/* ==========================================================================
   RoyEats — Restaurants, Cafés & Bars
   Design system: warm, appetising, editorial. Built on the same structural
   vocabulary as the VitalCare/RoyRentals siblings so the explorer bridge and
   the console share one mental model, but with a kitchen-warm palette.

   Theming: every colour lives in a token block below. The global framework
   menu (.app-window-menu) flips `html[data-bs-theme]`; our CSS just reacts.
   ========================================================================== */

/* --- Tokens --------------------------------------------------------------- */
:root {
    --bg: #fdf6f0;
    --bg-soft: #fff9f4;
    --surface: #ffffff;
    --surface-2: #fff4ea;
    --ink: #2b1a10;
    --text: #40301f;
    --muted: #8a7460;
    --line: #f0dfd0;
    --line-strong: #e2c8b1;

    --ember: #ea580c;
    --ember-strong: #c2410c;
    --ember-soft: #ffedd5;
    --gold: #d97706;
    --gold-soft: #fef3c7;
    --berry: #be123c;
    --berry-soft: #ffe4e6;
    --leaf: #15803d;
    --leaf-soft: #dcfce7;
    --plum: #7c3aed;
    --plum-soft: #ede9fe;

    --ok: #15803d;
    --ok-soft: #dcfce7;
    --warn: #b45309;
    --warn-soft: #fef3c7;
    --danger: #dc2626;
    --danger-soft: #fee2e2;

    /* Decorative palettes (gradients, hero art, banners) */
    --hero-bg: linear-gradient(140deg, #431407 0%, #7c2d12 42%, #b45309 100%);
    --hero-glow-a: rgba(251, 146, 60, 0.4);
    --hero-glow-b: rgba(190, 18, 60, 0.28);
    --hero-text: #fff7ed;
    --hero-muted: rgba(255, 247, 237, 0.76);
    --hero-solid-text: #7c2d12;

    --shadow-sm: 0 1px 2px rgba(43, 26, 16, 0.06);
    --shadow: 0 16px 40px rgba(43, 26, 16, 0.1);
    --shadow-lg: 0 32px 80px rgba(43, 26, 16, 0.24);

    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 22px;
    --radius-xl: 28px;

    --font-body: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-display: "Sora", "Manrope", ui-sans-serif, system-ui, sans-serif;
}

/* Dark theme (driven by the global #app-window-menu theme switch) */
html[data-bs-theme="dark"] {
    --bg: #16100c;
    --bg-soft: #1d1510;
    --surface: #221812;
    --surface-2: #2c1f17;
    --ink: #fdece0;
    --text: #f3dccb;
    --muted: #b39c85;
    --line: #3a281d;
    --line-strong: #523a2a;

    --ember-soft: #431f0a;
    --gold-soft: #3b2a0c;
    --berry-soft: #400f1c;
    --leaf-soft: #12301c;
    --plum-soft: #2a1f4a;
    --ok-soft: #12301c;
    --warn-soft: #3b2a0c;
    --danger-soft: #43120f;

    --hero-bg: linear-gradient(140deg, #1c0f08 0%, #46180a 45%, #7c2d12 100%);
    --hero-text: #fff3e6;
    --hero-solid-text: #ffedd5;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
    --shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 32px 80px rgba(0, 0, 0, 0.6);
}

/* --- Reset & base ---------------------------------------------------------- */
* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family: var(--font-body);
    color: var(--text);
    background:
        radial-gradient(52% 40% at 4% -6%, rgba(234, 88, 12, 0.14), transparent 62%),
        radial-gradient(46% 36% at 98% 0%, rgba(217, 119, 6, 0.12), transparent 60%),
        radial-gradient(40% 32% at 50% 106%, rgba(190, 18, 60, 0.08), transparent 62%),
        var(--bg);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
    /* Mobile-first: never let the OS rescale the layout, and never inherit a
       sub-16px control size (iOS Safari zooms the page when one is focused). */
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-display);
    letter-spacing: -0.015em;
    color: var(--ink);
    margin: 0;
}

button {
    font: inherit;
}

a {
    color: var(--ember-strong);
}

.hidden {
    display: none !important;
}

/* Touch ergonomics: drop the double-tap-zoom delay and the grey tap flash,
   and make every interactive element a comfortable finger target. */
