/* ============================================================
   AI NEWS — Restrained Editorial
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400..600&family=Newsreader:ital,opsz,wght@0,6..72,400..600;1,6..72,400..500&family=JetBrains+Mono:wght@500&display=swap');

:root {
    --ink:    #15110d;
    --paper:  #faf6ec;
    --rule:   #d9d2c3;
    --muted:  #837b6f;
    --accent: #a82326;

    --font-display: 'Fraunces', Georgia, serif;
    --font-body:    'Newsreader', Georgia, serif;
    --font-mono:    'JetBrains Mono', ui-monospace, monospace;

    --measure: 64ch;
    --gutter:  clamp(1rem, 3vw, 1.75rem);
    --shell:   1080px;
}

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

html { background: var(--paper); }

body {
    font-family: var(--font-body);
    font-optical-sizing: auto;
    font-size: 17px;
    line-height: 1.6;
    color: var(--ink);
    background: var(--paper);
    min-height: 100vh;
}

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

a { color: inherit; }

/* ============================================================
   HEADER — quiet flag
   ============================================================ */

header {
    max-width: var(--shell);
    margin: 0 auto;
    padding: 1.5rem var(--gutter) 0;
}

header nav {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--rule);
}

.logo {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 1.4rem;
    line-height: 1;
    letter-spacing: -0.01em;
    text-decoration: none;
    color: var(--ink);
    font-variation-settings: "opsz" 144;
}

.nav-links {
    display: flex;
    gap: 1.25rem;
    font-size: 0.92rem;
}

.nav-links a {
    color: var(--muted);
    text-decoration: none;
    transition: color 120ms ease;
}
.nav-links a:hover { color: var(--ink); }

.tagline {
    font-style: italic;
    color: var(--muted);
    font-size: 0.95rem;
    padding: 0.85rem 0 0;
    margin-bottom: 2.25rem;
}

/* ============================================================
   MAIN
   ============================================================ */

main {
    max-width: var(--shell);
    margin: 0 auto;
    padding: 0 var(--gutter);
    min-height: 60vh;
}

/* ============================================================
   CATEGORY BAR — minimal
   ============================================================ */

.category-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
    font-size: 0.92rem;
}

.category-pill {
    text-decoration: none;
    color: var(--muted);
    padding: 0;
    border: none;
    transition: color 120ms ease;
}
.category-pill:hover { color: var(--ink); }
.category-pill.active {
    color: var(--ink);
    border-bottom: 1px solid var(--ink);
    padding-bottom: 2px;
}

/* ============================================================
   ARTICLE GRID — hairline-ruled, no cards
   ============================================================ */

.article-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    column-gap: 2.25rem;
    row-gap: 0;
    margin-bottom: 2rem;
}

.article-card {
    padding: 1.4rem 0 1.6rem;
    border-top: 1px solid var(--rule);
    background: transparent;
}

.article-card h2 {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 1.3rem;
    line-height: 1.18;
    letter-spacing: -0.012em;
    font-variation-settings: "opsz" 36;
    margin: 0.45rem 0 0.6rem;
}
.article-card h2 a {
    color: var(--ink);
    text-decoration: none;
}
.article-card:hover h2 a { color: var(--accent); }

.article-summary {
    color: var(--ink);
    font-size: 0.95rem;
    line-height: 1.55;
    margin-bottom: 0.85rem;
}

.card-category {
    display: inline-block;
    color: var(--muted);
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-decoration: none;
}
.card-category:hover { color: var(--ink); }

.article-card time {
    display: block;
    color: var(--muted);
    font-size: 0.8rem;
}

.card-list {
    display: inline-block;
    margin-top: 0.25rem;
    color: var(--muted);
    font-size: 0.78rem;
    text-decoration: none;
    border-bottom: 1px dotted var(--muted);
}
.card-list:hover { color: var(--ink); border-bottom-color: var(--ink); }

.list-header {
    margin: 1rem 0 1.5rem;
}
.list-header h1 {
    margin: 0.25rem 0 0;
}
.back-link {
    display: inline-block;
    color: var(--muted);
    font-size: 0.85rem;
    text-decoration: none;
}
.back-link:hover { color: var(--ink); }

