/* =====================================================================
   Admin shell - sidebar + topbar + content, RTL first.
   ===================================================================== */

.admin {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    min-height: 100vh;
}

/* ---------------------------------------------------------------------
   Sidebar
   --------------------------------------------------------------------- */

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, var(--color-forest) 0%, var(--color-forest-dark) 100%);
    color: rgba(255, 255, 255, .82);
    overflow-y: auto;
    z-index: 40;
}

.sidebar__brand {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-5);
    border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.sidebar__mark {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    background: var(--color-emerald);
    display: grid;
    place-items: center;
    flex: none;
    box-shadow: 0 4px 14px rgba(33, 165, 88, .35);
}

.sidebar__mark svg { width: 22px; height: 22px; }

.sidebar__name {
    font-weight: 700;
    font-size: var(--text-md);
    color: #fff;
    line-height: 1.2;
}

.sidebar__tagline {
    font-size: var(--text-xs);
    color: rgba(255, 255, 255, .5);
}

.sidebar__nav {
    flex: 1;
    padding: var(--space-4) var(--space-3);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar__section {
    padding: var(--space-4) var(--space-3) var(--space-2);
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .38);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: 10px var(--space-3);
    border-radius: var(--radius-sm);
    color: rgba(255, 255, 255, .78);
    font-weight: 600;
    font-size: var(--text-base);
    transition: background var(--duration-fast) var(--ease-out),
                color var(--duration-fast) var(--ease-out);
}

.nav-link:hover {
    background: rgba(255, 255, 255, .07);
    color: #fff;
}

.nav-link.is-active {
    background: rgba(33, 165, 88, .18);
    color: #fff;
    box-shadow: inset 3px 0 0 var(--color-emerald);
}

[dir="rtl"] .nav-link.is-active { box-shadow: inset -3px 0 0 var(--color-emerald); }

.nav-link svg { width: 18px; height: 18px; flex: none; opacity: .9; }

.nav-link__badge {
    margin-inline-start: auto;
    background: var(--color-gold);
    color: #3A2708;
    border-radius: var(--radius-pill);
    padding: 1px 8px;
    font-size: var(--text-xs);
    font-weight: 700;
}

.sidebar__footer {
    padding: var(--space-4);
    border-top: 1px solid rgba(255, 255, 255, .1);
}

.sidebar__user {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: var(--text-sm);
    flex: none;
}

.sidebar__user-name  { font-size: var(--text-sm); font-weight: 700; color: #fff; }
.sidebar__user-email { font-size: var(--text-xs); color: rgba(255, 255, 255, .5); }

.sidebar__logout {
    width: 100%;
    background: rgba(255, 255, 255, .08);
    border: 0;
    color: rgba(255, 255, 255, .85);
}

.sidebar__logout:hover { background: rgba(255, 255, 255, .16); color: #fff; }

/* ---------------------------------------------------------------------
   Main column
   --------------------------------------------------------------------- */

.admin__main {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: var(--space-4);
    min-height: var(--header-height);
    padding: 0 var(--space-6);
    background: rgba(255, 255, 255, .9);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--color-border);
}

.topbar__title { font-size: var(--text-md); font-weight: 700; }

.topbar__actions { margin-inline-start: auto; display: flex; align-items: center; gap: var(--space-2); }

.sidebar-toggle { display: none; }

.content {
    flex: 1;
    padding: var(--space-6);
    max-width: 1440px;
    width: 100%;
}

.page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-4);
    flex-wrap: wrap;
    margin-bottom: var(--space-5);
}

.page-head__title { font-size: var(--text-xl); }
.page-head__sub   { color: var(--color-text-muted); font-size: var(--text-base); margin: 4px 0 0; }
.page-head__actions { display: flex; gap: var(--space-2); flex-wrap: wrap; }

.breadcrumb {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    margin-bottom: var(--space-2);
}

.breadcrumb a { color: var(--color-text-muted); }
.breadcrumb a:hover { color: var(--color-forest); }
.breadcrumb__sep { opacity: .5; }

