/* ---------- Thmanyah fonts ---------- */
@font-face { font-family: "Thmanyah Sans"; src: url("../fonts/thmanyahsans-Light.woff2") format("woff2"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Thmanyah Sans"; src: url("../fonts/thmanyahsans-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Thmanyah Sans"; src: url("../fonts/thmanyahsans-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Thmanyah Sans"; src: url("../fonts/thmanyahsans-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Thmanyah Sans"; src: url("../fonts/thmanyahsans-Black.woff2") format("woff2"); font-weight: 900; font-display: swap; }
@font-face { font-family: "Thmanyah Serif Display"; src: url("../fonts/thmanyahserifdisplay-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

/* ---------- Tokens ---------- */
:root {
    --bg: #f6f5f1;
    --surface: #ffffff;
    --surface-2: #faf9f6;
    --ink: #17171b;
    --ink-2: #4a4a52;
    --muted: #8a8a93;
    --line: #e7e5df;
    --accent: #1f4b3f;
    --accent-soft: #e6efe9;

    --review: #a3520b;  --review-soft: #fdf1e2;
    --copy: #2e4fbf;    --copy-soft: #e9eefc;
    --library: #5e6470; --library-soft: #eef0f2;

    --radius: 18px;
    --shadow: 0 1px 2px rgba(20, 20, 30, .04), 0 8px 24px -12px rgba(20, 20, 30, .10);
}
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #111214;
        --surface: #18191c;
        --surface-2: #1d1e22;
        --ink: #f1f0ec;
        --ink-2: #c3c2bd;
        --muted: #8b8b92;
        --line: #2a2b30;
        --accent: #7cc7a8;
        --accent-soft: #1d2a25;
        --review: #f3a85c;  --review-soft: #2d2216;
        --copy: #8ea6ff;    --copy-soft: #1c2236;
        --library: #a3a9b5; --library-soft: #23252a;
        --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -12px rgba(0, 0, 0, .5);
    }
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: "Thmanyah Sans", system-ui, sans-serif;
    font-size: 15px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
.num, .ltr { font-variant-numeric: tabular-nums; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
code, .path { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 12.5px; }

.container { max-width: 1160px; margin: 0 auto; padding: 0 20px; }

/* ---------- Top bar ---------- */
.topbar { border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 10; }
.topbar .container { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 16px; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--ink); color: var(--bg); font-size: 15px; }
.topbar .hint { color: var(--muted); font-size: 13px; display: flex; gap: 8px; align-items: center; }

/* ---------- Page header ---------- */
.page-head { padding: 44px 0 28px; }
.eyebrow { color: var(--muted); font-size: 13px; display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.eyebrow a:hover { color: var(--ink); }
h1 { font-family: "Thmanyah Serif Display", "Thmanyah Sans", serif; font-weight: 700; font-size: clamp(28px, 4vw, 40px); line-height: 1.25; margin: 0 0 10px; letter-spacing: -.01em; }
.lead { color: var(--ink-2); font-size: 16px; max-width: 680px; margin: 0; }
h2 { font-size: 19px; font-weight: 700; margin: 0; display: flex; align-items: center; gap: 10px; }
.section { margin: 0 0 36px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.section-head p { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; }

/* ---------- Cards & stats ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 36px; }
.stat { padding: 20px 22px; }
.stat .label { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 8px; }
.stat .value { font-size: 30px; font-weight: 700; margin-top: 6px; letter-spacing: -.02em; }
.stat .sub { color: var(--muted); font-size: 12.5px; }

.verdicts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 40px; }
.verdict { padding: 22px; display: flex; gap: 16px; align-items: flex-start; transition: transform .15s ease, border-color .15s ease; }
.verdict:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--tone) 40%, var(--line)); }
.verdict .icon { width: 44px; height: 44px; border-radius: 12px; flex: none; display: grid; place-items: center; background: var(--tone-soft); color: var(--tone); font-size: 18px; }
.verdict .title { font-weight: 700; font-size: 16px; }
.verdict .count { font-size: 26px; font-weight: 700; line-height: 1.2; }
.verdict .desc { color: var(--muted); font-size: 13px; margin-top: 4px; }

.tone-review  { --tone: var(--review);  --tone-soft: var(--review-soft); }
.tone-copy    { --tone: var(--copy);    --tone-soft: var(--copy-soft); }
.tone-library { --tone: var(--library); --tone-soft: var(--library-soft); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: start; font-weight: 500; color: var(--muted); font-size: 12.5px; padding: 14px 20px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 14px 20px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .12s ease; }
tbody tr:hover { background: var(--surface-2); }
td.end, th.end { text-align: end; }
.row-link { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }
.row-link .fa-folder { color: var(--muted); }
.go { color: var(--muted); font-size: 12px; }
tr:hover .go { color: var(--ink); }

/* ---------- Chips, badges, bars ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12.5px; color: var(--ink-2); }
.chip b { font-weight: 700; color: var(--ink); }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; background: var(--tone-soft); color: var(--tone); white-space: nowrap; }
.badge-exact { --tone: var(--accent); --tone-soft: var(--accent-soft); }
.badge-format { --tone: var(--review); --tone-soft: var(--review-soft); }
.badge-partial { --tone: var(--copy); --tone-soft: var(--copy-soft); }
.badge-partial b { font-weight: 700; }

.bar { display: flex; align-items: center; gap: 10px; min-width: 160px; }
.bar .track { flex: 1; height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.bar .fill { height: 100%; background: var(--copy); border-radius: 99px; }
.bar .pct { font-size: 12.5px; color: var(--ink-2); min-width: 38px; }

/* ---------- Report list ---------- */
.report-list { display: grid; gap: 12px; }
.report-item { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px; padding: 18px 22px; transition: transform .15s ease; }
.report-item:hover { transform: translateY(-2px); }
.report-item .icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 18px; }
.report-item .title { font-weight: 700; }
.report-item .meta { color: var(--muted); font-size: 13px; display: flex; gap: 16px; flex-wrap: wrap; }
.report-item .meta span { display: inline-flex; gap: 6px; align-items: center; }

/* ---------- Empty state / how-to ---------- */
.empty { padding: 48px 32px; text-align: center; }
.empty .big-icon { width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 18px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 26px; }
.empty h2 { justify-content: center; margin-bottom: 8px; }
.empty p { color: var(--ink-2); margin: 0 auto 20px; max-width: 520px; }
.terminal { direction: ltr; text-align: left; background: #141519; color: #e9e8e3; border-radius: 14px; padding: 16px 20px; overflow-x: auto; font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 13px; line-height: 1.8; max-width: 760px; margin: 0 auto; }
.terminal .c { color: #7d7f88; }

/* ---------- Toolbar (filters) ---------- */
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tabs { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 4px; gap: 2px; }
.tabs a { padding: 6px 14px; border-radius: 9px; font-size: 13.5px; color: var(--ink-2); display: inline-flex; gap: 8px; align-items: center; }
.tabs a.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); font-weight: 500; }
.tabs .n { color: var(--muted); font-size: 12px; }
.search { position: relative; }
.search input { font: inherit; font-size: 14px; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 8px 38px 8px 14px; width: 280px; max-width: 100%; outline: none; }
.search input:focus { border-color: var(--ink-2); }
.search i { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 13px; }

.file-cell .path { color: var(--ink); word-break: break-all; }
.file-cell .from { color: var(--muted); font-size: 12px; display: flex; gap: 6px; align-items: center; margin-top: 2px; }

details.errors summary { cursor: pointer; padding: 16px 20px; color: var(--ink-2); display: flex; gap: 10px; align-items: center; list-style: none; }
details.errors ul { margin: 0; padding: 0 20px 16px 20px; list-style: none; }
details.errors li { padding: 6px 0; border-top: 1px solid var(--line); color: var(--muted); }

.pagination { padding: 16px 20px; display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); }
.pagination .pages { display: flex; gap: 8px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 13.5px; }
.btn:hover { border-color: var(--ink-2); }
.btn.disabled { opacity: .4; pointer-events: none; }

.muted { color: var(--muted); }
button.btn { font: inherit; font-size: 13.5px; cursor: pointer; }

/* ---------- Login ---------- */
.login { min-height: calc(100vh - 180px); display: grid; place-items: center; padding: 40px 0; }
.login-card { width: 100%; max-width: 400px; padding: 36px 32px; text-align: center; }
.login-card .big-icon { width: 60px; height: 60px; margin: 0 auto 16px; border-radius: 18px; display: grid; place-items: center; background: var(--ink); color: var(--bg); font-size: 24px; }
.login-card h1 { font-size: 30px; margin-bottom: 4px; }
.login-card form { margin-top: 24px; text-align: start; display: grid; gap: 14px; }
.field > span:first-child { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; }
.input { position: relative; display: block; }
.input i { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 13px; }
.input input { width: 100%; font: inherit; font-size: 15px; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 11px 40px 11px 14px; outline: none; text-align: right; }
.input input:focus { border-color: var(--ink-2); }
.form-error { margin: 0; color: var(--review); font-size: 13px; }
.btn-primary { margin-top: 6px; font: inherit; font-weight: 700; font-size: 15px; padding: 12px; border-radius: 12px; border: 0; background: var(--ink); color: var(--bg); cursor: pointer; display: inline-flex; justify-content: center; align-items: center; gap: 10px; }
.btn-primary:hover { opacity: .9; }
.footer { padding: 30px 0 50px; color: var(--muted); font-size: 12.5px; text-align: center; }

/* ---------- Phone width ---------- */
@media (max-width: 860px) {
    .stats { grid-template-columns: repeat(2, 1fr); }
    .verdicts { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    .container { padding: 0 16px; }
    .topbar .hint { display: none; }
    .report-item { grid-template-columns: auto 1fr; }
    .report-item .go { display: none; }
    th, td { padding: 12px 14px; }
    table { min-width: 620px; } /* scroll sideways inside the card instead of squeezing */
    td { white-space: nowrap; }
    td:first-child { white-space: normal; min-width: 170px; max-width: 210px; overflow-wrap: anywhere; }
    .chips { flex-wrap: nowrap; }
    .search input { width: 100%; }
    .search, .toolbar .tabs { width: 100%; }
}