@media (max-width: 820px) {
    .article-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
    .article-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   ARTICLE DETAIL
   ============================================================ */

.article-detail {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 240px;
    column-gap: 2.5rem;
    max-width: 980px;
    margin: 1rem auto 0;
}

.article-detail > h1 {
    grid-column: 1 / -1;
    font-family: var(--font-display);
    font-weight: 500;
    font-size: clamp(1.9rem, 3.6vw, 2.8rem);
    line-height: 1.05;
    letter-spacing: -0.02em;
    font-variation-settings: "opsz" 144;
    margin-bottom: 0.85rem;
}

.article-meta {
    grid-column: 1 / -1;
    display: flex;
    gap: 1.25rem;
    color: var(--muted);
    font-size: 0.85rem;
    padding-bottom: 1.25rem;
    margin-bottom: 1.75rem;
    border-bottom: 1px solid var(--rule);
}

.article-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.article-body {
    grid-column: 1;
    font-family: var(--font-body);
    font-size: 1.12rem;
    line-height: 1.7;
    max-width: var(--measure);
    text-wrap: pretty;
}

/* The single allowed flourish */
.article-body::first-letter {
    font-family: var(--font-display);
    font-weight: 500;
    float: left;
    font-size: 4rem;
    line-height: 0.88;
    margin: 0.35rem 0.55rem 0 0;
    color: var(--ink);
    font-variation-settings: "opsz" 144;
}

.article-body .sentence { margin-right: 0.18em; }

.article-body sup a {
    color: var(--accent);
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 0.62rem;
    font-weight: 500;
    margin: 0 0.05em;
}
.article-body sup a:hover { text-decoration: underline; }

/* Sources sidebar — quiet marginalia */
.sources {
    grid-column: 2;
    align-self: start;
    position: sticky;
    top: 1.5rem;
    padding: 0 0 0 1.5rem;
    border-left: 1px solid var(--rule);
    max-height: calc(100vh - 3rem);
    overflow-y: auto;
}
.sources h2 {
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.75rem;
}
.sources ol { list-style: none; padding: 0; }
.sources li {
    position: relative;
    padding: 0.55rem 0 0.55rem 2.6rem;
    font-size: 0.85rem;
    line-height: 1.4;
    border-bottom: 1px solid var(--rule);
}
.sources li:last-child { border-bottom: none; }
.sources li .source-id {
    position: absolute;
    left: 0; top: 0.6rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--accent);
}
.sources li:target { background: rgba(168,35,38,0.06); }
.sources a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--rule); }
.sources a:hover { border-bottom-color: var(--ink); }
.source-date {
    display: block;
    margin-top: 0.2rem;
    color: var(--muted);
    font-size: 0.75rem;
}

@media (max-width: 880px) {
    .article-detail { grid-template-columns: 1fr; }
    .sources {
        grid-column: 1;
        position: static;
        border-left: none;
        border-top: 1px solid var(--rule);
        padding: 1.5rem 0 0;
        margin-top: 2rem;
        max-height: none;
    }
}

.back-link {
    display: inline-block;
    margin: 3rem 0 1rem;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 120ms ease;
}
.back-link:hover { color: var(--ink); }

/* ============================================================
   LOAD MORE / EMPTY
   ============================================================ */

.load-more {
    grid-column: 1 / -1;
    text-align: center;
    margin: 2.5rem 0 1rem;
    padding-top: 2rem;
    border-top: 1px solid var(--rule);
}
.load-more .btn {
    background: transparent;
    color: var(--ink);
    border: 1px solid var(--ink);
    padding: 0.6rem 1.4rem;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 0.9rem;
    transition: background 160ms ease, color 160ms ease;
}
.load-more .btn:hover { background: var(--ink); color: var(--paper); }

.empty {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--muted);
    font-style: italic;
    padding: 4rem 0;
}

/* ============================================================
   PRIVATE EDITION — redacted-headline notice
   ============================================================ */

