/* Sati's one look (Owner, 2026-10-13): the same colors, dark mode and navigation on every /m/ page.
   Pages link this before their own <style>; their own rules use these tokens and never define colors. */
:root {
  --page: #eef1f5; --card: #ffffff; --soft: #f4f6f9; --line: #cdd4df; --track: #e1e6ee;
  --ink: #1c2740; --muted: #56617a; --accent: #1c2740; --on-accent: #ffffff; --focus: #5d86d6;
  --bad: #b2402c; --on-bad: #ffffff; --warn: #9a5b12; --ok: #2b6657;
  --wait-bg: #f6e1d9; --wait-fg: #7d2a19; --wait-line: #b2402c;
  --work-bg: #dde6f6; --work-fg: #213f72; --work-line: #3d5f8f;
  --done-bg: #dbece4; --done-fg: #1d5844; --done-line: #2b6657;
  --hot-bg: #fff2cf; --hot-fg: #5c4400; --hot-line: #d39b12;
  --ask-bg: #fff3cd; --ask-fg: #5c4400;
  /* Each Project keeps one color, shown only on its small icon. Kept apart from the state colors. */
  --p0: #6b4fa0; --p1: #137c7c; --p2: #a8650f; --p3: #a3407c; --p4: #4a6a1f; --p5: #2f5fa8; --p6: #8a5a3c; --p7: #5a6478;
  --on-p: #ffffff;
  /* The names the older pages use, pointing at the same colors */
  --bg: var(--page); --surface: var(--card); --fg: var(--ink); --chip: var(--soft); --ready: var(--work-bg);
  --ink-2: #26334f; --on-ink: #eef1f6; --on-ink-2: #b9c3d6;
  --nav-h: 64px; --rail-w: 84px; --side-w: 232px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --page: #121823; --card: #1a2230; --soft: #202a3a; --line: #2e3a4e; --track: #26324a;
  --ink: #e4e9f2; --muted: #9aa6bc; --accent: #9db8ee; --on-accent: #0f1726; --focus: #9db8ee;
  --bad: #f0907f; --on-bad: #2a0f0a; --warn: #e2b04a; --ok: #6cc29a;
  --wait-bg: #3a211b; --wait-fg: #f3c2b4; --wait-line: #e4806f;
  --work-bg: #1c2a44; --work-fg: #bcd0f5; --work-line: #8fb0ee;
  --done-bg: #17302a; --done-fg: #b5e0cf; --done-line: #6cc29a;
  --hot-bg: #3a2f12; --hot-fg: #f5dc9a; --hot-line: #e2b04a;
  --ask-bg: #3a2f12; --ask-fg: #f5dc9a;
  --p0: #b99aea; --p1: #5cc7c4; --p2: #e3a552; --p3: #e58bbd; --p4: #a6cf6a; --p5: #8fb0ee; --p6: #d9a27e; --p7: #aab3c5;
  --on-p: #10151f; --ink-2: #26334f; --on-ink: #10151f; --on-ink-2: #3a4560;
  color-scheme: dark; } }
:root[data-theme="dark"] {
  --page: #121823; --card: #1a2230; --soft: #202a3a; --line: #2e3a4e; --track: #26324a;
  --ink: #e4e9f2; --muted: #9aa6bc; --accent: #9db8ee; --on-accent: #0f1726; --focus: #9db8ee;
  --bad: #f0907f; --on-bad: #2a0f0a; --warn: #e2b04a; --ok: #6cc29a;
  --wait-bg: #3a211b; --wait-fg: #f3c2b4; --wait-line: #e4806f;
  --work-bg: #1c2a44; --work-fg: #bcd0f5; --work-line: #8fb0ee;
  --done-bg: #17302a; --done-fg: #b5e0cf; --done-line: #6cc29a;
  --hot-bg: #3a2f12; --hot-fg: #f5dc9a; --hot-line: #e2b04a;
  --ask-bg: #3a2f12; --ask-fg: #f5dc9a;
  --p0: #b99aea; --p1: #5cc7c4; --p2: #e3a552; --p3: #e58bbd; --p4: #a6cf6a; --p5: #8fb0ee; --p6: #d9a27e; --p7: #aab3c5;
  --on-p: #10151f; --ink-2: #26334f; --on-ink: #10151f; --on-ink-2: #3a4560;
  color-scheme: dark; }
html { background: var(--page); }
body { background: var(--page); color: var(--ink); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------- Navigation: the same 5 places; bottom bar < 600px, icon rail 600–959px, sidebar ≥ 960px ---------- */
body.m-has-nav { padding-bottom: calc(env(safe-area-inset-bottom, 0px) + var(--nav-h) + 20px) !important; }
.m-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--card); border-top: 1px solid var(--line); padding: 6px 4px calc(env(safe-area-inset-bottom, 0px) + 6px); }
.m-nav .m-n { display: grid; justify-items: center; align-content: center; gap: 2px; min-height: 50px; padding: 4px 0; position: relative;
  text-decoration: none; color: var(--muted); font-size: 12px; border-radius: 12px; }