button,
a,
label,
summary,
input,
select,
textarea {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

button,
.btn,
.chip-btn,
.workspace-rail button,
.filters-toggle {
    min-height: 44px;
}

/* --- Top app bar ----------------------------------------------------------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 90;
    background: rgba(253, 246, 240, 0.78);
    backdrop-filter: blur(14px) saturate(160%);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    border-bottom: 1px solid var(--line);
}

html[data-bs-theme="dark"] .topbar {
    background: rgba(22, 16, 12, 0.78);
}

.topbar-inner {
    width: 100%;
    max-width: 1352px;
    margin: 0 auto;
    min-height: 56px;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    /* One row, always. The switch shrinks (and the brand truncates) instead of
       the nav dropping onto a second line. */
    flex-wrap: nowrap;
    padding: 0.5rem 0.9rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.08rem;
    color: var(--ink);
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    flex: none;
    width: 34px;
    height: 34px;
    border-radius: 11px;
    background: linear-gradient(135deg, var(--ember), var(--gold) 60%, var(--berry));
    color: #fff;
    font-size: 1.1rem;
    box-shadow: 0 8px 18px rgba(234, 88, 12, 0.34);
}

.brand-text {
    letter-spacing: 0.01em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.viewswitch {
    display: flex;
    /* Never squashed, never wrapped: on a phone it is the labels that go, not
       the control's place in the row. */
    flex: none;
    gap: 0.25rem;
    padding: 0.25rem;
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: 999px;
    margin-left: auto;
}

.viewswitch button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-width: 44px;
    padding: 0.5rem 0.8rem;
    border: none;
    background: transparent;
    color: var(--muted);
    border-radius: 999px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.875rem;
    white-space: nowrap;
    transition: background 0.18s ease, color 0.18s ease;
}

.viewswitch button:hover {
    color: var(--ember-strong);
}

.viewswitch button.is-active {
    background: linear-gradient(135deg, var(--ember), var(--ember-strong));
    color: #fff;
    box-shadow: 0 6px 16px rgba(234, 88, 12, 0.3);
}

.vs-icon {
    font-size: 1.15rem;
    line-height: 1;
}

/* Phone: icon-only, so the bar stays one row and the switch costs ~100px
   instead of 318px. The buttons carry aria-labels, so the names survive. */
.viewswitch .vs-label {
    display: none;
}

/* --- Shell & panels -------------------------------------------------------- */
/* Base = a phone: full-bleed with a gutter. The centred max-width is added at
   900px and up (see the mobile-first breakpoints at the end of this file). */
.shell {
    width: 100%;
    max-width: 1352px;
    margin: 1rem auto 3rem;
    padding: 0 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.panel {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    min-width: 0;
}

/* --- Hero ------------------------------------------------------------------ */
.hero {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-xl);
    background: var(--hero-bg);
    color: var(--hero-text);
    box-shadow: var(--shadow-lg);
}

.hero::after {
    /* appetising warm haze over the gradient */
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(42% 54% at 88% 12%, var(--hero-glow-a), transparent 68%),
        radial-gradient(38% 48% at 76% 96%, var(--hero-glow-b), transparent 70%);
    pointer-events: none;
}

.hero-inner {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.9rem;
    padding: 1.35rem 1.1rem 1.3rem;
}

.hero-copy {
    min-width: 0;
}

.kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.32rem 0.8rem;
    border-radius: 999px;
    background: rgba(255, 247, 237, 0.14);
    border: 1px solid rgba(255, 247, 237, 0.22);
    color: var(--hero-text);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.kicker-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #fb923c;
    box-shadow: 0 0 0 4px rgba(251, 146, 60, 0.22);
}

.hero h1 {
    margin: 0.8rem 0 0.6rem;
    font-size: clamp(1.5rem, 6.4vw, 2.5rem);
    line-height: 1.16;
    color: var(--hero-text);
}

.hero h1 em {
    font-style: normal;
    background: linear-gradient(100deg, #fdba74, #fde68a 55%, #fda4af);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero p {
    margin: 0;
    max-width: 62ch;
    color: var(--hero-muted);
    font-size: 0.95rem;
    line-height: 1.58;
}

.hero p strong {
    color: var(--hero-text);
}

.hero-cta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    margin-top: 1.2rem;
}

/* The primary action owns the full width on a phone; the secondary two share a row. */
.hero-cta> :first-child {
    grid-column: 1 / -1;
}

/* Two compact columns on a phone: the trust points stay, at half the height. */
.hero-trust {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.4rem 0.8rem;
    margin-top: 1.1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 247, 237, 0.16);
}

.trust-item {
    display: inline-flex;
    align-items: flex-start;
    gap: 0.35rem;
    font-size: 0.78rem;
    line-height: 1.35;
    color: var(--hero-muted);
}

.trust-check {
    display: inline-grid;
    place-items: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(253, 186, 116, 0.24);
    color: #fdba74;
    font-size: 0.68rem;
    font-weight: 800;
}

/* Hero art: a plate, not a stock photo.
   Hidden on a phone — it costs a viewport without earning one. */
.hero-art {
    position: relative;
    display: none;
    place-items: center;
    min-height: 200px;
}