.private-page {
    max-width: var(--measure);
    margin: 0 auto;
    padding: clamp(2.5rem, 10vh, 6rem) 0 3rem;
}

/* The single allowed flourish: the withheld headline */
.private-redaction {
    margin-bottom: 2rem;
}
.private-redaction span {
    display: block;
    height: clamp(1.7rem, 3vw, 2.3rem);
    background: var(--ink);
}
.private-redaction span:first-child { width: 86%; }
.private-redaction span:last-child  { width: 58%; margin-top: 0.55rem; }

.private-page h1 {
    font-size: clamp(1.7rem, 3.2vw, 2.3rem);
    line-height: 1.08;
    font-variation-settings: "opsz" 144;
    margin-bottom: 0.85rem;
}

.private-note {
    max-width: 48ch;
    font-size: 1.05rem;
    text-wrap: pretty;
}
.private-note a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid currentColor;
    transition: color 120ms ease;
}
.private-note a:hover { color: var(--ink); }

.private-page .back-link { margin: 2.5rem 0 0; }

/* ============================================================
   FOOTER — single quiet line
   ============================================================ */

footer {
    max-width: var(--shell);
    margin: 4rem auto 0;
    padding: 1.75rem var(--gutter) 2rem;
    border-top: 1px solid var(--rule);
    color: var(--muted);
    font-size: 0.85rem;
    text-align: center;
}

/* ============================================================
   ADMIN — preserved, retoned to the system
   ============================================================ */

h1 { font-family: var(--font-display); font-weight: 500; letter-spacing: -0.015em; }
h2 { font-family: var(--font-display); font-weight: 500; }

.admin-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 1.5rem;
}
.admin-header h1 { font-size: 1.8rem; margin: 0; }

.admin-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: rgba(255,255,255,0.4);
    border: 1px solid var(--rule);
}
.admin-section h2 {
    font-size: 1.2rem;
    border-bottom: 1px solid var(--rule);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

.section-header {
    display: flex; justify-content: space-between; align-items: center;
}
.section-header h2 { border-bottom: none; padding-bottom: 0; margin-bottom: 0; }

.actions { display: flex; gap: 0.75rem; margin-bottom: 1rem; }

.add-feed-form, .import-feeds-form {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.import-feeds-form { flex-direction: column; }
.import-feeds-form label {
    font-size: 0.85rem;
    color: var(--muted);
}
.import-feeds-form code {
    background: rgba(0,0,0,0.04);
    padding: 0.05rem 0.3rem;
    font-family: var(--font-mono);
    font-size: 0.85em;
}
.add-feed-form input, .import-feeds-form textarea, .login-form input {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--rule);
    background: var(--paper);
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--ink);
}
.add-feed-form input[name="name"] { width: 200px; }
.add-feed-form input[name="url"] { flex: 1; min-width: 300px; }
.import-feeds-form textarea { resize: vertical; min-height: 8rem; font-family: var(--font-mono); }
.import-feeds-form button { align-self: flex-start; }

.import-lists {
    border: 1px solid var(--rule);
    padding: 0.5rem 0.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.75rem;
}
.import-lists legend {
    padding: 0 0.4rem;
    font-size: 0.8rem;
    color: var(--muted);
}
.check-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.88rem;
    cursor: pointer;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
th, td {
    padding: 0.6rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--rule);
}
th { font-weight: 600; }
.url-cell { max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.actions-cell { white-space: nowrap; }
.check-col { width: 1.5rem; text-align: center; }

.bulk-toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0.5rem 0 0.75rem;
}
.bulk-toolbar .hint { margin: 0; }

.btn {
    padding: 0.4rem 0.85rem;
    border: 1px solid var(--rule);
    background: transparent;
    color: var(--ink);
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 0.88rem;
    transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}
