/* ELA app walkthrough — dark, calm, self-contained. No external fonts or CDNs. */

:root {
  --bg:        #060b09;
  --bg-2:      #0a110e;
  --panel:     #0c1512;
  --panel-2:   #101b17;
  --line:      rgba(120, 190, 165, 0.13);
  --line-2:    rgba(120, 190, 165, 0.24);
  --ink:       #e9f3ef;
  --ink-2:     #9db3aa;
  --ink-3:     #67807600;
  --muted:     #6f8880;
  --mint:      #4fd1a5;
  --mint-dim:  rgba(79, 209, 165, 0.42);
  --mint-soft: rgba(79, 209, 165, 0.10);
  --amber:     #f0b866;
  --amber-soft:rgba(240, 184, 102, 0.11);
  --rose:      #ef6f72;
  --radius:    12px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --shadow: 0 30px 70px -20px rgba(0,0,0,.85), 0 2px 10px rgba(0,0,0,.5);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background:
    radial-gradient(1100px 620px at 50% -14%, rgba(79,209,165,.075), transparent 62%),
    radial-gradient(900px 520px at 88% 106%, rgba(79,209,165,.045), transparent 60%),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ---------- top bar ---------- */
.topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 18px;
  height: 58px;
  border-bottom: 1px solid var(--line);
  background: rgba(6,11,9,.82);
  backdrop-filter: blur(14px);
  z-index: 40;
}
.brand { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.brandmark {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--mint); box-shadow: 0 0 12px var(--mint-dim);
  align-self: center;
}
.brandname { font-weight: 700; letter-spacing: .16em; font-size: 13px; }
.brandsub { color: var(--muted); font-size: 11.5px; letter-spacing: .04em; white-space: nowrap; }

.tabs { display: flex; gap: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.tab {
  appearance: none; border: 0; background: transparent; color: var(--ink-2);
  font: inherit; font-size: 12.5px; padding: 5px 13px; border-radius: 7px; cursor: pointer;
  transition: background .16s, color .16s;
}
.tab:hover { color: var(--ink); }
.tab.is-on { background: var(--mint-soft); color: var(--mint); }

.crumbs { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 7px; overflow: hidden; }
.crumb {
  font-size: 11.5px; color: var(--muted); white-space: nowrap;
  padding: 3px 9px; border-radius: 999px; border: 1px solid transparent;
  background: rgba(255,255,255,.02); cursor: pointer;
}
.crumb:hover { color: var(--ink-2); border-color: var(--line); }
.crumb.is-now { color: var(--mint); border-color: var(--line-2); background: var(--mint-soft); cursor: default; }
.crumb-sep { color: rgba(120,150,140,.35); font-size: 11px; }

.controls { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.btn {
  appearance: none; cursor: pointer; font: inherit; font-size: 12.5px;
  color: var(--ink-2); background: var(--panel); border: 1px solid var(--line);
  border-radius: 9px; padding: 6px 12px; display: inline-flex; align-items: center; gap: 7px;
  transition: border-color .16s, color .16s, background .16s;
}
.btn:hover { color: var(--ink); border-color: var(--line-2); }
.btn:disabled { opacity: .38; cursor: default; }
.glyph { font-size: 13px; line-height: 1; }

.seg { display: flex; align-items: center; gap: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 9px; padding: 3px 3px 3px 10px; }
.seglabel { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-right: 3px; }
.segbtn {
  appearance: none; border: 0; background: transparent; color: var(--ink-2);
  font: inherit; font-size: 11.5px; padding: 4px 9px; border-radius: 6px; cursor: pointer;
}
.segbtn:hover { color: var(--ink); }
.segbtn.is-on { background: var(--mint-soft); color: var(--mint); }

/* ---------- stage ---------- */
.stage {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr) 320px;
}
.stage[hidden] { display: none; }

.sidebar {
  border-right: 1px solid var(--line);
  overflow-y: auto;
  padding: 16px 12px 30px;
  scrollbar-width: thin;
}
.lanehead {
  font-size: 10px; letter-spacing: .17em; text-transform: uppercase;
  color: var(--muted); padding: 14px 10px 6px;
}
.lanehead:first-child { padding-top: 2px; }
.navitem {
  display: flex; align-items: center; gap: 8px;
  width: 100%; text-align: left; appearance: none; border: 0; cursor: pointer;
  background: transparent; color: var(--ink-2); font: inherit; font-size: 12.2px;
  padding: 6px 10px; border-radius: 8px; line-height: 1.35;
  transition: background .14s, color .14s;
}
.navitem:hover { background: rgba(255,255,255,.035); color: var(--ink); }
.navitem.is-now { background: var(--mint-soft); color: var(--mint); }
.navitem .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .4; flex: 0 0 auto; }
.navitem.is-now .dot { opacity: 1; }
.navitem .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- phone ---------- */
.phonewrap {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; padding: 18px; min-width: 0; min-height: 0;
}
.phone {
  position: relative;
  height: min(calc(100vh - 178px), 800px);
  aspect-ratio: 1170 / 2532;
  border-radius: 46px;
  padding: 9px;
  background: linear-gradient(160deg, #1b2724 0%, #0a100e 42%, #131d1a 100%);
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(255,255,255,.06);
  flex: 0 0 auto;
}
.screen {
  position: relative; width: 100%; height: 100%;
  border-radius: 38px; overflow: hidden;
  background: #05100c;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.9);
}
.screen img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: top center;
  opacity: 0; transition: opacity 150ms ease;
  user-select: none; -webkit-user-drag: none;
}
.screen img.is-on { opacity: 1; }

