:root {
  --indigo: #1d2340; --indigo-2: #2a3260; --kunyit: #e3a52b; --bata: #b4523a;
  --paper: #f6efe2; --ink: #22202a; --muted: #6d6676; --line: #e2d8c6; --ok: #2f7d55;
  --radius: 14px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-size: 16px; line-height: 1.45; }
body.has-nav { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
a { color: var(--indigo-2); }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: var(--indigo); color: #fff; }
.brand { color: #fff; text-decoration: none; font-weight: 700; letter-spacing: .2px; }
.brand::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%;
  background: var(--kunyit); margin-right: 8px; vertical-align: 1px; }
.wrap { max-width: 920px; margin: 0 auto; padding: 16px; }
h1 { font-size: 1.5rem; margin: 8px 0 14px; }
h2 { font-size: 1.1rem; margin: 0 0 12px; }
h3 { font-size: .95rem; margin: 18px 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.card.narrow { max-width: 420px; margin: 24px auto; }
.card.highlight { border-color: var(--kunyit); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.tag { font-size: .75rem; font-weight: 600; color: var(--muted); background: var(--paper); border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 720px) { .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tile { border: 1px solid var(--line); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 4px; min-height: 72px; }
.tile .label { font-size: .8rem; color: var(--muted); }
.tile .value { font-size: 1.2rem; font-weight: 700; }
.tile .value.empty { font-size: .9rem; font-weight: 500; color: var(--muted); }
.ypp { margin-bottom: 12px; }
.ypp-name { font-weight: 600; margin-bottom: 4px; }
.bar { height: 8px; background: var(--paper); border-radius: 999px; overflow: hidden; margin: 6px 0 2px; }
.bar span { display: block; height: 100%; background: var(--kunyit); }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
label { display: flex; flex-direction: column; gap: 4px; font-size: .9rem; color: var(--muted); }
input[type=email], input[type=password], input[type=text], input:not([type]), input[name=code] {
  font: inherit; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); min-width: 0; flex: 1; }
input.code { font-size: 1.6rem; letter-spacing: .4em; text-align: center; }
button, .button { font: inherit; border: 0; border-radius: 10px; padding: 11px 16px; cursor: pointer; text-decoration: none; display: inline-block; }
button.primary, .button { background: var(--indigo); color: #fff; }
button.danger { background: #fff; color: var(--bata); border: 1px solid var(--bata); padding: 6px 12px; }
button.link { background: none; color: #fff; padding: 4px; text-decoration: underline; }
form.inline { display: inline; margin: 0; }
.alert { background: #fbe9e4; color: var(--bata); border-radius: 10px; padding: 10px 12px; }
.notice { background: #e6f3ec; color: var(--ok); border-radius: 10px; padding: 10px 12px; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.links { margin: 0; padding-left: 18px; } .links li { padding: 6px 0; }
code.token { display: block; word-break: break-all; background: var(--paper); padding: 10px; border-radius: 8px; user-select: all; }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; display: flex; background: #fff; border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom); }
.tabbar a { flex: 1; text-align: center; padding: 14px 4px; font-size: .8rem; text-decoration: none; color: var(--muted); }
.tabbar a.on { color: var(--indigo); font-weight: 700; box-shadow: inset 0 3px 0 var(--kunyit); }
.foot { text-align: center; font-size: .8rem; color: var(--muted); padding: 8px 0 20px; }
.has-nav .foot { padding-bottom: 8px; }
.prose p, .prose li { max-width: 68ch; }
/* Phase 2: ideas and plan */
select, input[type=date] { font: inherit; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); max-width: 100%; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.seg a { text-decoration: none; padding: 8px 12px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--ink); font-size: .9rem; }
.seg a.on { background: var(--indigo); color: #fff; border-color: var(--indigo); }
.seg.small a { padding: 5px 10px; font-size: .8rem; }
.row.between { justify-content: space-between; }
.idea-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.idea-head h2 { margin: 0 0 6px; }
.idea-head h2 a { text-decoration: none; color: var(--ink); }
.score { font-weight: 800; font-size: 1.1rem; background: var(--kunyit); color: var(--ink); border-radius: 10px; padding: 4px 9px; }
.scores { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 14px; margin: 10px 0 4px; }
@media (min-width: 720px) { .scores { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.bar.risk span { background: var(--bata); }
.actions { margin-top: 10px; justify-content: space-between; }
.run { padding: 8px 0; border-bottom: 1px solid var(--line); }
.run:last-of-type { border-bottom: 0; margin-bottom: 10px; }
.tag.st-ok { background: #e6f3ec; color: var(--ok); }
.tag.st-failed { background: #fbe9e4; color: var(--bata); }
.err, .warn { color: var(--bata); }
details.card > summary, details > summary { cursor: pointer; font-weight: 600; }
.digest pre { white-space: pre-wrap; font: inherit; font-size: .85rem; background: var(--paper); padding: 10px; border-radius: 8px; }
.legend { margin-bottom: 12px; }
.chip { font-size: .75rem; font-weight: 700; border-radius: 6px; padding: 2px 8px; color: #fff; background: var(--muted); }
.chip.ch-1, .dot.ch-1 { background: var(--indigo-2); }
.chip.ch-2, .dot.ch-2 { background: var(--bata); }
.chip.ch-3, .dot.ch-3 { background: var(--ok); }
.card.day { padding: 12px 14px; }
.card.day.today { border-color: var(--kunyit); }
.card.day h2 { margin-bottom: 8px; }
.lane { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; padding: 4px 0; }
details.job { flex: 1 1 100%; }
details.job summary { font-weight: 400; }
details.job form { margin: 8px 0; }
.day-actions { margin-top: 8px; }
.day-actions form { margin: 8px 0; }
.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.dow { text-align: center; padding: 4px 0; }
.mday { min-height: 58px; border: 1px solid var(--line); border-radius: 8px; padding: 4px; text-decoration: none; color: var(--ink); display: flex; flex-wrap: wrap; gap: 3px; align-content: flex-start; }
.mday.other { opacity: .45; }
.mday.today { border-color: var(--kunyit); box-shadow: inset 0 0 0 1px var(--kunyit); }
.mday .num { flex: 1 1 100%; font-size: .8rem; font-weight: 700; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; }
.dot .code { display: none; }
@media (min-width: 720px) { .dot { width: auto; height: auto; border-radius: 4px; padding: 1px 4px; } .dot .code { display: inline; color: #fff; font-size: .7rem; } }
.mday .warn, .mday .paused { font-size: .75rem; font-weight: 700; }
