/* Lancaster Independent — newsroom. Built phone-first. */
:root {
  --bg: #f6f5f2; --card: #fff; --ink: #121212; --soft: #666; --rule: #e2e0db;
  --accent: #d7263d; --ok: #1a7f4b; --warn: #b26a00;
  --head: 'Fraunces', Georgia, serif; --text: 'Newsreader', Georgia, serif;
  --ui: 'Inter', system-ui, -apple-system, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #101011; --card: #1a1a1c; --ink: #f1efea; --soft: #a3a19b; --rule: #303033; --accent: #ff5d73; --ok: #58c98b; --warn: #f0b24a; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.45 var(--ui); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, ul { margin: 0; padding: 0; }
ul { list-style: none; }
img, video { max-width: 100%; display: block; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.rose { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); display: inline-block; }

/* top bar (desktop) / bottom tabs (phone) */
.bar { display: flex; align-items: center; gap: 28px; padding: 0 24px; height: 58px; background: var(--card); border-bottom: 1px solid var(--rule); position: sticky; top: 0; z-index: 20; }
.brand { font: 700 20px/1 var(--head); letter-spacing: -0.02em; display: flex; align-items: center; gap: 8px; }
.tabs { display: flex; gap: 4px; flex: 1; }
.tabs a { display: flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 99px; font-size: 14px; font-weight: 600; color: var(--soft); position: relative; }
.tabs a svg { width: 18px; height: 18px; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { background: var(--bg); color: var(--ink); }
.badge { background: var(--accent); color: #fff; font-size: 11px; border-radius: 99px; padding: 1px 6px; min-width: 18px; text-align: center; }
.view-site { font-size: 13.5px; color: var(--soft); font-weight: 500; }
.page { max-width: 760px; margin: 0 auto; padding: 26px 20px 120px; }

@media (max-width: 720px) {
  .bar { height: 50px; padding: 0 16px; justify-content: space-between; position: static; }
  .tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--card); border-top: 1px solid var(--rule); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); justify-content: space-around; gap: 0; }
  .tabs a { flex-direction: column; gap: 2px; font-size: 10.5px; padding: 5px 8px; border-radius: 10px; min-width: 56px; }
  .tabs a svg { width: 23px; height: 23px; }
  .tabs a.on { background: none; color: var(--accent); }
  .tabs a.write svg { background: var(--ink); color: var(--card); border-radius: 50%; padding: 5px; width: 32px; height: 32px; margin-top: -4px; }
  .tabs a.write span { display: none; }
  .tabs .wide-only { display: none; }
  .badge { position: absolute; top: 0; right: 6px; }
  .page { padding: 18px 16px 130px; }
  body.editing .tabs { display: none; }
}

