:root {
  color-scheme: dark;
  --bg: #061018;
  --bg-deep: #030a10;
  --surface: #0b1a24;
  --surface-2: #102531;
  --surface-3: #15313e;
  --paper: #f7faf9;
  --paper-2: #eef4f3;
  --ink: #12252e;
  --ink-soft: #536a73;
  --text: #f2fafb;
  --text-soft: #b6cad1;
  --line-dark: #24404c;
  --line: #d6e1e0;
  --cyan: #72eadc;
  --cyan-deep: #087c78;
  --cyan-soft: #dff8f4;
  --amber: #f4b654;
  --amber-soft: #fff2d7;
  --red: #e86e70;
  --red-soft: #fde7e7;
  --green: #4cc39d;
  --green-soft: #dcf6ed;
  --shadow: 0 30px 80px rgba(0, 0, 0, .24);
  --radius: 22px;
  --radius-sm: 13px;
  --shell: 1480px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
  background: var(--bg-deep);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 86% 6%, rgba(63, 180, 181, .12), transparent 28rem),
    linear-gradient(180deg, var(--bg) 0 42rem, var(--paper-2) 42rem 100%);
  color: var(--text);
  line-height: 1.55;
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
a,
input,
textarea,
select,
summary {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 3px;
}

button {
  border: 0;
}

a {
  color: inherit;
}

img,
svg {
  max-width: 100%;
}

.shell {
  width: min(calc(100% - 40px), var(--shell));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  z-index: 999;
  top: 12px;
  left: 12px;
  padding: 10px 16px;
  border-radius: 9px;
  background: var(--cyan);
  color: var(--bg-deep);
  font-weight: 800;
  transform: translateY(-160%);
  transition: transform .18s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.site-header {
  position: relative;
  z-index: 20;
  min-height: 84px;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 28px;
  width: min(calc(100% - 40px), var(--shell));
  margin-inline: auto;
  border-bottom: 1px solid rgba(169, 220, 220, .16);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border: 1px solid rgba(114, 234, 220, .48);
  border-radius: 13px;
  background: linear-gradient(145deg, rgba(114, 234, 220, .19), rgba(114, 234, 220, .04));
  color: var(--cyan);
  font-size: .82rem;
  font-weight: 900;
  letter-spacing: .08em;
  box-shadow: inset 0 0 0 4px rgba(114, 234, 220, .035);
}

.brand > span:last-child {
  display: grid;
  line-height: 1.05;
}

.brand b {
  font-size: 1.02rem;
}

.brand small {
  margin-top: 5px;
  color: var(--text-soft);
  font-size: .73rem;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.chapalab-link,
.brand-banner-copy {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.chapalab-icon {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
}

.top-nav a,
.site-footer a,
.text-link {
  color: var(--text-soft);
  text-decoration: none;
  font-size: .84rem;
  font-weight: 700;
}

.top-nav a:hover,
.site-footer a:hover,
.text-link:hover {
  color: var(--cyan);
}

.language-switch {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line-dark);
  border-radius: 10px;
  background: rgba(4, 15, 22, .62);
}

.language-switch select {
  width: auto;
  min-width: 112px;
  border: 0;
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  font-size: .72rem;
  font-weight: 850;
}

[dir="rtl"] .section-tab,
[dir="rtl"] .field-heading,
[dir="rtl"] .source-grid,
[dir="rtl"] .material-grid,
[dir="rtl"] .legal-shell {
  text-align: right;
}

.language-switch button {
  min-width: 38px;
  padding: 6px 8px;
  border-radius: 7px;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  font-size: .72rem;
  font-weight: 850;
}

.language-switch button[aria-pressed="true"] {
  background: var(--cyan);
  color: var(--bg-deep);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.22fr) minmax(300px, .78fr);
  gap: clamp(36px, 7vw, 110px);
  align-items: end;
  padding-block: clamp(64px, 9vw, 126px) 72px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--cyan-deep);
  font-size: .7rem;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.hero .eyebrow,
.download-panel .eyebrow,
.hero-panel .eyebrow {
  color: var(--cyan);
}

.hero h1 {
  max-width: 950px;
  margin: 0;
  font-size: clamp(2.6rem, 6.1vw, 6.4rem);
  line-height: .94;
  letter-spacing: -.055em;
  text-wrap: balance;
}

.hero-lead {
  max-width: 780px;
  margin: 30px 0 0;
  color: var(--text-soft);
  font-size: clamp(1rem, 1.5vw, 1.3rem);
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
}

.trust-row span {
  padding: 8px 12px;
  border: 1px solid var(--line-dark);
  border-radius: 999px;
  background: rgba(15, 38, 49, .58);
  color: var(--text-soft);
  font-size: .72rem;
  font-weight: 760;
}

.trust-row span:first-child {
  border-color: rgba(114, 234, 220, .32);
  color: var(--cyan);
}

.hero-panel {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  padding: 24px;
  border: 1px solid rgba(244, 182, 84, .3);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(244, 182, 84, .1), rgba(16, 37, 49, .82));
  box-shadow: var(--shadow);
}

