/* =====================================================================
   M3U EDITOR — "Broadsheet"
   Warm editorial interface. Serif display, grotesk UI, mono data.
   Light = parchment, Dark = inked paper. Nothing default here.
   ===================================================================== */

/* ---- Type ---- */
@import url('https://fonts.googleapis.com/css2?family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,500;0,6..72,600;1,6..72,400;1,6..72,500&family=Hanken+Grotesk:wght@400;500;600;700&family=Spline+Sans+Mono:wght@400;500;600&display=swap');

/* ---- Tokens: LIGHT (parchment) ---- */
:root {
    --font-display: "Newsreader", Georgia, "Times New Roman", serif;
    --font-sans: "Hanken Grotesk", -apple-system, system-ui, sans-serif;
    --font-mono: "Spline Sans Mono", ui-monospace, "SFMono-Regular", monospace;

    --bg:          #e9e0cd;
    --surface:     #f6f0e3;
    --surface-2:   #fbf6ec;
    --surface-sink:#efe7d6;
    --ink:         #29241d;
    --ink-soft:    #5a5044;
    --muted:       #8b7f6c;
    --line:        #d8cbb2;
    --line-soft:   #e4d9c4;
    --line-strong: #c6b598;
    --accent:      #ad4f2b;
    --accent-2:    #8f4022;
    --accent-soft: rgba(173,79,43,0.12);
    --good:        #5d7546;
    --good-soft:   rgba(93,117,70,0.14);
    --bad:         #a5382b;
    --bad-soft:    rgba(165,56,43,0.12);
    --warn:        #9c6a1f;
    --warn-soft:   rgba(156,106,31,0.14);
    --shadow:      0 1px 0 rgba(41,36,29,0.04), 0 8px 30px -18px rgba(41,36,29,0.35);
    --rail-w:      256px;
    --rail-w-col:  74px;
}

/* ---- Tokens: DARK (inked paper) ---- */
[data-theme="dark"] {
    --bg:          #1b1813;
    --surface:     #242019;
    --surface-2:   #2b271f;
    --surface-sink:#201d16;
    --ink:         #ece1cd;
    --ink-soft:    #c1b6a1;
    --muted:       #8f8471;
    --line:        #38332a;
    --line-soft:   #302b23;
    --line-strong: #4a4335;
    --accent:      #d17e55;
    --accent-2:    #e0966f;
    --accent-soft: rgba(209,126,85,0.16);
    --good:        #93ae76;
    --good-soft:   rgba(147,174,118,0.16);
    --bad:         #d4785f;
    --bad-soft:    rgba(212,120,95,0.16);
    --warn:        #d3a659;
    --warn-soft:   rgba(211,166,89,0.16);
    --shadow:      0 1px 0 rgba(0,0,0,0.2), 0 12px 40px -20px rgba(0,0,0,0.7);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--ink);
    min-height: 100vh;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    transition: background 0.3s ease, color 0.3s ease;
}

/* faint paper grain via layered gradients */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.5;
    background:
        radial-gradient(circle at 15% 12%, rgba(173,79,43,0.05), transparent 45%),
        radial-gradient(circle at 88% 90%, rgba(93,117,70,0.05), transparent 45%);
}

::selection { background: var(--accent-soft); color: var(--accent-2); }

a { color: var(--accent-2); }

/* =====================================================================
   SHELL + RAIL (collapsible sidebar)
   ===================================================================== */
.shell {
    display: grid;
    grid-template-columns: var(--rail-w) 1fr;
    min-height: 100vh;
    position: relative;
    z-index: 1;
    transition: grid-template-columns 0.28s cubic-bezier(.4,0,.2,1);
}
.shell.collapsed { grid-template-columns: var(--rail-w-col) 1fr; }

.rail {
    background: var(--surface);
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
}

.rail-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 22px 20px 20px;
}

.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }

.brand-mark {
    width: 34px; height: 34px;
    flex-shrink: 0;
    border: 1.5px solid var(--ink);
    border-radius: 3px;
    display: grid;
    place-items: center;
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 600;
    background: var(--ink);
    color: var(--surface);
    transform: rotate(-3deg);
}

.brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.1; }
.brand-title {
    font-family: var(--font-display);
    font-size: 19px;
    font-weight: 600;
    letter-spacing: 0.2px;
    white-space: nowrap;
}
.brand-sub {
    font-family: var(--font-mono);
    font-size: 9.5px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--muted);
    margin-top: 3px;
    white-space: nowrap;
}

.rail-toggle {
    flex-shrink: 0;
    width: 30px; height: 30px;
    display: grid; place-items: center;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--surface-2);
    color: var(--ink-soft);
    cursor: pointer;
    transition: all 0.15s;
}
.rail-toggle:hover { border-color: var(--line-strong); color: var(--ink); }
.rail-toggle svg { width: 16px; height: 16px; }

/* nav */
.nav { display: flex; flex-direction: column; gap: 2px; padding: 8px 12px; margin-top: 4px; }
.nav-section {
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    color: var(--muted);
    padding: 14px 12px 6px;
    white-space: nowrap;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 9px 12px;
    border: none;
    background: none;
    color: var(--ink-soft);
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 5px;
    text-align: left;
    width: 100%;
    position: relative;
    transition: color 0.14s, background 0.14s;
    white-space: nowrap;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; stroke-width: 1.6; }
.nav-item:hover { color: var(--ink); background: var(--surface-sink); }
.nav-item.active { color: var(--accent-2); background: var(--accent-soft); }
.nav-item.active::before {
    content: "";
    position: absolute;
    left: -12px; top: 50%;
    transform: translateY(-50%);
    width: 3px; height: 20px;
    background: var(--accent);
    border-radius: 0 3px 3px 0;
}
.nav-item.danger { color: var(--muted); }
.nav-item.danger:hover { color: var(--bad); background: var(--bad-soft); }

.rail-foot { margin-top: auto; padding: 12px; border-top: 1px solid var(--line-soft); }

/* collapsed state */
.shell.collapsed .brand-text,
.shell.collapsed .brand-sub,
.shell.collapsed .nav-item .label,
.shell.collapsed .nav-section { opacity: 0; pointer-events: none; }
.shell.collapsed .rail-top { flex-direction: column-reverse; gap: 16px; padding: 18px 0; }
.shell.collapsed .nav-item { justify-content: center; padding: 11px; }
.shell.collapsed .nav-item.active::before { left: 0; }
.shell.collapsed .nav { align-items: center; padding: 8px; }
.shell.collapsed .nav-section { height: 10px; padding: 8px 0 0; }

/* =====================================================================
   MAIN + MASTHEAD
   ===================================================================== */
.main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    max-height: 100vh;
    overflow-y: auto;
}

.masthead {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    padding: 34px 40px 20px;
    border-bottom: 1.5px solid var(--ink);
    position: sticky;
    top: 0;
    background: linear-gradient(var(--bg) 72%, rgba(233,224,205,0));
    z-index: 20;
}
[data-theme="dark"] .masthead { background: linear-gradient(var(--bg) 72%, rgba(27,24,19,0)); }

.masthead-left { min-width: 0; }
.kicker {
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.kicker .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--accent); }
.page-title {
    font-family: var(--font-display);
    font-size: 40px;
    font-weight: 500;
    line-height: 1;
    letter-spacing: -0.3px;
}
.page-title em { font-style: italic; color: var(--accent-2); font-weight: 500; }

.masthead-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.icon-btn {
    width: 38px; height: 38px;
    display: grid; place-items: center;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: var(--surface);
    color: var(--ink-soft);
    cursor: pointer;
    transition: all 0.15s;
}
.icon-btn:hover { border-color: var(--line-strong); color: var(--ink); }
.icon-btn svg { width: 18px; height: 18px; stroke-width: 1.7; }

.view { padding: 26px 40px 60px; flex: 1; }

/* =====================================================================
   CARDS
   ===================================================================== */
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 22px;
    margin-bottom: 22px;
    box-shadow: var(--shadow);
}
.card.flush { padding: 0; overflow: hidden; }

