:root {
  --bg: #f8faf7;
  --surface: #ffffff;
  --surface-2: #f0f3ee;
  --ink: #101915;
  --muted: #59645e;
  --border: #c8d0c7;
  --green: #173f35;
  --green-2: #286452;
  --blue: #1b5d7a;
  --burgundy: #7c2434;
  --gold: #b08b3f;
  --focus: #004bcc;
  --shadow: 0 18px 46px rgba(16, 25, 21, 0.1);
  --base-font: 18px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: var(--base-font);
  letter-spacing: 0;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
}

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

button {
  cursor: pointer;
}

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

svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: 16px;
  z-index: 50;
  transform: translateY(-160%);
  background: var(--ink);
  color: white;
  padding: 12px 16px;
  border-radius: 8px;
}

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

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 290px 1fr;
  padding-bottom: 76px;
}

.app-shell[data-font-size="large"] {
  --base-font: 20px;
}

.app-shell[data-font-size="xlarge"] {
  --base-font: 22px;
}

body.high-contrast {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #eeeeee;
  --ink: #000000;
  --muted: #222222;
  --border: #000000;
  --green: #003d2c;
  --green-2: #00553e;
  --burgundy: #6f001d;
  --gold: #7a5700;
  --shadow: none;
}

.side-nav {
  position: sticky;
  top: 0;
  min-height: calc(100vh - 76px);
  border-right: 1px solid var(--border);
  background: var(--surface);
  padding: 24px 18px;
  min-width: 0;
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.brand-mark {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--green);
  border-radius: 8px;
}

.brand-mark svg {
  width: 34px;
  height: 34px;
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  font-size: 1.08rem;
}

.brand span {
  color: var(--muted);
  font-size: 0.88rem;
  margin-top: 4px;
}

.nav-list {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.nav-item {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  padding: 10px 12px;
  text-align: left;
}

.nav-item:hover,
.nav-item.is-active {
  background: var(--surface-2);
  border-color: var(--border);
}

.nav-item.is-active {
  color: var(--green);
  font-weight: 700;
}

.icon {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
}

.main {
  padding: 30px;
}

.landing-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.85fr);
  gap: 34px;
  align-items: stretch;
  min-height: min(560px, calc(100vh - 190px));
  margin-bottom: 24px;
  padding: clamp(26px, 5vw, 62px);
  border: 1px solid var(--border);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(23, 63, 53, 0.08), transparent 45%),
    linear-gradient(180deg, #ffffff 0%, #f3f6f1 100%);
  box-shadow: var(--shadow);
  scroll-margin-top: 20px;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.status-line {
  margin: 0 0 8px;
  color: var(--burgundy);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.78rem;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: clamp(2.25rem, 5vw, 4.9rem);
  line-height: 1.04;
  letter-spacing: 0;
}

.intro {
  max-width: 940px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: clamp(1.08rem, 1.7vw, 1.42rem);
  line-height: 1.5;
}

.hero-founder {
  max-width: 760px;
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.hero-founder strong {
  color: var(--green);
  font-size: 1.08rem;
}

.hero-founder span,
.hero-note {
  color: var(--muted);
  line-height: 1.45;
}

.hero-note {
  max-width: 760px;
  margin: 14px 0 0;
  padding-left: 16px;
  border-left: 4px solid var(--gold);
  font-weight: 700;
}

.hero-actions {
  display: grid;
  grid-template-columns: minmax(230px, 260px) repeat(2, minmax(112px, 126px));
  gap: 12px;
  margin-top: 28px;
  padding-bottom: 18px;
}

.link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  text-decoration: none;
}

.hero-actions .primary-btn {
  min-width: min(100%, 260px);
  min-height: 68px;
  padding-inline: 28px;
  font-size: 1.18rem;
  box-shadow: 0 16px 34px rgba(23, 63, 53, 0.22);
}

.hero-actions .secondary-btn {
  min-height: 54px;
  min-width: 116px;
}

.hero-board {
  align-self: center;
  min-height: 390px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 18px;
  border: 1px solid rgba(23, 63, 53, 0.28);
  border-radius: 8px;
  background: #ffffff;
  padding: 22px;
  box-shadow: 0 22px 60px rgba(16, 25, 21, 0.16);
}

.board-topline {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-weight: 800;
}

.board-topline strong {
  color: var(--green);
}

.board-document {
  display: grid;
  align-content: center;
  gap: 18px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(27, 93, 122, 0.08), transparent 55%),
    var(--surface-2);
}

