/* Tracelyx — Components */

/* ============ NAV ============ */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: color-mix(in oklab, var(--bg-0) 75%, transparent);
  border-bottom: 1px solid color-mix(in oklab, var(--line) 60%, transparent);
}
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.brand__mark {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background:
    radial-gradient(circle at 30% 30%, var(--accent), transparent 60%),
    linear-gradient(135deg, color-mix(in oklab, var(--accent) 70%, #000), #000);
  position: relative;
  overflow: hidden;
}
.brand__mark::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 4px;
  background:
    linear-gradient(to right, transparent 49%, color-mix(in oklab, var(--accent) 80%, white) 49% 51%, transparent 51%),
    linear-gradient(to bottom, transparent 49%, color-mix(in oklab, var(--accent) 60%, white) 49% 51%, transparent 51%);
  opacity: 0.7;
}
.nav__links {
  display: flex;
  gap: 28px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--fg-2);
}
.nav__links a:hover { color: var(--fg-0); }
.nav__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.lang-toggle, .theme-toggle {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-1);
  transition: border-color .15s var(--ease), color .15s var(--ease);
}
.lang-toggle:hover, .theme-toggle:hover {
  border-color: var(--line-strong);
  color: var(--fg-0);
}
@media (max-width: 800px) {
  .nav__links { display: none; }
}
@media (max-width: 480px) {
  .nav__actions .btn { display: none; }
}

/* ============ HERO ============ */
.hero {
  padding-top: 112px;
  padding-bottom: 64px;
  position: relative;
}
.hero__inner {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 64px;
  align-items: center;
}
@media (max-width: 980px) {
  .hero__inner { grid-template-columns: 1fr; gap: 48px; }
}
.hero h1 {
  margin-top: 20px;
  margin-bottom: 24px;
}
.hero h1 .accent {
  color: var(--accent);
  font-style: italic;
  font-family: "Times New Roman", serif;
  font-weight: 400;
}
.hero__cta-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 28px;
  align-items: center;
}
.hero__meta {
  display: flex;
  gap: 24px;
  margin-top: 28px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-3);
}
.hero__meta .check { color: var(--accent); }

/* ============ TERMINAL / CODE ============ */
.terminal {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow:
    0 1px 0 color-mix(in oklab, var(--fg-0) 4%, transparent) inset,
    0 30px 60px -20px rgba(0,0,0,0.6),
    0 0 0 1px color-mix(in oklab, var(--accent) 10%, transparent);
  position: relative;
}
.terminal__bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
}
.terminal__dots {
  display: flex;
  gap: 6px;
}
.terminal__dots span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--bg-3);
}
.terminal__title {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-3);
  margin-left: auto;
  margin-right: auto;
}
.terminal__tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
  background: var(--bg-1);
  overflow-x: auto;
  scrollbar-width: none;
}
.terminal__tabs::-webkit-scrollbar { display: none; }
.terminal__tab {
  padding: 10px 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-3);
  border-right: 1px solid var(--line);
  white-space: nowrap;
  transition: color .15s var(--ease), background .15s var(--ease);
  position: relative;
}
.terminal__tab:hover { color: var(--fg-1); }
.terminal__tab[aria-selected="true"] {
  color: var(--accent);
  background: color-mix(in oklab, var(--accent) 6%, transparent);
}
.terminal__tab[aria-selected="true"]::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 1px;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}
.terminal__body {
  padding: 20px 22px;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--fg-1);
  white-space: pre;
  overflow-x: auto;
  min-height: 280px;
}
.terminal__body::-webkit-scrollbar { height: 8px; }
.terminal__body::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 4px; }