.art-plate {
    position: relative;
    display: grid;
    place-items: center;
    width: clamp(150px, 20vw, 218px);
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle at 34% 28%, #fff7ed 0%, #fed7aa 46%, #fb923c 100%);
    box-shadow: 0 26px 60px rgba(0, 0, 0, 0.34), inset 0 0 0 12px rgba(255, 255, 255, 0.32);
}

.art-plate::after {
    content: "";
    position: absolute;
    inset: 19%;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 34%, #ffedd5 0%, #fdba74 100%);
    box-shadow: inset 0 0 22px rgba(124, 45, 18, 0.24);
}

.art-plate-icon {
    position: relative;
    z-index: 1;
    font-size: clamp(2.1rem, 4vw, 3rem);
    filter: drop-shadow(0 3px 8px rgba(124, 45, 18, 0.32));
}

.art-steam {
    position: absolute;
    top: 6%;
    width: 10px;
    height: 46%;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(255, 247, 237, 0.5), transparent);
    filter: blur(4px);
}

.art-steam:nth-child(1) {
    left: 42%;
    animation: steam 3.6s ease-in-out infinite;
}

.art-steam:nth-child(2) {
    left: 52%;
    height: 36%;
    animation: steam 3.6s ease-in-out 0.9s infinite;
}

.art-steam:nth-child(3) {
    left: 62%;
    height: 28%;
    animation: steam 3.6s ease-in-out 1.8s infinite;
}

@keyframes steam {

    0%,
    100% {
        opacity: 0.25;
        transform: translateY(6px) scaleY(0.9);
    }

    50% {
        opacity: 0.7;
        transform: translateY(-8px) scaleY(1.1);
    }
}

.art-ground {
    position: absolute;
    bottom: 6%;
    width: 62%;
    height: 14px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.28);
    filter: blur(8px);
}

@media (prefers-reduced-motion: reduce) {
    .art-steam {
        animation: none;
    }
}

/* --- Panel head ------------------------------------------------------------ */
.panel-head {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    flex-wrap: wrap;
}

.panel-head h2 {
    font-size: 1.24rem;
    margin-bottom: 0.24rem;
}

.panel-head p {
    margin: 0;
    color: var(--muted);
    font-size: 0.88rem;
    max-width: 74ch;
    /* On a phone the filter toggle already explains itself; this is the desktop
       explainer, so it only appears once there is room for it. */
    display: none;
}

.focus-pick {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.focus-pick label {
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--muted);
}

.focus-pick select {
    min-width: 200px;
}

/* --- Subscription banner --------------------------------------------------- */
.sub-banner {
    border-radius: var(--radius);
    padding: 0.9rem 1.1rem;
    background: linear-gradient(135deg, var(--gold-soft), var(--surface-2));
    border: 1px solid var(--line-strong);
}

.sub-banner-inner {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.sub-banner-copy {
    display: flex;
    flex-direction: column;
    gap: 0.22rem;
    min-width: 0;
}

.sub-banner-copy strong {
    font-family: var(--font-display);
    font-size: 0.98rem;
    color: var(--ink);
}

.sub-banner .btn {
    margin-left: auto;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.22rem 0.62rem;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 700;
    width: fit-content;
}

.status-chip.is-active {
    background: var(--ok-soft);
    color: var(--ok);
}

.status-chip.is-pending {
    background: var(--warn-soft);
    color: var(--warn);
}

.status-chip.is-danger {
    background: var(--danger-soft);
    color: var(--danger);
}

/* --- Buttons --------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.62rem 1.05rem;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    background: var(--surface);
    color: var(--text);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.14s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

.btn-hero {
    background: #fff7ed;
    color: var(--hero-solid-text);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
}

html[data-bs-theme="dark"] .btn-hero {
    background: var(--ember);
    color: #fff;
}

.btn-hero-ghost {
    background: rgba(255, 247, 237, 0.1);
    border-color: rgba(255, 247, 237, 0.34);
    color: #fff7ed;
}

.btn-hero-ghost:hover {
    background: rgba(255, 247, 237, 0.18);
}

.btn-primary {
    background: linear-gradient(135deg, var(--ember), var(--ember-strong));
    color: #fff;
    box-shadow: 0 8px 20px rgba(234, 88, 12, 0.26);
}

.btn-alt {
    background: var(--ink);
    color: var(--surface);
}

html[data-bs-theme="dark"] .btn-alt {
    background: var(--ember-soft);
    color: var(--ink);
}

.btn-plain {
    background: transparent;
    border-color: var(--line-strong);
    color: var(--text);
}

.btn-plain:hover {
    border-color: var(--ember);
    color: var(--ember-strong);
}

.btn-danger {
    background: var(--danger-soft);
    color: var(--danger);
    border-color: transparent;
}

.btn-sm {
    padding: 0.5rem 0.8rem;
    font-size: 0.85rem;
}

.btn-block {
    width: 100%;
}

/* --- Search & filters ------------------------------------------------------ */
.search-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 0.9rem;
    box-shadow: var(--shadow-sm);
}