.board-document span {
  display: block;
  height: 18px;
  border-radius: 8px;
  background: rgba(23, 63, 53, 0.2);
}

.board-document span:nth-child(1) {
  width: 86%;
  height: 28px;
  background: var(--green);
}

.board-document span:nth-child(2) {
  width: 72%;
}

.board-document span:nth-child(3) {
  width: 93%;
}

.board-document span:nth-child(4) {
  width: 58%;
  background: rgba(124, 36, 52, 0.26);
}

.board-flow {
  display: grid;
  gap: 10px;
}

.board-flow div {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 10px;
  align-items: center;
  min-height: 48px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
}

.board-flow strong {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--green);
  color: #ffffff;
}

.board-flow span {
  color: var(--ink);
  font-weight: 800;
  line-height: 1.25;
}

.trust-box {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 10px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  padding: 18px;
}

.trust-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--green-2);
}

.trust-box span:last-child {
  grid-column: 2;
  color: var(--muted);
  font-size: 0.9rem;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 22px;
  align-items: start;
}

.disclosure-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.85fr);
  gap: 22px;
  align-items: start;
  border: 2px solid var(--burgundy);
  border-radius: 8px;
  background: #fffafb;
  padding: 20px;
  margin-bottom: 24px;
}

.disclosure-panel h2 {
  margin-bottom: 8px;
  font-size: 1.3rem;
}

.disclosure-panel p {
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 0;
}

.disclosure-link {
  margin-top: 12px !important;
}

.disclosure-link a,
.doc-link,
.hero-founder a,
.founder-section a {
  color: var(--green);
  font-weight: 800;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.disclosure-grid {
  display: grid;
  gap: 10px;
}

.disclosure-grid div {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px 14px;
}

.disclosure-grid strong,
.disclosure-grid span {
  display: block;
}

.disclosure-grid strong {
  margin-bottom: 4px;
  color: var(--burgundy);
}

.disclosure-grid span {
  color: var(--muted);
  line-height: 1.4;
  font-size: 0.92rem;
}

.founder-section,
.movement-section {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  padding: clamp(22px, 3.5vw, 34px);
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.founder-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 24px;
  align-items: center;
}

.founder-section h2,
.movement-section h2 {
  margin-bottom: 12px;
  font-size: clamp(1.7rem, 3vw, 2.55rem);
  line-height: 1.08;
}

.founder-section p,
.movement-section p {
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 12px;
}

.founder-section p:last-child,
.movement-section p:last-child {
  margin-bottom: 0;
}

.founder-card {
  border-left: 6px solid var(--blue);
  border-radius: 8px;
  background: #f3f8fa;
  padding: 20px;
}

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

.founder-card strong {
  margin-bottom: 8px;
  color: var(--blue);
}

.founder-card span {
  color: var(--muted);
  line-height: 1.45;
}

.movement-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.movement-grid article {
  min-height: 170px;
  border-top: 5px solid var(--green);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 18px;
}

.movement-grid article:nth-child(2) {
  border-top-color: var(--burgundy);
}

.movement-grid article:nth-child(3) {
  border-top-color: var(--blue);
}

.movement-grid h3 {
  margin-bottom: 8px;
  font-size: 1.12rem;
}

.task-panel,
.guide-panel {
  min-width: 0;
}

.section-heading h2 {
  margin-bottom: 7px;
  font-size: 1.5rem;
}

.section-heading p {
  color: var(--muted);
  line-height: 1.45;
}

.compact h2 {
  font-size: 1.25rem;
}

.task-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.task-card {
  min-height: 136px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 20px;
  text-align: left;
  box-shadow: 0 2px 0 rgba(16, 25, 21, 0.03);
}

.task-card:hover,
.task-card.is-selected {
  border-color: var(--green);
  box-shadow: var(--shadow);
}

.task-card.is-selected {
  background: #f4faf5;
}

body.high-contrast .task-card.is-selected {
  background: #ffffff;
  outline: 3px solid var(--green);
}

.task-icon {
  width: 42px;
  height: 42px;
  color: var(--green);
  flex: 0 0 auto;
}

.task-card strong,
.task-card small {
  display: block;
}

.task-card strong {
  margin-bottom: 8px;
  font-size: 1.12rem;
  line-height: 1.18;
}

.task-card small {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.35;
}

.flow-card,
.guide-panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.flow-card {
  padding: 22px;
}

.flow-header {
  display: flex;
  gap: 14px;
  justify-content: space-between;
  align-items: start;
  border-bottom: 1px solid var(--border);
  padding-bottom: 18px;
  margin-bottom: 20px;
}

.flow-label {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
  margin-bottom: 4px;
}

#flow-title {
  margin-bottom: 0;
  font-size: 1.45rem;
}