.tok-kw { color: #ff7eb6; }
.tok-str { color: #a5e887; }
.tok-fn { color: var(--accent); }
.tok-com { color: var(--fg-3); font-style: italic; }
.tok-num { color: #ffd166; }
.tok-var { color: #79c0ff; }
.tok-punct { color: var(--fg-2); }

/* Copy button */
.terminal__copy {
  position: absolute;
  top: 56px;
  right: 12px;
  padding: 6px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-2);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  z-index: 2;
  opacity: 0;
  transition: opacity .15s var(--ease), color .15s var(--ease);
}
.terminal:hover .terminal__copy { opacity: 1; }
.terminal__copy:hover { color: var(--accent); border-color: var(--accent); }
.terminal__copy.copied { color: var(--accent); }

/* ============ FRAMEWORKS ROW ============ */
.frameworks {
  padding: 48px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, transparent, color-mix(in oklab, var(--bg-1) 50%, transparent), transparent);
}
.frameworks__label {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin-bottom: 24px;
}
.frameworks__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
}
@media (max-width: 720px) {
  .frameworks__grid { grid-template-columns: repeat(2, 1fr); }
}
.framework {
  padding: 24px 20px;
  background: var(--bg-1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--fg-1);
  transition: background .2s var(--ease), color .2s var(--ease);
  position: relative;
}
.framework:hover {
  background: color-mix(in oklab, var(--accent) 5%, var(--bg-1));
  color: var(--fg-0);
}
.framework__icon {
  width: 22px;
  height: 22px;
  flex: none;
  opacity: 0.9;
}
.framework__status {
  position: absolute;
  top: 10px;
  right: 12px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--accent);
  text-transform: uppercase;
}
.framework__status.soon { color: var(--fg-3); }

/* ============ SECTION HEADER ============ */
.section-head {
  margin-bottom: 56px;
  max-width: 720px;
}
.section-head .eyebrow { margin-bottom: 20px; }
.section-head h2 + p { margin-top: 16px; color: var(--fg-2); font-size: 18px; }

/* ============ COMPARISON TABLE ============ */
.compare {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.compare table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 13px;
}
.compare th, .compare td {
  padding: 16px 20px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  vertical-align: middle;
}
.compare th:last-child, .compare td:last-child { border-right: 0; }
.compare tr:last-child th, .compare tr:last-child td { border-bottom: 0; }

.compare thead th {
  background: var(--bg-2);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--fg-2);
  font-weight: 500;
}
.compare thead th.us {
  color: var(--accent);
  background: color-mix(in oklab, var(--accent) 8%, var(--bg-2));
}
.compare tbody th {
  font-weight: 400;
  color: var(--fg-1);
  background: var(--bg-1);
  width: 32%;
}
.compare td.us {
  background: color-mix(in oklab, var(--accent) 4%, var(--bg-1));
  color: var(--fg-0);
}
.cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.cell--yes { color: var(--accent); }
.cell--no { color: var(--fg-3); }
.cell--partial { color: #ffd166; }
.cell-mark {
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 720px) {
  .compare { overflow-x: auto; }
  .compare table { min-width: 720px; }
}

/* ============ FEATURES ============ */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
@media (max-width: 900px) {
  .features-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .features-grid { grid-template-columns: 1fr; }
}
.feature-card {
  background: var(--bg-1);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  transition: background .2s var(--ease);
}
.feature-card:hover {
  background: color-mix(in oklab, var(--accent) 4%, var(--bg-1));
}
.feature-card__icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.feature-card:hover .feature-card__icon {
  border-color: color-mix(in oklab, var(--accent) 40%, var(--line-strong));
  box-shadow: 0 0 16px -4px color-mix(in oklab, var(--accent) 35%, transparent);
}
.feature-card__title {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--fg-0);
  margin: 18px 0 10px;
  letter-spacing: -0.01em;
}
.feature-card__desc {
  font-size: 13.5px;
  color: var(--fg-2);
  line-height: 1.65;
  flex: 1;
}
.feature-card__tag {
  display: inline-flex;
  align-self: flex-start;
  margin-top: 20px;
  padding: 3px 9px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--accent);
  background: color-mix(in oklab, var(--accent) 8%, transparent);
  border: 1px solid color-mix(in oklab, var(--accent) 22%, transparent);
  border-radius: var(--radius-sm);
}

/* ============ OSS / GITHUB ============ */
.oss {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}
@media (max-width: 880px) {
  .oss { grid-template-columns: 1fr; }
}
.oss__card {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
  font-family: var(--font-mono);
}
.oss__repo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--fg-1);
  margin-bottom: 16px;
}
.oss__repo .slash { color: var(--fg-3); }
.oss__stars {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 16px 0 20px;
}
.oss__stars .num {
  font-size: 44px;
  color: var(--fg-0);
  letter-spacing: -0.02em;
}
.oss__stars .label { font-size: 12px; color: var(--fg-3); }
.oss__contrib {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
}
.contrib-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--bg-3), var(--line-strong));
  border: 2px solid var(--bg-1);
  margin-left: -8px;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fg-2);
}
.contrib-avatar:first-child { margin-left: 0; }
.oss__commit {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
  font-size: 12px;
  color: var(--fg-3);
  display: flex;
  gap: 8px;
}
.oss__commit .hash { color: var(--accent); }