.hotspots { position: absolute; inset: 0; }
.hot {
  position: absolute; appearance: none; padding: 0; cursor: pointer;
  background: transparent; border: 1px dashed transparent; border-radius: 9px;
  transition: background .14s, border-color .14s, box-shadow .14s;
}
.hot:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }
body[data-hints="subtle"] .hot { border-color: rgba(79,209,165,.34); }
body[data-hints="subtle"] .hot.k-sheet { border-color: rgba(240,184,102,.26); }
body[data-hints="subtle"] .hot.k-external { border-color: rgba(157,179,170,.24); }
body[data-hints="labels"] .hot { border-color: rgba(79,209,165,.5); background: rgba(79,209,165,.07); }
body[data-hints="labels"] .hot.k-sheet { border-color: rgba(240,184,102,.42); background: rgba(240,184,102,.06); }
body[data-hints="labels"] .hot.k-external { border-color: rgba(157,179,170,.35); background: rgba(157,179,170,.05); }
body[data-hints="off"] .hot { border-color: transparent; background: transparent; }

.hot:hover { background: rgba(79,209,165,.16); border-color: var(--mint); box-shadow: 0 0 0 1px rgba(79,209,165,.3); }
.hot.k-sheet:hover { background: rgba(240,184,102,.15); border-color: var(--amber); box-shadow: 0 0 0 1px rgba(240,184,102,.3); }
.hot.k-external:hover { background: rgba(200,220,212,.12); border-color: rgba(210,228,221,.7); box-shadow: none; }

