/* Will OS — grown out of the Four Days dashboard styles */
:root {
  --bg: #f6f5f1;
  --card: #ffffff;
  --ink: #21211d;
  --muted: #6d6c64;
  --line: #e4e2da;
  --p1: #3e6b4f; /* mountain green */
  --p2: #b05c2a; /* van orange */
  --p3: #8c1d2f; /* USC crimson */
  --p4: #3d5a73; /* robot steel */
  --p5: #8a6d1f; /* runway gold */
  --p6: #2e7d84; /* pool teal */
  --think: #5b4fc4; /* think violet */
  --money: #8a6d1f;
  --make: #4d6b3e;
  --sprint: #4a4a45;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 -apple-system, "Segoe UI", system-ui, sans-serif;
  padding: 0 0 4rem;
}
header.site {
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid var(--line);
  background: var(--card);
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem 1.25rem;
  position: sticky; top: 0; z-index: 5;
}
header.site .brand { font-weight: 700; letter-spacing: .02em; text-decoration: none; color: var(--ink); }
header.site nav { display: flex; flex-wrap: wrap; gap: .9rem; font-size: .88rem; }
header.site nav a { color: var(--muted); text-decoration: none; cursor: pointer; }
header.site nav a:hover, header.site nav a.here { color: var(--ink); }
main { max-width: 1080px; margin: 0 auto; padding: 2rem 1.25rem; }
h1 { font-size: 1.7rem; line-height: 1.2; margin-bottom: .4rem; }
h2 { font-size: 1.05rem; margin: 2.2rem 0 .7rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); border-bottom: 1px solid var(--line); padding-bottom: .3rem; }
h3 { font-size: 1rem; margin: 1.2rem 0 .4rem; }
p.lede { color: var(--muted); max-width: 46rem; }

.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin-top: 1rem; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 1.1rem 1.2rem; display: block; color: var(--ink); text-decoration: none;
  border-top: 4px solid var(--ac, var(--sprint));
  transition: transform .08s ease;
}
a.card:hover { transform: translateY(-2px); }
.card .num { font-size: .75rem; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.card h3 { margin: .15rem 0 .35rem; font-size: 1.05rem; }
.card p { font-size: .88rem; color: var(--muted); }
.badge {
  display: inline-block; font-size: .7rem; font-weight: 600; letter-spacing: .05em;
  padding: .15rem .55rem; border-radius: 99px; margin-top: .6rem; text-transform: uppercase;
}
.badge.done { background: #e3efe7; color: #2c5e40; }
.badge.active { background: #fdeeda; color: #92551f; }
.badge.queued { background: #ececea; color: #6d6c64; }
.badge.urgent { background: #f7e0dc; color: #8f2f22; }

.kpi-row { display: flex; flex-wrap: wrap; gap: 1rem; margin: 1.2rem 0; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: .7rem 1rem; min-width: 150px; flex: 1; }
.kpi .v { font-size: 1.25rem; font-weight: 700; }
.kpi .l { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.kpi .s { font-size: .72rem; color: var(--muted); margin-top: .15rem; }

.callout { background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--ac, var(--sprint)); border-radius: 8px; padding: .9rem 1.1rem; margin: 1rem 0; font-size: .93rem; }

table.mini { width: 100%; border-collapse: collapse; font-size: .82rem; margin-top: .5rem; }
table.mini th, table.mini td { text-align: left; padding: .3rem .4rem; border-bottom: 1px solid var(--line); }
table.mini th { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
table.mini tr:last-child td { border-bottom: none; }
table.mini td.num, table.mini th.num { text-align: right; font-variant-numeric: tabular-nums; }
.gain { color: #2c5e40; } .loss { color: #a33b2e; }

.machine {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: .5rem 1rem; margin-top: 1rem;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 0 1.5rem;
}
.machine-empty { font-size: .85rem; color: var(--muted); padding: .4rem 0; }
.mrow { display: flex; align-items: baseline; gap: .5rem; padding: .42rem 0; border-bottom: 1px solid var(--line); font-size: .85rem; min-width: 0; }
.mrow .dot { width: .55rem; height: .55rem; border-radius: 50%; flex: none; align-self: center; }
.dot.ok { background: #3e8e5a; } .dot.warn { background: #d9a13b; } .dot.fail { background: #c0472f; } .dot.idle { background: #9b998e; }
.mrow .name { font-weight: 600; white-space: nowrap; }
.mrow .note { color: var(--muted); font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.mrow .when { color: var(--muted); font-size: .72rem; white-space: nowrap; margin-left: auto; }
html.dark .dot.ok { background: #5cae7c; } html.dark .dot.warn { background: #dbb15e; } html.dark .dot.fail { background: #d76a52; }

.cfilter { display: flex; gap: .4rem; margin-top: 1.6rem; }
.cfilter button {
  font: inherit; font-size: .72rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
  padding: .25rem .7rem; border-radius: 99px; border: 1px solid var(--line);
  background: var(--card); color: var(--muted); cursor: pointer;
}
.cfilter button.on { color: var(--ink); border-color: var(--muted); }
.card { position: relative; }
.cedit {
  position: absolute; top: .5rem; right: .6rem; border: none; background: none;
  color: var(--muted); font-size: 1rem; cursor: pointer; padding: 0 .2rem; opacity: 0;
}
.card:hover .cedit, .mrow:hover .cedit { opacity: 1; }
.cmenu {
  position: absolute; z-index: 50; background: var(--card); border: 1px solid var(--line);
  border-radius: 8px; box-shadow: 0 4px 14px rgba(0,0,0,.25); display: flex; flex-direction: column; min-width: 8rem;
}
.cmenu button { font: inherit; font-size: .85rem; text-align: left; padding: .45rem .8rem; border: none; background: none; color: var(--ink); cursor: pointer; }
.cmenu button:hover { background: var(--bg); }
.scount { font-size: .75rem; color: var(--muted); font-weight: 400; }
.srow .name { overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.srow .note { flex: none; max-width: 40%; }
.srow-edit { margin-left: .3rem; position: static; }
details.more { margin-top: .5rem; }
details.more summary { font-size: .8rem; color: var(--muted); cursor: pointer; padding: .2rem 0; }

.src { font-size: .8rem; color: var(--muted); margin-top: 1.6rem; }
.src a { color: var(--muted); }

/* dark mode — toggled by js/theme.js via html.dark */
html.dark { color-scheme: dark; }
html.dark body, html.dark { --bg: #1a1a18; --card: #242422; --ink: #e7e5de; --muted: #9b998e; --line: #3a3a36; }
html.dark .badge.done { background: #22382b; color: #8fc9a5; }
html.dark .badge.active { background: #3d2f1c; color: #e0b073; }
html.dark .badge.queued { background: #2e2e2b; color: #a09e93; }
html.dark .badge.urgent { background: #44231e; color: #e0968a; }
html.dark .gain { color: #8fc9a5; }
html.dark .loss { color: #e0968a; }
