﻿:root {
    --lk-bg: #f6f7f9;
    --lk-surface: #ffffff;
    --lk-text: #1c2430;
    --lk-muted: #5f6b7a;
    --lk-line: #dfe3e9;
    --lk-accent: #1f5fbf;
    --lk-accent-text: #ffffff;
    --lk-good: #1d7a46;
    --lk-good-bg: #e3f4ea;
    --lk-bad: #b3261e;
    --lk-bad-bg: #fbe9e7;
    --lk-warn: #8a5a00;
    --lk-warn-bg: #fdf3dc;
    --lk-quiet-bg: #eef0f3;
    --lk-radius: 8px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --lk-bg: #12161c;
        --lk-surface: #1a2029;
        --lk-text: #e6e9ee;
        --lk-muted: #9aa5b4;
        --lk-line: #2c3541;
        --lk-accent: #6aa6ff;
        --lk-accent-text: #0b1320;
        --lk-good: #6fd29a;
        --lk-good-bg: #173325;
        --lk-bad: #ff8f86;
        --lk-bad-bg: #3a1d1b;
        --lk-warn: #f2c460;
        --lk-warn-bg: #352b13;
        --lk-quiet-bg: #232b36;
    }
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    background: var(--lk-bg);
    color: var(--lk-text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.5;
}

a { color: var(--lk-accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; margin: 0.4rem 0 1rem; }
h2 { font-size: 1.15rem; margin: 0; }
h3 { font-size: 1.05rem; margin: 0; }
h4 { font-size: 0.85rem; margin: 1rem 0 0.4rem; color: var(--lk-muted); text-transform: uppercase; letter-spacing: 0.04em; }

.lk-shell { max-width: 1080px; margin: 0 auto; padding: 0 16px 48px; }

.lk-header {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    padding: 14px 0;
    border-bottom: 1px solid var(--lk-line);
}
.lk-brand { font-weight: 700; font-size: 1.2rem; color: var(--lk-text); }
.lk-brand:hover { text-decoration: none; }
.lk-nav { display: flex; gap: 16px; flex: 1; }
.lk-nav a { color: var(--lk-muted); padding: 4px 0; border-bottom: 2px solid transparent; }
.lk-nav a.active { color: var(--lk-text); border-bottom-color: var(--lk-accent); }
.lk-nav a:hover { text-decoration: none; color: var(--lk-text); }
.lk-user { display: flex; align-items: center; gap: 8px; color: var(--lk-muted); font-size: 0.9rem; }

.lk-notice {
    margin: 12px 0 0;
    padding: 8px 12px;
    border-radius: var(--lk-radius);
    background: var(--lk-warn-bg);
    color: var(--lk-warn);
    font-size: 0.85rem;
}

.lk-main { padding-top: 12px; }
.lk-section { margin: 1.6rem 0; }
.lk-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 0.6rem; }
.lk-muted { color: var(--lk-muted); }
.lk-small { font-size: 0.8rem; margin: 0.4rem 0 0; }
.lk-error { color: var(--lk-bad); }
.lk-ok { color: var(--lk-good); }
.lk-list { margin: 0; padding-left: 1.1rem; }

input[type="text"], input[type="number"], input[type="password"], select, textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--lk-line);
    border-radius: 6px;
    background: var(--lk-surface);
    color: var(--lk-text);
    font: inherit;
}
select { width: auto; }
textarea { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.85rem; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible {
    outline: 2px solid var(--lk-accent);
    outline-offset: 2px;
}

.lk-button {
    display: inline-block;
    padding: 8px 16px;
    border: 1px solid var(--lk-accent);
    border-radius: 6px;
    background: var(--lk-accent);
    color: var(--lk-accent-text);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}
.lk-button:hover { text-decoration: none; filter: brightness(1.05); }
.lk-button:disabled { opacity: 0.5; cursor: default; }
.lk-button-quiet { background: transparent; color: var(--lk-accent); }
.lk-link { background: none; border: 0; padding: 0; color: var(--lk-accent); font: inherit; cursor: pointer; }
.lk-link:hover { text-decoration: underline; }

.lk-table-wrap { overflow-x: auto; background: var(--lk-surface); border: 1px solid var(--lk-line); border-radius: var(--lk-radius); }
.lk-table { width: 100%; border-collapse: collapse; }
.lk-table th, .lk-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--lk-line); vertical-align: middle; }
.lk-table th { white-space: nowrap; font-size: 0.8rem; color: var(--lk-muted); font-weight: 600; }
.lk-table tr:last-child td { border-bottom: 0; }
.lk-number { text-align: right !important; font-variant-numeric: tabular-nums; }
.lk-actions { text-align: right; white-space: nowrap; }
.lk-actions > * + * { margin-left: 14px; }
.lk-shared { display: block; }

