/* 3.10.0: Tynvara's own colours - the platform blue #1D4ED8 / #3B82F6 and navy #0b1b3f / #1E3A8A (the
   website's tailwind theme and og image, and TenantContext.jsx's platform branding). */
:root {
  --bg: #f3f5f9;
  --card: #ffffff;
  --text: #111827;
  --muted: #5f6368;
  --line: #dde3ea;
  --brand: #1d4ed8;
  --brand-text: #ffffff;
  --soft-brand: #dbeafe;
  --bar-top: #0b1b3f;
  --bar-bottom: #1e3a8a;
  --awake: #15803d;
  --busy: #b45309;
  --asleep: #6b7280;
  --bad: #b91c1c;
  --soft-awake: #e7f6ec;
  --soft-busy: #fdf1e2;
  --soft-asleep: #eef0f2;
  --soft-bad: #fdeaea;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a1124;
    --card: #111a33;
    --text: #e8edf7;
    --muted: #9aa7c0;
    --line: #24304f;
    --brand: #3b82f6;
    --brand-text: #ffffff;
    --soft-brand: #172554;
    --bar-top: #081430;
    --bar-bottom: #14275e;
    --awake: #4ade80;
    --busy: #fbbf24;
    --asleep: #9ca3af;
    --bad: #f87171;
    --soft-awake: #12301f;
    --soft-busy: #3a2a10;
    --soft-asleep: #1c2540;
    --soft-bad: #3b1717;
  }
}
.logo { display: block; height: auto; max-width: min(260px, 70vw); }
.logo.on-dark { display: none; }
@media (prefers-color-scheme: dark) {
  .logo.on-light { display: none; }
  .logo.on-dark { display: block; }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
main {
  max-width: 34rem;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 16px) calc(env(safe-area-inset-right) + 16px)
           calc(env(safe-area-inset-bottom) + 24px) calc(env(safe-area-inset-left) + 16px);
}
[hidden] { display: none !important; }
h1 { font-size: 1.5rem; margin: 0; letter-spacing: -0.01em; }
h2 { font-size: 1.15rem; margin: 0 0 0.5rem; }
p { margin: 0.4rem 0; }
.top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.panel, .card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 14px;
}
.hint { border-style: dashed; }

