:root {
  --bg: #0f0508;
  --bg-2: #170a0f;
  --surface: #1e0d14;
  --surface-2: #27111a;
  --line: rgba(214, 220, 228, 0.13);
  --line-strong: rgba(214, 220, 228, 0.28);
  --burgundy: #8a1c3c;
  --burgundy-hi: #b8284f;
  --wine: #5a0f26;
  --chrome-1: #f6f8fb;
  --chrome-2: #c3cad3;
  --chrome-3: #8d96a1;
  --text: #f4eff1;
  --muted: #b3a6ab;
  --dim: #85767c;
  --ok: #7fd6b0;
  --warn: #f0c37a;
  --stall: #ff8f9f;
  --radius: 18px;
  --tab-h: 74px;
  --font: "SF Pro Display", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Inter", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); color-scheme: dark; }
body {
  margin: 0; min-height: 100dvh; font-family: var(--font); color: var(--text);
  font-size: 16px; line-height: 1.45; -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(900px 520px at 85% -10%, rgba(184, 40, 79, 0.30), transparent 62%),
    radial-gradient(700px 480px at -10% 8%, rgba(90, 15, 38, 0.55), transparent 60%),
    linear-gradient(180deg, var(--bg-2), var(--bg) 42%);
  background-attachment: fixed;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }

.wrap { max-width: 760px; margin: 0 auto; padding: calc(env(safe-area-inset-top) + 18px) 18px calc(var(--tab-h) + env(safe-area-inset-bottom) + 28px); }

/* chrome text: a brushed silver gradient, used for titles only */
.chrome {
  background: linear-gradient(180deg, var(--chrome-1) 0%, var(--chrome-2) 48%, #eef1f5 52%, var(--chrome-3) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.eyebrow { font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
h1 { font-size: 34px; line-height: 1.08; margin: 6px 0 0; font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: 13px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--chrome-2); margin: 30px 0 12px; font-weight: 650; }
.clock { font-variant-numeric: tabular-nums; font-size: 14px; color: var(--muted); padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,0.03); white-space: nowrap; }

.card {
  position: relative; background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 16px 15px; margin-bottom: 12px;
  box-shadow: 0 1px 0 rgba(255,255,255,0.06) inset, 0 18px 40px -22px rgba(0,0,0,0.9);
}
.card::before { /* chrome hairline along the top edge */
  content: ""; position: absolute; left: 18px; right: 18px; top: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(246,248,251,0.55), transparent);
}
.card h3 { margin: 0; font-size: 18px; line-height: 1.25; font-weight: 650; letter-spacing: -0.01em; }
.card p { margin: 7px 0 0; color: var(--muted); font-size: 15px; }
.card .next { color: var(--text); }
.card .next b { color: var(--chrome-2); font-weight: 600; }

.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 11px; }
.pill { font-size: 12px; font-weight: 650; letter-spacing: 0.04em; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--chrome-2); background: rgba(255,255,255,0.04); white-space: nowrap; }
.pill.s-Running, .pill.s-Moving, .pill.s-Done { color: var(--ok); border-color: rgba(127,214,176,0.45); background: rgba(127,214,176,0.08); }
.pill.s-Waiting, .pill.s-Paused { color: var(--warn); border-color: rgba(240,195,122,0.45); background: rgba(240,195,122,0.08); }
.pill.s-Stalled { color: var(--stall); border-color: rgba(255,143,159,0.5); background: rgba(255,143,159,0.10); }
.pill.s-Idea, .pill.s-Not { color: var(--muted); }
.pill.owner-none { color: var(--stall); border-style: dashed; }

/* hero count on Home */
.hero { padding: 20px 18px; border-radius: 22px; margin-bottom: 14px; border: 1px solid rgba(184,40,79,0.55);
  background: linear-gradient(135deg, rgba(138,28,60,0.92), rgba(58,10,25,0.96));
  box-shadow: 0 1px 0 rgba(255,255,255,0.14) inset, 0 26px 50px -24px rgba(138,28,60,0.9); display: block; }
