/* Live replicas of the app. Colours sampled from the real screenshots:
   face #090909, keycap #2a2a2b -> #222221, wells #030303, segment off #191919,
   accent #59c7fa, amber #f5a624, green #4dd978, red #f2544a.
   Phones are drawn on an 874 x 402 pt surface (the app's own layout) and scaled by live.js. */

.app, .mini, .rq { --ice: #59c7fa; --amber: #f5a624; --green: #4dd978; --red: #f2544a; --i1: #ededed; --i2: #a8a8a8; --i3: #808080; }

/* ---------- Device frame ---------- */
.device {
  position: relative; max-width: 980px; margin: 64px auto 0; padding: 12px;
  border-radius: 7.2% / 15%; background: #050506;
  box-shadow: inset 0 0 0 1px #2c2c30, 0 50px 120px -30px rgb(89 199 250 / .45), 0 30px 60px -30px rgb(0 0 0 / .8);
}
.device__screen { position: relative; aspect-ratio: 874 / 402; overflow: hidden; border-radius: 4.4% / 9.6%; background: #090909; }
.device__fallback img { width: 100%; height: 100%; }
.app { display: none; }
.live .device__fallback { display: none; }
.live .app { display: block; }

/* ---------- App surface ---------- */
.app {
  position: absolute; left: 0; top: 0; width: 874px; height: 402px;
  transform-origin: 0 0; transform: scale(var(--k, 1));
  background: #090909; color: var(--i1);
  font: 400 15px / 1.25 var(--sans); letter-spacing: -.01em;
  -webkit-user-select: none; user-select: none;
}
:where(.app, .rq) button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.app button:focus-visible, .rq button:focus-visible { outline: 3px solid var(--ice); outline-offset: 2px; }
.app__island { position: absolute; left: 15px; top: 139px; width: 35px; height: 122px; border-radius: 18px; background: #000; }
.app__bar {
  position: absolute; left: 70px; right: 71px; top: 5px; height: 24px;
  display: flex; align-items: center; justify-content: space-between; color: var(--i2); font-size: 12.5px;
}
.app__host { display: inline-flex; align-items: center; gap: 7px; }
.app__host i { width: 6px; height: 6px; border-radius: 50%; background: #34c759; }
.app__right { display: inline-flex; align-items: center; gap: 9px; }
.app__right svg { width: 14px; height: 14px; }
.app__dots { position: absolute; left: 0; right: 0; top: 370px; display: flex; justify-content: center; gap: 9px; }
.app__dots i { width: 6px; height: 6px; border-radius: 50%; background: #4d4d4d; }
.app__dots i.on { background: var(--i1); }

.well { background: #030303; border-radius: 11px; box-shadow: inset 0 1px 2px rgb(0 0 0 / .8), inset 0 0 0 1px rgb(255 255 255 / .025); }

/* Keycaps, like Keys.swift: a gradient cap on a hard 4 pt shadow; pressing sinks it. */
.cap {
  position: relative; display: flex; align-items: center; justify-content: center;
  border-radius: 13px; background: linear-gradient(#2a2a2b, #222221);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .07), 0 4px 0 #030303, 0 8px 16px rgb(0 0 0 / .45);
  transition: transform 70ms cubic-bezier(0, 0, .58, 1), box-shadow 70ms cubic-bezier(0, 0, .58, 1);
}
.cap svg { width: 26px; height: 26px; fill: currentColor; }
.cap::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--tint, var(--ice)); opacity: 0; transition: opacity 70ms; }
.cap:active { transform: translateY(4px); box-shadow: inset 0 1px 0 rgb(255 255 255 / .05), 0 0 0 #030303, 0 2px 6px rgb(0 0 0 / .45); }
.cap:active::after { opacity: .12; }
.cap:disabled { cursor: default; }

/* ---------- Session tile (also used on the request phone) ---------- */
.t-sess {
  position: absolute; left: 70px; top: 37px; width: 415px; height: 98px;
  display: grid; grid-template-columns: 40px 1fr auto 40px; align-items: center;
  border-radius: 13px; background: linear-gradient(#2a2a2b, #222221);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .07), 0 3px 0 #030303, 0 10px 22px rgb(0 0 0 / .45);
}
.t-sess__arrow { display: flex; align-items: center; justify-content: center; height: 70px; color: var(--i2); }
.t-sess__arrow svg { width: 10px; height: 18px; }
button.t-sess__arrow:active { color: var(--i1); }
.t-sess__text { min-width: 0; display: grid; gap: 4px; }
.t-sess__top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.t-sess__top b { min-width: 0; font-size: 17px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-sess__dash { flex: none; width: 20px; height: 3.5px; border-radius: 2px; background: var(--ice); box-shadow: 0 0 8px rgb(89 199 250 / .6); }
.t-sess__sub { font-size: 13px; color: var(--i2); padding-left: 30px; }
.t-sess__count { display: flex; align-items: center; gap: 5px; padding-right: 4px; color: var(--i3); font-size: 12px; }
.pip { width: 8px; height: 8px; border-radius: 50%; background: var(--ice); }
.pip:nth-child(2) { background: #4d4d4d; }
.pip.on { box-shadow: 0 0 0 1.5px #090909, 0 0 0 3px var(--i1); margin-inline: 3px; }
.t-sess__mark {
  position: absolute; right: 8px; top: 8px; width: 19px; height: 19px; border-radius: 50%;
  display: none; place-items: center; background: var(--amber); color: #000; font: 800 12px/1 var(--sans); font-style: normal;
}
.t-sess.is-idle .t-sess__dash { background: var(--i3); box-shadow: none; }
.is-asking .t-sess__dash { background: var(--amber); box-shadow: 0 0 10px rgb(245 166 36 / .7); }
.is-asking .t-sess__sub { color: var(--amber); }
.is-asking .t-sess__mark { display: grid; }

/* ---------- Clock ---------- */
.t-clock { position: absolute; left: 70px; top: 146px; width: 415px; height: 211px; }
.t-clock__time { position: absolute; left: 18px; top: 58px; font-size: 58px; font-weight: 300; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.t-clock__date { position: absolute; left: 20px; top: 136px; font-size: 15px; color: var(--i2); }

/* ---------- Media ---------- */
.t-media { position: absolute; left: 495px; top: 37px; width: 308px; height: 321px; }
.t-np { position: absolute; inset: 0 0 auto; height: 162px; padding: 52px 16px 0; }
.t-np b { display: block; font-size: 20px; font-weight: 600; }
.t-np > span:not(.segs) { display: block; margin-top: 3px; color: var(--i2); font-size: 15px; }
.segs { display: flex; gap: 2.5px; }
.segs i { flex: 1; background: #191919; border-radius: 1px; }
.segs--np { position: absolute; left: 13px; right: 13px; top: 110px; height: 5px; }
.segs--np i.on { background: var(--ice); }
.t-keys { position: absolute; left: 0; right: 0; top: 175px; height: 83px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.cap--play { color: var(--ice); }
.cap--play .i-play, .cap--play.is-paused .i-pause { display: none; }
.cap--play.is-paused .i-play { display: block; }
.t-vol { position: absolute; left: 0; right: 0; top: 270px; height: 51px; display: grid; grid-template-columns: 55px 1fr 55px; gap: 10px; }
.t-vol .cap svg { width: 22px; height: 22px; }
.segs--vol { align-items: center; padding: 0 12px; gap: 3px; }
.segs--vol i { height: 26px; }
.segs--vol i.on { background: var(--i1); }

/* ---------- Request card: the phone's request sheet at real size ----------
   The whole phone scaled into a column made its text 5-7 px, so the card shows the
   part that matters (session tile + request sheet) at the app's own sizes. */
.rq {
  position: relative; height: 252px; max-width: 560px; margin: 8px auto; overflow: hidden;
  border-radius: 24px; background: #090909; color: var(--i1);
  font: 400 15px / 1.25 var(--sans); letter-spacing: -.01em;
  box-shadow: 0 0 0 7px #050506, 0 0 0 8px #2c2c30, 0 30px 70px -18px rgb(245 166 36 / .5);
  -webkit-user-select: none; user-select: none;
}
.rq__bar { position: absolute; left: 18px; right: 18px; top: 9px; display: flex; justify-content: space-between; color: var(--i2); font-size: 11.5px; }
.rq__host { display: inline-flex; align-items: center; gap: 6px; }
.rq__host i { width: 6px; height: 6px; border-radius: 50%; background: #34c759; }
.rq__tile {
  position: absolute; left: 12px; right: 12px; top: 32px; height: 50px;
  display: flex; align-items: center; gap: 10px; padding: 0 12px 0 14px; border-radius: 12px;
  background: linear-gradient(#2a2a2b, #222221); box-shadow: inset 0 1px 0 rgb(255 255 255 / .07), 0 3px 0 #030303;
  transition: opacity .25s;
}
.rq__dash { flex: none; width: 16px; height: 3px; border-radius: 2px; background: var(--ice); box-shadow: 0 0 8px rgb(89 199 250 / .6); }
.rq__text { min-width: 0; display: grid; gap: 1px; }
.rq__text b { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rq__text span { font-size: 12px; color: var(--i2); }
.rq__mark {
  flex: none; margin-left: auto; width: 18px; height: 18px; border-radius: 50%;
  display: none; place-items: center; background: var(--amber); color: #000; font: 800 11px/1 var(--sans); font-style: normal;
}
.rq.is-asking .rq__dash { background: var(--amber); box-shadow: 0 0 10px rgb(245 166 36 / .7); }
.rq.is-asking .rq__text span { color: var(--amber); }
.rq.is-asking .rq__mark { display: grid; }
.rq.is-up .rq__tile { opacity: .45; }
.rq__sheet {
  position: absolute; left: 6px; right: 6px; bottom: 0; height: 160px; padding: 12px;
  display: grid; grid-template-rows: 40px 36px 44px; gap: 8px;
  border-radius: 18px 18px 0 0; background: #0f0f0f;
  box-shadow: 0 -12px 30px rgb(0 0 0 / .5), inset 0 1px 0 rgb(255 255 255 / .06);
  transform: translateY(105%); transition: transform .32s cubic-bezier(.32, .72, 0, 1);
}
.rq.is-up .rq__sheet { transform: none; }
.rq__head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.rq__badge {
  flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--amber); color: #000; font: 700 18px/1 var(--sans); font-style: normal;
}
.rq__who { min-width: 0; display: grid; gap: 1px; }
.rq__who b { font-size: 14px; font-weight: 600; }
.rq__who span { font-size: 12px; color: var(--i2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rq__cd { flex: none; margin-left: auto; display: grid; justify-items: end; gap: 5px; color: var(--amber); font-size: 12px; font-variant-numeric: tabular-nums; }
.segs--cd { width: clamp(64px, 20vw, 132px); height: 4px; gap: 2px; }
.segs--cd i.on { background: var(--amber); }
.rq__cmd { display: flex; align-items: center; min-width: 0; padding: 0 12px; border-radius: 9px; font: 400 13.5px/1 var(--mono); white-space: nowrap; overflow: hidden; }
.rq__keys { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rq__keys .cap { border-radius: 11px; font-size: 15px; font-weight: 600; }
.cap--deny { color: var(--red); --tint: var(--red); }
.cap--allow { color: var(--green); --tint: var(--green); }

/* Terminals in the flow follow the phone. */
.term__body[data-term-ask] { transition: opacity .3s; }
.term__body.is-done { opacity: .45; }
.t-no { color: #f2544a; }
.term__body.flash { animation: term-flash 1.2s cubic-bezier(.16, 1, .3, 1); }
@keyframes term-flash { from { background: rgb(89 199 250 / .14); } }
.try { color: #0a6fae; font-weight: 600; }
.dark .try, .try--center { color: var(--ice, #59c7fa); }
.try--center { margin-top: 22px; text-align: center; font-size: 1rem; }

/* ---------- Bento minis ---------- */
.b > p { margin-bottom: 22px; }
.mini {
  margin-top: auto; padding: 16px 16px 18px; border-radius: 13px 13px 0 0;
  background: #090909; color: var(--i1); box-shadow: inset 0 0 0 1px rgb(255 255 255 / .05);
  font: 400 15px / 1.4 var(--sans);
}
:where(.mini) button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.mini button:focus-visible, .mini input:focus-visible { outline: 2px solid var(--ice); outline-offset: 2px; }
.mini__btn {
  width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; color: var(--i2) !important;
  background: linear-gradient(#2a2a2b, #222221) !important; box-shadow: 0 2px 0 #030303, 0 4px 10px rgb(0 0 0 / .4);
  transition: transform 70ms, box-shadow 70ms;
}
.mini__btn svg { width: 8px; height: 14px; }
.mini__btn:active { transform: translateY(2px); box-shadow: 0 0 0 #030303; }

.chat__head { display: flex; align-items: center; gap: 10px; }
.chat__title { flex: 1; min-width: 0; display: flex; align-items: center; gap: 7px; font-size: 14px; }
.chat__title i { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--ice); }
.chat__title b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat__title span { color: var(--i3); font-size: 12px; }
.chat.is-idle .chat__title i { background: var(--i3); }
.chat__who { margin-top: 14px; font-size: 12px; font-weight: 600; color: var(--i3); }
.chat__who--you { color: var(--ice); }
.chat__you { margin-top: 2px; font-size: 17px; font-weight: 600; }
.chat__claude { margin-top: 2px; color: var(--i1); max-width: 46em; }
.chat__claude code { font: 13.5px var(--mono); background: #1a1a1a; padding: 1px 4px; border-radius: 4px; }
.chat__dim { color: var(--i3); }

.todo { background: #030303; }
.todo__head { display: flex; align-items: center; gap: 9px; }
.todo__head b { font-size: 14px; font-weight: 600; }
.todo__add { width: 22px; height: 22px; }
.todo__add svg { width: 22px; height: 22px; fill: var(--ice); }
.todo__exp { margin-left: auto; width: 14px; color: var(--i3); }
.todo__list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 4px; }
.todo__list li { display: flex; align-items: center; gap: 10px; min-height: 30px; }
.todo__list li span { flex: 1; min-width: 0; font-size: 15px; overflow-wrap: anywhere; }
.todo__tick { flex: none; width: 19px; height: 19px; border-radius: 50%; box-shadow: inset 0 0 0 1.6px var(--i3); position: relative; }
.done .todo__tick { background: var(--ice); box-shadow: none; }
.done .todo__tick::after { content: ""; position: absolute; left: 6.5px; top: 3.5px; width: 4px; height: 8px; border-right: 2px solid #000; border-bottom: 2px solid #000; transform: rotate(45deg); }
.done span { color: var(--i3); text-decoration: line-through; }
.todo__del { width: 26px; height: 26px; border-radius: 7px; color: var(--i3) !important; font-size: 18px !important; line-height: 1; opacity: 0; transition: opacity .15s; }
.todo__list li:hover .todo__del, .todo__del:focus-visible { opacity: 1; }
@media (hover: none) { .todo__del { opacity: .7; } }
.todo__form { margin-top: 10px; }
.todo__form input {
  width: 100%; padding: 9px 11px; border: 0; border-radius: 9px; background: #1a1a1a; color: var(--i1);
  font: 15px var(--sans); box-shadow: inset 0 0 0 1px rgb(89 199 250 / .4);
}

.dial { display: grid; place-items: center; position: relative; padding-top: 22px; }
.dial__ring { width: min(220px, 100%); height: auto; }
.dial__ring line { stroke: #1a1a1a; stroke-width: 5; stroke-linecap: round; transition: stroke .3s; }
.dial__ring line.on { stroke: var(--ice); }
.dial__val { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -64%); display: grid; justify-items: center; }
.dial__val b { font-size: 44px; font-weight: 300; font-variant-numeric: tabular-nums; line-height: 1; }
.dial__val small { position: absolute; right: -16px; top: 18px; font-size: 16px; color: var(--i2); }
.dial__val span { font-size: 13px; color: var(--i2); margin-top: 4px; }
.dial__hist { width: 100%; height: 26px; display: flex; align-items: flex-end; gap: 3px; margin-top: 8px; }
.dial__hist i { flex: 1; height: 100%; border-radius: 1px; background: var(--ice); opacity: .85; transform-origin: bottom; transform: scaleY(var(--h, .3)); transition: transform .5s cubic-bezier(.16, 1, .3, 1); }

.sys { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sys__mem b { display: block; font-size: 30px; font-weight: 300; font-variant-numeric: tabular-nums; }
.sys__mem b small { font-size: 14px; color: var(--i2); margin-left: 3px; }
.sys__cap { display: block; font-size: 12px; color: var(--i2); }
.sys__bars { display: grid; gap: 3px; margin-top: 12px; }
.sys__bars i { height: 6px; border-radius: 1px; background: #191919; transition: background .3s; }
.sys__bars i.on { background: var(--ice); }
.sys__grid { display: flex; gap: 3px; margin-top: 10px; }
.sys__grid > span { flex: 1; display: grid; gap: 3px; }
.sys__grid i { height: 8px; border-radius: 1px; background: #191919; transition: background .25s; }
.sys__grid i.on { background: var(--ice); }

.gal__chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chip {
  flex: none; padding: 8px 14px !important; border-radius: 999px; background: #1a1a1d !important; color: #d2d2d7 !important;
  font-size: 14px !important; box-shadow: inset 0 0 0 1px rgb(255 255 255 / .06);
}
.chip.on { background: rgb(89 199 250 / .16) !important; color: var(--ice) !important; box-shadow: inset 0 0 0 1.5px var(--ice); }
.gal__tiles { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.gal__tile {
  display: flex; align-items: center; gap: 9px; min-height: 44px; padding: 0 12px; border-radius: 10px;
  background: linear-gradient(#2a2a2b, #222221); box-shadow: 0 2px 0 #030303; font-size: 14px;
}
.gal__tile::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--c, var(--ice)); }
.gal__tile--claude { --c: var(--amber); }
.gal__tile--media { --c: var(--green); }
.gal__tile--developer { --c: #d2d2d7; }
.gal__tile--control { --c: var(--i3); }

@media (min-width: 1000px) {
  .b--dial, .b--sys { grid-column: span 3; }
}
@media (prefers-reduced-motion: reduce) {
  .cap, .cap::after, .rq__sheet, .rq__tile, .dial__hist i, .dial__ring line, .sys__bars i, .sys__grid i, .mini__btn, .term__body { transition: none !important; animation: none !important; }
}

/* Section text colours (home.css .light b) must not reach inside the device. */
.app b, .mini b, .rq b, .app strong { color: inherit; }

/* Phones: the panel keeps 80 % of the app's size and pans sideways, instead of shrinking to 40 %. */
.try__pan { display: none; }
.gal__more { display: none; }
@media (max-width: 699px) {
  .pan { margin: 40px calc(-1 * var(--m)) 0; padding: 8px var(--m) 64px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; }
  .pan::-webkit-scrollbar { display: none; }
  .pan .device { width: 723px; max-width: none; margin: 0; }
  .pan + .try { margin-top: -36px; }
  .try__pan { display: inline; }
}
@media (max-width: 639px) {
  .gal__tiles { grid-template-columns: 1fr 1fr; }
  .gal__tile { padding: 0 10px; font-size: 13px; }
  .gal:not(.is-open) .gal__tiles li:nth-child(n + 11) { display: none; }
  .gal__more {
    display: block; width: 100%; min-height: 44px; margin-top: 10px; border-radius: 10px;
    background: #1a1a1d !important; color: var(--ice) !important; font-size: 14px !important; font-weight: 600 !important;
    box-shadow: inset 0 0 0 1px rgb(255 255 255 / .06);
  }
  .gal__more[hidden] { display: none; }
}
