/* 21-Day Content Challenge: mobile-first, deep blue + orange */
:root {
  --blue: #16307a; --blue2: #2348b8; --blue-soft: #e8eefc; --orange: #f97316; --orange-soft: #fff1e6;
  --ink: #111827; --muted: #6b7280; --line: #e5e7eb; --bg: #f4f6fb; --card: #fff;
  --ok: #0f9d58; --ok-soft: #e6f6ed; --warn: #b45309; --warn-soft: #fff7e6; --bad: #c62828; --bad-soft: #fdecec;
  --r: 14px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", sans-serif; background: var(--bg); color: var(--ink); }
a { color: var(--blue2); }
h1 { font-size: 1.45rem; margin: .3rem 0 .6rem; }
h1 small { font-size: .85rem; font-weight: 500; }
h2 { font-size: 1.05rem; margin: 0 0 .6rem; }
.muted { color: var(--muted); }
.small, small { font-size: .82rem; }
.center { text-align: center; }
.good { color: var(--ok); font-weight: 600; }
.bad { color: var(--bad); }
.nowrap { white-space: nowrap; }
code, .code { font-family: ui-monospace, Menlo, monospace; background: var(--blue-soft); padding: 1px 6px; border-radius: 6px; }

.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); background: var(--blue); color: #fff; }
.brand { display: flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; font-weight: 700; }
.logo { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--orange); color: #fff; font-weight: 800; }
.bell { position: relative; color: #fff; text-decoration: none; font-size: 1.2rem; }
.bell .dot { position: absolute; top: -6px; right: -10px; background: var(--orange); color: #fff; font-size: .7rem; border-radius: 10px; padding: 0 5px; font-weight: 700; }
.adminnav { display: flex; gap: 4px; overflow-x: auto; padding: 8px 12px; background: #fff; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.adminnav a { white-space: nowrap; padding: 6px 10px; border-radius: 8px; text-decoration: none; color: var(--ink); font-size: .9rem; }
.adminnav a.on { background: var(--blue); color: #fff; }

.wrap { max-width: 860px; margin: 0 auto; padding: 14px 16px 96px; }
.bottomnav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; display: flex; justify-content: space-around; background: #fff;
  border-top: 1px solid var(--line); padding: 6px 4px; padding-bottom: max(6px, env(safe-area-inset-bottom)); }
.bottomnav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; font-size: .72rem; color: var(--muted); text-decoration: none; padding: 4px 0; border-radius: 10px; }
.bottomnav a span { font-size: 1.25rem; }
.bottomnav a.on { color: var(--blue); font-weight: 700; background: var(--blue-soft); }

.card { background: var(--card); border-radius: var(--r); padding: 14px; margin: 0 0 12px; box-shadow: 0 1px 2px rgba(17,24,39,.06); border: 1px solid #edf0f6; }
.card.link { display: block; text-decoration: none; color: inherit; }
.card.warnbox { border-color: #f6d39a; background: var(--warn-soft); }
.flash { padding: 10px 12px; border-radius: 10px; margin: 0 0 10px; background: var(--ok-soft); color: #075e35; }
.flash.err { background: var(--bad-soft); color: var(--bad); }
.flash.warn { background: var(--warn-soft); color: var(--warn); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.grid2, .grid3, .grid4 { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .grid2 { grid-template-columns: 1fr 1fr; } .grid3 { grid-template-columns: repeat(3, 1fr); } .grid4 { grid-template-columns: repeat(4, 1fr); } }
.wrapline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

label { display: block; font-size: .85rem; font-weight: 600; margin: 0 0 10px; color: #374151; }
input, select, textarea { display: block; width: 100%; margin-top: 4px; padding: 10px 12px; border: 1px solid #cfd5e3; border-radius: 10px; font: inherit; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--blue2); outline-offset: 0; border-color: transparent; }
label.check, .inline-label { display: flex; align-items: center; gap: 8px; font-weight: 500; }
label.check input { width: auto; margin: 0; }
form.inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0; }
form.inline input, form.inline select { width: auto; margin: 0; flex: 1 1 140px; }
.inline-label select { width: auto; margin: 0; }
.title-input { font-weight: 700; font-size: 1rem; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 10px; padding: 10px 16px; font: inherit; font-weight: 700;
  background: var(--orange); color: #fff; cursor: pointer; text-decoration: none; }
.btn:hover { filter: brightness(.96); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.big { padding: 14px 18px; font-size: 1.05rem; }
.btn.wide { width: 100%; }
.btn.small { padding: 6px 10px; font-size: .85rem; }
.btn.ghost { background: var(--blue-soft); color: var(--blue); }
.btn.danger { background: var(--bad-soft); color: var(--bad); }

.hero { background: linear-gradient(135deg, var(--blue), var(--blue2)); color: #fff; border-radius: 18px; padding: 16px; margin-bottom: 12px; }
.hero .muted, .hero .eyebrow { color: #c9d6ff; }
.hero h1 { margin: 2px 0; font-size: 1.7rem; }
.hero h1 small { color: #c9d6ff; }
.hero-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.eyebrow { margin: 0; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.hero .btn.big { margin-top: 12px; }
.hero .center.muted { margin: 6px 0 0; }
.done-banner { margin-top: 12px; background: rgba(255,255,255,.14); border-radius: 12px; padding: 12px; text-align: center; font-weight: 700; }

.ring { position: relative; width: 112px; height: 112px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 11; }
.ring-bg { stroke: rgba(255,255,255,.22); }
.ring-fg { stroke: var(--orange); stroke-linecap: round; transition: stroke-dashoffset .6s; }
.ring-fg.full { stroke: #34d399; }
.ring-txt { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-txt b { font-size: 1.6rem; }
.ring-txt small { color: #c9d6ff; }

.countdown { margin-top: 12px; display: flex; justify-content: space-between; align-items: center; background: rgba(0,0,0,.18); border-radius: 12px; padding: 10px 12px; }
.cd-time { font-variant-numeric: tabular-nums; font-size: 1.35rem; font-weight: 800; letter-spacing: .02em; }
.countdown.urgent .cd-time { color: #fdba74; }
.cd-label { font-size: .85rem; color: #dbe4ff; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 0 12px; }
@media (min-width: 640px) { .stats { grid-template-columns: repeat(6, 1fr); } }
.stat { background: #fff; border-radius: 12px; padding: 10px 6px; text-align: center; border: 1px solid #edf0f6; }
.stat b { display: block; font-size: 1.15rem; }
.stat small { color: var(--muted); }

.bar { height: 10px; background: #e7ebf4; border-radius: 6px; overflow: hidden; margin: 6px 0; }
.bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--orange), #fb923c); border-radius: 6px; transition: width .6s; }

.vlist { list-style: none; margin: 0; padding: 0; }
.vlist li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--line); }
.vlist li:first-child { border-top: 0; }
.vnum { flex: none; display: grid; place-items: center; min-width: 30px; height: 30px; border-radius: 8px; background: var(--ok-soft); color: var(--ok); font-weight: 800; font-size: .8rem; }
.vlist li.extra .vnum { background: #eef0f4; color: var(--muted); }
.vmain { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.vmain small { display: block; color: var(--muted); }
.vside { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.views-form { margin-top: 6px !important; }
.views-form input { max-width: 120px; padding: 6px 8px; }
.vt { font-size: .7rem; font-weight: 700; padding: 2px 7px; border-radius: 20px; white-space: nowrap; }
.vt.ok { background: var(--ok-soft); color: var(--ok); }
.vt.self { background: #eef0f4; color: var(--muted); }

.chip { display: inline-block; font-size: .75rem; font-weight: 700; padding: 3px 9px; border-radius: 20px; background: var(--blue-soft); color: var(--blue); white-space: nowrap; }
.chip.big { font-size: .9rem; }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.part { background: var(--orange-soft); color: #c2410c; }
.chip.none { background: var(--bad-soft); color: var(--bad); }

.tabs, .pills { display: flex; gap: 6px; overflow-x: auto; margin: 0 0 10px; scrollbar-width: none; }
.tabs a, .pills a { white-space: nowrap; text-decoration: none; padding: 7px 12px; border-radius: 20px; background: #fff; color: var(--ink); border: 1px solid var(--line); font-size: .88rem; }
.tabs a.on { background: var(--blue); color: #fff; border-color: var(--blue); }
.pills a.on { background: var(--orange-soft); border-color: var(--orange); color: #c2410c; font-weight: 700; }

.rank-card { display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 12px; padding: 10px 12px; margin: 0 0 6px; border: 1px solid #edf0f6; }
.rank-card.me { border: 2px solid var(--orange); }
.rank-card.top1 { background: linear-gradient(90deg, #fff7e0, #fff); }
.rank-card .rk { width: 36px; text-align: center; font-weight: 800; font-size: 1.05rem; }
.rank-card .who { flex: 1; min-width: 0; }
.rank-card .who small { display: block; color: var(--muted); }
.rank-card .pts { text-align: right; }
.rank-card .pts b { display: block; font-size: 1.1rem; }
.rank-card .pts small { color: var(--muted); }
.mv { width: 30px; text-align: center; font-size: .75rem; font-weight: 700; }
.mv.up { color: var(--ok); } .mv.down { color: var(--bad); } .mv.same { color: #cbd5e1; }

.batch-card { background: #fff; border-radius: var(--r); padding: 14px; margin: 0 0 10px; border: 1px solid #edf0f6; }
.batch-card.me { border: 2px solid var(--orange); }
.batch-card h2 { margin: 0; }
.score { font-size: 1.4rem; color: var(--blue); }
.parts { display: grid; grid-template-columns: 1fr; gap: 6px; margin: 8px 0; }
@media (min-width: 560px) { .parts { grid-template-columns: 1fr 1fr; } }
.parts > div { display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 8px; }
.parts small { grid-column: 1 / -1; color: var(--muted); }

table { width: 100%; border-collapse: collapse; }
table.check td, table.check th, table.list td, table.list th { text-align: left; padding: 8px 6px; border-top: 1px solid var(--line); vertical-align: top; }
table th { font-size: .78rem; color: var(--muted); font-weight: 600; border-top: 0 !important; }
table tr.me { background: var(--orange-soft); }
table tr.off { opacity: .5; }
table.people .actions form { justify-content: flex-end; }
.audit td { font-size: .82rem; }
.leader-remind { margin-top: 10px; display: flex; flex-direction: column; gap: 4px; }
.brow { display: grid; grid-template-columns: 1fr; gap: 2px; padding: 8px 0; border-top: 1px solid var(--line); text-decoration: none; color: inherit; }
.brow:first-of-type { border-top: 0; }

.daychart { display: flex; align-items: flex-end; gap: 3px; height: 90px; margin-top: 10px; }
.daychart .col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; text-decoration: none; }
.daychart .col span { display: block; width: 100%; background: var(--blue2); border-radius: 4px 4px 0 0; min-height: 2px; }
.daychart .col.perfect span { background: var(--ok); }
.daychart small { font-size: .6rem; color: var(--muted); }

.calendar { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (min-width: 560px) { .calendar { grid-template-columns: repeat(7, 1fr); } }
.cal-day { border-radius: 12px; padding: 8px; text-align: center; background: #fff; border: 1px solid var(--line); display: flex; flex-direction: column; gap: 1px; }
.cal-day b { font-size: 1.1rem; }
.cal-day .cd-n { font-size: .72rem; color: var(--muted); }
.cal-day.full { background: var(--ok-soft); border-color: #a7e3c2; }
.cal-day.part { background: var(--orange-soft); border-color: #fdc79a; }
.cal-day.miss { background: var(--bad-soft); border-color: #f5b5b5; }
.cal-day.today { border: 2px solid var(--blue2); }
.cal-day.up { opacity: .55; }
.cal-day small.ok { color: var(--ok); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; font-size: .8rem; margin-bottom: 10px; }
.legend .cal { display: inline-block; width: 14px; height: 14px; border-radius: 4px; border: 1px solid var(--line); vertical-align: middle; margin-right: -6px; }
.legend .cal.full { background: var(--ok-soft); } .legend .cal.part { background: var(--orange-soft); } .legend .cal.miss { background: var(--bad-soft); }
.legend .cal.today { border: 2px solid var(--blue2); } .legend .cal.up { background: #fff; }

.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; }
.badge { background: var(--blue-soft); border-radius: 12px; padding: 10px 6px; text-align: center; display: flex; flex-direction: column; gap: 2px; }
.badge .b-icon { font-size: 1.6rem; }
.badge .b-name { font-weight: 700; font-size: .82rem; }
.badge small { color: var(--muted); font-size: .72rem; }
.badges.dim .badge { filter: grayscale(1); opacity: .5; }
.wall { list-style: none; padding: 0; margin: 0; }
.wall li { padding: 6px 0; border-top: 1px solid var(--line); }
.wall li span { margin-right: 6px; }

.menu { padding: 0; }
.menu a { display: block; padding: 14px; border-top: 1px solid var(--line); text-decoration: none; color: var(--ink); font-weight: 600; }
.menu a:first-child { border-top: 0; }
.notes { list-style: none; padding: 0; margin: 0; }
.notes li a { display: block; background: #fff; border-radius: 12px; padding: 10px 12px; margin-bottom: 6px; text-decoration: none; color: var(--ink); border: 1px solid #edf0f6; }
.notes li.unread a { border-left: 4px solid var(--orange); }
.notes li span { display: block; }
.notes li small { color: var(--muted); }
.fl-row { display: grid; gap: 4px; padding: 10px 0; border-top: 1px solid var(--line); }
.fl-row:first-of-type { border-top: 0; }
.review.rejected { opacity: .7; }
details summary { cursor: pointer; color: var(--blue2); font-weight: 600; margin: 4px 0; }

.auth { background: linear-gradient(160deg, var(--blue), #0c1d4f); min-height: 100vh; }
.auth-box { max-width: 420px; margin: 0 auto; padding: 32px 16px; }
.auth-logo { text-align: center; color: #fff; margin-bottom: 16px; }
.auth-logo .logo { width: 56px; height: 56px; font-size: 1.5rem; border-radius: 16px; }
.auth-logo h1 { margin: 10px 0 2px; }
.auth-logo .muted { color: #c9d6ff; }
.auth .center.muted { color: #c9d6ff; }
.auth .center.muted a { color: #fff; }
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 46px; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); margin-top: 2px; border: 0; background: transparent; font-size: 1.15rem; cursor: pointer; padding: 6px; line-height: 1; }
