:root {
  /* Light: cool light-gray page, white cards, near-black (not pure black) text */
  --bg: #eef0f3;
  --fg: #1b1f24;
  --muted: #5d6671;
  --line: #dde1e6;
  --card: #ffffff;
  --panel: #e4e8ec;
  --soft: #f3f5f7;
  --up: #1b1f24;
  --down: #1b1f24;
  --accent: #1b1f24;
  --accent-ink: #ffffff;
  --btn: #1b1f24;
  --btn-ink: #ffffff;
  --hl: #111418;
  --img: none;
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color-scheme: light;
}
/* Dark: no pure black or pure white. Blue-gray surfaces (lighter = closer), off-white text at ~87%
   brightness, muted text ~60%, and dimmer buttons so nothing glares. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14171b; --fg: #d9dde3; --muted: #8b94a0; --line: #2b3038; --card: #1b1f25; --soft: #232830; --panel: #20252c; --tint: 16%; --tint-b: 70%; --accent: #c3cad3; --accent-ink: #14171b; --btn: #b9c1cb; --btn-ink: #14171b; --hl: #e8ebef; --img: brightness(.9);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #14171b; --fg: #d9dde3; --muted: #8b94a0; --line: #2b3038; --card: #1b1f25; --soft: #232830; --panel: #20252c; --tint: 16%; --tint-b: 70%; --accent: #c3cad3; --accent-ink: #14171b; --btn: #b9c1cb; --btn-ink: #14171b; --hl: #e8ebef; --img: brightness(.9);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--sans); font-size: 15px; line-height: 1.45; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; background: none; border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; cursor: pointer; }
button:hover { border-color: var(--fg); }
button.primary { background: var(--btn); color: var(--btn-ink); border-color: var(--btn); }
input, select { font: inherit; color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; width: 100%; }

/* Masthead */
.masthead { border-bottom: 3px double var(--fg); padding: 14px 16px 10px; max-width: 1400px; margin: 0 auto; }
.masthead-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.masthead h1 { font-family: var(--serif); font-weight: 900; font-size: clamp(34px, 7vw, 64px); letter-spacing: -1px; text-align: center; margin: 6px 0 2px; }
.masthead h1 a:hover { text-decoration: none; }
.tagline { text-align: center; font-size: 12px; letter-spacing: 3px; text-transform: uppercase; color: var(--muted); }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.icon-btn { width: 36px; height: 36px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }

/* Masonry: columns of freely stacked blocks */
.grid { max-width: 1400px; margin: 0 auto; padding: 16px; display: grid; grid-template-columns: var(--cols, 2fr 1fr 1fr); gap: 16px; align-items: start; }
.col { display: flex; flex-direction: column; gap: 16px; min-width: 0; min-height: 40px; }
.block { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; min-width: 0; position: relative; }
.drop-hint { display: none; border: 1px dashed var(--muted); border-radius: 12px; padding: 18px; text-align: center; color: var(--muted); font-size: 13px; }
body.editing .drop-hint { display: block; }
@media (max-width: 900px) { .grid { grid-template-columns: 1fr 1fr !important; } .colwrap:first-child { grid-column: 1 / -1; } }
@media (max-width: 640px) { .grid { grid-template-columns: 1fr !important; } }
.block h2 { font-family: var(--sans); font-size: 13px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; color: var(--bc, var(--accent)); margin: 0 0 4px; padding-bottom: 8px; border-bottom: 3px solid var(--bc, var(--accent)); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.block.tinted { background: color-mix(in srgb, var(--bc) var(--tint, 6%), var(--card)); border: 2px solid color-mix(in srgb, var(--bc) var(--tint-b, 40%), var(--line)); }
body.editing select.tr { display: none; }
select.tr { width: auto; font-size: 12px; padding: 3px 6px; border-radius: 999px; text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--muted); background: transparent; }
.note { font-size: 12px; color: var(--muted); margin-top: 8px; }
.block h2 small { font-family: var(--sans); font-size: 12px; font-weight: 400; color: var(--muted); }
.block-tools { display: none; position: absolute; top: 8px; right: 8px; gap: 4px; }
body.editing .block-tools { display: flex; }
body.editing .block { cursor: grab; outline: 1px dashed var(--muted); }
.block-tools button, .block-tools .handle { padding: 2px 9px; font-size: 13px; background: var(--card); border: 1px solid var(--line); border-radius: 999px; }
.block-tools .handle { cursor: grab; }
.tpl button { padding: 2px 10px; font-size: 13px; }
.tpl button.on { background: var(--bg); color: var(--fg); }
.sortable-ghost { opacity: .35; }
.loading { color: var(--muted); font-size: 13px; }

