:root {
  --bg: #0e1014;
  --panel: #171a20;
  --panel-2: #1d2129;
  --ink: #e9ebef;
  --muted: #949aa6;
  --line: #262a33;
  --primary: #5B22D6;
  --primary-ink: #ffffff;
  --highlight: #D894FF;
  --lavender: #C4A2FF;
  --violet: #A78BFA;
  --good: #45c98a;
  --bad: #ff7676;
  --mark-bg: rgba(216,148,255,.18);
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.3);
  --radius: 12px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f7f9; --panel: #ffffff; --panel-2: #f1f2f6; --ink: #16181d; --muted: #6b7280;
    --line: #e4e7ec; --good: #14864f; --bad: #c02626; --mark-bg: rgba(91,34,214,.14);
    --shadow: 0 1px 2px rgba(16,24,40,.06), 0 8px 24px rgba(16,24,40,.06);
  }
}

* { box-sizing: border-box; }
html { height: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 14px; line-height: 1.5;
  background: var(--bg); color: var(--ink);
  display: flex; flex-direction: column; min-height: 100vh;
}
a { color: var(--highlight); text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

/* ---------- header ---------- */
.top {
  display: flex; align-items: center; gap: 20px;
  padding: 12px 24px; border-bottom: 1px solid var(--line); background: var(--panel);
  position: sticky; top: 0; z-index: 5;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.brand .mark { width: 28px; height: 28px; object-fit: contain; }
.brand .name { font-weight: 700; font-size: 17px; letter-spacing: .01em; }
.nav { display: flex; gap: 4px; }
.navbtn {
  background: none; border: 0; padding: 6px 12px; border-radius: 8px; color: var(--muted); font-weight: 500;
}
.navbtn.on { background: var(--panel-2); color: var(--ink); }
.identity { margin-left: auto; display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.avatar { width: 26px; height: 26px; border-radius: 50%; }

/* ---------- buttons ---------- */
.primary {
  background: var(--primary); color: var(--primary-ink); border: 0; border-radius: 10px;
  padding: 11px 20px; font-weight: 600; font-size: 15px;
}
.primary:hover { filter: brightness(1.1); }
.secondary {
  display: inline-block; border: 1px solid var(--line); border-radius: 10px; padding: 10px 20px;
  color: var(--ink); font-weight: 600; font-size: 15px; background: var(--panel);
}
.secondary:hover { border-color: var(--violet); }
.ghost {
  background: none; border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; color: var(--ink);
}
.ghost:hover { border-color: var(--violet); }
.ghost.small { padding: 3px 9px; font-size: 12px; }
.ghost.wide { width: 100%; margin-top: 8px; }
.ghost.danger { color: var(--bad); }
.icon { background: none; border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; font-size: 12px; color: var(--muted); }
.icon:hover { color: var(--ink); border-color: var(--violet); }
.link { background: none; border: 0; color: var(--highlight); padding: 0; }

/* ---------- landing ---------- */
.landing { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 56px 24px 40px; }
.hero { max-width: 640px; text-align: center; }
.hero-mark { width: 96px; height: 96px; object-fit: contain; margin-bottom: 12px; }
.hero h1 { font-size: 34px; line-height: 1.15; margin: 0 0 14px; letter-spacing: -.01em; }
.lede { color: var(--muted); font-size: 16px; margin: 0 0 24px; }
.cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
@media (max-width: 520px) { .hero h1 { font-size: 28px; } }

.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 18px; border-top: 1px solid var(--line); }
.error { color: var(--bad); }
.muted { color: var(--muted); }
.pad { padding: 14px 18px; margin: 0; }

/* ---------- gate ---------- */
.gate { flex: 1; display: grid; place-items: center; padding: 40px 24px; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.card.center { max-width: 460px; padding: 32px; text-align: center; }
.card.center h2 { margin: 0 0 8px; }
.card.center p { margin: 0 0 20px; }

/* ---------- portal ---------- */
.portal {
  flex: 1; display: grid; grid-template-columns: 240px minmax(300px, 420px) 1fr;
  min-height: 0; height: calc(100vh - 53px);
}
.rail { padding: 18px 16px; border-right: 1px solid var(--line); overflow: auto; background: var(--panel); }
.seg { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin-bottom: 14px; }
.seg button { flex: 1; background: none; border: 0; padding: 7px; color: var(--muted); font-weight: 500; }
.seg button.on { background: var(--primary); color: #fff; }
.field { display: block; margin-bottom: 12px; }
.field span { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 4px; }
.field input, .field select {
  width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; outline: none;
}
.field input:focus, .field select:focus { border-color: var(--violet); }
.hint { font-size: 12px; color: var(--muted); margin: 6px 0 0; }

.list { border-right: 1px solid var(--line); overflow: auto; padding: 8px; }
.list-head { font-size: 12px; color: var(--muted); padding: 6px 10px; }
.row {
  width: 100%; text-align: left; background: none; border: 0; border-radius: 10px; padding: 10px 12px;
  display: block; color: var(--ink);
}
.row:hover { background: var(--panel); }
.row.on { background: var(--panel-2); }
.row .t { font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .m { font-size: 12px; color: var(--muted); display: block; }
.row .s { font-size: 12px; color: var(--muted); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.row .snip { font-size: 12px; margin-top: 4px; color: var(--ink); opacity: .9; }
.row .snip div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
mark { background: var(--mark-bg); color: var(--highlight); border-radius: 3px; padding: 0 1px; }
mark.cur { outline: 2px solid var(--highlight); }

.detail { overflow: auto; padding: 24px 32px; }
.empty { color: var(--muted); display: grid; place-items: center; height: 100%; }
.mhead h2 { margin: 0 0 4px; font-size: 22px; outline: none; border-radius: 6px; }
.mhead h2[contenteditable="true"] { background: var(--panel); padding: 2px 6px; box-shadow: 0 0 0 2px var(--violet); }
.meta { color: var(--muted); font-size: 13px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.block { margin-top: 26px; }
.block-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.block-head h3 { margin: 0; font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); flex: 1; }
#m-summary { margin: 0; font-size: 15px; }
.notes h4 { margin: 14px 0 4px; font-size: 14px; color: var(--lavender); }
.notes h4:first-child { margin-top: 0; }
.notes h5 { margin: 8px 0 2px; font-size: 13px; color: var(--ink); }
.notes ul { margin: 0; padding-left: 18px; }
.notes li { margin: 2px 0; }
.notes .ts { color: var(--muted); font-size: 12px; }
.find { display: flex; align-items: center; gap: 6px; }
.find input { background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 3px 8px; font-size: 12px; width: 180px; outline: none; }
.find input:focus { border-color: var(--violet); }
.transcript { font-size: 14px; }
.turn { display: grid; grid-template-columns: 56px 1fr; gap: 10px; padding: 5px 0; }
.turn .ts { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; padding-top: 2px; }
.turn .sp { font-weight: 600; font-size: 12px; letter-spacing: .02em; display: block; }
.turn .tx { margin: 0; }

@media (max-width: 1000px) {
  .portal { grid-template-columns: 220px 1fr; height: auto; }
  .detail { grid-column: 1 / -1; border-top: 1px solid var(--line); }
}
@media (max-width: 680px) {
  .portal { grid-template-columns: 1fr; }
  .rail { border-right: 0; border-bottom: 1px solid var(--line); }
  .list { border-right: 0; }
}

/* ---------- admin ---------- */
.admin { flex: 1; padding: 24px; display: flex; flex-direction: column; gap: 20px; max-width: 1200px; width: 100%; margin: 0 auto; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.card-head h2 { margin: 0; font-size: 15px; }
.card-head input { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; outline: none; width: 260px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 9px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
td .actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11px; border: 1px solid var(--line); color: var(--muted); }
.pill.active, .pill.approved { color: var(--good); border-color: var(--good); }
.pill.pending { color: var(--highlight); border-color: var(--highlight); }
.pill.suspended, .pill.denied { color: var(--bad); border-color: var(--bad); }
.pill.admin { color: var(--lavender); border-color: var(--lavender); }

.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow);
  padding: 8px 14px; border-radius: 10px; font-size: 13px; z-index: 20;
}

.primary.small { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.secondary.small { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.railcard { margin-top: 18px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); display: flex; flex-direction: column; gap: 6px; }
.railcard strong { font-size: 13px; }
.railcard span { font-size: 12px; color: var(--muted); }
.railcard button { align-self: flex-start; margin-top: 4px; }

/* ---------- onboarding stepper ---------- */
.onboard { grid-column: 2 / -1; overflow: auto; padding: 40px 32px; display: flex; justify-content: center; }
.onboard-inner { width: 100%; max-width: 980px; }
.onboard h2 { margin: 0 0 4px; font-size: 24px; letter-spacing: -.01em; }
.onboard > .onboard-inner > p { margin: 0 0 28px; }
.stepper-wrap { position: relative; }
.stepper { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; position: relative; }
.track { position: absolute; left: 10%; right: 10%; top: 31px; height: 2px; background: var(--line); border-radius: 2px; z-index: 0; }
.track .fill { height: 100%; width: 0; background: linear-gradient(90deg, #5B22D6, #D894FF); border-radius: 2px; }
.play .track .fill { animation: draw 1.4s cubic-bezier(.4,0,.2,1) .3s forwards; }
.step {
  position: relative; z-index: 1; padding: 16px 14px 18px; border-radius: 14px;
  border: 1px solid transparent;
  background: linear-gradient(var(--panel), var(--panel)) padding-box, linear-gradient(var(--line), var(--line)) border-box;
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px;
  opacity: 0; transform: translateY(14px);
  transition: transform .25s ease, box-shadow .25s ease, background .25s ease;
}
.play .step { animation: rise .5s cubic-bezier(.2,.7,.2,1) forwards; animation-delay: calc(var(--i) * 120ms + 150ms); }
.step:hover, .step.is-active {
  background: linear-gradient(var(--panel), var(--panel)) padding-box, linear-gradient(135deg, #5B22D6, #D894FF) border-box;
  box-shadow: 0 0 0 1px rgba(216,148,255,.15), 0 10px 30px rgba(91,34,214,.28);
  transform: translateY(-2px);
}
.step .badge {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--primary); color: #fff; font-weight: 700; font-size: 13px;
  box-shadow: 0 0 0 4px var(--panel);
}
.step .ico { width: 30px; height: 30px; color: var(--lavender); margin-top: 6px; }
.step .ico svg { width: 100%; height: 100%; }
.step strong { font-size: 14px; }
.step .sub { font-size: 12px; color: var(--muted); line-height: 1.35; }
.onboard-actions { display: flex; gap: 12px; margin-top: 28px; justify-content: center; }
@keyframes rise { to { opacity: 1; transform: translateY(0); } }
@keyframes draw { to { width: 100%; } }
@media (max-width: 900px) {
  .stepper { grid-template-columns: 1fr; gap: 12px; }
  .track { left: 29px; right: auto; top: 6%; bottom: 6%; width: 2px; height: auto; }
  .track .fill { width: 100%; height: 0; background: linear-gradient(180deg, #5B22D6, #D894FF); }
  .play .track .fill { animation-name: drawv; }
  .step { flex-direction: row; text-align: left; align-items: center; padding-left: 14px; display: grid; grid-template-columns: 30px 30px 1fr; column-gap: 12px; row-gap: 0; }
  .step .ico { margin-top: 0; }
  .step strong { grid-column: 3; }
  .step .sub { grid-column: 3; }
  .step .badge { grid-row: 1 / span 2; }
  .step .ico { grid-row: 1 / span 2; }
}
@keyframes drawv { to { height: 100%; } }
@media (max-width: 1000px) { .onboard { grid-column: 1 / -1; } }
@media (prefers-reduced-motion: reduce) {
  .step, .play .step { animation: none; opacity: 1; transform: none; transition: none; }
  .play .track .fill { animation: none; width: 100%; height: 100%; }
  .step:hover, .step.is-active { transform: none; }
}

/* ---------- loading / transitions ---------- */
main { transition: opacity .2s ease; }
main.fade-out { opacity: 0; }
main.fade-in { animation: fadein .2s ease; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.loading .lede { color: var(--muted); }
.pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: .55; transform: scale(.98); } 50% { opacity: 1; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) {
  main, main.fade-in { transition: none; animation: none; }
  .pulse { animation: none; }
}

/* ---------- calendar status pill ---------- */
.status-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--line); font-size: 12px; color: var(--muted); cursor: default; white-space: nowrap;
}
.status-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.status-pill.connected .dot { background: var(--good); box-shadow: 0 0 0 3px rgba(69,201,138,.18); }
.status-pill.connected { color: var(--ink); }
.status-pill .cal-ico { width: 14px; height: 14px; flex: none; }
@media (max-width: 760px) { .status-pill .lbl { display: none; } .status-pill { padding: 4px 8px; } }

.foot-brand { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; }
.foot-brand:hover { opacity: 1; }
.foot-mark { width: 16px; height: 16px; object-fit: contain; opacity: .85; }

/* ---------- delete / confirm ---------- */
.meta { position: relative; }
.icon.danger { color: var(--muted); }
.icon.danger:hover { color: var(--bad); border-color: var(--bad); }
.icon.trash { margin-left: auto; padding: 3px 6px; display: inline-flex; }
.icon.trash svg { width: 14px; height: 14px; }
.row { position: relative; }
.row .row-trash {
  position: absolute; top: 8px; right: 8px; opacity: 0; background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 6px; padding: 3px 6px; color: var(--muted); display: inline-flex;
}
.row .row-trash svg { width: 13px; height: 13px; }
.row:hover .row-trash, .row .row-trash:focus { opacity: 1; }
.row .row-trash:hover { color: var(--bad); border-color: var(--bad); }
.primary.danger-btn { background: var(--bad); }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: grid; place-items: center; z-index: 30; padding: 20px; }
.modal-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 22px; max-width: 440px; width: 100%; }
.modal-card p { margin: 0 0 18px; font-size: 15px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* ---------- thin loading bar ---------- */
.admin { position: relative; }
.loading-bar { position: absolute; top: 0; left: 0; right: 0; height: 2px; overflow: hidden; background: var(--line); }
.loading-bar div { height: 100%; width: 40%; background: linear-gradient(90deg, #5B22D6, #D894FF); animation: slide 1.1s ease-in-out infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(260%); } }
@media (prefers-reduced-motion: reduce) { .loading-bar div { animation: none; width: 100%; } }

/* ---------- original-language lines ---------- */
.toggle { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); cursor: pointer; user-select: none; }
.toggle input { accent-color: var(--primary); margin: 0; }
.turn .orig { margin: 2px 0 0; font-size: 12px; color: var(--muted); font-style: italic; }
.transcript.hide-orig .orig { display: none; }

/* ================= visual refresh ================= */
:focus-visible { outline: 2px solid var(--highlight); outline-offset: 2px; border-radius: 6px; }
.grad { background: linear-gradient(90deg, #A78BFA 0%, #D894FF 55%, #5B22D6 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* header */
.top { background: color-mix(in srgb, var(--panel) 78%, transparent); backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%); border-bottom: 0; }
.top::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(216,148,255,.45) 30%, rgba(91,34,214,.6) 70%, transparent); }
.wave { width: 34px; height: 16px; fill: var(--lavender); margin-left: 2px; opacity: .9; }
.wave rect { transform-box: fill-box; transform-origin: center; animation: bar 1.5s ease-in-out infinite; }
.wave rect:nth-child(1) { animation-delay: 0s; --lo: .25; --hi: .8; }
.wave rect:nth-child(2) { animation-delay: .2s; --lo: .35; --hi: 1; }
.wave rect:nth-child(3) { animation-delay: .4s; --lo: .2; --hi: .7; }
.wave rect:nth-child(4) { animation-delay: .6s; --lo: .4; --hi: 1; }
.wave rect:nth-child(5) { animation-delay: .8s; --lo: .3; --hi: .85; }
.wave rect:nth-child(6) { animation-delay: 1s; --lo: .2; --hi: .6; }
@keyframes bar { 0%, 100% { transform: scaleY(var(--lo)); } 50% { transform: scaleY(var(--hi)); } }

/* landing */
.landing { position: relative; overflow: hidden; padding-top: 60px; padding-bottom: 56px; }
.backdrop {
  position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background-image: radial-gradient(rgba(196,162,255,.13) 1px, transparent 1.2px);
  background-size: 26px 26px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 25%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 25%, #000 30%, transparent 75%);
}
.hero { position: relative; z-index: 1; max-width: 720px; }
.glow {
  position: absolute; left: 50%; top: 40px; width: 560px; height: 560px; transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(91,34,214,.55) 0%, rgba(168,139,250,.28) 35%, rgba(216,148,255,.10) 55%, transparent 70%);
  filter: blur(30px); z-index: -1; pointer-events: none;
  animation: breathe 12s ease-in-out infinite;
}
@keyframes breathe { 0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: .85; } 50% { transform: translate(-50%, -50%) scale(1.12); opacity: 1; } }
.hero-mark { width: 104px; height: 104px; filter: drop-shadow(0 0 24px rgba(216,148,255,.35)); }
.hero h1 { font-size: 42px; font-weight: 800; letter-spacing: -.025em; line-height: 1.08; margin: 6px 0 16px; }
.lede { max-width: 600px; margin-left: auto; margin-right: auto; }
.glowbtn {
  display: inline-flex; align-items: center; gap: 10px;
  background: linear-gradient(135deg, #5B22D6 0%, #7C3AED 60%, #A78BFA 130%);
  box-shadow: 0 6px 22px rgba(91,34,214,.35), inset 0 1px 0 rgba(255,255,255,.15);
  transition: box-shadow .25s ease, transform .2s ease, filter .2s ease;
}
.glowbtn:hover { box-shadow: 0 8px 34px rgba(216,148,255,.45), 0 0 0 1px rgba(216,148,255,.35), inset 0 1px 0 rgba(255,255,255,.2); transform: translateY(-1px); }
.glowbtn .g { width: 18px; height: 18px; background: #fff; border-radius: 50%; padding: 3px; box-sizing: content-box; }

/* demo transcript card */
.demo { position: relative; z-index: 1; width: 100%; max-width: 640px; margin-top: 44px; }
.glass {
  border-radius: 16px; padding: 16px 18px 18px;
  background: color-mix(in srgb, var(--panel) 62%, transparent);
  border: 1px solid rgba(196,162,255,.2);
  backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%);
  box-shadow: 0 20px 60px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.06);
}
.glass-head { display: flex; justify-content: space-between; align-items: center; font-size: 12px; margin-bottom: 12px; }
.rec { display: inline-flex; align-items: center; gap: 6px; color: #ff9b4a; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; font-size: 11px; }
.rdot { width: 7px; height: 7px; border-radius: 50%; background: #ff7a1a; box-shadow: 0 0 0 3px rgba(255,122,26,.2); }
.lines { min-height: 118px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; text-align: left; }
.dl { display: grid; grid-template-columns: 40px 1fr; gap: 10px; opacity: 0; transform: translateY(4px); transition: opacity .3s ease, transform .3s ease; }
.dl.in { opacity: 1; transform: none; }
.dl .ts { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; padding-top: 2px; }
.dl .sp { font-weight: 600; font-size: 12px; letter-spacing: .02em; display: block; }
.dl .tx { margin: 0; min-height: 1.4em; }
.caret { display: inline-block; width: 2px; height: 1em; background: var(--highlight); vertical-align: -2px; margin-left: 1px; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.demo-notes { margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(196,162,255,.14); display: flex; align-items: center; gap: 10px; opacity: 0; transform: translateY(6px); transition: opacity .45s ease, transform .45s ease; text-align: left; font-size: 13px; }
.demo-notes.in { opacity: 1; transform: none; }
.pill-notes { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; color: #fff; background: linear-gradient(135deg, #5B22D6, #A78BFA); }
.ai .who { color: var(--lavender); font-weight: 600; margin-right: 4px; }
.ai .ts { color: var(--muted); font-size: 12px; }

/* feature row */
.features { position: relative; z-index: 1; width: 100%; max-width: 1080px; margin-top: 44px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 979px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 559px) { .features { grid-template-columns: 1fr; } }
.feat {
  padding: 18px 18px 20px; border-radius: 14px; text-align: left; display: flex; flex-direction: column; gap: 6px;
  border: 1px solid transparent;
  background: linear-gradient(var(--panel), var(--panel)) padding-box, linear-gradient(var(--line), var(--line)) border-box;
  transition: transform .22s ease, box-shadow .22s ease, background .22s ease;
}
.feat:hover {
  transform: translateY(-2px);
  background: linear-gradient(var(--panel), var(--panel)) padding-box, linear-gradient(135deg, #5B22D6, #D894FF) border-box;
  box-shadow: 0 10px 30px rgba(91,34,214,.25);
}
.ficon { width: 28px; height: 28px; color: var(--lavender); }
.ficon svg { width: 100%; height: 100%; }
.feat strong { font-size: 14px; margin-top: 4px; }
.feat span:not(.ficon) { font-size: 13px; color: var(--muted); line-height: 1.4; }
@media (max-width: 760px) { .features { grid-template-columns: 1fr; } .hero h1 { font-size: 32px; } .glow { width: 380px; height: 380px; } }

/* portal polish */
.row { border-left: 2px solid transparent; border-radius: 0 10px 10px 0; transition: background .15s ease, border-color .15s ease; }
.row:hover, .row.on { border-left-color: var(--lavender); }
.row.on { background: linear-gradient(90deg, rgba(196,162,255,.10), var(--panel-2) 40%); }
.detail { position: relative; }
.detail::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 160px; pointer-events: none; background: radial-gradient(ellipse 60% 100% at 50% 0%, rgba(91,34,214,.16), transparent 70%); }
.detail > * { position: relative; }
.primary { background: linear-gradient(135deg, #5B22D6 0%, #7C3AED 70%, #8B5CF6 120%); box-shadow: 0 2px 10px rgba(91,34,214,.25); transition: box-shadow .2s ease, transform .15s ease; }
.primary:hover { box-shadow: 0 4px 18px rgba(216,148,255,.35); filter: none; }
.seg button.on { background: linear-gradient(135deg, #5B22D6, #7C3AED); }
.rail { background: color-mix(in srgb, var(--panel) 85%, transparent); }

@media (prefers-color-scheme: light) {
  .backdrop { background-image: radial-gradient(rgba(91,34,214,.16) 1px, transparent 1.2px); }
  .glow { background: radial-gradient(circle, rgba(91,34,214,.28) 0%, rgba(168,139,250,.18) 35%, rgba(216,148,255,.08) 55%, transparent 70%); }
  .glass { box-shadow: 0 20px 60px rgba(16,24,40,.12), inset 0 1px 0 rgba(255,255,255,.6); }
}
@media (prefers-reduced-motion: reduce) {
  .glow, .wave rect, .caret, .rdot { animation: none !important; }
  .dl, .demo-notes { opacity: 1 !important; transform: none !important; transition: none !important; }
  .feat, .glowbtn, .row { transition: none; }
  .feat:hover, .glowbtn:hover { transform: none; }
}

/* Demo card: translated line reveals its original underneath */
.demo-orig { opacity: 0; transform: translateY(-2px); transition: opacity .35s ease, transform .35s ease; }
.demo-orig.in { opacity: 1; transform: none; }
.dl .demo-orig { margin: 1px 0 0; font-size: 12.5px; color: var(--muted); font-style: italic; }