.btn:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn-primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn-primary:hover { background: transparent; color: var(--ink); }
.btn-sm { padding: 0.25rem 0.55rem; font-size: 0.82rem; }
.btn-success { border-color: #2d6a3e; color: #2d6a3e; }
.btn-success:hover { background: #2d6a3e; color: var(--paper); border-color: #2d6a3e; }
.btn-danger { border-color: var(--accent); color: var(--accent); }
.btn-danger:hover { background: var(--accent); color: var(--paper); }

.badge {
    padding: 0.18rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
}
.badge.published { background: #d6e3d3; color: #1f4422; }
.badge.rejected  { background: #f1d1d3; color: #7a1418; }
.badge.category  { background: rgba(0,0,0,0.04); color: var(--ink); border: 1px solid var(--rule); }

.category-select,
.category-input {
    padding: 0.2rem 0.4rem;
    border: 1px solid var(--rule);
    background: var(--paper);
    font-size: 0.85rem;
    font-family: var(--font-body);
    color: var(--ink);
    width: 12rem;
}

.success { color: #2d6a3e; font-size: 0.88rem; }
.error   { color: var(--accent); font-size: 0.88rem; }
.info    { color: var(--ink); font-size: 0.88rem; }

.htmx-indicator { display: none; color: var(--muted); font-size: 0.85rem; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { display: inline; }

/* Admin: lists */
.hint { color: var(--muted); font-size: 0.85rem; margin: -0.5rem 0 0.75rem; }
.lists-cell { font-size: 0.85rem; }
.list-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.1rem 0.45rem;
    margin: 0 0.25rem 0.25rem 0;
    background: rgba(255,255,255,0.4);
    border: 1px solid var(--rule);
    border-radius: 2px;
    font-size: 0.8rem;
}
.list-tag-remove {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    padding: 0;
    font-size: 1rem;
    line-height: 1;
}
.list-tag-remove:hover { color: var(--accent); }
.list-assign-form { display: inline-block; margin: 0.25rem 0 0; }
.list-assign-form select {
    font-size: 0.78rem;
    padding: 0.15rem 0.3rem;
    background: transparent;
    border: 1px dashed var(--rule);
    color: var(--muted);
}

/* Login */
.login-container {
    max-width: 400px;
    margin: 6rem auto;
    padding: 2.5rem;
    background: rgba(255,255,255,0.5);
    border: 1px solid var(--rule);
}
.login-container h1 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
}
.login-container .error {
    margin-bottom: 1rem;
    padding: 0.5rem 0.75rem;
    background: #f1d1d3;
    border: 1px solid #d8a4a8;
}
.login-form label {
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.85rem;
    color: var(--muted);
}
.login-form input { display: block; width: 100%; margin-bottom: 1rem; }
.login-form .btn { width: 100%; padding: 0.7rem; }

/* ============================================================
   THE EDITOR'S DESK — admin / user backoffice reskin
   ============================================================ */

/* Desk surfaces use the full shell width (not the public reading column).
   --shell is read by <header>, <main>, and <footer> — overriding it on
   the body cascades to all three so masthead, TOC, content, banner and
   footer all share the same column edges. */
body:has(.desk-masthead) {
    --shell: min(1400px, calc(100vw - 3rem));
}

.desk-masthead {
    padding: 2.25rem 0 0.75rem;
    margin: -0.5rem 0 2.5rem;
    border-top: 3px solid var(--ink);
    border-bottom: 1px solid var(--ink);
    position: relative;
}

.desk-masthead h1 {
    font-family: var(--font-display);
    font-weight: 500;
    font-variation-settings: "opsz" 144;
    font-size: clamp(2.4rem, 5.5vw, 3.6rem);
    line-height: 0.95;
    letter-spacing: -0.025em;
    margin: 0 0 0.65rem;
    text-transform: none;
}

.desk-masthead h1::before {
    content: "❦";
    color: var(--accent);
    font-size: 0.55em;
    vertical-align: 0.4em;
    margin-right: 0.4em;
    font-variation-settings: "opsz" 144;
}

.desk-meta {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.1rem;
    padding-bottom: 0.5rem;
}
.desk-meta .sep { color: var(--rule); }
.desk-meta .count { color: var(--ink); }
.desk-meta .count em {
    color: var(--accent);
    font-style: normal;
    font-weight: 500;
    margin-right: 0.25em;
}

.desk-masthead .logout {
    position: absolute;
    top: 1rem;
    right: 0;
}
.desk-masthead .logout button {
    background: none;
    border: none;
    padding: 0;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    cursor: pointer;
    border-bottom: 1px solid var(--rule);
    transition: color 120ms ease, border-color 120ms ease;
}
.desk-masthead .logout button:hover { color: var(--accent); border-color: var(--accent); }

/* Departments — section structure without the boxy chrome */
.desk-section {
    margin: 0 0 2.75rem;
    padding: 1.25rem 0 0;
    border-top: 1px solid var(--rule);
}
.desk-section:first-of-type { border-top: none; padding-top: 0.25rem; }

.desk-section > h2 {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 1.55rem;
    letter-spacing: -0.01em;
    margin: 0 0 0.25rem;
    font-variation-settings: "opsz" 96;
    display: flex;
    align-items: baseline;
    gap: 0.85rem;
}
.desk-section > h2::after {
    content: "";
    flex: 1;
    border-bottom: 1px solid var(--rule);
    transform: translateY(-0.3em);
}
.desk-section > h2 .eyebrow {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 500;
    flex: none;
}

.desk-section > .hint,
.desk-section > p.hint {
    margin: 0.15rem 0 1.25rem;
    color: var(--muted);
    font-size: 0.92rem;
    font-style: italic;
}

.desk-section .section-header {
    display: flex;
    align-items: baseline;
    justify-content: flex-start;
    gap: 0.85rem;
    margin: 0 0 0.25rem;
}
.desk-section .section-header h2 { margin: 0; }

/* Galley tables — typographic dense data */
.desk-section table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.85rem;
    font-size: 0.92rem;
}
.desk-section thead th {
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: 0.66rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted);
    text-align: left;
    padding: 0.4rem 0.6rem;
    border-bottom: 1px solid var(--ink);
    background: none;
}
.desk-section tbody td {
    padding: 0.7rem 0.6rem;
    border-bottom: 1px solid var(--rule);
    vertical-align: top;
}
.desk-section tbody tr:hover td { background: rgba(168, 35, 38, 0.025); }
.desk-section tbody td code {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--accent);
    background: none;
    padding: 0;
}
.desk-section tbody td a:not(.btn) {
    color: var(--ink);
    text-decoration: none;
    border-bottom: 1px solid var(--rule);
    transition: border-color 120ms ease;
}
.desk-section tbody td a:not(.btn):hover { border-bottom-color: var(--ink); }
.desk-section .url-cell {
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--muted);
}