label { display: block; font-weight: 600; margin: 10px 0 6px; }
input[type=password] {
  width: 100%;
  font: inherit;
  font-size: 1.05rem;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
}
button {
  font: inherit;
  font-weight: 600;
  border: 0;
  border-radius: 12px;
  min-height: 48px;
  padding: 0 18px;
  cursor: pointer;
  width: 100%;
  margin-top: 12px;
  touch-action: manipulation;
}
button.primary { background: var(--brand); color: var(--brand-text); }
button.secondary { background: transparent; color: var(--text); border: 1px solid var(--line); }
button.confirm { background: var(--busy); color: #fff; }
button.link {
  background: none; color: var(--brand); width: auto; min-height: 40px; padding: 0; margin-top: 8px;
  font-weight: 600;
}
button:disabled { opacity: 0.55; cursor: default; }
.msg { color: var(--bad); min-height: 1.4em; }

.card .head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card h2 { margin: 0; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 999px; padding: 4px 10px; font-size: 0.85rem; font-weight: 700; white-space: nowrap;
}
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.pill.awake { color: var(--awake); background: var(--soft-awake); }
.pill.waking, .pill.sleeping { color: var(--busy); background: var(--soft-busy); }
.pill.waking::before, .pill.sleeping::before { animation: pulse 1.2s ease-in-out infinite; }
.pill.asleep { color: var(--asleep); background: var(--soft-asleep); }
.pill.error, .pill.unknown { color: var(--bad); background: var(--soft-bad); }
@keyframes pulse { 50% { opacity: 0.25; } }
@media (prefers-reduced-motion: reduce) { .pill::before { animation: none !important; } }

.card .addr { word-break: break-all; }
.card a { color: var(--brand); font-weight: 600; }
.card .detail { color: var(--muted); font-size: 0.92rem; }
.card .warn { color: var(--busy); font-size: 0.92rem; }
.card .err { color: var(--bad); font-size: 0.92rem; }
.card .row { display: flex; gap: 10px; }
.card .row button { flex: 1; }

footer { margin-top: 18px; }

/* ── 3.9.0: the menu bar and its drop-down (it replaced 3.4.0's tab bar along the bottom) ── */
body.in-app main { padding-top: 0; }
body.in-app .top {
  position: sticky; top: 0; z-index: 20;
  align-items: center; justify-content: flex-start; gap: 10px;
  margin: 0 calc(-1 * (env(safe-area-inset-right) + 16px)) 14px calc(-1 * (env(safe-area-inset-left) + 16px));
  padding: calc(env(safe-area-inset-top) + 10px) calc(env(safe-area-inset-right) + 16px) 10px calc(env(safe-area-inset-left) + 16px);
  background: linear-gradient(135deg, var(--bar-top), var(--bar-bottom));   /* 3.10.0: the Tynvara navy bar */
  border-bottom: 0;
  box-shadow: 0 2px 10px rgba(11, 27, 63, 0.25);
}
.top h1 { line-height: 0; }
.mark { flex: none; width: 30px; height: 30px; }
#menu-button {
  display: inline-flex; align-items: center; gap: 10px;
  width: auto; max-width: 62%; margin: 0; min-height: 48px; padding: 0 14px 0 12px;
  background: rgba(255, 255, 255, 0.1); color: #ffffff; border: 1px solid rgba(255, 255, 255, 0.22);
  font-size: 1.15rem; font-weight: 700; text-align: left;
}
#menu-button .chev { color: #bfdbfe; }
#menu-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.burger {
  flex: none; width: 18px; height: 14px;
  background:
    linear-gradient(currentColor 0 0) top / 100% 2px no-repeat,
    linear-gradient(currentColor 0 0) center / 100% 2px no-repeat,
    linear-gradient(currentColor 0 0) bottom / 100% 2px no-repeat;
}
.chev { flex: none; font-size: 0.8em; color: var(--muted); transition: transform 0.15s; }
#menu-button[aria-expanded="true"] .chev { transform: rotate(180deg); }
body.in-app #updated { font-size: 0.85rem; text-align: right; margin: 0 0 0 auto; color: #bfdbfe; }
.menu-backdrop { position: fixed; inset: 0; z-index: 25; background: rgba(0, 0, 0, 0.35); }
.menu {
  position: fixed; z-index: 30;
  top: calc(env(safe-area-inset-top) + 74px);
  left: calc(env(safe-area-inset-left) + 12px); right: calc(env(safe-area-inset-right) + 12px);
  max-width: 32rem; margin: 0 auto;
  max-height: calc(100vh - env(safe-area-inset-top) - 90px); overflow-y: auto; overscroll-behavior: contain;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 6px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}
.menu button {
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
  width: 100%; margin: 0; min-height: 56px; padding: 8px 12px;
  background: transparent; color: var(--text); border-radius: 12px; text-align: left;
}
.menu .menu-page.on { background: var(--soft-brand); }
.menu .menu-page.on .menu-name { color: var(--brand); }
.menu-name { font-weight: 700; }
.menu-blurb { font-weight: 400; font-size: 0.85rem; color: var(--muted); }
.menu-sections { margin: 2px 0 6px 18px; padding-left: 8px; border-left: 2px solid var(--soft-brand); }
.menu .menu-section { min-height: 44px; font-weight: 500; font-size: 0.95rem; }
.menu .menu-signout { color: var(--bad); border-top: 1px solid var(--line); border-radius: 0 0 12px 12px; margin-top: 4px; }
article.card { scroll-margin-top: calc(env(safe-area-inset-top) + 82px); }
@media (prefers-reduced-motion: reduce) { .chev { transition: none; } }