/* ============ WAITLIST ============ */
.waitlist {
  position: relative;
  padding: 96px 0 120px;
  text-align: center;
  border-top: 1px solid var(--line);
}
.waitlist::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 50% 50% at 50% 100%, color-mix(in oklab, var(--accent) 18%, transparent), transparent 70%);
  pointer-events: none;
  z-index: 0;
}
.waitlist__inner { position: relative; z-index: 1; }
.waitlist h2 { margin-bottom: 16px; }
.waitlist .lede { margin: 0 auto 36px; }
.waitlist__form {
  display: flex;
  gap: 8px;
  max-width: 480px;
  margin: 0 auto;
  padding: 6px;
  background: var(--bg-1);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.waitlist__form:focus-within {
  border-color: color-mix(in oklab, var(--accent) 60%, var(--line-strong));
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--accent) 12%, transparent);
}
.waitlist__form input {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--fg-0);
  font-family: var(--font-mono);
  font-size: 14px;
  padding: 10px 14px;
  outline: 0;
}
.waitlist__form input::placeholder { color: var(--fg-3); }
.waitlist__form button { padding: 10px 18px; }
.waitlist__hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }
.waitlist__notice {
  margin-top: 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-3);
}
.waitlist__notice a {
  color: var(--fg-2);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color .15s var(--ease);
}
.waitlist__notice a:hover { color: var(--fg-0); }
.waitlist__success {
  display: none;
  margin-top: 24px;
  padding: 16px 20px;
  background: color-mix(in oklab, var(--accent) 10%, var(--bg-1));
  border: 1px solid color-mix(in oklab, var(--accent) 40%, var(--line));
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}
.waitlist__success.is-visible { display: block; }
.waitlist__error {
  display: none;
  margin-top: 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--status-err);
}
.waitlist__error.is-visible { display: block; }

/* ============ FOOTER ============ */
.footer {
  padding: 56px 0 40px;
  border-top: 1px solid var(--line);
  background: var(--bg-1);
}
.footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}
@media (max-width: 720px) {
  .footer__grid { grid-template-columns: 1fr 1fr; }
}
.footer__col h4 {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin: 0 0 16px;
  font-weight: 500;
}
.footer__col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.footer__col a {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--fg-1);
  transition: color .15s var(--ease);
}
.footer__col a:hover { color: var(--accent); }
.footer__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-3);
}
@media (max-width: 720px) {
  .footer__bottom { flex-direction: column; gap: 12px; }
}
.footer__tag {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

/* ============ STATUS LINE / ASCII ============ */
.status-line {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 24px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-3);
  padding: 12px 0;
  border-top: 1px dashed var(--line);
  border-bottom: 1px dashed var(--line);
  margin: 32px 0;
}
.status-line span { display: inline-flex; align-items: center; gap: 6px; }
.status-line .ok { color: var(--accent); }
.status-line .ok::before {
  content: "";
  display: inline-block;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
}

/* ============ COOKIE CONSENT ============ */
.cookie-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--bg-3);
  border-top: 1px solid var(--line-strong);
  padding: 12px 24px;
  font-family: var(--font-sans);
}
.cookie-bar[hidden] { display: none; }

.cookie-bar__main {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: var(--container);
  margin: 0 auto;
}
.cookie-bar__text {
  flex: 1;
  font-size: 13px;
  color: var(--fg-1);
  line-height: 1.5;
}
.cookie-bar__text a { color: var(--accent); text-decoration: none; margin-left: 0.3em; }
.cookie-bar__text a:hover { text-decoration: underline; }

