/* 99.9 Gakondo FM — admin */
:root {
  --ink: #141210; --ink-2: #1c1916; --line-d: #2e2924; --muted-d: #a89f94;
  --red: #e4572e; --red-text: #b23a1a; --red-soft: #fbe6de;
  --bg: #f4ede4; --card: #fffdf9; --line: #ded3c5; --line-2: #8c8173;
  --text: #141210; --text-2: #3d3832; --text-3: #5c554c;
  --ok: #1f6b45; --ok-bg: #e2f2e8; --warn: #7a4a00; --warn-bg: #fdf0d5; --err: #a1261b; --err-bg: #fbe3df;
  --r: 14px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 Manrope, system-ui, -apple-system, "Segoe UI", sans-serif; }
h1, h2, h3 { font-family: Sora, Manrope, sans-serif; line-height: 1.2; margin: 0; }
a { color: var(--red-text); }
a:hover { color: var(--ink); }
code { background: #ece3d7; padding: 1px 6px; border-radius: 6px; font-size: .92em; }
.ic { flex: none; }
.muted { color: var(--text-3); }
.small { font-size: 13px; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }

/* layout */
.shell { display: flex; min-height: 100vh; }
.side { width: 248px; flex: none; background: var(--ink); color: #f4ede4; display: flex; flex-direction: column; padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 18px; color: #f4ede4; text-decoration: none; }
.brand span { display: flex; flex-direction: column; line-height: 1; }
.brand strong { font-family: Sora, sans-serif; font-size: 17px; letter-spacing: .04em; }
.brand em { font-style: normal; font-family: Sora, sans-serif; font-size: 10px; letter-spacing: .3em; color: var(--red); margin-top: 4px; }
.side nav, .side-foot { display: flex; flex-direction: column; gap: 2px; }
.side a { display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 0 12px; border-radius: 10px; color: #d9d0c4; text-decoration: none; font-weight: 600; }
.side a:hover { background: var(--ink-2); color: #fff; }
.side a.on { background: #2a2420; color: #fff; box-shadow: inset 3px 0 0 var(--red); }
.side a span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side hr { border: 0; border-top: 1px solid var(--line-d); margin: 10px 8px; }
.side-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line-d); }
.side-foot a { font-weight: 500; font-size: 14px; color: var(--muted-d); }
.badge { background: var(--red); color: var(--ink); font-size: 12px; font-weight: 800; min-width: 22px; height: 22px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; padding: 0 6px; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 20px 32px 4px; }
.topbar h1 { font-size: 26px; }
.topbar .menu-btn { display: none; }
.content { padding: 16px 32px 64px; max-width: 1180px; width: 100%; }

/* pieces */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; margin-bottom: 18px; }
.card > header { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.card h2 { font-size: 18px; margin-bottom: 12px; }
.card > header h2 { margin: 0; }
.card h3 { font-size: 15px; margin: 18px 0 10px; }
.empty { color: var(--text-3); margin: 4px 0; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; flex-direction: column; gap: 2px; padding: 10px 0; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }
.list a { color: var(--text); text-decoration: none; }
.list a:hover strong { color: var(--red-text); }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; align-items: start; }
.cols .card { margin: 0; }
.hello { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 20px; }
.hello h2 { font-size: 22px; margin-bottom: 4px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { position: relative; background: var(--ink); color: #f4ede4; border-radius: var(--r); padding: 16px 18px; display: flex; flex-direction: column; text-decoration: none; transition: background .15s, transform .15s; }
a.stat::after { content: "→"; position: absolute; top: 14px; right: 16px; font-size: 18px; color: var(--muted-d); transition: transform .15s, color .15s; }
a.stat:hover, a.stat:focus-visible { background: var(--ink-2); color: #fff; }
a.stat:hover::after, a.stat:focus-visible::after { color: #fff; transform: translateX(3px); }
a.stat:active { transform: scale(.98); }
.stat b { font-family: Sora, sans-serif; font-size: 28px; }
.stat span { color: var(--muted-d); font-size: 13px; font-weight: 600; }
.pill.ad-running { background: var(--ok-bg); color: var(--ok); }
.pill.ad-scheduled { background: #e0ecf8; color: #1d4f7a; }
.pill.ad-paused { background: var(--warn-bg); color: var(--warn); }
.places { border: 0; padding: 0; margin: 6px 0 14px; display: grid; gap: 8px; }
.places legend { font-weight: 800; font-size: 14px; margin-bottom: 6px; }
.places .place { align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.places .place > span { display: flex; flex-direction: column; gap: 2px; }
.translations { margin: 4px 0 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.translations .versions { display: flex; flex-direction: column; gap: 6px; font-size: 14px; margin: 0 0 10px; }
.translations .versions span { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.bulk-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-bottom: 12px; }
.bulk-bar .check { margin-right: 6px; }
.comment-mod header .check { margin: 0; }
.toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.toolbar p { margin: 0; max-width: 70ch; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; background: #e9e0d4; padding: 4px; border-radius: 12px; }
.tabs.wrap { margin-bottom: 14px; display: inline-flex; }
.tabs a { min-height: 38px; display: inline-flex; align-items: center; gap: 6px; padding: 0 14px; border-radius: 9px; color: var(--text-2); text-decoration: none; font-weight: 700; font-size: 14px; }
.tabs a b { font-size: 12px; color: var(--text-3); }
.tabs a.on { background: var(--card); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.filters input[type=search] { flex: 1 1 220px; }
.pill { display: inline-flex; align-items: center; font-size: 12px; font-weight: 800; padding: 2px 9px; border-radius: 999px; background: #ece3d7; color: var(--text-2); white-space: nowrap; }
.pill-published { background: var(--ok-bg); color: var(--ok); }
.pill-pending { background: var(--warn-bg); color: var(--warn); }
.pill-scheduled { background: #e0ecf8; color: #1d4f7a; }
.pill-featured { background: var(--red-soft); color: var(--red-text); }
.tiny { font-size: 12px; font-weight: 700; margin-left: 6px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1.5px solid var(--ink); background: var(--ink); color: #f4ede4; font: 800 14px/1 Manrope, sans-serif; cursor: pointer; text-decoration: none; }
.btn:hover { background: #2c2622; color: #fff; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn.ghost:hover { border-color: var(--ink); background: rgba(20,18,16,.04); }
.btn.danger { color: var(--err); border-color: #d9a49c; }
.btn.danger:hover { background: var(--err-bg); }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 13px; }
.btn.block { width: 100%; }
.icon-btn { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--card); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--ink); }
.row-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 8px; }
.push-right { margin-left: auto; }
.stack { display: flex; flex-direction: column; gap: 8px; }

/* forms */
.form fieldset { border: 0; padding: 0; margin: 0 0 18px; }
.form legend { font-family: Sora, sans-serif; font-weight: 700; font-size: 16px; margin-bottom: 10px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; }
.field > span { font-weight: 700; font-size: 14px; }
.field small, .field > span small { font-weight: 500; color: var(--text-3); font-size: 12.5px; }
input[type=text], input:not([type]), input[type=email], input[type=password], input[type=search], input[type=number], input[type=date], input[type=time], input[type=datetime-local], input[type=url], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-2); background: #fff; color: var(--text); font: 500 15px/1.4 Manrope, sans-serif;
}
textarea { resize: vertical; }
textarea.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
input[type=file] { font: inherit; max-width: 100%; }
.headline { font-family: Sora, sans-serif !important; font-size: 22px !important; font-weight: 700 !important; }
.check { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; font-weight: 600; margin-right: 16px; }
.check input { width: 18px; height: 18px; accent-color: var(--red-text); }
.danger-text { color: var(--err); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 16px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 16px; align-items: end; }
.days { display: flex; flex-wrap: wrap; gap: 8px; }
.days legend { width: 100%; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; }
.chip span { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 999px; font-weight: 700; cursor: pointer; }
.chip input:checked + span { background: var(--ink); color: #f4ede4; border-color: var(--ink); }
.chip input:focus-visible + span { outline: 3px solid var(--red); outline-offset: 2px; }
.thumb-row { display: flex; align-items: center; gap: 12px; }
.thumb { width: 96px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
audio { max-width: 100%; height: 40px; }
.narrow { max-width: 560px; }
.sticky-save { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 30%); padding: 18px 0 10px; }

/* notices */
.notice { border-radius: 12px; padding: 12px 16px; margin-bottom: 14px; background: #ece3d7; border: 1px solid var(--line); }
.notice.ok { background: var(--ok-bg); border-color: #b7dcc5; color: #164f33; }
.notice.error { background: var(--err-bg); border-color: #efb8b0; color: #7d1d14; }
.notice.warn { background: var(--warn-bg); border-color: #edd29b; color: #5c3800; }

/* tables */
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
.table { width: 100%; border-collapse: collapse; min-width: 640px; }
.table th { text-align: left; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); padding: 12px 14px; border-bottom: 1px solid var(--line); }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; }
.table a { color: var(--text); text-decoration: none; }
.table a:hover { color: var(--red-text); }
.table .title-cell { max-width: 420px; }
.table tr.dim td { opacity: .55; }
.pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 16px; }

/* week grid */
.week { display: grid; grid-template-columns: repeat(7, minmax(140px, 1fr)); gap: 10px; overflow-x: auto; padding-bottom: 6px; }
.day { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px; min-width: 140px; }
.day h3 { font-size: 14px; margin-bottom: 8px; }
.slot { display: flex; flex-direction: column; padding: 8px 10px; border-radius: 9px; background: #f3ece2; margin-bottom: 6px; text-decoration: none; color: var(--text); font-size: 13px; line-height: 1.35; }
.slot:hover { background: var(--red-soft); }
.slot b { font-family: Sora, sans-serif; font-size: 12px; color: var(--red-text); }
.slot em { font-style: normal; color: var(--text-3); }
.section-h { font-size: 18px; margin: 24px 0 10px; }

/* tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.tile { display: flex; flex-direction: column; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; text-decoration: none; color: var(--text); }
.tile:hover { border-color: var(--ink); }
.tile-img { display: block; aspect-ratio: 3/4; border-radius: 10px; background: #e3d8ca center/cover no-repeat; margin-bottom: 6px; }
.tile-img.has-art { position: relative; overflow: hidden; background: #141210; }
.tile-img .show-art { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.lang-cols { align-items: start; gap: 0 22px; }
.lang-col legend { font-weight: 800; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--red-text); margin-bottom: 8px; }
.small-note { font-size: 13px; margin: -6px 0 16px; }
.people .tile-img { aspect-ratio: 1; }
.tile-img.round { border-radius: 50%; }
.tile small { color: var(--red-text); font-weight: 800; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
.tile .pill { align-self: flex-start; }

/* messages */
.message header { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
.message.is-new { border-color: var(--red); background: #fff7f2; }
.msg-body { white-space: pre-wrap; margin: 10px 0; }

/* story editor */
.editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.editor-side .card { padding: 16px; }
.side-status { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; }
.editor-bar { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px; background: #ece3d7; border: 1px solid var(--line-2); border-bottom: 0; border-radius: 10px 10px 0 0; position: sticky; top: 0; z-index: 2; }
.editor-bar button { min-width: 40px; min-height: 36px; border: 0; background: transparent; border-radius: 7px; font: 700 13px Manrope, sans-serif; cursor: pointer; color: var(--text); }
.editor-bar button:hover { background: #fff; }
.editor { min-height: 420px; background: #fff; border: 1px solid var(--line-2); border-radius: 0 0 10px 10px; padding: 18px 20px; font: 17px/1.7 Manrope, sans-serif; outline: none; }
.editor:focus { border-color: var(--ink); }
.editor h2 { font-size: 24px; margin: 1em 0 .4em; }
.editor h3 { font-size: 19px; margin: 1em 0 .4em; }
.editor blockquote { margin: 1em 0; padding-left: 16px; border-left: 3px solid var(--red); font-size: 19px; }
.editor img { max-width: 100%; height: auto; border-radius: 8px; }
.editor figure { margin: 1em 0; }
.editor figcaption { font-size: 14px; color: var(--text-3); min-height: 1.4em; }
.editor figcaption:empty::before { content: "Caption (optional) — click to write one"; color: #a99f94; font-style: italic; }
.editor figure.uploading { display: flex; align-items: center; justify-content: center; min-height: 120px; border: 2px dashed var(--line-2); border-radius: 10px; color: var(--text-3); font-weight: 700; font-size: 14px; background: #faf6f0; }
.editor img[data-adopting] { opacity: .45; }
.editor img[data-stuck] { outline: 3px dashed #d9a441; outline-offset: 3px; }
.editor .pic-fix { display: block; margin: 10px 0 16px; padding: 12px 14px; border-radius: 10px; background: var(--warn-bg); border: 1px solid #edd29b; color: #5c3800; font-size: 14px; line-height: 1.5; user-select: none; }
.editor .pic-fix b { display: block; font-weight: 800; }
.editor .pic-fix.is-broken { margin-top: 0; }
.pic-fix-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.pic-fix-btns button { font: 700 13px/1 Manrope, sans-serif; padding: 9px 13px; border-radius: 999px; border: 1px solid #c9a65c; background: #fff; color: var(--ink); cursor: pointer; }
.pic-fix-btns button:first-child { background: var(--ink); border-color: var(--ink); color: #fff; }
.pic-fix-btns button.danger { color: #9b2316; border-color: #e3b1a9; }
.pic-fix-btns button:hover { filter: brightness(.94); }
.pic-fix-msg { display: block; margin-top: 8px; font-weight: 700; }
.pic-fix-msg:empty { display: none; }
.editor-note { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; }
.editor-note[hidden] { display: none; }
.editor-note .note-x { flex: none; border: 0; background: none; font-size: 22px; line-height: 1; color: inherit; cursor: pointer; padding: 0 4px; }
.editor:empty::before { content: "Start writing…"; color: #9a9086; }

/* sign-in and setup */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; background: var(--ink); }
.auth-card { width: 100%; max-width: 400px; background: var(--card); border-radius: 20px; padding: 28px; }
.auth-card.wide { max-width: 640px; }
.auth-card h1 { font-size: 24px; margin: 8px 0 8px; }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.auth-brand div { display: flex; flex-direction: column; line-height: 1; }
.auth-brand strong { font-family: Sora, sans-serif; font-size: 18px; letter-spacing: .04em; }
.auth-brand span { font-family: Sora, sans-serif; font-size: 10px; letter-spacing: .3em; color: var(--red-text); margin-top: 5px; font-weight: 700; }
.logo-mark { display: inline-flex; flex: none; }
.auth-card .logo-mark { background: var(--ink); border-radius: 10px; padding: 6px 8px; }

/* imaging */
.imaging-list { display: flex; flex-direction: column; gap: 10px; }
.imaging-item { display: grid; grid-template-columns: minmax(160px, 1.4fr) minmax(120px, .8fr) minmax(200px, 1.4fr) auto auto auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.imaging-item .field { margin: 0; }

/* phones */
@media (max-width: 900px) {
  .editor-layout { grid-template-columns: 1fr; }
  .imaging-item { grid-template-columns: 1fr 1fr; }
  .imaging-item audio { grid-column: 1 / -1; width: 100%; }
}
@media (max-width: 760px) {
  .side { position: fixed; left: 0; top: 0; bottom: 0; z-index: 50; transform: translateX(-100%); transition: transform .2s ease; }
  .side.open { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.4); }
  .topbar .menu-btn { display: inline-flex; }
  .topbar { padding: 14px 16px 0; position: sticky; top: 0; background: var(--bg); z-index: 10; }
  .topbar h1 { font-size: 20px; }
  .content { padding: 12px 16px 64px; }
  .card { padding: 16px; }
  .week { grid-template-columns: repeat(7, 160px); }
}

/* story language */
.lang-pick { display: flex; flex-wrap: wrap; gap: 8px; border: 0; padding: 0; margin: 0 0 14px; }
.lang-pick legend { font-weight: 700; font-size: 14px; margin-bottom: 6px; width: 100%; }
.lang-pick small { width: 100%; color: var(--text-3); font-size: 12.5px; }
.lang-pick .chip span { gap: 8px; }
.flag { display: inline-block; vertical-align: middle; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.12); }
.lang-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; letter-spacing: .04em; }
.i18n-table td { vertical-align: top; }
.i18n-table td:first-child { width: 42%; color: var(--text-2); font-size: 14px; }
.i18n-table textarea { min-height: 44px; font-size: 14px; }
.i18n-table tr.changed td:first-child { box-shadow: inset 3px 0 0 var(--red); }
