:root {
  color-scheme: light;
  font-family: "Segoe UI", "Microsoft YaHei", "Yu Gothic UI", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  color: #172522;
  background: #f5f6f3;
  letter-spacing: 0;
  --color-canvas: #f5f6f3;
  --color-surface: #ffffff;
  --color-surface-muted: #f1f4f1;
  --color-text: #172522;
  --color-text-muted: #566661;
  --color-border: #c8d1cd;
  --color-primary: #0e5a52;
  --color-primary-strong: #09483f;
  --color-primary-soft: #e7f1ee;
  --color-success: #256a4b;
  --color-success-soft: #e5f2e9;
  --color-warning: #78530b;
  --color-warning-soft: #fff1c9;
  --color-review: #5b4b77;
  --color-review-soft: #eee9f5;
  --color-danger: #8a341f;
  --color-focus: #9b6500;
  --space-1: 6px;
  --space-2: 10px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 32px;
  --space-6: 48px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --shadow-soft: 0 12px 35px rgba(25, 49, 43, 0.07);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--color-canvas);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
}

button,
select,
textarea,
input {
  font: inherit;
  letter-spacing: 0;
}

.app-header {
  border-bottom: 1px solid #cbd3d1;
  background: #ffffff;
}

.header-inner {
  width: min(1180px, calc(100% - 40px));
  min-height: 76px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
}

.product-mark {
  width: 42px;
  height: 42px;
  margin: 0;
  display: grid;
  place-items: center;
  border: 2px solid #146b62;
  border-radius: 6px;
  color: #0f5b54;
  font-weight: 800;
  background: #e8f4f1;
}

.app-header h1 {
  margin: 0;
  font-size: 20px;
  line-height: 1.3;
}

.app-header p:not(.product-mark) {
  margin: 3px 0 0;
  color: #53625f;
  font-size: 13px;
}