/* Mobile filter disclosure.
   On a phone the filter grid is a screen-and-a-half of controls, so the results
   are the priority: the form starts collapsed behind a toggle that reports how
   many filters are active, and is permanently open from 900px up. */
.filters-toggle {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.6rem 0.85rem;
    margin-top: 0.85rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--bg-soft);
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
}

.filters-toggle .filters-caret {
    margin-left: auto;
    transition: transform 0.2s ease;
}

.search-card.is-open .filters-toggle .filters-caret {
    transform: rotate(180deg);
}

.filters-count {
    display: inline-grid;
    place-items: center;
    min-width: 22px;
    height: 22px;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: var(--ember);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
}

.filters-count[hidden] {
    display: none;
}

/* Collapsed folds only the advanced fields around the two controls that matter on
   a phone — the keyword box and the submit. The script only applies the class
   below 900px, so this needs no desktop override and the full grid always renders
   on a wide screen. Stacked to begin with, because below 360px the keyword box
   would otherwise be squeezed to about 115px. */
.search-card.is-collapsed:not(.is-open) .filters {
    grid-template-columns: minmax(0, 1fr);
    align-items: end;
}

@media (min-width: 360px) {
    .search-card.is-collapsed:not(.is-open) .filters {
        grid-template-columns: minmax(0, 1fr) auto;
    }
}

.search-card.is-collapsed:not(.is-open) .filters .field:not(:first-child):not(:last-child) {
    display: none;
}

/* The submit field's spacer label only exists to line up in a desktop row. */
.search-card.is-collapsed:not(.is-open) .filters .field:last-child>label {
    display: none;
}

.filters-toggle[hidden] {
    display: none;
}

.filters {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.75rem 0.85rem;
}

.filters .field {
    display: flex;
    flex-direction: column;
    gap: 0.32rem;
    min-width: 0;
}

.filters .field.span-2,
.filters .field.span-3,
.filters .field.span-4 {
    grid-column: span 1;
}

.filters label {
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

.filters label small {
    text-transform: none;
    letter-spacing: 0;
    font-weight: 500;
}

input,
select,
textarea {
    width: 100%;
    min-height: 46px;
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line-strong);
    background: var(--bg-soft);
    color: var(--text);
    font-family: inherit;
    /* 16px is the floor: anything smaller makes iOS Safari zoom on focus. */
    font-size: 1rem;
    transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--ember);
    box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.16);
}

input.readonly,
input[readonly] {
    background: var(--surface-2);
    color: var(--muted);
}

textarea {
    min-height: 84px;
    resize: vertical;
}

.check-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 46px;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--bg-soft);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    text-transform: none;
    letter-spacing: 0;
}

.check-label input {
    width: 20px;
    height: 20px;
    flex: none;
    accent-color: var(--ember);
}

.check-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

/* --- Results strip & pills ------------------------------------------------- */
.results-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.36rem 0.78rem;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 600;
}

.pill strong {
    color: var(--ink);
}

/* --- Listing grid ---------------------------------------------------------- */
/* One card per row on a phone; as many 320px columns as fit from 620px up. */
.grid-listings {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.85rem;
}

.listing-card {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 1.05rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.16s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.listing-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
    border-color: var(--line-strong);
}

.listing-top {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
}

.listing-avatar {
    display: grid;
    place-items: center;
    flex: none;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--ember-soft), var(--gold-soft));
    border: 1px solid var(--line-strong);
    font-size: 1.35rem;
}

.listing-headline {
    min-width: 0;
    flex: 1;
}

.listing-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.02rem;
    color: var(--ink);
    line-height: 1.25;
}

.listing-sub {
    display: block;
    margin-top: 0.16rem;
    color: var(--muted);
    font-size: 0.82rem;
}

.listing-blurb {
    margin: 0;
    color: var(--text);
    font-size: 0.87rem;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.badge-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.34rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    padding: 0.22rem 0.58rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    background: var(--surface-2);
    color: var(--muted);
    border: 1px solid var(--line);
    white-space: nowrap;
}

.badge-open {
    background: var(--ok-soft);
    color: var(--ok);
    border-color: transparent;
}

.badge-closed {
    background: var(--surface-2);
    color: var(--muted);
}

.badge-reservable {
    background: var(--plum-soft);
    color: var(--plum);
    border-color: transparent;
}

.badge-delivery {
    background: var(--leaf-soft);
    color: var(--leaf);
    border-color: transparent;
}

.badge-signature {
    background: var(--gold-soft);
    color: var(--gold);
    border-color: transparent;
}

.badge-offer {
    background: var(--berry-soft);
    color: var(--berry);
    border-color: transparent;
}

.badge-price {
    background: var(--ember-soft);
    color: var(--ember-strong);
    border-color: transparent;
}

