:root {
  --bg: #07090d;
  --bg2: #0d1118;
  --panel: #12171f;
  --panel2: #181e28;
  --border: rgba(255,255,255,0.07);
  --border2: rgba(255,255,255,0.12);
  --text: #f1f5f9;
  --muted: #8b97a8;
  --faint: #5c6b7e;
  --accent: #4f8cff;
  --accent-soft: rgba(79,140,255,0.14);
  --good: #34d399;
  --good-soft: rgba(52,211,153,0.12);
  --warn: #fbbf24;
  --danger: #f87171;
  --danger-soft: rgba(248,113,113,0.12);
  --radius: 14px;
  --radius-sm: 10px;
  --tab-h: 68px;
  --header-h: 56px;
  --shadow: 0 8px 28px rgba(0,0,0,0.35);
  --font: "SF Pro Text", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  font-family: var(--font);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0;
  padding: 0;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(79,140,255,0.16), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(52,211,153,0.08), transparent 50%),
    var(--bg);
  color: var(--text);
  min-height: 100%;
  min-height: 100dvh;
  font-size: 15px;
  line-height: 1.45;
}
body {
  padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px) + 8px);
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px calc(10px);
  padding-top: calc(10px + env(safe-area-inset-top, 0px));
  background: rgba(7,9,13,0.82);
  backdrop-filter: blur(16px) saturate(1.2);
  border-bottom: 1px solid var(--border);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #4f8cff 0%, #22d3ee 50%, #34d399 100%);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 12px;
  color: #041018;
  letter-spacing: -0.02em;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.12), 0 6px 18px rgba(79,140,255,0.35);
  flex-shrink: 0;
}
.brand-text { min-width: 0; }
.app-header h1 {
  font-size: 15px;
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.sub {
  font-size: 11px;
  color: var(--faint);
  margin-top: 1px;
}
.header-actions { display: flex; gap: 8px; flex-shrink: 0; }

.chip {
  margin: 12px 14px 0;
  padding: 10px 12px;
  background: linear-gradient(180deg, rgba(79,140,255,0.12), rgba(79,140,255,0.04));
  border: 1px solid rgba(79,140,255,0.28);
  border-radius: 999px;
  font-size: 12px;
  color: var(--muted);
  display: none;
  align-items: center;
  gap: 8px;
}
.chip.show { display: flex; }
.chip strong { color: var(--text); font-weight: 650; }
.chip .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 0 3px rgba(52,211,153,0.18);
  flex-shrink: 0;
}

main {
  padding: 14px 14px 28px;
  max-width: 560px;
  margin: 0 auto;
}

.hero {
  margin-bottom: 14px;
  padding: 16px;
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(79,140,255,0.18), transparent 42%),
    linear-gradient(180deg, #151b26, #10151e);
  border: 1px solid var(--border2);
  box-shadow: var(--shadow);
}
.hero h2 {
  margin: 0 0 6px;
  font-size: 18px;
  letter-spacing: -0.02em;
}
.hero p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.tab-panel { display: none; animation: fade .18s ease; }
.tab-panel.active { display: block; }
@keyframes fade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 2px 0 12px;
  font-size: 11px;
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.card {
  background: linear-gradient(180deg, rgba(255,255,255,0.03), transparent 40%), var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: 0 1px 0 rgba(255,255,255,0.03) inset;
}
.card.active-card {
  border-color: rgba(79,140,255,0.55);
  box-shadow: 0 0 0 1px rgba(79,140,255,0.2), 0 10px 30px rgba(79,140,255,0.08);
}
.card h3 {
  margin: 0 0 4px;
  font-size: 15px;
  letter-spacing: -0.01em;
}
.meta {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}
.row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

