/* APP Disclosure Assistant — styles
   System fonts only. No external fonts, no CDNs. */

:root{
  --ink: #1b2126;
  --ink-soft: #3c4650;
  --paper: #f4f1ea;
  --panel: #ffffff;
  --line: #c9c2b2;
  --navy: #1b3a4b;
  --navy-dark: #122a37;
  --rust: #c97b2c;
  --rust-dark: #9c5f20;
  --ok-bg: #e7f1e9;
  --ok-line: #3f7a53;
  --warn-bg: #fdf1df;
  --warn-line: #a6671a;
  --danger-bg: #fbe9e7;
  --danger-line: #a33a2d;
  --focus: #2a66c9;
  --radius: 8px;
  --max-width: 920px;
}

*{box-sizing:border-box;}

html{
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.5;
}

body{
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

h1, h2, h3, h4{
  line-height: 1.25;
  color: var(--navy-dark);
}

a{ color: var(--navy); text-decoration: underline; }
a:hover{ color: var(--rust-dark); }

:focus-visible{
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

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

.skip-link{
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--navy);
  color: #fff;
  padding: 0.6rem 1rem;
  z-index: 100;
  border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus{
  left: 0;
}

/* Header */
.site-header{
  background: var(--navy);
  color: #fff;
  padding: 0 0 1.5rem;
}

.notice-bar{
  background: var(--navy-dark);
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
}
.notice-bar p{ margin: 0.25rem 0; max-width: var(--max-width); margin-inline: auto; }

.hero{
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.5rem 1rem 0;
  text-align: left;
}
.hero .mark{ margin: 0 0 0.5rem; }
.hero h1{
  color: #fff;
  margin: 0 0 0.5rem;
  font-size: 2rem;
}
.hero .tagline{
  font-size: 1.1rem;
  margin: 0 0 0.5rem;
  color: #f4f1ea;
}
.hero .hero-sub{
  margin: 0;
  color: #d8dee2;
  font-size: 0.95rem;
}

/* Progress nav */
.progress-nav{
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
#step-indicator{
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.5rem 1rem;
}
.step-btn{
  background: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--ink-soft);
}
.step-btn[aria-current="step"]{
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
  font-weight: 600;
}
.step-btn:hover{ border-color: var(--navy); }

/* Main / steps */
main{
  flex: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.5rem 1rem 2rem;
  width: 100%;
}

.step-panel h2{ margin-top: 0; }
.step-intro{ color: var(--ink-soft); }

fieldset.question, fieldset.field{
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  margin: 0 0 1.25rem;
  background: var(--panel);
}
legend{
  font-weight: 600;
  padding: 0 0.4rem;
}
.helper{
  font-size: 0.9rem;
  color: var(--ink-soft);
  margin: 0.4rem 0 0.6rem;
}
.flag-note{ font-size: 0.85rem; color: var(--warn-line); }
.optional-tag{ font-weight: 400; font-size: 0.85rem; color: var(--ink-soft); }

.radio-row{ display: flex; gap: 1.25rem; flex-wrap: wrap; }
.radio-row label, .radio-col label{ display: flex; align-items: flex-start; gap: 0.4rem; cursor: pointer; }
.radio-col{ display: flex; flex-direction: column; gap: 0.6rem; }

.checkbox-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.5rem 1rem;
}
.checkbox-grid label{ display: flex; align-items: flex-start; gap: 0.4rem; cursor: pointer; }

.standalone-check{ display: flex; align-items: flex-start; gap: 0.4rem; cursor: pointer; margin: 0.5rem 0; }

.callout{
  border: 1px dashed var(--warn-line);
  background: var(--warn-bg);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin-top: 0.75rem;
}

.verify-flag{
  display: inline-block;
  background: var(--warn-bg);
  border: 1px solid var(--warn-line);
  color: var(--warn-line);
  font-weight: 600;
  font-size: 0.78rem;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}

input[type="text"], input[type="search"], textarea, select{
  width: 100%;
  font: inherit;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
}
textarea{ resize: vertical; }

.field{ margin-bottom: 1.25rem; }
.field label{ display: block; font-weight: 600; margin-bottom: 0.3rem; }