.state-chip {
  white-space: nowrap;
  border: 1px solid var(--gold);
  border-radius: 8px;
  color: #5f4300;
  background: #fff8e3;
  padding: 8px 10px;
  font-size: 0.82rem;
  font-weight: 800;
}

.flow-body {
  display: grid;
  gap: 18px;
}

.drop-zone,
.dictation-box,
.form-grid,
.verification-list {
  border: 2px dashed var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 20px;
}

.drop-zone {
  min-height: 178px;
  display: grid;
  place-items: center;
  text-align: center;
}

.drop-zone strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1.12rem;
}

.drop-zone p,
.dictation-box p,
.assist-note p {
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 0;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.primary-btn,
.secondary-btn,
.bar-btn,
.icon-btn {
  min-height: 48px;
  border-radius: 8px;
  border: 1px solid var(--green);
  padding: 10px 16px;
  font-weight: 800;
}

.primary-btn {
  background: var(--green);
  color: white;
}

.secondary-btn,
.bar-btn,
.icon-btn {
  background: var(--surface);
  color: var(--green);
}

.primary-btn:hover,
.secondary-btn:hover,
.bar-btn:hover,
.icon-btn:hover {
  filter: brightness(0.96);
}

.assist-note {
  border-left: 5px solid var(--burgundy);
  background: #fff7f8;
  padding: 14px 16px;
}

.assist-note strong {
  display: block;
  margin-bottom: 4px;
}

.result-preview {
  display: grid;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
}

.result-preview h3 {
  margin-bottom: 0;
  font-size: 1.04rem;
}

.result-preview ul {
  margin: 0;
  padding-left: 22px;
  line-height: 1.55;
}

.dictation-box textarea,
.form-grid input,
.form-grid select,
.form-grid textarea {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  color: var(--ink);
  background: var(--surface);
}

.dictation-box textarea,
.form-grid textarea {
  min-height: 120px;
  resize: vertical;
}

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

.form-grid label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 700;
}

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

.verification-list {
  display: grid;
  gap: 12px;
  list-style: none;
  margin: 0;
  padding: 18px;
}

.verification-list li {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  align-items: start;
}

.checkmark {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: white;
  background: var(--green);
  font-size: 0.84rem;
  font-weight: 900;
}

.guide-panel {
  padding: 20px;
  position: sticky;
  top: 24px;
}

.steps {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  display: grid;
  gap: 10px;
}

.steps li {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border-radius: 8px;
  color: var(--muted);
}

.steps li span {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-weight: 900;
}

.steps li.is-current {
  background: var(--surface-2);
  color: var(--ink);
  font-weight: 800;
}

.steps li.is-current span {
  background: var(--green);
  color: white;
  border-color: var(--green);
}

.source-status {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
  margin: 16px 0;
}

.source-status h3 {
  font-size: 1.05rem;
  margin-bottom: 8px;
}

.source-status p {
  color: var(--muted);
  line-height: 1.45;
}

.status-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 0;
}

.status-row strong {
  color: var(--burgundy);
}

.guide-actions {
  display: grid;
  gap: 10px;
}