/* ---------------------------------------------------------------------
   Stat cards
   --------------------------------------------------------------------- */

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-5);
}

.stat {
    position: relative;
    padding: var(--space-5);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.stat::after {
    content: "";
    position: absolute;
    inset-block-start: 0;
    inset-inline-start: 0;
    width: 3px;
    height: 100%;
    background: var(--stat-accent, var(--color-emerald));
}

.stat__label {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    font-weight: 600;
    margin-bottom: 6px;
}

.stat__value {
    font-size: var(--text-2xl);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -.02em;
    font-variant-numeric: tabular-nums;
}

.stat__meta { font-size: var(--text-xs); color: var(--color-text-faint); margin-top: 4px; }

/* ---------------------------------------------------------------------
   Board cards
   --------------------------------------------------------------------- */

.board-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-4);
}

.board-card {
    display: flex;
    flex-direction: column;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: box-shadow var(--duration-base) var(--ease-out),
                transform var(--duration-base) var(--ease-out),
                border-color var(--duration-base) var(--ease-out);
}

.board-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--color-border-strong);
}

.board-card__banner {
    height: 84px;
    background: linear-gradient(135deg, var(--color-forest) 0%, var(--color-forest-deep) 60%, var(--color-emerald) 180%);
    position: relative;
}

.board-card__banner::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle at 20% 120%, rgba(212, 160, 87, .35), transparent 55%);
}

.board-card__body { padding: var(--space-4) var(--space-5); flex: 1; }
.board-card__title { font-size: var(--text-md); margin-bottom: 4px; }
.board-card__meta { font-size: var(--text-sm); color: var(--color-text-muted); }

.board-card__stats {
    display: flex;
    gap: var(--space-5);
    margin-top: var(--space-4);
    padding-top: var(--space-4);
    border-top: 1px solid var(--color-border);
}

.board-card__stat-value { font-size: var(--text-lg); font-weight: 700; font-variant-numeric: tabular-nums; }
.board-card__stat-label { font-size: var(--text-xs); color: var(--color-text-muted); }

.board-card__footer {
    padding: var(--space-3) var(--space-5);
    background: var(--color-surface-alt);
    border-top: 1px solid var(--color-border);
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
}

/* ---------------------------------------------------------------------
   Board tabs
   --------------------------------------------------------------------- */

/* The divider is an inset shadow rather than a border, and the tabs sit
   flush rather than being pulled down over it.

   overflow-x: auto forces overflow-y to compute to auto as well, so the 1px
   the tabs used to be pulled past the bottom of the box counted as vertical
   overflow — and the strip grew its own vertical scrollbar, one pixel of
   scrollable content next to a row of links. A shadow is painted on the box
   and takes no part in layout, so the same look costs no overflow: the active
   tab underline lands exactly on the divider and covers it. */
.tabs {
    display: flex;
    gap: 2px;
    box-shadow: inset 0 -1px 0 var(--color-border);
    margin-bottom: var(--space-5);
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
}

.tab {
    padding: 10px 16px;
    border: 0;
    background: transparent;
    color: var(--color-text-muted);
    font-weight: 600;
    font-size: var(--text-base);
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: color var(--duration-fast) var(--ease-out),
                border-color var(--duration-fast) var(--ease-out);
}

.tab:hover { color: var(--color-text); }

.tab.is-active {
    color: var(--color-forest);
    border-bottom-color: var(--color-emerald);
}

/* ---------------------------------------------------------------------
   Category rows
   --------------------------------------------------------------------- */

.category-list { display: flex; flex-direction: column; gap: var(--space-2); }

.category-row {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    transition: border-color var(--duration-fast) var(--ease-out),
                box-shadow var(--duration-fast) var(--ease-out);
}

.category-row:hover { border-color: var(--color-border-strong); }
.category-row.is-dragging { opacity: .5; box-shadow: var(--shadow-md); }
.category-row.is-drop-target { border-color: var(--color-emerald); box-shadow: var(--shadow-glow); }