button{
  font: inherit;
  cursor: pointer;
  background: var(--navy);
  color: #fff;
  border: 1px solid var(--navy);
  border-radius: 6px;
  padding: 0.55rem 1.1rem;
}
button:hover{ background: var(--navy-dark); }
button.danger-btn{ background: var(--danger-bg); color: var(--danger-line); border-color: var(--danger-line); }
button.danger-btn:hover{ background: var(--danger-line); color: #fff; }
button:disabled{ opacity: 0.5; cursor: not-allowed; }

.form-actions, .button-row{ display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 0.5rem; }

.result-box{
  border-radius: var(--radius);
  padding: 1rem;
  border: 1px solid var(--line);
  background: var(--panel);
  margin: 1rem 0;
}
.result-box.ok{ background: var(--ok-bg); border-color: var(--ok-line); }
.result-box.warn{ background: var(--warn-bg); border-color: var(--warn-line); }
.result-box.danger{ background: var(--danger-bg); border-color: var(--danger-line); }
.result-box p:first-child{ margin-top: 0; }

.explainer{ margin: 1.5rem 0; }
.explainer summary{ cursor: pointer; font-weight: 600; }

/* Inventory table */
.table-wrap{ overflow-x: auto; }
table{
  width: 100%;
  border-collapse: collapse;
  margin: 0.75rem 0;
  background: var(--panel);
}
th, td{
  text-align: left;
  padding: 0.6rem 0.7rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  font-size: 0.92rem;
}
thead th{ background: #ece7db; }
.empty-note{ color: var(--ink-soft); font-style: italic; }

.badge{
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}
.badge.in-scope{ background: var(--ok-bg); color: var(--ok-line); border: 1px solid var(--ok-line); }
.badge.possible{ background: var(--warn-bg); color: var(--warn-line); border: 1px solid var(--warn-line); }
.badge.uncertain{ background: var(--danger-bg); color: var(--danger-line); border: 1px solid var(--danger-line); }
.badge.out{ background: #eceae3; color: var(--ink-soft); border: 1px solid var(--line); }

.classification-preview{
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 0.75rem;
  background: #fbfaf6;
}

.row-actions{ display: flex; gap: 0.4rem; flex-wrap: wrap; }
.row-actions button{ padding: 0.3rem 0.6rem; font-size: 0.85rem; }

/* Draft output */
#draft-container{
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-top: 1rem;
}
.counsel-banner{
  background: var(--danger-bg);
  border: 1px solid var(--danger-line);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  margin-bottom: 1.25rem;
}
.counsel-banner h3{ margin-top: 0; color: var(--danger-line); }
.counsel-banner ul{ margin: 0.4rem 0 0; padding-left: 1.4rem; }

.draft-article table{ font-size: 0.9rem; }
.draft-article .sensitive{ font-weight: 700; }
.draft-article .source-line{ font-size: 0.85rem; color: var(--ink-soft); }
.draft-article .notice-block{ font-size: 0.85rem; border-top: 1px solid var(--line); margin-top: 1.25rem; padding-top: 0.75rem; color: var(--ink-soft); }
.draft-article .counsel-inline{ color: var(--warn-line); font-weight: 600; }

/* Examples */
.example-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}
.example-card{
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  display: flex;
  flex-direction: column;
}
.example-card h3{ margin-top: 0; font-size: 1.05rem; }
.fictional-tag{
  display: inline-block;
  background: var(--navy);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  margin-bottom: 0.4rem;
}
.example-card p{ flex: 1; font-size: 0.9rem; }
.example-why{ font-size: 0.82rem; color: var(--ink-soft); font-style: italic; }

/* Export cards */
.export-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}
.export-card{
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
}
.export-card h3{ margin-top: 0; }
.file-label{
  display: inline-block;
  background: #fff;
  border: 1px solid var(--navy);
  color: var(--navy);
  border-radius: 6px;
  padding: 0.55rem 1.1rem;
  cursor: pointer;
}
.file-label input[type="file"]{
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0;
}

/* Step controls */
.step-controls{
  position: sticky;
  bottom: 0;
  background: var(--panel);
  border-top: 1px solid var(--line);
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
}
.step-position{ font-size: 0.9rem; color: var(--ink-soft); }

