/* ==========================================================================
   Keel admin
   Same Blueprint Noir language as the site: ink chrome, cool paper canvas,
   one engineering blue, amber for anything unfinished.
   ========================================================================== */

:root {
    --ink: #0e1116;
    --ink-2: #161b24;
    --ink-3: #1f2733;
    --paper: #f2f4f7;
    --surface: #ffffff;
    --line: #e0e4ea;
    --line-strong: #c4cbd6;
    --muted: #626d7d;
    --brand: #1f5eff;
    --brand-deep: #0a2a7a;
    --brand-wash: #eaf0ff;
    --amber: #b7791f;
    --amber-wash: #fdf3dd;
    --ok: #0b8a5f;
    --ok-wash: #e6f6ef;
    --danger: #c22b1c;
    --danger-wash: #fdecea;

    --sans: 'Archivo', system-ui, sans-serif;
    --ui: 'Inter', system-ui, -apple-system, sans-serif;
    --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
    --rail: 264px;
}

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--ui);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--sans); font-weight: 700; letter-spacing: -0.03em; margin: 0; line-height: 1.15; }
p { margin: 0 0 1em; }
a { color: var(--brand-deep); }
img { max-width: 100%; display: block; }

:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 3px; }
::selection { background: #ffcf3d; color: var(--ink); }

.sr-only {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap;
}

/* ------------------------------------------------------------------ shell */

.app { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); min-height: 100vh; }

/* ------------------------------------------------------------------- rail */

.rail {
    background: var(--ink);
    color: #aeb8c7;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    position: relative;
}
.rail::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 26px 26px;
    pointer-events: none;
}
.rail > * { position: relative; }