/* ── 3.4.0: the Production, Costs and Build tabs ── */
.card .big { font-size: 1.1rem; font-weight: 700; }
.card .money { font-size: 2rem; font-weight: 800; letter-spacing: -0.02em; margin: 4px 0 6px; }
.card .small, .detail.small { font-size: 0.85rem; }
.card > p.muted.small { margin-top: 10px; }
.bar-row { margin: 10px 0; }
.bar-label { display: flex; justify-content: space-between; gap: 10px; font-size: 0.92rem; }
.bar-label .amount { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.bar-track { height: 8px; border-radius: 999px; background: var(--soft-asleep); margin-top: 4px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: var(--brand); }
.group { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.group:first-of-type { border-top: 0; }
.group span { text-align: right; }
.stray { background: var(--soft-bad); border-radius: 12px; padding: 10px 12px; margin: 10px 0; }
.stray .stray-what { color: var(--bad); font-weight: 700; word-break: break-all; margin: 0; }
.steps { padding-left: 1.3rem; margin: 8px 0; }
.steps li { margin: 6px 0; }
input#gh-token {
  width: 100%; font: inherit; font-size: 1.05rem; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text);
}
/* ── 3.5.0: releases, the week grid, errors, the buttons that change something ── */
.release { display: flex; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 0.92rem; }
.release strong { white-space: nowrap; font-variant-numeric: tabular-nums; }
.hist { margin: 8px 0 4px; }
.hist-row { display: flex; align-items: center; gap: 8px; margin: 3px 0; }
.hist-day { width: 2.4rem; font-size: 0.8rem; color: var(--muted); }
.hist-cells { flex: 1; display: grid; grid-template-columns: repeat(24, 1fr); gap: 2px; }
.hist-cell { height: 12px; border-radius: 2px; background: var(--soft-asleep); }
.hist-cell.up { background: var(--awake); }
.hist-cell.some { background: var(--busy); }
.hist-cell.down { background: var(--bad); }
.group .path { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.82rem; word-break: break-all; text-align: left; }
.group.total { border-top: 2px solid var(--line); }
.warn-text { color: var(--busy); }
.stray.soft { background: var(--soft-busy); }
.stray.soft .stray-what { color: var(--text); }
button.danger { background: var(--bad); color: #fff; }
input.secret {
  width: 100%; font: inherit; font-size: 1.05rem; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text);
}/* 3.6.0: approve a production update, phone alerts */
.approve { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 10px; }
.approve h3 { font-size: 1rem; margin: 4px 0 6px; }
.approve .row { margin-top: 12px; }
.approve label.check { display: flex; align-items: center; gap: 8px; font-weight: 600; margin: 8px 0; }
.approve label.check input { width: 22px; height: 22px; margin: 0; }
.progress { background: var(--soft-asleep); border-radius: 12px; padding: 10px 12px; margin: 8px 0; }
.progress p { margin: 4px 0; }
.progress .steps { font-size: 0.88rem; }
.card .group button.link { flex: none; }

/* 3.7.0: what an update brings, and Undo */
.notes { margin: 6px 0 4px; }
.notes details { margin-top: 4px; }
.notes summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
.release .tag { margin-left: auto; white-space: nowrap; font-size: 0.78rem; color: var(--busy); }
.card > .row { margin-top: 12px; }

/* 3.11.0: the Claude page */
.session { padding: 10px 0; border-top: 1px solid var(--line); }
.card .head + .session { border-top: 0; }
.session-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.session-head strong { overflow-wrap: anywhere; }
.session-head .small { white-space: nowrap; }
.card a.open-session { display: inline-flex; align-items: center; min-height: 36px; margin-top: 2px; text-decoration: none; }
.choices button { margin-top: 8px; }
.card .hours { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 6px 0; }
select.hour {
  font: inherit; min-height: 44px; padding: 8px 10px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text);
}
.card label.check { display: flex; align-items: center; gap: 10px; font-weight: 600; margin: 14px 0 4px; }
.card label.check input { width: 22px; height: 22px; margin: 0; }
