/* Email HTML stays inside a sandboxed frame; these rules apply only to the tool. */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scrollbar-gutter: stable; }
body { margin: 0; background: var(--ric-bg-secondary); color: var(--ric-text-primary); font: var(--ric-font-body-m); font-family: 'Open Sans', sans-serif; color-scheme: light; }
body.ric-theme-dark { color-scheme: dark; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
button, input, textarea { font-family: inherit; }
a { color: var(--ric-text-link-hover); }
.sg-shell { width: min(1200px, 100%); margin-inline: auto; padding: 0 32px; }
.sg-header { min-height: 88px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--ric-border-primary); }
.sg-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ric-text-primary); font-weight: 600; font-size: 18px; }
.sg-brand-caption { display: block; font: var(--ric-font-body-s); font-family: inherit; color: var(--ric-text-secondary); }
.sg-intro { padding: 40px 0 32px; }
.sg-eyebrow { font: var(--ric-font-header-s); font-family: inherit; color: var(--ric-text-secondary); margin-bottom: 8px; }
h1 { font: var(--ric-font-header-2xl); font-family: inherit; margin-bottom: 12px; }
.sg-intro > p:last-child { color: var(--ric-text-secondary); }
.sg-workspace { display: grid; grid-template-columns: 1fr 1.2fr; gap: 24px; align-items: start; }
.sg-panel { padding: 24px; border: 1px solid var(--ric-border-primary); border-radius: 8px; background: var(--ric-bg-primary); min-width: 0; }
.sg-panel-heading { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 24px; }
.sg-step { background: var(--ric-bg-secondary); color: var(--ric-text-secondary); border: 1px solid var(--ric-border-primary); border-radius: 8px; padding: 6px; font: var(--ric-font-header-s); font-family: inherit; }
h2 { font: var(--ric-font-header-l); font-family: inherit; }
.sg-panel-heading p, .sg-code-heading p { margin-top: 4px; color: var(--ric-text-secondary); font: var(--ric-font-body-s); font-family: inherit; }
.sg-fields { display: grid; gap: 16px; }
.sg-field { display: grid; gap: 6px; }
.sg-field label { font: var(--ric-font-label-m); font-family: inherit; }
.sg-field label span { color: var(--ric-text-secondary); }
/* rc31's default primary fill is 3.53:1 with white; the hover role gives 4.91:1. */
.ric-btn-primary { background-color: var(--ric-bg-btn-primary-hover); }
.sg-field input::placeholder, .sg-code::placeholder { color: var(--ric-text-secondary); }
.sg-field-error, .sg-message { color: var(--ric-text-critical); font: var(--ric-font-body-s); font-family: inherit; }
.sg-field input[aria-invalid=true] { border-color: var(--ric-text-critical); }
.sg-form-footer { display: grid; gap: 12px; margin-top: 24px; }
.sg-form-footer .ric-btn { width: 100%; justify-content: center; }
.sg-results { display: grid; gap: 16px; min-width: 0; }
/* The exported email has literal colours and a natural width; do not restyle its table. */
.sg-paper { border: 1px solid var(--ric-border-primary); border-radius: 8px; overflow: hidden; background: var(--ric-color-grey-0); }
.sg-empty { min-height: 224px; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 8px; padding: 24px; text-align: center; color: var(--ric-color-grey-700); }
.sg-empty > p { font-weight: 600; }
.sg-empty > span { font: var(--ric-font-body-s); font-family: inherit; }
#signature-preview { display: block; width: 100%; height: 224px; border: 0; color-scheme: light; }
.sg-result-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; }
.sg-result-footer p { color: var(--ric-text-secondary); font: var(--ric-font-body-s); font-family: inherit; }
.sg-result-footer .ric-btn { flex-shrink: 0; }
.sg-code-heading { display: flex; justify-content: space-between; align-items: start; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
#byte-count { font: var(--ric-font-body-s); font-family: inherit; color: var(--ric-text-secondary); font-variant-numeric: tabular-nums; }
.sg-code { height: 148px; resize: vertical; font: 12px/20px Consolas, monospace; overflow-wrap: anywhere; }
.sg-notice { display: grid; grid-template-columns: 20px 1fr; gap: 12px; padding: 16px; border: 1px solid var(--ric-border-primary); border-radius: 8px; background: var(--ric-bg-helper); }
.sg-notice > svg { margin-top: 2px; color: var(--ric-icon-primary); }
.sg-notice h3 { font: var(--ric-font-header-m); font-family: inherit; margin-bottom: 4px; }
.sg-notice p { font: var(--ric-font-body-s); font-family: inherit; color: var(--ric-text-secondary); }
.sg-instructions { margin-top: 40px; }
.sg-instructions > h2 { margin-bottom: 16px; }
details { border-bottom: 1px solid var(--ric-border-primary); padding: 16px 0; }
summary { cursor: pointer; font-weight: 600; }
details p, details ol { margin-top: 12px; color: var(--ric-text-secondary); }
details ol { padding-left: 24px; margin-bottom: 0; }
details li + li { margin-top: 8px; }
video { display: block; width: 100%; margin-top: 16px; border-radius: 8px; }
.sg-footer { margin-top: 40px; padding: 24px 0; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; color: var(--ric-text-secondary); font: var(--ric-font-body-s); font-family: inherit; }
:focus-visible { outline: 2px solid var(--ric-border-interactive); outline-offset: 3px; }
.sg-field input:focus-visible { outline: 2px solid var(--ric-border-interactive); outline-offset: 2px; }
@media (max-width: 840px) {
  .sg-shell { padding-inline: 20px; }
  .sg-workspace { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 480px) {
  .sg-shell { padding-inline: 16px; }
  .sg-header { min-height: 80px; }
  .sg-brand-caption { display: none; }
  .sg-intro { padding: 28px 0 24px; }
  .sg-panel { padding: 16px; }
  .sg-panel-heading { margin-bottom: 20px; }
  .sg-result-footer { align-items: stretch; flex-direction: column; }
  .sg-result-footer .ric-btn { width: 100%; justify-content: center; }
}