.cookie-bar__btns {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.cookie-btn {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity .15s var(--ease);
}
.cookie-btn:hover { opacity: 0.85; }
.cookie-btn--ghost {
  background: transparent;
  color: var(--fg-2);
  border: 1px solid var(--line-strong);
}
.cookie-btn--outline {
  background: transparent;
  color: var(--fg-0);
  border: 1px solid var(--line-strong);
}
.cookie-btn--primary {
  background: var(--accent);
  color: #000;
  font-weight: 700;
}

/* Arrow indicator on settings button via CSS — doesn't interfere with i18n textContent */
#cookie-settings-btn::after { content: ' ▼'; font-size: 9px; }
#cookie-settings-btn.is-active { color: var(--accent); border-color: var(--accent); }
#cookie-settings-btn.is-active::after { content: ' ▲'; }

/* Footer link styled as text */
.cookie-footer-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--fg-2);
  font-family: var(--font-sans);
  font-size: 13px;
  cursor: pointer;
  text-align: left;
}
.cookie-footer-link:hover { color: var(--fg-0); }

/* Settings panel */
.cookie-settings {
  max-width: var(--container);
  margin: 12px auto 0;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.cookie-settings[hidden] { display: none; }

.cookie-settings__title {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--fg-3);
  margin-bottom: 8px;
}

.cookie-cat-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.cookie-cat-row:last-of-type { border-bottom: none; }

.cookie-cat-info { flex: 1; }

.cookie-cat-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-0);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
}
.cookie-badge {
  font-family: var(--font-mono);
  font-size: 9px;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  background: var(--bg-2);
  color: var(--fg-3);
  border: 1px solid var(--line);
}
.cookie-cat-desc {
  font-size: 12px;
  color: var(--fg-3);
  line-height: 1.4;
}
.cookie-cat-keys {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fg-3);
  margin-top: 4px;
  opacity: 0.6;
}

/* Toggle */
.cookie-toggle-wrap {
  flex-shrink: 0;
  padding-top: 2px;
  cursor: pointer;
}
.cookie-toggle-wrap input { display: none; }
.cookie-toggle {
  display: block;
  width: 34px;
  height: 18px;
  background: var(--bg-2);
  border-radius: 9px;
  border: 1px solid var(--line-strong);
  position: relative;
  transition: background .2s var(--ease), border-color .2s var(--ease);
}
.cookie-toggle::after {
  content: '';
  position: absolute;
  left: 2px;
  top: 2px;
  width: 12px;
  height: 12px;
  background: var(--fg-3);
  border-radius: 50%;
  transition: left .2s var(--ease), background .2s var(--ease);
}
.cookie-toggle-wrap input:checked + .cookie-toggle {
  background: var(--accent);
  border-color: var(--accent);
}
.cookie-toggle-wrap input:checked + .cookie-toggle::after {
  left: 18px;
  background: #000;
}
.cookie-toggle--locked {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 18px;
  border-radius: 9px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  font-size: 10px;
  flex-shrink: 0;
  padding-top: 2px;
}

.cookie-settings__save {
  display: flex;
  justify-content: flex-end;
  padding-top: 10px;
}

@media (max-width: 720px) {
  .cookie-bar__main {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .cookie-bar__btns { flex-wrap: wrap; }
}

/* ============ APP PREVIEW (platform section) ============ */

.app-preview {
  position: relative;
}

/* ── Browser chrome ─────────────────────────────────────────── */
.browser {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 40px 80px -30px rgba(0,0,0,.7), 0 0 0 1px color-mix(in oklab, var(--accent) 8%, transparent);
}
.browser__bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 14px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--line);
}
.browser__dots { display: flex; gap: 6px; }
.browser__dots span { width: 11px; height: 11px; border-radius: 50%; }
.browser__url {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 380px;
  margin: 0 auto;
  padding: 5px 12px;
  background: var(--bg-0);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--fg-2);
}
.browser__url .lock { color: var(--accent); font-size: 10px; }
.browser__url .path { color: var(--fg-3); }

/* ── App shell ──────────────────────────────────────────────── */
.appshell { display: grid; grid-template-columns: 200px 1fr; min-height: 520px; }
@media (max-width: 860px) { .appshell { grid-template-columns: 1fr; } }

.appshell__side {
  background: var(--bg-2);
  border-right: 1px solid var(--line);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
@media (max-width: 860px) { .appshell__side { display: none; } }

.appshell__brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 6px 12px;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: -.02em;
  color: var(--fg-0);
}
.appshell__project {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--fg-1);
}
.appshell__project .caret { color: var(--fg-3); font-size: 9px; }

