/* Field PRD - app.css
   Family navy/orange layout, same visual system as Flange Lookup and Field Code. */

:root {
  --navy: #141F2A;
  --navy-card: #1B2A38;
  --navy-card-hover: #223747;
  --navy-intro: #1D2D3C;
  --border: #35485B;
  --border-strong: #3A4B5D;
  --orange: #E85D10;
  --orange-soft: #E98949;
  --orange-hover: #EF8A45;
  --focus: #FFC188;
  --text: #EDF3F8;
  --text-dim: #B5C4D2;
  --text-muted: #8FA3B4;
  --ok: #1A7F4E;
  --hold: #B7791F;
  --bad: #B91C1C;
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-black: 'Arial Black', 'Arial Bold', Arial, Helvetica, sans-serif;
  --font-num: ui-monospace, Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--navy);
  color: var(--text);
  font-family: var(--font-ui);
  font-synthesis: none;
  -webkit-text-size-adjust: 100%;
}

body {
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  min-height: 100vh;
  overflow-x: hidden;
}

img { max-width: 100%; }
a { color: var(--orange-soft); }
a:visited { color: var(--orange-soft); }

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

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

#app {
  width: min(1200px, 100%);
  margin: 0 auto;
  padding: 16px 16px 96px;
}

/* ---------- Header ---------- */
header.app-header {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 10px 0 18px;
  flex-wrap: wrap;
}
header.app-header img.mark {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  flex-shrink: 0;
}
header.app-header .titles { min-width: 0; }
.eyebrow {
  color: var(--orange-soft);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  margin: 0 0 2px;
}
h1.app-title {
  font-family: var(--font-black);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 24px;
  margin: 0 0 4px;
  color: var(--text);
}
.tagline {
  color: var(--text-dim);
  font-size: 14px;
  margin: 0;
  line-height: 1.5;
}

/* ---------- Search + toolbar ---------- */
.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.search-wrap { flex: 1 1 260px; min-width: 200px; position: relative; }
.search-wrap input[type="search"] {
  width: 100%;
  min-height: 44px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--navy-card);
  color: var(--text);
  padding: 10px 14px;
  font-size: 16px;
}
.search-wrap input::placeholder { color: var(--text-muted); }

.lang-wrap { flex-shrink: 0; }
.lang-wrap select {
  min-height: 44px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--navy-card);
  color: var(--text);
  padding: 8px 10px;
  font-size: 16px;
  font-weight: 700;
}

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

/* ---------- Tabs / bottom nav ---------- */
nav.tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
}
nav.tabs button {
  min-height: 44px;
  padding: 8px 14px;
  background: transparent;
  color: var(--text-dim);
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
}
nav.tabs button[aria-pressed="true"] {
  background: var(--navy-card);
  color: var(--text);
  border-color: var(--border-strong);
}
nav.tabs button:hover { background: var(--navy-card-hover); }

/* ---------- Cards and panels ---------- */
.card {
  background: var(--navy-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 16px;
}
.card h3 { margin: 0 0 10px; font-size: 17px; letter-spacing: -0.01em; }
.card h4 { margin: 14px 0 8px; font-size: 14px; color: var(--text-dim); }

.panel {
  padding: 24px;
  border: 1px solid var(--border-strong);
  border-top: 4px solid var(--orange);
  background: var(--navy-intro);
  border-radius: 16px;
  margin-bottom: 18px;
}
.panel p { max-width: 680px; line-height: 1.55; }

.section-title { font-size: 19px; margin: 4px 0 12px; letter-spacing: -0.01em; }
.muted { color: var(--text-muted); }
.dim { color: var(--text-dim); }
.mt0 { margin-top: 0; }
.small-note { font-size: 12px; color: var(--text-muted); margin-top: 6px; }
[hidden] { display: none !important; }

/* ---------- Tier cards ---------- */
.tier-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: 16px;
}
.tier-card {
  display: flex;
  flex-direction: column;
  min-height: 230px;
}
.tier-card h3 { margin: 0 0 8px; }
.tier-card p.dim { flex: 1 1 auto; }
.tier-card .btn-primary { width: 100%; }