.warning-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--amber);
  color: #2b1a00;
  font-weight: 950;
}

.hero-panel h2 {
  margin: 0;
  font-size: 1.05rem;
}

.hero-panel p {
  margin: 8px 0 0;
  color: var(--text-soft);
  font-size: .88rem;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 20px;
  border: 1px solid var(--line-dark);
  border-radius: 18px;
  background: rgba(9, 26, 36, .9);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .18);
}

.toolbar > div,
.download-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 11px;
  cursor: pointer;
  text-decoration: none;
  font-size: .82rem;
  font-weight: 820;
  transition: transform .16s ease, border-color .16s ease, background .16s ease, opacity .16s ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: not-allowed;
  opacity: .46;
}

.button.primary {
  background: var(--cyan);
  color: #041014;
}

.button.secondary {
  border: 1px solid var(--line-dark);
  background: var(--surface-2);
  color: var(--text);
}

.builder-main .button.secondary,
.legal-page .button.secondary {
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}

.button.ghost {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-soft);
}

.button.ghost:hover {
  border-color: var(--line-dark);
  background: var(--surface-2);
  color: var(--text);
}

.button.small {
  min-height: 36px;
  padding: 7px 11px;
  font-size: .75rem;
}

.offline-notice {
  margin-top: 14px;
  margin-bottom: 0;
  color: #8199a2;
  font-size: .75rem;
}

.builder {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr) 292px;
  gap: 24px;
  align-items: start;
  padding-block: 48px 96px;
  color: var(--ink);
}

.builder-sidebar,
.preview-column {
  position: sticky;
  top: 18px;
}

.builder-sidebar {
  display: grid;
  gap: 14px;
}

.progress-card,
.profile-card,
.sources-card,
.builder-main {
  border: 1px solid var(--line);
  background: rgba(247, 250, 249, .96);
  box-shadow: 0 18px 45px rgba(17, 40, 48, .08);
}

.progress-card,
.profile-card,
.sources-card {
  padding: 17px;
  border-radius: 17px;
}

.status-counts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
}

.status-counts div {
  min-width: 0;
  padding: 9px 5px;
  border-radius: 11px;
  background: var(--paper-2);
  text-align: center;
}

.status-counts strong,
.status-counts span {
  display: block;
}

.status-counts strong {
  font-size: 1.3rem;
  line-height: 1;
}

.status-counts span {
  margin-top: 6px;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: .59rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.section-nav {
  display: grid;
  gap: 5px;
}

.section-tab {
  display: grid;
  grid-template-columns: 28px 1fr 8px;
  gap: 8px;
  align-items: center;
  width: 100%;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  text-align: left;
}

.section-tab > span {
  color: #8ca0a7;
  font-size: .63rem;
  font-weight: 850;
}

.section-tab b {
  min-width: 0;
  overflow: hidden;
  font-size: .78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.section-tab.active,
.section-tab:hover {
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}

.section-tab.active {
  box-shadow: 0 8px 20px rgba(19, 53, 62, .08);
}

.section-state {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.section-state.complete {
  background: var(--green);
}

.section-state.recommended {
  background: var(--amber);
}

.section-state.absent {
  background: var(--red);
}

.profile-card > span,
.profile-card > strong {
  display: block;
}

.profile-card > span {
  color: var(--ink-soft);
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.profile-card > strong {
  margin-top: 5px;
  font-size: .82rem;
}

.profile-card p {
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: .71rem;
}

.builder-main {
  min-width: 0;
  overflow: hidden;
  border-radius: var(--radius);
}

.section-header {
  padding: clamp(24px, 4vw, 44px);
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(114, 234, 220, .14), transparent 58%),
    #fff;
}

.section-header h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.8rem, 4vw, 3.4rem);
  line-height: 1;
  letter-spacing: -.04em;
}

.section-header p:last-child {
  max-width: 650px;
  margin: 14px 0 0;
  color: var(--ink-soft);
}

#dossier-form {
  padding: clamp(18px, 3vw, 36px);
  background: var(--paper);
}

