:root {
  --bg: #F7F6F2; --surface: #FFFFFF; --border: #E2E0D8; --border-strong: #B8B4A8;
  --text: #1A1917; --text-secondary: #5C5A54; --text-hint: #9C9A94;
  --accent: #C84B0C; --accent-light: #FEF0E9;
  --blue: #1B4F8A; --blue-light: #E8F0FA;
  --green: #1E6B3C; --green-light: #EAF4EE;
  --yellow: #7A5C00; --yellow-light: #FEF8E7;
  --red: #8B1A1A; --red-light: #FDEAEA;
  --r: 8px; --rs: 5px; --shadow: 0 1px 4px rgba(0,0,0,.08);
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5; }
button { font-family: inherit; }
a { color: var(--blue); }

/* ── Top bar ── */
.topbar { background: var(--text); color: white; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 8px; position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 8px rgba(0,0,0,.2); }
.topbar-brand { font-size: 13px; font-weight: 700; letter-spacing: .08em; color: var(--accent); text-decoration: none; }
.topbar-mid { flex: 1; min-width: 0; display: flex; align-items: center; }
.topbar-visit { font-size: 13px; color: #ddd; display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; }
.bar-date { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.2); color: white; border-radius: var(--rs); padding: 3px 6px; font-size: 12px; color-scheme: dark; }
.topbar-actions { display: flex; gap: 8px; align-items: center; }
.topbar-btn { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); color: white; border-radius: var(--rs); padding: 5px 10px; font-size: 12px; cursor: pointer; white-space: nowrap; }
.topbar-btn:hover { background: rgba(255,255,255,.2); }
.savestate { font-size: 11px; color: #B8B4A8; white-space: nowrap; }
.savestate.ok { color: #7FCF9B; }
.savestate.warn { color: #E8C468; }
.savestate.bad { color: #F09090; }

/* ── Sticky visit bar ── */
.stickybar { background: #2A2825; border-bottom: 1px solid #3A3835; padding: 6px 16px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; position: sticky; top: 49px; z-index: 90; font-size: 12px; color: #B8B4A8; }
.sk-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; color: #9C9A94; }
.sk-factory { color: white; font-weight: 500; font-size: 13px; }
.sk-sep { color: #3A3835; }

/* ── Page & header ── */
.page { padding-bottom: 80px; max-width: 1080px; margin: 0 auto; }
.page-header { background: var(--surface); border-bottom: 3px solid var(--accent); padding: 20px 24px 16px; }
.page-title { font-size: 20px; font-weight: 700; }
.page-meta { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }
.page-values { font-size: 12px; color: var(--text-hint); margin-top: 6px; line-height: 1.6; }
.part-header { background: var(--text); color: white; padding: 10px 20px; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; margin-top: 16px; }

/* ── Sections ── */
.section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); margin: 12px 12px; overflow: hidden; box-shadow: var(--shadow); }
.section-header { display: flex; align-items: center; justify-content: space-between; padding: 13px 16px; cursor: pointer; user-select: none; border-bottom: 1px solid var(--border); gap: 8px; }
.section-header:hover { background: var(--bg); }
.section-title { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.section-num { background: var(--accent); color: white; border-radius: 4px; padding: 1px 6px; font-size: 11px; font-weight: 700; font-family: 'Courier New', monospace; }
.section-tag { font-size: 10px; font-weight: 600; color: var(--text-hint); border: 1px solid var(--border); border-radius: 10px; padding: 1px 8px; }
.tag-private { color: var(--red); border-color: var(--red-light); background: var(--red-light); }
.section-toggle { font-size: 11px; color: var(--text-hint); white-space: nowrap; }
.section-body { padding: 16px; display: none; }
.section-body.open { display: block; }
.section-hint { font-size: 12px; color: var(--text-secondary); margin-bottom: 14px; padding: 8px 12px; background: var(--blue-light); border-left: 3px solid var(--blue); border-radius: 0 var(--rs) var(--rs) 0; }

/* ── Fields ── */
.field-grid { display: flex; flex-wrap: wrap; gap: 14px; }
.field-group { display: flex; flex-direction: column; gap: 6px; }
.w-full { width: 100%; }
.w-half { width: calc(50% - 7px); }
.w-third { width: calc(33.333% - 10px); }
.field-label { font-size: 12px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .04em; }
.field-hint { font-size: 12px; color: var(--text-hint); }
.field-input { width: 100%; padding: 9px 11px; border: 1px solid var(--border); border-radius: var(--rs); font-size: 15px; background: var(--bg); color: var(--text); }
.field-input:focus { outline: none; border-color: var(--accent); background: white; }
textarea.field-input, textarea { min-height: 44px; resize: vertical; font-family: inherit; }
input, select, textarea { font-size: 15px; }

/* ── Pills ── */
.pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pill { border: 1px solid var(--border); background: var(--surface); color: var(--text-secondary); border-radius: 16px; padding: 6px 13px; font-size: 12.5px; font-weight: 500; cursor: pointer; }
.pills-compact .pill { padding: 4px 10px; font-size: 12px; }
.pill:hover { border-color: var(--border-strong); }
.pill-ok.active { background: var(--green-light); border-color: var(--green); color: var(--green); font-weight: 700; }
.pill-warn.active { background: var(--yellow-light); border-color: var(--yellow); color: var(--yellow); font-weight: 700; }
.pill-bad.active { background: var(--red-light); border-color: var(--red); color: var(--red); font-weight: 700; }
.pill-na.active { background: #EEEDE8; border-color: var(--border-strong); color: var(--text-secondary); font-weight: 700; }

/* ── Checkboxes ── */
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 6px; }
.check-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--rs); cursor: pointer; font-size: 13px; }
.check-item:hover { background: var(--bg); }
.check-item input[type=checkbox] { accent-color: var(--accent); width: 16px; height: 16px; flex-shrink: 0; }
.check-item.checked { background: var(--accent-light); border-color: var(--accent); }

/* ── Tables ── */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { background: var(--bg); padding: 8px 8px; text-align: left; font-size: 11px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .04em; border-bottom: 2px solid var(--border); }
.data-table td { padding: 6px 5px; border-bottom: 1px solid var(--border); vertical-align: top; }
.data-table tr:last-child td { border-bottom: none; }
.data-table td input, .data-table td textarea, .data-table td select { width: 100%; padding: 7px 8px; border: 1px solid var(--border); border-radius: var(--rs); font-size: 13px; background: var(--bg); color: var(--text); font-family: inherit; resize: none; }
.data-table td input:focus, .data-table td textarea:focus, .data-table td select:focus { outline: none; border-color: var(--accent); background: white; }
.row-num { color: var(--text-hint); font-size: 11px; text-align: center; padding-top: 12px !important; }
.empty-cell { color: var(--text-hint); font-size: 13px; font-style: italic; padding: 10px; text-align: center; }
.cell-center { text-align: center; }
.btn-add-row { background: none; border: 1px dashed var(--border-strong); border-radius: var(--rs); padding: 8px 14px; font-size: 12.5px; color: var(--text-secondary); cursor: pointer; margin-top: 8px; }
.btn-add-row:hover { border-color: var(--accent); color: var(--accent); }
.btn-seed { border-style: solid; margin-left: 8px; color: var(--blue); border-color: var(--blue-light); background: var(--blue-light); }
.btn-del { background: none; border: none; color: var(--text-hint); font-size: 14px; cursor: pointer; padding: 4px 6px; border-radius: var(--rs); white-space: nowrap; }
.btn-del:hover { color: var(--red); background: var(--red-light); }
.btn-primary { background: var(--accent); color: white; border: none; border-radius: var(--rs); padding: 10px 18px; font-size: 14px; font-weight: 600; cursor: pointer; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-secondary { background: var(--blue); }
.btn-tertiary { background: var(--green); }

/* ── Stations ── */
.station { border: 1px solid var(--border); border-radius: var(--rs); margin-bottom: 12px; overflow: hidden; }
.station-header { background: var(--bg); padding: 10px 12px; font-size: 13px; font-weight: 600; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.station[data-rate="major"] .station-header { background: var(--red-light); }
.station[data-rate="minor"] .station-header { background: var(--yellow-light); }
.station[data-rate="compliant"] .station-header { background: var(--green-light); }
.station-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); flex-shrink: 0; }
.station-name { margin-right: auto; }
.station-body { padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.station-checks { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.station-check { display: flex; align-items: center; gap: 6px; font-size: 12.5px; padding: 7px 9px; border: 1px solid var(--border); border-radius: var(--rs); cursor: pointer; line-height: 1.3; }
.station-check input { accent-color: var(--accent); }
.station-check.checked { background: var(--accent-light); border-color: var(--accent); }

/* ── Photos ── */
.photo-block { width: 100%; }
.photo-zone { border: 1.5px dashed var(--border-strong); border-radius: var(--rs); padding: 12px; text-align: center; cursor: pointer; background: var(--bg); }
.photo-zone:hover { border-color: var(--accent); background: var(--accent-light); }
.photo-zone.busy { opacity: .5; pointer-events: none; }
.photo-zone-label { font-size: 12px; color: var(--text-secondary); }
.photo-zone-label span { color: var(--accent); font-weight: 500; }
.photo-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.photo-thumb { position: relative; }
.photo-thumb img { width: 74px; height: 74px; object-fit: cover; border-radius: var(--rs); border: 1px solid var(--border); display: block; }
.photo-thumb-del { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%; background: var(--red); color: white; border: 1.5px solid white; font-size: 11px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.photo-log-item { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--border); }
.photo-log-item:last-child { border-bottom: none; }
.photo-log-thumb { width: 60px; height: 60px; object-fit: cover; border-radius: var(--rs); border: 1px solid var(--border); flex-shrink: 0; }
.photo-log-meta { flex: 1; }
.photo-log-station { font-size: 11px; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .04em; }
.photo-ts { font-weight: 400; color: var(--text-hint); text-transform: none; letter-spacing: 0; }
.photo-log-caption input { width: 100%; padding: 6px 8px; border: 1px solid var(--border); border-radius: var(--rs); font-size: 13px; background: var(--bg); margin-top: 4px; }
.photo-log-caption input:focus { outline: none; border-color: var(--accent); background: white; }
.photo-log-del { background: none; border: none; color: var(--text-hint); font-size: 16px; cursor: pointer; }
.photo-log-del:hover { color: var(--red); }

/* ── Check rows (golden sample / radar / jerry) ── */
.gs-check-row { display: grid; grid-template-columns: minmax(180px, 1.2fr) auto minmax(120px, 1fr); gap: 8px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--border); }
.gs-check-row:last-child { border-bottom: none; }
.gs-check-label { font-size: 13px; font-weight: 500; }
.gs-check-row input[type=text] { padding: 6px 8px; border: 1px solid var(--border); border-radius: var(--rs); font-size: 13px; background: var(--bg); }
.gs-check-row input[type=text]:focus { outline: none; border-color: var(--accent); background: white; }
.gs-card { border: 1px solid var(--border); border-radius: var(--rs); padding: 12px; margin-bottom: 12px; background: var(--surface); }
.gs-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.gs-card-num { font-size: 11px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .05em; }
.gs-photo-reminder { font-size: 12px; color: var(--yellow); background: var(--yellow-light); border-radius: var(--rs); padding: 7px 10px; margin-top: 10px; }
.field-row { display: grid; gap: 12px; }
.field-row-2 { grid-template-columns: 1fr 1fr; }

/* ── Stage completion ── */
.stagecomp-card { border: 1px solid var(--border); border-radius: var(--rs); padding: 12px; margin-top: 8px; }
.stagecomp-head { font-size: 12px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 10px; }
.pct-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 10px; }
.pct-cell { display: flex; flex-direction: column; gap: 4px; }
.pct-label { font-size: 10px; color: var(--text-hint); text-transform: uppercase; letter-spacing: .04em; }
.pct-cell input { padding: 8px; border: 1px solid var(--border); border-radius: var(--rs); font-size: 14px; background: var(--bg); width: 100%; }
.pct-cell input:focus { outline: none; border-color: var(--accent); background: white; }
.stagecomp-foot { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; }
.stagecomp-foot input[type=text] { padding: 7px 9px; border: 1px solid var(--border); border-radius: var(--rs); font-size: 13px; background: var(--bg); }

/* ── Contacts ── */
.contact-card { border: 1px solid var(--border); border-radius: var(--rs); padding: 12px 14px; margin-bottom: 10px; background: var(--bg); }
.contact-role-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.contact-role { font-size: 11px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .05em; }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.contact-grid-2 { grid-template-columns: 1fr 1fr; }
.contact-grid input, .contact-grid textarea { width: 100%; padding: 7px 9px; border: 1px solid var(--border); border-radius: var(--rs); font-size: 13px; background: white; font-family: inherit; }
.contact-grid input:focus, .contact-grid textarea:focus { outline: none; border-color: var(--accent); }
.contact-label { font-size: 10px; color: var(--text-hint); margin-bottom: 3px; text-transform: uppercase; letter-spacing: .04em; }

/* ── Mirror ── */
.mirror-block { background: var(--blue-light); border: 1px solid var(--blue); border-radius: var(--rs); padding: 12px; width: 100%; }
.mirror-block-label { font-size: 11px; font-weight: 700; color: var(--blue); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.mirror-block-content { font-size: 13px; white-space: pre-wrap; }
.mirror-block-content.empty { color: var(--text-hint); font-style: italic; }

/* ── Risk table ── */
.risk-legend { font-size: 11px; color: var(--text-hint); margin-bottom: 10px; display: flex; gap: 16px; flex-wrap: wrap; }
.c-ok { color: var(--green); } .c-warn { color: var(--yellow); } .c-bad { color: var(--red); }
.risk-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.risk-table th { background: var(--bg); padding: 8px 8px; text-align: left; font-size: 11px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; border-bottom: 2px solid var(--border); }
.risk-table td { padding: 8px 6px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.risk-table tr:last-child td { border-bottom: none; }
.risk-score { display: flex; gap: 4px; }
.risk-dot { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--border); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; color: transparent; background: white; }
.risk-dot:hover { border-color: var(--border-strong); }
.risk-dot.active-1, .risk-dot.active-2 { background: var(--green-light); border-color: var(--green); color: var(--green); }
.risk-dot.active-3 { background: var(--yellow-light); border-color: var(--yellow); color: var(--yellow); }
.risk-dot.active-4 { background: #FDEBD0; border-color: #B85C00; color: #B85C00; }
.risk-dot.active-5 { background: var(--red-light); border-color: var(--red); color: var(--red); }
.prev-score { font-size: 12px; font-weight: 700; color: var(--text-hint); }
.prev-score.s4, .prev-score.s5 { color: var(--red); }
.prev-score.s3 { color: var(--yellow); }
.prev-score.s1, .prev-score.s2 { color: var(--green); }
.trend-select, .risk-note-input { padding: 6px 8px; border: 1px solid var(--border); border-radius: var(--rs); font-size: 12px; background: var(--bg); width: 100%; }
.trend-select:focus, .risk-note-input:focus { outline: none; border-color: var(--accent); background: white; }

/* ── Carry-forward ── */
.cf-card { border: 1px solid var(--border); border-left: 4px solid var(--yellow); border-radius: var(--rs); padding: 10px 12px; margin-bottom: 8px; background: var(--surface); }
.cf-card[data-status="closed-verified"] { border-left-color: var(--green); opacity: .75; }
.cf-card[data-status="dropped"] { border-left-color: var(--border-strong); opacity: .6; }
.cf-card[data-status="overdue"] { border-left-color: var(--red); }
.cf-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 6px; }
.cf-title { font-size: 14px; font-weight: 600; }
.cf-meta { font-size: 11px; color: var(--text-hint); }
.cf-detail { font-size: 12.5px; color: var(--text-secondary); margin-bottom: 8px; }
.cf-controls { display: grid; grid-template-columns: 200px 1fr; gap: 8px; }
.cf-controls select, .cf-controls input { padding: 7px 9px; border: 1px solid var(--border); border-radius: var(--rs); font-size: 13px; background: var(--bg); }

/* ── Findings ── */
.fd-card { border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: var(--rs); padding: 10px 12px; margin-bottom: 10px; }
.fd-card[data-kind="action"] { border-left-color: var(--blue); }
.fd-card[data-status="closed-verified"] { opacity: .7; }
.fd-head { display: grid; grid-template-columns: 64px 1fr 130px 130px 150px auto; gap: 6px; align-items: center; }
.fd-kind { font-size: 10px; font-weight: 700; letter-spacing: .05em; color: var(--accent); }
.fd-card[data-kind="action"] .fd-kind { color: var(--blue); }
.fd-head input, .fd-head select { padding: 7px 9px; border: 1px solid var(--border); border-radius: var(--rs); font-size: 13px; background: var(--bg); width: 100%; }
.fd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.fd-field textarea { width: 100%; padding: 7px 9px; border: 1px solid var(--border); border-radius: var(--rs); font-size: 13px; background: var(--bg); font-family: inherit; }
.fd-buttons { display: flex; gap: 8px; }

/* ── Resolution ── */
.res-card { border: 1px solid var(--border); border-left: 4px solid var(--border-strong); border-radius: var(--rs); padding: 10px 12px; margin-bottom: 8px; }
.res-card[data-state="answered"] { border-left-color: var(--green); }
.res-card[data-state="partial"] { border-left-color: var(--yellow); }
.res-card[data-state="open"] { border-left-color: var(--red); }
.res-head { margin-bottom: 6px; }
.res-src { font-size: 10px; font-weight: 700; color: var(--text-hint); text-transform: uppercase; letter-spacing: .04em; margin-right: 8px; }
.res-q { font-size: 13.5px; font-weight: 600; }
.res-controls { margin-bottom: 6px; }

/* ── Dashboard ── */
.factory-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; padding: 16px; }
.factory-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; }
.factory-card-add { border-style: dashed; background: transparent; box-shadow: none; }
.factory-name { font-size: 16px; font-weight: 700; }
.factory-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: 12px; color: var(--text-secondary); }
.badge { font-size: 11px; font-weight: 700; border-radius: 10px; padding: 2px 9px; background: var(--bg); border: 1px solid var(--border); }
.badge-warn { background: var(--yellow-light); color: var(--yellow); border-color: var(--yellow); }
.badge-ok { background: var(--green-light); color: var(--green); border-color: var(--green); }
.factory-visits { display: flex; flex-direction: column; gap: 4px; }
.visit-row { display: flex; gap: 8px; align-items: center; font-size: 13px; padding: 5px 0; border-bottom: 1px dashed var(--border); }
.visit-row a { text-decoration: none; flex: 1; }
.visit-status { font-size: 10px; font-weight: 700; text-transform: uppercase; }
.visit-status.ok { color: var(--green); } .visit-status.warn { color: var(--yellow); }
.visit-report-link { font-size: 12px; }
.settings-section { margin: 16px; }

/* ── Auth ── */
.auth-card { max-width: 400px; margin: 9vh auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 28px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; }
.auth-brand { font-size: 13px; font-weight: 700; letter-spacing: .1em; color: var(--accent); }
.auth-card h1 { font-size: 20px; }
.auth-hint { font-size: 12.5px; color: var(--text-secondary); }
.auth-error { font-size: 13px; color: var(--red); min-height: 2px; }

/* ── Toast ── */
#toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--text); color: white; border-radius: 20px; padding: 9px 18px; font-size: 13px; opacity: 0; pointer-events: none; transition: all .25s; z-index: 999; max-width: 90vw; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Report actions ── */
.report-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.report-bar { display: flex; gap: 10px; padding: 12px 16px; }

/* ── Report page ── */
.report-page { background: white; max-width: 860px; margin: 0 auto 60px; padding: 34px 40px; font-size: 14px; }
.rcover { border-bottom: 3px solid var(--accent); padding-bottom: 18px; margin-bottom: 20px; }
.rcover-brand { font-size: 13px; font-weight: 700; letter-spacing: .1em; color: var(--accent); }
.rcover h1 { font-size: 25px; margin: 4px 0 14px; }
.rcover-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; font-size: 14px; font-weight: 600; }
.rcover-grid span { display: block; font-size: 10px; font-weight: 700; color: var(--text-hint); text-transform: uppercase; letter-spacing: .05em; }
.rcover-byline { margin-top: 14px; font-size: 12px; color: var(--text-secondary); }
.rblock { margin-bottom: 22px; break-inside: avoid-page; }
.rblock h2 { font-size: 16px; border-bottom: 2px solid var(--border); padding-bottom: 4px; margin-bottom: 10px; }
.rpara { margin-bottom: 10px; }
.rlabel { font-size: 11px; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .05em; margin: 8px 0 3px; }
.rtext { white-space: normal; }
.rmuted { color: var(--text-hint); font-weight: 400; }
.rtable { width: 100%; border-collapse: collapse; font-size: 12.5px; margin: 6px 0 10px; }
.rtable th { background: var(--bg); text-align: left; padding: 5px 8px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-secondary); border-bottom: 1.5px solid var(--border); }
.rtable td { padding: 5px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.rchip { display: inline-block; font-size: 10.5px; font-weight: 700; border-radius: 3px; padding: 1px 7px; text-transform: uppercase; letter-spacing: .03em; }
.rchip-ok { background: var(--green-light); color: var(--green); }
.rchip-warn { background: var(--yellow-light); color: var(--yellow); }
.rchip-bad { background: var(--red-light); color: var(--red); }
.rchip-na { background: #EEEDE8; color: var(--text-secondary); }
.rstation { margin-bottom: 12px; }
.rstation-head { font-weight: 700; font-size: 13.5px; margin-bottom: 3px; display: flex; gap: 8px; align-items: center; }
.rchecks { font-size: 11.5px; color: var(--text-secondary); display: flex; gap: 12px; flex-wrap: wrap; margin: 2px 0; }
.rsub { border-left: 3px solid var(--border); padding-left: 12px; margin: 10px 0; }
.rphotos { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.rphotos figure { width: 168px; }
.rphotos-appendix figure { width: 235px; }
.rphotos img { width: 100%; border-radius: 4px; border: 1px solid var(--border); }
.rphotos figcaption { font-size: 10.5px; color: var(--text-secondary); margin-top: 3px; line-height: 1.35; }
.rres { border-left: 3px solid var(--border-strong); padding: 6px 10px; margin-bottom: 8px; }
.rres-answered { border-left-color: var(--green); }
.rres-partial { border-left-color: var(--yellow); }
.rres-open { border-left-color: var(--red); }
.rres-q { font-weight: 600; font-size: 13px; }
.rres-a { font-size: 12.5px; margin-top: 2px; }
.rfd { border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: 4px; padding: 8px 10px; margin-bottom: 8px; }
.rfd-action { border-left-color: var(--blue); }
.rfd-head { font-size: 13px; font-weight: 600; }
.rfd-kind { font-size: 9.5px; font-weight: 700; color: var(--accent); letter-spacing: .05em; margin-right: 4px; }
.rfd-action .rfd-kind { color: var(--blue); }
.rfd-row { font-size: 12px; margin-top: 3px; }
.rfd-row span { font-weight: 700; color: var(--text-secondary); font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; }
.rfooter { margin-top: 30px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 10.5px; color: var(--text-hint); text-align: center; }
.loading { text-align: center; padding: 60px; color: var(--text-hint); }

/* ── Print ── */
@media print {
  .no-print, .topbar, .stickybar, .report-bar { display: none !important; }
  body { background: white; }
  .report-page { max-width: none; margin: 0; padding: 0; font-size: 12.5px; }
  .rblock { break-inside: avoid-page; }
  .rphotos figure { width: 150px; }
  .rphotos-appendix figure { width: 200px; }
}

/* ── Mobile ── */
@media (max-width: 700px) {
  .w-half, .w-third { width: 100%; }
  /* Stack data tables into cards — one labeled field per line */
  .data-table thead { display: none; }
  .data-table, .data-table tbody { display: block; width: 100%; }
  .data-table tr { display: block; border: 1px solid var(--border); border-radius: var(--rs); padding: 8px 10px; margin-bottom: 10px; background: var(--surface); }
  .data-table td { display: block; border-bottom: none; padding: 4px 0; }
  .data-table td.row-num { display: none; }
  .data-table td[data-label]::before { content: attr(data-label); display: block; font-size: 10px; font-weight: 700; color: var(--text-hint); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 2px; }
  .data-table td:last-child::before { content: none !important; }
  .data-table td:last-child { text-align: right; }
  .data-table .empty-cell::before { content: none; }
  .station-checks { grid-template-columns: repeat(2, 1fr); }
  .pct-grid { grid-template-columns: repeat(3, 1fr); }
  .gs-check-row { grid-template-columns: 1fr; gap: 5px; }
  .contact-grid, .contact-grid-2, .fd-grid { grid-template-columns: 1fr; }
  .fd-head { grid-template-columns: 1fr auto; }
  .fd-head input[type=text] { grid-column: 1 / -1; }
  .cf-controls { grid-template-columns: 1fr; }
  .field-row-2 { grid-template-columns: 1fr; }
  .section { margin: 10px 8px; }
  .topbar-visit { display: none; }
  .rcover-grid { grid-template-columns: 1fr 1fr; }
  input, select, textarea, .pill { font-size: 16px; } /* prevents iOS zoom-on-focus */
  .pills-compact .pill { font-size: 13px; padding: 6px 11px; }
}