/* Stories: strong, high-contrast headlines; everything else steps back */
.story { padding: 12px 0; border-bottom: 1px solid var(--line); }
/* Story blocks: equal height, scroll inside the box. The scrollbar is styled so it stays visible
   (macOS/iOS hide plain ones), and a fade at the bottom hints there is more below. */
.block .stories { max-height: 460px; overflow-y: scroll; overscroll-behavior: contain; margin-right: -6px; padding-right: 10px; }
.block.wide .stories { max-height: 640px; }
.block .stories::-webkit-scrollbar { width: 8px; }
.block .stories::-webkit-scrollbar-track { background: var(--soft, rgba(127,127,127,.12)); border-radius: 4px; }
.block .stories::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--fg) 35%, transparent); border-radius: 4px; }
@supports not selector(::-webkit-scrollbar) { .block .stories { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--fg) 35%, transparent) var(--soft, transparent); } }
.block .stories::after { content: ""; display: block; position: sticky; bottom: 0; height: 30px; margin-top: -30px; background: linear-gradient(transparent, var(--card)); pointer-events: none; }
.block.tinted .stories::after { background: linear-gradient(transparent, color-mix(in srgb, var(--bc) var(--tint, 6%), var(--card))); }
.story.has-img:not(.lead) { display: grid; grid-template-columns: 1fr 128px; column-gap: 12px; }
.story.has-img:not(.lead) > .hl, .story.has-img:not(.lead) > .sum { grid-column: 1; }
.story.has-img:not(.lead) > .meta, .story.has-img:not(.lead) > .sumbox { grid-column: 1 / -1; }
.story .thumb { grid-column: 2; grid-row: 1 / span 2; width: 128px; aspect-ratio: 16 / 9; align-self: start; border-radius: 8px; overflow: hidden; background: var(--line); }
.block:not(.wide) .story.has-img:not(.lead) { grid-template-columns: 1fr 100px; }
.block:not(.wide) .story .thumb { width: 100px; }
@media (max-width: 640px) { .block .story.has-img:not(.lead) { grid-template-columns: 1fr 112px; } .block .story .thumb { width: 112px; } }
.story .thumb img, .story .lead-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.story .lead-img { display: block; aspect-ratio: 16 / 9; max-height: 230px; width: 100%; border-radius: 10px; overflow: hidden; margin-bottom: 10px; background: var(--line); }
.story:last-child { border-bottom: 0; }
.story .hl { font-family: var(--sans); font-size: 17px; font-weight: 700; line-height: 1.3; letter-spacing: -0.2px; color: var(--hl); display: block; }
.story .hl:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.story.lead .hl { font-family: var(--serif); font-size: 28px; font-weight: 900; line-height: 1.15; letter-spacing: -0.4px; }
.story.lead .sum { -webkit-line-clamp: 3; font-size: 15px; }
.story .sum { color: var(--muted); font-size: 14px; line-height: 1.45; margin-top: 5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.story .meta { font-size: 12px; color: var(--muted); margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.chip { font-size: 11.5px; color: var(--muted); font-weight: 400; opacity: .8; }
.badge { background: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: 1px 8px; font-size: 11px; font-weight: 700; }
@media (max-width: 640px) { .story .hl { font-size: 18px; } .story.lead .hl { font-size: 25px; } .block { padding: 14px; } }

/* Data blocks */
.big { font-size: 34px; font-weight: 800; letter-spacing: -1px; }
.chg { font-weight: 600; font-size: 14px; }
.row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.row:last-child { border-bottom: 0; }
.tabs { display: flex; gap: 4px; margin: 8px 0; }
.tabs button { padding: 2px 10px; font-size: 12px; }
.tabs button.on { background: var(--fg); color: var(--bg); }
svg.chart { width: 100%; height: 110px; display: block; }
svg.chart path.line { fill: none; stroke: var(--fg); stroke-width: 1.6; }
svg.chart path.area { fill: var(--soft); stroke: none; }
.wx-now { display: flex; align-items: center; gap: 12px; }
.wx-icon { font-size: 40px; }
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; font-size: 12px; margin-top: 10px; }
.days div { background: var(--soft); border-radius: 8px; padding: 6px 2px; }
.muted { color: var(--muted); }
.teaser { background: var(--soft); border-radius: 10px; padding: 12px; font-size: 14px; }

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: none; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.modal.open { display: flex; }
.modal-card { background: var(--bg); color: var(--fg); border: 1px solid var(--line); border-radius: 14px; width: 100%; max-width: 400px; padding: 22px; }
.modal-card h3 { font-family: var(--serif); font-size: 24px; margin: 0 0 6px; }
.modal-card form { display: grid; gap: 10px; margin-top: 14px; }
.modal-card .err { color: var(--fg); font-weight: 600; font-size: 13px; min-height: 18px; }
.linkish { border: 0; padding: 0; text-decoration: underline; color: var(--muted); }

footer { max-width: 1400px; margin: 10px auto 30px; padding: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

/* Admin */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.stat { font-size: 28px; font-weight: 800; }
.wrap { max-width: 1400px; margin: 0 auto; padding: 16px; }
.scroll { overflow-x: auto; }

/* Profile wizard & nudge */
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 12px; }
.pick { border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; cursor: pointer; display: flex; gap: 8px; align-items: center; font-size: 14px; }
.pick input { width: auto; }
.pick:has(input:checked) { border-color: var(--fg); background: var(--soft); }
.pick-list { display: grid; gap: 4px; margin-top: 8px; }
.pick-list button { border-radius: 8px; text-align: left; }
.nudge { display: none; max-width: 1400px; margin: 12px auto 0; padding: 10px 16px; border: 1px solid var(--fg); border-radius: 12px; align-items: center; gap: 10px; flex-wrap: wrap; width: calc(100% - 32px); }
.nudge.show { display: flex; }

.tiles { display: none; }
.page-title { max-width: 1400px; margin: 14px auto 0; padding: 0 16px; font-family: var(--serif); font-size: 30px; }
.page-title:empty { display: none; }
@media (max-width: 640px) {
  .tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 12px 16px 0; }
  .tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 1px solid var(--line); border-radius: 14px; padding: 14px 6px; font-weight: 600; font-size: 13px; background: var(--card); }
  .tile:hover { text-decoration: none; }
  .tile.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
  .tile-icon { font-size: 24px; }
  .masthead h1 { font-size: 38px; }
  .masthead-top { justify-content: center; }
}