.badge-cuisine {
    background: var(--surface-2);
    color: var(--text);
}

.venue-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.4rem;
    padding: 0.65rem 0.7rem;
    border-radius: var(--radius-sm);
    background: var(--bg-soft);
    border: 1px solid var(--line);
}

.venue-stats .stat {
    min-width: 0;
    text-align: center;
}

.venue-stats .stat b {
    display: block;
    font-family: var(--font-display);
    font-size: 0.96rem;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.venue-stats .stat span {
    display: block;
    margin-top: 0.1rem;
    font-size: 0.66rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

.listing-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
    margin-top: auto;
    padding-top: 0.2rem;
}

.listing-actions .btn {
    min-width: 0;
}

.empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2.6rem 1rem;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius-lg);
    background: var(--surface);
    color: var(--muted);
}

.empty h3 {
    margin-bottom: 0.35rem;
    font-size: 1.05rem;
}

.empty p {
    margin: 0 auto 0.9rem;
    max-width: 52ch;
    font-size: 0.88rem;
}

.empty-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    justify-content: center;
}

.loading {
    grid-column: 1 / -1;
    display: grid;
    place-items: center;
    gap: 0.6rem;
    padding: 2.4rem 1rem;
    color: var(--muted);
    font-size: 0.88rem;
}

.spinner {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 3px solid var(--line-strong);
    border-top-color: var(--ember);
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* --- Manager KPIs ---------------------------------------------------------- */
/* Two up on a phone so four to six KPIs read without any horizontal hunting. */
.manager-kpis {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
}

.kpi {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0.85rem 0.95rem;
    box-shadow: var(--shadow-sm);
    min-width: 0;
}

.kpi-label {
    display: block;
    font-size: 0.68rem;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 700;
}

.kpi-value {
    display: block;
    margin-top: 0.3rem;
    font-family: var(--font-display);
    font-size: 1.32rem;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.1;
}

.kpi-note {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.74rem;
    color: var(--muted);
}

/* --- Console workspace ----------------------------------------------------- */
.workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.9rem;
    align-items: start;
}

.workspace>* {
    min-width: 0;
}

/* On a phone the rail is a scrollable tab bar pinned under the top app bar, so
   the section you are in stays reachable without scrolling back up. */
.workspace-rail {
    display: flex;
    flex-direction: row;
    gap: 0.25rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0.4rem;
    position: sticky;
    top: 60px;
    z-index: 40;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    box-shadow: var(--shadow-sm);
}

.workspace-rail::-webkit-scrollbar {
    display: none;
}

.workspace-rail button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 0 0 auto;
    padding: 0.55rem 0.75rem;
    border: none;
    background: transparent;
    color: var(--text);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.87rem;
    font-weight: 600;
    text-align: left;
    white-space: nowrap;
    scroll-snap-align: start;
    transition: background 0.16s ease, color 0.16s ease;
}

.workspace-rail button:hover {
    background: var(--bg-soft);
    color: var(--ember-strong);
}

.workspace-rail button.is-active {
    background: linear-gradient(135deg, var(--ember-soft), var(--gold-soft));
    color: var(--ember-strong);
}

.rail-icon {
    font-size: 1rem;
}

.workspace-main {
    min-width: 0;
}

.tab-content {
    display: none;
    flex-direction: column;
    gap: 1rem;
}

.tab-content.is-active {
    display: flex;
}

.box {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 1.05rem;
    box-shadow: var(--shadow-sm);
    min-width: 0;
}

.box>h3 {
    font-size: 1rem;
    margin-bottom: 0.8rem;
}

.box-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.85rem;
}

.box-head h3 {
    margin: 0;
    font-size: 1rem;
}

.box-head> :last-child:not(h3) {
    margin-left: auto;
}

.split-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
    gap: 1rem;
    align-items: start;
}

.split-grid>* {
    min-width: 0;
}

.filter-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-left: auto;
}

.filter-inline label {
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
}

.filter-inline select {
    width: auto;
    min-width: 150px;
}

.form-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* A form-actions row is a .field for grid placement but must lay out across,
   not stack like a labelled input. */
.filters .field.form-actions {
    flex-direction: row;
    align-items: center;
}

/* --- Tables ---------------------------------------------------------------- */
/* Mobile-first: a table is a key/value card per row. A 620px grid that must be
   scrolled sideways is unusable on a phone; the real table returns at 760px. */
.table-wrap {
    width: 100%;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

thead {
    display: none;
}

tbody,
tbody tr,
tbody td {
    display: block;
    width: 100%;
}

tbody tr {
    margin-bottom: 0.6rem;
    padding: 0.25rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
}

tbody tr:last-child {
    margin-bottom: 0;
}

tbody td {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.9rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--line);
    color: var(--text);
    text-align: right;
    min-width: 0;
}