.appnav { display: flex; flex-direction: column; gap: 2px; }
.appnav__item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-2);
  transition: background .15s var(--ease), color .15s var(--ease);
  cursor: pointer;
  text-align: left;
  width: 100%;
}
.appnav__item:hover { background: var(--bg-3); color: var(--fg-0); }
.appnav__item[aria-current="true"] {
  background: color-mix(in oklab, var(--accent) 14%, transparent);
  color: var(--accent);
}
.appnav__item svg { width: 14px; height: 14px; flex: none; opacity: .85; }
.appnav__badge {
  margin-left: auto;
  font-size: 9.5px;
  padding: 1px 5px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--status-err) 20%, transparent);
  color: var(--status-err);
}

.appshell__main { padding: 22px 24px; overflow: hidden; background: var(--bg-1); }
.appmain__head { margin-bottom: 20px; }
.appmain__title {
  font-family: var(--font-sans);
  font-size: 19px;
  font-weight: 500;
  letter-spacing: -.02em;
  color: var(--fg-0);
  margin: 0 0 4px;
}
.appmain__sub { font-family: var(--font-mono); font-size: 11.5px; color: var(--fg-3); }

/* ── Waterfall ──────────────────────────────────────────────── */
.wf__axis {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fg-3);
  padding: 0 0 6px 232px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
}
@media (max-width: 620px) { .wf__axis { padding-left: 120px; } }

.wf__row {
  display: grid;
  grid-template-columns: 232px 1fr;
  align-items: center;
  gap: 0;
  padding: 4px 0;
  border-radius: 4px;
  transition: background .12s var(--ease);
}
@media (max-width: 620px) { .wf__row { grid-template-columns: 120px 1fr; } }
.wf__row:hover { background: var(--bg-2); }

.wf__label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--fg-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 12px;
}
.wf__kind {
  width: 7px; height: 7px;
  border-radius: 2px;
  flex: none;
}
.wf__track { position: relative; height: 18px; }
.wf__bar {
  position: absolute;
  top: 3px;
  height: 12px;
  border-radius: 3px;
  min-width: 3px;
}
.wf__bar--dim { opacity: .9; }

/* Span meta label — JS positions it inside the bar or just past its edge */
.wf__meta {
  position: absolute;
  top: 3px;
  height: 12px;
  display: inline-flex;
  align-items: center;
  width: max-content;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 500;
  white-space: nowrap;
  color: var(--fg-2);
  pointer-events: none;
}
.wf__meta--in { color: rgba(0,0,0,.72); }
.wf__meta--in.wf__meta--on-dim { color: var(--fg-0); }
.wf__meta--out { color: var(--fg-2); }

.wf__loop {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: color-mix(in oklab, #ffd166 18%, transparent);
  border: 1px solid color-mix(in oklab, #ffd166 40%, transparent);
  color: #ffd166;
  font-size: 9px;
  white-space: nowrap;
}
.wf__flag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--status-err) 16%, transparent);
  border: 1px solid color-mix(in oklab, var(--status-err) 40%, transparent);
  color: var(--status-err);
  font-size: 9px;
  white-space: nowrap;
}

.wf__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--fg-3);
}
.wf__legend span { display: inline-flex; align-items: center; gap: 6px; }
.wf__legend i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }

/* ── Stat strip ─────────────────────────────────────────────── */
.statstrip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 20px;
}
@media (max-width: 620px) { .statstrip { grid-template-columns: repeat(2, 1fr); } }
.statstrip__cell { background: var(--bg-1); padding: 12px 14px; }
.statstrip__k {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin-bottom: 5px;
}
.statstrip__v {
  font-family: var(--font-mono);
  font-size: 17px;
  color: var(--fg-0);
  letter-spacing: -.02em;
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.statstrip__v small { font-size: 10px; color: var(--fg-3); }
.statstrip__v .up { color: var(--status-err); font-size: 10px; }
.statstrip__v .down { color: var(--accent); font-size: 10px; }

/* ── Data table ─────────────────────────────────────────────── */
.dtable { width: 100%; border-collapse: collapse; font-family: var(--font-mono); font-size: 11.5px; }
.dtable th {
  text-align: left;
  padding: 8px 12px;
  font-size: 9.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--fg-3);
  font-weight: 500;
  border-bottom: 1px solid var(--line);
}
.dtable td {
  padding: 10px 12px;
  border-bottom: 1px solid color-mix(in oklab, var(--line) 60%, transparent);
  color: var(--fg-1);
}
.dtable tr:last-child td { border-bottom: 0; }
.dtable tr:hover td { background: var(--bg-2); }
.dtable .num { text-align: right; font-variant-numeric: tabular-nums; }
.dtable .accent { color: var(--accent); }