.access-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  min-height: 76px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: center;
  border-top: 2px solid var(--border);
  background: var(--surface);
  padding: 10px 16px;
}

.access-group,
.toggle {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.toggle input {
  width: 24px;
  height: 24px;
}

.icon-btn {
  min-width: 56px;
  padding-inline: 10px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 92px;
  z-index: 60;
  max-width: min(420px, calc(100vw - 36px));
  border-radius: 8px;
  background: var(--ink);
  color: white;
  padding: 14px 16px;
  box-shadow: var(--shadow);
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease, transform 150ms ease;
}

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

.doc-page {
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  padding-bottom: 32px;
}

.doc-header,
.doc-main {
  width: min(1080px, calc(100% - 40px));
  margin: 0 auto;
}

.doc-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 28px 0 20px;
  border-bottom: 1px solid var(--border);
}

.doc-brand {
  display: flex;
  gap: 14px;
  align-items: center;
}

.doc-brand .brand-mark {
  width: 50px;
  height: 50px;
}

.doc-brand strong,
.doc-brand span {
  display: block;
}

.doc-brand span {
  color: var(--muted);
  margin-top: 3px;
}

.doc-main {
  padding-top: 34px;
}

.doc-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 26px;
  align-items: start;
  margin-bottom: 26px;
}

.doc-hero h1 {
  font-size: clamp(2rem, 5vw, 3.1rem);
}

.doc-hero p {
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.55;
}

.doc-summary,
.doc-section {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  padding: 20px;
  box-shadow: var(--shadow);
}

.doc-summary h2,
.doc-section h2 {
  font-size: 1.35rem;
}

.doc-summary ul,
.doc-section ul,
.doc-section ol {
  margin-bottom: 0;
  padding-left: 24px;
  line-height: 1.6;
}

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

.doc-section {
  margin-bottom: 16px;
}

.mode-card {
  border-left: 6px solid var(--green);
}

.warning-card {
  border-left: 6px solid var(--burgundy);
}

.doc-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}

.doc-table th,
.doc-table td {
  border: 1px solid var(--border);
  padding: 12px;
  text-align: left;
  vertical-align: top;
}

.doc-table th {
  background: var(--surface-2);
}

.simple-flow {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.simple-flow div {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 14px;
}

@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .side-nav {
    position: static;
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

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

  .nav-item {
    justify-content: center;
    flex-direction: column;
    min-height: 82px;
    text-align: center;
  }

  .landing-hero,
  .disclosure-panel,
  .founder-section,
  .workspace {
    grid-template-columns: 1fr;
  }

  .landing-hero {
    min-height: auto;
  }

  .hero-board {
    min-height: 340px;
  }

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

  .guide-panel {
    position: static;
  }
}

@media (max-width: 720px) {
  .main {
    padding: 18px;
  }

  .landing-hero {
    padding: 22px;
  }

  .hero-actions {
    display: grid;
  }

  .hero-founder {
    grid-template-columns: 1fr;
  }

  .link-btn {
    width: 100%;
  }

  .hero-actions .primary-btn {
    min-height: 74px;
    font-size: 1.34rem;
  }

  .hero-actions .secondary-btn {
    min-height: 62px;
    font-size: 1.08rem;
  }

  .hero-board {
    min-height: 300px;
    padding: 16px;
  }

  .side-nav {
    padding: 16px;
  }

  .brand {
    padding-bottom: 16px;
  }

  .nav-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    overflow-x: visible;
    padding-bottom: 0;
    width: 100%;
  }

  .nav-item {
    min-height: 62px;
    flex-direction: row;
    justify-content: flex-start;
    padding: 9px 10px;
    text-align: left;
  }

  .nav-item .icon {
    width: 25px;
    height: 25px;
  }

  .task-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .flow-header {
    display: grid;
  }

  .state-chip {
    width: fit-content;
  }

  .access-bar {
    justify-content: flex-start;
  }

  .doc-header,
  .doc-main {
    width: min(100% - 28px, 1080px);
  }

  .doc-header,
  .doc-hero {
    display: grid;
    grid-template-columns: 1fr;
  }

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

  .doc-table {
    display: block;
    overflow-x: auto;
  }
}

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