/* THE LOST FREQUENCY — styles
 * Colours, type and motion follow the SEVEN Brand Directory (see docs/01-brand-intelligence.md §5).
 * Logical properties throughout so RTL (Arabic) and LTR (English) mirror correctly.
 */
/* The SEVEN typeface is loaded from css/seven-font.css. Fallback = Tahoma, the brand's official support font (BD p.75). */

:root {
  /* 7 core colours — BD p.63 */
  --cyan: #00ADC4; --blue: #0057A4; --purple: #9D33A3; --magenta: #E5007A;
  --orange: #F46300; --yellow: #FABA00; --green: #04A357;
  /* tints — BD p.64 */
  --dark-blue: #002F6C; --light-blue: #458AC9; --bg-blue: #BADEF4;
  --bg-cyan: #CEEAEF; --light-cyan: #35D0E5; --dark-cyan: #0583A0;
  --bg-yellow: #FFF7C0; --light-yellow: #FFCC3E; --dark-yellow: #DB9200;
  --bg-magenta: #F9CFE7; --bg-purple: #E6CEEF; --bg-green: #D4F4DC; --bg-orange: #FFDFD2;
  --ink: #002F6C;            /* text on light = Dark Blue */
  --ink-2: #4b5d7a;
  --ink-3: #8a97ad;
  --line: #e6ebf3;
  --surface: #ffffff;
  --surface-2: #f5f8fc;
  --display: 'SEVEN', Tahoma, 'Segoe UI', system-ui, sans-serif;
  --body: Tahoma, 'Segoe UI', 'Geeza Pro', 'Noto Sans Arabic', system-ui, sans-serif;
  /* motion — BD p.413: human, non-linear acceleration */
  --ease: cubic-bezier(.65, 0, .35, 1);
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --t-fast: 180ms; --t: 320ms; --t-slow: 620ms;
  --fs: 15px;
  --r-phone: 46px;
}
:root[data-text='s'] { --fs: 13.5px; }
:root[data-text='l'] { --fs: 17px; }
:root[data-motion='reduced'] *, :root[data-motion='reduced'] *::before, :root[data-motion='reduced'] *::after {
  animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--body); font-size: var(--fs); color: var(--ink); background: #fff;
  overflow: hidden; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