.costbar {
  height: 5px;
  border-radius: 3px;
  background: var(--accent);
  min-width: 3px;
}
.costbar--track { background: var(--bg-3); border-radius: 3px; overflow: hidden; }

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10px;
  white-space: nowrap;
}
.badge--ok { background: color-mix(in oklab, var(--accent) 14%, transparent); color: var(--accent); }
.badge--err { background: color-mix(in oklab, var(--status-err) 16%, transparent); color: var(--status-err); }
.badge--warn { background: color-mix(in oklab, #ffd166 16%, transparent); color: #ffd166; }
.badge--neutral { background: var(--bg-3); color: var(--fg-2); }

/* ── Security feed ──────────────────────────────────────────── */
.secfeed { display: flex; flex-direction: column; gap: 8px; }
.secitem {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-left: 2px solid var(--status-err);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 11.5px;
}
.secitem--warn { border-left-color: #ffd166; }
.secitem__time { color: var(--fg-3); font-size: 10.5px; white-space: nowrap; }
.secitem__body { min-width: 0; }
.secitem__title { color: var(--fg-0); margin-bottom: 3px; }
.secitem__meta { color: var(--fg-3); font-size: 10.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.secitem__act { color: var(--fg-3); font-size: 10.5px; white-space: nowrap; }

/* ── Replay ─────────────────────────────────────────────────── */
.replay { display: grid; grid-template-columns: 1fr 260px; gap: 18px; }
@media (max-width: 760px) { .replay { grid-template-columns: 1fr; } }
.replay__timeline {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-2);
}
.replay__play {
  width: 24px; height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #00120a;
  font-size: 9px;
  flex: none;
}
.replay__track {
  flex: 1;
  height: 3px;
  background: var(--bg-3);
  border-radius: 2px;
  position: relative;
}
.replay__fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent); border-radius: 2px; }
.replay__knob {
  position: absolute;
  top: 50%;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--accent);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 22%, transparent);
}
.replay__steps { display: flex; flex-direction: column; gap: 3px; }
.replay__step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-2);
  border: 1px solid transparent;
}
.replay__step[data-active="true"] {
  background: color-mix(in oklab, var(--accent) 10%, transparent);
  border-color: color-mix(in oklab, var(--accent) 30%, transparent);
  color: var(--fg-0);
}
.replay__step .idx { color: var(--fg-3); font-size: 10px; width: 14px; }
.replay__state {
  background: var(--bg-0);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1.6;
  color: var(--fg-2);
  white-space: pre;
  overflow: auto;
  max-height: 300px;
}
.replay__state::-webkit-scrollbar { width: 6px; }
.replay__state::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 3px; }

/* ── View tabs (above browser) ──────────────────────────────── */
.viewtabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.viewtab {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--bg-1);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-2);
  transition: all .15s var(--ease);
}
.viewtab:hover { color: var(--fg-0); border-color: var(--line-strong); }
.viewtab[aria-selected="true"] {
  background: color-mix(in oklab, var(--accent) 12%, transparent);
  border-color: color-mix(in oklab, var(--accent) 45%, transparent);
  color: var(--accent);
}

/* ── Platform capability grid ───────────────────────────────── */
.capgrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-top: 40px;
}
@media (max-width: 900px) { .capgrid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .capgrid { grid-template-columns: 1fr; } }

.cap {
  background: var(--bg-1);
  padding: 26px 24px;
  transition: background .2s var(--ease);
}
.cap:hover { background: color-mix(in oklab, var(--accent) 4%, var(--bg-1)); }
.cap__icon {
  width: 30px; height: 30px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  background: color-mix(in oklab, var(--accent) 12%, transparent);
  color: var(--accent);
  margin-bottom: 16px;
}
.cap__icon svg { width: 16px; height: 16px; }
.cap h3 {
  font-family: var(--font-mono);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--fg-0);
  margin: 0 0 8px;
  letter-spacing: -.01em;
}
.cap p {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--fg-2);
  text-wrap: pretty;
}