/* Slugs — replace pill badges with typographic stamps */
.desk-section .badge,
.desk-section .slug {
    display: inline-block;
    background: none;
    border: none;
    padding: 0;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-weight: 500;
}
.desk-section .badge.published { color: #2d6a3e; }
.desk-section .badge.rejected,
.desk-section .badge.category[data-owner] { color: var(--accent); }
.desk-section .badge.category {
    color: var(--ink);
}

/* Action rows — dot-separated link-style actions */
.desk-section .actions-cell,
.desk-section td[id^="draft-actions-"],
.desk-section td[id^="published-actions-"] {
    white-space: nowrap;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
}
.desk-section .actions-cell .btn,
.desk-section td[id^="draft-actions-"] .btn,
.desk-section td[id^="published-actions-"] .btn,
.desk-section .actions-cell form {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    color: var(--ink);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-bottom: 1px solid transparent;
    cursor: pointer;
    transition: color 120ms ease, border-color 120ms ease;
}
.desk-section .actions-cell form { display: inline; border-bottom: none; }
.desk-section .actions-cell form .btn { padding: 0; }
.desk-section .actions-cell .btn:hover,
.desk-section td[id^="draft-actions-"] .btn:hover,
.desk-section td[id^="published-actions-"] .btn:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
    background: none;
}
.desk-section .actions-cell .btn-danger,
.desk-section td[id^="draft-actions-"] .btn-danger,
.desk-section td[id^="published-actions-"] .btn-danger { color: var(--accent); }
.desk-section .actions-cell .btn-success,
.desk-section td[id^="draft-actions-"] .btn-success,
.desk-section td[id^="published-actions-"] .btn-success { color: #2d6a3e; }

/* Dot separators between button siblings in action cells */
.desk-section .actions-cell > * + *::before,
.desk-section td[id^="draft-actions-"] > * + *::before,
.desk-section td[id^="published-actions-"] > * + *::before {
    content: "·";
    color: var(--rule);
    margin: 0 0.55rem;
    border-bottom: none;
}

/* Operations row — top-of-page actions kept as buttons (real CTAs) */
.desk-section .actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin: 0.5rem 0 1.25rem;
}

