:root {
    --fg: #313131;
    --muted: #666;
    --accent: #0077bd;
    --bg-soft: #f3f6fb;
    --border: #ddd;
    --error: #b00020;
    --ok: #1a7f37;
}

@font-face {
    font-family: 'Inter';
    src: url('/fonts/Inter-Variable.woff2') format('woff2');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

* { box-sizing: border-box; }

/* Author-level rule so the `hidden` attribute wins over `display` rules like `fieldset { display: grid }`. */
[hidden] { display: none !important; }

body {
    margin: 0;
    color: var(--fg);
    font-family: 'Inter', system-ui, sans-serif;
    line-height: 1.5;
}

h1, h2, h3 { color: var(--fg); }

header nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; }
.brand-logo { height: 2rem; width: auto; display: block; }
.brand-name { color: #000; font-weight: 400; font-size: 1.8rem; }

/* Tool links sit flush-left next to the brand, separated by a thin rule. */
.nav-tools { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; padding-left: 1rem; border-left: 1px solid var(--border); }
.nav-tools a { display: flex; align-items: center; gap: 0.4rem; padding: 0.35rem 0.6rem; border-radius: 6px; color: var(--fg); text-decoration: none; }
.nav-tools a:hover { color: var(--accent); }
.nav-tools svg { width: 1.25rem; height: 1.25rem; fill: var(--accent); }

/* margin-left:auto pushes this and the lang toggle flush-right. */
.nav-links { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; margin-left: auto; }
.nav-links a { padding: 0.35rem 0.6rem; border-radius: 6px; color: var(--fg); text-decoration: none; }
.nav-links a:hover { color: var(--accent); }

/* Current page: subtle gray highlight. */
.nav-tools a.active, .nav-links a.active { background: rgba(0, 0, 0, 0.06); }

/* Thin rule between the right-hand pages and the language selection. */
.lang-toggle { display: flex; gap: 0.4rem; align-items: center; padding-left: 1rem; border-left: 1px solid var(--border); }
.lang-toggle .flag {
    display: block;
    width: 1.2rem;
    height: 1.2rem;
    border-radius: 5px;
    overflow: hidden;
    border: 1px solid var(--border);
    opacity: 0.45;
    transition: opacity 0.15s;
}
.lang-toggle .flag:hover, .lang-toggle .flag.active { opacity: 1; }
.lang-toggle .flag img { display: block; width: 100%; height: 100%; object-fit: cover; }

main { max-width: 52rem; margin: 0 auto; padding: 1.5rem; }
footer { max-width: 52rem; margin: 0 auto; padding: 1.5rem; color: var(--muted); font-size: 0.85rem; }
footer a { color: var(--muted); }
footer a:hover { color: var(--accent); }

.hero { text-align: center; padding: 1.5rem 0 0.5rem; }
.hero h1 { margin: 0; font-size: 2.25rem; }
.hero .tagline { color: var(--muted); font-size: 1.15rem; margin-top: 0.5rem; }

.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1.25rem;
    margin: 2.5rem 0;
}
.tool-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 2rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-soft);
    color: var(--fg);
    text-decoration: none;
    font-weight: 600;
    text-align: center;
    transition: box-shadow 0.15s, transform 0.15s, border-color 0.15s;
}
.tool-tile:hover { box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08); transform: translateY(-2px); border-color: var(--accent); }
.tool-tile svg { width: 2.5rem; height: 2.5rem; fill: var(--accent); }

.info-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin: 2.5rem 0 1rem;
    padding: 1.75rem;
    background: var(--bg-soft);
    border-radius: 8px;
}
.info-columns h2 { font-size: 1.05rem; margin: 0 0 0.5rem; }
.info-columns p { margin: 0; color: var(--muted); }

form { display: grid; gap: 1rem; max-width: 36rem; }
fieldset { border: 1px solid var(--border); border-radius: 4px; display: grid; gap: 0.5rem; }
label { font-weight: 600; }
label.plain { font-weight: 400; }
input[type="text"], input[type="number"], textarea, select {
    width: 100%;
    padding: 0.4rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font: inherit;
}
button {
    justify-self: start;
    padding: 0.5rem 1.25rem;
    border: none;
    border-radius: 4px;
    background: var(--accent);
    color: #fff;
    font: inherit;
    cursor: pointer;
}
button.secondary { background: #eee; color: var(--fg); }

.error { color: var(--error); }
.ok { color: var(--ok); }
.muted { color: var(--muted); }

progress { width: 100%; height: 1.25rem; }

table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 0.4rem 0.75rem; border-bottom: 1px solid var(--border); }