.hot .chip {
  position: absolute; left: 4px; top: 3px; max-width: calc(100% - 8px);
  font-size: 9.5px; letter-spacing: .01em; line-height: 1.25;
  padding: 2px 6px; border-radius: 5px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
  background: rgba(4,10,8,.9); color: var(--mint); border: 1px solid rgba(79,209,165,.3);
  opacity: 0; transition: opacity .13s; pointer-events: none;
}
.hot.k-sheet .chip { color: var(--amber); border-color: rgba(240,184,102,.3); }
.hot.k-external .chip { color: #cfe0d9; border-color: rgba(200,220,212,.24); }
body[data-hints="labels"] .hot .chip { opacity: 1; }
.hot:hover .chip { opacity: 1; }
body[data-hints="off"] .hot .chip { opacity: 0; }
body[data-hints="off"] .hot:hover .chip { opacity: 1; }
.hot.is-edge .chip { writing-mode: vertical-rl; left: 2px; top: 6px; max-height: 90%; }

/* ---------- watch frame ---------- */
.phone.is-watch {
  height: min(calc((100vh - 178px) * .46), 380px);
  aspect-ratio: 416 / 496;
  border-radius: 25% / 21%;
  padding: 7px;
  background: linear-gradient(155deg, #202c29 0%, #0b1210 46%, #16211e 100%);
}
.phone.is-watch .screen { border-radius: 21% / 17%; }
/* digital crown */
.phone.is-watch::after {
  content: "";
  position: absolute; right: -5px; top: 31%;
  width: 6px; height: 14%;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, #2c3b36, #16211d 55%, #26332e);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.07), 1px 0 5px rgba(0,0,0,.6);
}

/* ---------- gesture / crown edges (no tap zone on the wrist) ---------- */
.gestures {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 7px; max-width: 640px;
}
.gestures:empty { display: none; }
.gesturepill {
  appearance: none; cursor: pointer; font: inherit; font-size: 11px;
  color: var(--ink-2); background: var(--panel); border: 1px solid var(--line);
  border-radius: 999px; padding: 4px 12px;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  transition: border-color .16s, color .16s, background .16s;
}
.gesturepill:hover { color: var(--mint); border-color: rgba(79,209,165,.5); background: var(--mint-soft); }
.gesturepill:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }
.gesturepill .g { color: var(--mint); font-size: 12.5px; line-height: 1; }
.gesturepill.k-sheet:hover { color: var(--amber); border-color: rgba(240,184,102,.45); background: var(--amber-soft); }
.gesturepill.k-sheet .g { color: var(--amber); }

.framefoot {
  margin: 0; font-size: 11.5px; color: var(--muted); text-align: center;
  max-width: 640px; min-height: 17px;
}

/* ---------- right rail ---------- */
.rail {
  border-left: 1px solid var(--line);
  overflow-y: auto; padding: 18px 18px 32px;
  scrollbar-width: thin;
}
.rail h1 { font-size: 18px; line-height: 1.28; margin: 4px 0 6px; font-weight: 650; letter-spacing: -.01em; }
.rail .lanetag {
  display: inline-block; font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--mint); background: var(--mint-soft); border: 1px solid rgba(79,209,165,.2);
  padding: 2px 8px; border-radius: 999px;
}
.rail .sid { font-family: var(--mono); font-size: 10.5px; color: var(--muted); margin: 8px 0 14px; word-break: break-all; }
.rail .sect { font-size: 9.5px; letter-spacing: .17em; text-transform: uppercase; color: var(--muted); margin: 18px 0 7px; }
.rail p.note { margin: 0 0 8px; font-size: 12px; color: var(--ink-2); line-height: 1.55; }

.autochip {
  display: block; width: 100%; text-align: left; appearance: none; cursor: default;
  font: inherit; font-size: 12px; line-height: 1.45;
  color: var(--amber); background: var(--amber-soft);
  border: 1px solid rgba(240,184,102,.28); border-left-width: 3px;
  border-radius: 10px; padding: 9px 11px;
}
.autochip.is-live { cursor: pointer; }
.autochip.is-live:hover { background: rgba(240,184,102,.19); border-color: rgba(240,184,102,.55); }
.autochip .go { display: block; margin-top: 5px; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; opacity: .85; }
.autochip .detail { display: block; margin-top: 6px; font-size: 11.2px; color: rgba(240,184,102,.72); }

/* mirrored surface: same moment, other device — same shape as .autochip, mint */
.mirrorchip {
  display: block; width: 100%; text-align: left; appearance: none; cursor: pointer;
  font: inherit; font-size: 12px; line-height: 1.45;
  color: var(--mint); background: var(--mint-soft);
  border: 1px solid rgba(79,209,165,.28); border-left-width: 3px;
  border-radius: 10px; padding: 9px 11px; margin-bottom: 6px;
  transition: background .16s, border-color .16s;
}
.mirrorchip:hover { background: rgba(79,209,165,.18); border-color: rgba(79,209,165,.55); }
.mirrorchip .detail { display: block; margin-top: 6px; font-size: 11.2px; color: rgba(140,220,195,.78); }
.mirrorchip .go { display: block; margin-top: 5px; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; opacity: .85; }

.stripchip {
  display: block; width: 100%; text-align: left; appearance: none; cursor: pointer;
  font: inherit; font-size: 11.5px; color: var(--ink-2);
  background: var(--panel); border: 1px solid var(--line); border-radius: 9px;
  padding: 7px 10px; margin-bottom: 6px; line-height: 1.4;
}
.stripchip:hover { border-color: var(--line-2); color: var(--ink); }
.stripchip .why { display: block; font-size: 10.5px; color: var(--muted); margin-top: 2px; }