.m-nav .m-n svg { width: 24px; height: 24px; }
.m-nav .m-n[aria-current="page"] { color: var(--accent); font-weight: 700; }
.m-nav .m-n[aria-current="page"] svg { stroke-width: 2.2; }
.m-nav .m-badge { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--wait-line); color: var(--on-bad); font-size: 11px; line-height: 18px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.m-nav .m-badge:empty { display: none; }
.m-nav .m-brand, .m-nav .m-side { display: none; }
@media (min-width: 600px) {
  body.m-has-nav { padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 28px) !important; padding-left: calc(var(--rail-w) + 16px) !important; }
  .m-nav { right: auto; top: 0; width: var(--rail-w); grid-template-columns: 1fr; grid-auto-rows: min-content; align-content: start; gap: 4px;
    border-top: 0; border-right: 1px solid var(--line); padding: calc(env(safe-area-inset-top, 0px) + 12px) 6px 12px; overflow-y: auto; }
  .m-nav .m-brand { display: grid; place-items: center; padding: 2px 0 10px; }
  .m-nav .m-brand img { width: 34px; height: 34px; border-radius: 9px; }
  .m-nav .m-brand span { display: none; }
  .m-nav .m-n { min-height: 60px; }
  .m-nav .m-n[aria-current="page"] { background: var(--soft); }
  .m-nav .m-badge { left: calc(50% + 4px); }
}
@media (min-width: 960px) {
  body.m-has-nav { padding-left: calc(var(--side-w) + 24px) !important; }
  .m-nav { width: var(--side-w); display: flex; flex-direction: column; gap: 2px; padding: calc(env(safe-area-inset-top, 0px) + 14px) 12px 14px; }
  .m-nav .m-brand { display: flex; align-items: center; gap: 10px; justify-content: flex-start; padding: 2px 8px 14px; font-weight: 800; font-size: 17px; color: var(--ink); text-decoration: none; }
  .m-nav .m-brand img { width: 30px; height: 30px; }
  .m-nav .m-brand span { display: inline; }
  .m-nav .m-n { grid-template-columns: 22px 1fr auto; justify-items: start; align-items: center; gap: 10px; min-height: 42px; padding: 0 10px; font-size: 15px; }
  .m-nav .m-n svg { width: 20px; height: 20px; }
  .m-nav .m-badge { position: static; justify-self: end; }
  .m-nav .m-side { display: grid; gap: 2px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
  .m-nav .m-side[hidden] { display: none; }
  .m-nav .m-side h4 { margin: 0 0 4px; padding: 0 10px; font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: .04em; }
  .m-nav .m-side.m-rel { margin-top: auto; border-top: 0; }
}
.m-agent { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 8px; font-size: 14px; color: var(--ink); text-decoration: none; }
.m-agent:hover { background: var(--soft); }
.m-agent b { font-weight: 600; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-agent small { color: var(--muted); font-size: 12px; white-space: nowrap; }
.m-lt { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; border: 1.5px solid var(--muted); }
.m-lt.blue { background: var(--work-line); border-color: var(--work-line); animation: m-pulse 1.6s ease-in-out infinite; }
.m-lt.green { background: var(--done-line); border-color: var(--done-line); }
.m-lt.red { background: var(--bad); border-color: var(--bad); border-radius: 2px; }
@keyframes m-pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .m-lt.blue { animation: none; } }
/* 上线 is always reachable; a quiet state is visibly available but deliberately subdued. */
.m-release { display: grid; gap: 2px; width: 100%; text-align: left; border-radius: 10px; border: 1px solid var(--hot-line); background: var(--hot-bg); color: var(--hot-fg);
  padding: 10px 12px; font-size: 13px; text-decoration: none; }
.m-release b { font-size: 14px; }
.m-release.quiet { border-color: var(--line); background: var(--soft); color: var(--muted); }

/* ---------- Back: every page below the 5 places says where back goes ---------- */
.m-back { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 6px 0 0; margin: -6px 0 -6px; border: 0; background: transparent;
  color: var(--accent); font: inherit; font-size: 16px; font-weight: 600; text-decoration: none; cursor: pointer; max-width: 100%; justify-self: start; }
.m-back span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Project icon: a small square in the Project's color with a short name ---------- */
.plogo { width: 26px; height: 26px; border-radius: 7px; background: var(--pc, var(--p7)); color: var(--on-p); display: inline-grid; place-items: center; flex: none;
  font-size: 12px; font-weight: 800; letter-spacing: -.02em; line-height: 1; }