tbody td:last-child {
    border-bottom: none;
}

/* Each cell carries its column name for the stacked view (see app.js). */
tbody td::before {
    content: attr(data-label);
    flex: 0 0 auto;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    text-align: left;
}

/* A full-width "nothing here yet" cell must not print a stray label. */
tbody td[colspan]:not([data-label])::before {
    display: none;
}

/* Kept in the base so the stacked view and the real table share one definition;
   the <thead> itself is hidden until 760px (see the breakpoints). */
thead th {
    text-align: left;
    padding: 0.6rem 0.7rem;
    background: var(--bg-soft);
    color: var(--muted);
    font-size: 0.7rem;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    font-weight: 700;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

.row-actions {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}

/* --- Tight list (console rows) --------------------------------------------- */
.tight-list {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.tight-list .row-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.55rem;
    padding: 0.8rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--bg-soft);
    min-width: 0;
}

.entry-top {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.entry-top strong {
    font-family: var(--font-display);
    font-size: 0.92rem;
    color: var(--ink);
}

.entry-top small {
    color: var(--muted);
    font-size: 0.76rem;
}

.entry-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.85rem;
    margin-top: 0.25rem;
    font-size: 0.79rem;
    color: var(--muted);
}

.entry-meta b {
    color: var(--ink);
}

.entry-main {
    flex: 1;
    min-width: 0;
}

.entry-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    gap: 0.4rem;
    margin-left: 0;
}

.price-tag {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--ink);
    white-space: nowrap;
}

.sub-note {
    margin: 0 0 0.8rem;
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.6;
}

/* --- Place banner (the E-Tours deep link) ---------------------------------- */
.place-banner {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: flex-start;
    padding: 1rem 1.1rem;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--ember-soft), var(--gold-soft));
    border: 1px solid var(--line-strong);
}

.place-banner-main {
    display: flex;
    gap: 0.75rem;
    min-width: 0;
    flex: 1;
}

.place-banner-icon {
    font-size: 1.4rem;
    line-height: 1;
}

.place-banner-copy {
    min-width: 0;
}

.place-banner-text {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--ink);
    font-size: 0.98rem;
}

.place-banner-stats,
.geo-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.1rem;
    margin-top: 0.5rem;
}

.geo-stat {
    font-size: 0.78rem;
    color: var(--muted);
}

.geo-stat strong {
    display: block;
    font-family: var(--font-display);
    font-size: 1.02rem;
    color: var(--ink);
}

.geo-chips-label {
    margin-top: 0.6rem;
    font-size: 0.74rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 700;
}

.chip-btn {
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    border: 1px solid var(--line-strong);
    background: var(--surface);
    color: var(--text);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease;
}

.chip-btn:hover {
    border-color: var(--ember);
    color: var(--ember-strong);
}

.chip-btn .muted {
    color: var(--muted);
    margin-left: 0.25rem;
}

.place-banner-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
    width: 100%;
}

.place-banner-actions [hidden] {
    display: none;
}

/* --- Detail card ----------------------------------------------------------- */
.venue-detail {
    display: flex;
    flex-direction: column;
    gap: 1.05rem;
}

.vd-hero {
    display: flex;
    gap: 0.9rem;
    align-items: flex-start;
    flex-wrap: wrap;
    padding-bottom: 0.9rem;
    border-bottom: 1px solid var(--line);
}

.vd-avatar {
    display: grid;
    place-items: center;
    width: 62px;
    height: 62px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--ember-soft), var(--gold-soft));
    border: 1px solid var(--line-strong);
    font-size: 1.85rem;
    flex: none;
}

.vd-headline {
    flex: 1;
    min-width: 0;
}

.vd-title {
    font-family: var(--font-display);
    font-size: 1.28rem;
    font-weight: 700;
    color: var(--ink);
}

.vd-location {
    margin-top: 0.2rem;
    color: var(--muted);
    font-size: 0.86rem;
}

.vd-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
    width: 100%;
}

.vd-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 0.6rem;
}

.vd-meta .stat {
    padding: 0.6rem 0.7rem;
    border-radius: var(--radius-sm);
    background: var(--bg-soft);
    border: 1px solid var(--line);
}

.vd-meta .stat b {
    display: block;
    font-family: var(--font-display);
    font-size: 1.02rem;
    color: var(--ink);
}

.vd-meta .stat span {
    display: block;
    margin-top: 0.14rem;
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

.vd-section {
    min-width: 0;
}

.vd-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
    font-family: var(--font-display);
    font-size: 0.94rem;
    font-weight: 700;
    color: var(--ink);
}

.vd-section-title small {
    margin-left: auto;
    font-weight: 500;
    color: var(--muted);
    font-size: 0.78rem;
}

.vd-text {
    margin: 0;
    color: var(--text);
    font-size: 0.9rem;
    line-height: 1.65;
}