.badge { padding: 0.1rem 0.5rem; border-radius: 999px; font-size: 0.8rem; }
.badge.ok { background: #e6f4ea; }
.badge.fail { background: #fdecea; }

@media (max-width: 40rem) {
    header nav { justify-content: center; text-align: center; }
    .nav-tools, .nav-links { justify-content: center; }
    .nav-links { margin-left: 0; }
    main, footer { padding: 1rem; }
    .hero h1 { font-size: 1.75rem; }
}

/* Report viewer (web/Pages/ReportView.cshtml) — wider canvas for data tables. */
body.report-view main { max-width: 85rem; }

.report-nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; padding-bottom: 0.75rem; margin-bottom: 1rem; border-bottom: 1px solid var(--border); }
.report-nav a { color: var(--fg); text-decoration: none; padding: 0.25rem 0.6rem; border-radius: 6px; font-size: 0.9rem; }
.report-nav a:hover { background: var(--bg-soft); }
.report-nav a.active { background: var(--accent); color: #fff; font-weight: 600; }

.report-table-wrap { overflow-x: auto; }
td.numeric { text-align: right; font-variant-numeric: tabular-nums; }
td.key { font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace; color: var(--muted); }
td.flag { text-align: center; font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace; }
td.flag.on { color: var(--accent); font-weight: 600; }
td.flag.off { color: var(--muted); }

.summary-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.75rem; margin: 1rem 0 2rem; }
.summary-card { border: 1px solid var(--border); border-radius: 6px; padding: 1rem; transition: border-color 0.15s; }
.summary-card:hover { border-color: var(--accent); }
.summary-card a { display: block; text-decoration: none; color: inherit; }
.summary-card .count { font-size: 1.8rem; font-weight: 700; color: var(--accent); line-height: 1.1; }
.summary-card .label { font-size: 0.9rem; color: var(--muted); margin-top: 0.25rem; }

.color-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 0.5rem; margin: 0.5rem 0 1rem; }
.color-cell { display: flex; flex-direction: column; align-items: center; gap: 0.25rem; padding: 0.5rem; border: 1px solid var(--border); border-radius: 4px; }
.color-swatch { display: inline-block; width: 48px; height: 48px; border: 1px solid var(--border); border-radius: 4px; }
.color-swatch.is-null { background: repeating-linear-gradient(45deg, var(--bg-soft), var(--bg-soft) 6px, var(--border) 6px, var(--border) 12px); }
.color-swatch-label { font-size: 0.75rem; color: var(--muted); text-align: center; font-family: ui-monospace, monospace; }
.color-swatch-name { font-size: 0.8rem; font-weight: 600; }
.swatch-inline { display: inline-block; width: 0.85em; height: 0.85em; border: 1px solid var(--border); border-radius: 2px; vertical-align: -0.1em; margin-right: 0.25rem; }
.swatch-inline.is-null { background: repeating-linear-gradient(45deg, var(--bg-soft), var(--bg-soft) 3px, var(--border) 3px, var(--border) 6px); }

.child-list { display: flex; flex-wrap: wrap; gap: 0.25rem 0.5rem; list-style: none; margin: 0; padding: 0; }
.child-list li { background: var(--bg-soft); border: 1px solid var(--border); border-radius: 999px; padding: 0.1rem 0.5rem; font-size: 0.8rem; }
.child-list li.empty { background: transparent; border: none; }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 0.25rem 0.75rem; font-size: 0.85rem; margin: 0.5rem 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

.empty { color: var(--muted); font-style: italic; }

pre.shape-text { background: var(--bg-soft); border: 1px solid var(--border); border-radius: 4px; padding: 0.5rem 0.75rem; margin: 0; white-space: pre-wrap; word-break: break-word; max-width: 60ch; }
pre.shape-text:empty::before { content: "(empty)"; color: var(--muted); font-style: italic; }
span.format-run.is-bold { font-weight: 700; }
span.format-run.is-ital { font-style: italic; }
span.format-run.is-underline { text-decoration: underline; }
span.format-run.is-strike { text-decoration: line-through; }
span.format-run.is-underline.is-strike { text-decoration: underline line-through; }

details.format-toggle { margin-top: 0.4rem; font-size: 0.85rem; }
details.format-toggle > summary { cursor: pointer; color: var(--accent); -webkit-user-select: none; user-select: none; padding: 0.15rem 0; }
details.format-toggle .format-actions { margin-top: 0.4rem; font-size: 0.8rem; }

img.thumb { max-width: 120px; max-height: 80px; border: 1px solid var(--border); border-radius: 4px; object-fit: contain; background: var(--bg-soft); display: block; }

a.anchor { visibility: hidden; color: var(--muted); margin-left: 0.25rem; text-decoration: none; font-size: 0.85em; }
tr:hover a.anchor { visibility: visible; }
tr:target { background: var(--bg-soft); }
