:root {
  color-scheme: light;
  font-family: "Inter", system-ui, sans-serif;
  color: #182837;
  background: #fafafa;
  line-height: 1.55;
  --navy: #122639;
  --brand-accent: #d63031;
  --brand-accent-hover: #b71c1c;
  --line: #dce5ec;
  --muted: #455b6b;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .55; cursor: wait; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid #207cc0;
  outline-offset: 3px;
}
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -.02em; }
h1 { font-size: clamp(1.9rem, 4vw, 3rem); }
h2 { font-size: 1.35rem; margin-bottom: 1rem; }
h3 { font-size: 1.05rem; margin-bottom: .45rem; }
p { margin: .6rem 0 1rem; }
[hidden] { display: none !important; }
.topbar {
  padding: .9rem max(1.25rem, calc((100vw - 78rem) / 2));
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  color: #1d1d1f; background: #fff; border-bottom: 1px solid #e5e5e7;
}
.brand { display: flex; align-items: center; gap: .75rem; font-weight: 700; }
.brand img { display: block; flex: none; }
.brand span { border-left: 1px solid #e5e5e7; padding-left: .75rem; line-height: 1.25; }
.shell { margin-inline: auto; max-width: 80rem; padding: 2.4rem 1.25rem 5rem; }
.card {
  border: 1px solid var(--line); border-radius: .9rem; padding: clamp(1rem, 3vw, 1.75rem);
  background: #fff; box-shadow: 0 5px 22px #16354b0d; min-width: 0;
}
.auth { display: grid; grid-template-columns: 1fr minmax(16rem, 28rem); align-items: center; gap: 3rem; max-width: 66rem; padding-top: clamp(2rem, 9vh, 7rem); }
.intro { padding: clamp(1rem, 4vw, 2.5rem); background: #ffeaea; border-radius: .9rem; }
.intro h1 { max-width: 15ch; }
.intro p { max-width: 36ch; color: var(--muted); }
.intro .scope { margin-bottom: 0; color: #115448; font-weight: 650; }
.sample-form-link { display: inline-block; margin-top: 1rem; font-size: .9rem; }
.sidebar .sample-form-link { color: #bdebdc; }
.dashboard { display: grid; grid-template-columns: 1.3fr 1fr; gap: 1.25rem; align-items: start; margin-top: 1.4rem; }
.draft-link {
  display: flex; justify-content: space-between; align-items: center; gap: .75rem;
  text-align: left; width: 100%; padding: .7rem .9rem; margin-top: .7rem;
  border: 1px solid var(--line); border-radius: .45rem; background: #f2f7fa; color: var(--navy); font-weight: 650;
}
.badge { border-radius: 2rem; background: #dbece6; color: #17483e; padding: .15rem .6rem; font-size: .875rem; }
.hint, .muted { color: var(--muted); }
.hint { font-size: .9rem; margin: .35rem 0; }
.row-date { padding-inline: .9rem; }
.field { margin-bottom: 1.1rem; }
.field label { display: block; font-weight: 650; margin-bottom: .3rem; }
.field-heading { display: flex; align-items: center; flex-wrap: wrap; gap: .25rem .6rem; margin-bottom: .35rem; }
.field-heading > label, .field-heading > h3 { margin: 0; }
.field-help-toggle {
  display: inline-grid; place-items: center; inline-size: 1.5rem; block-size: 1.5rem;
  padding: 0; border: 0; border-radius: 50%; position: relative;
  background: transparent; color: var(--muted); font-size: .75rem; font-weight: 650; line-height: 1;
}
.field-help-toggle::before {
  content: ""; position: absolute; inset: .1875rem; border: 1px solid #afbec8; border-radius: 50%;
}
.field-help-toggle:hover, .field-help-toggle[aria-expanded="true"] { background: #eaf2f5; color: #185d70; }
.field-help-panel {
  margin-bottom: .65rem; padding: .5rem .75rem; border-left: 3px solid #207789;
  background: #edf5f8; color: var(--navy); font-size: .9rem; overflow-wrap: anywhere;
}
.field-help-panel p { margin: 0; }
.field-help-panel a { display: inline-block; margin-top: .35rem; color: #185d70; }
input, select, textarea { width: 100%; min-height: 2.6rem; border: 1px solid #aabbc7; border-radius: .42rem; padding: .48rem .65rem; background: #fff; color: inherit; }
textarea { resize: vertical; }
select { appearance: none; padding-right: 2rem; background: linear-gradient(45deg, transparent 50%, #3e5564 50%) calc(100% - 16px) center / 6px 6px no-repeat, linear-gradient(135deg, #3e5564 50%, transparent 50%) calc(100% - 10px) center / 6px 6px no-repeat, #fff; }
.primary, .secondary, .quiet { padding: .48rem .86rem; border: 1px solid transparent; border-radius: .42rem; font-weight: 650; }
.primary { background: var(--brand-accent); color: #fff; }
.primary:hover { background: var(--brand-accent-hover); }
.secondary { background: #fff; color: var(--navy); border-color: #afbec8; }
.secondary:hover, .draft-link:hover { background: #eaf2f5; }
.quiet { color: #185d70; background: transparent; padding-inline: .35rem; }
.quiet:hover { text-decoration: underline; }
.actions { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.workspace { display: grid; grid-template-columns: minmax(13rem, 17rem) minmax(0, 1fr); gap: 1.35rem; align-items: start; }
.sidebar { position: sticky; top: 1.2rem; padding: 1.05rem; background: var(--navy); color: #fff; border-radius: .75rem; }
.sidebar .quiet { color: #bdebdc; }
.progress-label { margin-bottom: .4rem; font-weight: 650; }
progress { width: 100%; height: .75rem; border: 0; accent-color: #79d8b9; }
.sidebar nav { display: grid; gap: .35rem; margin-top: .9rem; }
.section-button { display: grid; gap: .18rem; text-align: left; color: #fff; padding: .65rem .7rem; border: 1px solid transparent; background: transparent; border-radius: .4rem; }
.section-button:hover, .section-button[aria-current] { background: #284758; border-color: #466574; }
.section-count { font-size: .875rem; color: #c3d8e1; }
.workspace-main { display: grid; gap: 1.1rem; }
.editor-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .75rem; overflow-wrap: anywhere; }
.section-fields { padding: 0; border: 0; min-width: 0; margin: 0; }
#section-title {
  color: var(--navy); font-size: clamp(1.5rem, 3vw, 1.85rem);
  padding-bottom: .75rem; border-bottom: 2px solid var(--line);
}
.draft-group-title, .draft-subgroup-title { margin: 0 0 .55rem; line-height: 1.25; }
.field-heading > :is(.draft-group-title, .draft-subgroup-title) { margin: 0; }
.draft-group-title { color: var(--brand-accent); font-size: 1.2rem; font-weight: 750; }
.draft-subgroup-title { color: var(--navy); font-size: 1rem; font-weight: 700; }
.node > .node + .node { margin-top: .7rem; }
.collection, .entry { border: 1px solid var(--line); padding: .85rem; margin: .8rem 0; border-radius: .45rem; }
.collection { background: #f5f8fa; }
.entry { background: #fff; }
.review summary { cursor: pointer; font-weight: 700; }
.review li { margin-block: .45rem; overflow-wrap: anywhere; }
#snapshots { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .6rem; }
#notice { position: fixed; bottom: 1rem; right: 1rem; max-width: min(29rem, calc(100% - 2rem)); z-index: 1; color: #fff; background: #154438; border: 1px solid #4fb598; padding: .8rem 1rem; border-radius: .55rem; box-shadow: 0 6px 24px #142b3f33; }
#notice.error { background: #752b34; border-color: #b9505b; }
@media (max-width: 45rem) {
  .auth, .dashboard, .workspace { grid-template-columns: 1fr; gap: 1rem; }
  .sidebar { position: static; }
  .sidebar nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shell { padding-top: 1.2rem; }
}
.group { border-left: 2px solid var(--line); margin-block: 1rem; padding-left: .8rem; }
.group > .field-heading { margin-bottom: .75rem; }
.signature-drawing { margin-bottom: 1.25rem; }
.signature-pad {
  display: block; width: 100%; max-width: 45rem; height: auto;
  border-radius: .45rem; background: #fff; box-shadow: 0 0 0 1px #aabbc7;
  cursor: crosshair; touch-action: none;
}
.signature-drawing .actions { margin-top: .85rem; }
.signature-preview {
  display: block; max-width: 100%; max-height: 8rem; margin-block: .6rem;
  padding: .35rem; border: 1px solid var(--line); border-radius: .4rem; background: #fff;
}
.field-error { color: #8c2632; font-size: .9rem; margin: .4rem 0 1rem; }
[aria-invalid="true"] { border-color: #a6404c; }
.review .issue-list { list-style: none; padding: 0; margin: .65rem 0 0; }
.issue-list > li + li { border-top: 1px solid var(--line); }
.issue-link {
  display: grid; gap: .15rem; width: 100%; padding: .6rem .65rem;
  text-align: left; line-height: 1.4;
}
.issue-link:hover { background: #f5f8fa; text-decoration: none; }
.issue-link:hover .issue-path { text-decoration: underline; }
.issue-path { color: var(--navy); font-weight: 700; }
.issue-problem { color: #8c2632; font-size: .9rem; white-space: pre-wrap; }
.issue-guidance { color: var(--muted); font-size: .9rem; font-weight: 400; }
.site-info { display: flex; align-items: start; flex-wrap: wrap; gap: 1.25rem; padding-bottom: 2rem; }
.site-info details { max-width: 45rem; }
.site-info summary { cursor: pointer; }
.recovery-card { max-width: 40rem; margin-inline: auto; }
.copy-codes { padding: .25rem .6rem; font-size: .875rem; }
.recovery-code-sheet { padding: .85rem; background: #f5f8fa; border: 1px solid var(--line); border-radius: .45rem; }
.recovery-username { margin: 0; overflow-wrap: anywhere; }
.recovery-codes {
  display: grid; gap: .35rem; list-style: none; padding: 0;
}
.recovery-codes li { padding: .35rem .55rem; background: #edf3f5; border-radius: .25rem; overflow-wrap: anywhere; }
.recovery-confirmation { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .75rem; margin-top: 1rem; }
.recovery-confirmation-label { display: flex; align-items: center; gap: .5rem; font-weight: 650; cursor: pointer; }
.recovery-confirmation-label input { flex: none; width: 1.125rem; height: 1.125rem; min-height: 0; margin: 0; accent-color: var(--brand-accent); }
.recovery-confirmation .primary:disabled { cursor: default; }


.merge-conflict { margin-block: 0.8rem; padding: 0.75rem; border: 1px solid var(--line, #ddd); border-radius: 0.5rem; }
.merge-comparison { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); gap: 1rem; }
.merge-answer { white-space: pre-wrap; overflow-wrap: anywhere; }