.menu-group {
    margin-bottom: 0.85rem;
}

.menu-group:last-child {
    margin-bottom: 0;
}

.menu-group-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ember-strong);
    margin-bottom: 0.4rem;
}

.menu-item {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    padding: 0.55rem 0.7rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: var(--bg-soft);
    margin-bottom: 0.4rem;
}

.menu-item.is-signature {
    border-color: var(--gold);
    background: linear-gradient(135deg, var(--gold-soft), var(--bg-soft));
}

.mi-name {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 700;
    color: var(--ink);
    font-size: 0.9rem;
    flex-wrap: wrap;
}

.mi-desc {
    display: block;
    margin-top: 0.16rem;
    color: var(--muted);
    font-size: 0.8rem;
    line-height: 1.5;
}

.mi-price {
    margin-left: auto;
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--ink);
    white-space: nowrap;
}

.mi-flags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.28rem;
    margin-top: 0.34rem;
}

.dietary-chip {
    padding: 0.16rem 0.5rem;
    border-radius: 999px;
    background: var(--leaf-soft);
    color: var(--leaf);
    font-size: 0.68rem;
    font-weight: 700;
}

.spicy-dots {
    color: var(--berry);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
}

.offer-item {
    padding: 0.7rem 0.8rem;
    border-radius: var(--radius-sm);
    border: 1px dashed var(--berry);
    background: var(--berry-soft);
    margin-bottom: 0.45rem;
}

.offer-item .offer-price {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--berry);
}

.offer-item .offer-price s {
    color: var(--muted);
    font-weight: 500;
    margin-left: 0.35rem;
    font-size: 0.82rem;
}

.review-item {
    padding: 0.7rem 0.8rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: var(--bg-soft);
    margin-bottom: 0.45rem;
}

.review-item .rv-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.review-item .rv-name {
    font-weight: 700;
    color: var(--ink);
    font-size: 0.88rem;
}

.review-item .rv-date {
    margin-left: auto;
    color: var(--muted);
    font-size: 0.76rem;
}

.review-item p {
    margin: 0.35rem 0 0;
    color: var(--text);
    font-size: 0.86rem;
    line-height: 1.6;
}

.rating-stars {
    color: var(--gold);
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.hours-line {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: var(--text);
}

.open-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex: none;
}

.open-dot.is-open {
    background: var(--ok);
    box-shadow: 0 0 0 4px var(--ok-soft);
}

.open-dot.is-closed {
    background: var(--muted);
    box-shadow: 0 0 0 4px var(--bg-soft);
}

.open-dot.is-unknown {
    background: var(--warn);
    box-shadow: 0 0 0 4px var(--warn-soft);
}

.similar-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

/* --- Modals ---------------------------------------------------------------- */
/* Mobile-first: a bottom sheet on a phone — thumb-reachable and using the whole
   width — re-centring into a dialog from 640px up. */
.modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: none;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
    background: rgba(43, 26, 16, 0.6);
    backdrop-filter: blur(4px);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.modal.is-open {
    display: flex;
}

.modal-card {
    width: 100%;
    max-height: 92dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    background: var(--surface);
    border: 1px solid var(--line);
    border-bottom: none;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    box-shadow: var(--shadow-lg);
    padding: 1rem 0.95rem calc(1.6rem + env(safe-area-inset-bottom));
    animation: sheet 0.26s cubic-bezier(0.22, 0.9, 0.3, 1);
}

/* Grab handle: signals the sheet is a dismissible surface. */
.modal-card::before {
    content: "";
    display: block;
    width: 44px;
    height: 4px;
    margin: -0.4rem auto 0.8rem;
    border-radius: 999px;
    background: var(--line-strong);
}

