/* JarvisDaily City. Design tokens from the screens canvas (docs/SCREENS.md). */
:root {
  --rail: #141A3D; --rail-2: #1E2550; --rail-hover: #232A55; --rail-text: #D9DCEF; --rail-muted: #8E93B8;
  --paper: #F6F3EC; --card: #FFFFFF; --line: #E4DED0; --line-soft: #EFEAE0; --warm: #FBF8F1; --warm-line: #EFE6D2;
  --ink: #1B1D2E; --ink-2: #4A4D63; --ink-3: #5B5E73; --navy: #141A3D; --link: #1E3A8A;
  --gold: #C99A2E; --amber: #B26A00; --amber-text: #8A5200; --blue: #2A78D6; --ok: #1F6FC4; --idle: #9AA0BF;
  --red: #B42318; --green: #1E7B45; --soft-blue: #EEF1FB; --panel: #F4F6FC;
  --serif: "Fraunces", Georgia, serif; --sans: "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--sans); color: var(--ink); background: var(--paper); font-size: 15px; line-height: 1.45; }
a { color: var(--link); } a:hover { color: #172554; }
h1, h2, h3 { color: var(--navy); }
h1 { font-family: var(--serif); font-weight: 600; font-size: 32px; margin: 4px 0 0; line-height: 1.15; }
h2 { font-size: 16px; font-weight: 600; margin: 0; }
.mono { font-family: var(--mono); }
.label { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }
.muted { color: var(--ink-2); } .small { font-size: 13px; } .tiny { font-size: 12px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; }
.stack { display: flex; flex-direction: column; gap: 12px; } .row { display: flex; gap: 10px; align-items: center; }
.grow { flex-grow: 1; } .right { margin-left: auto; } .wrap { flex-wrap: wrap; }

/* layout */
.shell { display: flex; min-height: 100vh; }
.rail { width: 244px; flex-shrink: 0; background: var(--rail); display: flex; flex-direction: column; padding: 22px 14px;
  gap: 18px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; color: #fff; text-decoration: none; }
.mark { width: 30px; height: 30px; border-radius: 8px; background: var(--gold); display: flex; align-items: center;
  justify-content: center; color: var(--rail); font-family: var(--serif); font-weight: 600; font-size: 18px; }
.brand-name { font-family: var(--serif); font-size: 19px; font-weight: 600; }
.rail nav { display: flex; flex-direction: column; gap: 2px; }
.rail-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; color: var(--rail-text);
  font-size: 14px; text-decoration: none; min-height: 40px; }
.rail-item:hover { background: var(--rail-hover); color: #fff; }
.rail-item.on { background: var(--rail-hover); color: #fff; }
.count { margin-left: auto; background: var(--gold); color: var(--rail); border-radius: 10px; padding: 1px 8px; font-size: 12px;
  font-weight: 600; }
.dot { width: 8px; height: 8px; border-radius: 4px; display: inline-block; flex-shrink: 0; background: var(--idle); }
.dot.run { background: var(--blue); } .dot.warn { background: var(--amber); } .dot.ok { background: var(--green); }
.dot.bad { background: var(--red); }
.rail .label { color: var(--rail-muted); padding: 0 12px; }
.runner { margin-top: auto; background: var(--rail-2); border-radius: 10px; padding: 12px; display: flex; flex-direction: column;
  gap: 6px; color: #fff; font-size: 14px; }
.runner .sub { color: #B9BDD8; font-size: 12px; }
.main { flex-grow: 1; min-width: 0; padding: 26px 32px; display: flex; flex-direction: column; gap: 20px; }
.topbar { display: none; }
header.page { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }

/* buttons and fields */
.btn { border: 0; background: var(--navy); color: #fff; border-radius: 9px; padding: 11px 18px; font: inherit; font-size: 14px;
  font-weight: 500; text-decoration: none; cursor: pointer; min-height: 44px; display: inline-flex; align-items: center;
  justify-content: center; gap: 6px; white-space: nowrap; }
.btn:hover { background: #232A55; color: #fff; }
.btn.ghost { background: #fff; color: var(--navy); border: 1px solid var(--navy); }
.btn.plain { background: transparent; color: var(--ink-3); }
.btn.gold { background: var(--gold); color: var(--rail); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.field { width: 100%; border: 1px solid #D8D1C0; border-radius: 8px; padding: 10px 12px; font: inherit; font-size: 14px;
  background: #fff; color: var(--ink); min-height: 44px; }
textarea.field { min-height: 120px; resize: vertical; line-height: 1.5; }
label.f { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; }
.notice { padding: 12px 14px; border-radius: 10px; background: var(--warm); border: 1px solid var(--warm-line); font-size: 14px; }
.notice.bad { background: #FDF0EE; border-color: #F2C9C3; color: #7A1A12; }
.notice.good { background: #EEF7F1; border-color: #CBE6D5; color: #14532D; }

/* command centre */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; }
.kpi .v { font-family: var(--serif); font-size: 30px; font-weight: 600; color: var(--navy); }
.two { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.feed-row { display: grid; grid-template-columns: 58px 150px minmax(0, 1fr); gap: 12px; padding: 9px 0;
  border-bottom: 1px solid var(--line-soft); align-items: baseline; font-size: 14px; }
.feed-row .t { font-family: var(--mono); font-size: 12px; color: var(--ink-3); }
.feed-row .who { font-size: 12px; font-weight: 600; color: var(--blue); overflow-wrap: anywhere; }
.feed-row.new { animation: flash 2s ease-out; }
@keyframes flash { from { background: #FFF6DE; } to { background: transparent; } }
.need { display: flex; gap: 12px; align-items: flex-start; text-decoration: none; color: var(--ink); padding: 10px 12px;
  border-radius: 9px; background: var(--warm); border: 1px solid var(--warm-line); }
.need .bar { width: 4px; align-self: stretch; border-radius: 2px; background: var(--amber); }
.need .bar.red { background: var(--red); }
.need b { display: block; font-size: 14px; } .need span { font-size: 13px; color: var(--ink-2); }

/* approvals */
.appr { display: grid; grid-template-columns: 400px minmax(0, 1fr); gap: 18px; align-items: start; }
.item { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: 10px; background: #fff;
  border: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.item .sub { font-size: 13px; color: var(--ink-2); }
.item.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.item.on .sub, .item.on .meta { color: #C9CDEB; }
.item .meta { display: flex; gap: 8px; font-size: 12px; font-weight: 600; color: var(--ink-3); }
.item .title { font-size: 15px; font-weight: 600; }
.draft { background: var(--warm); border: 1px solid var(--warm-line); border-radius: 10px; padding: 18px 20px; font-size: 15px;
  line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.fact { background: var(--panel); border-radius: 9px; padding: 10px 12px; font-size: 13px; overflow-wrap: anywhere; }
.pill { font-size: 12px; font-weight: 600; background: var(--soft-blue); color: var(--link); border-radius: 999px;
  padding: 3px 10px; white-space: nowrap; }
.pill.gold { background: #F7EBCB; color: #6B4E0B; } .pill.red { background: #FBE3DF; color: #7A1A12; }
.pill.green { background: #E2F2E8; color: #14532D; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
pre.payload { background: var(--panel); border-radius: 9px; padding: 12px; font-family: var(--mono); font-size: 12px;
  overflow-x: auto; margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }

/* tables */
table.list { width: 100%; border-collapse: collapse; font-size: 13px; }
table.list th { text-align: left; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3);
  font-weight: 600; padding: 10px 8px; border-bottom: 1px solid var(--line-soft); }
table.list td { padding: 10px 8px; border-bottom: 1px solid var(--line-soft); vertical-align: top; overflow-wrap: anywhere; }
.state { font-size: 12px; font-weight: 600; text-transform: uppercase; }
.state.ok, .state.executed, .state.approved, .state.green { color: var(--ok); }
.state.failed, .state.error, .state.timeout, .state.red, .state.killed { color: var(--red); }
.state.quota, .state.blocked, .state.needs_founder, .state.amber, .state.skipped, .state.redraft { color: var(--amber-text); }
.state.running, .state.queued, .state.pending, .state.executing { color: var(--link); }
.scroll { overflow-x: auto; }

/* health */
.lights { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.light { display: flex; flex-direction: column; gap: 8px; }
.light .big { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 22px; font-weight: 600; }
.light .big .dot { width: 14px; height: 14px; border-radius: 7px; }

/* brain */
.search { display: flex; gap: 10px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { font-size: 12px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); background: #fff;
  text-decoration: none; color: var(--ink-2); }
.chip.on { background: var(--navy); color: #fff; border-color: var(--navy); }
#graph { width: 100%; height: 640px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
dl.props { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 6px 14px; margin: 0; font-size: 14px; }
dl.props dt { color: var(--ink-3); } dl.props dd { margin: 0; overflow-wrap: anywhere; }

/* auth pages */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; background: var(--rail); }
.auth .card { width: 100%; max-width: 420px; padding: 28px; display: flex; flex-direction: column; gap: 16px; }
.qr svg { width: 200px; height: 200px; display: block; }

/* phone */
@media (max-width: 900px) {
  .shell { flex-direction: column; }
  .rail { display: none; }
  .rail.open { display: flex; position: fixed; inset: 56px 0 0 0; width: auto; height: auto; z-index: 20; }
  .topbar { display: flex; align-items: center; gap: 10px; background: var(--rail); padding: 10px 16px; position: sticky; top: 0;
    z-index: 30; min-height: 56px; }
  .topbar .brand-name { font-size: 17px; }
  .topbar .menu { margin-left: auto; background: transparent; color: #fff; border: 1px solid #3A4270; border-radius: 8px;
    min-height: 40px; padding: 0 12px; font: inherit; }
  .main { padding: 16px; gap: 16px; }
  h1 { font-size: 26px; }
  .kpis, .lights { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two, .appr, .facts { grid-template-columns: minmax(0, 1fr); }
  .feed-row { grid-template-columns: 48px minmax(0, 1fr); }
  .feed-row .who { grid-column: 2; }
  .feed-row .what { grid-column: 2; }
  dl.props { grid-template-columns: minmax(0, 1fr); }
  .appr.has-sel .list-col { display: none; }
  .hide-phone { display: none; }
  #graph { height: 480px; }
}
@media (max-width: 900px) { .appr.has-sel #back { display: inline !important; } }

/* Home: the mini city (opens /city) */
.mini-city-pic{display:block;border-radius:10px;overflow:hidden;border:1px solid var(--line, #e3dccb)}
.mini-city-pic img{display:block;width:100%;height:auto}
.mini-city-pic:hover img,.mini-city-pic:focus-visible img{filter:brightness(1.06)}
