/* Pastry World PMS: "Fresh Counter" design (Direction C, chosen 25 Nov 2026).
   Plain CSS, no build step. Light theme by default, dark via [data-theme="dark"]. */

:root {
    --bg: #f2f5f3;
    --card: #ffffff;
    --card-2: #fafcfb;
    --ink: #1f2a27;
    --muted: #5f6e69;
    --line: #e3e9e6;
    --line-2: #c9d4cf;
    --accent: #24776d;          /* teal, white text passes contrast */
    --accent-2: #5bb3a6;
    --accent-hover: #1c5f57;
    --on-accent: #ffffff;
    --accent-soft: #e1f2ef;
    --sun: #f2c14e;
    --sun-soft: #fdf3d8;
    --sun-ink: #6b4d0c;
    --maroon: #8a2f2b;
    --berry: #c2456b;
    --berry-soft: #fbe4ea;
    --berry-ink: #a8365a;       /* berry text on berry-soft (5.2:1) */
    --danger: #b42318;
    --danger-soft: #fdecea;
    --ok: #18744a;              /* darkened 27 Nov 2026 so green labels pass 4.5:1 */
    --ok-soft: #e3f4ea;
    --hero-from: #24776d;
    --hero-to: #1c5f57;
    --glass: rgba(242, 245, 243, 0.85);
    --glass-2: rgba(255, 255, 255, 0.92);

    --shadow-1: 0 1px 2px rgba(31, 42, 39, 0.05), 0 2px 6px rgba(31, 42, 39, 0.04);
    --shadow-2: 0 2px 4px rgba(31, 42, 39, 0.04), 0 12px 28px -6px rgba(31, 42, 39, 0.12);
    --shadow-3: 0 4px 8px rgba(31, 42, 39, 0.05), 0 28px 56px -12px rgba(31, 42, 39, 0.22);

    --font: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
    --radius: 22px;
    color-scheme: light;
}

:root[data-theme="dark"] {
    --bg: #101614;
    --card: #18211e;
    --card-2: #1d2724;
    --ink: #e8efec;
    --muted: #9aaba5;
    --line: #26322e;
    --line-2: #34433e;
    --accent: #5bb3a6;
    --accent-2: #8fd3c8;
    --accent-hover: #74c4b8;
    --on-accent: #0b1f1b;
    --accent-soft: #1b3330;
    --sun: #f2c14e;
    --sun-soft: #3a3119;
    --sun-ink: #f6d98e;
    --berry: #e7849f;
    --berry-soft: #3a2029;
    --berry-ink: #e7849f;
    --danger: #f2a097;
    --danger-soft: #3d2422;
    --ok: #7ee2a0;
    --ok-soft: #1a3325;
    --hero-from: #1f5f57;
    --hero-to: #143f3a;
    --glass: rgba(16, 22, 20, 0.85);
    --glass-2: rgba(24, 33, 30, 0.92);

    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-2: 0 2px 4px rgba(0, 0, 0, 0.25), 0 12px 28px -6px rgba(0, 0, 0, 0.45);
    --shadow-3: 0 4px 8px rgba(0, 0, 0, 0.3), 0 28px 56px -12px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.5;
}

h1, h2, h3 { line-height: 1.15; margin: 0 0 0.5rem; letter-spacing: -0.02em; text-wrap: balance; }
h1 { font-size: 1.9rem; font-weight: 800; }
h2 { font-size: 1.15rem; font-weight: 800; letter-spacing: -0.01em; }
p { margin: 0 0 1rem; }
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 1rem; top: 1rem; background: var(--card); padding: 0.5rem 1rem; z-index: 100; }

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

/* ---------- Brand ---------- */

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: -0.01em;
    color: var(--ink);
    text-decoration: none;
    white-space: nowrap;
}
.brand:hover { color: var(--ink); }
/* The real logo is a black oval with gold lettering (640 × 247), so it keeps its own shape. */
.brand__logo { display: block; flex: none; height: 40px; width: auto; }
.brand__app {
    font-size: 0.78rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--muted); padding-left: 10px; border-left: 1.5px solid var(--line-2);
}
.brand__app--full { line-height: 1.25; }
.brand__app--short { display: none; }
/* The full name only fits beside the whole menu on wide screens. */
@media (max-width: 1199px) {
    .brand:not(.brand--big) .brand__app--full { display: none; }
    .brand:not(.brand--big) .brand__app--short { display: inline; }
}
.brand--big .brand__logo { height: 58px; }
.brand--big .brand__app { font-size: 0.85rem; }

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font: inherit;
    font-weight: 700;
    border: 0;
    border-radius: 14px;
    padding: 0.7rem 1.2rem;
    min-height: 44px;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.15s cubic-bezier(.2, .8, .2, 1.4), box-shadow 0.2s, background 0.2s, color 0.2s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(1px) scale(0.98); }