/* ---------- Buttons ---------- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 12px 22px;
  border: 0;
  background: var(--orange);
  color: var(--navy);
  font-size: 17px;
  font-weight: 750;
  border-radius: 9px;
  cursor: pointer;
}
.btn-primary:hover { background: var(--orange-hover); }
.btn-primary:disabled {
  background: #6E7880;
  color: #D8DEE3;
  cursor: not-allowed;
  opacity: .8;
}
.btn-secondary {
  min-height: 44px;
  padding: 10px 16px;
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
}
.btn-secondary:hover { background: var(--navy-card-hover); color: var(--text); }
.link-btn {
  background: none;
  border: 0;
  padding: 0;
  color: var(--orange-soft);
  text-decoration: underline;
  font-size: 14px;
  cursor: pointer;
  min-height: 44px;
}

/* ---------- Form fields ---------- */
label.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 12px;
}
label.field input:not([type="checkbox"]):not([type="file"]),
label.field select,
label.field textarea {
  min-height: 44px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--navy);
  color: var(--text);
  padding: 8px 12px;
  font-size: 16px;
}
label.field textarea {
  min-height: 90px;
  resize: vertical;
}
select { max-width: 100%; }

.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: 0 16px;
}
.field-grid > * { min-width: 0; }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
}

/* ---------- Chips ---------- */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
button.chip {
  min-height: 44px;
  min-width: 44px;
  padding: 8px 14px;
  background: var(--navy-card);
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 22px;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
}
button.chip[aria-pressed="true"] {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff;
}
button.chip:hover { border-color: var(--orange-hover); }

/* ---------- Part grid ---------- */
.part-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(190px, 100%), 1fr));
  gap: 12px;
}
button.part-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  min-height: 150px;
  padding: 16px;
  background: var(--navy-card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-align: left;
  cursor: pointer;
}
button.part-card:hover {
  border-color: var(--orange-hover);
  background: var(--navy-card-hover);
}
.part-card .part-glyph {
  width: 44px;
  height: 44px;
  color: var(--orange-soft);
}
.part-card .part-name {
  font-size: 16px;
  font-weight: 750;
}
.part-card .part-hint {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.4;
}

/* ---------- Report sections ---------- */
.report-sheet {
  background: var(--navy-intro);
  border: 1px solid var(--border-strong);
  border-top: 4px solid var(--orange);
  border-radius: 16px;
  padding: 22px;
  margin-bottom: 18px;
}
.report-sheet h2 { margin-top: 0; }
.report-sheet h3 { font-size: 15px; color: var(--orange-soft); text-transform: uppercase; letter-spacing: .06em; }
.section-card {
  background: var(--navy-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  margin: 12px 0;
}
.section-card .section-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.photo-item {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--navy);
}
.photo-item img {
  width: 100%;
  height: 110px;
  object-fit: cover;
  display: block;
}
.photo-item .photo-caption {
  padding: 8px;
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.3;
}
.photo-item button.remove-photo {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 0;
  background: rgba(20,31,42,.88);
  color: #fff;
  cursor: pointer;
}

.part-editor {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-top: 14px;
}
.part-editor:first-of-type {
  border-top: 0;
  margin-top: 0;
  padding-top: 0;
}
.part-editor-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}
.part-editor-head strong { font-size: 15px; }

.badge-pass, .badge-fail, .badge-hold, .badge-copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 700;
}
.badge-pass { background: rgba(26,127,78,.2); color: #9BE3BE; border: 1px solid var(--ok); }
.badge-fail { background: rgba(185,28,28,.2); color: #FFB9B9; border: 1px solid var(--bad); }
.badge-hold { background: rgba(183,121,31,.18); color: #F0C07A; border: 1px solid var(--hold); }
.badge-copy { background: rgba(26,127,78,.2); color: #9BE3BE; border: 1px solid var(--ok); }

/* ---------- Report preview metadata ---------- */
.report-meta {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr));
  gap: 10px 18px;
  margin: 0 0 18px;
}
.report-meta .meta-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px dashed var(--border);
  padding-bottom: 6px;
}
.report-meta dt { color: var(--text-dim); font-size: 13px; }
.report-meta dd {
  margin: 0;
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  text-align: right;
  overflow-wrap: anywhere;
}

/* ---------- Drop zone ---------- */
.drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  border: 2px dashed var(--border-strong);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  margin: 12px 0;
}
.drop-zone:hover, .drop-zone.dragging {
  border-color: var(--orange-soft);
  background: rgba(232,93,16,.08);
}
.drop-zone strong { font-size: 16px; }

progress.copy-progress {
  display: block;
  width: 100%;
  height: 14px;
  margin: 12px 0 8px;
  accent-color: var(--orange);
}