/* basics */
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.head-row h1 { font: 700 30px/1.1 var(--head); letter-spacing: -0.025em; }
.sub { font: 700 12px/1 var(--ui); letter-spacing: .09em; text-transform: uppercase; color: var(--soft); margin: 30px 0 12px; }
.sub.first { margin-top: 0; }
.back { font-size: 14px; font-weight: 600; color: var(--soft); }
.hint { color: var(--soft); font-size: 14.5px; }
.hint.small, small { font-size: 12.5px; color: var(--soft); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: 600 15px/1 var(--ui); color: var(--ink); background: var(--card); border: 1px solid var(--rule); border-radius: 99px; padding: 0 18px; min-height: 44px; cursor: pointer; white-space: nowrap; -webkit-appearance: none; appearance: none; }
.btn:hover { border-color: var(--ink); }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.primary:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.small { min-height: 36px; font-size: 13px; padding: 0 14px; }
.btn.big { min-height: 52px; font-size: 16px; width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.btn-row.spaced { margin-top: 22px; }
.btn-row:empty { display: none; }
.linkish { background: none; border: 0; padding: 6px 0; font: 500 13.5px var(--ui); color: var(--soft); text-decoration: underline; cursor: pointer; }
.linkish:hover { color: var(--accent); }
input, textarea, select { font: 400 16px/1.4 var(--ui); color: var(--ink); background: var(--card); border: 1px solid var(--rule); border-radius: 12px; padding: 12px 14px; width: 100%; -webkit-appearance: none; appearance: none; }
select { padding-right: 34px; background-image: linear-gradient(45deg, transparent 50%, var(--soft) 50%), linear-gradient(135deg, var(--soft) 50%, transparent 50%); background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--ink); outline-offset: -1px; }
input[type=checkbox] { width: 22px; height: 22px; padding: 0; border-radius: 6px; -webkit-appearance: auto; appearance: auto; accent-color: var(--accent); flex: none; }
label { font-size: 13px; font-weight: 600; display: grid; gap: 6px; }
label small { font-weight: 400; }
.stack { display: grid; gap: 16px; }
.flash { background: var(--ink); color: var(--bg); border-radius: 12px; padding: 12px 16px; font-weight: 500; font-size: 14.5px; margin-bottom: 16px; }
.error { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); border-radius: 12px; padding: 12px 14px; font-size: 14.5px; font-weight: 500; margin-bottom: 14px; }
.notice { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; background: color-mix(in srgb, var(--accent) 10%, var(--card)); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); border-radius: 14px; padding: 13px 16px; font-size: 14.5px; margin-bottom: 12px; }
.notice span:last-child { margin-left: auto; font-weight: 600; }
.notice.plain { background: var(--card); border-color: var(--rule); justify-content: space-between; }
.notice.plain span { margin: 0; font-weight: 400; flex: 1; min-width: 200px; }
.status { font: 600 11px/1 var(--ui); letter-spacing: .04em; text-transform: uppercase; padding: 5px 8px; border-radius: 6px; background: var(--bg); color: var(--soft); white-space: nowrap; border: 1px solid var(--rule); }
.status.published { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.status.pending { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.status.returned { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }

/* sign in */
body.auth { display: grid; min-height: 100vh; min-height: 100dvh; place-items: center; }
body.auth .page { padding: 20px; width: 100%; max-width: 440px; }
.auth-card { background: var(--card); border: 1px solid var(--rule); border-radius: 22px; padding: 30px 26px; }
.auth-mark { font: 800 24px/1 var(--head); letter-spacing: -0.03em; display: flex; gap: 7px; align-items: center; margin-bottom: 26px; }
.auth-mark em { font-weight: 400; }
.auth-card h1 { font: 700 28px/1.1 var(--head); letter-spacing: -0.02em; }
.auth-card .hint { margin: 8px 0 20px; }
.auth-card .hint.small { margin: 18px 0 0; text-align: center; }

/* story list */
.chips { display: flex; gap: 8px; overflow-x: auto; margin: 14px -16px 14px; padding: 0 16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips a { font-size: 13.5px; font-weight: 600; padding: 8px 14px; border-radius: 99px; background: var(--card); border: 1px solid var(--rule); white-space: nowrap; color: var(--soft); }
.chips a.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.rows { background: var(--card); border: 1px solid var(--rule); border-radius: 16px; overflow: hidden; }
.rows li { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--rule); }
.rows li:first-child { border-top: 0; }
.row-main { display: flex; gap: 12px; align-items: center; flex: 1; min-width: 0; }
.row-main img, .noimg { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; background: var(--bg); flex: none; }
.row-text { display: grid; gap: 3px; min-width: 0; }
.row-text b { font: 600 17px/1.2 var(--head); letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.row-text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-text .note { color: var(--accent); white-space: normal; }
.blank { color: var(--soft); padding: 28px 16px !important; display: block !important; text-align: center; }
.blank.big { padding: 60px 0 !important; font-size: 17px; }

/* cards (review, live, people) */
.cards { display: grid; gap: 12px; margin-top: 14px; }
.cards li, .panel-box, .composer { background: var(--card); border: 1px solid var(--rule); border-radius: 16px; padding: 16px; display: grid; gap: 8px; }
.cards li.off { opacity: .6; }
.cards h3 { font: 600 20px/1.2 var(--head); letter-spacing: -0.012em; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cards img { border-radius: 10px; max-height: 320px; object-fit: cover; width: 100%; }
.cards p { color: var(--soft); font-size: 15px; }
.cards p.pre { white-space: pre-line; color: var(--ink); font: 400 17px/1.5 var(--text); }
.cards summary { font-size: 14px; font-weight: 600; cursor: pointer; padding: 6px 0; }
.cards small a { text-decoration: underline; }
.invite { display: flex; gap: 8px; margin-top: 4px; }
.invite input { font-size: 13px; padding: 8px 10px; min-width: 0; }
.panel-box { gap: 14px; margin-bottom: 8px; }
.field-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; }
.field-row .grow { flex: 1; min-width: 180px; }
.mini { color: var(--soft); }

/* live composer */
.composer textarea { border: 0; padding: 4px 2px; font: 400 19px/1.45 var(--text); resize: none; border-radius: 0; }
.composer textarea:focus { outline: none; }
.composer-row { display: flex; justify-content: space-between; gap: 10px; }
.live-photo img { border-radius: 12px; max-height: 280px; }
.progress { height: 6px; border-radius: 99px; background: var(--rule); overflow: hidden; margin-top: 8px; }
.progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }

/* story editor */
.story-form { display: grid; gap: 14px; }
.story-form .head-row { margin-bottom: 0; }
.t-title, .t-dek { border: 0; background: none; padding: 0; border-radius: 0; resize: none; overflow: hidden; }
.t-title { font: 700 34px/1.08 var(--head); letter-spacing: -0.025em; margin-top: 6px; }
.t-dek { font: 400 20px/1.35 var(--text); color: var(--soft); }
.t-title:focus, .t-dek:focus, .caption:focus { outline: none; }
.hero-pick { border-radius: 16px; overflow: hidden; position: relative; }
.hero-pick img, .hero-pick .hero-tools { display: none; }
.hero-pick.has img { display: block; width: 100%; max-height: 460px; object-fit: cover; }
.hero-pick.has .hero-tools { display: flex; gap: 8px; position: absolute; right: 10px; bottom: 10px; }
.hero-pick.has .drop { display: none; }
.drop { border: 1.5px dashed var(--rule); border-radius: 16px; background: var(--card); padding: 28px 16px; justify-items: center; text-align: center; cursor: pointer; color: var(--soft); gap: 4px; }
.drop svg { width: 30px; height: 30px; stroke-width: 1.5; }
.drop b { color: var(--ink); font-size: 15px; }
.hero-pick .progress { position: absolute; left: 12px; right: 12px; bottom: 12px; }
.caption { border: 0; border-bottom: 1px solid var(--rule); border-radius: 0; background: none; padding: 8px 0; font-size: 14px; }
.toolbar { display: flex; gap: 6px; overflow-x: auto; position: sticky; top: 58px; z-index: 10; background: var(--bg); padding: 8px 0; scrollbar-width: none; }
.toolbar::-webkit-scrollbar { display: none; }
.toolbar button, .tb-photo { font: 600 14px/1 var(--ui); min-width: 44px; height: 40px; padding: 0 13px; border-radius: 10px; border: 1px solid var(--rule); background: var(--card); color: var(--ink); cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; }
.toolbar button i { font-family: var(--text); font-size: 17px; }
.tb-photo { color: var(--accent); }
.editor { min-height: 320px; background: var(--card); border: 1px solid var(--rule); border-radius: 16px; padding: 18px; font: 400 19px/1.6 var(--text); overflow-wrap: break-word; }
.editor:focus { outline: 2px solid var(--ink); outline-offset: -1px; }
.editor { position: relative; }
.editor:empty::before, .editor:has(> p:only-child > br:only-child)::before { content: attr(data-placeholder); color: var(--soft); }
.editor p { margin: 0 0 1em; }
.editor:has(> p:only-child > br:only-child)::before { position: absolute; pointer-events: none; }
.editor h2, .editor h3 { font: 700 25px/1.15 var(--head); letter-spacing: -0.015em; margin: 1.3em 0 .4em; }
.editor blockquote { margin: 1.2em 0; padding-left: 16px; border-left: 3px solid var(--accent); font-style: italic; }
.editor a { text-decoration: underline; text-decoration-color: var(--accent); }
.editor figure { margin: 1.2em 0; }
.editor figure img { border-radius: 8px; width: 100%; }
.editor figcaption { font: 400 13px var(--ui); color: var(--soft); margin-top: 6px; }
.editor ul, .editor ol { padding-left: 1.2em; margin: 0 0 1em; list-style: revert; }
.panel { background: var(--card); border: 1px solid var(--rule); border-radius: 16px; padding: 4px 16px; }
.panel summary { font-weight: 600; font-size: 15px; padding: 12px 0; cursor: pointer; }
.panel[open] { padding-bottom: 16px; }
.panel > * + * { margin-top: 12px; }
.panel .btn-row { margin-top: 12px; }
.video-pick video { width: 100%; border-radius: 12px; background: #000; }
.check { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 500; }
.danger-row { text-align: center; }
.actions { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: var(--card); border-top: 1px solid var(--rule); padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); display: flex; gap: 8px; justify-content: center; }
.actions .btn { flex: 1; max-width: 240px; padding: 0 10px; }
@media (max-width: 720px) {
  .toolbar { top: 0; margin: 0 -16px; padding: 8px 16px; }
  .t-title { font-size: 29px; }
  .actions .btn { font-size: 14px; }
}