.btn--primary {
    background: var(--accent);
    color: var(--on-accent);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 6px 16px rgba(36, 119, 109, 0.3);
}
.btn--primary:hover { background: var(--accent-hover); color: var(--on-accent); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 10px 22px rgba(36, 119, 109, 0.38); }
.btn--line { background: var(--card); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn--line:hover { color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line-2); }
.btn--white { background: #fff; color: #24776d; }
.btn--white:hover { color: #1c5f57; }
.btn--block { width: 100%; }
.btn--small { padding: 0.45rem 0.9rem; min-height: 38px; font-size: 0.9rem; border-radius: 12px; }

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 0;
    background: var(--card);
    color: var(--ink);
    box-shadow: var(--shadow-1);
    cursor: pointer;
    transition: transform 0.15s, background 0.2s;
}
.icon-btn:hover { background: var(--accent-soft); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-sun { display: none; }
:root[data-theme="dark"] .icon-sun { display: block; }
:root[data-theme="dark"] .icon-moon { display: none; }

/* ---------- Forms ---------- */

.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 0.35rem; }
.field .hint { color: var(--muted); font-size: 0.85rem; margin-top: 0.35rem; }
.input {
    width: 100%;
    font: inherit;
    font-size: 16px; /* stops iPhone zooming in on focus */
    color: var(--ink);
    background: var(--card-2);
    border: 1.5px solid var(--line);
    border-radius: 12px;
    padding: 0.75rem 0.9rem;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.input:focus { outline: none; border-color: var(--accent); background: var(--card); box-shadow: 0 0 0 4px var(--accent-soft); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.check { display: flex; align-items: center; gap: 0.55rem; margin: 0.25rem 0 1.25rem; font-size: 0.93rem; color: var(--muted); }
.check input { width: 1.1rem; height: 1.1rem; accent-color: var(--accent); }
.error { color: var(--danger); font-size: 0.87rem; margin-top: 0.35rem; font-weight: 500; }

/* ---------- Messages ---------- */

.alert { border-radius: 14px; padding: 0.8rem 1rem; margin-bottom: 1rem; font-size: 0.95rem; font-weight: 500; }
.alert--ok { background: var(--ok-soft); color: var(--ok); }
.alert--danger { background: var(--danger-soft); color: var(--danger); }
.alert--info { background: var(--sun-soft); color: var(--sun-ink); }

/* ---------- Sign-in page ---------- */

.auth {
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 40px;
    max-width: 1180px;
    margin: 0 auto;
    padding: 40px 28px;
}
.auth__theme { position: fixed; top: 14px; right: 14px; z-index: 20; }
.auth__title { font-size: clamp(2.1rem, 4.2vw, 3.25rem); line-height: 1.04; letter-spacing: -0.03em; margin: 28px 0 12px; }
.auth__title span {
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.auth__lead { color: var(--muted); font-size: 1.05rem; max-width: 40ch; margin: 0 0 28px; }
.auth__card { background: var(--card); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow-2); max-width: 420px; }
.auth__help { font-size: 0.85rem; color: var(--muted); text-align: center; margin: 1rem 0 0; }
.btn--microsoft { gap: 10px; min-height: 52px; font-size: 1rem; }
.btn--microsoft svg { background: #fff; border-radius: 3px; padding: 2px; box-sizing: content-box; }

/* 3D stack of documents: request, approved, purchase order */
.stage { perspective: 1200px; height: 460px; position: relative; }
.stack { position: absolute; inset: 0; transform-style: preserve-3d; transform: rotateX(52deg) rotateZ(-32deg); animation: bob 7s ease-in-out infinite; }
@keyframes bob { 50% { transform: rotateX(52deg) rotateZ(-28deg) translateZ(14px); } }
.doc {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 230px;
    height: 290px;
    margin: -145px 0 0 -115px;
    border-radius: 18px;
    background: var(--card);
    box-shadow: var(--shadow-3);
    padding: 20px;
    transition: transform 0.6s cubic-bezier(.2, .7, .2, 1);
}
.doc__tag { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: 0.08em; padding: 3px 8px; border-radius: 6px; }
.doc__line { height: 9px; border-radius: 5px; background: var(--line); margin-top: 12px; }
.doc__line--s { width: 60%; }
.doc__line--m { width: 80%; }
.doc__total { position: absolute; left: 20px; right: 20px; bottom: 20px; display: flex; justify-content: space-between; font-weight: 800; font-size: 15px; }
.doc--1 { transform: translateZ(0); }
.doc--1 .doc__tag { background: var(--sun-soft); color: var(--sun-ink); }
.doc--2 { transform: translateZ(60px) translate(26px, -26px); }
.doc--2 .doc__tag { background: var(--accent-soft); color: var(--accent); }
.doc--3 { transform: translateZ(120px) translate(52px, -52px); }
.doc--3 .doc__tag { background: var(--berry-soft); color: var(--berry-ink); }
.stage:hover .doc--2 { transform: translateZ(90px) translate(40px, -40px); }
.stage:hover .doc--3 { transform: translateZ(180px) translate(80px, -80px); }
.doc__stamp {
    position: absolute; right: 18px; top: 16px; width: 56px; height: 56px; border-radius: 50%;
    border: 3px solid var(--ok); color: var(--ok); display: grid; place-items: center;
    font-weight: 800; font-size: 11px; letter-spacing: 0.06em; transform: rotate(-14deg); opacity: 0.85;
}
.stage__shadow {
    position: absolute; left: 50%; top: 58%; width: 300px; height: 120px; margin-left: -150px;
    background: radial-gradient(rgba(31, 42, 39, 0.18), transparent 70%); filter: blur(10px);
    animation: shadowPulse 7s ease-in-out infinite;
}
:root[data-theme="dark"] .stage__shadow { background: radial-gradient(rgba(0, 0, 0, 0.5), transparent 70%); }
@keyframes shadowPulse { 50% { transform: scale(0.92); opacity: 0.8; } }

/* ---------- App header ---------- */

.top {
    position: sticky;
    top: 0;
    z-index: 30;
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.top__inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
}
.tabs {
    display: flex;
    gap: 4px;
    background: var(--card);
    padding: 4px;
    border-radius: 14px;
    box-shadow: var(--shadow-1);
    margin-left: 12px;
    margin-right: auto;
}
.tabs a {
    padding: 8px 14px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--muted);
    font-weight: 700;
    font-size: 0.9rem;
    transition: background 0.2s, color 0.2s;
}
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }

.me { display: flex; align-items: center; gap: 10px; }
.me form { margin: 0; }
.avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--sun);
    color: #5b420a;
    display: grid;
    place-items: center;
    font-weight: 800;
    flex: none;
}
.me__name { font-weight: 700; font-size: 0.9rem; line-height: 1.2; text-align: right; }
.me__name small { display: block; font-weight: 500; color: var(--muted); font-size: 0.78rem; }

/* ---------- Page ---------- */

.page { max-width: 1180px; margin: 0 auto; padding: 12px 24px 110px; }
.page__hello { margin: 0 0 14px; color: var(--muted); font-weight: 600; }
.page-head { margin: 8px 0 18px; }
.page-head p { color: var(--muted); margin: 0; }

.hero { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.tile {
    background: var(--card);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-2);
    transition: transform 0.3s cubic-bezier(.2, .8, .2, 1), box-shadow 0.3s;
    position: relative;
    overflow: hidden;
}
.tile:hover { box-shadow: var(--shadow-3); }
.tile__label { color: var(--muted); font-size: 0.88rem; font-weight: 700; }
.tile__value { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; margin-top: 4px; overflow-wrap: anywhere; }
.tile__note { margin-top: 6px; font-size: 0.85rem; color: var(--muted); }
.tile--hero { background: linear-gradient(140deg, var(--hero-from), var(--hero-to)); color: #fff; }
.tile--hero .tile__label { color: rgba(255, 255, 255, 0.85); }
.tile--hero h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin: 4px 0 6px; color: #fff; }
.tile--hero p { color: rgba(255, 255, 255, 0.88); margin: 0 0 16px; }
.tile--hero::after {
    content: "";
    position: absolute;
    right: -40px;
    top: -40px;
    width: 190px;
    height: 190px;
    border-radius: 50%;
    background: radial-gradient(rgba(242, 193, 78, 0.55), transparent 70%);
    pointer-events: none;
}
.tile__icon {
    width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center;
    font-size: 20px; margin-bottom: 12px;
}

.cols { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; }
.card { background: var(--card); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-2); }
.card h2 { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
    display: inline-block;
    border-radius: 999px;
    padding: 3px 11px;
    font-size: 0.82rem;
    font-weight: 700;
    background: var(--accent-soft);
    color: var(--accent);
}
.chip--sun { background: var(--sun-soft); color: var(--sun-ink); }
.tile--hero .chip { background: rgba(255, 255, 255, 0.18); color: #fff; }

.details { margin: 0; }
.details > div {
    display: grid;
    grid-template-columns: 8rem 1fr;
    gap: 0.5rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--line);
}
.details > div:last-child { border-bottom: 0; }
.details dt { color: var(--muted); font-size: 0.9rem; font-weight: 600; }
.details dd { margin: 0; overflow-wrap: anywhere; }