/* ---------- Search result cards ---------- */
.result-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}
.result-head h2 { margin: 0 0 6px; font-size: 18px; }
.topic {
  margin: 0 0 4px;
  color: var(--orange-soft);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.standard-badge {
  flex-shrink: 0;
  background: var(--navy-card-hover);
  color: var(--text-dim);
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 700;
}
.summary { color: var(--text-dim); line-height: 1.5; }
.related-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.related-chip {
  min-height: 40px;
  padding: 7px 12px;
  border: 1px solid var(--border);
  background: var(--navy);
  color: var(--text-dim);
  border-radius: 20px;
  cursor: pointer;
}

/* ---------- Sources ---------- */
details.source-group {
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
  padding: 4px 12px;
}
details.source-group summary {
  cursor: pointer;
  padding: 8px 0;
  font-size: 14px;
  font-weight: 650;
  color: var(--text);
}
ul.sources { list-style: none; margin: 0; padding: 0; }
ul.sources li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  word-break: break-word;
}
ul.sources li:last-child { border-bottom: 0; }
ul.sources li small { display: block; color: var(--text-muted); margin-top: 2px; }

/* ---------- Legal modal ---------- */
iframe.legal-frame {
  width: 100%;
  min-height: 320px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  margin-top: 10px;
}
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 20, 0.72);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px;
  z-index: 50;
}
.modal-overlay[hidden] { display: none; }
.modal-panel {
  max-width: 680px;
  width: 100%;
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  margin: auto;
  background: var(--navy-intro);
  border: 1px solid var(--border-strong);
  border-top: 4px solid var(--orange);
  border-radius: 16px;
  padding: 26px;
}
.modal-panel h2 { margin-top: 0; }
.modal-panel .btn-primary { width: 100%; margin-top: 16px; }
.legal-assent-panel > p { line-height: 1.5; }
.assent-advisory {
  border-left: 4px solid var(--orange-soft);
  background: rgba(232, 93, 16, .12);
  padding: 10px 12px;
}
.legal-switches { display: flex; flex-wrap: wrap; gap: 8px; }
.legal-copy-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.legal-copy-links a { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.legal-switches button[aria-pressed="true"] {
  border-color: var(--orange-soft);
  color: var(--text);
  background: var(--navy-card-hover);
}
iframe.legal-gate-frame {
  min-height: 220px;
  height: 30vh;
  max-height: 340px;
  margin: 10px 0 14px;
}
.consent-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
  cursor: pointer;
}
.consent-row input {
  width: 22px;
  height: 22px;
  margin: 0;
  accent-color: var(--orange);
}
.assent-error {
  color: #FFE1E1;
  background: rgba(185, 28, 28, .3);
  border: 1px solid #E87171;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
}
.decline-box {
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.45;
}
body.legal-gated { overflow: hidden; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  max-width: min(480px, calc(100vw - 32px));
  background: var(--navy-intro);
  border: 1px solid var(--orange-soft);
  border-radius: 10px;
  padding: 12px 16px;
  color: var(--text);
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
  z-index: 80;
}

/* ---------- Responsive ---------- */
@media (max-width: 767px) {
  #app { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  nav.tabs {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    margin: 0;
    background: var(--navy-card);
    border-top: 1px solid var(--border);
    border-bottom: 0;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    justify-content: space-between;
    overflow-x: auto;
    z-index: 20;
  }
  nav.tabs button {
    flex: 1 1 auto;
    font-size: 11px;
    padding: 8px 4px;
    border-radius: 6px;
    white-space: nowrap;
  }
  h1.app-title { font-size: 20px; }
  .part-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 480px) {
  .modal-overlay { padding: 8px; }
  .modal-panel {
    max-height: calc(100vh - 16px);
    max-height: calc(100dvh - 16px);
    padding: 18px;
    border-radius: 12px;
  }
  iframe.legal-gate-frame {
    min-height: 180px;
    height: 27vh;
  }
  .part-grid { grid-template-columns: 1fr; }
}

@media (min-width: 768px) {
  #app { padding-left: 24px; padding-right: 24px; }
}