/* Text pages */
.doc { max-width: 760px; margin: 0 auto; padding: 20px 16px; font-size: 16px; line-height: 1.6; }
.doc h2 { font-family: var(--serif); font-size: 24px; margin: 26px 0 8px; }
.doc a { text-decoration: underline; }
/* Affiliate link under a block */
.slot { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--line); font-size: 13px; display: flex; justify-content: space-between; gap: 8px; }
.slot a { font-weight: 600; }
.slot .tag { color: var(--muted); font-size: 11px; }

/* Customize panel: lives inside the left menu */
.panel-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); font-size: 17px; }
.panel-body { overflow-y: auto; padding: 4px 16px 24px; flex: 1; }
.panel h4 { margin: 18px 0 8px; font-size: 14px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.panel h4 small, .small { font-weight: 400; font-size: 12px; color: var(--muted); }
.pchips, .prow, .padd { display: flex; flex-wrap: wrap; gap: 6px; }
.prow { margin-top: 8px; }
.prow button, .padd button { font-size: 13px; padding: 5px 11px; }
.prow button.on { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.pchip { border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: 14px; font-weight: 600; cursor: grab; }
.pchip:hover { text-decoration: none; border-color: var(--fg); }
.pchip.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.plabel { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin: 12px 0 4px; }
.plist { display: flex; flex-direction: column; gap: 6px; min-height: 44px; border: 1px dashed var(--line); border-radius: 12px; padding: 6px; }
.ptile { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--bc, var(--line)); border-radius: 10px; padding: 9px 10px; cursor: grab; }
.ptile .pt-name { flex: 1; font-weight: 600; font-size: 14px; }
.ptile .handle { color: var(--muted); }
.ptile .x { padding: 2px 9px; font-size: 13px; }
.dot { width: 24px; height: 24px; padding: 0; border-radius: 50%; background: conic-gradient(#d62828, #ea580c, #15803d, #1d4ed8, #7c3aed, #d62828); }
.dot.set { background: var(--bc); }
.ptile .sw-row { flex-basis: 100%; }
.sw-row { display: flex; flex-wrap: wrap; gap: 6px; }
.sw { width: 30px; height: 30px; padding: 0; border-radius: 50%; border: 2px solid transparent; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; position: relative; overflow: hidden; cursor: pointer; }
.sw.on { outline: 2px solid var(--fg); outline-offset: 2px; }
.sw.none { border-color: var(--line); background: var(--bg); }
.sw.custom { border: 1px dashed var(--muted); }
.sw.custom input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; padding: 0; border: 0; cursor: pointer; }
.wide-btn { width: 100%; margin-top: 10px; border-style: dashed; }
.padd { margin-top: 8px; }
.pfoot { display: flex; justify-content: space-between; gap: 8px; margin-top: 24px; padding-top: 14px; border-top: 1px solid var(--line); }
/* Translated headline toggle */
.story .meta .trx { font: inherit; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; }
.story .meta .trx.on { border-color: var(--accent); color: var(--fg); }
.pgroup { border: 1px solid var(--line); border-radius: 10px; margin-top: 8px; padding: 8px 10px; }
.pgroup summary { cursor: pointer; font-weight: 700; font-size: 14px; }
.pgroup summary small { color: var(--muted); font-weight: 400; }
.lang-sel { width: auto; border-radius: 999px; padding: 6px 10px; font-size: 14px; background: none; cursor: pointer; }
/* Sum up */
.story .meta .sumup { font: inherit; font-size: 12px; font-weight: 800; padding: 3px 11px; border-radius: 999px; border: 1px solid var(--btn); background: var(--btn); color: var(--btn-ink); cursor: pointer; }
.story .meta .sumup:hover { opacity: .85; }
.story .meta .sumup.on { background: transparent; color: var(--fg); }
.story .sumbox { grid-column: 1 / -1; margin-top: 8px; padding: 10px 12px; border-radius: 10px; background: var(--soft); border-left: 3px solid var(--accent); font-size: 14px; line-height: 1.45; }
.story .sumbox ul { margin: 0; padding-left: 18px; }
.story .sumbox li + li { margin-top: 4px; }
.story .sumsrc { margin-top: 8px; font-size: 12px; }
.story .sumsrc a { text-decoration: underline; }

/* Layout: sticky top bar over the newspaper; the Customize drawer opens on the left while editing
   and the page shifts right so changes show live. */
:root { --side: 0px; }
body.editing { --side: 380px; }
.side { display: none; position: fixed; top: 0; left: 0; bottom: 0; width: var(--side); z-index: 40; background: var(--panel); border-right: 1px solid var(--line); flex-direction: column; }
body.editing .side { display: flex; }
.side .panel { display: flex; flex: 1; flex-direction: column; min-height: 0; }
.main { margin-left: var(--side); min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: 8px 16px; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.tb-logo:hover { text-decoration: none; }
.logo-mark { width: 38px; height: 38px; border-radius: 10px; background: var(--fg); color: var(--bg); display: inline-flex; align-items: center; justify-content: center; font-family: var(--serif); font-weight: 900; font-size: 15px; letter-spacing: -1px; }
.tb-pages { flex: 1; min-width: 0; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.tb-pages::-webkit-scrollbar { display: none; }
.tb-pages .tab { padding: 8px 12px; border-radius: 999px; font-weight: 600; font-size: 14px; white-space: nowrap; }
.tb-pages .tab:hover { background: var(--soft); text-decoration: none; }
.tb-pages .tab.on { background: var(--accent); color: var(--accent-ink); }
.tb-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.tb-cta { font-weight: 700; padding: 8px 14px; border: 2px solid var(--fg); }
.tb-cta.primary { background: var(--fg); color: var(--bg); }
.lang-sel { width: auto; border-radius: 999px; padding: 6px 10px; font-size: 13px; background: none; cursor: pointer; }
.tb-account { display: flex; gap: 6px; align-items: center; font-size: 13px; }
.tb-account .muted { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-account button { padding: 6px 12px; font-size: 13px; }
.masthead { border-bottom: 3px double var(--fg); padding-top: 8px; }
.masthead h1 { font-size: clamp(30px, 5vw, 52px); }
@media (max-width: 1180px) { .tb-account .muted { display: none; } }
@media (max-width: 900px) {
  .tb-cta .lbl { display: none; }
  .tb-cta { padding: 7px 11px; }
}
}
@media (min-width: 641px) { .tiles { display: none !important; } }
/* Narrow boxes: picture goes above the headline instead of squeezing it */
.block { container-type: inline-size; }
@container (max-width: 300px) {
  .story.has-img:not(.lead) { display: block; }
  .story .thumb { display: block; width: 100% !important; margin-bottom: 8px; }
}
/* Locations bar */
.locbar { display: none; max-width: 1400px; margin: 12px auto 0; padding: 0 16px; gap: 8px; flex-wrap: wrap; align-items: center; }
.locbar.show { display: flex; }
.loc-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; padding: 5px 6px 5px 12px; font-weight: 600; font-size: 14px; background: var(--card); }
.loc-chip.primary { border: 2px solid var(--accent); }
.loc-chip small { color: var(--muted); font-weight: 400; font-size: 11px; }
.loc-chip button { padding: 1px 7px; font-size: 12px; }
.loc-list { max-height: 50vh; overflow-y: auto; }

/* Panel content sits on the gray drawer; cards inside stay white/black */
.side .panel-head { background: var(--panel); }
.side .ptile, .side .pchip { background: var(--card); }

/* Customize: pages as a vertical, draggable list */
.side .pchips { flex-direction: column; flex-wrap: nowrap; gap: 6px; }
.side .pchip { display: flex; align-items: center; gap: 8px; border-radius: 10px; }
.pchip .handle { color: var(--muted); cursor: grab; }

/* Location button + picker */
.tb-loc { font-weight: 600; padding: 7px 12px; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.loc-current { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

/* Phone: ✏️ left, ☰ right, everything else in the burger menu */
html, body { overflow-x: clip; }
.tb-burger { display: none; }
.burger { position: fixed; top: 56px; right: 8px; left: 8px; z-index: 45; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 10px; box-shadow: 0 12px 40px rgba(0,0,0,.25); max-height: calc(100vh - 70px); overflow-y: auto; }
.burger[hidden] { display: none; }
.burger-pages { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.burger-pages a { padding: 12px; border-radius: 10px; background: var(--card); font-weight: 600; }
.burger-pages a.on { background: var(--accent); color: var(--accent-ink); }
.burger-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 4px 0; font-weight: 600; font-size: 14px; }
.seg { display: inline-flex; gap: 4px; }
.seg button { padding: 5px 9px; font-size: 12.5px; }
.seg button.on { background: var(--fg); color: var(--bg); }
.burger-account { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 14px 4px 2px; margin-top: 12px; border-top: 1px solid var(--line); font-size: 13px; }
@media (max-width: 640px) {
  body.editing { --side: 0px; }
  body.editing .side { width: 100%; }
  .topbar { padding: 6px 10px; gap: 8px; height: 52px; }
  .tb-pages, .tb-desk { display: none !important; }
  .tb-burger { display: inline-flex; width: 40px; height: 40px; padding: 0; align-items: center; justify-content: center; font-size: 17px; }
  .tb-actions { flex: 1; justify-content: flex-end; gap: 6px; min-width: 0; }
  .tb-cta { padding: 0; width: 40px; height: 40px; justify-content: center; }
  .tb-loc { max-width: 42vw; padding: 7px 10px; font-size: 13px; }
  .masthead { padding: 6px 12px 8px; }
  .masthead h1 { font-size: 34px; margin: 2px 0; }
  .tagline { font-size: 9.5px; letter-spacing: 2px; }
  .grid, .nudge { padding-left: 12px; padding-right: 12px; }
  .nudge { width: calc(100% - 24px); }
}
.side .pchip.on { background: var(--accent); color: var(--accent-ink); }
body.editing .tb-cta .lbl, body.editing .tb-loc .lbl { display: none; }

/* Pencil = Customize, top-left in a box */
.tb-pencil { width: 40px; height: 40px; padding: 0; border-radius: 10px; border: 2px solid var(--fg); font-size: 18px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.tb-pencil.on { background: var(--fg); }
/* "+ Add a page" tab: dotted, stands out as the make-your-own entry point */
.tab-add { border: 2px dashed var(--muted) !important; background: none; color: var(--fg); font-weight: 700; white-space: nowrap; }
.tb-pages .tab-add { padding: 6px 12px; border-radius: 999px; margin-left: 4px; }
.burger-pages .tab-add { padding: 12px; border-radius: 10px; font-size: 15px; }
.tab-add:hover { border-color: var(--fg) !important; }
/* Pop-up close button */
.modal-card { position: relative; }
.modal-x { position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; padding: 0; display: inline-flex; align-items: center; justify-content: center; font-size: 15px; }
.modal-card h3 { padding-right: 40px; }
/* Clickable "+ Add a block" at the bottom of each column while editing */
button.drop-hint { width: 100%; font: inherit; font-weight: 700; color: var(--fg); background: none; border: 2px dashed var(--muted); border-radius: 12px; padding: 18px; cursor: pointer; }
button.drop-hint small { display: block; font-weight: 400; color: var(--muted); }
button.drop-hint:hover { border-color: var(--fg); }
/* Page icon picker */
.icon-row { display: flex; flex-wrap: wrap; gap: 4px; }
.icon-row button { width: 36px; height: 36px; padding: 0; border-radius: 8px; font-size: 18px; background: var(--card); }
.icon-row button.on { outline: 2px solid var(--fg); }
.icon-custom { width: 110px; height: 36px; padding: 4px 8px; font-size: 14px; }
.locbar .muted { font-size: 14px; }

/* Columns: the whole column is a drop zone while editing; "+ Add a section" opens the list in place */
.colwrap { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.colwrap .col { flex: 1; }
body.editing .grid { align-items: stretch; }
body.editing .col { min-height: 160px; border-radius: 12px; }
body.editing .col:empty { border: 2px dashed var(--line); }
.col-picker { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 4px 10px 10px; }
.col-picker[hidden] { display: none; }
.pcolbox { display: flex; flex-direction: column; gap: 6px; }
.pcolbox .wide-btn { margin-top: 0; }
/* In-site dialog */
#dlg .modal-card { max-width: 420px; }
#dlgForm { display: grid; gap: 12px; margin-top: 8px; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; }
button.danger { background: #d62828; border-color: #d62828; color: #fff; }
/* Emoji picker field */
.icon-add { display: flex; gap: 6px; margin-top: 6px; }
.icon-add .icon-custom { flex: 1; width: auto; }
.icon-add button { width: 40px; padding: 0; }
/* Pop-ups scroll inside on small screens (the sports list is long) */
.modal { overflow-y: auto; overscroll-behavior: contain; }
.modal-card { max-height: calc(100dvh - 32px); overflow-y: auto; -webkit-overflow-scrolling: touch; }
@media (max-width: 640px) { .modal { align-items: flex-start; padding: 12px; } .modal-card { max-height: calc(100dvh - 24px); } }

/* Customize menu: each part is its own card with a bold caps title, so it's easy to scan */
.panel-body > h4 { margin: 22px -16px 10px; padding: 12px 16px 0; border-top: 6px solid var(--bg); font-size: 13px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; }
.panel-body > h4:first-child { border-top: 0; margin-top: 8px; }
.panel-body > h4 small { text-transform: none; letter-spacing: 0; }
.plabel { font-weight: 700; color: var(--fg); opacity: .75; }

/* Phones: bigger text, a clear menu icon, and 16px form fields so iOS doesn't zoom in */
@media (max-width: 640px) {
  html { font-size: 17px; }
  body { font-size: 16px; }
  .story .hl { font-size: 19px; }
  .story .sum { font-size: 15.5px; }
  .story .meta { font-size: 13px; }
  .block h2 { font-size: 14px; }
  input, select, textarea, .lang-sel, .icon-custom { font-size: 16px !important; }
  .tb-burger { width: 46px !important; height: 46px !important; font-size: 26px !important; font-weight: 700; border: 2px solid var(--fg); border-radius: 12px; }
  .tb-pencil { width: 46px; height: 46px; font-size: 21px; }
  .tb-cta { width: 46px; height: 46px; font-size: 19px; }
  .topbar { height: 60px; }
  .burger { top: 64px; }
  .panel-body { font-size: 16px; }
  .ptile .pt-name { font-size: 16px; }
}

/* ✏️ Edit (word + icon on desktop, icon only on phones) and the one-time hint bubble */
.tb-pencil { width: auto; padding: 0 14px; gap: 6px; font-weight: 800; font-size: 15px; }
.tb-pencil.on { color: var(--bg); }
.edit-hint { position: fixed; top: 62px; left: 12px; z-index: 46; background: var(--fg); color: var(--bg); font-weight: 700; font-size: 14px; padding: 8px 12px; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.edit-hint::before { content: ""; position: absolute; top: -6px; left: 22px; border: 6px solid transparent; border-top: 0; border-bottom-color: var(--fg); }
.edit-hint[hidden] { display: none; }
.tb-brand { display: none; font-family: var(--serif); font-weight: 900; font-size: 22px; letter-spacing: -.5px; white-space: nowrap; }
.tb-brand:hover { text-decoration: none; }
/* Language: flag button + menu */
.lang-dd { position: relative; }
.lang-btn { font-size: 20px; }
.lang-menu { position: absolute; left: 50%; transform: translateX(-50%); top: 44px; z-index: 47; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 6px; display: grid; gap: 2px; min-width: 170px; box-shadow: 0 12px 30px rgba(0,0,0,.25); }
.lang-menu[hidden] { display: none; }
.lang-menu button { border: 0; border-radius: 8px; text-align: left; padding: 8px 10px; }
.lang-menu button:hover, .lang-menu button.on { background: var(--card); }
/* Personalize call to action at the top of the edit menu */
.personalize { width: 100%; margin-top: 12px; padding: 14px 16px; border-radius: 14px; border: 0; background: var(--accent); color: var(--accent-ink); font-size: 17px; font-weight: 800; text-align: left; display: grid; gap: 2px; }
.personalize small { font-size: 12.5px; font-weight: 500; opacity: .8; }
#wizBody .pick-list button.on, #wizBody .prow button.on { background: var(--fg); color: var(--bg); }
@media (max-width: 640px) {
  .tb-pencil { width: 46px; padding: 0; }
  .tb-pencil .lbl { display: none; }
  .tb-brand { display: block; position: absolute; left: 50%; transform: translateX(-50%); }
  .masthead { display: none; }
  .topbar { position: sticky; }
  .page-title { font-size: 24px; margin-top: 10px; }
}

/* Pages list in Customize: name opens the page, "✎ Edit" opens the page editor */
.side .pchip { display: flex; align-items: center; gap: 8px; padding: 8px 10px; cursor: default; }
.pchip .pname { flex: 1; font-weight: 600; }
.pchip .pname:hover { text-decoration: none; }
.pchip .plang { font-size: 15px; }
.pchip .pedit { padding: 3px 10px; font-size: 12.5px; font-weight: 700; }
.side .pchip.on .pedit { border-color: var(--accent-ink); color: var(--accent-ink); }
/* Page editor */
#pageDlg .modal-card { max-width: 440px; }
#pageForm { display: grid; gap: 8px; margin-top: 6px; }
#pageForm .plabel { margin: 8px 0 0; }
.pg-preview { font-size: 20px; font-weight: 800; padding: 10px 12px; border-radius: 10px; background: var(--soft); }
.danger-link { border: 0; color: #d62828; padding: 6px 4px; }

/* Pop-ups stand out from the page in dark mode too */
.modal { background: rgba(0,0,0,.6); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.modal-card { background: var(--panel); border: 1px solid color-mix(in srgb, var(--fg) 25%, transparent); box-shadow: 0 20px 60px rgba(0,0,0,.45); }
.modal-card input, .modal-card select { background: var(--card); }
.modal-card .pick { background: var(--card); }

/* Dark mode: slightly dim photos so they don't glare against the dark page */
.story img, .top-posts img { filter: var(--img); }
.seg button.on, .prow button.on, #wizBody .pick-list button.on, #wizBody .prow button.on { background: var(--btn); color: var(--btn-ink); border-color: var(--btn); }
.tb-pencil.on { background: var(--btn); color: var(--btn-ink); }

/* Sign up is the one button that should always pop: pure white in dark mode, solid near-black in light */
button.cta-signup { font-weight: 800; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) button.cta-signup { background: #ffffff; color: #14171b; border-color: #ffffff; } }
:root[data-theme="dark"] button.cta-signup { background: #ffffff; color: #14171b; border-color: #ffffff; }

/* Political lean tags (L / C / R) and the coverage spread bar */
i.lean { display: inline-flex; align-items: center; justify-content: center; width: 15px; height: 15px; border-radius: 4px; font-style: normal; font-size: 9.5px; font-weight: 800; color: #fff; margin-right: 4px; vertical-align: 1px; }
i.lean.left { background: #2563eb; } i.lean.lean-left { background: #60a5fa; }
i.lean.center { background: #8b94a0; }
i.lean.lean-right { background: #f87171; } i.lean.right { background: #dc2626; }
i.state { font-style: normal; }
.spread { display: inline-flex; width: 54px; height: 6px; border-radius: 3px; overflow: hidden; background: var(--line); gap: 1px; }
.spread b.left { background: #3b82f6; } .spread b.center { background: #9aa3ad; } .spread b.right { background: #ef4444; }
.src-f button { opacity: .45; } .src-f button.on { opacity: 1; background: var(--card); border-color: var(--fg); color: var(--fg); }
.mh-link { font-weight: 600; color: var(--fg); }
.burger-link { display: block; padding: 14px 4px 0; font-weight: 700; }

/* Per-section source picker */
.src-btn { padding: 2px 8px; font-size: 13px; border-radius: 999px; color: var(--muted); background: transparent; }
.src-btn.on { color: var(--fg); border-color: var(--fg); }
.src-btn b { font-size: 11px; }
body.editing .src-btn { display: none; }
#srcDlg .modal-card { max-width: 480px; }
.src-tools-row { display: flex; gap: 6px; align-items: center; margin: 10px 0 6px; }
.src-tools-row button { padding: 4px 12px; font-size: 13px; }
.src-pick-list { display: grid; gap: 2px; max-height: 50vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; padding: 4px; background: var(--card); }
.src-row { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.src-row:hover { background: var(--soft); }
.src-row input { width: 18px; height: 18px; flex: 0 0 auto; }
.src-row .src-name { flex: 1; font-weight: 600; }
.src-row .muted { font-size: 12px; text-align: right; }
.block h2 small { display: inline-flex; gap: 6px; align-items: center; }

/* Section gear: one clear button for the section's language and outlets */
.sec-gear { display: inline-flex; align-items: center; gap: 4px; padding: 4px 9px; border-radius: 999px; font-size: 13px; color: var(--fg); background: var(--soft); border: 1px solid var(--line); text-transform: none; letter-spacing: 0; }
.sec-gear.on { border-color: var(--fg); }
.sec-gear b { font-size: 12px; }
body.editing .block h2 { padding-right: 76px; }
.sec-langs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.sec-langs button { padding: 6px 11px; font-size: 13.5px; }
.sec-langs button.on { background: var(--btn); color: var(--btn-ink); border-color: var(--btn); }
.link-btn { display: block; text-align: center; font-weight: 700; padding: 10px; border-radius: 999px; border: 2px solid var(--fg); }
.link-btn:hover { text-decoration: none; background: var(--card); }
/* Our sources view inside the site */
.view { max-width: 1000px; margin: 0 auto; padding: 8px 16px 40px; }
.view[hidden] { display: none; }
.src-intro { font-size: 15px; line-height: 1.55; }
.src-tools { display: grid; gap: 8px; margin: 14px 0; }
.src-tools input { font-size: 16px; }
.src-filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.src-filters select { font-size: 15px; }
@media (max-width: 640px) { .src-filters { grid-template-columns: 1fr 1fr; } }
.src-list { display: grid; gap: 8px; margin-top: 8px; }
.src { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: grid; gap: 8px; }
.src-top { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.src-top a { font-weight: 800; font-size: 16px; }
.badge2 { font-size: 12.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); display: inline-flex; align-items: center; }
.badge2.mine { border: 2px solid var(--fg); }
.rate { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 8px; border-radius: 10px; background: var(--soft); }
.rate-l { font-weight: 800; font-size: 13px; margin-right: 4px; }
.rate button { padding: 6px 12px; font-size: 13.5px; font-weight: 600; background: var(--card); }
.rate button.on { background: var(--btn); color: var(--btn-ink); border-color: var(--btn); }

.nl-form { display: flex; gap: 6px; margin-top: 10px; }
.nl-form input { flex: 1; min-width: 0; }
.nl-msg { margin-top: 8px; }
.check-line { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; color: var(--muted); }
.check-line input { width: auto; margin-top: 2px; }
.check-line[hidden] { display: none; }