.workspace {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.notice {
  padding: 0 0 20px;
  border-bottom: 1px solid #cbd3d1;
}

.notice h2 {
  margin: 0;
  font-size: 17px;
}

.notice p {
  margin: 7px 0 0;
  color: #465451;
  line-height: 1.6;
}

.notice strong {
  color: #8a341f;
}

.stepper {
  margin: 22px 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid #cbd3d1;
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
}

.stepper span {
  padding: 12px 14px;
  color: #596864;
  border-right: 1px solid #dce2e0;
  font-size: 13px;
}

.stepper span:last-child { border-right: 0; }
.stepper span[aria-current="step"] { color: #0f5b54; background: #e8f4f1; }
.stepper span[aria-disabled="true"] { color: #89938f; background: #f6f7f7; }
.stepper strong { margin-right: 6px; }

.demo-shell {
  display: grid;
  grid-template-columns: minmax(300px, 420px) minmax(0, 1fr);
  gap: 28px;
  padding: 26px;
  border: 1px solid #cbd3d1;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 12px 34px rgba(31, 55, 50, 0.07);
}

.demo-shell h2,
.secondary-heading h2 { margin: 0; font-size: 20px; }

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

.target-grid label { margin-bottom: 6px; }

.target-summary {
  margin: 14px 0 20px;
  padding: 12px 14px;
  border-left: 3px solid #146b62;
  background: #edf6f4;
  color: #33443f;
  line-height: 1.55;
}

.requirements-output { display: grid; gap: 24px; }
.requirement-group h3 { margin: 0 0 10px; font-size: 16px; }
.requirement-list { display: grid; gap: 10px; }
.requirement-card { padding: 15px; border: 1px solid #d5ddda; border-radius: 7px; background: #fbfcfc; }
.requirement-card h4 { margin: 0; font-size: 15px; }
.requirement-card p { margin: 8px 0 0; line-height: 1.6; }
.requirement-card .reviewed-summary-label { margin-top: 12px; color: #596764; font-size: 12px; font-weight: 700; }
.requirement-card .reviewed-summary { margin: 6px 0 0; padding-left: 12px; border-left: 3px solid #9cbdb7; white-space: pre-wrap; font-size: 13px; line-height: 1.65; }
.requirement-card .actions { margin-top: 12px; }
.requirement-status { display: inline-block; margin-top: 8px; padding: 3px 8px; border-radius: 999px; color: #35514b; background: #e3eeeb; font-size: 12px; font-weight: 700; }
.requirement-status[data-status="needs_information"],
.requirement-status[data-status="not_covered"] { color: #744b08; background: #fff0ca; }
.requirement-status[data-status="conditional"] { color: #335277; background: #e7eef8; }
.requirement-status[data-status="needs_review"] { color: #713f76; background: #f4e8f6; }

.applicant-panel {
  grid-column: 1 / -1;
  padding-top: 26px;
  border-top: 1px solid #dce2e0;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.profile-grid fieldset { min-width: 0; margin: 0; padding: 16px; border: 1px solid #d5ddda; border-radius: 7px; }
.profile-grid legend { padding: 0 6px; color: #24453f; font-weight: 700; }
.profile-grid label { display: grid; gap: 6px; margin-top: 10px; }
.materials-fieldset { grid-column: 1 / -1; }
.material-inputs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.comparison-output { display: grid; gap: 24px; margin-top: 22px; }
.readiness-panel { scroll-margin-top: 20px; }
.readiness-counts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 18px 0; }
.readiness-counts div { padding: 14px; border: 1px solid #d5ddda; border-radius: 7px; background: #f7faf9; }
.readiness-counts dt { color: #596764; font-size: 12px; }
.readiness-counts dd { margin: 4px 0 0; color: #174f47; font-size: 24px; font-weight: 800; }
.readiness-filters { display: flex; flex-wrap: wrap; gap: 10px 18px; margin: 0; padding: 14px; border: 1px solid #d5ddda; border-radius: 7px; }
.readiness-filters legend { padding: 0 6px; font-weight: 700; }
.readiness-filters label { display: inline-flex; align-items: center; gap: 6px; }
.next-action { padding: 10px 12px; border-left: 3px solid #4c8c82; background: #eef6f4; }

.grounded-answer-panel {
  margin-top: 28px;
  padding: 26px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}
.grounded-answer-header { display: flex; align-items: start; justify-content: space-between; gap: 18px; }
.grounded-answer-header h2 { margin: 0; font-size: 22px; }
.ai-badge { flex: 0 0 auto; padding: 5px 10px; border-radius: 999px; color: #fff; background: var(--color-review); font-size: 12px; font-weight: 800; }
.grounded-answer-panel form { margin-top: 18px; }
.grounded-answer-output { display: grid; gap: 16px; margin-top: 20px; min-width: 0; }
.grounded-answer-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.grounded-answer-meta span { padding: 5px 9px; border-radius: 999px; color: #33453f; background: var(--color-surface-muted); font-size: 12px; overflow-wrap: anywhere; }
.grounded-claim { min-width: 0; padding: 16px; border: 1px solid var(--color-border); border-left: 4px solid var(--color-primary); border-radius: var(--radius-sm); background: #fcfdfc; }
.grounded-claim[data-kind="reviewed_rule"] { border-left-color: var(--color-review); }
.grounded-claim[data-kind="applicant_statement"] { border-left-color: var(--color-warning); }
.grounded-claim p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.7; }
.grounded-citations { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.grounded-citations button { width: auto; padding: 7px 10px; font-size: 12px; }
.grounded-boundary { padding: 14px; border-radius: var(--radius-sm); color: #4f421e; background: var(--color-warning-soft); line-height: 1.65; overflow-wrap: anywhere; }
.grounded-source-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.grounded-source-actions .source-link { margin-top: 0; }
.grounded-subanswer { display: grid; gap: 12px; min-width: 0; padding: 18px; border: 1px solid var(--color-border); border-radius: var(--radius-sm); background: var(--color-surface); }
.grounded-subanswer h3 { margin: 0; font-size: 17px; line-height: 1.5; overflow-wrap: anywhere; }
.grounded-supported, .grounded-missing { margin: 0; padding: 10px 12px; border-radius: var(--radius-sm); line-height: 1.6; }
.grounded-supported { color: #1d4f3d; background: #eaf6f0; }
.grounded-missing { color: #6b4d12; background: var(--color-warning-soft); }
.grounded-audit { min-width: 0; padding: 10px 12px; border: 1px dashed var(--color-border); border-radius: var(--radius-sm); color: var(--color-text-muted); }
.grounded-audit summary { cursor: pointer; font-weight: 700; }
.grounded-audit > p { overflow-wrap: anywhere; }

.evidence-drawer {
  width: min(560px, 100%);
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0 0 0 auto;
  padding: 0;
  border: 0;
  color: #18201f;
  background: #ffffff;
  box-shadow: -18px 0 45px rgba(20, 40, 36, 0.22);
}

.evidence-drawer::backdrop { background: rgba(20, 31, 29, 0.52); }
.drawer-header { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 24px; border-bottom: 1px solid #cbd3d1; background: #ffffff; }
.drawer-header h2 { margin: 0; font-size: 20px; }
.drawer-content { padding: 24px; }
.drawer-content h3 { margin: 0; font-size: 18px; }
.drawer-content dl { margin-top: 18px; }
.drawer-content details { margin-top: 18px; padding: 12px 0; border-top: 1px solid #d5ddda; border-bottom: 1px solid #d5ddda; }
.drawer-content summary { cursor: pointer; font-weight: 700; }
.relationship-window { width: min(840px, calc(100vw - 32px)); height: min(780px, calc(100dvh - 32px)); margin: auto; border-radius: 16px; }
.relationship-window .drawer-content { min-width: 0; }
.relation-intro { line-height: 1.6; color: #425650; }
.relation-graph { display: grid; gap: 16px; margin-top: 16px; }
.relation-path { display: flex; align-items: stretch; gap: 0; min-width: 0; padding: 12px; border: 1px solid #d3e2dc; border-radius: 12px; background: #f8fbf9; }
.relation-node { display: flex; flex-direction: column; flex: 1 1 0; min-width: 0; padding: 12px 14px; border: 1px solid #9bbdb2; border-radius: 10px; background: #ffffff; }
.relation-node h4 { margin: 0; font-size: 15px; overflow-wrap: anywhere; }
.relation-node p { margin: 6px 0; line-height: 1.45; font-size: 14px; overflow-wrap: anywhere; }
.relation-node button { align-self: flex-start; margin-top: auto; }
.relation-edge { position: relative; display: flex; flex: 0 0 112px; align-items: center; justify-content: center; padding: 18px 4px; color: #185a50; text-align: center; line-height: 1.4; }
.relation-edge::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 2px solid #247267; }
.relation-edge::after { content: "▶"; position: absolute; right: -5px; top: 50%; transform: translateY(-50%); font-size: 12px; color: #247267; }
.relation-edge span { position: relative; z-index: 1; padding: 3px 6px; border: 1px solid #9bbdb2; border-radius: 10px; background: #eff6f2; font-size: 13px; font-weight: 700; }
.relation-edge-stage { color: #7a4b27; }
.relation-edge-stage::before { border-top: 2px dashed #ad7141; }
.relation-edge-stage::after { color: #ad7141; }
.relation-edge-stage span { border: 1px dashed #ad7141; background: #fff7e9; }
.relation-path-long { display: grid; }
.relation-path-long .relation-edge { min-height: 52px; }
.relation-path-long .relation-edge::before { top: 0; bottom: 0; left: 50%; right: auto; border-top: 0; border-left: 2px solid #247267; }
.relation-path-long .relation-edge::after { content: "▼"; top: auto; right: auto; bottom: -5px; left: 50%; transform: translateX(-50%); }
.relation-path-long .relation-edge-stage::before { border-left-style: dashed; }
.relation-nodes { display: grid; gap: 12px; }
.relation-nodes h4 { margin: 0; }
.relation-unknown { padding: 12px; border: 1px dashed #8f9f99; line-height: 1.6; }
.relation-back { margin-bottom: 18px; }
@media (max-width: 600px) {
  .relationship-window .drawer-content { padding: 18px; }
  .relation-path { display: grid; padding: 8px; }
  .relation-node { padding: 12px; }
  .relation-edge { min-height: 56px; }
  .relation-edge::before { top: 0; bottom: 0; left: 50%; right: auto; border-top: 0; border-left: 2px solid #247267; }
  .relation-edge::after { content: "▼"; top: auto; right: auto; bottom: -5px; left: 50%; transform: translateX(-50%); }
  .relation-edge-stage::before { border-left-style: dashed; }
}
.source-link { display: inline-block; margin-top: 18px; color: #0f5b54; font-weight: 700; }
.secondary-heading { margin-top: 42px; padding-top: 30px; border-top: 1px solid #cbd3d1; }

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(260px, 330px) minmax(0, 1fr);
  gap: 32px;
  padding-top: 26px;
}

.search-panel {
  align-self: start;
}

.search-panel h2,
.results-panel h2 {
  margin: 0;
  font-size: 18px;
}

.field-group {
  margin-top: 22px;
}

label {
  display: block;
  margin-bottom: 7px;
  font-size: 14px;
  font-weight: 700;
}

select,
textarea,
input {
  width: 100%;
  border: 1px solid #9ca9a6;
  border-radius: 5px;
  color: #18201f;
  background: #ffffff;
}

select {
  min-height: 42px;
  padding: 8px 34px 8px 10px;
}

textarea {
  min-height: 132px;
  padding: 10px;
  resize: vertical;
  line-height: 1.55;
}

input {
  min-height: 42px;
  padding: 8px 10px;
}

select:focus-visible,
textarea:focus-visible,
input:focus-visible,
button:focus-visible,
summary:focus-visible,
.source-link:focus-visible,
[tabindex="-1"]:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
}

select:disabled,
textarea:disabled,
input:disabled,
button:disabled {
  cursor: not-allowed;
  border-color: #8d9995;
  color: #4f5d59;
  background: #e2e6e4;
  opacity: 1;
}

.field-detail,
.input-meta {
  color: #596764;
  font-size: 12px;
  line-height: 1.5;
}

.field-detail {
  min-height: 18px;
  margin: 7px 0 0;
}

.input-meta {
  margin-top: 6px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.actions {
  margin-top: 18px;
  display: flex;
  gap: 10px;
}

button {
  min-height: 42px;
  padding: 9px 15px;
  border: 1px solid #0f5b54;
  border-radius: 5px;
  cursor: pointer;
  color: #ffffff;
  background: #0f5b54;
  font-weight: 700;
}

button:hover:not(:disabled) {
  background: #0a4943;
}

button.secondary {
  color: #174b47;
  background: #ffffff;
}

button.quiet {
  border-color: #6b7a77;
  color: #34413f;
  background: transparent;
}

.document-bar {
  padding: 20px 0;
  border-bottom: 1px solid #cbd3d1;
}

.document-field {
  max-width: 760px;
  margin-top: 0;
}

.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid #9ca9a6;
  padding-top: 18px;
}

.tab-button {
  min-height: 44px;
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  color: #465451;
  background: transparent;
}

.tab-button:hover:not(:disabled) {
  color: #0f5b54;
  background: #e8efed;
}

.tab-button[aria-selected="true"] {
  border-bottom-color: #0f5b54;
  color: #0f5b54;
  background: #ffffff;
}

.coverage-notice {
  padding: 18px 0;
  border-bottom: 1px solid #cbd3d1;
}

.coverage-notice h2,
.report-form-panel h2,
.report-results-panel h2 {
  margin: 0;
  font-size: 18px;
}

.coverage-notice p {
  margin: 7px 0 0;
  line-height: 1.55;
}

.coverage-notice strong,
.final-notice {
  color: #8a341f;
}

.report-grid {
  display: grid;
  grid-template-columns: minmax(320px, 480px) minmax(0, 1fr);
  gap: 32px;
  padding-top: 26px;
}

fieldset {
  margin: 20px 0 0;
  padding: 0;
  border: 0;
}

legend {
  width: 100%;
  margin-bottom: 14px;
  padding-bottom: 7px;
  border-bottom: 1px solid #cbd3d1;
  font-weight: 800;
}

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

.report-output {
  min-width: 0;
}

.report-section {
  padding: 20px 0;
  border-bottom: 1px solid #cbd3d1;
}

.report-section h3 {
  margin: 0 0 12px;
  font-size: 16px;
}

.report-section h4 {
  margin: 0;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.coverage-result {
  border-left: 4px solid #a67113;
  padding-left: 14px;
  background: #fff8e8;
}

.readiness-value {
  font-weight: 800;
}

.finding-list,
.diagnostic-list,
.compact-list {
  margin: 0;
  padding-left: 22px;
}

.finding-list > li,
.diagnostic-list > li {
  margin-top: 14px;
  overflow-wrap: anywhere;
}

.compact-list {
  margin-top: 10px;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 12px;
}

.report-evidence {
  margin-top: 18px;
}

.report-evidence p {
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.final-notice {
  padding: 16px;
  border: 1px solid #b56c58;
  font-weight: 800;
  line-height: 1.6;
  background: #fff5f1;
}

.results-header {
  min-height: 44px;
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  border-bottom: 1px solid #cbd3d1;
  padding-bottom: 12px;
}

.section-label {
  margin: 0 0 3px;
  color: #0f665e;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.result-count {
  margin: 0;
  color: #53625f;
  font-size: 13px;
  white-space: nowrap;
}

.status-message {
  margin-top: 18px;
  padding: 12px 14px;
  border-left: 4px solid #6b7a77;
  color: #3e4b49;
  background: #e7ebea;
  line-height: 1.55;
}

.status-message[data-state="loading"] {
  border-color: #a67113;
  background: #fff3d8;
}

.status-message[data-state="error"] {
  border-color: #a13f29;
  background: #fbe8e3;
}

.status-message[data-state="success"] {
  border-color: #147164;
  background: #e4f2ef;
}

.evidence-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.evidence-item {
  padding: 22px 0;
  border-bottom: 1px solid #cbd3d1;
}

.evidence-heading {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.evidence-rank {
  color: #0f665e;
  font-size: 13px;
  font-weight: 800;
}

.evidence-item h3 {
  margin: 0;
  font-size: 16px;
  overflow-wrap: anywhere;
}

.citation {
  margin: 9px 0 0;
  color: #8a341f;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 13px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.evidence-text {
  margin: 14px 0 0;
  padding: 0 0 0 14px;
  border-left: 3px solid #6ea39b;
  color: #202a28;
  white-space: pre-wrap;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

.evidence-meta {
  margin: 13px 0 0;
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 5px 12px;
  font-size: 12px;
  line-height: 1.55;
}

.evidence-meta dt {
  color: #5e6d69;
  font-weight: 700;
}

.evidence-meta dd {
  margin: 0;
  overflow-wrap: anywhere;
}

[hidden] {
  display: none !important;
}

@media (max-width: 760px) {
  .header-inner,
  .workspace {
    width: min(100% - 28px, 680px);
  }

  .workspace-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 34px;
  }

  .stepper { grid-template-columns: repeat(2, 1fr); }
  .stepper span:nth-child(2) { border-right: 0; }
  .stepper span:nth-child(-n + 2) { border-bottom: 1px solid #dce2e0; }

  .demo-shell,
  .target-grid,
  .profile-grid,
  .material-inputs,
  .readiness-counts {
    grid-template-columns: minmax(0, 1fr);
  }

  .demo-shell { padding: 18px; }

  .evidence-drawer {
    width: 100%;
    height: min(88dvh, 760px);
    margin: auto 0 0;
    border-radius: 14px 14px 0 0;
  }

  .report-grid,
  .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .actions button {
    flex: 1 1 0;
  }
}

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

/* UX-01 progressive applicant flow */
.app-header {
  border-color: var(--color-border);
  background: rgba(255, 255, 255, 0.96);
}

.header-inner {
  width: min(1040px, calc(100% - 48px));
  min-height: 72px;
}

.product-mark {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 10px;
  color: #ffffff;
  background: var(--color-primary);
}

.header-copy { min-width: 0; }
.header-copy h1 { font-size: 19px; }
.header-copy p { color: var(--color-text-muted); }
.runtime-boundary {
  margin-left: auto;
  padding: 6px 10px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  color: var(--color-text-muted);
  background: var(--color-surface-muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.workspace {
  width: min(1040px, calc(100% - 48px));
  padding: 36px 0 72px;
}

.intro { max-width: 760px; }
.eyebrow,
.section-label,
.summary-label {
  margin: 0 0 7px;
  color: var(--color-primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.intro h2 { margin: 0; font-size: clamp(25px, 3vw, 34px); line-height: 1.3; }
.intro > p:not(.eyebrow, .essential-boundary) {
  margin: 12px 0 0;
  color: var(--color-text-muted);
  font-size: 16px;
  line-height: 1.7;
}
.essential-boundary {
  margin: 18px 0 0;
  padding: 11px 14px;
  border-left: 4px solid var(--color-warning);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: #563d0d;
  background: var(--color-warning-soft);
  line-height: 1.55;
}
.scope-details { margin-top: 13px; color: var(--color-text-muted); font-size: 13px; }
.scope-details summary { width: fit-content; cursor: pointer; color: var(--color-primary); font-weight: 750; }
.scope-details p { margin: 9px 0 0; line-height: 1.65; }

.current-target-bar {
  position: sticky;
  top: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 20px;
  padding: 12px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: #ffffff;
  box-shadow: 0 4px 16px rgba(22, 55, 48, 0.12);
}
.current-target-bar[hidden] { display: none; }
.current-target-bar strong { overflow-wrap: anywhere; }
.current-target-bar .summary-label { margin-bottom: 3px; }
.current-target-hint { margin: 3px 0 0; color: var(--color-text-muted); font-size: 12px; }
.current-target-bar button { flex: 0 0 auto; }

.stepper {
  display: block;
  margin: 32px 0 24px;
  border: 0;
  border-radius: 0;
  overflow: visible;
  background: transparent;
}
.stepper ol {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.stepper li {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  background: var(--color-surface);
}
.stepper span,
.stepper span:last-child {
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  font-size: inherit;
}
.stepper strong { margin: 0; }
.stepper li > span:last-child { min-width: 0; display: grid; gap: 2px; }
.stepper li strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.stepper li small { font-size: 11px; }
.step-number {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--color-text-muted);
  background: var(--color-surface-muted);
  font-size: 13px;
  font-weight: 800;
}
.stepper li[data-state="current"] { border-color: #7aa49b; color: var(--color-primary-strong); background: var(--color-primary-soft); }
.stepper li[data-state="current"] .step-number { color: #ffffff; background: var(--color-primary); }
.stepper li[data-state="complete"] { color: #24563f; background: var(--color-success-soft); }
.stepper li[data-state="complete"] .step-number { color: #ffffff; background: var(--color-success); }
.stepper li[data-state="stale"] { border-color: #d7bd7d; color: #64470e; background: var(--color-warning-soft); }
.stepper li[data-state="stale"] .step-number { color: #ffffff; background: var(--color-warning); }

.demo-shell.application-flow {
  display: block;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.flow-step {
  scroll-margin-top: 24px;
  margin-top: 14px;
  padding: 28px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: var(--shadow-soft);
}
.flow-step[data-step-state="complete"] { padding: 20px 24px; box-shadow: none; }
.flow-step-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.flow-step-header h2 { margin: 0; font-size: 23px; line-height: 1.35; }
.step-state-badge {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--color-primary-strong);
  background: var(--color-primary-soft);
  font-size: 12px;
  font-weight: 800;
}
.flow-step[data-step-state="complete"] .step-state-badge { color: #24563f; background: var(--color-success-soft); }
.flow-step[data-step-state="stale"] .step-state-badge { color: #64470e; background: var(--color-warning-soft); }
.flow-step-content { margin-top: 24px; }
.completed-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
}
.completed-summary p { margin: 0; line-height: 1.55; }
.completed-summary .summary-label { margin-bottom: 4px; color: var(--color-text-muted); }
.edit-step { flex: 0 0 auto; min-height: 38px; padding: 7px 13px; }

.target-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 16px; }
.target-grid label { color: #273b36; }
.action-hint { margin: 10px 0 0; color: var(--color-text-muted); font-size: 13px; line-height: 1.5; }
.action-hint[data-state="ready"] { color: var(--color-success); font-weight: 700; }
.step-primary-action { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--color-border); }
.step-primary-action { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.step-primary-action .reference-generate { width: auto; }
.reference-action-status { margin-top: 10px; }
.slice-profile { padding: 18px; border: 1px solid var(--color-border); border-radius: 8px; background: #f7faf8; }
.slice-profile p { margin-top: 0; }
.reference-report { position: fixed; inset: 0 0 0 auto; width: min(820px, calc(100vw - 24px)); margin: 0; }
.reference-report .drawer-header { gap: 16px; }
.reference-report .drawer-content { max-height: min(68vh, 800px); overflow: auto; }
.reader-report-options { display: flex; flex-wrap: wrap; gap: 10px 18px; margin: 0 0 18px; padding: 12px 16px; border: 1px solid var(--color-border); border-radius: var(--radius-sm); }
.reader-report-options legend { padding: 0 4px; font-weight: 800; }
.reader-report-options label { display: inline-flex; align-items: center; gap: 7px; width: auto; margin: 0; white-space: nowrap; cursor: pointer; }
.reader-report-options input[type="checkbox"] { flex: 0 0 auto; width: 18px; height: 18px; margin: 0; accent-color: var(--color-primary); }
.reader-report-paper { min-width: 0; overflow-wrap: anywhere; line-height: 1.65; }
.reader-report-title { padding: 14px 16px; border-left: 4px solid var(--color-primary); background: var(--color-primary-soft); }
.reader-report-title h3 { font-size: 16px; line-height: 1.45; }
.reader-report-title p { margin: 7px 0 0; }
.reader-report-section { margin-top: 18px; padding: 16px; border: 1px solid var(--color-border); border-radius: var(--radius-sm); background: #fff; }
.reader-report-section:first-of-type { border-color: #d5c89f; background: #fffaf0; }
.reader-report-section h3 { margin: 0 0 10px; font-size: 17px; }
.reader-report-section ul { margin: 0; padding-left: 21px; }
.reader-report-section li + li { margin-top: 9px; }
.reader-report-note { margin: 14px 0 0; color: var(--color-text-muted); font-size: 13px; }
.reference-report textarea { width: calc(100% - 48px); margin: 0 24px 20px; min-height: 110px; }
.requirement-evidence-actions { flex-wrap: wrap; min-width: 0; }
.slice-readiness .comparison-output > .requirement-card { margin-top: 18px; }

.requirements-output { grid-template-columns: minmax(0, 1fr); gap: 24px; }
.result-section { min-width: 0; scroll-margin-top: 20px; }
.exam-arrangement { padding: 20px; border: 1px solid #c8ded5; border-radius: 14px; background: #f6faf8; scroll-margin-top: 180px; }
.exam-arrangement .exam-lead { font-weight: 700; color: #183d32; }
.exam-arrangement .exam-course-notice { padding: 10px 12px; border-left: 4px solid #916e2c; background: #fff8e6; line-height: 1.55; overflow-wrap: anywhere; }
.exam-arrangement h4 { margin: 16px 0 6px; }
.exam-arrangement li { margin: 5px 0; overflow-wrap: anywhere; }
.exam-arrangement details { margin-top: 14px; }
.exam-arrangement .source-actions button { max-width: 100%; }
.requirements-jump { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 22px; }
.requirements-jump button { width: auto; }
.requirements-jump + .result-section { margin-top: 0; }
@media (max-width: 600px) {
  .requirements-jump button { flex: 1 1 auto; min-width: 0; }
}
.result-section > h3 { margin: 0 0 8px; color: #263d37; font-size: 19px; }
.section-intro { max-width: 76ch; margin: 0 0 16px; color: var(--color-text-muted); line-height: 1.65; }
.empty-reviewed-data {
  margin: 0;
  padding: 14px;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  background: var(--color-surface-muted);
}

.application-overview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 310px);
  gap: 24px;
  padding: 24px;
  border: 1px solid #9abbb4;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #f5fbf9, #ffffff 62%);
  box-shadow: var(--shadow-soft);
}
.application-overview h3 { margin: 0; color: var(--color-primary-strong); font-size: 24px; }
.overview-target { margin: 8px 0 18px; color: var(--color-text-muted); line-height: 1.55; }
.overview-metrics {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) repeat(2, minmax(130px, .7fr));
  gap: 10px;
  margin: 0;
}
.overview-metrics div {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: #ffffff;
}
.overview-metrics div[data-metric="deadline"] { border: 2px solid #a34b37; background: #fff8f5; }
.overview-metrics dt { color: var(--color-text-muted); font-size: 12px; font-weight: 700; }
.overview-metrics dd { margin: 6px 0 0; color: #233934; font-size: 18px; font-weight: 800; line-height: 1.45; overflow-wrap: anywhere; }
.overview-metrics div[data-metric="deadline"] dd { color: #762d1b; font-size: 20px; }
.overview-metric-note { margin: 6px 0 0; color: var(--color-text-muted); font-size: 11px; line-height: 1.4; }
.overview-action {
  align-self: start;
  position: sticky;
  top: 16px;
  padding: 18px;
  border-radius: var(--radius-sm);
  color: #ffffff;
  background: var(--color-primary-strong);
}
.overview-action > p:first-child { margin: 0 0 10px; font-size: 12px; font-weight: 800; letter-spacing: .08em; }
.overview-action .field-detail { margin: 10px 0 0; color: #dbece8; }
.overview-cta { width: 100%; color: var(--color-primary-strong); background: #ffffff; font-weight: 800; }
.overview-cta:hover:not(:disabled) { color: #ffffff; background: #1d746a; }

.key-dates-section { padding-top: 4px; }
.key-dates-section .date-event-list {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  margin: 0;
  padding-left: 22px;
  border-left: 2px solid #b7c8c4;
}
.key-dates-section .date-event {
  position: relative;
  display: grid;
  grid-template-columns: minmax(200px, .75fr) minmax(300px, 1.5fr) auto;
  align-items: center;
  gap: 18px;
  margin: 0 0 12px;
  padding: 17px 18px;
}
.key-dates-section .date-event::before {
  content: "";
  position: absolute;
  left: -29px;
  width: 12px;
  height: 12px;
  border: 3px solid #ffffff;
  border-radius: 50%;
  background: var(--color-primary);
  box-shadow: 0 0 0 1px #6f8f88;
}
.key-dates-section .date-event[data-event-type="arrival_deadline"]::before { background: #a34b37; box-shadow: 0 0 0 2px #a34b37; }
.key-dates-section .date-event-header { align-items: center; }
.key-dates-section .date-conclusion { margin: 0; font-size: 18px; }
.key-dates-section .date-uncertainty { grid-column: 2; margin: -8px 0 0; }
.key-dates-section .date-event .actions { margin: 0; padding: 0; }
.key-dates-section .date-event .actions button { width: auto; white-space: nowrap; }

.materials-section .requirement-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.materials-section .requirement-card { border-left: 4px solid var(--color-primary); }
.pending-section {
  padding: 22px;
  border: 1px solid #d7c598;
  border-radius: var(--radius-md);
  background: #fffbef;
}
.pending-other-notice {
  margin: 0 0 16px;
  padding: 10px 12px;
  border-left: 3px solid var(--color-warning);
  color: #5c430f;
  background: #fff6dd;
  line-height: 1.6;
}
.profile-input-heading { margin: 0 0 10px; color: #263d37; font-size: 14px; }
.profile-needs-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.profile-needs-list li {
  padding: 7px 10px;
  border: 1px solid #d7c598;
  border-radius: 999px;
  color: #5c430f;
  background: #ffffff;
  font-size: 13px;
  font-weight: 700;
}
.pending-details { margin-top: 18px; }
.pending-details > summary,
.other-requirements > summary,
.technical-disclosure > summary { cursor: pointer; color: var(--color-primary-strong); font-weight: 800; }
.pending-details .requirement-list,
.other-requirements .requirement-list { margin-top: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.requirement-card-compact .requirement-description { color: var(--color-text-muted); font-size: 14px; }
.technical-disclosure { margin-top: 12px; }
.technical-disclosure .reviewed-summary { margin-top: 10px; }
.next-step-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 22px;
  border-radius: var(--radius-md);
  color: #ffffff;
  background: var(--color-primary-strong);
}
.next-step-section h3 { color: #ffffff; }
.next-step-section p { margin: 5px 0 0; color: #dbece8; }
.next-step-cta { flex: 0 0 auto; color: var(--color-primary-strong); background: #ffffff; font-weight: 800; }
.other-requirements {
  padding: 18px 20px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-muted);
}
.other-requirements > summary { font-size: 17px; }
.requirement-group { min-width: 0; }
.requirement-group h3 { margin-bottom: 12px; color: #263d37; font-size: 17px; }
.requirement-list { gap: 12px; }
.requirement-card {
  padding: 18px;
  border-color: var(--color-border);
  border-radius: var(--radius-sm);
  background: #fcfdfc;
}
.requirement-card[data-category="dates"] { border-left: 4px solid var(--color-warning); background: #fffdf7; }
.requirement-card h4 { font-size: 16px; line-height: 1.45; }
.requirement-description { color: #344740; }
.deadline-callout {
  padding: 10px 12px;
  border-radius: 7px;
  color: #5c410c;
  background: var(--color-warning-soft);
  font-weight: 800;
}
.requirement-status { color: #24563f; background: var(--color-success-soft); }
.requirement-status[data-status="needs_information"],
.requirement-status[data-status="not_covered"] { color: #64470e; background: var(--color-warning-soft); }
.requirement-status[data-status="conditional"],
.requirement-status[data-status="needs_review"] { color: var(--color-review); background: var(--color-review-soft); }
.requirement-card .reviewed-summary { border-color: #8baea6; color: #41524e; background: var(--color-surface-muted); }

.date-event-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.date-event {
  min-width: 0;
  padding: 14px;
  border: 1px solid #d5c89f;
  border-radius: var(--radius-sm);
  background: #ffffff;
}
.date-event[data-event-type="arrival_deadline"] {
  border-width: 2px;
  border-color: #a34b37;
  background: #fff8f5;
}
.date-event-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.date-event-header h5 { margin: 0; color: #283d37; font-size: 14px; line-height: 1.45; }
.date-nature {
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: 999px;
  color: #64470e;
  background: var(--color-warning-soft);
  font-size: 11px;
  font-weight: 800;
}
.date-nature[data-nature="must_arrive"] { color: #762d1b; background: #fbe5df; }
.date-conclusion { color: #223630; font-size: 16px; font-weight: 800; }
.date-uncertainty { color: var(--color-text-muted); font-size: 12px; }
.date-event .actions { padding-top: 4px; }
.date-event .actions button { width: 100%; }

.direct-evidence-heading { margin: 22px 0 8px; color: #5c281d; font-weight: 800; }
.direct-evidence {
  margin: 10px 0;
  padding: 14px;
  border-left: 4px solid #a34b37;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: #fff4f0;
  line-height: 1.75;
}
.direct-evidence-label { display: block; margin-bottom: 7px; color: #762d1b; font-size: 12px; font-weight: 800; }
.direct-evidence mark,
.evidence-text mark { padding: 1px 3px; color: #4d1e14; background: #ffd4c8; font-weight: 800; }
.official-context { margin-top: 14px; }
.evidence-text { margin: 12px 0 0; white-space: pre-wrap; line-height: 1.75; }
.source-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.source-actions .source-link {
  margin-top: 0;
  padding: 9px 12px;
  border: 1px solid #6c7d78;
  border-radius: var(--radius-sm);
  text-decoration: none;
}
.source-actions .pdf-source-link { color: #ffffff; border-color: var(--color-primary); background: var(--color-primary); }
.source-actions .pdf-source-link:hover { background: var(--color-primary-strong); }
.source-actions .official-web-link:hover { color: #ffffff; background: var(--color-primary-strong); }

.applicant-panel { padding-top: 28px; border-top: 0; }
.profile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.profile-intro { max-width: 75ch; line-height: 1.7; }
.profile-state-guide {
  margin: 15px 0 0;
  padding: 14px 16px;
  border-left: 4px solid var(--color-primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: #344740;
  background: var(--color-primary-soft);
  line-height: 1.7;
}
.profile-group { min-width: 0; border: 1px solid var(--color-border); border-radius: var(--radius-sm); background: #fcfdfc; }
.profile-group > summary {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 18px 20px;
  cursor: pointer;
  list-style: none;
}
.profile-group > summary::-webkit-details-marker { display: none; }
.profile-group > summary::before { content: "▸"; flex: 0 0 auto; color: var(--color-primary); font-size: 19px; line-height: 1.1; }
.profile-group[open] > summary::before { content: "▾"; }
.profile-group-title { display: grid; gap: 5px; min-width: 0; flex: 1; }
.profile-group-title strong { color: var(--color-primary-strong); font-size: 17px; }
.profile-group-title small { color: var(--color-text-muted); font-size: 12px; font-weight: 500; line-height: 1.5; }
.profile-group-state {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  color: #64470e;
  background: var(--color-warning-soft);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
.profile-group-state[data-state="complete"] { color: #24563f; background: var(--color-success-soft); }
.profile-group-state[data-state="partial"] { color: var(--color-primary-strong); background: var(--color-primary-soft); }
.profile-group-state[data-state="unknown"] { color: var(--color-review); background: var(--color-review-soft); }
.profile-grid .profile-group fieldset { min-width: 0; margin: 0; padding: 0 20px 20px; border: 0; background: transparent; }
.profile-grid .profile-group legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.profile-grid .profile-group label { margin: 16px 0 3px; color: #273b36; }
.profile-grid .profile-group select,
.profile-grid .profile-group input { min-width: 0; }
.english-proof-fields { margin-top: 18px; padding: 14px 16px; border: 1px solid var(--color-border); border-radius: var(--radius-sm); background: #fff; }
.english-proof-fields[hidden], .english-proof-fields [hidden] { display: none; }
.preparation-steps, .english-guide-list { margin: 12px 0; padding-left: 1.5em; line-height: 1.65; }
.preparation-steps li + li, .english-guide-list li + li { margin-top: 5px; }
.preparation-warning { margin: 10px 0; color: #6b4a17; }
.preparation-conditions { margin: 12px 0; }
.preparation-conditions p { margin: 9px 0; line-height: 1.65; }
.evidence-chinese-summary { padding: 12px 16px; border: 1px solid var(--color-border); border-radius: var(--radius-sm); background: #f9fcfa; }
.field-help { margin: 0 0 7px; color: var(--color-text-muted); font-size: 12px; line-height: 1.55; }
.linked-field-hint,
.profile-limit {
  margin: 16px 0 0;
  padding: 11px 13px;
  border-left: 3px solid var(--color-primary);
  color: #305048;
  background: var(--color-primary-soft);
  line-height: 1.6;
  font-size: 13px;
}
.linked-field-hint[data-state="attention"] { border-color: var(--color-warning); color: #5c430f; background: #fff6dd; }
.profile-submit-help { margin: 18px 0 0; color: var(--color-text-muted); line-height: 1.65; }
.material-inputs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.material-inputs label { min-width: 0; }

.action-summary { margin-top: 20px; padding: 20px; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: #fcfdfc; }
.action-summary-heading { display: flex; align-items: end; justify-content: space-between; gap: 12px; }
.action-summary-heading h3 { margin: 0; color: var(--color-primary-strong); font-size: 21px; }
.action-summary-total { margin: 0; color: var(--color-text-muted); font-size: 13px; white-space: nowrap; }
.action-summary .readiness-counts { grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 16px 0; }
.readiness-counts div { border-color: var(--color-border); border-radius: var(--radius-sm); background: var(--color-surface-muted); }
.readiness-counts div[data-group="action_required"] { background: var(--color-warning-soft); }
.readiness-counts div[data-group="review_required"] { background: var(--color-review-soft); }
.readiness-counts div[data-group="recorded"] { background: var(--color-surface-muted); }
.readiness-counts dd { color: var(--color-primary-strong); }
.priority-actions { padding: 16px 18px; border-radius: var(--radius-sm); background: var(--color-primary-soft); }
.priority-actions h4 { margin: 0 0 10px; color: var(--color-primary-strong); }
.priority-actions ol { display: grid; gap: 10px; margin: 0; padding-left: 22px; }
.priority-actions li { padding-left: 3px; overflow-wrap: anywhere; }
.priority-actions li a { display: inline; font-weight: 800; }
.priority-actions li span { display: block; margin-top: 2px; color: #344740; font-size: 13px; line-height: 1.55; }
.priority-actions > p { margin-bottom: 0; line-height: 1.6; }
.progress-boundary { margin: 14px 0 18px; color: #485951; font-size: 13px; line-height: 1.65; }
.readiness-filters { border-color: var(--color-border); border-radius: var(--radius-sm); background: #fcfdfc; }
.readiness-filters label { min-width: 0; white-space: nowrap; }
.readiness-filters input[type="radio"] { flex: 0 0 auto; width: auto; margin: 0; }
.comparison-group .requirement-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.comparison-card { scroll-margin-top: 18px; }
.comparison-card[data-action-group="recorded"] { border-left: 4px solid var(--color-border); }
.comparison-card[data-action-group="recorded"] .requirement-status { color: #40544d; background: var(--color-surface-muted); }
.comparison-card[data-action-group="action_required"] { border-left: 4px solid var(--color-warning); }
.comparison-card[data-action-group="review_required"] { border-left: 4px solid var(--color-review); }
.comparison-card[data-action-group="recorded"] .next-action { border-color: var(--color-border); background: var(--color-surface-muted); }
.comparison-card[data-action-group="action_required"] .next-action { border-color: var(--color-warning); background: var(--color-warning-soft); }
.comparison-card[data-action-group="review_required"] .next-action { border-color: var(--color-review); background: var(--color-review-soft); }
.comparison-category { margin: 0 0 5px; color: var(--color-text-muted); font-size: 12px; font-weight: 800; }
.comparison-state-label { margin: 14px 0 4px; color: #40544d; font-size: 12px; font-weight: 800; }
.comparison-reason { line-height: 1.65; }
.personal-progress { margin: 16px 0 5px; color: var(--color-primary-strong); font-size: 13px; font-weight: 800; }
.personal-check { display: inline-flex; align-items: center; gap: 9px; padding: 9px 12px; border: 1px solid var(--color-border); border-radius: var(--radius-sm); color: #344740; background: #fff; cursor: pointer; font-size: 13px; }
.personal-check input { width: 18px; height: 18px; margin: 0; accent-color: var(--color-primary); }
.comparison-card[data-handled="true"] .personal-check { background: var(--color-primary-soft); }
.comparison-limit { margin-top: 15px; color: var(--color-text-muted); font-size: 12px; line-height: 1.6; }
.comparison-limit summary { cursor: pointer; font-weight: 700; }
.comparison-limit p { margin-bottom: 0; }
.application-flow .final-notice {
  border-color: #c9a55a;
  color: #5c430f;
  background: #fffaf0;
  font-weight: 400;
}

/* One reading scale across the original four-step page and report. */
button { font-weight: 600; }
select, textarea, input { font-weight: 400; }
.flow-step-header h2,
.result-section > h3,
.grounded-answer-header h2 { font-size: 22px; font-weight: 600; line-height: 1.4; }
.requirement-card h4,
.comparison-card h4,
.reader-report-section h3 { font-size: 18px; font-weight: 600; line-height: 1.45; }
.section-label,
.comparison-category,
.comparison-state-label { font-size: 13px; font-weight: 600; }
.field-detail,
.field-help,
.progress-boundary,
.reader-report-note { font-size: 14px; font-weight: 400; line-height: 1.6; }
.requirement-card .requirement-status,
.profile-group-state { font-size: 13px; font-weight: 600; }
.date-conclusion,
.priority-actions li a { font-weight: 600; }
.personal-progress { font-weight: 600; }
.requirement-card .material-official-name { margin-top: 3px; color: var(--color-text-muted); font-size: 14px; }
.material-explanation { margin-top: 8px; }
.material-applicability { margin-top: 9px; color: var(--color-text-muted); font-size: 14px; }
.comparison-card[data-category="materials"] .next-action { margin-top: 10px; padding: 8px 11px; }
.comparison-card[data-category="materials"] .comparison-state-label { margin-top: 10px; }
.materials-section .requirement-card { padding: 14px 16px; }
.grounded-response { padding: 20px; border: 1px solid var(--color-border); border-radius: var(--radius-sm); background: #fff; }
.grounded-response h3 { margin: 0 0 12px; font-size: 18px; font-weight: 600; }
.grounded-response-text { font-size: 17px; line-height: 1.75; overflow-wrap: anywhere; }
.grounded-response-text p { margin: 0; }
.grounded-response-text p + p,
.grounded-response-text :is(ul, ol, h4) { margin-top: 13px; }
.grounded-response-text :is(ul, ol) { padding-left: 23px; }
.grounded-response-text li + li { margin-top: 7px; }
.grounded-response-text h4 { margin-bottom: 5px; font-size: 17px; font-weight: 600; }
.grounded-response-text strong { font-weight: 600; }

.status-message { border-radius: var(--radius-sm); }
.status-message[data-state="success"] { border-color: #85ad97; color: #24563f; background: var(--color-success-soft); }
.status-message[data-state="loading"] { border-color: #89aaa3; color: var(--color-primary-strong); background: var(--color-primary-soft); }
.status-message[data-state="error"] { border-color: #d29c8e; color: #762d1b; background: #fbece8; }

button { border-radius: var(--radius-sm); background: var(--color-primary); }
button:hover:not(:disabled) { background: var(--color-primary-strong); }
button.secondary,
button.quiet { border-color: #6c7d78; color: #2d4841; background: #ffffff; }
button.secondary:hover:not(:disabled),
button.quiet:hover:not(:disabled) { color: #ffffff; background: var(--color-primary-strong); }

@media (max-width: 760px) {
  .header-inner,
  .workspace { width: min(100% - 28px, 680px); }
  .header-inner { min-height: 66px; }
  .runtime-boundary { display: none; }
  .workspace { padding-top: 26px; }
  .intro h2 { font-size: 27px; }
  .stepper ol { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stepper li { padding: 10px; }
  .flow-step,
  .flow-step[data-step-state="complete"] { padding: 20px 18px; }
  .flow-step-header h2 { font-size: 21px; }
  .completed-summary { align-items: flex-start; }
  .target-grid,
  .requirements-output,
  .date-event-list,
  .profile-grid,
  .material-inputs,
  .comparison-group .requirement-list { grid-template-columns: minmax(0, 1fr); }
  .readiness-counts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .action-summary { padding: 16px; }
  .action-summary-heading { align-items: start; flex-direction: column; }
  .action-summary .readiness-counts { grid-template-columns: minmax(0, 1fr); gap: 7px; }
  .action-summary .readiness-counts div { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; }
  .action-summary .readiness-counts dd { margin: 0; font-size: 21px; }
  .priority-actions { padding: 13px; }
  .readiness-filters { display: grid; gap: 10px; }
  .step-primary-action button { width: 100%; }
  .step-primary-action .reference-generate { width: 100%; }
  .current-target-bar { align-items: stretch; flex-direction: column; gap: 10px; }
  .current-target-bar button { width: 100%; }
  .source-actions { display: grid; }
  .source-actions .source-link { text-align: center; }
  .application-overview { grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 20px 16px 16px; }
  .application-overview h3 { font-size: 22px; }
  .overview-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-metrics div[data-metric="deadline"] { grid-column: 1 / -1; }
  .overview-metrics dd,
  .overview-metrics div[data-metric="deadline"] dd { font-size: 17px; overflow-wrap: break-word; }
  .overview-action { position: sticky; z-index: 4; top: auto; bottom: 10px; padding: 14px; box-shadow: 0 8px 28px rgba(12, 54, 49, .25); }
  .overview-action .field-detail { display: none; }
  .overview-action > p:first-child { margin-bottom: 7px; }
  .key-dates-section .date-event-list { display: grid; padding-left: 17px; }
  .key-dates-section .date-event {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    padding: 15px;
  }
  .key-dates-section .date-event::before { left: -24px; }
  .key-dates-section .date-event-header { align-items: flex-start; }
  .key-dates-section .date-conclusion { font-size: 17px; overflow-wrap: break-word; }
  .key-dates-section .date-uncertainty { grid-column: 1; margin: 0; }
  .key-dates-section .date-event .actions button { width: 100%; white-space: normal; }
  .materials-section .requirement-list,
  .pending-details .requirement-list,
  .other-requirements .requirement-list { grid-template-columns: minmax(0, 1fr); }
  .pending-section { padding: 18px 16px; }
  .profile-needs-list { display: grid; }
  .profile-grid { gap: 10px; }
  .profile-group > summary { padding: 16px; }
  .profile-group-title strong { font-size: 16px; }
  .profile-grid .profile-group fieldset { padding: 0 16px 18px; }
  .next-step-section { align-items: stretch; flex-direction: column; }
  .next-step-cta { width: 100%; }
  .grounded-answer-panel { padding: 20px 16px; }
  .grounded-answer-header { align-items: flex-start; }
  .grounded-source-actions { display: grid; }
  .grounded-source-actions .source-link { overflow-wrap: anywhere; text-align: center; }
  .requirement-evidence-actions button { flex: 1 1 125px; min-width: 125px; white-space: normal; }
}

/* UX-03: completed steps keep their identity and edit action in a short row. */
.application-flow > .flow-step[data-step-state="complete"] {
  min-width: 0;
  margin-top: 8px;
  padding: 10px 16px;
  border-color: #d8e4df;
  background: #f9fcfa;
}
.application-flow > .flow-step[data-step-state="complete"] > .flow-step-header { display: none; }
.application-flow > .flow-step[data-step-state="complete"] > .completed-summary {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  gap: 12px;
}
.application-flow > .flow-step[data-step-state="complete"] > .completed-summary > div { min-width: 0; }
.application-flow > .flow-step[data-step-state="complete"] .summary-label {
  margin: 0 0 2px;
  font-size: 12px;
}
.application-flow > .flow-step[data-step-state="complete"] .completed-summary p:last-child {
  overflow-wrap: anywhere;
  font-size: 14px;
}
.application-flow > .flow-step[data-step-state="complete"] .edit-step {
  min-width: 82px;
  min-height: 36px;
  padding: 6px 10px;
}
.current-target-bar[data-compact="true"] { position: relative; box-shadow: none; }

/* One visible English topic: action rows stay outside the optional reference list. */
.comparison-topic-group,
.english-preparation-group {
  min-width: 0;
  padding: 18px 20px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #ffffff;
}
.comparison-topic-group > h3,
.english-preparation-group > h3 {
  margin: 0 0 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-primary-strong);
  font-size: 19px;
}
.comparison-topic-group .requirement-list { min-width: 0; }
.english-preparation-group { border-color: #b8d7ce; background: #f9fcfa; }
.english-preparation-group .requirement-list { grid-template-columns: minmax(0, 1fr); }
.english-topic-overview { margin: 0 0 6px; font-weight: 700; line-height: 1.5; }
.english-check-list { display: grid; gap: 10px; min-width: 0; }
.english-check-row {
  min-width: 0;
  scroll-margin-top: 24px;
  padding: 11px 14px;
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: #ffffff;
}
.english-check-row[data-action-group="action_required"] { border-left-color: var(--color-warning); }
.english-check-row[data-action-group="review_required"] { border-left-color: var(--color-review); }
.english-check-row h4 { margin: 0 0 6px; font-size: 16px; }
.english-check-row p { margin: 6px 0 0; line-height: 1.55; }
.english-check-row .next-action { padding: 8px 10px; }
.english-reference-details,
.preparation-guide-details,
.evidence-choice-list {
  min-width: 0;
  margin-top: 12px;
  border-top: 1px solid var(--color-border);
}
.english-reference-details > summary,
.preparation-guide-details > summary,
.evidence-choice-list > summary {
  width: fit-content;
  max-width: 100%;
  padding: 10px 0;
  color: var(--color-primary-strong);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.english-reference-details[open] > summary,
.preparation-guide-details[open] > summary,
.evidence-choice-list[open] > summary { margin-bottom: 6px; }
.preparation-guide-details .material-official-name { margin-top: 0; }
.preparation-guide-details .preparation-steps { margin-top: 8px; }
.evidence-choice-list .actions,
.evidence-choice-list .evidence-choice-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
  margin: 0 0 8px;
}
.evidence-choice-list button,
.requirement-evidence-actions button {
  min-width: 0;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: left;
  line-height: 1.45;
}

@media (max-width: 760px) {
  .application-flow > .flow-step[data-step-state="complete"] { padding: 10px 12px; }
  .application-flow > .flow-step[data-step-state="complete"] > .completed-summary {
    align-items: center;
    gap: 8px;
  }
  .application-flow > .flow-step[data-step-state="complete"] .edit-step { min-width: 70px; }
  .comparison-topic-group,
  .english-preparation-group { padding: 15px 13px; }
  .comparison-topic-group .requirement-list,
  .english-preparation-group .requirement-list { grid-template-columns: minmax(0, 1fr); }
  .english-check-row { padding: 10px 11px; }
  .evidence-choice-list .actions,
  .evidence-choice-list .evidence-choice-actions { display: grid; grid-template-columns: minmax(0, 1fr); }
  .evidence-choice-list button,
  .requirement-evidence-actions button {
    width: 100%;
    min-width: 0;
    word-break: normal;
    overflow-wrap: anywhere;
  }
}