.lk-badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 600; white-space: nowrap; }
.lk-badge-good { background: var(--lk-good-bg); color: var(--lk-good); }
.lk-badge-bad { background: var(--lk-bad-bg); color: var(--lk-bad); }
.lk-badge-muted { background: var(--lk-quiet-bg); color: var(--lk-muted); }

.lk-card { background: var(--lk-surface); border: 1px solid var(--lk-line); border-radius: var(--lk-radius); padding: 14px 16px; margin: 0 0 12px; }
.lk-card-rejected { opacity: 0.88; }
.lk-meta { margin: 2px 0 0; color: var(--lk-muted); font-size: 0.85rem; }
.lk-price { color: var(--lk-text); font-size: 0.95rem; }

/* A result: the picture, what the boat is, and the score, then the assessment folded away until it is asked for. */
.lk-result {
    display: grid;
    grid-template-columns: 168px minmax(0, 1fr) 102px;
    grid-template-areas: "thumb main score" "more more more";
    gap: 6px 16px;
    align-items: start;
}
.lk-thumb {
    grid-area: thumb;
    display: block;
    width: 168px;
    height: 126px;
    border-radius: 6px;
    overflow: hidden;
    background: var(--lk-quiet-bg);
}
.lk-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lk-thumb-empty { display: grid; place-items: center; width: 100%; height: 100%; color: var(--lk-muted); font-size: 0.8rem; }
.lk-result-main { grid-area: main; min-width: 0; }
.lk-result-title { display: flex; align-items: flex-start; gap: 10px; }
.lk-result-title h3 { flex: 1; min-width: 0; }
.lk-result-title h3 a { color: var(--lk-text); }
.lk-result-title .lk-badge { flex: none; }

/*
 * The score is the first thing to see: a light number in a colour from amber (low) to forest green (high), by the same scale on every page.
 * How it is drawn is the user's choice (one class per ScoreStyle). It stands apart from the corner of the card, with room above and to the right.
 */
