/* Better Eating: macOS-style look (sidebar + content panel). Replaces Pico.css. */

/* ---------- Tokens ---------- */
:root {
    --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", system-ui, sans-serif;
    --mono: ui-monospace, "SF Mono", Menlo, monospace;

    --backdrop: #e4e5e9;
    --sidebar: #f6f6f7;
    --panel: #ffffff;
    --surface: #f7f7f8;          /* table heads, inputs, subtle fills */
    --hover: #f2f2f4;
    --selected: #e9e9ec;
    --border: #e7e7ea;
    --border-strong: #d6d6db;
    --text: #1d1d1f;
    --text-2: #5f6168;
    --text-3: #8e9097;

    --accent: #1f8f4e;           /* fresh green */
    --accent-hover: #187a41;
    --accent-soft: #e5f4ea;
    --good: #1f8f4e;
    --warn: #d1372e;
    --warn-soft: #fdecea;
    --sale: #e5484d;
    --coupon: #8e4ec6;
    --coupon-soft: #f3ecfa;
    --orange: #e8790c;

    --radius: 10px;
    --radius-lg: 18px;
    --shadow-btn: 0 1px 2px rgba(0, 0, 0, .06), 0 0 0 .5px rgba(0, 0, 0, .04);
    --shadow-card: 0 1px 3px rgba(0, 0, 0, .04);
    --shadow-panel: 0 0 0 1px rgba(0, 0, 0, .04), 0 8px 30px rgba(0, 0, 0, .06);
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --backdrop: #101012;
        --sidebar: #1b1b1e;
        --panel: #222225;
        --surface: #2a2a2e;
        --hover: #2c2c30;
        --selected: #34343a;
        --border: #333338;
        --border-strong: #44444a;
        --text: #f2f2f4;
        --text-2: #a9abb2;
        --text-3: #7d7f86;
        --accent: #34c26f;
        --accent-hover: #46d07f;
        --accent-soft: #173a25;
        --good: #3ccf78;
        --warn: #ff6b61;
        --warn-soft: #3a1d1b;
        --coupon: #c08cf0;
        --coupon-soft: #2f2240;
        --shadow-btn: 0 0 0 .5px rgba(255, 255, 255, .06);
        --shadow-panel: 0 0 0 1px rgba(255, 255, 255, .05);
        color-scheme: dark;
    }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
[id] { scroll-margin-top: 16px; }
body {
    margin: 0;
    font: 14px/1.5 var(--font);
    color: var(--text);
    background: var(--backdrop);
    -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
small { font-size: .86em; }
strong { font-weight: 600; }
s { color: var(--text-3); }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.5rem 0; }
pre { font-family: var(--mono); background: var(--surface); padding: .75rem; border-radius: 8px; overflow: auto; }
ul, ol { padding-left: 1.25rem; }
li { margin: .2rem 0; }

h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5rem; letter-spacing: -.01em; }
h2 { font-size: 1.85rem; font-weight: 700; letter-spacing: -.02em; }
h3 { font-size: 1.15rem; font-weight: 650; margin-top: 2rem; }
h4 { font-size: .95rem; font-weight: 600; margin-top: 1.5rem; }
h3 small, h4 small { color: var(--text-3); font-weight: 500; }
p { margin: 0 0 .75rem; }
section > p small, .list-page > p small { color: var(--text-2); font-size: .95em; }