button:focus-visible, [tabindex]:focus-visible, input:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; border-radius: 8px; }
img { display: block; max-width: 100%; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; margin: 0; letter-spacing: 0; }
p { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Stage (desktop backdrop) ---------- */
.stage {
  position: fixed; inset: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center; background: linear-gradient(180deg, #fff 0%, var(--surface-2) 100%); overflow: hidden;
}
.stage-path { position: absolute; pointer-events: none; opacity: .9; }
.stage-path--a { width: 46vw; max-width: 760px; inset-block-end: -10vh; inset-inline-start: -8vw; transform: scaleX(-1); }
.stage-path--b { width: 18vw; max-width: 300px; inset-block-start: -12vh; inset-inline-end: 6vw; }
[dir='ltr'] .stage-path--a { transform: none; }
.side { grid-column: 1; justify-self: end; padding-inline-end: 56px; max-width: 340px; position: relative; z-index: 1; }
.side-logo { width: 200px; height: auto; margin-block-end: 28px; }
.side-title { font-size: 34px; line-height: 1.15; color: var(--ink); margin-block-end: 22px; }
.side-chapters { list-style: none; margin: 0 0 22px; padding: 0; display: grid; gap: 10px; }
.side-chapters li { display: flex; align-items: center; gap: 10px; color: var(--ink-3); font-size: 14px; transition: color var(--t) var(--ease); }
.side-chapters li::before { content: ''; inline-size: 26px; block-size: 6px; border-radius: 6px; background: var(--line); transition: background var(--t) var(--ease), inline-size var(--t) var(--ease); }
.side-chapters li.done { color: var(--ink-2); }
.side-chapters li.done::before { background: var(--c, var(--cyan)); }
.side-chapters li.now { color: var(--ink); font-weight: 700; }
.side-chapters li.now::before { background: var(--c, var(--cyan)); inline-size: 42px; }
.side-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 7px 14px; font-size: 13px; color: var(--ink); transition: border-color var(--t-fast); }
.chip:hover { border-color: var(--cyan); }
.side-hint { margin-block-start: 14px; font-size: 13.5px; line-height: 1.6; color: var(--ink-2); min-height: 3em; }

.device { grid-column: 2; display: grid; place-items: center; padding: 18px; position: relative; z-index: 2; }
.phone {
  --w: min(390px, calc((100dvh - 36px) * 0.4615));
  width: var(--w); height: calc(var(--w) * 2.1667); max-height: calc(100dvh - 36px);
  position: relative; border-radius: var(--r-phone); background: #fff; overflow: hidden; isolation: isolate;
  box-shadow: 0 0 0 11px #0e1422, 0 0 0 12.5px #2a3347, 0 40px 80px -20px rgba(0, 47, 108, .45), 0 18px 36px -18px rgba(0,0,0,.35);
  font-size: var(--fs);
}
.phone::before { /* camera island */
  content: ''; position: absolute; z-index: 60; inset-block-start: 10px; inset-inline-start: 50%; translate: -50% 0;
  width: 112px; height: 32px; border-radius: 20px; background: #0b0f19; pointer-events: none;
}
[dir='rtl'] .phone::before { translate: 50% 0; }

@media (max-width: 980px) {
  .stage { grid-template-columns: 1fr; }
  .side { display: none; }
  .device { grid-column: 1; }
}
@media (max-width: 520px), (max-height: 560px) and (max-width: 900px) {
  .stage-path { display: none; }
  .device { padding: 0; width: 100vw; height: 100dvh; }
  .phone { --w: 100vw; width: 100vw; height: 100dvh; max-height: none; border-radius: 0; box-shadow: none; }
  .phone::before { display: none; }
}

/* ---------- Status bar ---------- */
.statusbar {
  position: absolute; inset-block-start: 0; inset-inline: 0; height: 50px; z-index: 50; padding: 16px 30px 0;
  display: flex; justify-content: space-between; align-items: center; font-family: var(--display); font-size: 14.5px;
  color: var(--sb, var(--ink)); pointer-events: none; direction: ltr;
}
.statusbar.light { --sb: #fff; }
.sb-right { display: flex; gap: 6px; align-items: center; }
.sb-signal { display: flex; gap: 2px; align-items: flex-end; height: 11px; }
.sb-signal i { width: 3px; border-radius: 1px; background: currentColor; opacity: .3; }
.sb-signal i:nth-child(1) { height: 4px; opacity: 1; } .sb-signal i:nth-child(2) { height: 6px; } .sb-signal i:nth-child(3) { height: 8px; } .sb-signal i:nth-child(4) { height: 11px; }
.sb-nosim { font-size: 11px; font-family: var(--body); opacity: .8; }
.sb-batt { display: flex; align-items: center; gap: 4px; font-size: 12.5px; }
.sb-batt b { width: 24px; height: 12px; border: 1.5px solid currentColor; border-radius: 4px; position: relative; opacity: .9; }
.sb-batt b::after { content: ''; position: absolute; inset: 1.5px; inline-size: 12%; background: #ff3b3b; border-radius: 1.5px; }
[dir] .sb-batt b::after { inset-inline-end: auto; left: 1.5px; right: auto; }
.sb-batt.charging b::after { background: var(--green); inline-size: 70%; width: 70%; }

/* ---------- Screens & views ---------- */
.screens { position: absolute; inset: 0; }
.view {
  position: absolute; inset: 0; background: var(--surface); display: flex; flex-direction: column; isolation: isolate;
  transition: transform var(--t) var(--ease-out), opacity var(--t) var(--ease-out);
}
.view.enter { transform: translateX(var(--from, 100%)); }
[dir='rtl'] .view { --from: -100%; }
.view.app-open { animation: appOpen var(--t) var(--ease-out); }
@keyframes appOpen { from { transform: scale(.88); opacity: 0; border-radius: 40px; } to { transform: none; opacity: 1; } }
.view.leave { transform: translateX(calc(var(--from, 100%) * -0.25)); opacity: .6; }
.view.closing { transform: translateX(var(--from, 100%)); }
.view.app-closing { transform: scale(.9); opacity: 0; }

.appbar {
  padding: 54px 16px 10px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px;
  background: rgba(255,255,255,.92); backdrop-filter: blur(14px); border-block-end: 1px solid var(--line); position: relative; z-index: 3;
}
.appbar h2 { font-size: 17px; text-align: center; grid-column: 2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
.appbar .back { justify-self: start; display: flex; align-items: center; gap: 2px; color: var(--accent, var(--blue)); font-size: 15px; padding: 6px 4px; }
.appbar .back svg { width: 22px; height: 22px; }
[dir='rtl'] .appbar .back svg { transform: scaleX(-1); }
.appbar .action { justify-self: end; color: var(--accent, var(--blue)); padding: 6px; }
.appbar-large { padding: 54px 20px 12px; border-block-end: 0; display: block; background: #fff; }
.appbar-large h2 { font-size: 30px; text-align: start; max-width: none; }
.appbar-large .sub { color: var(--ink-3); font-size: 13px; margin-block-start: 2px; }
.scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding-block-end: 34px; scrollbar-width: thin; }

/* ---------- Lock screen ---------- */
.lock { background: #0b1b3a; color: #fff; overflow: hidden; }
.lock-wall { position: absolute; inset: 0; background-size: cover; background-position: center 30%; transform: scale(1.04); transition: filter var(--t-slow) var(--ease), transform var(--t-slow) var(--ease); }
.lock-wall::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,47,108,.45) 0%, rgba(0,47,108,.05) 34%, rgba(0,20,50,.6) 70%, rgba(0,15,40,.85) 100%); }
.lock.keypad-open .lock-wall { filter: blur(18px) brightness(.55); transform: scale(1.12); }
.lock-top { position: relative; text-align: center; padding-block-start: 66px; }
.lock-date { font-size: 15px; opacity: .95; letter-spacing: .2px; }
.lock-time { font-family: var(--display); font-size: 84px; line-height: 1; margin-block-start: 4px; letter-spacing: -1px; direction: ltr; text-shadow: 0 4px 30px rgba(0,0,0,.25); }
.lock-time .blink { animation: colon 2.6s steps(1) infinite; }
@keyframes colon { 50% { opacity: .25; } }
.sticky {
  position: relative; margin: 14px auto 0; width: 78%; background: var(--bg-yellow); color: var(--ink); border-radius: 14px; padding: 12px 14px 10px;
  box-shadow: 0 10px 30px -10px rgba(0,0,0,.45); rotate: -1.6deg; text-align: start;
}
[dir='rtl'] .sticky { rotate: 1.6deg; }
.sticky::before { content: ''; position: absolute; inset-block-start: -8px; inset-inline-start: 50%; translate: -50%; width: 56px; height: 16px; background: rgba(250,186,0,.55); border-radius: 3px; }
.sticky p { font-family: var(--display); font-size: 16px; line-height: 1.35; white-space: pre-line; }
.sticky small { display: block; margin-block-start: 6px; font-size: 12.5px; color: var(--ink-2); line-height: 1.45; }
.lock-notifs { position: absolute; inset-inline: 10px; inset-block-end: 92px; display: grid; gap: 7px; max-height: 46%; overflow-y: auto; scrollbar-width: none; padding-block-start: 6px; }
.notif {
  display: grid; grid-template-columns: 34px 1fr auto; gap: 4px 10px; align-items: start; text-align: start; width: 100%;
  background: rgba(255,255,255,.82); color: var(--ink); backdrop-filter: blur(20px) saturate(1.4); border-radius: 18px; padding: 10px 12px;
  animation: notifIn var(--t-slow) var(--ease-out) both; box-shadow: 0 8px 24px -14px rgba(0,0,0,.5);
}
.notif .ic { grid-row: span 2; width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; }
.notif .ic svg { width: 20px; height: 20px; }
.notif b { font-size: 13.5px; }
.notif time { font-size: 11.5px; color: var(--ink-3); }
.notif > span:not(.ic) { grid-column: 2 / 4; font-size: 13.5px; line-height: 1.4; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.notif.strange { background: rgba(255,247,192,.94); }
.notif.strange > span:not(.ic) { color: var(--ink); }
.notif.strange .ic { animation: glitch 3.4s infinite; }
@keyframes glitch { 0%, 92%, 100% { transform: none; filter: none; } 93% { transform: translate(2px, -1px); filter: hue-rotate(80deg); } 95% { transform: translate(-2px, 1px); } 97% { transform: none; filter: hue-rotate(-60deg); } }
@keyframes notifIn { from { opacity: 0; transform: translateY(16px) scale(.97); } }
.lock-foot { position: absolute; inset-block-end: 22px; inset-inline: 0; text-align: center; font-size: 13px; opacity: .9; }
.lock-foot button { padding: 10px 18px; animation: nudge 2.4s var(--ease) infinite; }
@keyframes nudge { 0%, 60%, 100% { transform: none; } 30% { transform: translateY(-6px); } }

.keypad { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; opacity: 0; pointer-events: none; transition: opacity var(--t) var(--ease); z-index: 5; color: #fff; }
.lock.keypad-open .keypad { opacity: 1; pointer-events: auto; }
.lock.keypad-open .lock-top, .lock.keypad-open .lock-notifs, .lock.keypad-open .lock-foot { opacity: 0; pointer-events: none; }
.lock-top, .lock-notifs, .lock-foot { transition: opacity var(--t) var(--ease); }
.keypad h3 { font-family: var(--body); font-weight: 400; font-size: 17px; }
.dots { display: flex; gap: 16px; direction: ltr; }
.dots i { width: 13px; height: 13px; border-radius: 50%; border: 1.5px solid #fff; transition: background var(--t-fast); }
.dots i.on { background: #fff; }
.dots.shake { animation: shake .42s var(--ease); }
@keyframes shake { 20%, 60% { transform: translateX(-10px); } 40%, 80% { transform: translateX(10px); } }
.keys { display: grid; grid-template-columns: repeat(3, 74px); gap: 14px 22px; direction: ltr; margin-block-start: 8px; }
.key { width: 74px; height: 74px; border-radius: 50%; background: rgba(255,255,255,.16); backdrop-filter: blur(8px); display: grid; place-content: center; font-family: var(--display); font-size: 30px; line-height: 1; transition: background var(--t-fast); }
.key small { font-family: var(--body); font-size: 9.5px; letter-spacing: 2px; opacity: .8; margin-block-start: 2px; }
.key:active { background: rgba(255,255,255,.45); }
.key.blank { visibility: hidden; }
.keypad-actions { display: flex; justify-content: space-between; width: 266px; font-size: 15px; }
.keypad-hint { min-height: 2.8em; max-width: 270px; text-align: center; font-size: 13px; line-height: 1.5; color: var(--bg-yellow); }

/* ---------- Home ---------- */
.home { background: #fff; }
.home-wall { position: absolute; inset: 0; background: url('../assets/img/pattern-joyful.png') center/280px repeat; opacity: .32; }
.home-path { position: absolute; inset-block-end: -6%; inset-inline-end: -28%; width: 120%; opacity: .95; pointer-events: none; transform: scaleX(-1); }
[dir='ltr'] .home-path { transform: none; }
.home-inner { position: relative; padding: 58px 18px 0; display: flex; flex-direction: column; gap: 18px; height: 100%; }
.widget {
  display: block; width: 100%; text-align: start; border-radius: 24px; padding: 14px 16px; color: #fff; position: relative; overflow: hidden;
  background: var(--dark-blue); box-shadow: 0 14px 30px -18px rgba(0,47,108,.8);
}
.widget::after { content: ''; position: absolute; inset-inline-end: -40px; inset-block-start: -50px; width: 170px; height: 170px; background: url('../assets/img/path-cyan-light.png') center/contain no-repeat; opacity: .45; }
.widget-row { display: flex; justify-content: space-between; align-items: baseline; position: relative; z-index: 1; }
.widget h3 { font-size: 15px; display: flex; align-items: center; gap: 8px; }
.widget small { font-size: 12px; opacity: .8; }
.widget .stations { display: flex; gap: 7px; margin-block: 14px 8px; position: relative; z-index: 1; }
.widget .stations i { flex: 1; height: 8px; border-radius: 8px; background: rgba(255,255,255,.16); position: relative; overflow: hidden; }
.widget .stations i.on { background: var(--c); }
.widget .status { font-size: 13px; opacity: .92; position: relative; z-index: 1; }
.widget .pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--yellow); box-shadow: 0 0 0 0 rgba(250,186,0,.7); animation: pulse 1.8s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(250,186,0,0); } 100% { box-shadow: 0 0 0 0 rgba(250,186,0,0); } }
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px 8px; }
.app-icon { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 11.5px; color: var(--ink); position: relative; }
.app-icon .tile {
  width: 60px; height: 60px; border-radius: 17px; display: grid; place-items: center; color: #fff; background: var(--bg, var(--blue));
  box-shadow: 0 8px 18px -12px rgba(0,47,108,.7), inset 0 0 0 .5px rgba(0,0,0,.05); transition: transform var(--t-fast) var(--ease);
}
.app-icon:active .tile { transform: scale(.9); }
.app-icon .tile svg { width: 30px; height: 30px; }
.app-icon .badge { position: absolute; inset-block-start: -5px; inset-inline-end: calc(50% - 38px); min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--magenta); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; border: 2px solid #fff; animation: pop var(--t) var(--ease-out); }
@keyframes pop { from { transform: scale(0); } }
.app-icon.new .tile { animation: wiggle 1.6s var(--ease) 2; }
@keyframes wiggle { 20% { rotate: -6deg; } 40% { rotate: 6deg; } 60% { rotate: -3deg; } 80% { rotate: 0; } }
.tile.freq { background: conic-gradient(from 200deg, var(--cyan), var(--blue), var(--purple), var(--magenta), var(--orange), var(--yellow), var(--green), var(--cyan)); }
.tile.freq span { width: 46px; height: 46px; border-radius: 13px; background: var(--dark-blue); display: grid; place-items: center; }
.tile.freq.locked span { background: #2b3a55; }
.tile.cal { background: #fff !important; color: var(--ink); display: flex !important; flex-direction: column; justify-content: center; line-height: 1; gap: 2px; }
.tile.cal em { font-style: normal; font-size: 9.5px; color: var(--magenta); font-weight: 700; }
.tile.cal b { font-family: var(--display); font-size: 26px; }

/* ---------- Lists ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.row {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 16px; text-align: start; position: relative; background: #fff;
}
.row + .row::before { content: ''; position: absolute; inset-block-start: 0; inset-inline-start: 70px; inset-inline-end: 0; height: 1px; background: var(--line); }
.row:active { background: var(--surface-2); }
.row .grow { flex: 1; min-width: 0; }
.row .title { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.row .title b { font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .title time { font-size: 12.5px; color: var(--ink-3); flex-shrink: 0; }
.row .preview { font-size: 13.5px; color: var(--ink-2); line-height: 1.4; margin-block-start: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.row.unread .title b { color: var(--ink); }
.row .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--blue); flex-shrink: 0; }
.row .chev { color: var(--ink-3); width: 16px; height: 16px; flex-shrink: 0; }
[dir='rtl'] .row .chev { transform: scaleX(-1); }
.avatar { width: 46px; height: 46px; border-radius: 50%; background: var(--c, var(--blue)); color: #fff; display: grid; place-items: center; font-family: var(--display); font-size: 18px; flex-shrink: 0; position: relative; }
.avatar.group { background: conic-gradient(var(--purple) 0 33%, var(--orange) 0 66%, var(--blue) 0); }
.section-title { padding: 18px 16px 6px; font-size: 12.5px; color: var(--ink-3); font-weight: 700; text-transform: uppercase; letter-spacing: .4px; }
.pin { font-size: 11px; color: var(--ink-3); }

/* ---------- Chat ---------- */
.chat { background: linear-gradient(180deg, #fff, var(--surface-2)); }
.chat .scroll { padding: 10px 12px 18px; display: flex; flex-direction: column; gap: 4px; }
.chat-head { display: flex; flex-direction: column; align-items: center; gap: 4px; grid-column: 2; }
.chat-head .avatar { width: 34px; height: 34px; font-size: 14px; }
.chat-head b { font-size: 12.5px; font-weight: 400; color: var(--ink-2); }
.day { align-self: center; font-size: 11.5px; color: var(--ink-3); margin: 12px 0 6px; }
.bubble {
  max-width: 78%; padding: 8px 12px 7px; border-radius: 19px; font-size: 14.5px; line-height: 1.5; white-space: pre-line; position: relative;
  animation: bubbleIn var(--t) var(--ease-out) both; word-wrap: break-word;
}
@keyframes bubbleIn { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.bubble time { display: block; font-size: 10.5px; opacity: .6; margin-block-start: 2px; text-align: end; direction: ltr; }
.bubble.them { align-self: flex-start; background: #fff; color: var(--ink); border: 1px solid var(--line); border-end-start-radius: 6px; }
.bubble.me { align-self: flex-end; background: var(--blue); color: #fff; border-end-end-radius: 6px; }
.bubble .who { display: block; font-size: 11.5px; font-weight: 700; color: var(--c); margin-block-end: 1px; }
.bubble.fresh { box-shadow: 0 0 0 2px var(--bg-yellow); }
.composer { display: flex; gap: 8px; align-items: center; padding: 8px 12px 30px; background: #fff; border-block-start: 1px solid var(--line); }
.composer button { flex: 1; text-align: start; border: 1px solid var(--line); border-radius: 20px; padding: 9px 14px; color: var(--ink-3); font-size: 14px; }
.typing { align-self: flex-start; display: flex; gap: 4px; padding: 12px 14px; background: #fff; border: 1px solid var(--line); border-radius: 19px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); animation: typing 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes typing { 50% { transform: translateY(-4px); opacity: .5; } }

/* ---------- Photos ---------- */
.seg { display: flex; gap: 6px; padding: 10px 16px 6px; overflow-x: auto; scrollbar-width: none; }
.seg button { padding: 7px 14px; border-radius: 999px; background: var(--surface-2); font-size: 13.5px; white-space: nowrap; color: var(--ink-2); }
.seg button[aria-pressed='true'] { background: var(--ink); color: #fff; }
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; padding: 2px; }
.photo-grid button { aspect-ratio: 1; overflow: hidden; background: var(--surface-2); position: relative; }
.photo-grid img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--t) var(--ease); }
.photo-grid button:active img { transform: scale(.94); }
.photo-grid.brands button { background: #fff; border: 1px solid var(--line); }
.photo-grid.brands img { object-fit: contain; padding: 12px; }
.photo-grid .new { position: absolute; inset-block-start: 6px; inset-inline-start: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--yellow); box-shadow: 0 0 0 2px #fff; }
.album-intro { padding: 4px 16px 10px; font-size: 13px; color: var(--ink-2); line-height: 1.5; }
.viewer { background: #000; color: #fff; }
.viewer .appbar { background: rgba(0,0,0,.6); border: 0; color: #fff; }
.viewer .appbar .back, .viewer .appbar .action { color: #fff; }
.viewer-img { flex: 1; display: grid; place-items: center; overflow: hidden; touch-action: pan-y; }
.viewer-img img { max-width: 100%; max-height: 100%; object-fit: contain; animation: fadeIn var(--t) var(--ease); }
.viewer-img.brand { background: #fff; }
.viewer-img.brand img { max-width: 80%; max-height: 60%; }
@keyframes fadeIn { from { opacity: 0; } }
.viewer-cap { padding: 12px 18px 34px; background: rgba(0,0,0,.6); font-size: 14px; line-height: 1.55; }
.viewer-cap .nav { display: flex; justify-content: space-between; margin-block-start: 10px; }
.viewer-cap .nav button { padding: 6px 10px; border-radius: 10px; background: rgba(255,255,255,.12); font-size: 13px; }
.viewer-cap .nav button:disabled { opacity: .3; cursor: default; }
.info-panel { margin-block-start: 10px; padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,.12); font-size: 13px; white-space: pre-line; line-height: 1.6; animation: fadeIn var(--t); }

/* ---------- Notes ---------- */
.note-view .scroll { padding: 8px 20px 40px; }
.note-view h1 { font-size: 24px; line-height: 1.3; margin-block: 6px 4px; }
.note-view .meta { font-size: 12px; color: var(--ink-3); margin-block-end: 16px; }
.note-body { white-space: pre-line; line-height: 1.85; font-size: 15px; color: var(--ink); }
.note-paper { background: linear-gradient(180deg, #fffdf0 0%, #fff 30%); }
.row .note-ic { width: 40px; height: 40px; border-radius: 10px; background: var(--bg-yellow); display: grid; place-items: center; color: var(--dark-yellow); flex-shrink: 0; }

/* ---------- Calendar ---------- */
.cal-head { display: flex; justify-content: space-between; align-items: baseline; padding: 4px 18px 10px; }
.cal-head h3 { font-size: 22px; color: var(--magenta); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; padding: 0 10px; text-align: center; }
.cal-grid .dow { font-size: 11px; color: var(--ink-3); padding-block: 4px; }
.cal-grid button { aspect-ratio: 1; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 15px; gap: 3px; position: relative; max-width: 46px; justify-self: center; width: 100%; }
.cal-grid button .ev { display: flex; gap: 2px; height: 5px; }
.cal-grid button .ev i { width: 5px; height: 5px; border-radius: 50%; background: var(--c); }
.cal-grid button.today { color: var(--magenta); font-weight: 700; }
.cal-grid button[aria-pressed='true'] { background: var(--ink); color: #fff; }
.cal-grid button[aria-pressed='true'].today { background: var(--magenta); }
.events { padding: 14px 14px 0; display: grid; gap: 8px; }
.event { display: grid; grid-template-columns: 4px 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); text-align: start; width: 100%; }
.event::before { content: ''; grid-row: span 2; width: 4px; align-self: stretch; border-radius: 4px; background: var(--c); }
.event b { font-size: 14.5px; }
.event time { font-size: 12.5px; color: var(--ink-3); grid-column: 2; }
.event .chev { grid-row: 1 / 3; grid-column: 3; }
.empty { padding: 30px 20px; text-align: center; color: var(--ink-3); font-size: 14px; line-height: 1.6; }

/* ---------- Voice memos ---------- */
.memo { border-block-end: 1px solid var(--line); }
.memo > button { padding: 14px 18px; display: grid; grid-template-columns: 1fr auto; width: 100%; text-align: start; gap: 2px; }
.memo b { font-size: 15.5px; }
.memo small { font-size: 12.5px; color: var(--ink-3); }
.memo .dur { grid-row: 1 / 3; grid-column: 2; align-self: center; font-size: 13px; color: var(--ink-3); direction: ltr; }
.memo.new b::after { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--yellow); margin-inline-start: 8px; vertical-align: middle; }
.player { padding: 0 18px 16px; display: none; }
.memo.open .player { display: block; animation: fadeIn var(--t); }
.wave { display: flex; align-items: center; gap: 2px; height: 46px; direction: ltr; cursor: pointer; touch-action: none; }
.wave i { flex: 1; border-radius: 2px; background: var(--line); min-height: 3px; transition: background var(--t-fast); }
.wave i.on { background: var(--c, var(--magenta)); }
.player-ctl { display: flex; align-items: center; justify-content: space-between; margin-block-start: 10px; }
.player-ctl .time { font-size: 12px; color: var(--ink-3); direction: ltr; min-width: 70px; }
.play-btn { width: 54px; height: 54px; border-radius: 50%; background: var(--c, var(--magenta)); color: #fff; display: grid; place-items: center; box-shadow: 0 8px 18px -10px var(--c, var(--magenta)); }
.play-btn svg { width: 24px; height: 24px; }
.link-btn { color: var(--blue); font-size: 13.5px; padding: 6px 2px; }
.transcript { margin-block-start: 10px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); white-space: pre-line; font-size: 14px; line-height: 1.75; color: var(--ink); animation: fadeIn var(--t); }

/* ---------- Files ---------- */
.file-ic { width: 42px; height: 50px; border-radius: 8px; display: grid; place-items: center; color: #fff; font-size: 10px; font-weight: 700; flex-shrink: 0; position: relative; }
.file-ic.doc { background: var(--blue); } .file-ic.audio { background: var(--magenta); }
.file-ic .lock-badge { position: absolute; inset-block-end: -6px; inset-inline-end: -6px; width: 22px; height: 22px; border-radius: 50%; background: var(--yellow); color: var(--ink); display: grid; place-items: center; border: 2px solid #fff; }
.file-ic .lock-badge svg { width: 12px; height: 12px; }
.doc-view .scroll { padding: 16px 20px 40px; }
.doc-page { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 18px; box-shadow: 0 10px 30px -22px rgba(0,47,108,.6); white-space: pre-line; line-height: 1.75; font-size: 14px; }
.doc-page[lang='en'] { direction: ltr; text-align: left; }
.st-table { width: 100%; border-collapse: collapse; font-size: 13.5px; margin-block-start: 10px; }
.st-table td, .st-table th { padding: 9px 6px; border-block-end: 1px solid var(--line); text-align: start; }
.st-table th { font-size: 11.5px; color: var(--ink-3); font-weight: 700; }
.st-table .sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--c); margin-inline-end: 6px; }
.st-table .f { font-family: var(--display); direction: ltr; unicode-bidi: isolate; }

/* ---------- Contacts / Phone ---------- */
.card-view .scroll { padding: 0 0 40px; }
.card-hero { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px 20px 20px; background: linear-gradient(180deg, var(--bgc, var(--bg-cyan)), #fff); }
.card-hero .avatar { width: 92px; height: 92px; font-size: 36px; box-shadow: 0 0 0 4px #fff; }
.card-hero h1 { font-size: 24px; }
.card-hero small { color: var(--ink-2); }
.card-actions { display: flex; gap: 10px; margin-block-start: 6px; }
.card-actions button { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 16px; border-radius: 14px; background: #fff; color: var(--blue); font-size: 12px; min-width: 84px; box-shadow: 0 4px 12px -8px rgba(0,47,108,.5); }
.card-actions svg { width: 22px; height: 22px; }
.field { margin: 10px 16px 0; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); }
.field label { display: block; font-size: 12px; color: var(--ink-3); margin-block-end: 3px; }
.field p { white-space: pre-line; line-height: 1.65; font-size: 14.5px; }
.field .num { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.call-ic { width: 30px; height: 30px; display: grid; place-items: center; color: var(--ink-3); flex-shrink: 0; }
.call-ic svg { width: 18px; height: 18px; }
.row.missed b { color: var(--magenta); }

/* ---------- Settings ---------- */
.settings { background: var(--surface-2); }
.group { margin: 14px 14px 0; background: #fff; border-radius: 14px; overflow: hidden; }
.group .row + .row::before { inset-inline-start: 56px; }
.s-ic { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: #fff; background: var(--c); flex-shrink: 0; }
.s-ic svg { width: 18px; height: 18px; }
.toggle { width: 50px; height: 30px; border-radius: 15px; background: #dfe5ee; position: relative; flex-shrink: 0; transition: background var(--t-fast); }
.toggle::after { content: ''; position: absolute; inset-block-start: 3px; inset-inline-start: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.2); transition: inset-inline-start var(--t-fast) var(--ease); }
.toggle[aria-checked='true'] { background: var(--green); }
.toggle[aria-checked='true']::after { inset-inline-start: 23px; }
.pills { display: flex; gap: 4px; background: var(--surface-2); padding: 3px; border-radius: 10px; }
.pills button { padding: 5px 10px; border-radius: 8px; font-size: 12.5px; color: var(--ink-2); }
.pills button[aria-pressed='true'] { background: #fff; color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.12); font-weight: 700; }
.profile { display: flex; align-items: center; gap: 14px; padding: 16px; }
.profile .avatar { width: 58px; height: 58px; font-size: 22px; }
.meter { height: 8px; border-radius: 8px; background: var(--surface-2); overflow: hidden; margin-block-start: 8px; }
.meter i { display: block; height: 100%; background: linear-gradient(90deg, var(--cyan), var(--blue), var(--purple), var(--magenta), var(--orange), var(--yellow), var(--green)); border-radius: 8px; transition: width var(--t-slow) var(--ease); }
.disc-list { display: flex; flex-wrap: wrap; gap: 6px; margin-block-start: 10px; }
.disc-list span { font-size: 12px; padding: 4px 9px; border-radius: 999px; background: var(--bg-cyan); color: var(--ink); }
.disc-list span.locked { background: var(--surface-2); color: var(--ink-3); }
.walls { display: flex; gap: 10px; padding: 10px 16px 14px; }
.walls button { width: 70px; aspect-ratio: 9/16; border-radius: 12px; overflow: hidden; border: 3px solid transparent; }
.walls button[aria-pressed='true'] { border-color: var(--cyan); }
.walls img { width: 100%; height: 100%; object-fit: cover; }
.danger { color: var(--magenta); }
.about { white-space: pre-line; font-size: 13px; line-height: 1.7; color: var(--ink-2); padding: 12px 16px 16px; }

/* ---------- Sheets / modal ---------- */
.overlay { position: absolute; inset: 0; z-index: 40; pointer-events: none; }
.scrim { position: absolute; inset: 0; background: rgba(0,20,50,.38); animation: fadeIn var(--t) var(--ease); pointer-events: auto; }
.sheet {
  position: absolute; inset-inline: 0; inset-block-end: 0; background: #fff; border-radius: 26px 26px 0 0; padding: 10px 20px 34px; pointer-events: auto;
  animation: sheetIn var(--t) var(--ease-out); max-height: 88%; overflow-y: auto; box-shadow: 0 -10px 40px -10px rgba(0,0,0,.3);
}
.sheet::before { content: ''; display: block; width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 14px; }
@keyframes sheetIn { from { transform: translateY(100%); } }
.sheet h3 { font-size: 20px; margin-block-end: 6px; }
.sheet p { line-height: 1.6; color: var(--ink-2); }
.sheet .event-meta { font-size: 13px; color: var(--ink-3); margin-block-end: 12px; }
.sheet .notes-box { white-space: pre-line; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); color: var(--ink); line-height: 1.7; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 20px; border-radius: 14px; background: var(--ink); color: #fff; font-weight: 700; font-size: 15px; width: 100%; transition: transform var(--t-fast), opacity var(--t-fast); }
.btn:active { transform: scale(.98); }
.btn.secondary { background: var(--surface-2); color: var(--ink); }
.btn.accent { background: var(--c, var(--blue)); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btns { display: grid; gap: 8px; margin-block-start: 16px; }
.pw-input { width: 100%; margin-block-start: 14px; padding: 14px 16px; border-radius: 14px; border: 2px solid var(--line); font: inherit; font-size: 17px; color: var(--ink); text-align: center; background: var(--surface-2); }
.pw-input:focus { outline: none; border-color: var(--cyan); background: #fff; }
.pw-input.bad { border-color: var(--magenta); animation: shake .42s var(--ease); }
.pw-hint { margin-block-start: 10px; font-size: 13.5px; color: var(--dark-yellow); min-height: 1.4em; line-height: 1.6; }

/* ---------- Banners & toasts ---------- */
.banners { position: absolute; inset-block-start: 46px; inset-inline: 8px; z-index: 70; display: grid; gap: 6px; pointer-events: none; }
.banner { pointer-events: auto; animation: bannerIn var(--t-slow) var(--ease-out) both; }
.banner.out { animation: bannerOut var(--t) var(--ease) forwards; }
.banner .notif { background: rgba(255,255,255,.96); box-shadow: 0 16px 34px -14px rgba(0,47,108,.55); animation: none; }
@keyframes bannerIn { from { transform: translateY(-120%); opacity: 0; } }
@keyframes bannerOut { to { transform: translateY(-120%); opacity: 0; } }
.toasts { position: absolute; inset-block-end: 40px; inset-inline: 0; z-index: 65; display: grid; justify-items: center; gap: 6px; pointer-events: none; }
.toast { background: var(--dark-blue); color: #fff; padding: 9px 16px; border-radius: 999px; font-size: 13px; display: flex; gap: 8px; align-items: center; box-shadow: 0 10px 24px -10px rgba(0,0,0,.5); animation: toastIn var(--t) var(--ease-out) both; max-width: 90%; }
.toast.out { animation: toastOut var(--t) var(--ease) forwards; }
.toast .spark { color: var(--yellow); }
@keyframes toastIn { from { transform: translateY(20px); opacity: 0; } }
@keyframes toastOut { to { transform: translateY(20px); opacity: 0; } }
.home-bar { position: absolute; z-index: 80; inset-block-end: 7px; inset-inline-start: 50%; translate: -50% 0; width: 136px; height: 22px; display: grid; place-items: center; }
[dir='rtl'] .home-bar { translate: 50% 0; }
.home-bar::after { content: ''; width: 136px; height: 5px; border-radius: 3px; background: var(--hb, var(--ink)); opacity: .85; }
.home-bar.light { --hb: #fff; }
.home-bar[hidden] { display: none; }

/* ---------- Chapter card ---------- */
.chapter-card { position: absolute; inset: 0; z-index: 90; display: grid; place-content: center; text-align: center; color: #fff; background: var(--c, var(--dark-blue)); animation: chapterIn 2.8s var(--ease) forwards; overflow: hidden; pointer-events: auto; }
.chapter-card img { position: absolute; width: 140%; inset-block-end: -20%; inset-inline-start: -20%; opacity: .5; animation: pathDrift 2.8s var(--ease-out) both; }
.chapter-card small { font-size: 14px; letter-spacing: 3px; opacity: .85; position: relative; }
.chapter-card h2 { font-size: 40px; margin-block-start: 6px; position: relative; }
@keyframes chapterIn { 0% { opacity: 0; } 12% { opacity: 1; } 82% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } }
@keyframes pathDrift { from { transform: translateX(20%) rotate(-6deg); } to { transform: none; } }

/* ---------- Intro ---------- */
.intro { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; background: rgba(255,255,255,.86); backdrop-filter: blur(10px); transition: opacity var(--t-slow) var(--ease); padding: 24px; }
.intro.gone { opacity: 0; pointer-events: none; }
.intro-card { max-width: 420px; text-align: center; display: grid; gap: 14px; justify-items: center; }
.intro-card .symbol { width: 54px; height: auto; margin-block-end: 6px; animation: float 4s var(--ease) infinite; }
@keyframes float { 50% { transform: translateY(-6px); } }
.intro-card h1 { font-size: 34px; color: var(--ink); line-height: 1.2; }
.intro-card p { color: var(--ink-2); line-height: 1.7; font-size: 16px; }
.intro-card .btn { width: auto; min-width: 230px; background: var(--dark-blue); padding: 15px 26px; font-size: 16px; }
.intro-card .langs { display: flex; gap: 8px; }
.intro-card .note { font-size: 13px; color: var(--ink-3); }

/* ---------- Frequency app ---------- */
.freq-app { background: var(--dark-blue); color: #fff; }
.freq-app .appbar { background: transparent; border: 0; color: #fff; }
.freq-app .appbar .back, .freq-app .appbar .action { color: #fff; }
.freq-app .scroll { padding: 4px 18px 40px; }
.freq-bg { position: absolute; inset: 0; background: url('../assets/img/path-blue-cyan.png') 30% 110%/160% no-repeat; opacity: .18; pointer-events: none; }
.signals { display: grid; gap: 10px; margin-block-start: 18px; }
.signal { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 16px; background: rgba(255,255,255,.07); border: 1.5px dashed rgba(255,255,255,.25); transition: background var(--t), border-color var(--t); width: 100%; text-align: start; color: #fff; }
.signal .s-ic { --c: rgba(255,255,255,.12); }
.signal.on { background: rgba(0,173,196,.2); border: 1.5px solid var(--cyan); }
.signal.on .s-ic { --c: var(--cyan); }
.signal b { font-size: 14.5px; font-weight: 400; }
.signal .state { margin-inline-start: auto; font-size: 18px; }
.freq-lead { font-size: 15px; line-height: 1.6; opacity: .9; margin-block-start: 6px; }
.freq-big { font-family: var(--display); font-size: 30px; line-height: 1.15; }
.radar { position: relative; margin: 18px auto 6px; width: 100%; aspect-ratio: 1.3; }
.radar svg { width: 100%; height: 100%; overflow: visible; }
.radar .node { cursor: pointer; }
.radar .node circle.ring { fill: none; stroke: rgba(255,255,255,.35); stroke-dasharray: 3 4; animation: spin 14s linear infinite; transform-box: fill-box; transform-origin: center; }
.radar .node.on circle.ring { stroke: var(--c); stroke-dasharray: none; animation: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.radar text { fill: #fff; font-family: var(--body); font-size: 11px; }
.world-cards { display: grid; gap: 8px; margin-block-start: 6px; }
.world-card { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 16px; background: rgba(255,255,255,.07); color: #fff; width: 100%; text-align: start; transition: background var(--t-fast); }
.world-card:active { background: rgba(255,255,255,.14); }
.world-card .thumb { width: 64px; height: 44px; border-radius: 10px; background-size: cover; background-position: center; filter: grayscale(1) brightness(.6); flex-shrink: 0; border: 2px solid transparent; }
.world-card.on .thumb { filter: none; border-color: var(--c); }
.world-card b { display: block; font-size: 15px; }
.world-card small { font-size: 12px; opacity: .75; }
.world-card .f { margin-inline-start: auto; font-family: var(--display); font-size: 17px; direction: ltr; color: var(--c); }
.world-card:not(.on) .f { color: rgba(255,255,255,.45); }
.connect-btn { margin-block-start: 16px; background: linear-gradient(90deg, var(--green), var(--purple), var(--cyan), var(--orange), var(--magenta)); }

.tuner { padding: 6px 4px 0; }
.tuner .display { text-align: center; padding: 18px 10px 8px; border-radius: 22px; background: #001a3d; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.08); position: relative; overflow: hidden; }
.tuner .display .label { font-size: 12.5px; opacity: .7; }
.tuner .display .mhz { font-family: var(--display); font-size: 62px; line-height: 1.05; direction: ltr; letter-spacing: 1px; color: #fff; transition: color var(--t), text-shadow var(--t); }
.tuner .display .mhz small { font-size: 16px; opacity: .6; margin-inline-start: 4px; }
.tuner .display.locked .mhz { color: var(--c); text-shadow: 0 0 24px var(--c); }
.tuner .display .noise { position: absolute; inset: 0; opacity: .12; background-image: repeating-linear-gradient(0deg, rgba(255,255,255,.4) 0 1px, transparent 1px 3px); animation: noise .25s steps(3) infinite; pointer-events: none; }
.tuner .display.locked .noise { display: none; }
@keyframes noise { 33% { transform: translateY(1px); } 66% { transform: translateY(-1px); } }
.scale { position: relative; height: 92px; margin-block-start: 16px; border-radius: 16px; background: rgba(255,255,255,.05); overflow: hidden; touch-action: none; cursor: grab; direction: ltr; }
.scale:active { cursor: grabbing; }
.scale .ticks { position: absolute; inset: 0; }
.scale .ticks i { position: absolute; inset-block-start: 14px; width: 1px; height: 14px; background: rgba(255,255,255,.35); }
.scale .ticks i.major { height: 26px; background: rgba(255,255,255,.7); }
.scale .ticks span { position: absolute; inset-block-start: 46px; font-size: 11px; translate: -50% 0; opacity: .7; font-family: var(--display); }
.scale .needle { position: absolute; inset-block: 6px; width: 3px; border-radius: 2px; background: var(--c, var(--yellow)); translate: -50% 0; box-shadow: 0 0 14px var(--c, var(--yellow)); }
.tuner-ctl { display: grid; grid-template-columns: 56px 1fr 56px; gap: 10px; margin-block-start: 14px; align-items: center; }
.tuner-ctl .step { height: 52px; border-radius: 16px; background: rgba(255,255,255,.1); font-size: 22px; display: grid; place-items: center; direction: ltr; }
.tuner-ctl .btn { background: var(--c); height: 52px; }
.tuner-msg { min-height: 3.4em; margin-block-start: 12px; font-size: 13.5px; line-height: 1.6; opacity: .9; text-align: center; }
.tuner-msg button { color: var(--light-cyan); text-decoration: underline; }

.world { background: #fff; color: var(--ink); }
.world .appbar { background: var(--c); color: #fff; border: 0; }
.world .appbar .back { color: #fff; }
.world-hero { position: relative; background: var(--c); padding: 0 0 18px; overflow: hidden; color: #fff; }
.world-hero .path { position: absolute; inset-inline-end: -30%; inset-block-start: -20%; width: 90%; opacity: .25; pointer-events: none; mix-blend-mode: screen; }
.enlighter { position: relative; margin: 0 14px; border-radius: 18px; overflow: hidden; aspect-ratio: 16/10; background: #000; cursor: crosshair; touch-action: none; }
.enlighter img { width: 100%; height: 100%; object-fit: cover; }
.enlighter .dark { position: absolute; inset: 0; background: radial-gradient(circle at var(--x, 50%) var(--y, 50%), transparent 0, transparent var(--r, 0px), rgba(0,10,30,.86) calc(var(--r, 0px) + 60px)); transition: opacity 1.2s var(--ease); }
.enlighter.lit .dark { opacity: 0; }
.enlighter .tip { position: absolute; inset-inline: 0; inset-block-end: 12px; text-align: center; font-size: 13px; color: #fff; transition: opacity var(--t); }
.enlighter.lit .tip { opacity: 0; }
.world-title { padding: 16px 18px 0; position: relative; }
.world-title small { font-size: 12.5px; opacity: .85; }
.world-title h1 { font-size: 30px; margin-block-start: 2px; }
.world-body { padding: 16px 18px 40px; display: grid; gap: 14px; }
.kv { display: flex; gap: 10px; }
.kv > div { flex: 1; padding: 12px; border-radius: 14px; background: var(--bgc); }
.kv label { display: block; font-size: 11.5px; color: var(--ink-2); margin-block-end: 2px; }
.kv b { font-size: 15px; }
.letter-tile { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 16px; border: 2px dashed var(--c); }
.letter-tile .l { width: 58px; height: 58px; border-radius: 14px; background: var(--c); color: #fff; display: grid; place-items: center; font-family: var(--display); font-size: 30px; flex-shrink: 0; animation: pop .5s var(--ease-out); }
.world .field-note { padding: 14px; border-radius: 16px; background: var(--surface-2); line-height: 1.8; white-space: pre-line; position: relative; }
.world .field-note label { display: block; font-size: 12px; color: var(--ink-3); margin-block-end: 4px; }
.world .memo { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }

.connect { background: #00122d; color: #fff; }
.connect .appbar { background: transparent; color: #fff; border: 0; }
.connect .appbar .back { color: #fff; }
.connect canvas { width: 100%; height: 210px; display: block; border-radius: 18px; background: #001a3d; margin-block: 12px; }
.sliders { display: grid; gap: 10px; }
.sliders label { display: grid; grid-template-columns: 82px 1fr 24px; align-items: center; gap: 10px; font-size: 13px; }
.sliders input[type='range'] { -webkit-appearance: none; appearance: none; height: 6px; border-radius: 6px; background: rgba(255,255,255,.12); outline: none; direction: ltr; }
.sliders input[type='range']::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; border-radius: 50%; background: var(--c); border: 3px solid #fff; cursor: pointer; }
.sliders input[type='range']::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--c); border: 3px solid #fff; cursor: pointer; }
.sliders .ok { color: var(--c); opacity: 0; transition: opacity var(--t); text-align: center; }
.sliders label.done .ok { opacity: 1; }
.connect-result { text-align: center; padding: 18px 0 6px; animation: fadeIn 1s var(--ease); }
.connect-result h3 { font-size: 30px; white-space: pre-line; line-height: 1.25; }
.letters { display: flex; justify-content: center; gap: 8px; margin-block: 16px; direction: rtl; flex-wrap: wrap; }
[lang='en'] .letters, .letters[lang='en'] { direction: ltr; }
.letters span { width: 50px; height: 56px; border-radius: 12px; background: var(--c); display: grid; place-items: center; font-family: var(--display); font-size: 26px; animation: drop .7s var(--ease-out) both; }
@keyframes drop { from { transform: translateY(-60px) rotate(-12deg); opacity: 0; } }

/* ---------- Reveal ---------- */
.reveal { background: #fff; color: var(--ink); z-index: 30; }
.reveal .scroll { padding: 64px 26px 40px; display: flex; flex-direction: column; }
.reveal-path { position: absolute; inset-inline-start: -20%; inset-block-end: -8%; width: 140%; opacity: .14; pointer-events: none; }
.letter-lines { display: grid; gap: 14px; position: relative; }
.letter-lines p { font-size: 18px; line-height: 1.65; opacity: 0; transform: translateY(10px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.letter-lines p.in { opacity: 1; transform: none; }
.letter-lines p.big { font-family: var(--display); font-size: 26px; line-height: 1.35; color: var(--dark-blue); }
.letter-lines p.you { font-family: var(--display); font-size: 34px; color: var(--magenta); }
.reveal-ctl { position: sticky; inset-block-end: 0; display: flex; justify-content: space-between; align-items: center; padding-block: 14px 4px; background: linear-gradient(180deg, rgba(255,255,255,0), #fff 40%); margin-block-start: auto; }
.reveal-ctl .play-btn { --c: var(--dark-blue); width: 46px; height: 46px; }
.keys7 { display: flex; gap: 6px; justify-content: center; margin-block: 26px 10px; direction: ltr; }
.keys7 button { width: 38px; height: 150px; border-radius: 19px; background: var(--c); position: relative; transition: transform var(--t-fast), box-shadow var(--t); box-shadow: 0 10px 20px -12px var(--c); animation: keyGlow 2.4s var(--ease) infinite; animation-delay: var(--d); }
@keyframes keyGlow { 50% { filter: brightness(1.15); transform: translateY(-4px); } }
.keys7 button.you { background: #fff; border: 2.5px dashed var(--yellow); animation: youPulse 1.4s var(--ease) infinite; box-shadow: none; }
@keyframes youPulse { 50% { box-shadow: 0 0 0 8px rgba(250,186,0,.18); } }
.keys7 button.you.done { background: var(--yellow); border-style: solid; animation: none; }
.keys7 button small { position: absolute; inset-block-end: -22px; inset-inline: -10px; font-size: 11px; color: var(--ink-2); text-align: center; }
.keys-copy { text-align: center; }
.keys-copy h3 { font-size: 22px; }
.keys-copy p { color: var(--ink-2); margin-block-start: 6px; }
.finale { text-align: center; display: grid; gap: 16px; justify-items: center; animation: fadeIn 1.2s var(--ease); }
.finale .logo { width: 230px; height: auto; margin-block: 8px; }
.finale .tagline { font-family: var(--display); font-size: 26px; color: var(--dark-blue); }
.qa { text-align: start; width: 100%; display: grid; gap: 12px; }
.qa div { padding: 14px; border-radius: 16px; background: var(--surface-2); }
.qa b { display: block; font-family: var(--display); font-size: 16px; margin-block-end: 4px; }
.qa p { line-height: 1.65; color: var(--ink-2); }
.finale .stats { font-size: 13px; color: var(--ink-3); }
.flash { position: absolute; inset: 0; z-index: 95; pointer-events: none; background: radial-gradient(circle, #fff 0%, rgba(255,255,255,0) 70%); animation: flash 1.1s var(--ease) forwards; }
@keyframes flash { 0% { opacity: 0; transform: scale(.4); } 30% { opacity: 1; } 100% { opacity: 0; transform: scale(2.2); } }
[hidden] { display: none !important; }
.connect .scroll { padding: 4px 18px 40px; }
html, body { overscroll-behavior: none; }