/* Bulk toolbar — quieter */
.desk-section .bulk-toolbar {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    margin: 1rem 0 0.5rem;
    padding-top: 0.85rem;
    border-top: 1px dashed var(--rule);
}
.desk-section .bulk-toolbar .hint {
    margin: 0;
    font-style: italic;
    font-size: 0.85rem;
    color: var(--muted);
}

/* Inputs in desk sections — flatter, paper-on-paper */
.desk-section .add-feed-form,
.desk-section .import-feeds-form {
    margin: 0.5rem 0 1.25rem;
}
.desk-section .add-feed-form input,
.desk-section .import-feeds-form textarea {
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--ink);
    padding: 0.4rem 0.2rem;
    font-family: var(--font-body);
    font-size: 0.95rem;
}
.desk-section .add-feed-form input:focus,
.desk-section .import-feeds-form textarea:focus {
    outline: none;
    border-bottom-color: var(--accent);
}
.desk-section .import-feeds-form textarea {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    border: 1px solid var(--rule);
    padding: 0.6rem 0.75rem;
}

/* List tags — quieter */
.desk-section .list-tag {
    background: none;
    border: none;
    border-bottom: 1px solid var(--rule);
    border-radius: 0;
    padding: 0.05rem 0;
    margin: 0 0.5rem 0.25rem 0;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    color: var(--ink);
}
.desk-section .list-tag-remove { font-size: 0.85rem; }
.desk-section .list-assign-form select {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

/* Hint utility (overrides the negative-margin default in desk context) */
.desk-section .hint { margin: -0.25rem 0 0.75rem; }
.desk-section .actions-cell .hint,
.desk-section td .hint { margin: 0; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; }

@media (max-width: 720px) {
    .desk-masthead h1 { font-size: 2rem; }
    .desk-masthead .logout { position: static; margin-top: 0.75rem; display: block; }
    .desk-meta { font-size: 0.65rem; gap: 0.3rem 0.75rem; }
}

/* ----- Contents Index — sticky TOC + single-section content ----- */

.desk-layout {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 2.5rem;
    align-items: start;
}

.desk-toc {
    position: sticky;
    top: 1.5rem;
    align-self: start;
    border-right: 1px solid var(--rule);
    padding: 0.25rem 1.5rem 1rem 0;
}

.desk-toc .toc-label {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 0 0 0.85rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--ink);
}

.desk-toc a {
    display: flex;
    align-items: baseline;
    gap: 0.45rem;
    padding: 0.55rem 0;
    color: var(--muted);
    text-decoration: none;
    font-family: var(--font-body);
    font-size: 0.95rem;
    line-height: 1.2;
    transition: color 120ms ease;
}
.desk-toc a:hover { color: var(--ink); }

.desk-toc .toc-num {
    font-family: var(--font-mono);
    font-size: 0.66rem;
    letter-spacing: 0.06em;
    color: var(--muted);
    width: 1.65rem;
    flex-shrink: 0;
    text-align: left;
}
.desk-toc .toc-name { flex: 0 0 auto; }
.desk-toc .toc-leader {
    flex: 1;
    height: 0;
    align-self: end;
    border-bottom: 1px dotted var(--rule);
    margin-bottom: 0.4em;
}
.desk-toc .toc-count {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--ink);
    flex-shrink: 0;
    min-width: 1.5rem;
    text-align: right;
}