/* ---------- App shell ---------- */
.app {
    display: grid;
    grid-template-columns: 248px 1fr;
    min-height: 100vh;
    padding: 12px 12px 0;
}
.sidebar {
    position: sticky; top: 12px;
    height: calc(100vh - 12px);
    display: flex; flex-direction: column;
    background: var(--sidebar);
    border-radius: var(--radius-lg) 0 0 0;
    border-right: 1px solid var(--border);
    padding: 18px 12px;
    overflow-y: auto;
}
.brand {
    display: flex; align-items: center; gap: 10px;
    padding: 2px 8px 18px; margin-bottom: 10px;
    border-bottom: 1px solid var(--border);
    color: var(--text); font-size: 1.15rem; font-weight: 700; letter-spacing: -.02em;
}
.brand:hover { text-decoration: none; }
.brand-mark {
    width: 30px; height: 30px; border-radius: 8px;
    display: grid; place-items: center; font-size: 17px;
    background: linear-gradient(145deg, #4cd384, #1f8f4e);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 1px 2px rgba(0, 0, 0, .15);
}
.nav-section { margin: 14px 0 4px; padding: 0 10px; font-size: .72rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.nav { list-style: none; margin: 0; padding: 0; }
.nav li { margin: 1px 0; }
.nav a {
    display: flex; align-items: center; gap: 10px;
    padding: 7px 10px; border-radius: 8px;
    color: var(--text); font-weight: 500;
}
.nav a:hover { background: var(--hover); text-decoration: none; }
.nav a[aria-current="page"] { background: var(--selected); font-weight: 600; }
.nav .ico { width: 20px; text-align: center; font-size: 15px; line-height: 1; }
.nav .label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav .count {
    min-width: 22px; padding: 0 6px; border-radius: 6px;
    font-size: .75rem; font-weight: 500; text-align: center; color: var(--text-2);
    border: 1px solid var(--border-strong); background: var(--panel);
    font-variant-numeric: tabular-nums;
}
.nav.sub { margin: 1px 0 4px 20px; padding-left: 8px; border-left: 1px solid var(--border-strong); }
.nav.sub a { padding: 5px 10px; font-size: .9rem; color: var(--text-2); }
.nav.sub a[aria-current="page"] { color: var(--text); }
.nav.sub .ico { font-size: 13px; }
.sidebar-foot { margin-top: auto; padding: 12px 10px 0; color: var(--text-3); font-size: .75rem; }

.main {
    min-width: 0;
    background: var(--panel);
    border-radius: 0 var(--radius-lg) 0 0;
    box-shadow: var(--shadow-panel);
}
.content { max-width: 1240px; padding: 34px 44px 64px; }

/* Page title: an h2 with optional action buttons on the right */
.content > section > h2:first-of-type,
.content > .list-page > h2 {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
    margin-bottom: .35rem;
}
.back { display: inline-flex; align-items: center; gap: 4px; margin-bottom: .75rem; color: var(--text-2); font-weight: 500; }
.back:hover { color: var(--text); text-decoration: none; }

/* ---------- Buttons ---------- */
button, [role="button"], input[type="submit"] {
    -webkit-appearance: none; appearance: none;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    font: inherit; font-weight: 500; line-height: 1.25;
    padding: 7px 14px; margin: 0;
    border-radius: 8px; border: 1px solid transparent;
    background: var(--accent); color: #fff;
    box-shadow: var(--shadow-btn);
    cursor: pointer; white-space: nowrap; text-decoration: none;
    transition: background .12s, border-color .12s, color .12s;
}
button:hover, [role="button"]:hover { background: var(--accent-hover); text-decoration: none; }
button:active, [role="button"]:active { transform: translateY(.5px); }
button:focus-visible, [role="button"]:focus-visible, a:focus-visible,
input:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 35%, transparent); outline-offset: 1px; }
button[disabled] { opacity: .55; cursor: default; }

/* Secondary / outline: the white macOS push button */
button.secondary, button.outline, [role="button"].secondary, [role="button"].outline {
    background: var(--panel); color: var(--text); border-color: var(--border-strong);
}
button.secondary:hover, button.outline:hover, [role="button"].secondary:hover, [role="button"].outline:hover { background: var(--hover); }
button.contrast.outline { color: var(--text-2); }
button.contrast.outline:hover { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, var(--border-strong)); background: var(--warn-soft); }
button.contrast:not(.outline) { background: var(--text); color: var(--panel); }

/* Compact row buttons */
.qty-btn, .pantry-add { padding: 4px 10px; font-size: .85rem; border-radius: 7px; }
.qty-cell .qty-btn { width: 28px; height: 28px; padding: 0; font-size: 1rem; border-radius: 50%; }
.row-actions { white-space: nowrap; text-align: right; }
.row-actions .qty-btn + .qty-btn { margin-left: 4px; }
.dont-buy { padding-left: 9px; padding-right: 9px; }
.pantry-cell { white-space: nowrap; width: 1%; }
.pantry-add { width: 28px; height: 28px; padding: 0; border-radius: 50%; font-size: 1.05rem; }
.pantry-add.just-added { background: var(--good); animation: pop .3s ease; }
@keyframes pop { 50% { transform: scale(1.18); } }
.plan-btn { font-size: .9rem; }