@media (min-width: 1024px) {
  h1.app-title { font-size: 28px; }
  .field-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1440px) {
  #app { padding-left: 32px; padding-right: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}

/* ---------- Print ---------- */
@media print {
  @page { background: #fff; }
  html, body { background: #fff !important; color: #111; color-scheme: light; }
  body { min-height: auto; }
  #app, #view { background: #fff !important; }
  #app { padding: 0 0 12mm; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
  header.app-header, .toolbar, nav.tabs, .no-print, .toast, .modal-overlay {
    display: none !important;
  }
  #view { color: #111; }
  .report-sheet, .section-card, .card, .panel {
    background: #fff;
    color: #111;
    border-color: #ccc;
    border-top-color: #E85D10;
    box-shadow: none;
  }
  .report-sheet h2, .report-sheet h3, .section-card, .photo-caption, .dim, .summary {
    color: #111;
  }
  .report-meta dt { color: #333; }
  .photo-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 5mm; }
  .photo-item { width: 100%; min-width: 0; margin: 0; background: #fff; break-inside: avoid; }
  .photo-item img { width: 100%; height: auto; max-height: 90mm; object-fit: contain; }
  .photo-item .photo-caption { color: #111; overflow-wrap: anywhere; }
  .section-card { break-inside: avoid; }
  .report-sheet { break-before: auto; break-inside: auto; }
}

/* Expanded field workflows, evidence panels and source-separated planner. */
[hidden] { display: none !important; }
.skip-link { position: absolute; left: 16px; top: -100px; padding: 12px; background: var(--navy-card); z-index: 100; }
.skip-link:focus { top: 8px; }
.device-status { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; color: var(--text-muted); font-size: 12px; margin: 0 0 18px; }
.tester-notice { border: 2px solid #d97b3f; background: #3f2a1d; color: #fff0e3; border-radius: 9px; padding: 13px 15px; margin: 0 0 18px; line-height: 1.55; }
.save-failed { color: #ffb5a9; font-weight: 700; }
.tabs { gap: 4px; }
.tabs .tab { min-height: 44px; }
.tier-grid { align-items: stretch; }
.tier-card { display: flex; flex-direction: column; }
.tier-card .btn-primary { margin-top: auto; }
.tier-card h3 { margin-top: 8px; }
.tier-card .method-limit { margin-bottom: 18px; }
.plain-list { margin: 12px 0; padding-left: 22px; line-height: 1.65; }
.plain-list li + li { margin-top: 8px; }
.planner-steps { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; margin-top: 20px; }
.step-button, .filter-chip { min-height: 44px; border: 1px solid var(--border); background: var(--navy-card); color: var(--text); border-radius: 9px; padding: 9px 12px; cursor: pointer; font-size: 14px; }
.filter-chip { min-width: 44px; }
.step-button[aria-current="step"], .filter-chip[aria-pressed="true"] { border-color: var(--orange-soft); background: #59301c; color: #fff; }
.planner-actions { margin-top: 24px; }
.field small { line-height: 1.5; font-size: 13px; font-weight: 400; }
.field select, .field input, .field textarea { max-width: 100%; min-width: 0; }
.field-note, .record-warning, .result-banner, .language-fallback { border-left: 3px solid var(--orange-soft); padding: 12px 14px; background: #213342; line-height: 1.6; border-radius: 0 8px 8px 0; }
.record-warning { border-color: #eab45f; background: #3d3323; color: #ffdfb0; }
.result-banner { font-size: 18px; font-weight: 650; }
.language-fallback { font-size: 14px; color: var(--text-dim); }
.status-badge { display: inline-flex; max-width: 100%; border: 1px solid #7692a8; border-radius: 5px; padding: 4px 8px; font-size: 11px; font-weight: 800; letter-spacing: .04em; color: #d9e8f5; overflow-wrap: anywhere; }
.source-card h3, .jurisdiction-card h3 { margin-top: 14px; }
.source-card p, .jurisdiction-card p, .learning-card p { line-height: 1.65; }
.source-card a, .jurisdiction-card a { display: inline-block; margin: 5px 0; overflow-wrap: anywhere; }
.rule-result { margin-top: 16px; padding: 18px 0 4px; border-top: 1px solid var(--border); }
.rule-result h4 { margin: 12px 0; }
.rule-interval { color: #f4c092; }
.due-date { font-family: var(--font-num); font-size: 21px; color: #c3efd5; }
.attention-card { border-color: #9e773f; }
.jurisdiction-card { border-top: 4px solid #779bb8; }
details > summary { cursor: pointer; min-height: 44px; padding: 12px 0; font-weight: 700; line-height: 1.45; }
details > summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.owner-details { border-top: 1px solid var(--border); margin-top: 20px; }
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.learning-card { margin-bottom: 12px; }
.glossary dt { font-weight: 700; color: #f4c092; margin-top: 20px; }
.glossary dd { margin: 8px 0; line-height: 1.65; }
.carried-field { padding: 12px; border: 1px solid #eab45f; border-radius: 8px; }
.carried-note { color: #ffdfb0; }
.verify-button { min-height: 44px; border: 1px solid #eab45f; color: var(--text); background: transparent; border-radius: 6px; align-self: start; cursor: pointer; }
.danger-button { color: #ffb5a9; }
.method-checklist { border-top: 1px solid var(--border); margin: 16px 0; }
.edit-panel > .btn-secondary { margin: 12px 0 0 12px; }
.lookup-photo { margin: 18px 0; padding: 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--navy-card); }
.lookup-photo img { display: block; width: 100%; max-height: 440px; object-fit: contain; border-radius: 7px; background: #0b1218; }
.lookup-photo figcaption { margin-top: 10px; color: var(--text-dim); font-size: 13px; }
.lookup-suggestion { display: grid; grid-template-columns: 28px minmax(0,1fr); gap: 10px; align-items: start; padding: 14px 0; border-top: 1px solid var(--border); cursor: pointer; }
.lookup-suggestion input { width: 21px; height: 21px; margin-top: 2px; accent-color: var(--orange); }
.lookup-suggestion-body { display: grid; gap: 5px; min-width: 0; overflow-wrap: anywhere; }
.lookup-suggestion-body small { color: var(--text-dim); line-height: 1.45; }
.lookup-conflict { background: rgba(95,44,31,.28); padding-left: 10px; padding-right: 10px; border-radius: 7px; }
.lookup-suggestion-body .conflict-note { color: #ffcf9e; }
.lookup-source-link { width: fit-content; font-size: 13px; }
.lookup-proof { margin-top: 20px; border-top: 2px solid var(--orange-soft); padding-top: 14px; }
.lookup-proof-entry { padding: 10px 0; border-top: 1px solid var(--border); }
.lookup-proof-entry p { margin: 7px 0; line-height: 1.5; }
.print-lookup-footer { display: none; }
.database-update { margin-top: 18px; }
.access-panel input { font-size: 16px; min-height: 48px; width: 100%; }
.access-panel button { min-height: 48px; }
.access-panel .btn-row { flex-wrap: wrap; }
.access-preview-notice { border-color: #eab45f; }
.unpaid-report-stamp { border: 3px solid #915d0a; padding: 12px; font-size: 20px; font-weight: 800; color: #ffd18b; text-align: center; }
#unpaid-print-watermark { display: none; }
.database-sources { margin-top: 24px; }
.database-source-row { display: flex; justify-content: space-between; gap: 16px; align-items: center; padding: 13px 0; border-top: 1px solid var(--border); }
.database-source-row small { display: block; margin-top: 5px; color: var(--text-dim); line-height: 1.4; }
.import-review { margin-top: 22px; padding: 14px; border: 1px solid var(--orange-soft); border-radius: 9px; }
.lookup-search-results { margin-top: 8px; }
@media(max-width:767px) {
  nav.tabs { justify-content: flex-start; flex-wrap: nowrap; padding-left: 8px; padding-right: 8px; scroll-padding: 8px; }
  #view button, #view input, #view select { scroll-margin-block: 88px; }
  nav.tabs button { flex: 0 0 auto; font-size: 13px; padding: 10px 12px; }
  .planner-steps { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .tier-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .tier-card { padding: 16px; }
  .tier-card h3 { font-size: 18px; line-height: 1.3; }
  .tier-card .btn-primary { font-size: 15px; padding: 11px 8px; }
  .btn-row { flex-wrap: wrap; }
  .database-source-row { align-items: flex-start; flex-direction: column; }
}
@media(max-width:430px) { .tier-grid { grid-template-columns: 1fr; } .field-grid { grid-template-columns: 1fr; } .edit-panel > .btn-secondary { margin-left: 0; } }
@media print {
  body.prd-unpaid #unpaid-print-watermark { display: block !important; position: fixed; inset: 40% 0 auto; z-index: 99999; color: rgba(100, 65, 15, .24); font: 800 38pt sans-serif; text-align: center; transform: rotate(-28deg); pointer-events: none; }
  .unpaid-report-stamp { color: #111; background: #fff; }
  @page { margin-bottom: 18mm; background: #fff; }
  .status-badge,.rule-interval,.due-date,.glossary dt,.small-note,.field-note,.record-warning,.result-banner { color: #111; background: #fff; }
  details:not([open]) > :not(summary) { display: block !important; }
  .plan-summary { break-before: auto; }
  .rule-result { break-inside: avoid; }
  .print-lookup-footer {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    margin: 0;
    border-top: 1px solid #333;
    padding-top: 2mm;
    color: #111;
    background: #fff;
    font-size: 8pt;
    line-height: 1.25;
  }
}
.credit-input{display:block;margin:1rem 0}.credit-input input,.credit-input select{display:block;box-sizing:border-box;width:100%;font:inherit;font-size:16px;padding:12px;margin-top:6px}.credit-history-row{border-top:1px solid #c7ccd0;padding:12px 0}.credit-delete summary{cursor:pointer;min-height:44px;padding:8px}.credits-panel .btn-row{flex-wrap:wrap}.credits-panel button{min-height:44px}.credits-panel [role=status]{overflow-wrap:anywhere}
