:root {
  --bg: #f7f4ee; --card: #fff; --ink: #1f1c17; --muted: #6f695e; --line: #e6dfd2; --gold: #a8812c; --gold-soft: #f3ead6;
  --ok: #2e7550; --ok-soft: #e3f1e8; --warn: #a35a12; --warn-soft: #fbeedd; --err: #a72a22; --err-soft: #f9e2df;
  --radius: 12px; font-size: 16px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 1rem/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
a { color: inherit; }
main { max-width: 980px; margin: 0 auto; padding: 12px 14px 32px; }
h1 { font-size: 1.35rem; margin: 8px 0 12px; }
h2 { font-size: 1.05rem; margin: 0 0 10px; }
h3 { font-size: .95rem; margin: 0 0 6px; }
p { margin: 0 0 8px; }
.top { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; background: var(--ink); color: #fff; position: sticky; top: 0; z-index: 3; }
.brand { text-decoration: none; font-weight: 700; letter-spacing: .02em; }
.brand span { color: #d9bd7c; font-weight: 500; }
.tabs { position: fixed; bottom: 0; left: 0; right: 0; display: flex; background: var(--card); border-top: 1px solid var(--line); z-index: 3; padding-bottom: env(safe-area-inset-bottom); }
.tabs a { flex: 1; text-align: center; padding: 12px 2px; font-size: .78rem; text-decoration: none; color: var(--muted); }
.tabs a.on { color: var(--gold); font-weight: 700; box-shadow: inset 0 3px 0 var(--gold); }
@media (min-width: 760px) {
  body { padding-bottom: 0; }
  .tabs { position: sticky; top: 50px; bottom: auto; border-top: 0; border-bottom: 1px solid var(--line); }
  .tabs a { font-size: .9rem; }
}
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin: 0 0 14px; }
.card.focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.muted { color: var(--muted); font-size: .9rem; }
.small { font-size: .82rem; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.between { justify-content: space-between; }
.grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.stat b { display: block; font-size: 1.5rem; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: .78rem; background: var(--gold-soft); color: var(--gold); font-weight: 600; white-space: nowrap; }
.pill-ok { background: var(--ok-soft); color: var(--ok); }
.pill-warn { background: var(--warn-soft); color: var(--warn); }
.pill-err { background: var(--err-soft); color: var(--err); }
.pill-grey { background: #eee; color: var(--muted); }
.pill-tool { background: #e6effc; color: #2456a6; }
button.small-btn { font-size: .8rem; padding: 4px 9px; margin-top: 6px; }
.flash { padding: 10px 12px; border-radius: var(--radius); margin: 0 0 12px; }
.flash.ok { background: var(--ok-soft); color: var(--ok); }
.flash.err { background: var(--err-soft); color: var(--err); }
.banner { background: var(--err-soft); border-color: #efc2bc; }
.todo { list-style: none; padding: 0; margin: 0; }
.todo li { padding: 8px 0; border-top: 1px solid var(--line); }
.todo li:first-child { border-top: 0; }
.ok-mark { color: var(--ok); font-weight: 700; }
.ko-mark { color: var(--err); font-weight: 700; }
.warn-mark { color: var(--warn); font-weight: 700; }
button, .btn { font: inherit; font-size: .92rem; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 10px; padding: 9px 13px; cursor: pointer; text-decoration: none; display: inline-block; }
button.primary, .btn.primary { background: var(--ink); color: #fff; border-color: var(--ink); }
button.gold { background: var(--gold); border-color: var(--gold); color: #fff; }
button.danger { color: var(--err); border-color: #efc2bc; }
button:disabled { opacity: .5; cursor: default; }
input, select, textarea { font: inherit; font-size: .95rem; width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); }
textarea { min-height: 180px; line-height: 1.4; }
label { display: block; font-size: .85rem; color: var(--muted); margin: 8px 0 4px; }
form { margin: 0; }
form.inline { display: inline; }
.fields { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); align-items: end; }
details { border-top: 1px solid var(--line); padding: 8px 0 0; margin-top: 8px; }
summary { cursor: pointer; color: var(--muted); font-size: .9rem; }
pre.mail { white-space: pre-wrap; font: .95rem/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: #fbf9f5; border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin: 8px 0; overflow-wrap: anywhere; }
.list { list-style: none; padding: 0; margin: 0; }
.list > li { padding: 10px 0; border-top: 1px solid var(--line); }
.list > li:first-child { border-top: 0; }
.list .removed { opacity: .55; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: .8rem; }
td { font-variant-numeric: tabular-nums; }
.nums td:not(:first-child), .nums th { white-space: nowrap; }
.scroll { overflow-x: auto; }
.board { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 10px; scroll-snap-type: x mandatory; }
.col { flex: 0 0 230px; background: #efe9de; border-radius: var(--radius); padding: 10px; scroll-snap-align: start; max-height: 75vh; overflow-y: auto; }
.col h3 { display: flex; justify-content: space-between; }
.mini { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin: 0 0 8px; text-decoration: none; font-size: .88rem; }
.mini b { display: block; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 120px; border-bottom: 1px solid var(--line); }
.bars span { flex: 1; background: var(--gold); border-radius: 3px 3px 0 0; min-height: 1px; }
.bars span.zero { background: var(--line); }
.meter { height: 10px; background: var(--line); border-radius: 99px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--gold); }
.meter i.full { background: var(--err); }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: 8px 0 8px 14px; border-left: 2px solid var(--line); margin-left: 4px; }
.timeline li.out { border-left-color: var(--gold); }
.timeline li.in { border-left-color: var(--ok); }
.log { white-space: pre-wrap; font: .85rem/1.5 ui-monospace, Menlo, monospace; background: #fbf9f5; border-radius: 10px; padding: 10px; border: 1px solid var(--line); margin: 8px 0 0; }
.login { max-width: 360px; margin: 12vh auto; }