/* Busy state (aria-busy) */
[aria-busy="true"]::before {
    content: ""; width: 12px; height: 12px; border-radius: 50%;
    border: 2px solid currentColor; border-right-color: transparent;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.htmx-indicator { display: none; }
.htmx-request.htmx-indicator, .htmx-request .htmx-indicator { display: block; }

/* ---------- Forms ---------- */
label { display: block; margin-bottom: .35rem; font-weight: 500; }
label small { display: block; font-weight: 400; color: var(--text-2); }
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]), select, textarea {
    width: 100%; font: inherit; color: var(--text);
    padding: 7px 11px; margin: 0;
    border: 1px solid var(--border-strong); border-radius: 8px;
    background: var(--panel);
    box-shadow: inset 0 1px 1px rgba(0, 0, 0, .03);
    transition: border-color .12s, box-shadow .12s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
input[type="search"] {
    padding-left: 32px !important;
    background: var(--panel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238e9097' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='m11 11 3.5 3.5'/%3E%3C/svg%3E") no-repeat 10px center !important;
}
select {
    -webkit-appearance: none; appearance: none; padding-right: 30px;
    background: var(--panel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%238e9097' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 4.5 3 3 3-3'/%3E%3C/svg%3E") no-repeat right 10px center;
}
input[type="file"] { font: inherit; color: var(--text-2); }
input[type="file"]::file-selector-button {
    font: inherit; font-weight: 500; margin-right: 10px; padding: 6px 12px; cursor: pointer;
    border-radius: 8px; border: 1px solid var(--border-strong); background: var(--panel); color: var(--text);
}
input[type="checkbox"] { accent-color: var(--accent); }
form > * + * { margin-top: .6rem; }
form .grid { margin-top: .5rem; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 1rem; }
.grid > * { margin: 0; }

/* ---------- Cards ---------- */
article {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 18px;
    margin: 0 0 1rem;
    box-shadow: var(--shadow-card);
}
article > header { margin: -16px -18px 14px; padding: 12px 18px; border-bottom: 1px solid var(--border); background: var(--surface); border-radius: 12px 12px 0 0; }
article > :last-child { margin-bottom: 0; }
article h3 { margin-top: .25rem; font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.grid > article small:first-child { color: var(--text-2); font-weight: 500; }
article.expiry-ok { background: var(--accent-soft); border-color: transparent; color: var(--good); }
article.accent-good { border-left: 3px solid var(--good); }
article.accent-muted { border-left: 3px solid var(--border-strong); }

/* ---------- Tables ---------- */
figure { margin: 0 0 1.25rem; overflow-x: auto; }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-variant-numeric: tabular-nums; }
thead th {
    position: sticky; top: 0;
    background: var(--surface);
    color: var(--text-2); font-weight: 500; font-size: .84rem; text-align: left;
    padding: 9px 12px; white-space: nowrap;
    border-bottom: 1px solid var(--border);
}
thead th:first-child { border-radius: 10px 0 0 10px; }
thead th:last-child { border-radius: 0 10px 10px 0; }
thead th { border-bottom: 0; }
td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr { transition: background .1s; }
tbody tr:hover td { background: var(--hover); }
tbody tr:last-child td { border-bottom: 0; }
td a strong, td > strong { font-weight: 600; }
td a { color: var(--text); }
td a:hover { color: var(--accent); text-decoration: none; }
td small { color: var(--text-2); }

/* ---------- Details ---------- */
details { margin: 1.25rem 0; }
summary { cursor: pointer; color: var(--text-2); font-weight: 500; list-style: none; display: inline-flex; align-items: center; gap: 6px; }
summary::-webkit-details-marker { display: none; }
summary::before { content: "›"; display: inline-block; font-size: 1.1em; transition: transform .15s; }
details[open] > summary::before { transform: rotate(90deg); }
details[open] > summary { margin-bottom: .75rem; }

/* ---------- Status & tags ---------- */
.muted { color: var(--text-3); }
.price-good, .expiry-ok { color: var(--good); }
.expiry-warning { color: var(--warn); font-weight: 600; }
.deal-tag { color: var(--text-3); }
.deal-tag.good { color: var(--good); font-weight: 600; }
.store-tag {
    display: inline-block; min-width: 2.6em; margin-right: 4px;
    color: var(--text-3); font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .03em;
}
.sale-badge {
    display: inline-block; padding: 0 6px; border-radius: 5px; vertical-align: 1px;
    background: var(--sale); color: #fff; font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .03em;
}
.coupon-tag { display: inline-block; margin-top: 2px; padding: 0 6px; border-radius: 5px; background: var(--coupon-soft); color: var(--coupon); white-space: nowrap; }
.pantry-count, .list-tag {
    display: inline-block; min-width: 22px; margin-left: 6px; padding: 1px 7px; border-radius: 999px;
    font-size: .75rem; font-weight: 600; text-align: center; vertical-align: middle;
}
.pantry-count { background: var(--accent-soft); color: var(--good); }
.list-tag { background: color-mix(in srgb, var(--orange) 15%, transparent); color: var(--orange); }
.pantry-count:hover, .list-tag:hover { text-decoration: none; filter: brightness(.95); }

/* ---------- Lists (pantry / shopping / bought before) ---------- */
.add-form {
    background: var(--surface); border-radius: 12px; padding: 14px 16px; margin: 1rem 0 1.5rem;
}
.add-form .grid { grid-template-columns: 3fr 5rem 2fr auto; align-items: start; margin-bottom: 0; }
.due-soon > header { background: transparent; }
.item-list .qty-btn.secondary { color: var(--accent); }
.item-list .qty-btn.secondary:hover { background: var(--accent-soft); }

.list-group { margin-top: 1rem; }
.cat-row th {
    position: static; background: none; border-radius: 0 !important;
    padding: 22px 12px 6px; border-bottom: 1px solid var(--border); text-align: left;
    font-size: .74rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-2);
}
.cat-row th .muted { margin-left: 4px; font-weight: 500; }
tbody tr.cat-row:hover th { background: none; }
.cat-group:first-of-type .cat-row th { padding-top: 12px; }
.due-soon { margin-top: 1.5rem; }
.list-group table { table-layout: fixed; }
.list-group th.col-qty { width: 8.5rem; }
.list-group th.col-today { width: 14rem; }
.list-group th.col-actions { width: 8rem; }
.list-group th.col-actions.wide { width: 17.5rem; }
.list-group th { overflow: hidden; text-overflow: ellipsis; }
.qty-cell { white-space: nowrap; }
.qty { display: inline-block; min-width: 2rem; text-align: center; font-weight: 600; }
.not-for-us { margin-top: 2rem; }
.not-for-us ul { padding: 0; }
.not-for-us li { list-style: none; margin: 0; padding: 6px 0; display: flex; align-items: center; gap: 10px; }

/* Toolbar: search + filters above a table */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin: 1rem 0; }
.toolbar input[type="search"] { flex: 1 1 260px; max-width: 360px; }
.toolbar select { flex: 0 1 220px; width: auto; }

/* ---------- Shopping trip ---------- */
.trip-summary { background: var(--accent-soft); border-color: transparent; }
.trip-summary small { color: var(--text-2); }
.trip-store { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.trip-list { list-style: none; padding: 0; margin: 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.trip-list li { list-style: none; margin: 0; padding: 12px 14px; border-top: 1px solid var(--border); }
.trip-list li:first-child { border-top: 0; }
.trip-list li:hover { background: var(--hover); }
.trip-list label { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; margin: 0; font-weight: 400; }
.trip-list input[type=checkbox] { flex: none; width: 22px; height: 22px; margin: 1px 0 0; }
.trip-list small { color: var(--text-2); }
.trip-list li.done .trip-item { text-decoration: line-through; opacity: .45; }

.bookmarklet { cursor: grab; }

/* ---------- Mobile ---------- */
@media (max-width: 860px) {
    .app { display: block; padding: 0; }
    .sidebar {
        position: sticky; top: 0; z-index: 10; height: auto;
        flex-direction: row; align-items: center; gap: 4px;
        border-radius: 0; border-right: 0; border-bottom: 1px solid var(--border);
        padding: 8px 10px; overflow-x: auto;
        background: color-mix(in srgb, var(--sidebar) 88%, transparent);
        -webkit-backdrop-filter: saturate(180%) blur(16px); backdrop-filter: saturate(180%) blur(16px);
    }
    .brand { border: 0; padding: 0 6px 0 2px; margin: 0; font-size: 0; gap: 0; }
    .nav-section, .sidebar-foot { display: none; }
    .nav { display: flex; gap: 2px; }
    .nav li { margin: 0; }
    .nav.sub { display: contents; }
    .nav a { padding: 6px 9px; white-space: nowrap; }
    .nav .ico { width: auto; }
    .main { border-radius: 0; box-shadow: none; }
    .content { padding: 22px 16px 48px; }
    h2 { font-size: 1.5rem; }
    .add-form .grid { grid-template-columns: 1fr; }
}

/* Price Tracker */
.tracker-table td:first-child { min-width: 240px; }
.tracker-table .col-now { min-width: 170px; }
.tracker-table .num { text-align: right; white-space: nowrap; }
.tracker-table th.col-add, .tracker-table td.pantry-cell { width: 1%; text-align: right; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--text); }
th.sortable::after { content: "↕"; margin-left: 4px; opacity: .35; font-size: .8em; }
th[aria-sort="ascending"]::after { content: "↑"; opacity: 1; }
th[aria-sort="descending"]::after { content: "↓"; opacity: 1; }
.toolbar-note { align-self: center; font-size: .85rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Dashboard ---------- */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 1.25rem 0 1.5rem; }
.tile {
    display: flex; flex-direction: column; gap: 2px;
    padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px;
    background: var(--panel); color: var(--text); box-shadow: var(--shadow-card);
    transition: border-color .12s, transform .12s;
}
a.tile:hover { text-decoration: none; border-color: var(--border-strong); transform: translateY(-1px); }
.tile-label { color: var(--text-2); font-weight: 500; font-size: .85rem; }
.tile-value { font-size: 1.75rem; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tile-value small { font-size: .9rem; font-weight: 500; color: var(--text-2); }
.tile-value.good { color: var(--good); }
.tile-value.warn { color: var(--orange); }
.tile-note { color: var(--text-2); font-size: .82rem; }

.panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; }
.panel { padding-bottom: 6px; }
.panel > header { display: flex; align-items: baseline; gap: 8px; }
.panel-link { margin-left: auto; font-size: .85rem; font-weight: 500; }
.item-list { list-style: none; margin: 0; padding: 0; }
.item-list li { display: flex; align-items: center; gap: 12px; margin: 0; padding: 9px 0; border-top: 1px solid var(--border); }
.item-list li:first-child { border-top: 0; padding-top: 0; }
.item-list li.done .item-main { opacity: .45; }
.item-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.item-main a { color: var(--text); font-weight: 600; }
.item-main a:hover { color: var(--accent); text-decoration: none; }
.item-side { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.pill-good { padding: 1px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--good); font-weight: 600; }

.trips { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.trip { margin: 0; border-top: 1px solid var(--border); }
.trip:first-child { border-top: 0; }
.trip > summary { display: flex; align-items: center; gap: 16px; padding: 12px 16px; color: var(--text); font-weight: 400; width: 100%; }
.trip > summary:hover { background: var(--hover); }
.trip > summary::before { color: var(--text-3); }
.trip[open] > summary { margin: 0; background: var(--surface); }
.trip-date { display: flex; flex-direction: column; width: 56px; line-height: 1.2; }
.trip-date small { color: var(--text-3); }
.trip-where { flex: 1; display: flex; flex-direction: column; line-height: 1.3; }
.trip-total { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.3; font-variant-numeric: tabular-nums; }
.trip-items { list-style: none; margin: 0; padding: 6px 16px 12px 104px; columns: 2 280px; column-gap: 32px; }
.trip-items li { display: flex; justify-content: space-between; gap: 12px; margin: 0; padding: 4px 0; break-inside: avoid; font-size: .9rem; }
.trip-items a { color: var(--text); }
.trip-items span { color: var(--text-2); font-variant-numeric: tabular-nums; }
.scan { margin-top: 2rem; }
@media (max-width: 1100px) { .tiles { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 860px) { .trip-items { padding-left: 16px; } }
@media (max-width: 1240px) { .tracker-table .opt { display: none; } }

/* Rows that belong together (a coupon spanning several products) highlight as one */
.row-group:hover td { background: var(--hover); }
.row-group + .row-group td { border-top: 1px solid var(--border); }
.row-group tr:last-child td { border-bottom: 0; }
.row-group td[rowspan] { border-bottom: 0; }

/* ---------- Sign in ---------- */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: var(--backdrop); }
.login-card {
    width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 10px;
    background: var(--panel); border-radius: var(--radius-lg); box-shadow: var(--shadow-panel); padding: 28px 24px;
}
.login-card .brand { margin-bottom: 10px; }
.login-card label { font-size: .85rem; color: var(--text-2); }
.login-card input { width: 100%; }
.login-card button { width: 100%; margin-top: 4px; }
.login-error { color: var(--warn); margin: 0; font-size: .9rem; }
.inline-form { display: inline; margin: 0; }
.link-btn, .link-btn:hover {
    background: none; border: 0; padding: 0; box-shadow: none; color: inherit; font: inherit;
    text-decoration: underline; cursor: pointer; width: auto;
}