.fields-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.field-card,
.material-card,
.publish-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.field-card {
  padding: 18px;
}

.field-card:has(textarea) {
  grid-column: 1 / -1;
}

.field-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.field-heading label,
.field-card > label,
.material-grid label,
.publish-card > label,
.source-grid label {
  display: grid;
  min-width: 0;
  gap: 6px;
  color: var(--ink);
  font-size: .78rem;
  font-weight: 780;
}

.required {
  margin-left: 4px;
  color: var(--red);
}

.field-help,
.microcopy {
  margin: 7px 0 13px;
  color: var(--ink-soft);
  font-size: .7rem;
}

input,
textarea,
select {
  width: 100%;
  min-width: 0;
  border: 1px solid #c7d6d7;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  padding: 10px 11px;
  font-size: .82rem;
  line-height: 1.4;
  transition: border-color .15s ease, box-shadow .15s ease;
}

textarea {
  resize: vertical;
}

input:hover,
textarea:hover,
select:hover {
  border-color: #91aaae;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--cyan-deep);
  box-shadow: 0 0 0 3px rgba(8, 124, 120, .12);
}

input[aria-invalid="true"] {
  border-color: var(--red);
  background: #fffafa;
}

.status-pill {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: .59rem;
  font-style: normal;
  font-weight: 900;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.status-pill.complete,
.preview-state.complete {
  background: var(--green-soft);
  color: #086b4f;
}

.status-pill.recommended,
.preview-state.recommended {
  background: var(--amber-soft);
  color: #875500;
}

.status-pill.absent {
  background: var(--red-soft);
  color: #9d282b;
}

.source-details {
  margin-top: 13px;
  border-top: 1px dashed var(--line);
  padding-top: 10px;
}

.source-details summary,
.sources-card summary {
  color: var(--cyan-deep);
  cursor: pointer;
  font-size: .69rem;
  font-weight: 850;
}

.source-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr .8fr;
  gap: 10px;
  margin-top: 12px;
}

.source-grid input,
.source-grid select {
  padding: 8px 9px;
  font-size: .73rem;
}

.section-intro {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin-bottom: 18px;
}

.section-intro > p {
  margin: 0;
  color: var(--ink-soft);
}

.composition-meter {
  flex: 0 0 auto;
  min-width: 160px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--cyan-soft);
}

.composition-meter span,
.composition-meter strong {
  display: block;
}

.composition-meter span {
  color: var(--cyan-deep);
  font-size: .65rem;
  font-weight: 800;
}

.composition-meter strong {
  margin-top: 2px;
  font-size: 1.2rem;
}

.materials-list,
.publish-stack {
  display: grid;
  gap: 15px;
  margin-bottom: 17px;
}

.material-card {
  padding: 17px;
}

.material-card header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.material-card header > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.material-index {
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.material-grid {
  display: grid;
  grid-template-columns: 1.5fr .7fr .7fr 1fr;
  gap: 11px;
}

.material-grid label:last-child {
  grid-column: 1 / -1;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 9px;
  background: var(--paper-2);
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 1.15rem;
}

.icon-button.danger:hover {
  background: var(--red-soft);
  color: #9d282b;
}

.empty-state {
  margin: 0 0 14px;
  padding: 18px;
  border: 1px dashed #bdcdce;
  border-radius: 13px;
  color: var(--ink-soft);
  text-align: center;
  font-size: .78rem;
}

.publish-card {
  padding: 21px;
}

.publish-card h3,
.download-panel h3,
.validation-panel h3 {
  margin: 0;
  font-size: 1.08rem;
}

.publish-card > p:not(.eyebrow) {
  margin: 7px 0 16px;
  color: var(--ink-soft);
  font-size: .78rem;
}

.attachment-list {
  display: grid;
  gap: 7px;
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
}

.attachment-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--paper-2);
}

