:root {
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  color: #1b2926; background: #f5f7f4;
  --ink: #1b2926; --muted: #566660; --line: #dce4dd;
  --forest: #18312a; --accent: #206349; --mint: #afe8c7;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button { color: inherit; }
button:disabled { opacity: .55; cursor: default; }
:focus-visible { outline: 3px solid #328764; outline-offset: 3px; }
[hidden] { display: none !important; }
.sidebar { background: #172724; color: #ecf4ee; padding: 30px 16px 21px; display: flex; flex-direction: column; gap: 42px; }
.brand { display: flex; gap: 12px; align-items: center; padding: 0 12px; }
.brand-mark { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: #a8e6c0; color: #18312a; font-size: 1.65rem; }
.brand strong { display: block; font-size: 1.7rem; line-height: 1; letter-spacing: -.06em; }
.brand strong span { color: var(--mint); }
.brand small { display: block; color: #aac1b5; font-size: .81rem; margin-top: 4px; }
nav { display: grid; gap: 6px; }
nav button { background: none; border: 0; color: #ceded5; min-height: 46px; border-radius: 8px; padding: 0 11px; text-align: left; font-size: .875rem; display: flex; gap: 10px; align-items: center; }
nav button span { font-size: 1.16rem; color: #a9d6bf; }
nav button:hover, nav button[aria-current] { background: #2b433b; color: #fff; }
nav b { margin-left: auto; background: #435b50; border-radius: 20px; padding: 1px 7px; font-size: .81rem; }
nav b:empty { display: none; }
.workspace { margin-top: auto; border-top: 1px solid #3b5048; display: flex; gap: 10px; align-items: flex-start; padding: 18px 10px 0; font-size: .875rem; }
.workspace > span { background: var(--mint); width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; }
.account { align-items: center; justify-content: space-between; }
.account strong { overflow-wrap: anywhere; }
.account small { display: block; color: #aac1b5; margin-top: 4px; }
#logout { border: 0; background: none; color: #d4e6dc; padding: 6px 0; font-size: .875rem; }
#logout:hover { text-decoration: underline; }
.auth-view { grid-column: 1 / -1; min-height: 100vh; display: grid; align-items: center; justify-items: center; padding: 24px; }
.auth-panel { width: min(100%, 400px); border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 26px; }
.auth-panel .brand { padding: 0; margin-bottom: 24px; }
.auth-panel .brand small { color: var(--muted); }
.auth-panel h1 { font-size: 1.7rem; margin-bottom: 16px; }
#auth-form { display: grid; gap: 13px; }
#auth-form button { margin-top: 3px; }
#auth-error { margin-top: 12px; }
#user-form { align-items: flex-end; }
.quality-stats { margin-top: -10px; }
.quality-stats .stat { padding: 12px 18px; gap: 6px; }
.quality-stats .stat strong { font-size: 1.4rem; }
.content { max-width: 1450px; margin: auto; padding: 38px clamp(18px, 4vw, 50px) 60px; }
.title-row { display: flex; gap: 20px; align-items: center; justify-content: space-between; margin-bottom: 30px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(2rem, 4vw, 2.8rem); letter-spacing: -.055em; line-height: 1.12; }
h2 { font-size: 1.22rem; letter-spacing: -.025em; }
.muted { color: var(--muted); line-height: 1.45; margin-top: 8px; }
.primary, .secondary, .icon, .tab { border: 1px solid transparent; border-radius: 8px; font-weight: 650; font-size: .875rem; min-height: 42px; padding: 8px 14px; }
.primary { background: var(--forest); color: #fff; }
.primary:hover:not(:disabled) { background: #264a3d; }
.primary span { font-size: 1.12rem; line-height: 1; padding-right: 4px; }
.secondary, .icon { background: #fff; border-color: var(--line); }
.secondary:hover, .icon:hover { background: #f0f5ef; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 18px; display: grid; gap: 10px; font-size: .875rem; color: var(--muted); }
.stat strong { color: var(--ink); font-size: 2rem; line-height: 1; font-variant-numeric: tabular-nums; }
.stat:first-child { background: #e3f3e9; border-color: #c9e3d3; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 22px; overflow: hidden; }
.panel-head { display: flex; flex-wrap: wrap; gap: 14px; justify-content: space-between; align-items: center; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.registry-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
.registry-toolbar .filters { border-bottom: 0; }
.result-count { display: block; padding: 8px 14px; color: var(--muted); font-size: .875rem; }
.report-toolbar .result-count { padding: 0; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
th, td { text-align: left; padding: 13px 16px; vertical-align: middle; }
th { background: #f7f9f7; font-weight: 600; color: var(--muted); white-space: nowrap; }
tbody tr + tr { border-top: 1px solid #e8ede8; }
tbody tr:hover { background: #f9fbf9; }
td small { display: block; color: var(--muted); margin-top: 4px; font-size: .81rem; }
td strong, td small, #review-domain { overflow-wrap: anywhere; }
.tiny { min-height: 34px; padding: 5px 9px; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.job-actions button { white-space: nowrap; }
.domain-link { border: 0; background: none; padding: 0; text-align: left; font-weight: 650; overflow-wrap: anywhere; }
.domain-link:hover { text-decoration: underline; color: var(--accent); }
table:has(.job-actions) td:first-child { min-width: 170px; }
table:has(.job-actions) td:nth-child(4) { min-width: 145px; }
.tag { display: inline-block; border-radius: 12px; padding: 3px 9px; background: #eef1ef; white-space: nowrap; font-size: .875rem; }
.tag.classified { background: #e0f2e6; color: #185638; }
.tag.running { background: #e2edf9; color: #255474; }
.tag.error { background: #f9e4e2; color: #8a362c; }
.tag.review { background: #f7ecd2; color: #704d17; }
.tag.manual { background: #e5efe8; color: #315444; }
.domain-status-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.domain-status-bar button { margin-left: auto; }
.app-source { font-size: .875rem; margin-bottom: 10px; }
.app-source a { color: var(--accent); }
.app-import-errors { border-top: 1px solid var(--line); }
.app-import-errors summary { cursor: pointer; padding: 13px 20px; }
.progress { min-width: 150px; padding: 7px 14px 12px; font-size: .875rem; }
.progress span { color: var(--muted); }
progress { display: block; width: 100%; height: 7px; margin-top: 6px; accent-color: #30815c; }
.empty { color: var(--muted); padding: 34px 20px; text-align: center; }
.filters { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.field { display: grid; gap: 6px; min-width: 140px; font-size: .875rem; color: var(--muted); }
.category-filter summary { border: 1px solid #cdd9d0; border-radius: 7px; padding: 9px 11px; min-height: 39px; cursor: pointer; color: var(--ink); }
.category-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; padding: 10px 0 0; color: var(--ink); }
.category-options label { display: flex; align-items: center; gap: 4px; cursor: pointer; }
.category-options input { accent-color: var(--accent); }
.category-options button { justify-self: start; grid-column: 1 / -1; }
.check-field { display: flex; align-items: center; gap: 6px; margin-top: 4px; cursor: pointer; }
.check-field input { accent-color: var(--accent); }
.secondary-fields { display: grid; gap: 8px; min-width: 0; margin: 16px 0; padding: 0; border: 0; }
.secondary-fields legend { padding: 0 0 7px; font-size: .875rem; color: var(--muted); }
.pagination { display: flex; justify-content: flex-end; align-items: center; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: .875rem; }
select, input:not([type]), input[type="search"], input[type="password"], textarea { color: var(--ink); border: 1px solid #cdd9d0; border-radius: 7px; min-height: 39px; padding: 6px 11px; background: #fff; width: 100%; font: inherit; }
textarea { resize: vertical; }
select { appearance: none; padding-right: 29px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%23566660' stroke-width='1.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.tab { background: #f5f8f4; }
.tab[aria-pressed="true"] { background: #e1eee6; color: #174b34; border-color: #bdd5c5; }
dialog { width: min(560px, calc(100vw - 32px)); border: 1px solid var(--line); border-radius: 14px; padding: 23px; color: var(--ink); max-height: 90vh; overflow: auto; }
dialog::backdrop { background: #17272485; }
.domain-dialog { width: min(700px, calc(100vw - 32px)); }
#domain-title { overflow-wrap: anywhere; }
#domain-detail { margin-top: 16px; }
#domain-detail h3 { font-size: 1rem; margin: 18px 0 8px; }
#domain-detail .result-count { padding-left: 0; }
.domain-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; margin: 12px 0; font-size: .875rem; }
.domain-fields dt { color: var(--muted); margin-bottom: 3px; }
.domain-fields dd { margin: 0; overflow-wrap: anywhere; }
.evidence { font-size: .875rem; padding-left: 19px; }
.evidence li + li { margin-top: 6px; }
.evidence a { color: var(--accent); }
.dialog-top, .dialog-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dialog-actions { justify-content: flex-end; margin-top: 20px; flex-wrap: wrap; }
.icon { font-size: 1.3rem; min-height: 34px; padding: 1px 10px; }
.drop { position: relative; margin: 14px 0 6px; display: grid; place-items: center; text-align: center; padding: 19px 10px; border: 1px dashed #75a58b; border-radius: 10px; background: #f1f8f3; cursor: pointer; color: #245b42; }
.drop.drag { background: #dcefe2; }
.drop:focus-within { outline: 3px solid #328764; outline-offset: 3px; }
.drop input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
#csv-format { font-size: .875rem; margin-bottom: 12px; }
#notice, .validation { padding: 12px 14px; margin-bottom: 16px; background: #e5f3e9; border-radius: 8px; overflow-wrap: anywhere; }
.bad { background: #fae8e6 !important; color: #843729; }
#review-form .field { margin-top: 16px; }
@media (max-width: 820px) {
  body { grid-template-columns: 1fr; }
  .sidebar { gap: 14px; padding: 13px; }
  nav { display: flex; flex-wrap: wrap; }
  .workspace { margin-top: 0; padding: 5px 10px 0; }
}
@media (max-width: 560px) {
  .brand { padding: 0 5px; }
  .title-row { align-items: flex-start; flex-direction: column; margin-bottom: 20px; }
  .content { padding-top: 24px; }
  .stats { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat { padding: 12px; }
  .panel-head { padding: 14px; }
}