/* Footer */
.site-footer{
  background: var(--navy-dark);
  color: #e6e9eb;
  padding: 1.5rem 1rem 2rem;
  font-size: 0.88rem;
}
.site-footer a{ color: #bcd4e6; }
.site-footer p{ max-width: var(--max-width); margin: 0.5rem auto; }
.footer-notice{ font-size: 0.95rem; }
.related-resource{
  max-width: var(--max-width);
  margin: 1.25rem auto 0;
  padding-top: 1rem;
  border-top: 1px dashed #4a6270;
  font-size: 0.85rem;
  color: #c9d2d6;
}

/* Print: show only the inventory table (Step 2) and the draft (Step 3), never the forms/nav/buttons */
@media print{
  .skip-link, .notice-bar, .progress-nav, .step-controls,
  #screener-form, #item-form, .example-grid, #clear-all-btn,
  .export-grid, .site-footer, #refresh-draft-btn, .row-actions,
  .step-intro, .explainer, #step-1, #step-4, #step-5,
  #inventory-table th:last-child, #inventory-table td:last-child { display: none !important; }

  .hero .hero-sub{ display: none; }
  body{ background: #fff; color: #000; }
  #draft-container, table{ border-color: #000; }
  #step-2[hidden], #step-3[hidden]{ display: block !important; }
}

@media (max-width: 600px){
  .hero h1{ font-size: 1.6rem; }
  .step-controls{ flex-wrap: wrap; gap: 0.5rem; }
}

/* Reading rhythm and interactive states */
html{ line-height: 1.6; }
:root{ --line: #aaa99f; --warn-line: #805010; --ok-line: #285c3a; --danger-line: #8c3026; }
h1, h2, h3, h4{ letter-spacing: -0.02em; }
h2{ font-size: clamp(1.45rem, 3vw, 1.85rem); }
h3{ line-height: 1.3; }
p, li{ overflow-wrap: anywhere; }
.hero{ padding-top: 2rem; }
.hero h1{ font-size: clamp(2rem, 5vw, 2.75rem); }
.hero .tagline, .hero .hero-sub{ max-width: 70ch; }
main{ padding-top: 2rem; }
.step-intro{ max-width: 72ch; margin-bottom: 1.5rem; }
fieldset.question, fieldset.field{ padding: 1.1rem 1.25rem 1.25rem; margin-bottom: 1.5rem; }
legend{ max-width: 100%; line-height: 1.4; }
.helper{ max-width: 80ch; }
.radio-row, .radio-col, .checkbox-grid{ margin-top: 0.6rem; }
.field .radio-row label, .field .radio-col label, .field .checkbox-grid label, .field label.standalone-check{
  display: flex; font-weight: 400; margin-bottom: 0;
}
input[type="checkbox"], input[type="radio"]{ flex: 0 0 auto; width: 1.1em; height: 1.1em; margin: 0.25em 0 0; accent-color: var(--navy); }
input[type="text"], input[type="search"], textarea, select{ border-color: #727a7d; padding: 0.65rem 0.7rem; }
input::placeholder, textarea::placeholder{ color: #59636a; opacity: 1; }
button, .file-label{ min-height: 2.75rem; font-weight: 600; }
button:hover:not(:disabled){ background: var(--navy-dark); color: #fff; }
.step-btn:hover:not(:disabled){ background: #e8eef0; color: var(--navy-dark); }
.step-btn[aria-current="step"]:hover{ background: var(--navy-dark); color: #fff; }
.file-label{ margin-top: 0.5rem; }
.file-label:focus-within{ outline: 3px solid var(--focus); outline-offset: 2px; }
.file-label:hover{ background: #e8eef0; }
.result-box, .callout, .counsel-banner{ border-left-width: 4px; }
.result-box p:last-child, .callout p:last-child{ margin-bottom: 0; }
.table-wrap{ max-width: 100%; overscroll-behavior-inline: contain; }
#inventory-table{ min-width: 680px; }
th, td{ overflow-wrap: anywhere; }
thead th{ color: var(--navy-dark); }
.badge{ line-height: 1.4; }
.draft-article{ line-height: 1.6; }
.draft-article table{ table-layout: fixed; }
.example-card h3{ margin: 0.4rem 0; }
.example-card p{ flex: initial; }
.example-card button{ align-self: flex-start; margin-top: auto; }
.fictional-tag{ align-self: flex-start; }
.step-controls{ z-index: 9; box-shadow: 0 -3px 12px rgb(18 42 55 / 8%); }

@media (max-width: 600px){
  .progress-nav{ position: static; }
  #step-indicator{ flex-wrap: nowrap; overflow-x: auto; padding-bottom: 0.75rem; }
  #step-indicator li{ flex: 0 0 auto; }
  .checkbox-grid, .example-grid, .export-grid{ grid-template-columns: minmax(0, 1fr); }
  fieldset.question, fieldset.field{ padding: 0.9rem; }
  .step-controls{ flex-wrap: nowrap; }
  .step-position{ text-align: center; }
  .draft-article table{ table-layout: auto; }
  #draft-container{ overflow-x: auto; }
  .draft-article table{ min-width: 560px; }
}

@media print{
  @page{ margin: 15mm; }
  html, body{ background: #fff !important; color: #000 !important; font-size: 10pt; }
  .site-header{ background: #fff !important; color: #000 !important; padding: 0; }
  .notice-bar{ display: block !important; background: #fff !important; color: #000 !important; padding: 0; font-size: 9pt; }
  .hero{ padding: 0; }
  .hero .mark{ display: none; }
  .hero h1, .hero .tagline{ color: #000 !important; }
  .hero h1{ font-size: 18pt; }
  main{ max-width: none; padding: 0; }
  #step-2, #step-3{ display: block !important; }
  #step-2 > h2{ display: none; }
  #step-2 > h3, #step-3 > h2{ margin-top: 1.2em; }
  #inventory-empty{ display: block !important; }
  #inventory-empty[hidden]{ display: none !important; }
  #inventory-table th:last-child, #inventory-table td:last-child{ display: none; }
  .table-wrap, #draft-container{ overflow: visible; }
  #inventory-table, .draft-article table{ min-width: 0; table-layout: fixed; }
  #draft-container{ padding: 0; border: 0; }
  table{ width: 100%; font-size: 9pt; }
  th, td{ font-size: 9pt; border: 1px solid #555; padding: 0.3em; }
  thead{ display: table-header-group; }
  tr{ break-inside: avoid; page-break-inside: avoid; }
  h2, h3{ break-after: avoid; page-break-after: avoid; }
  .badge, .verify-flag, .counsel-banner, .result-box{ color: #000 !important; background: #fff !important; border-color: #000 !important; }
  .draft-article .source-line, .draft-article .notice-block, .draft-article .counsel-inline{ color: #000; }
  a{ color: #000; }
}