.attachment-list span,
.attachment-list small {
  display: block;
  min-width: 0;
}

.attachment-list strong {
  display: block;
  overflow: hidden;
  font-size: .76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-list small {
  color: var(--ink-soft);
  font-size: .65rem;
}

.check-row {
  display: flex !important;
  grid-template-columns: auto 1fr;
  align-items: flex-start;
  gap: 10px !important;
  cursor: pointer;
  line-height: 1.45;
}

.check-row + .check-row {
  margin-top: 14px;
}

.check-row input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  margin: 1px 0 0;
  accent-color: var(--cyan-deep);
}

.check-row span {
  font-size: .78rem;
}

.qr-check {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 20px;
  align-items: center;
  margin-top: 18px;
}

.qr-display {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 10px;
}

.qr-display svg {
  display: block;
  width: 100%;
  height: auto;
}

.qr-placeholder,
.preview-qr-placeholder {
  display: grid;
  place-items: center;
  border: 2px dashed #b8c9ca;
  color: #8ba1a5;
  font-weight: 900;
}

.qr-placeholder {
  width: 70%;
  aspect-ratio: 1;
}

.qr-placeholder.error {
  color: var(--red);
}

.qr-check p {
  margin: 0 0 8px;
  font-size: .78rem;
  font-weight: 700;
}

.qr-check code {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
  margin-bottom: 12px;
  padding: 9px;
  border-radius: 8px;
  background: var(--paper-2);
  color: var(--ink-soft);
  font-size: .66rem;
}

.declaration-card {
  background: #fffaf0;
  border-color: #ecd8ae;
}

.download-panel {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 25px;
  padding: 23px;
  border-radius: 17px;
  background: var(--surface);
  color: var(--text);
}

.download-panel p:not(.eyebrow) {
  margin: 7px 0 0;
  color: var(--text-soft);
  font-size: .76rem;
}

.download-panel .button.secondary {
  border-color: var(--line-dark);
  background: var(--surface-2);
  color: var(--text);
}

.validation-panel {
  padding: 0 clamp(18px, 3vw, 36px) clamp(22px, 4vw, 40px);
  background: var(--paper);
}