.desk-toc a.is-active { color: var(--ink); }
.desk-toc a.is-active .toc-name { font-weight: 500; }
.desk-toc a.is-active .toc-num { color: var(--accent); }
.desk-toc a.is-active .toc-count { color: var(--accent); }
.desk-toc a.is-active .toc-leader { border-bottom-color: var(--ink); }

/* In the layout, only the active section renders */
.desk-content > .desk-section {
    display: none;
    border-top: none;
    margin: 0;
    padding-top: 0;
}
.desk-content > .desk-section.is-active { display: block; }
.desk-content > .desk-section > h2 { margin-top: 0; }

@media (max-width: 760px) {
    .desk-layout { grid-template-columns: 1fr; gap: 1rem; }
    .desk-toc {
        position: static;
        border-right: none;
        border-bottom: 1px solid var(--ink);
        padding: 0 0 0.5rem;
        overflow-x: auto;
        white-space: nowrap;
    }
    .desk-toc .toc-label { display: none; }
    .desk-toc a {
        display: inline-flex;
        padding: 0.45rem 0.75rem;
        gap: 0.35rem;
    }
    .desk-toc .toc-leader { display: none; }
}

/* ============================================================
   WHY AN ACCOUNT — public editorial column, citation idiom
   ============================================================ */

.pitch {
    max-width: 720px;
    margin: 1rem auto 0;
}

/* Headline matches .article-detail h1 scale, not the admin masthead */
.pitch h1 {
    font-family: var(--font-display);
    font-weight: 500;
    font-variation-settings: "opsz" 144;
    font-size: clamp(1.9rem, 3.6vw, 2.8rem);
    line-height: 1.05;
    letter-spacing: -0.02em;
    margin: 0 0 0.5rem;
}

/* Italic standfirst — the print-paper "dek" beneath the head */
.pitch .dek {
    font-family: var(--font-body);
    font-style: italic;
    font-size: 1.1rem;
    line-height: 1.45;
    color: var(--muted);
    margin: 0 0 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--rule);
}

.pitch .lead {
    font-family: var(--font-body);
    font-size: 1.12rem;
    line-height: 1.65;
    color: var(--ink);
    max-width: var(--measure);
    margin: 0 0 1.5rem;
}

.pitch .benefit {
    padding: 1.5rem 0;
    border-top: 1px solid var(--rule);
}

/* Subhead matches .article-card h2 scale, not the masthead */
.pitch .benefit h2 {
    font-family: var(--font-display);
    font-weight: 500;
    font-variation-settings: "opsz" 36;
    font-size: 1.35rem;
    line-height: 1.2;
    letter-spacing: -0.012em;
    margin: 0 0 0.55rem;
    display: flex;
    align-items: baseline;
    gap: 0.65rem;
}

/* The single flourish: mono-accent numerals reusing the citation idiom
   established by .source-id in article bodies */
.pitch .benefit-no {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--accent);
    letter-spacing: 0.06em;
    font-weight: 500;
    flex: none;
}

.pitch .benefit p {
    font-family: var(--font-body);
    font-size: 1.02rem;
    line-height: 1.6;
    color: var(--ink);
    margin: 0;
    max-width: var(--measure);
}

.pitch .benefit p code {
    font-family: var(--font-mono);
    font-size: 0.85em;
    color: var(--accent);
    background: none;
    padding: 0;
}

/* CTA — centered hairline-topped, mirrors .load-more rhythm */
.pitch .cta {
    margin: 2.5rem 0 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--rule);
    text-align: center;
}

.pitch .cta .btn-primary {
    font-size: 0.95rem;
    padding: 0.7rem 1.6rem;
    text-decoration: none;
    display: inline-block;
}

.pitch .cta .signin {
    margin: 1rem 0 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.pitch .cta .signin a {
    color: var(--muted);
    border-bottom: 1px solid var(--rule);
    text-decoration: none;
    transition: color 120ms ease, border-color 120ms ease;
}

.pitch .cta .signin a:hover { color: var(--ink); border-bottom-color: var(--ink); }