.aliasbox {
  font-size: 11.3px; color: var(--muted); border: 1px dashed var(--line);
  border-radius: 9px; padding: 8px 10px; line-height: 1.5;
}
.aliasbox code { font-family: var(--mono); font-size: 10.5px; color: var(--ink-2); }

/* ---------- map ---------- */
.mapview { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.mapview[hidden] { display: none; }
.maphead {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 20px;
  padding: 16px 24px 12px;
}
.maphead h2 { margin: 0; font-size: 16px; font-weight: 650; letter-spacing: -.01em; }
.maphead p { margin: 3px 0 0; font-size: 12px; color: var(--muted); }
.mapzoom { display: flex; align-items: center; gap: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 9px; padding: 3px 3px 3px 10px; }

.mapscroll { flex: 1 1 auto; overflow: auto; padding: 0 24px 24px; scrollbar-width: thin; }
.mapzoomer { position: relative; }
.mapinner { position: relative; transform-origin: 0 0; }
#mapSvg { position: absolute; inset: 0; pointer-events: none; z-index: 1; }

.lanerow {
  position: absolute; height: 24px; display: flex; align-items: center; gap: 12px;
  z-index: 2; pointer-events: none;
}
.lanerow .nm { font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--mint); opacity: .85; }
.lanerow .rule { flex: 1 1 auto; height: 1px; background: linear-gradient(90deg, var(--line-2), transparent); }
.lanenote { position: absolute; z-index: 2; font-size: 10.5px; color: var(--muted); pointer-events: none; }

.mapcard {
  position: absolute; z-index: 3; appearance: none; cursor: pointer; padding: 0;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  overflow: hidden; text-align: left; font: inherit; color: var(--ink);
  transition: border-color .16s, transform .16s, box-shadow .16s;
}
.mapcard:hover { border-color: var(--mint); transform: translateY(-3px); box-shadow: 0 16px 34px -14px rgba(0,0,0,.9); }
.mapcard img { display: block; width: 100%; background: #05100c; }
.mapcard .cap { padding: 7px 9px 8px; border-top: 1px solid var(--line); background: var(--panel-2); }
.mapcard .cap .t { font-size: 11px; line-height: 1.3; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mapcard .cap .i { font-family: var(--mono); font-size: 9px; color: var(--muted); display: block; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.edgelabel { font-family: var(--sans); font-size: 9.5px; fill: #9db3aa; }
.edgelabel.deadman { fill: var(--amber); font-size: 10.5px; font-weight: 600; }

/* ---------- toasts ---------- */
.toasts {
  position: fixed; left: 50%; bottom: 58px; transform: translateX(-50%);
  display: flex; flex-direction: column-reverse; gap: 8px; z-index: 90;
  pointer-events: none; align-items: center; width: max-content; max-width: 92vw;
}
.toast {
  background: rgba(10,20,17,.96); border: 1px solid var(--line-2);
  border-left: 3px solid var(--mint);
  border-radius: 10px; padding: 9px 14px; font-size: 12.5px; color: var(--ink);
  box-shadow: 0 14px 34px -12px rgba(0,0,0,.9);
  animation: toastin .18s ease both;
  max-width: 560px;
}
.toast.t-sheet { border-left-color: var(--amber); }
.toast.t-external { border-left-color: #9db3aa; }
.toast .k { color: var(--muted); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; display: block; margin-bottom: 2px; }
.toast.is-out { animation: toastout .22s ease both; }
@keyframes toastin  { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes toastout { to { opacity: 0; transform: translateY(6px); } }

/* ---------- footer ---------- */
.foot {
  flex: 0 0 auto; height: 34px; display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 0 18px; border-top: 1px solid var(--line);
  font-size: 10.5px; color: var(--muted); letter-spacing: .02em;
}
.footkeys { color: rgba(111,136,128,.7); }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: rgba(120,190,165,.16); border-radius: 9px; }
::-webkit-scrollbar-track { background: transparent; }

@media (max-width: 1180px) {
  .stage { grid-template-columns: 200px minmax(0,1fr) 280px; }
  .crumbs { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .screen img, .hot, .mapcard, .gesturepill, .mirrorchip { transition: none; }
  .toast { animation: none; }
}