.card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.card-head.padded { padding: 20px 22px 0; margin-bottom: 14px; }
.card-title {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 500;
    display: flex;
    align-items: baseline;
    gap: 10px;
}
.card-title .count {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--muted);
    letter-spacing: 0.5px;
}
.section-lead { color: var(--ink-soft); font-size: 13.5px; margin-bottom: 16px; max-width: 62ch; }

/* =====================================================================
   STATS  — editorial numeral cards
   ===================================================================== */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0;
    border: 1px solid var(--line);
    border-radius: 7px;
    overflow: hidden;
    margin-bottom: 24px;
    background: var(--surface);
    box-shadow: var(--shadow);
}
.stat {
    padding: 22px 24px;
    border-right: 1px solid var(--line-soft);
    position: relative;
}
.stat:last-child { border-right: none; }
.stat .label {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 7px;
}
.stat .label svg { width: 13px; height: 13px; stroke-width: 1.8; color: var(--accent); }
.stat .value {
    font-family: var(--font-display);
    font-size: 46px;
    font-weight: 500;
    line-height: 1;
    margin-top: 12px;
    letter-spacing: -1px;
    font-variant-numeric: tabular-nums;
}

/* =====================================================================
   BUTTONS
   ===================================================================== */
.btn {
    font-family: var(--font-sans);
    padding: 9px 16px;
    border-radius: 5px;
    border: 1px solid var(--line-strong);
    background: var(--surface-2);
    color: var(--ink);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    white-space: nowrap;
}
.btn svg { width: 15px; height: 15px; stroke-width: 1.9; }
.btn:hover { border-color: var(--ink-soft); background: var(--surface-sink); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fbf6ec; }
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn-danger { background: transparent; border-color: var(--bad); color: var(--bad); }
.btn-danger:hover { background: var(--bad); color: #fbf6ec; }
.btn-good { background: transparent; border-color: var(--good); color: var(--good); }
.btn-good:hover { background: var(--good); color: #fbf6ec; }
.btn-sm { padding: 5px 11px; font-size: 12px; border-radius: 4px; }
.btn-ghost { background: none; border-color: transparent; color: var(--ink-soft); }
.btn-ghost:hover { background: var(--surface-sink); border-color: var(--line); color: var(--ink); }

/* =====================================================================
   FORMS
   ===================================================================== */
.field { margin-bottom: 16px; }
.field label {
    display: block;
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 7px;
}
.form-control {
    font-family: var(--font-sans);
    width: 100%;
    padding: 10px 13px;
    background: var(--surface-2);
    border: 1px solid var(--line-strong);
    border-radius: 5px;
    color: var(--ink);
    font-size: 14px;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.form-control::placeholder { color: var(--muted); }
.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%238b7f6c' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 11px center;
    padding-right: 34px;
    cursor: pointer;
}
[data-theme="dark"] select.form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%238f8471' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}

/* checkbox */
.check {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-size: 13.5px;
    cursor: pointer;
    color: var(--ink-soft);
    user-select: none;
}
.check input { position: absolute; opacity: 0; width: 0; height: 0; }
.check .box {
    width: 18px; height: 18px;
    border: 1.5px solid var(--line-strong);
    border-radius: 4px;
    background: var(--surface-2);
    display: grid;
    place-items: center;
    transition: all 0.15s;
    flex-shrink: 0;
}
.check .box svg { width: 12px; height: 12px; opacity: 0; stroke: #fbf6ec; stroke-width: 3; }
.check input:checked + .box { background: var(--accent); border-color: var(--accent); }
.check input:checked + .box svg { opacity: 1; }
.check input:focus-visible + .box { box-shadow: 0 0 0 3px var(--accent-soft); }

/* =====================================================================
   TOOLBAR
   ===================================================================== */
.toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.toolbar .form-control { width: auto; }
.toolbar .grow { flex: 1; min-width: 200px; }
.toolbar-sep { flex: 1; }
.hint { font-family: var(--font-mono); font-size: 11px; color: var(--muted); letter-spacing: 0.3px; }

.search {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 200px;
}
.search svg {
    position: absolute; left: 12px;
    width: 16px; height: 16px;
    color: var(--muted); stroke-width: 1.9;
    pointer-events: none;
}
.search .form-control { width: 100%; padding-left: 36px; }

/* =====================================================================
   TABLES
   ===================================================================== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead th {
    text-align: left;
    padding: 12px 16px;
    background: var(--surface-sink);
    border-bottom: 1.5px solid var(--line-strong);
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    white-space: nowrap;
}
tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--line-soft);
    vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background 0.12s; }
tbody tr:hover td { background: var(--surface-sink); }
td .name { font-weight: 600; }
td .sub { color: var(--muted); font-family: var(--font-mono); font-size: 12px; }
td.actions { white-space: nowrap; }
td.actions .btn { margin-left: 6px; }
td.actions .btn:first-child { margin-left: 0; }
.dash { color: var(--muted); }

.row-check { width: 42px; text-align: center; }

tr.is-hidden td { opacity: 0.55; }
tr.is-hidden td .name { text-decoration: line-through; text-decoration-color: var(--muted); }

.channel-logo {
    width: 34px; height: 34px;
    border-radius: 4px;
    object-fit: contain;
    background: var(--surface-sink);
    border: 1px solid var(--line-soft);
    padding: 2px;
}

.empty {
    text-align: center;
    color: var(--muted);
    padding: 46px 20px;
    font-family: var(--font-display);
    font-size: 18px;
    font-style: italic;
}

/* =====================================================================
   BADGES / PILLS  — editorial tags
   ===================================================================== */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 3px;
    font-family: var(--font-mono);
    font-size: 10.5px;
    font-weight: 500;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    border: 1px solid transparent;
}
.pill-good { background: var(--good-soft); color: var(--good); border-color: var(--good); }
.pill-bad { background: var(--bad-soft); color: var(--bad); border-color: var(--bad); }
.pill-warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn); }
.pill-muted { background: var(--surface-sink); color: var(--muted); border-color: var(--line-strong); }
.pill-cat {
    background: none;
    color: var(--ink-soft);
    border-color: var(--line-strong);
    text-transform: none;
    letter-spacing: 0.2px;
    font-family: var(--font-sans);
    font-size: 11.5px;
}

