/* VGAI UI: one hand-written design system. Tokens first, then layout, then components. */

:root {
    color-scheme: light;
    --bg: #f5f6f8;
    --surface: #ffffff;
    --surface-2: #f9fafb;
    --line: #e4e7ec;
    --line-strong: #d0d5dd;
    --text: #101828;
    --text-2: #475467;
    --text-3: #98a2b3;
    --accent: #0e7490;
    --accent-2: #155e75;
    --accent-soft: #e0f2f7;
    --green: #067647;   --green-soft: #dcfae6;
    --yellow: #b54708;  --yellow-soft: #fef0c7;
    --red: #b42318;     --red-soft: #fee4e2;
    --blue: #175cd3;    --blue-soft: #d1e9ff;
    --violet: #6941c6;  --violet-soft: #ebe9fe;
    --gray-soft: #f2f4f7;
    --fl: 42%;
    --side-bg: #0b1d22;
    --side-text: #b8c7cb;
    --side-active: #12343c;
    --shadow: 0 1px 2px rgba(16, 24, 40, .05);
    --shadow-lg: 0 8px 24px rgba(16, 24, 40, .08);
    --radius: 10px;
    --scroll: rgba(16, 24, 40, .2);
    --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
    --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* Dark: follows the system unless the theme switch says otherwise (data-theme on <html>). */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;
        --bg: #0c1114;
        --surface: #131a1e;
        --surface-2: #182126;
        --line: #243036;
        --line-strong: #31414a;
        --text: #e8eef0;
        --text-2: #a5b4ba;
        --text-3: #6b7d84;
        --accent: #22a6c3;
        --accent-2: #67cbe0;
        --accent-soft: #103540;
        --green: #47cd89;   --green-soft: #0f2e20;
        --yellow: #fdb022;  --yellow-soft: #3a2a0a;
        --red: #f97066;     --red-soft: #3d1512;
        --blue: #53b1fd;    --blue-soft: #102a46;
        --violet: #a48afb;  --violet-soft: #251c46;
        --gray-soft: #1c262b;
        --fl: 66%;
        --side-bg: #080e10;
        --side-active: #12262c;
        --shadow: none;
        --shadow-lg: 0 8px 24px rgba(0, 0, 0, .4);
        --scroll: rgba(255, 255, 255, .16);
    }
}

:root[data-theme="dark"] {
        color-scheme: dark;
        --bg: #0c1114;
        --surface: #131a1e;
        --surface-2: #182126;
        --line: #243036;
        --line-strong: #31414a;
        --text: #e8eef0;
        --text-2: #a5b4ba;
        --text-3: #6b7d84;
        --accent: #22a6c3;
        --accent-2: #67cbe0;
        --accent-soft: #103540;
        --green: #47cd89;   --green-soft: #0f2e20;
        --yellow: #fdb022;  --yellow-soft: #3a2a0a;
        --red: #f97066;     --red-soft: #3d1512;
        --blue: #53b1fd;    --blue-soft: #102a46;
        --violet: #a48afb;  --violet-soft: #251c46;
        --gray-soft: #1c262b;
        --fl: 66%;
        --side-bg: #080e10;
        --side-active: #12262c;
        --shadow: none;
        --shadow-lg: 0 8px 24px rgba(0, 0, 0, .4);
        --scroll: rgba(255, 255, 255, .16);
    }

* { box-sizing: border-box; }
/* Scrollbars: thin and quiet everywhere (no arrows), a light thumb on the dark sidebars. Chromium uses the
   ::-webkit-scrollbar rules only while no scrollbar-color is set, so that one is for Firefox alone. */