.hero .big { font-size: 56px; line-height: 1; font-weight: 750; letter-spacing: -0.03em; }
.hero .lbl { font-size: 15px; color: #f1d9e0; margin-top: 6px; }
.hero .go { margin-top: 14px; display: inline-flex; align-items: center; gap: 8px; font-weight: 650; font-size: 15px; padding: 10px 16px; border-radius: 999px; color: #1a0a10;
  background: linear-gradient(180deg, var(--chrome-1), var(--chrome-2)); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stat { text-align: center; padding: 13px 4px; border-radius: 16px; border: 1px solid var(--line); background: rgba(255,255,255,0.03); }
.stat .n { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat .t { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-top: 2px; }

/* buttons */
.actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.btn { border: 1px solid var(--line-strong); background: rgba(255,255,255,0.05); padding: 11px 16px; border-radius: 999px; font-weight: 650; font-size: 15px; min-height: 44px; cursor: pointer; }
.btn.primary { color: #1a0a10; border: 0; background: linear-gradient(180deg, var(--chrome-1), var(--chrome-2) 55%, #aab2bc); box-shadow: 0 8px 22px -10px rgba(246,248,251,0.6); }
.btn.wine { border-color: rgba(184,40,79,0.7); background: linear-gradient(180deg, rgba(184,40,79,0.5), rgba(138,28,60,0.35)); }
.btn:active { transform: translateY(1px); }
input[type=text], input[type=tel], textarea {
  width: 100%; font: inherit; color: var(--text); background: rgba(0,0,0,0.32); border: 1px solid var(--line-strong);
  border-radius: 14px; padding: 12px 14px; margin-top: 12px; outline: none; }
input:focus, textarea:focus { border-color: var(--chrome-2); box-shadow: 0 0 0 3px rgba(195,202,211,0.16); }
::placeholder { color: var(--dim); }

/* filter chips */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 12px; margin: 0 -18px; padding-left: 18px; padding-right: 18px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; padding: 9px 15px; border-radius: 999px; border: 1px solid var(--line-strong); font-size: 14px; font-weight: 600; color: var(--muted); background: rgba(255,255,255,0.03); }
.chip.on { color: #1a0a10; border-color: transparent; background: linear-gradient(180deg, var(--chrome-1), var(--chrome-2)); }

details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }
.more { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.empty { text-align: center; color: var(--muted); padding: 34px 16px; border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.empty strong { display: block; color: var(--text); font-size: 18px; margin-bottom: 4px; }
.feed li { padding: 10px 0; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 15px; list-style: none; }
.feed { margin: 0; padding: 0; }
.small { font-size: 13px; color: var(--dim); }

/* bottom tab bar */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; padding: 8px 10px calc(env(safe-area-inset-bottom) + 8px);
  background: linear-gradient(180deg, rgba(15,5,8,0.55), rgba(15,5,8,0.96)); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--line-strong); }
.tabs nav { max-width: 760px; margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.tab { position: relative; text-align: center; padding: 9px 4px 7px; border-radius: 14px; color: var(--dim); font-size: 12px; font-weight: 650; letter-spacing: 0.04em; }
.tab svg { display: block; margin: 0 auto 4px; width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tab.on { color: var(--chrome-1); background: linear-gradient(180deg, rgba(184,40,79,0.42), rgba(138,28,60,0.18)); box-shadow: 0 0 0 1px rgba(184,40,79,0.55) inset; }
.badge { position: absolute; top: 4px; left: calc(50% + 8px); min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; font-size: 11px; line-height: 19px; font-weight: 750; color: #1a0a10; background: linear-gradient(180deg, var(--chrome-1), var(--chrome-2)); }

/* login */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.login .box { width: 100%; max-width: 380px; text-align: center; }
.mark { width: 76px; height: 76px; margin: 0 auto 18px; border-radius: 22px; display: grid; place-items: center; font-weight: 800; font-size: 26px; letter-spacing: -0.02em; color: #1a0a10;
  background: linear-gradient(145deg, var(--chrome-1), var(--chrome-3)); box-shadow: 0 0 0 1px rgba(255,255,255,0.4) inset, 0 22px 50px -18px rgba(184,40,79,0.9); }
.err { color: var(--stall); margin-top: 12px; font-size: 15px; }

@media (min-width: 620px) { h1 { font-size: 40px; } .wrap { padding-left: 26px; padding-right: 26px; } }
@media (prefers-reduced-motion: no-preference) { .card, .hero { animation: rise 0.35s ease both; } @keyframes rise { from { opacity: 0; transform: translateY(6px); } } }

/* ---------- desktop: side navigation and wider grids ---------- */
.grid .card { margin-bottom: 0; }
.grid { display: grid; gap: 12px; }
.grid .empty { grid-column: 1 / -1; }
@media (min-width: 900px) {
  :root { --side: 232px; }
  .tabs { top: 0; bottom: 0; right: auto; width: var(--side); padding: 26px 14px; border-top: 0; border-right: 1px solid var(--line-strong);
    background: linear-gradient(180deg, rgba(23,10,15,0.92), rgba(15,5,8,0.96)); }
  .tabs::before { content: "HQ"; display: grid; place-items: center; width: 52px; height: 52px; margin: 0 6px 26px; border-radius: 16px; font-weight: 800; font-size: 19px; color: #1a0a10;
    background: linear-gradient(145deg, var(--chrome-1), var(--chrome-3)); box-shadow: 0 16px 34px -14px rgba(184,40,79,0.9); }
  .tabs nav { display: flex; flex-direction: column; gap: 6px; max-width: none; }
  .tab { display: flex; align-items: center; gap: 12px; text-align: left; padding: 12px 14px; font-size: 15px; letter-spacing: 0.01em; }
  .tab svg { margin: 0; width: 22px; height: 22px; }
  .badge { position: static; margin-left: auto; order: 3; }
  .wrap { max-width: 1240px; margin: 0; margin-left: var(--side); padding: 40px 44px 60px; }
  h1 { font-size: 44px; }
  .lead { display: grid; grid-template-columns: minmax(300px, 1fr) minmax(360px, 1.2fr); gap: 16px; align-items: stretch; }
  .lead .hero { margin-bottom: 0; }
  .lead .stats { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .lead .stat { display: grid; place-content: center; padding: 18px; }
  .lead .stat .n { font-size: 34px; }
  .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
  .chips { margin: 0; padding-left: 0; padding-right: 0; flex-wrap: wrap; overflow: visible; }
}
@media (min-width: 1400px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