@keyframes sheet {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.modal-head h3 {
    font-size: 1.06rem;
    margin: 0;
}

.modal-head .btn {
    margin-left: auto;
}

.lead-target {
    display: block;
    margin-bottom: 0.8rem;
    color: var(--muted);
    font-size: 0.85rem;
}

/* --- Toasts ---------------------------------------------------------------- */
/* Full width above the safe area on a phone; a corner card from 640px up. */
.toast-stack {
    position: fixed;
    left: 0.7rem;
    right: 0.7rem;
    bottom: calc(0.7rem + env(safe-area-inset-bottom));
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    padding: 0.75rem 0.95rem;
    border-radius: var(--radius-sm);
    background: var(--ink);
    color: var(--surface);
    font-size: 0.87rem;
    font-weight: 600;
    box-shadow: var(--shadow);
    animation: rise 0.2s ease;
    word-break: break-word;
}

.toast.is-ok {
    background: var(--ok);
    color: #fff;
}

.toast.is-error {
    background: var(--danger);
    color: #fff;
}

.toast.is-info {
    background: var(--ink);
    color: var(--surface);
}

/* --- Breakpoints (mobile-first) --------------------------------------------
   Everything above is the phone layout. Each step below adds the next tier of
   room, in the order the space actually becomes available. */

/* Room for both words again: from 460px the brand, the gap and the labelled
   switch fit on one row, with the brand still whole. */
@media (min-width: 460px) {
    .viewswitch .vs-label {
        display: inline;
    }
}

/* Wider phone / small tablet portrait: two-up filters. */
@media (min-width: 520px) {
    .hero-cta {
        display: flex;
        flex-wrap: wrap;
    }

    .hero-cta> :first-child {
        grid-column: auto;
    }

    .filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filters .field.span-2,
    .filters .field.span-3,
    .filters .field.span-4 {
        grid-column: span 2;
    }
}

/* Large phone: cards start flowing into columns. */
@media (min-width: 620px) {
    .grid-listings {
        grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
        gap: 1rem;
    }

    .hero-trust {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem 1.2rem;
    }
}

/* Tablet: dialogs re-centre, panels breathe, KPIs spread out. */
@media (min-width: 640px) {
    .shell {
        padding: 0 1rem;
        margin: 1.2rem auto 3.5rem;
        gap: 1.3rem;
    }

    .topbar-inner {
        min-height: 64px;
        padding: 0.5rem 1rem;
    }

    .search-card {
        padding: 1.05rem;
    }

    .panel-head p {
        display: block;
    }

    .hero-inner {
        padding: 1.9rem 1.5rem;
    }

    .modal {
        align-items: center;
        padding: 2.2rem 1rem;
    }

    .modal-card {
        width: min(560px, 100%);
        max-height: calc(100dvh - 4.4rem);
        border-bottom: 1px solid var(--line);
        border-radius: var(--radius-lg);
        padding: 1.2rem;
        animation: rise 0.2s ease;
    }

    .modal-card::before {
        display: none;
    }

    .modal-card-wide {
        width: min(860px, 100%);
    }

    .toast-stack {
        left: auto;
        right: 1rem;
        bottom: 1rem;
        max-width: min(380px, calc(100vw - 2rem));
    }

    .manager-kpis {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 0.7rem;
    }
}

/* Tablet landscape: real tables return, console rows go back to one line. */
@media (min-width: 760px) {
    .table-wrap {
        overflow-x: auto;
        border: 1px solid var(--line);
        border-radius: var(--radius-sm);
    }

    table {
        min-width: 620px;
        font-size: 0.86rem;
    }

    thead {
        display: table-header-group;
    }

    tbody {
        display: table-row-group;
    }

    tbody tr {
        display: table-row;
        margin: 0;
        padding: 0;
        border: none;
        border-radius: 0;
        background: transparent;
    }

    tbody tr:last-child {
        margin-bottom: 0;
    }

    tbody td {
        display: table-cell;
        width: auto;
        padding: 0.62rem 0.7rem;
        border-bottom: 1px solid var(--line);
        text-align: left;
        vertical-align: middle;
    }

    tbody td::before {
        display: none;
    }

    tbody tr:hover {
        background: var(--bg-soft);
    }

    .tight-list .row-card {
        flex-direction: row;
        align-items: flex-start;
        gap: 0.7rem;
        padding: 0.7rem 0.8rem;
    }

    .entry-actions {
        display: flex;
        gap: 0.35rem;
        flex-wrap: wrap;
        margin-left: auto;
    }

    .vd-actions {
        display: flex;
        flex-wrap: wrap;
        width: auto;
    }

    .place-banner-actions {
        display: flex;
        flex-wrap: wrap;
        width: auto;
    }
}

/* Desktop: centred column, always-open filter form, denser buttons. */
@media (min-width: 900px) {
    .shell {
        margin: 1.4rem auto 4rem;
        gap: 1.4rem;
    }

    .filters-toggle {
        display: none;
    }

    .btn-sm {
        min-height: 38px;
    }
}

/* Wide: the filter form goes back to four columns, the console gains a rail. */
@media (min-width: 1024px) {
    .filters {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .filters .field.span-3 {
        grid-column: span 3;
    }

    .filters .field.span-4 {
        grid-column: span 4;
    }

    .hero-inner {
        grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.65fr);
        gap: 1.6rem;
        padding: 2.4rem 2.2rem;
    }

    .hero-art {
        display: grid;
    }

    .hero h1 {
        font-size: clamp(1.9rem, 3.1vw, 2.5rem);
    }

    .workspace {
        grid-template-columns: 210px minmax(0, 1fr);
        gap: 1rem;
    }

    .workspace-rail {
        flex-direction: column;
        position: sticky;
        top: 84px;
        overflow: visible;
        padding: 0.5rem;
        scroll-snap-type: none;
    }

    .workspace-rail button {
        white-space: normal;
    }
}