.category-row__handle {
    cursor: grab;
    color: var(--color-text-faint);
    padding: 4px;
    border-radius: var(--radius-xs);
    background: none;
    border: 0;
    flex: none;
}

.category-row__handle:active { cursor: grabbing; }

.category-swatch {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-xs);
    flex: none;
    border: 1px solid rgba(0, 0, 0, .08);
}

.category-row__name { font-weight: 600; }
.category-row__meta { font-size: var(--text-xs); color: var(--color-text-muted); }
.category-row__actions { margin-inline-start: auto; display: flex; gap: var(--space-1); }

/* ---------------------------------------------------------------------
   Participants grid
   --------------------------------------------------------------------- */

.participant-toolbar {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex-wrap: wrap;
    padding: var(--space-3) var(--space-4);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-4);
}

.participant-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
    gap: var(--space-4);
}

.participant-card {
    position: relative;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: box-shadow var(--duration-fast) var(--ease-out),
                border-color var(--duration-fast) var(--ease-out);
}

.participant-card:hover { box-shadow: var(--shadow-sm); }
.participant-card.is-selected { border-color: var(--color-emerald); box-shadow: var(--shadow-glow); }

.participant-card__photo {
    aspect-ratio: 1;
    width: 100%;
    object-fit: cover;
    background: var(--color-surface-sunk);
}

.participant-card__check {
    position: absolute;
    inset-block-start: 8px;
    inset-inline-start: 8px;
    width: 22px;
    height: 22px;
    accent-color: var(--color-emerald);
    cursor: pointer;
    z-index: 2;
}

.participant-card__status {
    position: absolute;
    inset-block-start: 8px;
    inset-inline-end: 8px;
    z-index: 2;
}

.participant-card__body { padding: var(--space-3); }

.participant-card__cat {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: var(--text-xs);
    font-weight: 600;
}

.participant-card__cat-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }

.participant-card__meta {
    font-size: var(--text-xs);
    color: var(--color-text-faint);
    margin-top: 4px;
    display: flex;
    justify-content: space-between;
    gap: var(--space-2);
}

.participant-card__actions {
    display: flex;
    gap: 4px;
    padding: var(--space-2) var(--space-3) var(--space-3);
    flex-wrap: wrap;
}

.participant-card__actions .btn { flex: 1; min-width: 0; }

/* ---------------------------------------------------------------------
   Link/token blocks
   --------------------------------------------------------------------- */

.link-block {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3);
    background: var(--color-surface-sunk);
    border: 1px dashed var(--color-border-strong);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    word-break: break-all;
    direction: ltr;
    text-align: left;
}

.link-block__url { flex: 1; min-width: 0; overflow-wrap: anywhere; }

.qr-preview {
    display: inline-flex;
    padding: var(--space-4);
    background: #fff;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
}

.qr-preview canvas,
.qr-preview svg { image-rendering: pixelated; }

/* ---------------------------------------------------------------------
   Wizard
   --------------------------------------------------------------------- */

.wizard { display: grid; grid-template-columns: 240px 1fr; gap: var(--space-6); align-items: start; }

.wizard__steps { display: flex; flex-direction: column; gap: 2px; position: sticky; top: calc(var(--header-height) + var(--space-5)); }

.wizard__step {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    border-radius: var(--radius-sm);
    color: var(--color-text-muted);
    font-weight: 600;
    background: none;
    border: 0;
    text-align: start;
    cursor: pointer;
    width: 100%;
}