/* Coming-soon list with icons */
.roadmap { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.roadmap li { display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: center; }
.roadmap .ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 19px; }
.roadmap b { display: block; font-size: 0.95rem; }
.roadmap span { font-size: 0.85rem; color: var(--muted); }

/* Request journey tracker */
.steps { display: flex; align-items: center; margin: 6px 0 2px; }
.steps .s { display: flex; align-items: center; gap: 6px; font-size: 0.78rem; font-weight: 700; color: var(--muted); white-space: nowrap; }
.steps .dot { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; background: var(--line); color: var(--muted); flex: none; }
.steps .s.done .dot { background: var(--ok); color: #fff; }
.steps .s.now { color: var(--ink); }
.steps .s.now .dot { background: var(--sun); color: #5b420a; box-shadow: 0 0 0 4px var(--sun-soft); animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(242, 193, 78, 0.15); } }
.steps .bar { flex: 1; height: 2px; background: var(--line); margin: 0 8px; min-width: 10px; }
.steps .bar.done { background: var(--ok); }

/* ---------- Admin pages: headers, filters, tables, forms ---------- */

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.back-link { display: inline-block; font-weight: 700; font-size: 0.9rem; text-decoration: none; margin-bottom: 6px; }
.page-head--row { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head__actions { display: flex; gap: 8px; flex-wrap: wrap; }

.filters {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 12px;
    align-items: end;
    margin-bottom: 16px;
    padding: 16px 20px;
}
.filters .field { margin: 0; }
select.input { appearance: auto; }

.table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
.table th {
    text-align: left; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--muted); font-weight: 700; padding: 8px 10px; border-bottom: 1.5px solid var(--line);
}
.table td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr { transition: background 0.15s; }
.table tbody tr:hover { background: var(--card-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table__action { text-align: right; white-space: nowrap; }

.person { display: flex; align-items: center; gap: 10px; }
.person b { display: block; }
.person small { display: block; color: var(--muted); font-size: 0.82rem; overflow-wrap: anywhere; }
.avatar--sm { width: 34px; height: 34px; border-radius: 10px; font-size: 0.85rem; }

.status { display: inline-flex; align-items: center; gap: 6px; font-size: 0.78rem; font-weight: 700; border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status--ok { color: var(--ok); background: var(--ok-soft); }
.status--wait { color: var(--sun-ink); background: var(--sun-soft); }
.status--off { color: var(--muted); background: var(--line); }

.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; font-size: 0.9rem; }
.pager__buttons { display: flex; gap: 8px; }
.pager [aria-disabled="true"] { opacity: 0.45; pointer-events: none; }

.empty { text-align: center; padding: 28px 10px; }
.empty__icon { font-size: 36px; display: inline-block; animation: emptyPop 0.6s cubic-bezier(.2, .8, .2, 1.5); }
@keyframes emptyPop { from { transform: scale(0.3) rotate(-15deg); opacity: 0; } }
.empty p { color: var(--muted); margin: 6px 0 0; }

.cols--form { grid-template-columns: 1.6fr 1fr; align-items: start; }
.side-stack { display: grid; gap: 16px; }
.form-card { margin: 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-grid .field:last-child:nth-child(odd) { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; flex-wrap: wrap; }
.input--code { text-transform: uppercase; }
.input--readonly { background: var(--line); color: var(--muted); font-weight: 700; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }
textarea.input { resize: vertical; min-height: 80px; }
.form-grid .field--full { grid-column: 1 / -1; }
.per-preview {
    display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap;
    background: var(--accent-soft); border-radius: 12px; padding: 10px 14px; font-size: 0.95rem;
}
.per-preview b { font-size: 1.1rem; color: var(--accent); }
.unit-confirm { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.unit-confirm .check { margin-bottom: 0; color: var(--ink); font-weight: 600; }
.btn--danger { color: var(--danger); box-shadow: inset 0 0 0 1.5px var(--danger); background: var(--card); }
.btn--danger:hover { color: #fff; background: var(--danger); box-shadow: none; }
:root[data-theme="dark"] .btn--danger:hover { color: #1a0f0e; }
.input--code::placeholder { text-transform: none; }

.roles-pick { border: 0; padding: 0; margin: 4px 0 8px; min-width: 0; }
.roles-pick legend { font-weight: 600; font-size: 0.9rem; margin-bottom: 8px; padding: 0; }
.roles-pick__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.role-card { position: relative; display: block; cursor: pointer; }
.role-card input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.role-card__box {
    display: block; height: 100%;
    border-radius: 14px; padding: 12px 14px 12px 42px;
    background: var(--card-2); box-shadow: inset 0 0 0 1.5px var(--line);
    transition: box-shadow 0.2s, background 0.2s, transform 0.15s;
    position: relative;
}
.role-card__box::before {
    content: ""; position: absolute; left: 14px; top: 14px; width: 18px; height: 18px; border-radius: 6px;
    box-shadow: inset 0 0 0 2px var(--line-2); background: var(--card);
    transition: background 0.2s, box-shadow 0.2s;
}
.role-card__box b { display: block; font-size: 0.95rem; }
.role-card__box small { display: block; color: var(--muted); font-size: 0.8rem; line-height: 1.35; margin-top: 2px; }
.role-card:hover .role-card__box { box-shadow: inset 0 0 0 1.5px var(--line-2); }
.role-card input:checked + .role-card__box { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.role-card input:checked + .role-card__box::before {
    background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center / 12px no-repeat;
    box-shadow: none;
}
.role-card input:focus-visible + .role-card__box { outline: 3px solid var(--accent); outline-offset: 2px; }
.roles-pick[aria-invalid="true"] .role-card__box { box-shadow: inset 0 0 0 1.5px var(--danger); }

.switch-row { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.switch { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch__track {
    flex: none; width: 46px; height: 26px; border-radius: 99px; background: var(--line-2); position: relative;
    transition: background 0.2s; margin-top: 2px;
}
.switch__track::after {
    content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%;
    background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform 0.25s cubic-bezier(.2, .8, .2, 1.3);
}
.switch input:checked + .switch__track { background: var(--ok); }
.switch input:checked + .switch__track::after { transform: translateX(20px); }
.switch input:focus-visible + .switch__track { outline: 3px solid var(--accent); outline-offset: 2px; }
.switch input:disabled + .switch__track { opacity: 0.55; }
.switch input:disabled ~ span { cursor: not-allowed; }
.switch b { display: block; font-size: 0.95rem; }
.switch small { display: block; color: var(--muted); font-size: 0.83rem; }

.temp-pass {
    display: flex; gap: 14px; align-items: flex-start;
    background: var(--sun-soft); color: var(--ink);
    border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px;
    box-shadow: inset 0 0 0 1.5px var(--sun);
    animation: popIn 0.5s cubic-bezier(.2, .8, .2, 1.15) both;
}
.temp-pass__icon { font-size: 26px; line-height: 1; }
.temp-pass p { margin: 4px 0 10px; font-size: 0.92rem; }
.temp-pass__row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.temp-pass code {
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 1.15rem; font-weight: 700;
    letter-spacing: 0.06em; background: var(--card); padding: 6px 12px; border-radius: 10px; user-select: all;
}

/* ---------- Catalog ---------- */

.num { text-align: right; font-variant-numeric: tabular-nums; }
th.num { text-align: right; }
.small { font-size: 0.8rem; }
.strong-link { font-weight: 700; color: var(--ink); text-decoration: none; }
.strong-link:hover { color: var(--accent); text-decoration: underline; }
.h2-sub { font-size: 0.85rem; font-weight: 600; letter-spacing: 0; }
.chip--quiet { background: var(--card-2); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); text-decoration: none; }
a.chip--quiet:hover { color: var(--ink); }

.me__link { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); border-radius: 14px; padding: 2px; }
.me__link:hover { color: var(--ink); }
.me__link:hover .avatar { transform: rotate(-6deg) scale(1.05); }
.avatar { transition: transform 0.2s cubic-bezier(.2, .8, .2, 1.4); }
.avatar--teal { background: var(--accent-soft); color: var(--accent); }

.group-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.group-chips a {
    padding: 7px 14px; border-radius: 999px; font-weight: 700; font-size: 0.88rem; text-decoration: none;
    background: var(--card); color: var(--muted); box-shadow: var(--shadow-1); transition: background 0.2s, color 0.2s, transform 0.15s;
}
.group-chips a:hover { color: var(--ink); transform: translateY(-1px); }
.group-chips a[aria-current="true"] { background: var(--accent); color: var(--on-accent); }

.filters--catalog { grid-template-columns: 2fr 1.4fr auto auto; }
.filters__check { margin: 0 0 10px; white-space: nowrap; }

.item-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.item-card {
    display: flex; flex-direction: column; height: 100%; gap: 4px;
    background: var(--card); border-radius: 18px; padding: 16px; box-shadow: var(--shadow-2);
    color: var(--ink); text-decoration: none;
    transition: transform 0.25s cubic-bezier(.2, .8, .2, 1), box-shadow 0.25s;
}
.item-card:hover { color: var(--ink); transform: translateY(-4px); box-shadow: var(--shadow-3); }
.item-card:focus-visible { outline-offset: 3px; }
.item-card__top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.item-card { overflow: hidden; }
.item-card__media {
    display: block; margin: -16px -16px 10px; height: 150px; background: var(--card-2);
    border-bottom: 1px solid var(--line); overflow: hidden;
}
.item-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.4s cubic-bezier(.2, .8, .2, 1); }
.item-card:hover .item-card__media img { transform: scale(1.05); }
.item-card__placeholder { display: grid; place-items: center; height: 100%; font-size: 40px; opacity: 0.35; filter: grayscale(0.3); }

/* Item page photo tile */
.hero.hero--with-photo { grid-template-columns: 1fr 1.4fr 0.8fr 1fr; align-items: start; }
.photo-tile { display: flex; flex-direction: column; gap: 8px; padding: 12px; }
.photo-tile__img, .photo-tile__empty, .photo-tile__preview {
    display: block; width: 100%; aspect-ratio: 4 / 3; border-radius: 14px; overflow: hidden; background: var(--card-2);
}
.photo-tile__img img, .photo-tile__preview { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-tile__empty { display: grid; place-items: center; align-content: center; gap: 4px; color: var(--muted); box-shadow: inset 0 0 0 2px var(--line); border-radius: 14px; }
.photo-tile__empty span { font-size: 34px; opacity: 0.6; }
.photo-tile__form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0; }
.photo-tile__pick { cursor: pointer; }
.photo-tile__pick:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
.photo-tile__remove { margin: 0; font-size: 0.85rem; }
.item-card__top .chip { max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-card__code { font-size: 0.75rem; font-weight: 800; letter-spacing: 0.04em; color: var(--muted); font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }
.item-card__name { font-weight: 800; font-size: 1rem; line-height: 1.25; margin-top: 6px; }
.item-card__pack { color: var(--muted); font-size: 0.85rem; min-height: 1.3em; }
.item-card__foot { margin-top: auto; padding-top: 10px; display: flex; justify-content: space-between; align-items: end; gap: 8px; border-top: 1px dashed var(--line); }
.item-card__price { font-weight: 800; font-size: 1.05rem; }
.item-card__price small { font-weight: 600; color: var(--muted); font-size: 0.8rem; }
.item-card__meta { font-size: 0.8rem; color: var(--muted); font-weight: 600; text-align: right; }
.badge-best {
    display: inline-flex; align-items: center; gap: 4px; font-size: 0.75rem; font-weight: 800;
    border-radius: 999px; padding: 2px 9px; background: var(--ok-soft); color: var(--ok);
}
.badge-best::before { content: "★"; font-size: 0.7rem; }

.item-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.hero--item { grid-template-columns: 1.4fr 1fr 1fr; }
.tile__hero-value { font-size: clamp(1.9rem, 4vw, 2.6rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; margin: 6px 0 6px; color: #fff; }
.tile__hero-value small { font-size: 1rem; font-weight: 600; opacity: 0.85; }
.tile__hero-value--none { font-size: 1.4rem; }
.tile--wide { grid-column: span 2; }
.details--tight > div { padding: 0.4rem 0; grid-template-columns: 7rem 1fr; }
.row--best td { background: color-mix(in srgb, var(--ok-soft) 55%, transparent); }
.premium { font-size: 0.78rem; color: var(--muted); font-weight: 600; }
.unit-check {
    display: inline-block; margin-top: 4px; font-size: 0.75rem; font-weight: 700; text-align: left;
    color: var(--sun-ink); background: var(--sun-soft); border-radius: 8px; padding: 3px 8px; max-width: 240px;
}
.item-desc { margin-top: 14px; color: var(--muted); }

.table--compact td, .table--compact th { padding: 7px 8px; font-size: 0.87rem; }
.table-view { margin-top: 14px; }
.table-view summary { cursor: pointer; font-weight: 700; font-size: 0.9rem; color: var(--accent); padding: 6px 0; }
.table-view[open] summary { margin-bottom: 8px; }

.person--big .avatar { width: 52px; height: 52px; font-size: 1.3rem; border-radius: 16px; }
.person--big b { font-size: 1.15rem; }
.side-actions > div { display: grid; gap: 10px; }
.side-actions form { margin: 0; }

/* ---------- Sourcing ---------- */

.delta { display: inline-flex; align-items: center; gap: 4px; font-size: 0.8rem; font-weight: 800; border-radius: 999px; padding: 2px 9px; background: var(--line); color: var(--muted); white-space: nowrap; }
.delta--good { background: var(--ok-soft); color: var(--ok); }
.delta--bad { background: var(--danger-soft); color: var(--danger); }
.text-good { color: var(--ok); }
.text-bad { color: var(--danger); }
.tile__compare { margin: 6px 0 4px; }
.saving-banner {
    display: flex; gap: 12px; align-items: center; margin-bottom: 16px; padding: 14px 18px; border-radius: 18px;
    background: var(--ok-soft); color: var(--ink); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--ok) 40%, transparent);
}
.saving-banner span:first-child { font-size: 1.5rem; }
.choice-row { border: 0; padding: 0; margin: 4px 0 16px; display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.choice-row legend { font-weight: 600; font-size: 0.9rem; margin-bottom: 8px; padding: 0; width: 100%; }
.choice {
    display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; cursor: pointer;
    background: var(--card-2); box-shadow: inset 0 0 0 1.5px var(--line); font-weight: 600; font-size: 0.9rem;
    transition: box-shadow 0.15s, background 0.15s;
}
.choice input { accent-color: var(--accent); }
.choice:has(input:checked) { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); color: var(--accent); }
.choice:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.decision-form { display: grid; gap: 4px; margin-bottom: 18px; }
.decision-form--decline { padding-top: 16px; border-top: 1px solid var(--line); margin-bottom: 0; }
.proof-img { display: block; max-width: 420px; border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-1); }
.proof-img img { display: block; width: 100%; height: auto; }
.offers-card h2 { align-items: center; }

/* Compare suppliers: one card per option, cheapest first. */
.option-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; margin-bottom: 18px; }
.option-card {
    position: relative; display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: var(--radius);
    background: var(--card); box-shadow: var(--shadow-1); transition: transform 0.2s, box-shadow 0.2s;
}
.option-card--best { box-shadow: var(--shadow-1), inset 0 0 0 2px var(--ok); }
.option-card--main { background: linear-gradient(180deg, var(--accent-soft), var(--card) 55%); }
.option-card--off { opacity: 0.85; }
.option-card__tags { display: flex; flex-wrap: wrap; gap: 6px; min-height: 24px; }
.option-card__name { margin: 4px 0 0; font-size: 1.02rem; line-height: 1.3; }
.option-card__name a { color: inherit; text-decoration: none; }
.option-card__name a:hover { text-decoration: underline; }
.option-card__price { font-size: 1.7rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; margin-top: 4px; }
.option-card__price small { font-size: 0.9rem; font-weight: 600; color: var(--muted); }
.option-card__compare { display: grid; gap: 4px; justify-items: start; min-height: 24px; margin: 2px 0; }
.option-card__facts { margin: 4px 0 0; display: grid; gap: 3px; font-size: 0.84rem; }
.option-card__facts > div { display: grid; grid-template-columns: 88px 1fr; gap: 8px; }
.option-card__facts dt { color: var(--muted); }
.option-card__facts dd { margin: 0; }
.option-card__actions { margin-top: auto; padding-top: 10px; display: grid; gap: 8px; }
.option-card__actions form { margin: 0; }
.option-card__chosen { text-align: center; font-weight: 800; color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 9px 12px; }
.option-card__links { text-align: center; font-size: 0.85rem; }
.chip--best { background: var(--ok-soft); color: var(--ok); }
.chip--main { background: var(--accent); color: #fff; }
.add-option { max-width: 820px; scroll-margin-top: 90px; }
.option-card:target { animation: option-flash 1.6s ease-out; }
@keyframes option-flash { from { box-shadow: 0 0 0 4px var(--sun); } }
@media (prefers-reduced-motion: reduce) { .option-card:target { animation: none; box-shadow: 0 0 0 3px var(--sun); } }
.option-cell { display: grid; gap: 2px; }
.btn-row { display: inline-flex; flex-wrap: wrap; gap: 8px; }
.tile__value--text { font-size: 1.15rem; line-height: 1.3; }
.link-card { margin-bottom: 18px; max-width: 820px; }
.link-card > div { display: grid; gap: 12px; }
.link-card h2 { margin-bottom: 4px; }
.link-card p { margin: 0; font-size: 0.9rem; }
.link-card__form { display: flex; gap: 10px; align-items: flex-end; margin: 0; }
.link-card__form .field { flex: 1; margin: 0; }
@media (max-width: 560px) {
    .link-card__form { flex-direction: column; align-items: stretch; }
}
.row-link { cursor: pointer; }

/* ---------- Data source notes ---------- */

.source-note { font-size: 0.82rem; color: var(--muted); margin: -6px 0 12px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.source-badge {
    display: inline-block; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase;
    border-radius: 6px; padding: 1px 7px; background: var(--line); color: var(--muted);
}
.source-badge--bc { background: var(--accent-soft); color: var(--accent); }

/* ---------- BC differences ---------- */

.sync-info { display: flex; align-items: center; gap: 12px; padding: 14px 18px; margin-bottom: 8px; }
.sync-info > div { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.section-heading { margin: 22px 0 10px; font-size: 1.25rem; }
.diff-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 12px; }
.diff-tile {
    display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: 16px;
    background: var(--sun-soft); color: var(--ink); text-decoration: none; box-shadow: var(--shadow-1);
    transition: transform 0.15s, box-shadow 0.2s;
}
.diff-tile:hover { color: var(--ink); transform: translateY(-2px); box-shadow: var(--shadow-2); }
.diff-tile__n { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em; }
.diff-tile__t { font-size: 0.85rem; font-weight: 700; color: var(--muted); }
.diff-tile--ok { background: var(--ok-soft); }
.diff-tile--ok .diff-tile__n::after { content: " ✓"; font-size: 1rem; color: var(--ok); }
.diff-section { margin-bottom: 12px; }
.diff-section summary { cursor: pointer; display: flex; align-items: center; gap: 8px; list-style-position: inside; }
.diff-section[open] summary { margin-bottom: 4px; }
.btn:disabled { opacity: 0.7; cursor: progress; transform: none; }
.new-in-bc { margin: 12px 0 4px; box-shadow: var(--shadow-2), inset 0 0 0 2px var(--accent-soft); }
.new-in-bc h2 { justify-content: flex-start; }
.new-in-bc__actions { display: flex; gap: 6px; justify-content: flex-end; align-items: center; }
.new-in-bc__actions form { margin: 0; }
.link-button { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: var(--accent); cursor: pointer; text-decoration: underline; }
.prefill-note { display: flex; gap: 10px; align-items: flex-start; }

/* ---------- Charts (dataviz method: thin marks, recessive axes, fixed series order) ---------- */

.viz {
    margin: 0;
    --viz-grid: #e7ece9;
    --viz-axis: #c9d4cf;
    --viz-muted: #6c7a75;
    --viz-surface: var(--card);
    /* categorical slots 1-4, validated against #ffffff (light) and #18211e (dark) */
    --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100;
}
:root[data-theme="dark"] .viz {
    --viz-grid: #24302c;
    --viz-axis: #34433e;
    --viz-muted: #8d9c97;
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500;
}
.viz-s1 { --c: var(--s1); } .viz-s2 { --c: var(--s2); } .viz-s3 { --c: var(--s3); } .viz-s4 { --c: var(--s4); }

.viz-legend { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 0.85rem; color: var(--ink); }
.viz-legend li { display: flex; align-items: center; gap: 6px; }
.viz-key { display: inline-block; width: 14px; height: 4px; border-radius: 2px; background: var(--c); flex: none; }

.viz-frame { position: relative; }
.viz svg { display: block; width: 100%; height: auto; overflow: visible; }
.viz svg:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; border-radius: 8px; }
.viz-grid { stroke: var(--viz-grid); stroke-width: 1; shape-rendering: crispEdges; }
.viz-axis { stroke: var(--viz-axis); stroke-width: 1; shape-rendering: crispEdges; }
.viz-tick { fill: var(--viz-muted); font-size: 11px; font-variant-numeric: tabular-nums; font-family: var(--font); }
.viz-end { fill: var(--ink); font-size: 12px; font-weight: 700; font-family: var(--font); }
.viz-line { fill: none; stroke: var(--c); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.viz-dot { fill: var(--c); stroke: var(--viz-surface); stroke-width: 2; }
.viz-cross { stroke: var(--viz-axis); stroke-width: 1; }
.viz-hit { fill: transparent; cursor: crosshair; }
.viz-line { stroke-dasharray: 2000; stroke-dashoffset: 2000; animation: vizDraw 1.4s 0.2s cubic-bezier(.3, .7, .2, 1) forwards; }
@keyframes vizDraw { to { stroke-dashoffset: 0; } }

.viz-tip {
    position: absolute; top: 4px; z-index: 5; min-width: 170px; max-width: 260px;
    background: var(--card); color: var(--ink); border-radius: 12px; padding: 10px 12px;
    box-shadow: var(--shadow-3); font-size: 0.82rem; pointer-events: none;
}
.viz-tip b { display: block; margin-bottom: 4px; }
.viz-tip__row { display: flex; align-items: center; gap: 6px; padding: 2px 0; }
.viz-tip__name { flex: 1; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viz-tip__val { font-weight: 700; font-variant-numeric: tabular-nums; }

/* One-series column chart (spend by month): 24px max bars, 4px rounded tops, value on the cap. */
.cols-chart { display: flex; align-items: end; gap: 10px; height: 190px; padding: 8px 4px 0; border-bottom: 1px solid var(--viz-axis, var(--line-2)); }
.cols-chart__col { flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: end; gap: 4px; position: relative; outline: none; }
.cols-chart__bar {
    width: 100%; max-width: 24px; height: var(--h); min-height: 2px; border-radius: 4px 4px 0 0; background: var(--accent);
    transform-origin: bottom; animation: growUp 0.8s cubic-bezier(.2, .8, .2, 1) both; transition: filter 0.15s;
}
.cols-chart__col:nth-child(2) .cols-chart__bar { animation-delay: 0.04s; } .cols-chart__col:nth-child(3) .cols-chart__bar { animation-delay: 0.08s; }
.cols-chart__col:nth-child(4) .cols-chart__bar { animation-delay: 0.12s; } .cols-chart__col:nth-child(5) .cols-chart__bar { animation-delay: 0.16s; }
.cols-chart__col:nth-child(6) .cols-chart__bar { animation-delay: 0.2s; } .cols-chart__col:nth-child(n+7) .cols-chart__bar { animation-delay: 0.24s; }
@keyframes growUp { from { transform: scaleY(0); } }
.cols-chart__col:hover .cols-chart__bar, .cols-chart__col:focus-visible .cols-chart__bar { filter: brightness(1.15); }
.cols-chart__val { font-size: 0.7rem; font-weight: 700; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.cols-chart__label { position: absolute; bottom: -22px; font-size: 0.75rem; color: var(--muted); }
.cols-chart + .table-view { margin-top: 30px; }

/* ---------- Phone bottom bar ---------- */

.bottom-nav { display: none; }

/* ---------- Entrance animation ---------- */

.pop-in > * { animation: popIn 0.6s cubic-bezier(.2, .8, .2, 1.15) both; }
.pop-in > *:nth-child(2) { animation-delay: 0.07s; }
.pop-in > *:nth-child(3) { animation-delay: 0.14s; }
.pop-in > *:nth-child(4) { animation-delay: 0.21s; }
@keyframes popIn { from { opacity: 0; transform: translateY(18px) scale(0.98); } }

/* ---------- Small screens ---------- */

@media (max-width: 900px) {
    .auth { grid-template-columns: 1fr; gap: 0; padding: 56px 16px 32px; align-content: start; }
    .stage { height: 240px; order: -1; transform: scale(0.62); margin: 0 0 -24px; }
    .auth__title { margin-top: 18px; }
    .auth__card { max-width: none; }

    .tabs { display: none; }
    .top__inner { padding: 12px 16px; justify-content: space-between; }
    .me__name, .me .btn, .me form { display: none; }
    .page { padding: 8px 16px 120px; }
    .hero { grid-template-columns: 1fr 1fr; }
    .hero .tile--hero { grid-column: 1 / -1; }
    .cols { grid-template-columns: 1fr; }
    .details > div { grid-template-columns: 1fr; gap: 0.1rem; }
    .steps .s span { display: none; }
    .steps .s.now span { display: inline; }

    .filters, .filters--catalog { grid-template-columns: 1fr 1fr; }
    .filters__check { grid-column: 1 / -1; white-space: normal; }
    .hero--item { grid-template-columns: 1fr 1fr; }
    .hero.hero--with-photo { grid-template-columns: 1fr 1fr; }
    .hero--with-photo .photo-tile, .hero--with-photo .tile--hero { grid-column: 1 / -1; }
    .item-card__media { height: 170px; }
    .tile--wide { grid-column: 1 / -1; }
    .item-grid { grid-template-columns: 1fr; gap: 10px; }
    /* Keep chart text readable on phones: the chart keeps a minimum width and scrolls sideways. */
    .viz-frame { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -4px; padding: 0 4px 6px; }
    .viz svg { min-width: 560px; }
    .cols-chart { gap: 4px; }
    .cols-chart__val { font-size: 0.6rem; }
    .me__link .me__name { display: none; }
    .filters .field:first-child, .filters__go { grid-column: 1 / -1; }
    .filters__go .btn { width: 100%; }
    .form-grid, .roles-pick__grid { grid-template-columns: 1fr; }
    .form-actions .btn { flex: 1; }

    /* Tables turn into stacked cards on phones. */
    .table thead { display: none; }
    .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
    .table tr { padding: 12px 0; border-bottom: 1px solid var(--line); }
    .table tbody tr:last-child { border-bottom: 0; }
    .table tbody tr:hover { background: none; }
    .table td { border: 0; padding: 4px 0; display: grid; grid-template-columns: 7.5rem 1fr; gap: 8px; align-items: center; }
    .table td::before { content: attr(data-label); color: var(--muted); font-size: 0.8rem; font-weight: 700; }
    .table td[data-label="Name"] { grid-template-columns: 1fr; }
    .table td[data-label="Name"]::before { display: none; }
    .table__action { text-align: left; padding-top: 8px !important; }
    .table__action .btn { width: 100%; }
    .new-in-bc__actions { flex-direction: column; align-items: stretch; }

    .bottom-nav {
        display: flex;
        position: fixed;
        left: 12px;
        right: 12px;
        bottom: max(12px, env(safe-area-inset-bottom));
        z-index: 40;
        background: var(--glass-2);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
        border-radius: 22px;
        box-shadow: var(--shadow-3);
        padding: 8px;
        gap: 4px;
    }
    .bottom-nav form { flex: 1; display: flex; margin: 0; }
    .bottom-nav a, .bottom-nav button {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        padding: 6px 0;
        border: 0;
        background: none;
        border-radius: 14px;
        font: inherit;
        font-size: 11px;
        font-weight: 700;
        color: var(--muted);
        text-decoration: none;
        cursor: pointer;
    }
    .bottom-nav [aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
    .bottom-nav svg { width: 22px; height: 22px; }
}

@media (max-width: 420px) {
    .hero { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
    .viz-line { stroke-dasharray: none; stroke-dashoffset: 0; }
}

/* Item page: specifications always listed, blanks shown softly */
.specs-row { margin-bottom: 16px; align-items: start; }
.specs__empty { color: var(--muted); font-style: italic; font-size: 0.9rem; }

/* Easier to read and tap (UI/UX review, 27 Nov 2026). Targets: at least 24px everywhere, 44px on phones. */
.input--readonly { color: var(--ink); }
.icon-btn { width: 44px; height: 44px; }
.tabs a { display: inline-flex; align-items: center; min-height: 44px; }
.back-link { display: inline-flex; align-items: center; min-height: 32px; }
.check { min-height: 44px; }
.check input { width: 1.3rem; height: 1.3rem; flex: none; }
@media (max-width: 900px) {
    .back-link { min-height: 44px; }
    .group-chips a { display: inline-flex; align-items: center; min-height: 44px; }
    .table td .strong-link { display: inline-flex; align-items: center; min-height: 44px; }
    .btn--small { min-height: 44px; }
}

/* Sourcing requests (27 Nov 2026) */
.filters--requests { grid-template-columns: 2fr 1fr 1fr 1fr auto; }
.form-section { font-size: 1rem; margin: 22px 0 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.form-section:first-of-type { margin-top: 0; padding-top: 0; border-top: 0; }
.locked-item { margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 0.35rem; }
.inline-pair { display: grid; grid-template-columns: 1fr 9rem; gap: 8px; }
.stack-form { display: grid; gap: 12px; }
.stack-form .choice-row { margin: 0; }
.stack-form .btn { justify-self: start; }
.small-heading { font-size: 0.9rem; margin: 20px 0 6px; color: var(--muted); }
.plain-list { margin: 0; padding-left: 18px; }
.plain-list li { margin-bottom: 4px; }
.request-banner { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; background: var(--accent-soft); border-radius: 14px; padding: 12px 14px; margin-bottom: 16px; }
@media (max-width: 900px) {
    .filters--requests { grid-template-columns: 1fr 1fr; }
    .filters--requests .field:first-of-type, .filters--requests .filters__go { grid-column: 1 / -1; }
    .inline-pair { grid-template-columns: 1fr 7rem; }
}
.count-pill { display: inline-block; margin-left: 6px; padding: 0 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 0.78rem; font-weight: 800; }

/* Offer product details and files (sourcing step 2, 27 Nov 2026) */
.option-card__brand { margin-top: 6px; }
.file-row { display: grid; grid-template-columns: 1fr 1.4fr; gap: 12px; }
.file-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; }
.file-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.check--inline { margin: 0; min-height: 0; }
.file-cards { list-style: none; margin: 0 0 14px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.file-card { display: grid; gap: 6px; justify-items: start; }
.file-card__open { display: grid; gap: 6px; text-decoration: none; color: var(--ink); width: 100%; }
.file-card__open img, .file-card__pdf { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 12px; box-shadow: var(--shadow-1); background: var(--card-2); }
.file-card__pdf { display: grid; place-items: center; font-weight: 800; color: var(--maroon); }
.file-card__name { font-size: 0.82rem; font-weight: 600; overflow-wrap: anywhere; }
.add-file { display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 10px; align-items: end; }
.add-file .field { margin: 0; }
@media (max-width: 560px) {
    .file-row, .add-file { grid-template-columns: 1fr; }
}

/* Samples and test results (sourcing step 3, 27 Nov 2026) */
.sample-steps { list-style: none; padding: 0; margin: 0 0 16px; gap: 18px; flex-wrap: wrap; }
.sample-steps .s span { display: inline !important; }
.sample-steps small { display: block; font-weight: 600; }
.sample-dates { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; }
.sample-dates .field { margin: 0; }
.test-list { display: grid; gap: 12px; }
.test-card { border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; background: var(--card-2); }
.test-card__head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; align-items: center; margin-bottom: 8px; }
.test-card__notes { margin: 8px 0 0; }
.test-card__foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 10px; }
.score-list { margin: 0; display: grid; gap: 4px; }
.score-list > div { display: grid; grid-template-columns: 11rem 1fr; gap: 10px; align-items: center; }
.score-list dt { color: var(--muted); font-size: 0.88rem; font-weight: 600; }
.score-list dd { margin: 0; display: flex; align-items: center; gap: 8px; }
.score-list__avg { border-top: 1px solid var(--line); padding-top: 6px; margin-top: 2px; }
.score-bar { width: 90px; height: 8px; border-radius: 99px; background: var(--line); position: relative; overflow: hidden; flex: none; }
.score-bar::after { content: ""; position: absolute; inset: 0 auto 0 0; width: calc(var(--score) * 20%); background: var(--accent); border-radius: inherit; }
.add-test { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.add-test > summary { cursor: pointer; font-weight: 700; color: var(--accent); min-height: 44px; display: flex; align-items: center; }
.add-test form { margin-top: 8px; }
.score-help { margin: 4px 0 8px; }
.score-row { border: 0; padding: 0; margin: 0 0 10px; min-width: 0; }
.score-row legend { font-weight: 600; font-size: 0.9rem; margin-bottom: 6px; padding: 0; }
.score-choices { display: flex; flex-wrap: wrap; gap: 6px; }
.score-choice { position: relative; }
.score-choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.score-choice span { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0 12px; border-radius: 12px; background: var(--card); box-shadow: inset 0 0 0 1.5px var(--line-2); font-weight: 700; }
.score-choice input:checked + span { background: var(--accent); color: var(--on-accent); box-shadow: none; }
.score-choice input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.score-choice--skip span { font-weight: 600; color: var(--muted); }
.option-card__sample { margin-top: 6px; }
.option-card__warn { margin: 0 0 8px; font-size: 0.82rem; font-weight: 600; color: var(--sun-ink); background: var(--sun-soft); border-radius: 10px; padding: 6px 10px; }
@media (max-width: 560px) {
    .sample-dates { grid-template-columns: 1fr; }
    .score-list > div { grid-template-columns: 1fr; gap: 2px; }
}

/* Brands side by side (sourcing step 4, 27 Nov 2026) */
.matrix-card { margin-bottom: 16px; }
.matrix-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 14px; }
.matrix-wrap:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.matrix { border-collapse: separate; border-spacing: 0; min-width: 100%; font-size: 0.9rem; }
.matrix th, .matrix td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; min-width: 170px; max-width: 240px; }
.matrix thead th { vertical-align: bottom; border-bottom: 2px solid var(--line-2); }
.matrix tbody th, .matrix .matrix__label { position: sticky; left: 0; z-index: 1; background: var(--card); min-width: 128px; max-width: 150px; color: var(--muted); font-size: 0.82rem; font-weight: 700; }
.matrix__col--best { background: color-mix(in srgb, var(--ok-soft) 70%, transparent); border-radius: 12px 12px 0 0; }
.matrix__badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.matrix__key td { font-size: 0.95rem; }
.matrix__section th, .matrix__section td { border-top: 2px solid var(--line-2); }
.matrix__actions td { border-bottom: 0; }
.matrix__actions .option-card__warn { font-size: 0.75rem; }
.matrix .score-bar { width: 60px; vertical-align: middle; }
.filters--sourcing { grid-template-columns: 1.6fr repeat(4, 1fr) auto; }
@media (max-width: 1100px) { .filters--sourcing { grid-template-columns: 1fr 1fr 1fr; } .filters--sourcing .field:first-of-type { grid-column: 1 / -1; } }
@media (max-width: 900px) { .filters--sourcing { grid-template-columns: 1fr 1fr; } .filters--sourcing .filters__go { grid-column: 1 / -1; } }

/* Compare items (catalog): price up = dearer (red), down = cheaper (green) */
.up { color: var(--danger); font-weight: 700; }
.down { color: var(--ok); font-weight: 700; }
.compare-add__form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.compare-add__form .field { flex: 1 1 320px; margin-bottom: 0; }
.compare-suggest { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 14px; }
.compare-suggest__chip { text-decoration: none; min-height: 32px; display: inline-flex; align-items: center; }
.compare-suggest__chip:hover { background: var(--accent-soft); color: var(--ink); }
.compare-thumb { display: block; width: 64px; height: 64px; border-radius: 12px; overflow: hidden; background: var(--card-2); margin-bottom: 8px; }
.compare-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.compare-thumb span { display: grid; place-items: center; height: 100%; font-size: 26px; opacity: 0.45; }
.compare-name { display: block; line-height: 1.25; margin-top: 2px; }
.compare-remove { display: inline-flex; align-items: center; min-height: 32px; margin-top: 6px; font-size: 0.8rem; font-weight: 700; color: var(--muted); text-decoration: none; }
.compare-remove:hover { color: var(--danger); }
.compare-supplier { display: flex; flex-direction: column; padding: 3px 0; }
.compare-supplier + .compare-supplier { border-top: 1px dashed var(--line); }
.matrix--items .matrix__actions .btn { margin: 0 4px 4px 0; }
.matrix--items thead th { vertical-align: top; }
.compare-foot { margin: 12px 0 0; }

/* Catalog list: "Compare" tick on each card, and the bar that appears once items are ticked */
.item-grid > li { position: relative; }
.compare-tick {
    position: absolute; top: 10px; right: 10px; z-index: 2;
    display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 4px 10px 4px 8px;
    background: var(--glass-2, var(--card)); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    border-radius: 999px; box-shadow: var(--shadow-1, 0 1px 3px rgba(0,0,0,.12));
    font-size: 0.8rem; font-weight: 700; color: var(--ink); cursor: pointer;
}
.compare-tick input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.compare-tick:has(input:checked) { background: var(--accent); color: #fff; }
.compare-tick:has(input:disabled) { opacity: 0.55; cursor: not-allowed; }
.compare-tick:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
.compare-bar {
    position: fixed; left: 50%; transform: translateX(-50%); bottom: 18px; z-index: 45;
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: center;
    width: min(560px, calc(100% - 32px)); padding: 10px 12px 10px 18px;
    background: var(--card); border-radius: 18px; box-shadow: var(--shadow-3);
}
.compare-bar[hidden] { display: none; }
.compare-bar__text { flex: 1; font-weight: 700; }
.compare-bar__text small { display: block; font-weight: 500; color: var(--muted); }
.has-compare-bar { padding-bottom: 96px; }
@media (max-width: 900px) {
    .compare-bar { bottom: calc(max(12px, env(safe-area-inset-bottom)) + 84px); }
    .has-compare-bar { padding-bottom: 180px; }
    .compare-thumb { width: 52px; height: 52px; }
}

/* "Type, then pick from the list" dropdown (public/js/app.js) */
.suggest { position: relative; display: block; }
.suggest__list {
    position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 60;
    margin: 0; padding: 6px; list-style: none; max-height: min(360px, 55vh); overflow-y: auto;
    background: var(--card); border-radius: 14px; box-shadow: var(--shadow-3); border: 1px solid var(--line);
}
.suggest__list[hidden] { display: none; }
.suggest__option {
    display: flex; align-items: baseline; gap: 10px; min-height: 44px; padding: 10px 12px;
    border-radius: 10px; cursor: pointer; line-height: 1.3; font-size: 0.92rem;
}
.suggest__option:hover, .suggest__option[aria-selected="true"] { background: var(--accent-soft); }
.suggest__code { flex: none; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 0.78rem; font-weight: 700; color: var(--muted); }
.suggest__none { padding: 10px 12px; color: var(--muted); font-size: 0.85rem; }
/* The box holding an open dropdown sits in front of the boxes after it. */
.card:has(.suggest__list:not([hidden])), .pop-in:has(.suggest__list:not([hidden])), form:has(.suggest__list:not([hidden])) { position: relative; z-index: 30; }