.lk-score {
    --lk-score-lightness: 34%;
    --lk-score-colour: hsl(var(--lk-score-hue, 0) var(--lk-score-saturation, 0%) var(--lk-score-lightness));
    grid-area: score;
    position: relative;
    width: 76px;
    height: 76px;
    margin: 9px 11px 0 15px;
    display: grid;
    place-items: center;
    color: var(--lk-score-colour);
    font-size: 1.9rem;
    font-weight: 200;
    letter-spacing: -0.02em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.lk-score > svg { position: absolute; inset: 0; overflow: visible; fill: none; }
.lk-score-number { position: relative; }
.lk-score-track { stroke: var(--lk-line); fill: none; }
.lk-score-arc { stroke: var(--lk-score-colour); fill: none; stroke-linecap: round; }

.lk-score-ring { border-radius: 50%; border: 3px solid var(--lk-score-colour); }
.lk-score-tint { border-radius: 50%; background: color-mix(in srgb, var(--lk-score-colour) 11%, transparent); }
.lk-score-fraction { display: flex; align-items: baseline; justify-content: flex-end; gap: 3px; width: auto; height: auto; min-width: 76px; place-items: unset; }
.lk-score-fraction .lk-score-number { font-size: 2.2rem; letter-spacing: -0.04em; }
.lk-score-of { font-size: 0.75rem; font-weight: 300; color: var(--lk-muted); letter-spacing: 0; }
.lk-score-sweep::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: conic-gradient(from 200deg, color-mix(in srgb, var(--lk-score-colour) 8%, transparent), var(--lk-score-colour) calc(var(--lk-score-share, 0) * 1%), transparent calc(var(--lk-score-share, 0) * 1%));
    -webkit-mask: radial-gradient(circle, transparent 31px, #000 32px);
    mask: radial-gradient(circle, transparent 31px, #000 32px);
}
.lk-score-none { border-radius: 50%; border: 2px dashed var(--lk-line); color: var(--lk-muted); font-weight: 300; }
.lk-score-preview { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.lk-score-preview .lk-score { margin: 4px 8px 4px 0; }
@media (prefers-color-scheme: dark) {
    .lk-score { --lk-score-lightness: 56%; }
}

.lk-verdict { margin: 8px 0 0; font-size: 0.92rem; }
.lk-pill { display: inline-block; padding: 1px 10px; margin-right: 4px; border-radius: 999px; font-size: 0.78rem; font-weight: 700; white-space: nowrap; }
.lk-pill-pursue { background: var(--lk-good-bg); color: var(--lk-good); }
.lk-pill-ask { background: var(--lk-warn-bg); color: var(--lk-warn); }
.lk-pill-drop { background: var(--lk-bad-bg); color: var(--lk-bad); }

.lk-facts { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; padding: 0; list-style: none; }
.lk-chip { padding: 2px 10px; border-radius: 999px; background: var(--lk-quiet-bg); font-size: 0.82rem; }
.lk-chip span { color: var(--lk-muted); margin-right: 4px; }

.lk-more { grid-area: more; margin-top: 4px; border-top: 1px solid var(--lk-line); padding-top: 8px; }
.lk-more > summary { cursor: pointer; color: var(--lk-accent); font-size: 0.9rem; }
.lk-rationale { margin: 10px 0 0; }
.lk-questions h4, .lk-more h4 { margin: 14px 0 4px; }
.lk-questions ul { margin: 6px 0 0; padding-left: 1.2rem; }
.lk-allfacts { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 4px 18px; margin: 6px 0 0; }
.lk-allfacts div { display: flex; gap: 6px; font-size: 0.9rem; }
.lk-allfacts dt { color: var(--lk-muted); }
.lk-allfacts dd { margin: 0; }
.lk-rejected { margin: 8px 0 0; color: var(--lk-bad); font-size: 0.9rem; }
.lk-unknown { margin: 8px 0 0; color: var(--lk-muted); font-size: 0.9rem; }
.lk-expand-all { margin-left: auto; font-size: 0.9rem; }

.lk-tabs { display: flex; align-items: center; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.lk-tab { padding: 6px 14px; border: 1px solid var(--lk-line); border-radius: 999px; background: var(--lk-surface); color: var(--lk-text); font: inherit; cursor: pointer; }
.lk-tab-active { background: var(--lk-accent); border-color: var(--lk-accent); color: var(--lk-accent-text); }
.lk-total { margin-left: 8px; }
.lk-pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 18px 0; }

.lk-form { display: grid; gap: 16px; max-width: 720px; }
.lk-field { display: grid; gap: 4px; }
.lk-field > span, .lk-fieldset legend { font-weight: 600; }
.lk-check { display: flex; align-items: center; gap: 8px; }
.lk-fieldset { border: 1px solid var(--lk-line); border-radius: var(--lk-radius); padding: 12px 14px; background: var(--lk-surface); }
.lk-source-choice { padding: 6px 0; }
.lk-subfield { margin: 8px 0 4px 26px; display: grid; gap: 6px; }
.lk-problems { margin: 0; padding: 10px 14px 10px 30px; border-radius: var(--lk-radius); background: var(--lk-bad-bg); color: var(--lk-bad); }
.lk-actions-row { display: flex; align-items: center; gap: 16px; margin-top: 8px; }
.lk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }

@media (max-width: 640px) {
    .lk-result { grid-template-columns: 96px minmax(0, 1fr); grid-template-areas: "thumb score" "main main" "more more"; }
    .lk-thumb { width: 96px; height: 72px; }
    .lk-score { justify-self: end; }
}

.lk-saved { color: var(--lk-good); }

.lk-login { max-width: 360px; margin: 12vh auto 0; padding: 0 16px; }
.lk-login .lk-form { background: var(--lk-surface); border: 1px solid var(--lk-line); border-radius: var(--lk-radius); padding: 18px; }
.lk-login-error { color: var(--lk-bad); background: var(--lk-bad-bg); border-radius: 6px; padding: 8px 12px; }
.lk-user button { margin-left: 4px; }

.lk-runstatus { margin: 0 0 1rem; padding: 8px 12px; border: 1px solid var(--lk-line); border-radius: var(--lk-radius); background: var(--lk-surface); font-size: 0.9rem; }
.lk-runstatus-running { border-color: var(--lk-accent); }

.lk-triage { display: flex; gap: 12px; align-items: center; font-size: 0.85rem; }
.lk-triage-on { font-weight: 600; }

.lk-confirm { margin: 0 0 14px; padding: 12px 16px; border: 1px solid var(--lk-line); border-radius: var(--lk-radius); background: var(--lk-surface); }
.lk-confirm p { margin: 0 0 8px; }
.lk-reevaluating { margin: 0 0 10px; }
.lk-outdated { display: inline-flex; align-items: center; justify-content: center; width: 1.2rem; height: 1.2rem; margin-left: 6px; border-radius: 50%; background: var(--lk-warn-bg); color: var(--lk-warn); font-size: 0.8rem; font-weight: 700; cursor: help; }