.wizard__step:hover { background: var(--color-surface-sunk); }
.wizard__step.is-active { background: var(--color-surface); box-shadow: var(--shadow-xs); color: var(--color-text); }
.wizard__step.is-done .wizard__step-num { background: var(--color-emerald); color: #fff; border-color: var(--color-emerald); }

.wizard__step-num {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1.5px solid var(--color-border-strong);
    display: grid;
    place-items: center;
    font-size: var(--text-xs);
    font-weight: 700;
    flex: none;
}

.wizard__step.is-active .wizard__step-num { border-color: var(--color-forest); color: var(--color-forest); }

.wizard__panel { display: none; }
.wizard__panel.is-active { display: block; animation: fade-in var(--duration-base) var(--ease-out); }

/* ---------------------------------------------------------------------
   Simple charts (no library)
   --------------------------------------------------------------------- */

.bar-chart { display: flex; flex-direction: column; gap: var(--space-3); }

.bar-row { display: grid; grid-template-columns: 120px 1fr 64px; align-items: center; gap: var(--space-3); }

.bar-row__label { font-size: var(--text-sm); font-weight: 600; }

.bar-row__track {
    height: 10px;
    background: var(--color-surface-sunk);
    border-radius: var(--radius-pill);
    overflow: hidden;
}

.bar-row__fill {
    height: 100%;
    border-radius: inherit;
    background: var(--bar-color, var(--color-emerald));
    transition: width var(--duration-slow) var(--ease-out);
}

.bar-row__value {
    font-size: var(--text-sm);
    font-variant-numeric: tabular-nums;
    color: var(--color-text-muted);
    text-align: end;
}

.spark {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 72px;
}

.spark__bar {
    flex: 1;
    min-width: 4px;
    background: linear-gradient(180deg, var(--color-emerald), var(--color-emerald-soft));
    border-radius: 3px 3px 0 0;
    min-height: 3px;
    transition: height var(--duration-slow) var(--ease-out);
}

/* ---------------------------------------------------------------------
   Pagination
   --------------------------------------------------------------------- */

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    margin-top: var(--space-5);
    flex-wrap: wrap;
}

.pagination__link {
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    font-weight: 600;
    font-size: var(--text-sm);
    color: var(--color-text);
}

.pagination__link:hover { border-color: var(--color-forest); color: var(--color-forest); }

.pagination__link.is-active {
    background: var(--color-forest);
    border-color: var(--color-forest);
    color: #fff;
}

.pagination__link.is-disabled { opacity: .45; pointer-events: none; }

/* ---------------------------------------------------------------------
   Danger zone
   --------------------------------------------------------------------- */

.danger-zone {
    border: 1px solid rgba(192, 57, 43, .3);
    border-radius: var(--radius-lg);
    background: var(--color-danger-bg);
}

.danger-zone .card__header { border-bottom-color: rgba(192, 57, 43, .2); }
.danger-zone .card__title  { color: var(--color-danger); }

/* ---------------------------------------------------------------------
   Login
   --------------------------------------------------------------------- */

.login {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.login__aside {
    position: relative;
    background: linear-gradient(150deg, var(--color-forest) 0%, var(--color-forest-dark) 100%);
    color: #fff;
    padding: var(--space-8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}

.login__aside::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 82% 12%, rgba(212, 160, 87, .28), transparent 45%),
        radial-gradient(circle at 12% 88%, rgba(33, 165, 88, .30), transparent 45%);
}

.login__aside-inner { position: relative; max-width: 440px; }

.login__aside h1 { color: #fff; font-size: var(--text-3xl); margin-bottom: var(--space-4); }
.login__aside p  { color: rgba(255, 255, 255, .72); font-size: var(--text-md); }

.login__features { margin-top: var(--space-6); display: flex; flex-direction: column; gap: var(--space-3); }

.login__feature {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    color: rgba(255, 255, 255, .85);
    font-size: var(--text-base);
}

.login__feature-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, .12);
    display: grid;
    place-items: center;
    flex: none;
}

.login__main {
    display: grid;
    place-items: center;
    padding: var(--space-6);
    background: var(--color-background);
}

.login__form { width: min(400px, 100%); }

.login__logo {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    background: var(--color-forest);
    display: grid;
    place-items: center;
    margin-bottom: var(--space-5);
}