.side, .a-left { --scroll: rgba(255, 255, 255, .14); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-button { display: none; }
::-webkit-scrollbar-thumb { background: var(--scroll); background-clip: padding-box; border: 3px solid transparent; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { border-width: 2px; }
@supports (-moz-appearance: none) { * { scrollbar-width: thin; scrollbar-color: var(--scroll) transparent; } }
html, body { margin: 0; padding: 0; }
body {
    background: var(--bg);
    color: var(--text);
    font: 14px/1.5 var(--sans);
    font-feature-settings: "cv11", "ss01";
    -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 22px; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.grow { flex: 1; }
.row { display: flex; gap: 12px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 12px; }
.stack > * + * { margin-top: 16px; }
.mt { margin-top: 16px; }
.mt-s { margin-top: 8px; }

/* ---- shell ------------------------------------------------------------------------------------------------ */

.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side {
    background: var(--side-bg); color: var(--side-text);
    position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 18px 12px;
    overflow-y: auto; overscroll-behavior: contain;   /* a menu taller than the window scrolls by itself, not the page */
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 20px; }
.brand-name { color: #fff; font-weight: 650; font-size: 15px; line-height: 1.1; }
.brand-sub { font-size: 11px; color: #7f9499; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
    display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px;
    color: var(--side-text); font-weight: 500; text-decoration: none;
}
.nav a:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.nav a.active { background: var(--side-active); color: #fff; }
.nav a.active svg { color: #4fc3dc; }
.nav .badge { margin-left: auto; }
.badge.soft { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--line); }
.nav-section { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #5f7479; padding: 16px 10px 6px; }
.side-foot { margin-top: auto; padding: 10px; font-size: 11.5px; color: #6b8086; }
.side-foot code { font-size: 11px; color: #9fb3b8; }
.theme-switch { margin-top: 10px; background: rgba(255,255,255,.06); border: 0; color: var(--side-text); border-radius: 6px; padding: 4px 8px; font: 12px var(--sans); cursor: pointer; }
.theme-switch:hover { background: rgba(255,255,255,.12); color: #fff; }
.signed-in { display: flex; align-items: center; gap: 8px; margin-top: 10px; min-width: 0; }
.signed-in-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--side-text); font-size: 12px; }
.signed-in-as { display: inline-block; margin-top: 10px; text-decoration: none; }
.signed-in-as-other { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin-top: 10px; }
.signed-in-as-other form { margin: 0; }
.signed-in form { margin: 0; }
.signed-in .theme-switch { margin-top: 0; }

/* The login page: one card in the middle of the window. */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--bg); }
.login { width: 100%; max-width: 380px; padding: 28px 24px; display: flex; flex-direction: column; gap: 14px; }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.login-brand .brand-name { color: var(--text); }
.login-brand .brand-sub { color: var(--text-2); }
.login label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; color: var(--text-2); }
.login input { width: 100%; height: 38px; }
.login .btn { height: 38px; justify-content: center; }
.login-error { padding: 9px 12px; border-radius: 8px; background: var(--red-soft); color: var(--red); font-size: 13px; }
.login-note { font-size: 12.5px; color: var(--text-2); }
.login-form { display: flex; flex-direction: column; gap: 12px; }
.login-step { font-size: 13.5px; line-height: 1.5; color: var(--text); }
.login-qr { align-self: center; width: 200px; height: 200px; padding: 8px; border-radius: 8px; background: #fff; image-rendering: pixelated; }
.login-key { display: inline-block; margin-top: 4px; font-size: 13px; letter-spacing: .5px; user-select: all; word-break: break-word; }
.login input.login-code { font-size: 20px; letter-spacing: 6px; text-align: center; }
.login label.login-check { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; }
.login label.login-check input { width: auto; height: auto; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top {
    position: sticky; top: 0; z-index: 10; height: 56px; display: flex; align-items: center; gap: 12px; padding: 0 28px;
    background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.content { padding: 24px 28px 64px; max-width: 1480px; width: 100%; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 20px; }
.page-head .sub { color: var(--text-2); margin-top: 4px; }

/* A phone: the back office's menu is a drawer from the left (the menu button in the top bar, agent.css has the button
   and the shade); the page gets the whole width, its parts under each other, wide tables scroll sideways. */
@media (max-width: 760px) {
    .shell { grid-template-columns: minmax(0, 1fr); }
    .main { overflow-x: clip; }   /* a tip waiting off to the side mustn't make the page scroll sideways */
    .side {
        position: fixed; z-index: 50; top: 0; bottom: 0; left: 0; height: auto; width: min(280px, 86vw); overflow-y: auto;
        transform: translateX(-100%); transition: transform .25s ease; box-shadow: var(--shadow-lg);
    }
    html.nav-open .side { transform: none; }
    .top { padding: 0 12px; gap: 8px; }
    .top .job { flex: 1 1 auto; min-width: 0; overflow: hidden; }
    .top .job > .faint { display: none; }   /* how long ago: the text is what counts, and there is no room */
    .top .job .title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .top .btn span:not(.dot) { display: none; }   /* the watcher and Scan nu: their icons */
    .content { padding: 16px 12px 48px; }
    .page-head { flex-wrap: wrap; align-items: flex-start; }
    .page-head h1 { font-size: 22px; }
    .card { min-width: 0; }
    .card > .card-body { overflow-x: auto; }
    table { max-width: 100%; }
    .row { flex-wrap: wrap; }   /* chips, buttons and labels in a row go on to the next line rather than off the screen */
    .cmp-view { white-space: normal; flex-wrap: wrap; }
    /* Tabs that don't fit scroll sideways in their own row. */
    .tabs { overflow-x: auto; scrollbar-width: none; max-width: 100%; }
    .tabs button, .tabs a { flex: none; white-space: nowrap; }
}
.crumbs { font-size: 12.5px; color: var(--text-2); margin-bottom: 6px; }
.crumbs a { color: var(--text-2); }

/* ---- surfaces --------------------------------------------------------------------------------------------- */

.card {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.card-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.card-head h2 { font-size: 14.5px; }
.card-body { padding: 16px; }
.card-body.tight { padding: 0; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr); }
@media (max-width: 1100px) { .g2, .g3, .g-main { grid-template-columns: 1fr; } }

/* ---- KPIs ------------------------------------------------------------------------------------------------- */

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.kpi { padding: 14px 16px; display: block; color: inherit; }
a.kpi:hover { text-decoration: none; border-color: var(--line-strong); }
.kpi-label { font-size: 12px; color: var(--text-2); font-weight: 500; display: flex; align-items: center; gap: 6px; }
.kpi-value { font-size: 24px; font-weight: 650; letter-spacing: -.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.kpi.tone-red .kpi-value { color: var(--red); }
.kpi.tone-yellow .kpi-value { color: var(--yellow); }
.kpi.tone-green .kpi-value { color: var(--green); }
/* A KPI that filters what's below it (Log): the one chosen is outlined. */
.kpi-btn { all: unset; display: block; cursor: pointer; border-radius: var(--radius, 10px); }
.kpi-btn .kpi { height: 100%; box-sizing: border-box; }
.kpi-btn:hover .kpi { border-color: var(--line-strong); }
.kpi-btn.on .kpi { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.kpi-btn:focus-visible .kpi { box-shadow: 0 0 0 2px var(--accent); }
.log-views { border-bottom: 0; margin-bottom: 0; }
.log-detail { margin: 0; padding: 10px 12px; font: 12px/1.5 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 420px; overflow: auto;
    background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; }

/* ---- chips, badges, dots ----------------------------------------------------------------------------------- */

.chip {
    display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 999px;
    font-size: 12px; font-weight: 550; white-space: nowrap; background: var(--gray-soft); color: var(--text-2);
    margin-inline: 1px;   /* with the space around every chip (Chip.razor): 5-6 px to its neighbour in text and cells */
}
.chip.green { background: var(--green-soft); color: var(--green); }
.chip.yellow { background: var(--yellow-soft); color: var(--yellow); }
.chip.red { background: var(--red-soft); color: var(--red); }
.chip.blue { background: var(--blue-soft); color: var(--blue); }
.chip.violet { background: var(--violet-soft); color: var(--violet); }
.chip.accent { background: var(--accent-soft); color: var(--accent); }
.chip.outline { background: transparent; border: 1px solid var(--line-strong); }
.chip.lg { height: 28px; padding: 0 12px; font-size: 13px; }
.q-groups { gap: 6px; margin-bottom: 14px; }
.q-groups .chip { height: 28px; padding: 0 12px; font-size: 13px; gap: 6px; text-decoration: none !important; color: var(--text-2); border: 1px solid var(--line); background: var(--surface); }
.q-groups .chip:hover { border-color: var(--accent); }
.q-groups .chip.on { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.dot.pulse { animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 50%, transparent); } 70% { box-shadow: 0 0 0 6px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.badge {
    min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center;
    background: #f79009; color: #fff; font-size: 11px; font-weight: 700;
}

/* ---- buttons, inputs ---------------------------------------------------------------------------------------- */

.btn {
    display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 8px; cursor: pointer;
    border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font: 500 13px var(--sans);
    white-space: nowrap; text-decoration: none !important;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-2); }
.btn.danger { color: var(--red); }
.btn.danger-fill { background: var(--red); border-color: var(--red); color: #fff; }
.btn.danger-fill:hover:not(:disabled) { filter: brightness(1.08); }
/* "Slet listen" (DeleteListPanel): what goes, on a line of its own under the list's buttons. */
.del-panel { flex-basis: 100%; display: flex; flex-direction: column; gap: 8px; border-color: var(--red); }
.del-file { display: block; margin-top: 2px; word-break: break-all; }
.btn.good { color: var(--green); }
.btn.sm { height: 26px; padding: 0 9px; font-size: 12px; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--gray-soft); }
.btn.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.btn.sq { width: 34px; padding: 0; justify-content: center; }
/* Every text-like field looks the same, whatever its type (an <input> without one is text too). */
input:not([type]), input[type=text], input[type=search], input[type=number], input[type=date], input[type=email], input[type=password], select, textarea {
    height: 34px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface);
    color: var(--text); font: 14px var(--sans); outline: none; transition: border-color .12s ease, box-shadow .12s ease;
}
textarea { height: auto; min-height: 60px; padding: 8px 10px; line-height: 1.45; resize: vertical; width: 100%; }
input::placeholder, textarea::placeholder { color: var(--text-3); }
input:not([type]):hover, input[type=text]:hover, input[type=search]:hover, input[type=number]:hover, input[type=date]:hover, input[type=email]:hover, input[type=password]:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--line-strong)); }
input:not([type]):focus, input[type=text]:focus, input[type=search]:focus, input[type=number]:focus, input[type=date]:focus, input[type=email]:focus, input[type=password]:focus, select:focus, textarea:focus {
    border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
input:disabled, select:disabled, textarea:disabled { opacity: .55; cursor: not-allowed; }
input.mono { font-family: var(--mono); font-size: 13px; }
select {
    appearance: none; -webkit-appearance: none; padding-right: 30px; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 10px center;
}
select option { background: var(--surface); color: var(--text); }
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); cursor: pointer; flex: none; }
label.check { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text); cursor: pointer; user-select: none; }

/* A searchable picker (instead of the browser's datalist): a field and a list of matches under it. */
.picker { position: relative; display: inline-flex; flex-direction: column; }
.picker > input { width: 100%; }
.picker-pop {
    position: absolute; top: calc(100% + 4px); left: 0; z-index: 70; min-width: 100%; width: max-content; max-width: 420px;
    max-height: 280px; overflow: auto; padding: 4px; border-radius: var(--radius); border: 1px solid var(--line-strong);
    background: var(--surface); box-shadow: var(--shadow-lg);
}
.picker-item { display: flex; flex-direction: column; gap: 1px; width: 100%; text-align: left; padding: 6px 9px; border: 0; border-radius: 6px;
    background: transparent; color: var(--text); font: 13px var(--sans); cursor: pointer; }
.picker-item:hover, .picker-item.on { background: var(--accent-soft); }
.picker-item .pv { font-weight: 600; }
.picker-item .ps { font-size: 11.5px; color: var(--text-2); }
.picker-empty { padding: 8px 10px; font-size: 12.5px; color: var(--text-3); }
input.big { height: 44px; font-size: 16px; padding: 0 14px; }

/* ---- tables ------------------------------------------------------------------------------------------------- */

.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
.t th {
    text-align: left; font-weight: 550; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-2);
    padding: 9px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; position: sticky; top: 0;
}
.t td { padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr:hover td { background: var(--surface-2); }
.t td.num, .t th.num { text-align: right; font-variant-numeric: tabular-nums; }
.t tr.clickable { cursor: pointer; }
.t tr.selected td { background: var(--accent-soft) !important; }

/* ---- meters & charts ---------------------------------------------------------------------------------------- */

.meter { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.meter-track { flex: 1; height: 6px; border-radius: 3px; background: var(--gray-soft); overflow: hidden; }
.meter-fill { height: 100%; border-radius: 3px; background: var(--accent); }
.meter-fill.green { background: var(--green); }
.meter-fill.yellow { background: #f79009; }
.meter-fill.red { background: var(--red); }
.meter-val { font-size: 12px; font-variant-numeric: tabular-nums; color: var(--text-2); width: 38px; text-align: right; }
.hbars { display: flex; flex-direction: column; gap: 6px; }
.hbar { display: grid; grid-template-columns: 130px 1fr 70px; gap: 10px; align-items: center; font-size: 12.5px; }
.hbar-track { height: 16px; background: var(--gray-soft); border-radius: 4px; overflow: hidden; }
.hbar-fill { height: 100%; background: var(--accent); border-radius: 4px; opacity: .85; }
.cols { display: flex; align-items: flex-end; gap: 6px; height: 140px; padding-top: 8px; }
.cols .c { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; }
.cols .bar { width: 100%; border-radius: 4px 4px 0 0; min-height: 2px; }
.cols .bar.gray { background: var(--line-strong); }
.cols .bar.blue { background: #53b1fd; }
.cols .bar.yellow { background: #fdb022; }
.cols .bar.red { background: #f97066; }
.cols .lbl { font-size: 10.5px; color: var(--text-3); text-align: center; white-space: nowrap; }
.cols .val { font-size: 11px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.spark { display: block; }

/* ---- tabs --------------------------------------------------------------------------------------------------- */

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tabs button, .tabs a {
    background: none; border: 0; padding: 10px 14px; font: 500 13.5px var(--sans); color: var(--text-2); cursor: pointer;
    border-bottom: 2px solid transparent; margin-bottom: -1px; display: flex; gap: 6px; align-items: center; text-decoration: none;
}
.tabs button:hover, .tabs a:hover { color: var(--text); text-decoration: none; }
.tabs button.on, .tabs a.on { color: var(--accent); border-bottom-color: var(--accent); }
.tabs .count { font-size: 11px; background: var(--gray-soft); color: var(--text-2); border-radius: 999px; padding: 0 6px; }

/* ---- domain pieces -------------------------------------------------------------------------------------------- */

.supplier-card { display: flex; flex-direction: column; gap: 10px; padding: 16px; color: inherit; }
a.supplier-card:hover { text-decoration: none; border-color: var(--line-strong); box-shadow: var(--shadow-lg); }
.supplier-card .name { font-size: 15px; font-weight: 650; }
.supplier-card .facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.fact-label { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; }
.fact-value { font-weight: 600; font-variant-numeric: tabular-nums; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 18px 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.timeline li:last-child { border-bottom: 0; }
/* Aktivitet: the automatic jobs (AutoJobsPanel), side by side. */
.aj-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; margin-bottom: 22px; }
.aj-card { padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; border-top: 3px solid var(--green); }
.aj-card.paused, .aj-card.off { border-top-color: var(--line-strong); }
.aj-card.bad { border-top-color: var(--red); }
.aj-head { display: flex; align-items: center; gap: 8px; }
.aj-head svg { color: var(--text-2); flex: none; }
.aj-what { font-size: 12.5px; color: var(--text-2); line-height: 1.5; }
.aj-line { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 13px; }
.aj-line.good svg { color: var(--green); }
.aj-line.bad, .aj-line.warn { color: var(--red); }
.aj-line.warn { color: var(--yellow); }
.aj-result { font-size: 12px; color: var(--text-2); background: var(--surface-2); border-radius: 6px; padding: 6px 8px; overflow-wrap: anywhere; }
.aj-result.bad { color: var(--red); background: var(--red-soft); }
.aj-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.aj-runs { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.aj-runs li { display: grid; grid-template-columns: 14px auto auto auto minmax(0, 1fr); gap: 8px; align-items: baseline; padding: 6px 0; font-size: 12px; border-bottom: 1px dashed var(--line); }
.aj-runs li svg { color: var(--green); align-self: center; }
.aj-runs li.bad svg, .aj-runs li.bad .aj-run-result { color: var(--red); }
.aj-run-result { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
@media (max-width: 760px) { .aj-runs li { grid-template-columns: 14px auto minmax(0, 1fr); } .aj-runs li .faint { display: none; } }
.slow-sql summary { cursor: pointer; color: var(--text-3); width: fit-content; }
.slow-sql pre { white-space: pre-wrap; word-break: break-word; font: 11.5px/1.45 var(--mono); background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin: 4px 0 0; max-height: 260px; overflow: auto; }
.timeline .when { color: var(--text-3); font-size: 11.5px; }
.timeline .ic { margin-top: 3px; }

.finding { display: grid; grid-template-columns: 70px 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.finding:last-child { border-bottom: 0; }
tr.undone td { opacity: .55; }
.undo-confirm { margin-bottom: 12px; display: flex; flex-direction: column; gap: 8px; border-color: var(--accent); }
/* What a person can do about a warning: a line on what it means, and the buttons that settle it. */
.fix { margin-top: 8px; padding: 10px 12px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.fix-what { font-size: 12.5px; color: var(--text-2); line-height: 1.5; }
.fix-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 6px 0; border-top: 1px dashed var(--line); }
.fix-name { min-width: 180px; margin-right: 4px; }
.fix-q { flex-basis: 100%; }
.fix-or { font-size: 12px; color: var(--text-3); }
.new-brand { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-right: 10px; }
.fix-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 6px; }
.fix-compare .flow { display: flex; align-items: center; gap: 6px; padding: 2px 0; }
@media (max-width: 700px) { .fix-compare { grid-template-columns: 1fr; } .fix-name { min-width: 0; flex-basis: 100%; } }
.layer-strip { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.layer { padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); }
.layer .ln { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; }
.layer .lt { font-weight: 600; margin: 2px 0 6px; font-size: 13px; }
.layer.red { border-color: color-mix(in srgb, var(--red) 40%, var(--line)); background: var(--red-soft); }
.layer.yellow { border-color: color-mix(in srgb, #f79009 40%, var(--line)); background: var(--yellow-soft); }
.layer.green { background: var(--green-soft); border-color: color-mix(in srgb, var(--green) 30%, var(--line)); }

.flow { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.flow .arrow { color: var(--text-3); font-size: 11px; }
.pn { font-family: var(--mono); font-size: 12.5px; padding: 1px 6px; border-radius: 5px; background: var(--gray-soft); white-space: nowrap; }
.pn.key { background: transparent; border: 1px dashed var(--line-strong); color: var(--text-2); }
.pn.nap { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.pn.rule { background: var(--violet-soft); color: var(--violet); }
/* A number that looks itself up when clicked (Prisopslag: a supplier's own number). */
button.pn-link { border: 0; color: inherit; cursor: pointer; }
button.pn-link:hover { background: var(--accent-soft); color: var(--accent); }
.pricecmp { display: inline-flex; gap: 6px; align-items: baseline; }

.question { padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.question .q { font-size: 15px; font-weight: 550; line-height: 1.45; }
/* A waiting file's card (FileCard): a calm lead, then the file as the recipe reads it; the numbers under Detaljer */
.fc-lead { font-size: 14px; line-height: 1.55; }
.fc-sum { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; font-size: 13px; color: var(--text-2); }
.fc-sum .good { color: var(--green); }
.fc-sum .warn { color: var(--yellow); }
.fc-sum .bad { color: var(--red); }
.fc-chev { transition: transform .15s; }
.fc-chev.open { transform: rotate(90deg); }

/* The inbox (Inbox.razor): one line per waiting file; a click opens its card under it, one at a time */
.ib-list { padding: 0; overflow: hidden; }
.ib-row { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 14px; border-top: 1px solid var(--line);
  color: var(--text); text-decoration: none; font-size: 13px; }
.ib-row:first-child { border-top: 0; }
.ib-row:hover { background: var(--surface-2); text-decoration: none; }
.ib-row.on { background: var(--surface-2); }
.ib-chev { color: var(--text-3); flex: none; transition: transform .15s; }
.ib-row.on .ib-chev { transform: rotate(90deg); }
.ib-sup { flex: none; }
.ib-file { color: var(--text-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 0 1 auto; }
.ib-need { color: var(--text-2); flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ib-need::before { content: "·"; margin-right: 10px; color: var(--text-3); }
.ib-ago { flex: none; font-size: 12px; }
/* A brand question's card (QuestionCard): each answer with what it means. */
.qc-answers { display: flex; flex-direction: column; gap: 8px; margin-bottom: 6px; }
.qc-answer { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.qc-answer > :first-child { flex: none; }
.qc-ex { font-size: 13px; }
.qc-ex td, .qc-ex th { padding: 4px 8px; }
.ib-open { border-top: 1px solid var(--line); background: var(--surface-2); padding: 12px; }
.ib-open > .card { box-shadow: none; }
@media (max-width: 720px) {
  .ib-row { flex-wrap: wrap; }
  .ib-need { flex-basis: 100%; white-space: normal; }
  .ib-need::before { content: none; }
}
.evidence { font-size: 12.5px; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }

.decision { display: grid; grid-template-columns: 90px 1fr auto; gap: 14px; padding: 14px 16px; border-bottom: 1px solid var(--line); align-items: start; }
.decision:last-child { border-bottom: 0; }

pre.code {
    margin: 0; padding: 14px 16px; overflow: auto; background: var(--surface-2); border-radius: 8px; border: 1px solid var(--line);
    font: 12.5px/1.55 var(--mono); max-height: 640px; white-space: pre;
}
pre.code .cm { color: var(--text-3); }
pre.code .check { background: var(--yellow-soft); color: var(--yellow); }
pre.code .k { color: var(--accent); }

.drop {
    border: 2px dashed var(--line-strong); border-radius: 12px; padding: 28px; text-align: center; background: var(--surface-2);
    position: relative; transition: border-color .15s, background .15s;
}
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop.busy, .drop.busy:hover { border-color: var(--accent); background: var(--surface-2); }
.drop.busy input[type=file] { cursor: progress; }
.spinner.lg { width: 28px; height: 28px; border-width: 3px; display: inline-block; }
.drop-meter { max-width: 360px; margin: 10px auto 0; }

.job { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); min-width: 0; }
.job .title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 420px; }
.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--accent); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.log { font: 12px/1.6 var(--mono); max-height: 360px; overflow: auto; padding: 10px 14px; background: var(--surface-2); border-top: 1px solid var(--line); }
.log div { white-space: pre-wrap; }
.log .t { color: var(--text-3); margin-right: 8px; }

.empty { text-align: center; padding: 36px 16px; color: var(--text-2); }
.empty .big { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.loading { padding: 40px; text-align: center; color: var(--text-3); }

.transcript-turn { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.transcript-turn .who { padding: 8px 14px; font-weight: 600; font-size: 12.5px; background: var(--surface-2); border-bottom: 1px solid var(--line); display: flex; gap: 8px; align-items: center; }
.transcript-turn pre { margin: 0; padding: 12px 14px; font: 12px/1.55 var(--mono); white-space: pre-wrap; max-height: 520px; overflow: auto; }

#blazor-error-ui {
    background: var(--red-soft); color: var(--red); bottom: 0; display: none; left: 0; padding: 10px 20px; position: fixed; width: 100%; z-index: 1000;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 12px; top: 8px; }
/* What happened (errors.js sets data-state): an error, or VGAI updated or restarting, which isn't one. */
#blazor-error-ui .eb { display: none; }
#blazor-error-ui:not([data-state]) .eb-error, #blazor-error-ui[data-state="error"] .eb-error,
#blazor-error-ui[data-state="updated"] .eb-updated, #blazor-error-ui[data-state="restarting"] .eb-restarting { display: inline; }
#blazor-error-ui[data-state="updated"], #blazor-error-ui[data-state="restarting"] { background: var(--accent-soft, var(--surface-2)); color: var(--text); }
#blazor-error-ui[data-state="restarting"] .reload { display: none; }

/* Tip: what an action really does. Shows on hover (after a short pause, so it doesn't flash) and on keyboard focus. */
.tip { position: relative; display: inline-flex; }
.tip.block { display: flex; }
.tip-pop {
    position: absolute; top: calc(100% + 8px); left: 0; z-index: 60;
    width: max-content; max-width: min(320px, calc(100vw - 32px));
    display: flex; flex-direction: column; gap: 6px;
    padding: 11px 13px; border-radius: var(--radius);
    background: var(--surface); color: var(--text-2); border: 1px solid var(--line-strong); box-shadow: var(--shadow-lg);
    font-size: 12.5px; line-height: 1.45; font-weight: 400; text-align: left; white-space: normal;
    opacity: 0; visibility: hidden; transform: translateY(-3px); pointer-events: none;
    transition: opacity .12s ease, transform .12s ease, visibility 0s linear .12s;
}
.tip-pop.above { top: auto; bottom: calc(100% + 8px); transform: translateY(3px); }
.tip-pop.right { left: auto; right: 0; }
.tip-pop::before {
    content: ""; position: absolute; top: -5px; left: 16px; width: 8px; height: 8px; transform: rotate(45deg);
    background: var(--surface); border-left: 1px solid var(--line-strong); border-top: 1px solid var(--line-strong);
}
.tip-pop.right::before { left: auto; right: 16px; }
.tip-pop.above::before { top: auto; bottom: -5px; transform: rotate(225deg); }
/* Shown on hover, or on keyboard focus: a click's focus doesn't keep it open, and a click puts it away until the
   pointer leaves (.quiet, set by app JS). */
.tip:hover > .tip-pop, .tip:has(:focus-visible) > .tip-pop {
    opacity: 1; visibility: visible; transform: none;
    transition: opacity .15s ease .35s, transform .15s ease .35s, visibility 0s linear .35s;
}
.tip:has(:focus-visible) > .tip-pop { transition-delay: 0s; }
@media (hover: hover) {
    .tip.quiet > .tip-pop { opacity: 0; visibility: hidden; transform: translateY(-3px);
        transition: opacity .12s ease, transform .12s ease, visibility 0s linear .12s; }
}
.tip-title { color: var(--text); font-weight: 600; font-size: 13px; }
.tip-text { color: var(--text-2); }
.tip-line { display: flex; gap: 7px; align-items: flex-start; padding-top: 6px; border-top: 1px solid var(--line); }
.tip-line svg { flex: none; margin-top: 2px; }
.tip-line > span { flex: 1 1 auto; min-width: 0; display: block; text-align: left; }
.tip-line.safe svg { color: var(--green); }
.tip-line.note svg { color: var(--yellow); }
.tip-line.db svg { color: var(--accent); }
.tip-line.db b { color: var(--text); font-weight: 600; }
/* Short tips (data-tip="…"): one floating tip for the page, placed by app JS, so a scrolling list can't clip it. Never
   the browser's own title tooltip: a title attribute is turned into data-tip on hover. */
.tip-float {
    position: fixed; z-index: 1000; max-width: min(320px, calc(100vw - 24px)); padding: 7px 10px; border-radius: 8px;
    background: var(--surface); color: var(--text); border: 1px solid var(--line-strong); box-shadow: var(--shadow-lg);
    font-size: 12.5px; line-height: 1.4; white-space: pre-line; overflow-wrap: anywhere; pointer-events: none;   /* a long file name breaks inside the tip */
    opacity: 0; transform: translateY(-3px); transition: opacity .12s ease, transform .12s ease;
}
.tip-float.above { transform: translateY(3px); }
.tip-float.on { opacity: 1; transform: none; }
.tip-float.small { padding: 4px 8px; font-size: 11.5px; border-radius: 6px; }
@media (hover: none) { .tip:hover > .tip-pop { opacity: 0; visibility: hidden; } .tip:focus-within > .tip-pop { opacity: 1; visibility: visible; } }

/* ---- The file view (FileView.razor): a list's file as it is, with the import laid over it ---- */
.fv { display: flex; flex-direction: column; min-height: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.fv.in-pane { border: 0; border-radius: 0; flex: 1; height: 100%; }
.fv-empty { padding: 24px; color: var(--text-2); }
.fv-sheets { display: flex; gap: 2px; padding: 8px 12px 0; border-bottom: 1px solid var(--line); overflow-x: auto; flex: none; }
.fv-sheets button {
    display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid transparent; border-bottom: 0; background: none;
    border-radius: 8px 8px 0 0; font: 13px var(--sans); color: var(--text-2); cursor: pointer; white-space: nowrap; margin-bottom: -1px;
}
.fv-sheets button.on { background: var(--surface); border-color: var(--line); color: var(--text); font-weight: 600; }
.fv-how { padding: 10px 14px 4px; font-size: 13px; color: var(--text-2); flex: none; }
.fv-how.bad { color: var(--red); }
.fv-legend { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 14px; flex: none; }
.fv-key { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); }
.fv-key b { font-family: var(--mono); font-size: 11.5px; }
.fv-tools { display: flex; align-items: center; gap: 8px; padding: 6px 14px 8px; border-bottom: 1px solid var(--line); flex: none; }
.fv-goto { width: 110px; height: 28px; }
.fv-grid { overflow: auto; flex: 1; min-height: 0; max-height: 70vh; }
.fv.in-pane .fv-grid { max-height: none; }
.fv-grid table { border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
.fv-grid th, .fv-grid td {
    border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 3px 8px; white-space: nowrap;
    max-width: 240px; overflow: hidden; text-overflow: ellipsis; text-align: left;
}
.fv-grid thead th {
    position: sticky; top: 0; z-index: 2; background: var(--surface-2); font: 600 11.5px var(--mono); color: var(--text-2); text-align: center;
    vertical-align: top;
}
.fv-field { display: block; font: 600 11px var(--sans); text-transform: none; margin-top: 1px; }
.fv-grid .rn {
    position: sticky; left: 0; z-index: 1; background: var(--surface-2); color: var(--text-3); font: 11.5px var(--mono); text-align: right;
    min-width: 64px;
}
.fv-grid thead .rn { z-index: 3; }
.fv-ok { color: var(--green); margin-left: 4px; }
.fv-bad { color: var(--red); margin-left: 4px; cursor: help; }
/* Columns VGAI reads: each field its own colour (--fc), the same on the field to point at, the column key and the column. */
.f-tone { --fc: hsl(var(--h, 192) var(--fs, 68%) var(--fl)); }
.f-ref { --h: 213; } .f-price { --h: 145; } .f-brand { --h: 265; } .f-alt { --h: 178; } .f-other { --h: 192; }
.f-description { --h: 215; --fs: 14%; } .f-moq { --h: 28; } .f-ean { --h: 322; } .f-tecdoc_no { --h: 262; } .f-lead_time { --h: 48; } .f-core_charge { --h: 2; }
.f-customs_code { --h: 238; } .f-origin_country { --h: 196; } .f-gross_weight { --h: 78; } .f-net_weight { --h: 102; } .f-volume { --h: 290; }
.f-length { --h: 342; } .f-width { --h: 14; } .f-height { --h: 60; --fs: 55%; }
.fv-grid .f-tone { background: color-mix(in srgb, var(--fc) 14%, var(--surface)); }
.fv-grid thead th.f-tone { color: var(--fc); }
.fv-key.f-tone { background: color-mix(in srgb, var(--fc) 16%, var(--surface)); color: var(--fc); }
.fv-grid tr.hdr td { font-weight: 700; border-bottom: 2px solid var(--line-strong); }
.fv-grid tr.dim td:not(.rn) { color: var(--text-3); }
.fv-grid tr.rej td:not(.rn) { background: var(--red-soft); }
.fv-grid tr.target td { box-shadow: inset 0 2px 0 var(--accent), inset 0 -2px 0 var(--accent); }
.fv-grid tbody tr:hover td:not(.rn) { filter: brightness(.97); }
.fv-point { display: flex; flex-direction: column; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); flex: none; }
.fv-grid .pick { cursor: crosshair; }
.fv-grid td.rn.pick { cursor: pointer; }
/* A button that reads as a link (a row number that opens the file at that row). */
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; }
.linkish:hover { text-decoration: underline; }

/* A recipe question's card: what the checks found and what answering puts in use (RecipeCheck.razor). */
.rc { display: flex; flex-direction: column; gap: 12px; }
.rc-sec { display: flex; flex-direction: column; gap: 10px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; }
.rc-h { font-size: 13px; font-weight: 650; }
.rc-h.sm { font-size: 12px; color: var(--text-2); font-weight: 600; margin-bottom: -4px; }
.rc-note { font-size: 12.5px; color: var(--text-2); border-left: 3px solid var(--accent); padding-left: 10px; }
.rc-list { margin: 0; padding-left: 18px; font-size: 12.5px; color: var(--text-2); display: flex; flex-direction: column; gap: 3px; }
.rc-list.bad li, .rc-list li.bad, .rc .bad { color: var(--red); }
.rc-list li.warn { color: var(--yellow); }
.rc-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.rc-kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; min-width: 0; }
.rc-kl { font-size: 11.5px; color: var(--text-2); font-weight: 500; }
.rc-kv { font-size: 18px; font-weight: 650; font-variant-numeric: tabular-nums; margin-top: 2px; }
.rc-ks { font-size: 11.5px; color: var(--text-3); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-kpi.good .rc-kv { color: var(--green); }
.rc-kpi.warn .rc-kv { color: var(--yellow); }
.rc-kpi.bad .rc-kv { color: var(--red); }
.rc-why { font-size: 13px; line-height: 1.5; }
.rc-rows { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; font-size: 12.5px; }
.rc-rows td, .rc-rows th { padding: 5px 10px; }
.rc-fit td.good { color: var(--green); }
.rc-fit td.warn { color: var(--yellow); }
.rc .fv { max-height: 460px; }
/* Pointing at columns: the fields above the file take room of their own, so the file keeps its 460px under them */
.rc .fv:has(.fv-point) { max-height: none; }
.rc .fv:has(.fv-point) .fv-grid { max-height: 460px; }

/* VGPC history page (HistoryLinksPage.razor): a folder and the VGPC names that look like it. */
.hl { padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.hl-row { display: flex; align-items: flex-start; gap: 10px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 13px; }
.hl-row .chip { flex: none; margin-top: 1px; }

/* Database (a look behind the curtain) */
.db-page { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 16px; align-items: start; }
.db-side { padding: 8px; display: flex; flex-direction: column; gap: 1px; position: sticky; top: 64px; max-height: calc(100vh - 90px); overflow: auto; }
.db-group { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); padding: 10px 8px 4px; }
.db-item { display: flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 6px; color: var(--text); text-decoration: none; font-size: 12.5px; }
.db-item:hover { background: var(--surface-2); }
.db-item.on { background: var(--accent-soft, var(--surface-2)); color: var(--accent); font-weight: 600; }
.db-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.db-sql { width: 100%; font-size: 13px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); resize: vertical; }
.db-pager { padding: 8px 12px; border-bottom: 1px solid var(--line); gap: 8px; }
.db-rows { display: flex; flex-direction: column; height: calc(100vh - 230px); min-height: 360px; }
.db-scroll { overflow: auto; max-height: 70vh; }
.db-scroll .t { font-size: 12.5px; }
.db-scroll td, .db-scroll th { white-space: nowrap; padding: 5px 10px; }
.db-cols { font-size: 12.5px; }
@media (max-width: 800px) { .db-page { grid-template-columns: 1fr; } .db-side { position: static; max-height: 260px; } }

/* Master data (Grunddata): registers with a row that opens to edit it */
.t tr.click { cursor: pointer; }
.t tr.click:hover td { background: var(--surface-2); }
.t tr.click.on td { background: var(--accent-soft); }
.t tr.detail > td { background: var(--surface-2); padding: 12px 16px 16px; }
.md-detail { display: flex; flex-direction: column; gap: 10px; cursor: default; }
.md-h { font-size: 12px; font-weight: 600; color: var(--text-2); margin-top: 4px; }
.md-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.md-form label { display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; color: var(--text-2); }
.md-form label.check { flex-direction: row; align-items: center; gap: 7px; font-size: 13px; color: var(--text); height: 32px; }
.md-form input:not([type=checkbox]), .md-form select { height: 32px; }
input.sm, select.sm, .picker.sm > input { height: 28px; font-size: 12.5px; padding: 0 8px; border-radius: 7px; }
select.sm { padding-right: 26px; background-position: right 8px center; }
.chip .x { border: 0; background: none; color: var(--text-3); cursor: pointer; padding: 0 0 0 4px; font-size: 14px; line-height: 1; }
.chip .x:hover { color: var(--red); }

/* ---- price rules ------------------------------------------------------------------------------------------------ */
.pr-text { width: 100%; resize: vertical; font: inherit; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); }
.pr-draft { border-color: var(--accent); }
.pr-rule { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.pr-fields { display: flex; flex-wrap: wrap; gap: 10px 14px; }
.pr-fields label { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: .03em; }
.pr-fields input, .pr-fields select { height: 30px; min-width: 120px; }
.pr-fields .picker { min-width: 200px; }
.pr-preview { display: flex; flex-direction: column; gap: 6px; }
.pr-examples { display: grid; grid-template-columns: auto auto; justify-content: start; gap: 4px 14px; align-items: center; }

/* A sample line's extra columns, folded (ListPage) */
details.extras { margin-top: 2px; }
details.extras summary { cursor: pointer; user-select: none; color: var(--text-3); }
details.extras[open] summary { margin-bottom: 2px; }
details.extras > div { overflow-wrap: anywhere; }


/* Import, step by step (ManualImportPage) */
.steps { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.steps .step { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--text-3); font-size: 13px; }
.steps .step b { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--line); color: var(--text-2); font-size: 11px; }
.steps .step.on { border-color: var(--accent); color: var(--text); font-weight: 600; }
.steps .step.on b { background: var(--accent); color: #fff; }
.steps .step.done { color: var(--text-2); }
.steps .step.done b { background: var(--accent-soft); color: var(--accent); }
.callout { border: 1px solid var(--accent); background: var(--accent-soft); border-radius: 8px; padding: 10px 12px; font-size: 13px; }
.callout.warn { border-color: var(--yellow); background: var(--yellow-soft); }
ul.guess { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13px; }
ul.guess li { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
ul.guess li .k { min-width: 110px; color: var(--text-3); font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
ul.guess li.bad { color: var(--red); }
ul.guess li.warn { color: var(--yellow); }
ol.steps-plain { margin: 0; padding-left: 20px; display: grid; gap: 4px; }


/* Pointing at columns (FileView): fields in groups, the picked ones coloured, the file's settings as fields */
.fv-point .fv-how-to { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; font-size: 13px; }
.fv-point .fv-how-to > span { color: var(--text-2); }
.fv-point .fv-now { min-height: 20px; font-size: 13px; color: var(--accent); }
/* A field to point at: dashed while no column is chosen, filled in its colour once one is, one accent ring while it is the one being pointed */
.fv-point .fv-pick { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border-radius: 999px; box-sizing: border-box;
    border: 1px dashed var(--line-strong); background: transparent; color: var(--text-2); font-size: 12.5px; font-weight: 550; line-height: 1;
    white-space: nowrap; cursor: pointer; user-select: none; transition: border-color .12s ease, background .12s ease; }
.fv-point .fv-pick:hover { border-color: var(--accent); color: var(--text); }
.fv-point .fv-pick.picked { border-style: solid; color: var(--text); padding-right: 5px; }
.fv-point .fv-pick.picked.f-tone { background: color-mix(in srgb, var(--fc) 16%, var(--surface)); border-color: color-mix(in srgb, var(--fc) 55%, var(--surface)); }
.fv-point .fv-pick.picked.f-tone .fv-col { color: var(--fc); }
.fv-point .fv-pick.f-tone:not(.picked) { border-color: color-mix(in srgb, var(--fc) 45%, var(--surface)); }
.fv-point .fv-pick.f-tone:hover { border-color: var(--fc); }
.fv-point .fv-pick.f-tone.on.picked, .fv-point .fv-pick.f-tone.on:not(.picked) { border-style: solid; border-color: var(--fc, var(--accent)); box-shadow: inset 0 0 0 1px var(--fc, var(--accent)); color: var(--text); }
.fv-point .fv-col { display: inline-flex; align-items: center; height: 18px; padding: 0 5px; border-radius: 5px; font: 600 11px var(--mono);
    background: var(--surface); color: var(--text-2); }
.fv-point .fv-clear { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; padding: 0; border: 0; border-radius: 50%;
    background: transparent; color: var(--text-3); font: 14px/1 var(--sans); cursor: pointer; }
.fv-point .fv-clear:hover { background: var(--red-soft); color: var(--red); }
.fv-point .fv-group { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.fv-point .fv-group-name { width: 92px; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); }
.fv-point .fv-file { display: flex; flex-direction: column; gap: 6px; padding-bottom: 10px; border-bottom: 1px solid var(--line); font-size: 13px; }
.fv-point .fv-file .fv-group { gap: 6px 14px; min-height: 28px; }
.fv-point .fv-set { display: inline-flex; align-items: center; gap: 8px; }
.fv-point .fv-set > span, .fv-point .fv-file label.check { color: var(--text-2); }

/* Choice: a dropdown of fixed choices, looking like a field, its list the Picker's */
.choice-btn { display: inline-flex; align-items: center; justify-content: space-between; gap: 10px; height: 34px; padding: 0 10px; min-width: 100%;
    border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font: 14px var(--sans); cursor: pointer;
    transition: border-color .12s ease, box-shadow .12s ease; white-space: nowrap; }
.choice-btn:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--line-strong)); }
.choice-btn:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.choice-btn:disabled { opacity: .55; cursor: not-allowed; }
.choice-btn svg { transform: rotate(90deg); flex: none; }
.choice.sm .choice-btn { height: 28px; font-size: 12.5px; padding: 0 8px; border-radius: 7px; }
.choice .picker-item { flex-direction: row; align-items: baseline; gap: 8px; }
.choice .picker-item.chosen .pv { color: var(--accent); }
.choice .picker-item .pv { font-weight: 500; }

/* A recipe draft waiting for a person (DraftCard): its changes and the AI's notes as short lists */
.dc-list { margin: 4px 0 0; padding-left: 18px; font-size: 13px; display: grid; gap: 2px; }

/* Price lookup: filters and the search in progress */
/* The search: number, brand and the button in one bar; the button sits inside it, smaller than the bar */
.searchbar { display: flex; align-items: center; gap: 4px; height: 48px; padding: 0 5px 0 14px; border-radius: 10px;
  border: 1px solid var(--line-strong); background: var(--surface); transition: border-color .12s ease, box-shadow .12s ease; }
.searchbar:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--line-strong)); }
.searchbar:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.searchbar .sb-icon { color: var(--text-3); }
.searchbar input, .searchbar input:hover, .searchbar input:focus { height: 38px; border: 0; box-shadow: none; background: transparent; font-size: 16px; }
.searchbar .sb-number { flex: 1; min-width: 0; padding: 0 6px; }
.searchbar .sb-go { height: 38px; padding: 0 18px; font-size: 14px; }
/* The filters under it: rows of a label and fields, all one height */
.sf-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: 34px; }
.sf-row + .sf-row { margin-top: 10px; }
.sf-label { min-width: 86px; font-size: 12.5px; color: var(--text-2); }
.sf-label { display: inline-block; }
.dotted { border-bottom: 1px dotted var(--text-3); }
.sf-row .btn { height: 34px; }
.sf-all { font-size: 12.5px; color: var(--text-3); }
.sf-label.short { min-width: 0; }
.sf-sep { width: 1px; height: 20px; margin: 0 8px; background: var(--line); }
/* The filters switched off for one lookup ("vis alle"): grey, with a line saying so above the results. */
.search-filters.off .filter-chip { opacity: .45; }
.filters-off { display: flex; align-items: center; gap: 8px; margin: -4px 0 12px; padding: 7px 12px; border-radius: 8px;
  background: var(--yellow-soft); color: var(--text); border: 1px solid var(--line); }
.filters-off svg { color: var(--yellow); flex: none; }
.filters-off a { margin-left: auto; font-weight: 500; }

/* Sammenlign (CompareTool): the input, what's compared, the views and the table of the cheapest */
.cmp-tabs { margin-bottom: 0; padding: 0 8px; align-items: center; }
.cmp-input { display: grid; grid-template-columns: 1fr 220px; gap: 12px; }
.cmp-input textarea { min-height: 150px; font: 12.5px/1.5 var(--mono); white-space: pre; overflow: auto; }
.cmp-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 16px; }
.cmp-drop svg { color: var(--text-3); }
.cmp-cols { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 12px; }
.cmp-cols label { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.cmp-cols .choice { min-width: 170px; }
.cmp-what { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; font-size: 13.5px; }
.cmp-what > svg { color: var(--text-3); }
.cmp-views { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.cmp-view { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 7px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text-2); font: 500 12.5px var(--sans); cursor: pointer; white-space: nowrap; }
.cmp-view:hover { border-color: var(--line-strong); color: var(--text); }
.cmp-view.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.cmp-view .count { font-size: 11px; background: var(--gray-soft); color: var(--text-2); border-radius: 999px; padding: 0 6px; }
.cmp-pct { width: 46px; height: 22px; padding: 0 6px; font-size: 12px; text-align: right; -moz-appearance: textfield; }
.cmp-pct::-webkit-inner-spin-button, .cmp-pct::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.cmp-views .choice { width: 190px; }
/* Sammenlign and Prisliste: a cell holds a price with its supplier and list under it, so rows have several lines. */
.cmp-grid .dg-t td { vertical-align: top; height: auto; padding-top: 5px; padding-bottom: 5px; }
.cmp-sup { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 760px) { .cmp-input { grid-template-columns: 1fr; } }

/* A grid's Excel… button with a menu of its Excel-opskrifter (DataGrid) */
.xbtn { position: relative; display: inline-flex; gap: 0; }
.xbtn > .btn:first-child:not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.xbtn .xbtn-more { border-top-left-radius: 0; border-bottom-left-radius: 0; border-left-width: 0; padding: 0 6px; }
.xbtn .xbtn-more svg { transform: rotate(90deg); }
.xbtn-pop { right: 0; left: auto; width: 320px; top: calc(100% + 4px); padding: 6px; display: flex; flex-direction: column;
  max-height: min(70vh, 560px); }
.xbtn-list { overflow-y: auto; min-height: 0; }
.xbtn-search { margin: 0 4px 6px; height: 30px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 7px;
  background: var(--surface); color: var(--text); font: 13px var(--sans); }
.xbtn-group { display: flex; align-items: center; gap: 6px; width: 100%; padding: 8px 8px 4px; border: 0; background: none;
  color: var(--text-3); font: 600 11.5px var(--sans); letter-spacing: .02em; text-transform: uppercase; text-align: left; cursor: pointer; }
.xbtn-group:hover { color: var(--text); }
.xbtn-group svg { transition: transform .12s; }
.xbtn-group[aria-expanded="true"] svg { transform: rotate(90deg); }
.xbtn-group .faint { margin-left: auto; font-weight: 400; text-transform: none; }
.xbtn-head { padding: 4px 8px 6px; }
.xbtn-item { display: flex; align-items: flex-start; gap: 8px; padding: 7px 8px; border-radius: 7px; color: var(--text); text-decoration: none; }
.xbtn-item:hover { background: var(--surface-2); text-decoration: none; }
.xbtn-item svg { margin-top: 2px; color: var(--text-3); }
.xbtn-what { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
button.xbtn-item { width: 100%; background: none; border: 0; font: inherit; text-align: left; cursor: pointer; }
.sets-row > .xbtn-item { flex: 1; min-width: 0; width: auto; }
.sets-row > .xbtn-item:hover { background: none; }

/* Prisliste (PriceListTool): how it's priced and the list, side by side */
/* Prisliste's price: one row of controls over the list. */
.pl-row { display: flex; align-items: center; gap: 10px 18px; flex-wrap: wrap; }
.pl-row > label { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.pl-pct { display: inline-flex; align-items: center; gap: 4px; color: var(--text-2); }
.pl-pct input { width: 64px; height: 28px; padding: 0 6px; text-align: right; -moz-appearance: textfield; }
.pl-pct input::-webkit-inner-spin-button, .pl-pct input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.pl-groups { border-top: 1px solid var(--line); max-height: 260px; overflow: auto; }
.pl-group { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.pl-group-name { font-weight: 500; font-size: 13px; }
.filter-chip.other { background: var(--gray-soft); border-color: var(--line-strong); }
/* AddPicker: a "+" that slides open into a field to pick from */
.addpick { display: inline-flex; align-items: center; position: relative; }
.addpick-btn { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0; border-radius: 999px;
  border: 1px dashed color-mix(in srgb, var(--accent) 45%, var(--line-strong)); background: transparent; color: var(--accent); cursor: pointer;
  transition: width .22s ease, opacity .18s ease, margin .22s ease, background .12s ease; }
.addpick-btn:hover { background: var(--accent-soft); border-style: solid; }
.addpick .addpick-field { width: 0; opacity: 0; overflow: hidden; transition: width .25s ease, opacity .2s ease; }
.addpick .addpick-field > input { height: 30px; border-radius: 999px; padding: 0 12px; font-size: 13px; }
.addpick.open .addpick-btn { width: 0; opacity: 0; margin: 0; border-width: 0; pointer-events: none; }
.addpick.open .addpick-field { width: 220px; opacity: 1; overflow: visible; }
@media (prefers-reduced-motion: reduce) { .addpick-btn, .addpick .addpick-field { transition: none; } }
/* MoreFilters: the less used filters behind a button */
.mf { position: relative; }
.sets-n.on { background: var(--accent); color: #fff; }
.mf-pop { position: absolute; top: calc(100% + 4px); right: 0; z-index: 70; width: 320px; padding: 6px; border-radius: var(--radius);
  border: 1px solid var(--line-strong); background: var(--surface); box-shadow: var(--shadow-lg); outline: none; }
.mf-item { padding: 10px; display: grid; gap: 6px; }
.mf-item .datefield { justify-self: start; }
.mf-item + .mf-item { border-top: 1px solid var(--line); }
.mf-head { display: flex; align-items: center; justify-content: space-between; font-size: 13px; }
.mf-help { font-size: 11.5px; color: var(--text-3); line-height: 1.45; }
.mf-switch { display: flex; align-items: center; gap: 10px; font-size: 13px; cursor: pointer; }
.mf-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.mf-track { position: relative; flex: none; width: 34px; height: 20px; border-radius: 999px; background: var(--line-strong); transition: background .15s ease; }
.mf-knob { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25);
  transition: transform .15s ease; }
.mf-switch input:checked + .mf-track { background: var(--accent); }
.mf-switch input:checked + .mf-track .mf-knob { transform: translateX(14px); }
.mf-switch input:focus-visible + .mf-track { box-shadow: 0 0 0 3px var(--accent-soft); }
/* LineFixes on the list page: a row's fields to correct, over the rows; a corrected row's pencil */
.lfx { display: grid; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2, var(--surface)); }
.lfx-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lfx-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px 14px; }
.lfx-field { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.lfx-label { font-size: 11.5px; color: var(--text-2); }
.lfx-field input { height: 32px; width: 100%; }
.lfx-field.fixed input { border-color: color-mix(in srgb, var(--accent) 45%, var(--line-strong)); }
.lfx-field.changed input { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.lfx-was { display: flex; gap: 6px; align-items: baseline; font-size: 11.5px; color: var(--text-3); }
.lfx-foot { display: flex; gap: 8px; align-items: center; }
.lfx-foot input { height: 34px; min-width: 0; }
.lfx-mark { display: inline-flex; margin-left: 4px; color: var(--accent); vertical-align: -1px; }
/* ListsFilter: the brand's lists, some left out, from a chip next to the brand */
.lf-btn { gap: 5px; padding: 3px 8px 3px 10px; font: inherit; font-size: 12.5px; cursor: pointer; }
.lf-btn .sets-chev { color: var(--text-3); }
.lf-pop { left: 0; right: auto; width: 420px; max-width: calc(100vw - 32px); }
.lf-head, .lf-help { padding: 6px 8px 0; }
.lf-help { padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.lf-list { max-height: 380px; overflow-y: auto; padding-top: 2px; }
.lf-row { display: flex; align-items: flex-start; gap: 8px; padding: 6px 8px; border-radius: 6px; font-size: 13px; cursor: pointer; }
.lf-row:hover { background: var(--accent-soft); }
.lf-row input { margin: 3px 0 0; flex: none; }
.lf-what { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.lf-name { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lf-meta { font-size: 11.5px; color: var(--text-3); }
.lf-row.off .lf-name { color: var(--text-3); text-decoration: line-through; }
.lf-tags { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; max-width: 40%; }
.lf-tag { padding: 1px 7px; border-radius: 999px; font-size: 11px; background: var(--violet-soft); color: var(--violet); }
/* FilterSets: the saved filter sets in a menu */
.sets { position: relative; }
.sets-btn b { font-weight: 650; }
.sets-n { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--gray-soft); color: var(--text-2);
  font-size: 11px; display: inline-flex; align-items: center; justify-content: center; }
.sets-chev { transform: rotate(90deg); color: var(--text-3); }
.sets-pop { position: absolute; top: calc(100% + 4px); right: 0; z-index: 70; width: 320px; padding: 4px; border-radius: var(--radius);
  border: 1px solid var(--line-strong); background: var(--surface); box-shadow: var(--shadow-lg); }
.sets-empty { padding: 8px 10px; font-size: 12.5px; color: var(--text-3); line-height: 1.45; }
.sets-row { display: flex; align-items: center; border-radius: 6px; }
.sets-row:hover { background: var(--accent-soft); }
.sets-use { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 7px 8px; border: 0; background: transparent;
  color: var(--text); font: 13px var(--sans); text-align: left; cursor: pointer; }
.sets-check { width: 14px; display: inline-flex; color: var(--accent); }
.sets-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sets-row.on .sets-name { color: var(--accent); }
/* A set: its name, and its filters under it */
.sets-what { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.sets-count { font-size: 11.5px; font-weight: 400; color: var(--text-3); line-height: 1.35; }
.sets-del { flex: none; display: inline-flex; padding: 6px; margin-right: 2px; border: 0; border-radius: 6px; background: transparent;
  color: var(--text-3); cursor: pointer; opacity: 0; }
.sets-row:hover .sets-del, .sets-del:focus-visible { opacity: 1; }
.sets-del:hover { color: var(--red); background: var(--red-soft); }
/* ConfirmDelete: the bin opened into "slet? yes / no" (as deleting a conversation). */
.cd-confirm { flex: none; display: inline-flex; gap: 2px; margin-right: 2px; overflow: hidden; animation: cd-open .18s ease-out; }
.cd-confirm button { display: grid; place-items: center; width: 25px; height: 25px; border: 0; border-radius: 6px; cursor: pointer;
  background: var(--gray-soft); color: var(--text-2); transition: background-color .15s, color .15s; }
.cd-yes:hover { background: var(--red-soft); color: var(--red); }
.cd-no:hover { background: var(--line); color: var(--text); }
@keyframes cd-open { from { max-width: 25px; opacity: .4; } to { max-width: 60px; opacity: 1; } }
.sets-foot { margin-top: 4px; padding: 6px 4px 2px; border-top: 1px solid var(--line); }
.sets-add { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 8px; border: 0; border-radius: 6px; background: transparent;
  color: var(--accent); font: 500 13px var(--sans); cursor: pointer; text-align: left; }
.sets-add:hover { background: var(--accent-soft); }
.sets-name-row { display: flex; gap: 6px; }
.sets-name-row input { flex: 1; min-width: 0; }
.sets-name-row .btn { height: 34px; }
.sets-hint { padding: 6px 8px 4px; font-size: 11.5px; color: var(--text-3); line-height: 1.4; }

.filter-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 10px; border-radius: 999px; font-size: 12.5px;
  background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--text); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }
.filter-chip .x { border: 0; background: transparent; color: var(--text-3); cursor: pointer; font-size: 14px; line-height: 1; padding: 0 4px; border-radius: 50%; }
.filter-chip .x:hover { color: var(--text); background: color-mix(in srgb, var(--accent) 20%, transparent); }
.filter-chip.tag { background: var(--violet-soft); color: var(--violet); border-color: color-mix(in srgb, var(--violet) 30%, transparent); font-weight: 550; }
.filter-chip.group { font-weight: 550; }
.filter-chip.group .n { color: var(--text-3); font-weight: 450; }
.filter-chip.tag .x:hover { background: color-mix(in srgb, var(--violet) 20%, transparent); }
.tag-edit { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.list-labels { gap: 8px; margin: -10px 0 16px; min-height: 30px; }
.offer-list { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
/* "Tillæg" before the name of a list that is a supplement (SupplementMark): small, in the list line's height. */
.supp-mark { display: inline-block; margin-right: 5px; padding: 0 5px; border-radius: 4px; background: var(--blue-soft); color: var(--blue); font-size: 11px; font-weight: 600; line-height: 16px; vertical-align: 1px; }
.search-loading { position: relative; overflow: hidden; }
.search-sweep { position: absolute; left: 0; right: 0; top: 0; height: 3px; overflow: hidden; }
.search-sweep::before { content: ""; position: absolute; top: 0; bottom: 0; width: 35%; border-radius: 3px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent); animation: search-sweep 1.1s ease-in-out infinite; }
@keyframes search-sweep { from { left: -35%; } to { left: 100%; } }
.search-dots { display: inline-flex; gap: 5px; margin-right: 4px; }
.search-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: search-dot 1s ease-in-out infinite; }
.search-dots i:nth-child(2) { animation-delay: .15s; }
.search-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes search-dot { 0%, 80%, 100% { transform: scale(.55); opacity: .35; } 40% { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .search-sweep::before, .search-dots i { animation: none; } }

/* DateField: a day as people at NAP write it (16-10-2026), typed or picked in a Danish calendar */
.datefield { position: relative; display: inline-flex; align-items: center; }
.datefield > input { width: 140px; padding-right: 30px; font-variant-numeric: tabular-nums; }
.datefield.bad > input { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.datefield-btn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--text-3);
  cursor: pointer; padding: 4px; border-radius: 6px; display: inline-flex; }
.datefield-btn:hover { color: var(--text); background: var(--accent-soft); }
.datefield-pop { position: absolute; top: calc(100% + 4px); left: 0; z-index: 70; padding: 8px; border-radius: var(--radius);
  border: 1px solid var(--line-strong); background: var(--surface); box-shadow: var(--shadow-lg); width: max-content; }
.datefield-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; text-transform: capitalize; }
.datefield-grid { border-collapse: collapse; font-size: 12.5px; }
.datefield-grid th { font-weight: 500; color: var(--text-3); padding: 2px 0; width: 32px; text-align: center; font-size: 11.5px; }
.datefield-grid td { padding: 1px; text-align: center; }
.datefield-grid .wk { color: var(--text-3); font-size: 11px; width: 30px; }
.datefield-grid .day { width: 30px; height: 28px; border: 0; border-radius: 6px; background: transparent; color: var(--text); cursor: pointer;
  font-variant-numeric: tabular-nums; }
.datefield-grid .day:hover { background: var(--accent-soft); }
.datefield-grid .day.other { color: var(--text-3); }
.datefield-grid .day.today { box-shadow: inset 0 0 0 1px var(--accent); }
.datefield-grid .day.on { background: var(--accent); color: #fff; }
.datefield-foot { display: flex; justify-content: space-between; margin-top: 4px; }
/* TimeField: the hour, then the minutes, in the date field's look. */
.timefield > input { width: 96px; }
.timefield-pop { width: 236px; }
.timefield-label { font-size: 11.5px; color: var(--text-3); margin: 2px 2px 4px; }
.timefield-hours { display: grid; grid-template-columns: repeat(6, 1fr); gap: 2px; margin-bottom: 6px; }
.timefield-minutes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; }
.timefield-pop .day { height: 28px; border: 0; border-radius: 6px; background: transparent; color: var(--text); cursor: pointer; font: 12.5px var(--sans); font-variant-numeric: tabular-nums; }
.timefield-pop .day:hover { background: var(--accent-soft); }
.timefield-pop .day.on { background: var(--accent); color: #fff; }

/* Prisopslag: NAP's own item in Business Central under a brand's offers: purchase / offers / sales / stock, kept small. */
.card-head.wrap { flex-wrap: wrap; row-gap: 6px; }
.nap-sum { display: flex; flex-direction: column; gap: 6px; padding-top: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line); font-size: 12px; }
.nap-cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.nap-col { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.nap-col + .nap-col { border-left: 1px solid var(--line); padding-left: 16px; margin-left: 16px; }
.nap-col-head { font-size: 10.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-2); }
.nap-col-head .faint { font-weight: 500; letter-spacing: 0; text-transform: none; }
.nap-col .kv { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.nap-col .kv > span:first-child { color: var(--text-2); white-space: nowrap; }
.nap-col .kv > :last-child { text-align: right; font-variant-numeric: tabular-nums; }
.nap-col .kv .good { color: var(--green); }
.nap-col .kv .warn { color: var(--yellow); }
.nap-col .kv .bad { color: var(--red); }
.nap-col .kv-sub { font-size: 11.5px; color: var(--text-2); }
@media (max-width: 900px) {
    .nap-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 10px; }
    .nap-col + .nap-col { border-left: 0; padding-left: 0; margin-left: 0; }
    .nap-col:nth-child(even) { border-left: 1px solid var(--line); padding-left: 16px; margin-left: 16px; }
}
/* Sammenlign, NAP's items: a sales price close to (or under) the cheapest offer. */
.cmp-low { color: var(--red); font-weight: 600; }

/* ---- DataGrid (Shared/DataGrid.razor, grid.js): the one grid for rows of data ---- */
.dg { position: relative; display: flex; flex-direction: column; min-width: 0; --dg-row: 32px; }
.dg-compact { --dg-row: 26px; }
.dg-comfy { --dg-row: 40px; }
.dg-fill { flex: 1; min-height: 0; }
.dg-bar { flex: none; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 0 0 10px; }
.dg-fill .dg-bar { padding: 8px 14px; border-bottom: 1px solid var(--line); }
.dg-bar > .grow { flex: 1; }
/* One height for the bar's controls. */
.dg-bar .btn, .dg-bar input[type=search], .dg-bar .a-seg { height: 30px; }
.dg-bar .a-seg button { height: 24px; }
.dg-bar .btn.sq { width: 30px; }
.dg-quick { flex: 0 1 240px; min-width: 120px; }
.dg-count { white-space: nowrap; }
.dg-fchip { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 3px 0 9px; border-radius: 999px;
    background: var(--accent-soft); color: var(--accent); font-size: 12px; white-space: nowrap; }
.dg-fchip b { font-weight: 600; }
.dg-fchip button { display: inline-flex; padding: 4px; border: 0; border-radius: 999px; background: transparent; color: inherit; cursor: pointer; }
.dg-fchip button:hover { background: color-mix(in srgb, var(--accent) 18%, transparent); }
.dg-popwrap { position: relative; }
.dg-gear { position: relative; }
.dg-dot { position: absolute; top: 4px; right: 4px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.dg-views-btn .dg-changed { font-size: 11px; font-style: italic; color: var(--text-3); }

.dg-scroll { overflow: auto; min-height: 0; }
.dg-fill .dg-scroll { flex: 1; }
/* Rows from a source scroll inside the grid: Virtualize reads the rows the box shows (in the page's scroll it would read them all). */
.dg-boxed:not(.dg-fill) .dg-scroll { max-height: calc(100vh - 150px); }
/* A page whose grid is boxed ends close under it, so the box reaches down to the window's bottom (grid.js fit). */
.content:has(.dg-boxed:not(.dg-fill)) { padding-bottom: 16px; }
/* A grid as tall as its rows and wider than its place: its scrollbar across is a bar of its own that stays at the
   window's bottom while the grid goes on below (grid.js hbar); the box's own isn't shown. */
.dg-hbar { display: none; }
.dg[data-dg-wide] > .dg-scroll { scrollbar-width: none; }
.dg[data-dg-wide] > .dg-hbar { display: block; position: sticky; bottom: 0; z-index: 4; overflow-x: auto; overflow-y: hidden; background: var(--surface); }
.dg-hbar > div { height: 1px; }
.dg-t { table-layout: fixed; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.dg-fill .dg-t { font-size: 12.5px; }
.dg-t th { position: sticky; top: 0; z-index: 2; padding: 0; cursor: pointer; user-select: none; }
.dg-h { display: flex; align-items: center; gap: 4px; height: 34px; padding: 0 6px 0 10px; }
.dg-t th.num .dg-h { justify-content: flex-end; }
.dg-h-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.dg-sort { flex: none; color: var(--accent); font-weight: 700; }
.dg-sort sub { font-size: 9px; }
.dg-h-menu { flex: none; display: inline-flex; margin-left: auto; padding: 2px; border: 0; border-radius: 4px; background: transparent;
    color: var(--text-3); cursor: pointer; opacity: 0; }
.dg-t th.num .dg-h-menu { margin-left: 0; }
.dg-t th:hover .dg-h-menu, .dg-h-menu:focus-visible { opacity: 1; }
.dg-h-menu:hover { background: var(--gray-soft); color: var(--text); }
.dg-t th.dg-filtered .dg-h-text { color: var(--accent); }
.dg-t th.dg-drop { box-shadow: inset 2px 0 0 var(--accent); }
.dg-resize { position: absolute; top: 0; right: 0; width: 7px; height: 100%; cursor: col-resize; z-index: 3; touch-action: none; }
.dg-resize::after { content: ""; position: absolute; top: 25%; bottom: 25%; right: 2px; width: 2px; border-radius: 1px; }
.dg-t th:hover .dg-resize::after { background: var(--line-strong); }
.dg-t th .dg-resize:hover::after, .dg-resizing .dg-resize::after { background: var(--accent); }
.dg-resizing, .dg-resizing * { cursor: col-resize !important; user-select: none; }
/* A row is as high as its density says (the long lists scroll virtually by it): the border is part of it. */
.dg-t td { height: var(--dg-row); box-sizing: border-box; padding: 0 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dg-wrapping .dg-t td { height: auto; padding-top: 6px; padding-bottom: 6px; white-space: normal; overflow-wrap: anywhere; }
.dg-t td.dg-pin, .dg-t th.dg-pin { position: sticky; z-index: 1; background: var(--surface); }
.dg-t th.dg-pin { z-index: 3; background: var(--surface-2); }
.dg-t .dg-pin-last { box-shadow: 1px 0 0 var(--line-strong); }
.dg-measuring { table-layout: auto !important; }
.dg-measuring th, .dg-measuring td { white-space: nowrap !important; }
.dg-empty { padding: 24px; text-align: center; color: var(--text-3); font-size: 13px; }
/* Rows of more than one line, measured (grid.js → RowSized): every row and placeholder exactly that high, so the long
   lists' spacers add up. */
.dg-scroll { overflow-anchor: none; }
.dg-sized .dg-t tbody > tr:not(.dg-detail) > td { height: var(--dg-item); box-sizing: border-box; }
/* A row the source is still reading: a bar where its text comes. */
.dg-t tr.dg-ph > td { padding-top: 0; padding-bottom: 0; vertical-align: middle; }
.dg-skel { display: inline-block; width: 70%; max-width: 120px; height: 9px; border-radius: 4px; vertical-align: middle;
    background: linear-gradient(90deg, var(--surface-2) 25%, var(--line) 50%, var(--surface-2) 75%); background-size: 200% 100%;
    animation: dg-skel 1.2s ease-in-out infinite; }
.dg-ph td.num { text-align: right; }
.dg-ph td.num .dg-skel { width: 50%; }
@keyframes dg-skel { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .dg-skel { animation: none; } }
/* A row's details under it (a register's form): as wide as the grid's box, text as it wraps. */
.dg-t tr.dg-detail > td { height: auto; padding: 12px 16px 16px; white-space: normal; overflow: visible; background: var(--surface-2); }

/* The Kolonner panel and a column's menu (they borrow the saved sets' popover). */
.dg-panel { width: 300px; max-height: min(70vh, 560px); overflow-y: auto; }
.dg-find { width: 100%; height: 30px; margin-bottom: 2px; }
.dg-sec { padding: 8px 8px 4px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); }
.dg-sec .faint { font-weight: 400; text-transform: none; letter-spacing: 0; }
.dg-colrow { display: flex; align-items: center; gap: 6px; padding: 1px 6px; border-radius: 6px; font-size: 13px; }
.dg-colrow:hover { background: var(--accent-soft); }
.dg-colrow[draggable=true] { cursor: grab; }
.dg-colrow.dg-drop { box-shadow: inset 0 2px 0 var(--accent); }
.dg-colrow label { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 4px 0; cursor: pointer; }
.dg-colrow label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dg-grip { flex: none; }
.dg-grip-space { flex: none; width: 13px; }
.dg-mini { display: inline-flex; padding: 3px; border: 0; border-radius: 4px; background: transparent; color: var(--text-3); cursor: pointer; }
.dg-mini.on { color: var(--accent); }
.dg-panel-foot { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; padding: 10px 6px 4px; border-top: 1px solid var(--line); }
.dg-panel-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
label.dg-panel-row { justify-content: flex-start; cursor: pointer; }
.dg-colpop { top: 0; left: 0; right: auto; width: 230px; visibility: hidden; }
.dg-mi { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 8px; border: 0; border-radius: 6px; background: transparent;
    color: var(--text); font: 13px var(--sans); text-align: left; cursor: pointer; }
.dg-mi:hover { background: var(--accent-soft); }
.dg-mi svg { color: var(--text-3); }
.dg-mi.on { color: var(--accent); font-weight: 600; }
.dg-mi.on svg { color: var(--accent); }
.dg-msep { height: 1px; margin: 4px 0; background: var(--line); }
.dg-mfilter { display: flex; flex-direction: column; gap: 6px; padding: 4px 8px 6px; }
.dg-mfilter input { width: 100%; height: 30px; }
.dg-range { display: flex; align-items: center; gap: 6px; }
.dg-range input { flex: 1; min-width: 0; }
.dg-share.on { opacity: 1; color: var(--accent); }
.dg-share-row { display: flex; align-items: center; gap: 8px; cursor: pointer; }
/* A DataGrid in a card: its bar inside the card's edges. Prisopslag: the price meter next to how much over the cheapest. */
.card > .dg > .dg-bar { padding: 8px 12px; border-bottom: 1px solid var(--line); }
/* Prisopslag: one bar over the brand cards, for them all (its grid has no rows of its own). */
.ps-bar > .dg > .dg-bar { border-bottom: 0; }
.ps-bar-what { font-size: 13.5px; }
/* The first rows of a grid never seen: out of sight until measured, then shown at once, in place (DataGrid's settling). */
.dg-settling .dg-t tbody > tr:not(.dg-ph), .dg[data-dg-catch] .dg-t tbody > tr:not(.dg-ph) { visibility: hidden; }
.offer-meter { display: flex; align-items: center; gap: 8px; }
.offer-meter .meter-track { flex: 1; }

/* ---- The Excel builder (ExcelBuilder.razor): the file (AI bar, steps, rows, sheet tabs) and the panel beside it ---- */
.xb-top { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.xb-title { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.xb-title b { font-size: 15px; }
.xb-note { margin-bottom: 12px; border-color: var(--yellow); }
.xb { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.xb-preview { display: flex; flex-direction: column; min-width: 0; position: sticky; top: 0; overflow: visible; }
.xb-ai { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.xb-ai > svg { flex: none; color: var(--accent); }
.xb-ai input { height: 34px; }
.xb-go .xb-stop { display: none; flex: none; }
.xb-go.asking:hover .spinner { display: none; }
.xb-go.asking:hover .xb-stop { display: inline-block; }
.xb-msg { display: flex; align-items: center; gap: 6px; padding: 6px 14px; border-bottom: 1px solid var(--line); color: var(--text-2); }
.xb-msg svg { color: var(--green); }
.xb-steps { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 8px 12px; border-bottom: 1px solid var(--line); min-height: 44px; }
.xb-step { display: inline-flex; align-items: center; gap: 6px; height: 26px; max-width: 360px; padding: 0 4px 0 9px; border: 1px solid var(--line);
    border-radius: 13px; background: var(--surface-2); font-size: 12.5px; }
.xb-step.first { padding-right: 9px; background: transparent; color: var(--text-2); }
.xb-step.open { cursor: pointer; }
.xb-step.open:hover, .xb-step.on { border-color: var(--accent); }
.xb-step-info { padding: 8px 14px 10px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.xb-step-info-head { display: flex; align-items: center; gap: 6px; }
.xb-step-info dl { display: grid; grid-template-columns: max-content 1fr; gap: 3px 14px; margin: 4px 0 6px; }
.xb-step-info dt { color: var(--text-3); }
.xb-step-info dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.xb-fewer { color: var(--yellow); font-weight: 600; }
.xb-sql { margin: 6px 0 0; padding: 8px 10px; max-height: 180px; overflow: auto; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); font: 12px var(--mono); white-space: pre-wrap; }
.xb-step svg { flex: none; color: var(--text-3); }
.xb-step-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xb-step button { display: inline-flex; padding: 3px; border: 0; border-radius: 50%; background: transparent; color: var(--text-3); cursor: pointer; }
.xb-step button:hover:not(:disabled) { background: var(--gray-soft); color: var(--text); }
.xb-rows { display: flex; flex-direction: column; height: calc(100vh - 300px); min-height: 340px; }
/* The preview is the file: its headers as they are written there, not in the grids' capitals. */
.xb-rows .t th, .xb-sheet-look th { text-transform: none; letter-spacing: 0; font-size: 12.5px; }
.xb-sheet-text { display: flex; flex-direction: column; gap: 14px; padding: 14px; height: calc(100vh - 256px); min-height: 384px; overflow: auto; }
.xb-sheet-text label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--text-2); }
.xb-sheet-text textarea { resize: vertical; }
.xb-sheet-look { width: auto; min-width: 320px; }
.xb-sheet-look th, .xb-sheet-look td { padding: 4px 12px; border: 1px solid var(--line); text-align: left; }
.xb-tabs { display: flex; align-items: stretch; gap: 2px; padding: 0 8px; border-top: 1px solid var(--line); background: var(--surface-2);
    border-radius: 0 0 var(--radius) var(--radius); min-height: 36px; }
.xb-tab { display: inline-flex; align-items: center; gap: 6px; padding: 0 10px; margin-top: -1px; border: 1px solid transparent; border-top: 0;
    border-radius: 0 0 7px 7px; background: transparent; color: var(--text-2); font: inherit; font-size: 13px; cursor: pointer; user-select: none; }
.xb-tab:hover { color: var(--text); background: var(--gray-soft); }
.xb-tab.on { background: var(--surface); border-color: var(--line); color: var(--text); font-weight: 600; box-shadow: 0 2px 0 var(--accent) inset; }
.xb-tab svg { flex: none; color: var(--text-3); }
.xb-tab-x { display: inline-flex; padding: 2px; border: 0; border-radius: 4px; background: transparent; color: var(--text-3); cursor: pointer; opacity: 0; }
.xb-tab:hover .xb-tab-x, .xb-tab.on .xb-tab-x, .xb-tab-x:focus-visible { opacity: 1; }
.xb-tab-x:hover { background: var(--gray-soft); color: var(--text); }
.xb-tab-input { width: 140px; height: 24px; padding: 0 6px; font-size: 13px; }
.xb-tab-add { color: var(--text-3); height: 100%; }
.xb-add { position: relative; display: flex; }
.xb-add-pop { top: auto; bottom: calc(100% + 4px); left: 0; right: auto; width: 300px; padding: 6px; }
.xb-recipes { width: 340px; }
.xb-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.xb-form { display: flex; flex-direction: column; gap: 8px; }
.xb-form label:not(.row) { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--text-2); }
.xb-cols { max-height: 360px; overflow: auto; padding: 6px 8px; }
.xb-col { display: flex; align-items: center; gap: 6px; padding: 2px 4px; border-radius: 6px; cursor: grab; }
.xb-col:hover { background: var(--surface-2); }
.xb-col.dg-drop { box-shadow: inset 0 2px 0 var(--accent); }
.xb-head { flex: 1; min-width: 0; height: 28px; }
.xb-int { flex: none; font-size: 11px; color: var(--red); }
.xb-empty { padding: 6px 4px; }
.xb-sec { display: flex; align-items: center; gap: 6px; padding: 10px 12px 4px; border-top: 1px solid var(--line); font-size: 12px; font-weight: 600; color: var(--text-2); }
.xb-sec .faint { font-weight: 400; }
.xb-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; padding: 4px 12px 8px; }
.xb-chips-head { width: 100%; }
.xb-own { display: flex; flex-direction: column; gap: 6px; padding: 0 12px 10px; }
.xb-own-row { display: flex; justify-content: flex-end; gap: 6px; }
.xb-chip { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 9px 0 7px; border: 1px dashed var(--line-strong, var(--line));
    border-radius: 13px; background: transparent; color: var(--text-2); font: inherit; font-size: 12.5px; cursor: pointer; }
.xb-chip:hover:not(:disabled) { border-style: solid; border-color: var(--accent); color: var(--text); }
.xb-chip svg { color: var(--text-3); }
.xb-chip.int { color: var(--red); }
.xb-chip:disabled { opacity: .5; cursor: default; }
.dg-h-input { flex: 1; min-width: 0; height: 26px; padding: 0 6px; font: inherit; font-size: 12px; text-transform: none; letter-spacing: 0; }
.dg-mnote { padding: 2px 8px 6px; max-width: 240px; }
/* One column: the preview scrolls away with the page (sticky, it would lie over the columns under it). */
@media (max-width: 1100px) { .xb { grid-template-columns: 1fr; } .xb-preview { position: static; } }
/* A phone: the steps one under the other, each as wide as the card; the rows a box of their own, not the whole screen. */
@media (max-width: 760px) {
    .xb-steps { flex-direction: column; align-items: stretch; gap: 4px; }
    .xb-steps > .faint { display: none; }
    .xb-step { max-width: 100%; justify-content: flex-start; }
    .xb-step-text { flex: 1; }
    .xb-rows { height: 60vh; min-height: 280px; }
    .xb-ai { padding: 8px 10px; }
}

/* Many values in one cell (ListCell: an item's OE numbers): the first and "+N" on one line; a click shows them all. */
.lc { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-width: 0; white-space: nowrap; }
.lc-first { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.lc-more { flex: none; border: 1px solid var(--line-strong); background: var(--surface); color: var(--accent); border-radius: 999px;
    padding: 0 8px; height: 20px; font-size: 12px; font-weight: 600; cursor: pointer; }
.lc-more:hover { background: var(--accent-soft); border-color: var(--accent); }
.lc-back { position: fixed; inset: 0; z-index: 900; background: rgba(16, 24, 40, .25); display: flex; align-items: flex-start;
    justify-content: center; padding: 10vh 16px 16px; cursor: default; white-space: normal; text-align: left; }
.lc-box { width: min(640px, 100%); max-height: 75vh; display: flex; flex-direction: column; gap: 10px; padding: 14px 16px;
    box-shadow: var(--shadow-lg); font-weight: 400; }
.lc-head { display: flex; align-items: center; gap: 8px; }
.lc-find { width: 100%; }
.lc-list { overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding-right: 4px; }
.lc-name { font-weight: 600; font-size: 12.5px; margin-bottom: 4px; }
.lc-items { display: flex; flex-wrap: wrap; gap: 4px; }

/* A page coming in: its parts fade in as they arrive (the page's frame at once, its data when it's read), so going from
   page to page doesn't jump. Opacity only: a page moving while it comes made the grids' Virtualize think it was
   scrolled and the text shift. "Henter…" only shows when loading takes a while. The page's scrollbar is always there
   (empty when there's nothing to scroll), so a page short while it loads doesn't move everything sideways
   (scrollbar-gutter doesn't keep the room of our own scrollbars in Chrome). */
html { overflow-y: scroll; }
@keyframes page-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes appear { from { opacity: 0; } to { opacity: 1; } }
.content > *, .a-tool-body > * { animation: page-in .18s ease-out backwards; }
.loading { animation: appear .2s ease-out .25s backwards; }
@media (prefers-reduced-motion: reduce) { .content > *, .a-tool-body > *, .loading { animation: none; } }

/* ---- back office pages --------------------------------------------------------------------------------------
   Every page of a thing (a supplier, a list, a brand) is built the same way: crumbs, the name and its facts, the
   actions top right (Ret, Mere, one primary), one status sentence with what to do next, then tabs. Tables open the
   thing a row is about; editing is a panel from the right (pd); anything that changes prices in use asks first (pa). */

.ph { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.ph h1 { font-size: 24px; letter-spacing: -.01em; word-break: break-word; }
.ph .sub { color: var(--text-2); margin-top: 4px; font-size: 13px; }
.ph .sub > span + span::before { content: "·"; margin: 0 6px; color: var(--text-3); }
.ph-act { display: flex; gap: 8px; align-items: center; flex: none; padding-top: 2px; }
@media (max-width: 760px) { .ph { flex-wrap: wrap; } .ph-act { width: 100%; flex-wrap: wrap; } }

/* The status sentence: what the thing is now, in words, and what to do about it. */
.pstat { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-radius: var(--radius); border: 1px solid; margin-bottom: 18px; }
.pstat-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; flex: none; background: currentColor; }
.pstat-body { flex: 1; min-width: 0; color: var(--text); }
.pstat-title { font-weight: 650; }
.pstat-text { color: var(--text-2); margin-top: 2px; }
.pstat-acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.pstat.green { background: var(--green-soft); border-color: color-mix(in srgb, var(--green) 25%, transparent); color: var(--green); }
.pstat.yellow { background: var(--yellow-soft); border-color: color-mix(in srgb, var(--yellow) 25%, transparent); color: var(--yellow); }
.pstat.red { background: var(--red-soft); border-color: color-mix(in srgb, var(--red) 25%, transparent); color: var(--red); }
.pstat.blue { background: var(--blue-soft); border-color: color-mix(in srgb, var(--blue) 25%, transparent); color: var(--blue); }
.pstat.gray { background: var(--surface); border-color: var(--line); color: var(--text-3); }

/* Mere: the rarer actions, each with what it does under it. */
.pm { position: relative; display: inline-flex; }
.pm-chev { transform: rotate(90deg); color: var(--text-3); }
.pm-pop { position: absolute; top: calc(100% + 6px); right: 0; z-index: 70; width: 330px; padding: 6px; border-radius: var(--radius);
    border: 1px solid var(--line-strong); background: var(--surface); box-shadow: var(--shadow-lg); }
.pm-h { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); padding: 8px 8px 3px; font-weight: 600; }
.pm-sep { border-top: 1px solid var(--line); margin: 4px 0; }
.pm-item { display: block; width: 100%; text-align: left; padding: 7px 9px; border-radius: 6px; border: 0; background: transparent;
    color: var(--text); font: 13px var(--sans); cursor: pointer; text-decoration: none !important; }
.pm-item:hover:not(:disabled), .pm-item:focus-visible { background: var(--accent-soft); outline: none; }
.pm-item:disabled { opacity: .5; cursor: default; }
.pm-item small { display: block; color: var(--text-3); font-size: 11.5px; line-height: 1.4; margin-top: 1px; }
.pm-item.danger { color: var(--red); }

/* Ret: a panel from the right with all the thing's fields. */
.pd-shade { position: fixed; inset: 0; z-index: 80; background: rgba(16, 24, 40, .25); animation: appear .15s ease-out; }
.pd { position: fixed; z-index: 81; top: 0; right: 0; bottom: 0; width: min(460px, 100vw); background: var(--surface);
    border-left: 1px solid var(--line-strong); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: pd-in .18s ease-out; }
.pd.pd-wide { width: min(820px, 100vw); }
.pd:focus { outline: none; }
/* The dates a list's file states, in Ret: one line each, "Brug denne" at the end. */
.p-dates { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 8px; }
.p-date { display: flex; align-items: center; gap: 10px; padding: 6px 10px; font-size: 13px; font-weight: 400; min-height: 40px; }
.p-date + .p-date { border-top: 1px solid var(--line); }
/* Tabs in groups (Oprydning): a small heading before each group; they scroll sideways when narrow. */
.p-tabs { overflow-x: auto; scrollbar-width: none; }
.p-tabs a { white-space: nowrap; }
.p-tabs-h { align-self: center; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); padding: 0 4px 0 14px; white-space: nowrap; }
.p-tabs-h:first-child { padding-left: 2px; }
/* A Ret drawer's pending changes: what goes is struck through until Gem; the list of what Gem does. */
.p-gone { text-decoration: line-through; opacity: .6; }
.p-changes { margin: 0; padding-left: 18px; font-size: 13px; color: var(--text-2); }
.p-changes li + li { margin-top: 2px; }
/* A card of facts: label left, value right. */
.p-facts { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 6px 14px; margin: 0; font-size: 13px; }
.p-facts dt { color: var(--text-3); }
.p-facts dd { margin: 0; min-width: 0; }
@keyframes pd-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.pd-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.pd-head h2 { font-size: 16px; flex: 1; min-width: 0; }
.pd-body { flex: 1; overflow-y: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 16px; }
.pd-foot { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 8px; align-items: center; }
.pf { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.pf > input, .pf > select, .pf > .picker, .pf > textarea { width: 100%; }
.pf-hint { font-size: 11.5px; color: var(--text-3); font-weight: 400; }
.pf-row { display: flex; gap: 12px; }
.pf-row > * { flex: 1; min-width: 0; }
.pd-sec { border-top: 1px solid var(--line); padding-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.pd-sec h3 { font-size: 13px; }
.pk { display: flex; flex-direction: column; gap: 6px; }
.pk label { display: flex; gap: 9px; align-items: flex-start; padding: 9px 11px; border: 1px solid var(--line-strong); border-radius: 8px; cursor: pointer;
    font-size: 13px; color: var(--text); font-weight: 400; }
.pk label.on { border-color: var(--accent); background: var(--accent-soft); }
.pk label input { margin-top: 2px; }
.pk label small { display: block; color: var(--text-2); font-size: 12px; margin-top: 1px; }

/* Asks before prices in use change: what happens, and that it can be undone. */
.pa-shade { position: fixed; inset: 0; z-index: 90; background: rgba(16, 24, 40, .35); display: grid; place-items: center; padding: 16px; animation: appear .12s ease-out; }
.pa { width: min(480px, 100%); background: var(--surface); border-radius: 12px; border: 1px solid var(--line-strong); box-shadow: var(--shadow-lg); padding: 20px; }
.pa h2 { font-size: 16.5px; margin-bottom: 8px; }
.pa p { color: var(--text-2); margin: 0 0 8px; }
.pa .pa-safe { font-size: 12.5px; color: var(--text-3); }
.pa-acts { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }

/* Filters over a grid: the questions asked in daily work. */
.pseg { display: flex; gap: 4px; flex-wrap: wrap; }
.pseg button { height: 26px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2);
    font: 500 12px var(--sans); cursor: pointer; }
.pseg button.on { background: var(--accent-soft); color: var(--accent); border-color: transparent; font-weight: 600; }

/* Priser i brug: the latest files, as what they did to the prices. */
.pfeed { display: flex; flex-direction: column; }
.pfe { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line);
    align-items: start; color: inherit; text-decoration: none !important; }
.pfe:hover { background: var(--surface-2); }
.pfe:last-child { border-bottom: 0; }
.pfe-when { color: var(--text-3); font-size: 12px; padding-top: 1px; }
.pfe-what b { font-weight: 650; }
.pfe-what .s { color: var(--text-2); font-size: 12px; margin-top: 1px; overflow-wrap: anywhere; }
.p-cols { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 16px; align-items: start; }
@media (max-width: 1100px) { .p-cols { grid-template-columns: 1fr; } }
.p-step { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line);
    color: inherit; text-decoration: none !important; }
.p-step:last-child { border-bottom: 0; }
.p-step:hover .p-step-name { color: var(--accent); }
.p-step .dot { margin-top: 6px; width: 9px; height: 9px; }
.p-step-name { font-weight: 600; overflow-wrap: anywhere; }
.p-note { font-size: 12px; color: var(--text-3); margin-top: 8px; }
.p-detail { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
a.card.p-link { color: inherit; text-decoration: none !important; display: block; }
a.card.p-link:hover { border-color: var(--accent); }
.p-link .card-body { display: flex; flex-direction: column; gap: 4px; }
.p-finding { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line); }
.p-finding:last-child { border-bottom: 0; }