.livedot {
    display: inline-flex; align-items: center; gap: 7px;
    font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-soft);
    letter-spacing: 0.3px;
}
.livedot i {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--good);
    box-shadow: 0 0 0 0 var(--good-soft);
    animation: ping 2.2s infinite;
}
@keyframes ping {
    0% { box-shadow: 0 0 0 0 rgba(93,117,70,0.4); }
    70% { box-shadow: 0 0 0 7px rgba(93,117,70,0); }
    100% { box-shadow: 0 0 0 0 rgba(93,117,70,0); }
}

/* =====================================================================
   MODAL
   ===================================================================== */
.modal-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(28,24,18,0.55);
    backdrop-filter: blur(3px);
    z-index: 100;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-overlay.active { display: flex; animation: fade 0.16s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.modal {
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 9px;
    padding: 28px;
    width: 100%;
    max-width: 520px;
    max-height: 88vh;
    overflow-y: auto;
    box-shadow: 0 30px 80px -30px rgba(0,0,0,0.5);
    animation: rise 0.2s cubic-bezier(.4,0,.2,1);
}
@keyframes rise { from { transform: translateY(14px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.modal-kicker {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 6px;
}
.modal h3 {
    font-family: var(--font-display);
    font-size: 27px;
    font-weight: 500;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 14px;
}
.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid var(--line-soft);
}

/* =====================================================================
   OUTPUT / URLS
   ===================================================================== */
.url-block { margin-bottom: 18px; }
.url-block > label {
    display: block;
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 7px;
}
.url-box {
    background: var(--surface-sink);
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    padding: 13px 15px;
    font-family: var(--font-mono);
    font-size: 13px;
    word-break: break-all;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    color: var(--ink-soft);
}
.url-box code { flex: 1; color: var(--ink); }
.url-box strong { color: var(--accent-2); font-weight: 600; }

.cred-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 12px; }

/* =====================================================================
   PAGINATION
   ===================================================================== */
.pagination {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: center;
    padding: 18px;
    border-top: 1px solid var(--line-soft);
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--muted);
    letter-spacing: 0.5px;
}

/* =====================================================================
   TOAST
   ===================================================================== */
.toast-container {
    position: fixed;
    bottom: 26px; right: 26px;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-end;
}
.toast {
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-left: 3px solid var(--muted);
    border-radius: 6px;
    padding: 13px 18px;
    font-size: 13.5px;
    max-width: 380px;
    box-shadow: 0 16px 40px -18px rgba(0,0,0,0.5);
    animation: toastIn 0.24s cubic-bezier(.4,0,.2,1);
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.toast svg { width: 17px; height: 17px; flex-shrink: 0; margin-top: 1px; stroke-width: 2; }
.toast.success { border-left-color: var(--good); }
.toast.success svg { color: var(--good); }
.toast.error { border-left-color: var(--bad); }
.toast.error svg { color: var(--bad); }
.toast.info { border-left-color: var(--accent); }
.toast.info svg { color: var(--accent); }
@keyframes toastIn { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* =====================================================================
   LOADING
   ===================================================================== */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 60px;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 1px;
    text-transform: uppercase;
}
.spinner {
    width: 18px; height: 18px;
    border: 2px solid var(--line-strong);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.demo-flag {
    position: fixed;
    bottom: 26px; left: 50%;
    transform: translateX(-50%);
    z-index: 250;
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--warn);
    background: var(--warn-soft);
    border: 1px solid var(--warn);
    border-radius: 4px;
    padding: 6px 11px;
}

/* =====================================================================
   LOGIN
   ===================================================================== */
.login-wrap {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    position: relative;
    z-index: 1;
}
.login-aside {
    background: var(--ink);
    color: var(--surface);
    padding: 56px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}
.login-aside .mast {
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    opacity: 0.6;
}
.login-aside h1 {
    font-family: var(--font-display);
    font-size: 62px;
    font-weight: 500;
    line-height: 0.98;
    letter-spacing: -1px;
    max-width: 12ch;
}
.login-aside h1 em { font-style: italic; color: var(--accent-2); }
.login-aside .blurb {
    font-family: var(--font-display);
    font-size: 17px;
    font-style: italic;
    opacity: 0.75;
    max-width: 38ch;
    line-height: 1.5;
}
.login-aside .rule { height: 1px; background: rgba(255,255,255,0.14); margin: 18px 0; }

.login-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: var(--surface);
}
.login-card { width: 100%; max-width: 350px; }
.login-card .kick {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 8px;
}
.login-card h2 {
    font-family: var(--font-display);
    font-size: 32px;
    font-weight: 500;
    margin-bottom: 4px;
}
.login-card .lead { color: var(--muted); font-size: 13.5px; margin-bottom: 26px; }
.login-error {
    background: var(--bad-soft);
    border: 1px solid var(--bad);
    border-radius: 5px;
    padding: 11px 13px;
    color: var(--bad);
    font-size: 13px;
    margin-bottom: 16px;
    display: none;
    align-items: center;
    gap: 8px;
}
.login-error svg { width: 15px; height: 15px; flex-shrink: 0; }

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 900px) {
    .shell, .shell.collapsed { grid-template-columns: var(--rail-w-col) 1fr; }
    .shell .brand-text, .shell .brand-sub, .shell .nav-item .label, .shell .nav-section { opacity: 0; pointer-events: none; }
    .shell .rail-top { flex-direction: column-reverse; gap: 16px; padding: 18px 0; }
    .shell .nav-item { justify-content: center; padding: 11px; }
    .shell .nav { align-items: center; padding: 8px; }
    .masthead { padding: 24px 22px 16px; }
    .page-title { font-size: 30px; }
    .view { padding: 20px 22px 50px; }
    .field-row { grid-template-columns: 1fr; }
    .login-wrap { grid-template-columns: 1fr; }
    .login-aside { display: none; }
}