/* ---------------------------------------------------------------------
   Responsive
   --------------------------------------------------------------------- */

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

    .sidebar {
        position: fixed;
        inset-block: 0;
        inset-inline-start: 0;
        width: var(--sidebar-width);
        transform: translateX(100%);
        transition: transform var(--duration-base) var(--ease-out);
        box-shadow: var(--shadow-lg);
    }

    [dir="ltr"] .sidebar { transform: translateX(-100%); }

    .sidebar.is-open { transform: none; }

    .sidebar-toggle { display: inline-flex; }

    .content { padding: var(--space-4); }
    .topbar  { padding: 0 var(--space-4); }

    .wizard { grid-template-columns: 1fr; }
    .wizard__steps { flex-direction: row; overflow-x: auto; position: static; }

    .login { grid-template-columns: 1fr; }
    .login__aside { display: none; }
}

@media (max-width: 640px) {
    .stat-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
    .participant-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
    .bar-row { grid-template-columns: 90px 1fr 52px; }
    .page-head__actions { width: 100%; }
    .page-head__actions .btn { flex: 1; }
}

.scrim {
    position: fixed;
    inset: 0;
    background: rgba(12, 24, 20, .5);
    z-index: 35;
    animation: fade-in var(--duration-fast) var(--ease-out);
}

@media (min-width: 1025px) { .scrim { display: none; } }

/* Demographic chips on a participant card. Only rendered when the visitor
   answered those steps, so the card keeps its height when they are off. */
.participant-card__demo {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.participant-card__nat,
.participant-card__gender {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    background: rgba(15, 76, 63, .07);
    border: 1px solid rgba(15, 76, 63, .12);
    font-size: 12px;
    font-weight: 600;
    color: var(--color-forest);
    white-space: nowrap;
}

.participant-card__nat span[aria-hidden] {
    font-size: 14px;
    line-height: 1;
    font-family: "Segoe UI Emoji", "Noto Color Emoji", "Apple Color Emoji", sans-serif;
}

/* Nationality lists run long at a real event — scroll inside the card instead
   of stretching the page. */
.bar-chart--scroll {
    max-height: 340px;
    overflow-y: auto;
    padding-inline-end: 4px;
}

.nat-flag {
    font-family: "Segoe UI Emoji", "Noto Color Emoji", "Apple Color Emoji", sans-serif;
    margin-inline-end: 6px;
}

/* ---------------------------------------------------------------------
   Artwork upload slot
   --------------------------------------------------------------------- */

.asset-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Checkerboard: most of this artwork is transparent, and against a flat white
   card a transparent logo is indistinguishable from a broken one. */
.asset-field__preview {
    display: grid;
    place-items: center;
    min-height: 92px;
    padding: 10px;
    border-radius: var(--radius-md);
    border: 1px dashed rgba(15, 76, 63, .22);
    background-color: #fff;
    background-image:
        linear-gradient(45deg, rgba(15, 76, 63, .06) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(15, 76, 63, .06) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(15, 76, 63, .06) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(15, 76, 63, .06) 75%);
    background-size: 16px 16px;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}

.asset-field__preview img {
    max-height: 72px;
    max-width: 100%;
    object-fit: contain;
}

.asset-field__empty {
    color: var(--color-text-faint);
    font-size: var(--text-sm);
}

.asset-field__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.asset-field.is-busy {
    opacity: .55;
    pointer-events: none;
}

/* A pinned participant is called out in the list so it is obvious which photo
   is holding a slot permanently. */
.participant-card.is-pinned { outline: 2px solid var(--color-gold); }

#admin-upload.is-busy { opacity: .55; pointer-events: none; }

/* Nine-square stand-in for the map, for choosing where a pinned photo sits.
   Laid out right-to-left to match the wall, so "أعلى اليمين" is top-right on
   screen as well as in the label. */
.anchor-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    margin-bottom: 8px;
    direction: rtl;
}

.anchor-grid__cell {
    padding: 10px 4px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    background: var(--color-surface-alt);
    font-size: 11px;
    font-weight: 600;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: background var(--duration-fast) var(--ease-out),
                border-color var(--duration-fast) var(--ease-out);
}

.anchor-grid__cell:hover { background: var(--color-surface-sunk); }

.anchor-grid__cell.is-selected,
.btn.is-selected {
    border-color: var(--color-emerald);
    background: color-mix(in srgb, var(--color-emerald) 14%, transparent);
    color: var(--color-forest);
}