button, .btn {
  appearance: none;
  border: 1px solid var(--border2);
  background: var(--panel2);
  color: var(--text);
  border-radius: 11px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .08s ease;
}
button:hover { border-color: rgba(255,255,255,0.2); }
button.primary {
  background: linear-gradient(180deg, #6aa0ff, var(--accent));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 16px rgba(79,140,255,0.28);
}
button.good {
  background: var(--good-soft);
  border-color: rgba(52,211,153,0.3);
  color: #86efac;
}
button.danger {
  background: var(--danger-soft);
  border-color: rgba(248,113,113,0.28);
  color: #fca5a5;
}
button.ghost { background: transparent; }
button:active { transform: scale(0.98); }
button.small { padding: 7px 10px; font-size: 12px; border-radius: 9px; }

input, select, textarea {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 11px 12px;
  font-size: 14px;
  margin-top: 6px;
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: rgba(79,140,255,0.55);
  box-shadow: 0 0 0 3px rgba(79,140,255,0.15);
}
label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 12px;
  font-weight: 600;
}
textarea { min-height: 78px; resize: vertical; }

.pill {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #243044;
  color: #93c5fd;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  white-space: nowrap;
}
.pill.spec { background: rgba(148,163,184,0.15); color: #cbd5e1; }
.pill.design { background: rgba(251,191,36,0.14); color: #fcd34d; }
.pill.build { background: rgba(79,140,255,0.16); color: #93c5fd; }
.pill.qa { background: rgba(168,85,247,0.16); color: #e9d5ff; }
.pill.ship { background: rgba(52,211,153,0.14); color: #86efac; }

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.table th, .table td {
  text-align: left;
  padding: 10px 6px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.table th {
  color: var(--faint);
  font-weight: 700;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.table tr:last-child td { border-bottom: 0; }

.check-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.check-item:last-child { border-bottom: 0; }
.check-item input {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--accent);
}

.progress {
  height: 9px;
  background: #1a2230;
  border-radius: 99px;
  overflow: hidden;
  margin: 12px 0 6px;
  border: 1px solid var(--border);
}
.progress > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #22d3ee 55%, var(--good));
  width: 0%;
  transition: width .25s ease;
}

.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px));
  padding: 6px 8px env(safe-area-inset-bottom, 0px);
  background: rgba(8,10,14,0.92);
  backdrop-filter: blur(18px);
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  z-index: 30;
}
.tabbar button {
  border: 0;
  background: transparent;
  border-radius: 12px;
  color: var(--faint);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 56px;
  padding: 0;
}
.tabbar button.active {
  color: #dbeafe;
  background: var(--accent-soft);
}
.tabbar .ico {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  font-size: 15px;
  line-height: 1;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tab-h) + 18px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%) translateY(16px);
  background: #0f172a;
  border: 1px solid var(--border2);
  color: var(--text);
  padding: 11px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: .2s ease;
  z-index: 50;
  max-width: 90vw;
  box-shadow: var(--shadow);
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.62);
  z-index: 40;
  display: none;
  align-items: flex-end;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.modal-bg.open { display: flex; }
.modal {
  width: 100%;
  max-width: 560px;
  background: linear-gradient(180deg, #171d27, #10151c);
  border-radius: 20px 20px 0 0;
  border: 1px solid var(--border2);
  padding: 18px 16px calc(20px + env(safe-area-inset-bottom, 0px));
  max-height: 88vh;
  overflow: auto;
  box-shadow: 0 -20px 60px rgba(0,0,0,0.45);
}
.modal h2 { margin: 0 0 4px; font-size: 17px; letter-spacing: -0.02em; }
.hint { font-size: 12px; color: var(--muted); line-height: 1.5; }
.pre {
  white-space: pre-wrap;
  font-size: 12px;
  color: #cbd5e1;
  background: rgba(0,0,0,0.28);
  border-radius: 12px;
  padding: 11px;
  border: 1px solid var(--border);
  max-height: 150px;
  overflow: auto;
  line-height: 1.45;
}
.empty {
  text-align: center;
  color: var(--muted);
  padding: 36px 16px;
  font-size: 14px;
  border: 1px dashed var(--border2);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.015);
}
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #93c5fd;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}
.stat {
  background: rgba(0,0,0,0.22);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  text-align: center;
}
.stat b { display: block; font-size: 16px; margin-bottom: 2px; }
.stat span { font-size: 10px; color: var(--faint); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700; }