.validation-panel > header {
  display: flex;
  justify-content: space-between;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.issue-list {
  display: grid;
  gap: 8px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.issue-list li {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
}

.issue-list li > span {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  font-weight: 900;
}

.issue-list li.absent > span {
  background: var(--red-soft);
  color: #9d282b;
}

.issue-list li.recommended > span {
  background: var(--amber-soft);
  color: #875500;
}

.issue-list strong,
.issue-list p {
  display: block;
  margin: 0;
}

.issue-list strong {
  font-size: .75rem;
}

.issue-list p {
  color: var(--ink-soft);
  font-size: .66rem;
}

.text-button {
  background: transparent;
  color: var(--cyan-deep);
  cursor: pointer;
  font-size: .67rem;
  font-weight: 850;
}

.validation-ok {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
  padding: 15px;
  border-radius: 12px;
  background: var(--green-soft);
  color: #086b4f;
  font-size: .78rem;
  font-weight: 750;
}

.validation-ok span {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: #fff;
}

.validation-ok p {
  margin: 0;
}

.preview-column {
  min-width: 0;
}

.preview-column > .eyebrow {
  color: var(--ink-soft);
}

.phone-frame {
  position: relative;
  padding: 9px;
  border: 1px solid #263d45;
  border-radius: 35px;
  background: #07141b;
  box-shadow: 0 30px 65px rgba(21, 47, 56, .22);
}

.phone-speaker {
  position: absolute;
  z-index: 2;
  top: 14px;
  left: 50%;
  width: 62px;
  height: 5px;
  border-radius: 999px;
  background: #1d343e;
  transform: translateX(-50%);
}

.phone-screen {
  min-height: 520px;
  overflow: hidden;
  border-radius: 27px;
  background: #f9fbfa;
  color: var(--ink);
}

.preview-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 27px 16px 12px;
  border-bottom: 1px solid var(--line);
  font-size: .56rem;
  font-weight: 900;
  letter-spacing: .1em;
}

.preview-state {
  padding: 3px 6px;
  border-radius: 999px;
  font-size: .5rem;
  letter-spacing: 0;
}

.preview-hero {
  padding: 22px 16px;
  background: linear-gradient(145deg, #0b2733, #0e4247);
  color: #fff;
}

.preview-hero p,
.preview-hero h3,
.preview-hero span {
  margin: 0;
}

.preview-hero p {
  color: var(--cyan);
  font-size: .58rem;
  font-weight: 850;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.preview-hero h3 {
  margin-top: 6px;
  font-size: 1.5rem;
  line-height: 1;
  letter-spacing: -.035em;
}

.preview-hero span {
  display: block;
  margin-top: 8px;
  color: #bcd2d7;
  font-size: .68rem;
}

.preview-fact,
.preview-section,
.preview-bottom {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.preview-fact span,
.preview-section > span {
  display: block;
  color: var(--ink-soft);
  font-size: .55rem;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.preview-fact strong {
  display: block;
  margin-top: 4px;
  font-size: .72rem;
}

.preview-section ul {
  margin: 7px 0 0;
  padding: 0;
  list-style: none;
}

.preview-section li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 0;
  font-size: .66rem;
}

.preview-section li span {
  color: var(--ink-soft);
}

.preview-bottom {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 12px;
  align-items: center;
}

.preview-bottom > div {
  aspect-ratio: 1;
}

.preview-bottom svg,
.preview-qr-placeholder {
  width: 100%;
  height: 100%;
}

.preview-bottom code {
  overflow-wrap: anywhere;
  color: var(--ink-soft);
  font-size: .52rem;
}

.preview-warning {
  margin: 0;
  padding: 12px 16px 18px;
  color: #875500;
  font-size: .57rem;
  font-weight: 750;
}

.sources-card {
  margin-top: 15px;
  color: var(--ink);
}

.sources-card p,
.sources-card li {
  color: var(--ink-soft);
  font-size: .65rem;
}

.sources-card ul {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.sources-card a {
  display: block;
  color: var(--cyan-deep);
  font-weight: 750;
  text-decoration: none;
}

.sources-card small {
  display: block;
  color: #8ba0a5;
}

.site-footer {
  border-top: 1px solid var(--line-dark);
  background: var(--bg-deep);
  color: var(--text-soft);
}

.site-footer .shell {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  padding-block: 36px;
}

.site-footer strong {
  color: var(--text);
}

.site-footer p {
  margin: 6px 0 0;
  font-size: .72rem;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
}

.brand-banner-copy .banner-icon {
  width: 38px;
  height: 38px;
}

.toast {
  position: fixed;
  z-index: 100;
  right: 18px;
  bottom: 18px;
  max-width: min(420px, calc(100% - 36px));
  padding: 13px 16px;
  border: 1px solid var(--line-dark);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
  font-size: .78rem;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity .18s ease, transform .18s ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.toast.success {
  border-color: rgba(76, 195, 157, .55);
}

.toast.error {
  border-color: rgba(232, 110, 112, .7);
}

.qa-report {
  position: fixed;
  z-index: -1;
  left: -10000px;
  top: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.capture-mode body {
  background: var(--paper-2);
}

.capture-mode .hero,
.capture-mode .toolbar,
.capture-mode .offline-notice {
  display: none;
}

.capture-mode .site-header {
  min-height: 66px;
  color: var(--text);
  width: 100%;
  padding-inline: 24px;
  background: var(--bg);
}

.capture-mode .builder {
  width: calc(100% - 30px);
  padding-block: 16px 30px;
}

.capture-mode .site-footer {
  display: none;
}

.legal-page {
  min-height: 100vh;
  background: var(--paper-2);
  color: var(--ink);
}

.legal-header {
  color: var(--text);
  background: var(--bg);
  width: 100%;
  padding-inline: max(20px, calc((100% - 1020px) / 2));
}

.legal-shell {
  width: min(calc(100% - 40px), 900px);
  margin: 0 auto;
  padding: clamp(48px, 9vw, 100px) 0;
}

.legal-shell h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(2.4rem, 6vw, 5rem);
  line-height: .98;
  letter-spacing: -.05em;
}

.legal-lead {
  max-width: 760px;
  color: var(--ink-soft);
  font-size: 1.15rem;
}

.legal-shell section {
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.legal-shell h2 {
  margin: 0;
}

.legal-shell section p {
  color: var(--ink-soft);
}

@media (max-width: 1240px) {
  .builder {
    grid-template-columns: 210px minmax(0, 1fr);
  }

  .preview-column {
    position: static;
    grid-column: 2;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 20px;
    align-items: start;
  }

  .preview-column > .eyebrow {
    grid-column: 1 / -1;
    margin-bottom: -10px;
  }

  .sources-card {
    margin-top: 0;
  }
}

@media (max-width: 920px) {
  body {
    background: linear-gradient(180deg, var(--bg) 0 48rem, var(--paper-2) 48rem 100%);
  }

  .top-nav {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 36px;
    padding-top: 64px;
  }

  .hero-panel {
    max-width: 720px;
  }

  .builder {
    grid-template-columns: 1fr;
  }

  .builder-sidebar,
  .preview-column {
    position: static;
  }

  .builder-sidebar {
    grid-template-columns: 1fr;
  }

  .section-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .profile-card {
    display: none;
  }

  .preview-column {
    grid-column: 1;
  }

  .source-grid {
    grid-template-columns: 1fr 1fr;
  }

  .source-grid label:last-child {
    grid-column: 1 / -1;
  }

  .material-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .download-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .shell,
  .site-header {
    width: min(calc(100% - 24px), var(--shell));
  }

  .site-header {
    min-height: 70px;
    grid-template-columns: 1fr auto;
    gap: 12px;
  }

  .brand small {
    display: none;
  }

  .hero {
    padding-top: 48px;
    padding-bottom: 52px;
  }

  .hero h1 {
    font-size: clamp(2.45rem, 14vw, 4.6rem);
  }

  .hero-panel {
    padding: 18px;
  }

  .toolbar,
  .site-footer .shell {
    display: grid;
  }

  .toolbar > div,
  .toolbar .button {
    width: 100%;
  }

  .section-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .section-tab {
    grid-template-columns: 24px 1fr 8px;
  }

  .fields-grid {
    grid-template-columns: 1fr;
  }

  .field-card:has(textarea) {
    grid-column: auto;
  }

  .section-intro,
  .download-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .composition-meter {
    min-width: 0;
  }

  .material-grid,
  .source-grid,
  .qr-check,
  .preview-column {
    grid-template-columns: 1fr;
  }

  .source-grid label:last-child {
    grid-column: auto;
  }

  .qr-display {
    max-width: 220px;
  }

  .download-actions .button {
    width: 100%;
  }

  .preview-column {
    max-width: 360px;
    justify-self: center;
    width: 100%;
  }

  .issue-list li {
    grid-template-columns: 26px 1fr;
  }

  .issue-list .text-button {
    grid-column: 2;
    justify-self: start;
    padding: 0;
  }

  .site-footer nav {
    margin-top: 10px;
  }
}

@media (max-width: 400px) {
  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .brand b {
    font-size: .9rem;
  }

  .language-switch button {
    min-width: 32px;
  }

  .section-nav {
    grid-template-columns: 1fr;
  }

  .section-tab b {
    white-space: normal;
  }

  .status-counts span {
    font-size: .53rem;
  }

  .field-card,
  .material-card,
  .publish-card {
    padding: 14px;
  }

  #dossier-form,
  .validation-panel {
    padding-inline: 12px;
  }

  .section-header {
    padding: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .001ms !important;
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media print {
  .site-header,
  .hero,
  .toolbar,
  .offline-notice,
  .builder-sidebar,
  .preview-column,
  .site-footer,
  .toast {
    display: none !important;
  }

  body {
    background: #fff;
  }

  .builder {
    display: block;
    width: 100%;
    padding: 0;
  }

  .builder-main {
    border: 0;
    box-shadow: none;
  }
}
