/* Design System (same as v2) */
:root {
  --bg: #0b1220;
  --surface: #0f172a;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --brand: #0ea5e9;
  --brand-2: #22d3ee;
  --ring: #38bdf8;
  --card: #111827;
  --input: #1f2937;
  --border: #2a3441;
  --ad-bg: #0b1220;

  --control-h: 60px;
  --control-font: 18px;
  --control-radius: 12px;
  --pad-x: 12px;
}

:root.light {
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --brand: #0ea5e9;
  --brand-2: #2563eb;
  --ring: #60a5fa;
  --card: #ffffff;
  --input: #f1f5f9;
  --border: #e2e8f0;
  --ad-bg: #f1f5f9;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Noto Sans, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  background: radial-gradient(1200px 600px at 10% -10%, rgba(14,165,233,0.18), transparent 60%),
              radial-gradient(900px 500px at 120% 10%, rgba(34,211,238,0.15), transparent 60%),
              var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.container { max-width: 1200px; padding: 16px; margin: 0 auto; }
.header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 8px; }
.header .brand { display: flex; align-items: center; gap: 12px; }
.header .brand img { width: 40px; height: 40px; }
.header h1 { margin: 0; font-size: 1.5rem; letter-spacing: .3px; }
.header .sub { margin: 0; color: var(--muted); font-size: .95rem; }
.controls { display: flex; align-items: center; gap: 8px; }

.layout { display: grid; grid-template-columns: 320px 1fr; gap: 18px; }
.sidebar { display: none; }
@media (min-width: 1080px) { .sidebar { display: block; } }

.card {
  background: linear-gradient(180deg, var(--surface), var(--card));
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,.12);
}

.tracker { min-height: 520px; }

.row { display: flex; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.gap { gap: 10px; }
.grow { flex: 1; }
.mt { margin-top: 14px; }

label { font-size: 14px; display:block; margin-bottom:6px; }

.input, .select {
  width: 100%;
  height: var(--control-h);
  font-size: var(--control-font);
  padding: 0 var(--pad-x);
  background: var(--input); color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--control-radius);
  outline: none;
  line-height: calc(var(--control-h) - 2px);
}
.input:focus, .select:focus { border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring), transparent 70%); }
.input-value { height: 68px; font-size: 22px; font-weight: 700; }
@media (max-width: 640px) { .input-value { height: 60px; font-size: 20px; } }

.btn {
  background: linear-gradient(180deg, var(--brand), var(--brand-2));
  color: white; border: none; border-radius: var(--control-radius); padding: 10px 14px; cursor: pointer; font-weight: 600;
  transition: transform .05s ease; min-width: 44px;
}
.btn:active { transform: translateY(1px); }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text); padding: 10px 14px; border-radius: var(--control-radius); }

.pill { background: rgba(255,255,255,.06); padding: 6px 10px; border-radius: 999px; border: 1px solid var(--border); }
.pill a { color: inherit; text-decoration: none; }

.soft { background: color-mix(in oklab, var(--card), #000 6%); }
.hidden { display: none; }

.meta { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
@media (max-width: 720px) { .meta { grid-template-columns: 1fr; } }

.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { border-left: 3px solid var(--brand); padding: 8px 12px; margin: 8px 0 8px 8px; }
.timeline time { font-size: .9rem; opacity: .8; display: block; }

.bullets { padding-left: 18px; }

.footer { text-align: center; color: var(--muted); margin: 18px auto 32px; }

/* Ads */
.ad { display: grid; place-items: center; margin: 8px 0; }
.ad .ad-placeholder {
  background: var(--ad-bg);
  border: 1px dashed var(--border);
  color: var(--muted);
  border-radius: 12px;
  font-size: .95rem;
  padding: 18px;
  width: 100%;
  min-height: 90px;
  text-align: center;
}
.ad-top .ad-placeholder { min-height: 90px; }
.ad-sidebar .ad-placeholder { min-height: 600px; }
.ad-inline .ad-placeholder { min-height: 250px; }
.ad-bottom .ad-placeholder { min-height: 120px; }

/* RTL tweaks */
html[dir="rtl"] .header .brand { flex-direction: row-reverse; }
html[dir="rtl"] .header .brand div { text-align: right; }