.rail__head {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 1.35rem 1.4rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.rail__mark { font-family: var(--sans); font-weight: 800; font-size: 1.1rem; color: #fff; letter-spacing: -0.04em; }
.rail__sub { font-size: 0.75rem; color: #7d8798; }

.rail__group { padding: 1.1rem 0.85rem 0; }
.rail__label {
    font-size: 0.7rem;
    font-weight: 600;
    color: #6c7686;
    padding: 0 0.55rem 0.5rem;
    letter-spacing: 0.02em;
}

.rail__link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.6rem 0.6rem;
    border-radius: 6px;
    color: #b7c1d0;
    text-decoration: none;
    font-size: 0.925rem;
    transition: background 0.2s var(--ease), color 0.2s var(--ease), transform 0.2s var(--ease);
}
.rail__link svg { flex: none; opacity: 0.75; }
.rail__link:hover { background: rgba(255, 255, 255, 0.06); color: #fff; transform: translateX(2px); }
.rail__link.is-on { background: rgba(31, 94, 255, 0.16); color: #fff; }
.rail__link.is-on svg { opacity: 1; color: #7fa6ff; }
.rail__link.is-on::before {
    content: '';
    position: absolute;
    left: -0.85rem;
    top: 50%;
    width: 3px;
    height: 22px;
    background: var(--brand);
    border-radius: 0 3px 3px 0;
    transform: translateY(-50%) scaleY(0);
    animation: rail-mark 0.35s var(--ease) forwards;
}
@keyframes rail-mark { to { transform: translateY(-50%) scaleY(1); } }

.rail__count {
    margin-left: auto;
    background: var(--brand);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.1rem 0.42rem;
    border-radius: 999px;
}

.rail__foot {
    margin-top: auto;
    padding: 1rem 0.95rem 1.2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.who { display: flex; align-items: center; gap: 0.65rem; padding: 0.35rem 0.4rem 0.75rem; }
.who__name { color: #fff; font-size: 0.9rem; font-weight: 600; }
.who__role { font-size: 0.75rem; color: #7d8798; }

.avatar {
    width: 2rem; height: 2rem;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    display: grid;
    place-items: center;
    font-family: var(--sans);
    font-size: 0.75rem;
    font-weight: 700;
    flex: none;
}
.avatar--lg { width: 2.8rem; height: 2.8rem; font-size: 0.95rem; }

/* ------------------------------------------------------------------- main */

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

.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(242, 244, 247, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
    padding: 1rem clamp(1rem, 3vw, 2rem);
    display: flex;
    align-items: center;
    gap: 1rem;
}
.topbar__title { font-size: 1.35rem; }
.topbar__actions { margin-left: auto; display: flex; align-items: center; gap: 0.6rem; }
.topbar__link { font-size: 0.9rem; color: var(--muted); text-decoration: none; }
.topbar__link:hover { color: var(--ink); }

.canvas { padding: clamp(1.25rem, 3vw, 2rem); flex: 1; }
.canvas--narrow { max-width: 1080px; }

/* ---------------------------------------------------------------- buttons */

.btn {
    --btn-bg: var(--ink);
    --btn-fg: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.62rem 1.05rem;
    background: var(--btn-bg);
    color: var(--btn-fg);
    border: 1px solid var(--btn-bg);
    border-radius: 5px;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.14s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease);
    white-space: nowrap;
}
.btn:hover { box-shadow: 0 6px 18px -8px rgba(14, 17, 22, 0.6); }
.btn:active { transform: translateY(1px); }
.btn--brand { --btn-bg: var(--brand); }
.btn--ghost { --btn-bg: transparent; --btn-fg: var(--ink); border-color: var(--line-strong); }
.btn--ghost:hover { border-color: var(--ink); box-shadow: none; background: rgba(14, 17, 22, 0.04); }
.btn--danger { --btn-bg: var(--danger); }
.btn--sm { padding: 0.4rem 0.75rem; font-size: 0.82rem; }
.btn--block { width: 100%; }

/* ----------------------------------------------------------------- panels */

.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
}
.panel__head {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.15rem;
    border-bottom: 1px solid var(--line);
}
.panel__title { font-size: 1.05rem; }
.panel__body { padding: 1.15rem; }
.panel__foot { padding: 0.9rem 1.15rem; border-top: 1px solid var(--line); background: #fafbfc; }

/* -------------------------------------------------------------- dashboard */

.tiles {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}
.tile {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 1.15rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    text-decoration: none;
    color: inherit;
    transition: transform 0.25s var(--ease), border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
    animation: tile-in 0.5s var(--ease) both;
}
.tile:nth-child(2) { animation-delay: 0.06s; }
.tile:nth-child(3) { animation-delay: 0.12s; }
.tile:nth-child(4) { animation-delay: 0.18s; }
@keyframes tile-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.tile:hover { transform: translateY(-3px); border-color: var(--line-strong); box-shadow: 0 16px 30px -24px rgba(14, 17, 22, 0.6); }

.tile--lead {
    background: var(--ink);
    border-color: var(--ink);
    color: #fff;
    position: relative;
    overflow: hidden;
}
.tile--lead::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 28px 28px;
}
.tile--lead > * { position: relative; }
.tile__label { font-size: 0.82rem; color: var(--muted); }
.tile--lead .tile__label { color: #97a2b3; }
.tile__value { font-family: var(--sans); font-size: 2.4rem; font-weight: 800; letter-spacing: -0.05em; line-height: 1; }
.tile--lead .tile__value { font-size: 3rem; }
.tile__note { font-size: 0.82rem; color: var(--muted); margin-top: auto; padding-top: 0.6rem; }
.tile--lead .tile__note { color: #8f9bad; }

.duo { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 1rem; align-items: start; }

/* ----------------------------------------------------------------- tables */

.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table th {
    text-align: left;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--muted);
    padding: 0.7rem 1.15rem;
    border-bottom: 1px solid var(--line);
    background: #fafbfc;
    white-space: nowrap;
}
.table td { padding: 0.85rem 1.15rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr { transition: background 0.15s var(--ease); animation: row-in 0.4s var(--ease) both; }
.table tbody tr:hover { background: #f7f9fc; }
.table tbody tr:last-child td { border-bottom: 0; }
@keyframes row-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.cell-main { display: flex; align-items: center; gap: 0.8rem; }
.cell-main__title { font-weight: 600; color: var(--ink); text-decoration: none; }
.cell-main__title:hover { color: var(--brand-deep); text-decoration: underline; }
.cell-main__sub { font-size: 0.8rem; color: var(--muted); }
.thumb {
    width: 3.1rem; height: 2.4rem;
    border-radius: 4px;
    background: var(--ink);
    overflow: hidden;
    flex: none;
    position: relative;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .art { position: absolute; inset: 0; width: 100%; height: 100%; }

.rowactions { display: flex; gap: 0.4rem; justify-content: flex-end; }

/* ------------------------------------------------------------------ pills */

.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    white-space: nowrap;
}
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill--live { background: var(--ok-wash); color: var(--ok); }
.pill--draft { background: var(--amber-wash); color: var(--amber); }
.pill--new { background: var(--brand-wash); color: var(--brand-deep); }
.pill--muted { background: #eef1f5; color: var(--muted); }
.pill--admin { background: var(--brand-wash); color: var(--brand-deep); }

/* ------------------------------------------------------------------ forms */

.form-grid { display: grid; grid-template-columns: minmax(0, 1fr) 20rem; gap: 1rem; align-items: start; }

.field { display: grid; gap: 0.35rem; margin-bottom: 1.05rem; }
.field:last-child { margin-bottom: 0; }
.field > label { font-size: 0.85rem; font-weight: 600; }
.field input[type='text'],
.field input[type='email'],
.field input[type='password'],
.field input[type='number'],
.field input[type='search'],
.field select,
.field textarea {
    font: inherit;
    font-size: 0.95rem;
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--line-strong);
    border-radius: 5px;
    background: var(--surface);
    color: var(--ink);
    transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.field textarea { min-height: 8rem; resize: vertical; line-height: 1.6; }
.field textarea.is-tall { min-height: 26rem; font-size: 0.95rem; }
.field input:focus, .field select:focus, .field textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-wash);
}
.field__hint { font-size: 0.78rem; color: var(--muted); }
.field__error { font-size: 0.8rem; color: var(--danger); }
.field--bad input, .field--bad textarea, .field--bad select { border-color: var(--danger); }
.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.editor__bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    padding: 0.45rem;
    border: 1px solid var(--line-strong);
    border-bottom: 0;
    border-radius: 5px 5px 0 0;
    background: #fafbfc;
}
.editor__bar + textarea { border-radius: 0 0 5px 5px; }
.editor__btn {
    font: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.28rem 0.6rem;
    border: 1px solid transparent;
    border-radius: 4px;
    background: none;
    color: var(--muted);
    cursor: pointer;
    transition: all 0.15s var(--ease);
}
.editor__btn:hover { background: var(--surface); border-color: var(--line); color: var(--ink); }

.drop {
    border: 1px dashed var(--line-strong);
    border-radius: 6px;
    padding: 1rem;
    text-align: center;
    background: #fafbfc;
    transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
    cursor: pointer;
    position: relative;
}
.drop:hover, .drop.is-over { border-color: var(--brand); background: var(--brand-wash); }
.drop input[type='file'] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop__text { font-size: 0.85rem; color: var(--muted); }
.preview { margin-top: 0.7rem; border-radius: 5px; overflow: hidden; border: 1px solid var(--line); }
.preview img { width: 100%; height: 9rem; object-fit: cover; }

.check { display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; }

.sticky-foot {
    position: sticky;
    bottom: 0;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.85rem 1.15rem;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    border-top: 1px solid var(--line);
    border-radius: 0 0 8px 8px;
}
.sticky-foot__note { margin-left: auto; font-size: 0.8rem; color: var(--muted); }

/* --------------------------------------------------------------- filters */

.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.tab {
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    color: var(--muted);
    padding: 0.4rem 0.8rem;
    border: 1px solid transparent;
    border-radius: 999px;
    transition: all 0.2s var(--ease);
}
.tab:hover { color: var(--ink); border-color: var(--line-strong); }
.tab.is-on { background: var(--ink); color: #fff; border-color: var(--ink); }
.toolbar form { margin-left: auto; display: flex; gap: 0.4rem; }
.toolbar input[type='search'] {
    font: inherit;
    font-size: 0.88rem;
    padding: 0.42rem 0.7rem;
    border: 1px solid var(--line-strong);
    border-radius: 5px;
    min-width: 15rem;
    background: var(--surface);
}

/* ------------------------------------------------------------------ pager */

.pager { display: flex; gap: 0.35rem; padding: 1rem 0 0; }
.pager a, .pager span {
    min-width: 2.1rem; height: 2.1rem;
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0 0.55rem;
    border: 1px solid var(--line-strong);
    border-radius: 5px;
    font-size: 0.85rem;
    text-decoration: none;
    color: var(--ink);
    background: var(--surface);
}
.pager a:hover { border-color: var(--ink); }
.pager .is-current { background: var(--ink); color: #fff; border-color: var(--ink); }
.pager .is-off { opacity: 0.45; }

/* ------------------------------------------------------------------ empty */

.empty {
    border: 1px dashed var(--line-strong);
    border-radius: 8px;
    padding: 3rem 2rem;
    text-align: center;
    background: var(--surface);
}
.empty__title { font-size: 1.15rem; margin-bottom: 0.4rem; }
.empty__text { color: var(--muted); font-size: 0.92rem; margin-bottom: 1.2rem; }

/* ----------------------------------------------------------------- toasts */

.toasts {
    position: fixed;
    right: 1.1rem;
    bottom: 1.1rem;
    z-index: 200;
    display: grid;
    gap: 0.5rem;
    max-width: min(24rem, calc(100vw - 2rem));
}
.toast {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    background: var(--ink);
    color: #fff;
    padding: 0.8rem 0.9rem;
    border-radius: 7px;
    box-shadow: 0 20px 40px -20px rgba(14, 17, 22, 0.8);
    font-size: 0.9rem;
    animation: toast-in 0.4s var(--ease) both;
    position: relative;
    overflow: hidden;
}
.toast::after {
    content: '';
    position: absolute;
    left: 0; bottom: 0;
    height: 2px;
    width: 100%;
    background: var(--brand);
    transform-origin: left;
    animation: toast-timer 5s linear forwards;
}
.toast--bad::after { background: #ff6b5e; }
.toast--bad { background: #3a1512; }
.toast.is-out { animation: toast-out 0.3s var(--ease) forwards; }
.toast__x { margin-left: auto; background: none; border: 0; color: inherit; opacity: 0.6; cursor: pointer; font-size: 1rem; line-height: 1; }
.toast__x:hover { opacity: 1; }
@keyframes toast-in { from { opacity: 0; transform: translateY(14px) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(20px); } }
@keyframes toast-timer { to { transform: scaleX(0); } }

/* ------------------------------------------------------------------ modal */

.modal {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: rgba(14, 17, 22, 0.55);
    backdrop-filter: blur(3px);
    animation: fade 0.2s var(--ease) both;
}
.modal[hidden] { display: none; }
.modal__box {
    background: var(--surface);
    border-radius: 10px;
    padding: 1.4rem;
    width: min(28rem, 100%);
    animation: pop 0.28s var(--ease) both;
}
.modal__title { font-size: 1.2rem; margin-bottom: 0.5rem; }
.modal__text { color: var(--muted); font-size: 0.92rem; }
.modal__actions { display: flex; gap: 0.5rem; justify-content: flex-end; margin-top: 1.2rem; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(0.96); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------------ login */

.gate {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    background: var(--paper);
}
.gate__art {
    background: var(--ink);
    color: #fff;
    padding: clamp(2rem, 5vw, 4rem);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}
.gate__art::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
    background-size: 30px 30px;
}
.gate__art::after {
    content: '';
    position: absolute;
    width: 30rem; height: 30rem;
    right: -8rem; bottom: -10rem;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(31, 94, 255, 0.45), transparent 65%);
    animation: drift 20s ease-in-out infinite alternate;
}
@keyframes drift { from { transform: none; } to { transform: translate(-8%, -6%) scale(1.15); } }
.gate__art > * { position: relative; z-index: 2; }
.gate__mark { font-family: var(--sans); font-weight: 800; font-size: 1.2rem; letter-spacing: -0.04em; }
.gate__line { font-family: var(--sans); font-size: clamp(1.8rem, 3.4vw, 2.8rem); font-weight: 700; letter-spacing: -0.045em; max-width: 16ch; line-height: 1.05; }
.gate__note { color: #9aa5b8; font-size: 0.9rem; max-width: 34ch; }

.gate__form { display: grid; place-items: center; padding: clamp(1.5rem, 4vw, 3rem); }
.gate__inner { width: min(23rem, 100%); animation: tile-in 0.5s var(--ease) both; }
.gate__title { font-size: 1.6rem; margin-bottom: 0.4rem; }
.gate__sub { color: var(--muted); font-size: 0.92rem; margin-bottom: 1.6rem; }
.gate__hint {
    margin-top: 1.4rem;
    padding: 0.75rem 0.85rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 6px;
    font-size: 0.82rem;
    color: var(--muted);
}
.gate__hint code { background: #eef1f5; padding: 0.05rem 0.3rem; border-radius: 3px; font-size: 0.95em; }

.alert {
    padding: 0.75rem 0.9rem;
    border-radius: 6px;
    font-size: 0.88rem;
    margin-bottom: 1rem;
    border-left: 3px solid var(--danger);
    background: var(--danger-wash);
    color: #7d1f14;
    animation: tile-in 0.35s var(--ease) both;
}
.alert--ok { border-left-color: var(--ok); background: var(--ok-wash); color: #0a5c41; }

/* ---------------------------------------------------------------- enquiry */

.message {
    font-size: 1.02rem;
    line-height: 1.7;
    white-space: pre-wrap;
    background: #fafbfc;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 1.1rem;
}
.deflist { display: grid; gap: 0.85rem; }
.deflist__row { display: grid; gap: 0.15rem; }
.deflist__key { font-size: 0.78rem; color: var(--muted); }
.deflist__val { font-size: 0.95rem; }

/* ------------------------------------------------------------- responsive */

@media (max-width: 1100px) {
    .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .duo, .form-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 860px) {
    .app { grid-template-columns: minmax(0, 1fr); }
    .rail {
        position: fixed;
        z-index: 120;
        width: var(--rail);
        transform: translateX(-100%);
        transition: transform 0.3s var(--ease);
    }
    .rail.is-open { transform: none; box-shadow: 0 0 60px rgba(0, 0, 0, 0.4); }
    .rail__burger { display: inline-flex; }
    .gate { grid-template-columns: minmax(0, 1fr); }
    .gate__art { display: none; }
    .tiles { grid-template-columns: minmax(0, 1fr); }
    .table--stack thead { display: none; }
    .table--stack tr { display: grid; gap: 0.3rem; padding: 0.9rem 1rem; }
    .table--stack td { border: 0; padding: 0; }
    .table--stack tbody tr { border-bottom: 1px solid var(--line); }
}

.rail__burger { display: none; }
@media (max-width: 860px) { .rail__burger { display: inline-flex; } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .toast::after { animation: none; }
}

/* ------------------------------------------------------- dashboard lists */

.cell-main__sub { display: block; }
.push { margin-left: auto; }
.stack { display: grid; gap: 0.5rem; }

.minilist { display: grid; gap: 0.95rem; }
.minilist__item {
    display: flex;
    gap: 0.7rem;
    align-items: flex-start;
    text-decoration: none;
    color: inherit;
    min-width: 0;
    border-radius: 6px;
    transition: transform 0.2s var(--ease);
}
.minilist__item:hover { transform: translateX(2px); }
.minilist__item:hover .minilist__name { color: var(--brand-deep); }
.minilist__body { min-width: 0; flex: 1; }
.minilist__top { display: flex; align-items: center; gap: 0.45rem; }
.minilist__name { font-size: 0.9rem; font-weight: 600; }
.minilist__text {
    display: block;
    font-size: 0.85rem;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.muted { color: var(--muted); }
.note-block { font-size: 0.88rem; color: var(--muted); }
.note-block p:last-child { margin-bottom: 0; }

/* ==========================================================================
   Appearance: palette editor and live preview
   ========================================================================== */

.swatch {
    display: grid;
    grid-template-columns: 2.6rem minmax(0, 1fr) 7.2rem;
    gap: 0.9rem;
    align-items: center;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--line);
}
.swatch:last-of-type { border-bottom: 0; }

/* The native picker, cropped to a round chip. */
.swatch__dab {
    width: 2.6rem;
    height: 2.6rem;
    padding: 0;
    border: 1px solid var(--line-strong);
    border-radius: 50%;
    background: none;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.swatch__dab:hover { transform: scale(1.08); box-shadow: 0 4px 14px -4px rgba(0, 0, 0, 0.4); }
.swatch__dab::-webkit-color-swatch-wrapper { padding: 0; }
.swatch__dab::-webkit-color-swatch { border: none; border-radius: 50%; }
.swatch__dab::-moz-color-swatch { border: none; border-radius: 50%; }

.swatch__body { min-width: 0; }
.swatch__label { display: block; font-size: 0.9rem; font-weight: 600; }
.swatch__hint { display: block; font-size: 0.79rem; color: var(--muted); }

.swatch__hex {
    font: inherit;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.85rem;
    text-transform: lowercase;
    padding: 0.5rem 0.6rem;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    background: var(--surface);
    color: var(--ink);
    text-align: center;
}
.swatch__hex:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-wash); }
.swatch__hex.is-bad { border-color: var(--danger); color: var(--danger); }

/* contrast warnings */
.warnbox { display: grid; gap: 0.5rem; margin-top: 1rem; }
.warn {
    display: flex;
    gap: 0.55rem;
    align-items: flex-start;
    font-size: 0.84rem;
    padding: 0.65rem 0.8rem;
    border-radius: 8px;
    border-left: 3px solid var(--amber);
    background: var(--amber-wash);
    color: #7a5310;
}
.warn--bad { border-left-color: var(--danger); background: var(--danger-wash); color: #7d1f14; }
.warn b { font-weight: 600; }

/* presets */
.presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.6rem; }
.preset {
    display: grid;
    gap: 0.55rem;
    padding: 0.75rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.preset:hover { border-color: var(--ink); transform: translateY(-2px); }
.preset__chips { display: flex; gap: 3px; }
.preset__chips i { width: 100%; height: 1.5rem; border-radius: 4px; border: 1px solid rgba(0, 0, 0, 0.12); }
.preset__name { font-size: 0.85rem; font-weight: 600; }

/* ------------------------------------------------------------- the mock-up */

/* Same token names as the site, so the preview cannot drift from reality. */
.mock {
    --m-bg: #04070a;
    --m-surface: #080d12;
    --m-text: #e9f2ee;
    --m-muted: #8fa3ad;
    --m-accent: #35f0a0;
    --m-accent2: #37d6ff;
    --m-highlight: #ffc24b;
    --m-on-accent: #04070a;
    --m-edge: color-mix(in srgb, var(--m-text) 14%, transparent);

    background: var(--m-bg);
    color: var(--m-text);
    padding: 0.9rem;
    display: grid;
    gap: 0.85rem;
    font-size: 0.78rem;
    overflow: hidden;
}

.mock__bar { display: flex; align-items: center; gap: 0.6rem; padding-bottom: 0.7rem; border-bottom: 1px solid var(--m-edge); }
.mock__brand { font-weight: 800; letter-spacing: -0.03em; }
.mock__brand em { font-style: normal; color: var(--m-accent); }
.mock__nav { display: flex; gap: 0.4rem; margin-left: auto; }
.mock__nav i { width: 1.4rem; height: 3px; border-radius: 2px; background: var(--m-muted); opacity: 0.5; }
.mock__cta {
    background: var(--m-accent);
    color: var(--m-on-accent);
    border-radius: 100px;
    padding: 0.24rem 0.6rem;
    font-size: 0.68rem;
    font-weight: 700;
}

.mock__hero { display: grid; gap: 0.5rem; }
.mock__tag {
    justify-self: start;
    font-size: 0.62rem;
    color: var(--m-accent);
    border: 1px solid color-mix(in srgb, var(--m-accent) 35%, transparent);
    background: color-mix(in srgb, var(--m-accent) 9%, transparent);
    border-radius: 100px;
    padding: 0.15rem 0.5rem;
}
.mock__h { font-size: 1.15rem; line-height: 1.05; letter-spacing: -0.035em; margin: 0; font-weight: 800; }
.mock__h em {
    font-style: normal;
    background: linear-gradient(100deg, var(--m-accent), var(--m-accent2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.mock__p { color: var(--m-muted); margin: 0; font-size: 0.72rem; }
.mock__row { display: flex; gap: 0.4rem; }
.mock__btn {
    background: var(--m-accent);
    color: var(--m-on-accent);
    border-radius: 100px;
    padding: 0.3rem 0.7rem;
    font-size: 0.68rem;
    font-weight: 700;
}
.mock__btn--line { background: none; color: var(--m-text); border: 1px solid var(--m-edge); font-weight: 500; }

.mock__cards { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.mock__card {
    background: var(--m-surface);
    border: 1px solid var(--m-edge);
    border-radius: 9px;
    padding: 0.6rem;
    display: grid;
    gap: 0.28rem;
}
.mock__icon {
    width: 1.5rem; height: 1.5rem;
    border-radius: 6px;
    background: color-mix(in srgb, var(--m-accent) 16%, transparent);
    border: 1px solid color-mix(in srgb, var(--m-accent) 34%, transparent);
}
.mock__icon--2 { background: color-mix(in srgb, var(--m-accent2) 16%, transparent); border-color: color-mix(in srgb, var(--m-accent2) 34%, transparent); }
.mock__ct { font-weight: 700; font-size: 0.74rem; }
.mock__cp { color: var(--m-muted); font-size: 0.67rem; }

.mock__stack { position: relative; height: 4.6rem; }
.mock__layer {
    position: absolute;
    left: calc(14% + var(--i) * 9%);
    top: calc(var(--i) * 1.05rem);
    width: 62%;
    height: 2.1rem;
    border-radius: 7px;
    border: 1px solid var(--m-edge);
    background: linear-gradient(135deg, color-mix(in srgb, var(--m-surface) 82%, var(--m-text)), var(--m-surface));
    transform: skewX(-24deg) skewY(6deg);
}
.mock__layer--hot {
    border-color: color-mix(in srgb, var(--m-accent) 62%, transparent);
    box-shadow: 0 0 14px color-mix(in srgb, var(--m-accent) 40%, transparent);
}

@media (max-width: 700px) {
    .swatch { grid-template-columns: 2.4rem minmax(0, 1fr); }
    .swatch__hex { grid-column: 2; }
}
