/* Karvaura Connect: a keyboard phone in Karvaura's colours.
   Layout: one device on a mint desk; on a real phone the device becomes the whole screen. */
:root {
  /* Karvaura palette */
  --mint: #b3f5d4;        /* Mint Whisper */
  --leaf: #54de9e;        /* Fresh Leaf */
  --emerald: #128460;     /* Deep Emerald */
  --crimson: #9e0535;     /* Crimson Flame */
  --berry: #610421;       /* Burnt Berry */
  --char: #231f20;        /* Charred Earth: text only */
  --white: #fdfefe;       /* Pure White */
  /* derived */
  --emerald-dk: #0b5f45;
  --emerald-hi: #1fa67b;
  --mint-soft: #ecfcf4;
  --mint-line: #c6eedb;
  --ink: var(--char);
  --ink-dim: #4f625b;
  /* type */
  --body: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --display: "Barlow Semi Condensed", "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
/* Mobile first: on a phone the app IS the screen. The desktop "handset" frame is added
   in the min-width media query at the bottom of the file. */
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  overflow: hidden;            /* app-like: the screen scrolls inside, not the page */
  overscroll-behavior: none;
  background: var(--emerald-dk);
  color: var(--ink);
  font: 15px/1.45 var(--body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--emerald); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--crimson); outline-offset: 2px; }

/* ---------- desk + device (mobile: full screen) ---------- */
.desk { height: 100%; height: 100dvh; }
.device {
  width: 100%; height: 100%; height: 100dvh;
  padding: env(safe-area-inset-top, 0px) max(6px, env(safe-area-inset-right, 0px)) max(4px, env(safe-area-inset-bottom, 0px)) max(6px, env(safe-area-inset-left, 0px));
  background: linear-gradient(160deg, var(--emerald-hi), var(--emerald) 40%, var(--emerald-dk) 100%);
  display: flex; flex-direction: column; position: relative;
}
.bezel-top { height: 28px; flex: none; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 10px; }
.speaker { display: none; }
.brand {
  grid-column: 2; grid-row: 1;
  font: 700 10px/1 var(--display); letter-spacing: .38em; text-indent: .38em;
  color: var(--white);
}
.led { grid-column: 3; grid-row: 1; justify-self: end; width: 8px; height: 8px; border-radius: 50%; background: #0a4d38; box-shadow: inset 0 1px 1px rgba(0,0,0,.4); }
.led.on-red { animation: led-red 1.6s steps(1) infinite; }
.led.on-green { animation: led-green 2.4s steps(1) infinite; }
@keyframes led-red { 0%,60% { background: #ff2a4a; box-shadow: 0 0 10px 2px #ff2a4a; } 61%,100% { background: #0a4d38; box-shadow: none; } }
@keyframes led-green { 0%,15% { background: var(--mint); box-shadow: 0 0 10px 2px var(--mint); } 16%,100% { background: #0a4d38; box-shadow: none; } }

/* ---------- screen ---------- */
.screen {
  flex: 1; min-height: 0; border-radius: 6px;
  background: var(--white);
  box-shadow: 0 0 0 3px var(--emerald-dk), 0 0 0 4px rgba(255,255,255,.25);
  overflow: hidden; overflow: clip;
  display: flex; flex-direction: column; position: relative;
}
.screen::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(125deg, rgba(255,255,255,.18) 0%, rgba(255,255,255,0) 34%); }
.statusbar {
  height: 24px; flex: none;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 8px;
  background: var(--emerald-dk); color: var(--white);
  font: 600 11px/1 var(--display); letter-spacing: .04em;
}
.carrier b { color: var(--leaf); margin-left: 2px; }
.clock { font-variant-numeric: tabular-nums; }
.sb-right { justify-self: end; display: flex; gap: 6px; align-items: center; }
.signal { display: flex; align-items: flex-end; gap: 1px; height: 10px; }
.signal i { width: 2px; background: var(--white); }
.signal i:nth-child(1){height:2px}.signal i:nth-child(2){height:4px}.signal i:nth-child(3){height:6px}.signal i:nth-child(4){height:8px}.signal i:nth-child(5){height:10px;opacity:.35}
.battery { width: 20px; height: 10px; border: 1px solid var(--white); border-radius: 2px; position: relative; padding: 1px; }
.battery::after { content: ""; position: absolute; right: -3px; top: 2px; width: 2px; height: 4px; background: var(--white); }
.battery i { display: block; height: 100%; width: 78%; background: var(--leaf); }

.view { flex: 1; overflow: auto; position: relative; overscroll-behavior: contain; }
.scr { min-height: 100%; display: flex; flex-direction: column; animation: scr-in .18s ease-out; }
@keyframes scr-in { from { opacity: .5; transform: translateX(10px); } }
.scr[data-title]:not([data-title=""])::before {
  content: attr(data-title);
  position: sticky; top: 0; z-index: 3; display: block; padding: 7px 12px;
  background: linear-gradient(var(--emerald-hi), var(--emerald));
  color: var(--white);
  border-bottom: 2px solid var(--leaf);
  font: 700 14px/1.2 var(--display); letter-spacing: .03em;
}
.pad { padding: 16px 14px 22px; display: flex; flex-direction: column; gap: 10px; }
.center { text-align: center; align-items: center; justify-content: center; flex: 1; }
.h-app { font: 700 23px/1.12 var(--display); margin: 0; color: var(--emerald-dk); text-wrap: balance; }
h2 { font: 700 15px/1.2 var(--display); margin: 10px 0 0; color: var(--crimson); letter-spacing: .03em; }
.lede { margin: 0; color: var(--ink-dim); }
.muted { color: var(--ink-dim); margin: 2px 0 0; }
.fine { font-size: 12.5px; color: var(--ink-dim); margin: 6px 0 0; }
.eyebrow { margin: 0; font: 700 11px/1 var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--crimson); }

/* ---------- boot ---------- */
.scr-boot { align-items: center; justify-content: center; gap: 6px; background: var(--emerald); color: var(--white); }
.k-logo { width: 74px; height: 74px; }
.k-logo rect { fill: var(--white); }
.k-logo path { fill: none; stroke: var(--emerald); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.boot-word { margin: 10px 0 0; font: 700 20px/1 var(--display); letter-spacing: .42em; text-indent: .42em; }
.boot-tag { margin: 0; font-size: 12px; color: var(--mint); letter-spacing: .08em; }
.boot-bar { width: 140px; height: 4px; margin-top: 22px; background: var(--emerald-dk); border-radius: 2px; overflow: hidden; }
.boot-bar i { display: block; height: 100%; width: 0; background: var(--leaf); }

/* ---------- forms ---------- */
form { display: flex; flex-direction: column; gap: 8px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--ink-dim); min-width: 0; font-weight: 600; }
.field input, .field select, .field textarea {
  width: 100%; background: var(--white); color: var(--char);
  border: 1.5px solid var(--mint-line); border-radius: 4px; padding: 9px; font-size: 16px; font-weight: 400;
}
.field input:focus, .field select:focus { outline: 2px solid var(--leaf); outline-offset: 0; border-color: var(--emerald); }
.field [aria-invalid="true"] { border-color: var(--crimson); }
.check { display: grid; grid-template-columns: 22px 1fr; gap: 8px; font-size: 12.5px; color: var(--ink-dim); align-items: start; margin-top: 4px; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--emerald); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.err { margin: -4px 0 0; font-size: 12px; color: var(--crimson); font-weight: 600; }
.err:empty { display: none; }
.err.big { font-size: 13px; margin: 0; }

.btn {
  display: block; width: 100%; text-align: center; text-decoration: none;
  padding: 11px 14px; border-radius: 4px; border: 0;
  font: 700 15px/1.2 var(--display); letter-spacing: .04em;
}
.btn-go { color: var(--white); background: linear-gradient(var(--emerald-hi), var(--emerald)); box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 2px 0 var(--emerald-dk); }
.btn-go:active { transform: translateY(1px); box-shadow: inset 0 1px 0 rgba(255,255,255,.3); }
.btn-go[disabled] { opacity: .65; cursor: progress; }
.btn-ghost { color: var(--emerald-dk); background: var(--white); border: 1.5px solid var(--emerald); }
.btn-ghost:active { background: var(--mint-soft); }

/* ---------- home ---------- */
.scr-home {
  /* Wallpaper: the official Karvaura ribbon icon (Drive: Karvaura Logo & Icons /
     Supplementary Logo and Icon styles / Karvaura Icon - Colour Ribbon / 85 CH Karvaura Ribbon Icon - 1). */
  background: url("home-ribbon.png") right 12px top 12px / 96px auto no-repeat, #9e0535;
  padding-bottom: 8px;
}
.home-top { padding: 16px 118px 6px 16px; }
.home-time { margin: 0; font: 700 46px/1 var(--display); color: var(--white); text-shadow: 0 2px 8px rgba(0,0,0,.35); font-variant-numeric: tabular-nums; }
.home-date { margin: 4px 0 0; font-size: 13px; color: rgba(255,255,255,.92); text-shadow: 0 1px 4px rgba(0,0,0,.4); }
.home-hi { margin: 6px 0 0; font: 700 14px/1.25 var(--display); color: var(--white); text-shadow: 0 1px 4px rgba(0,0,0,.45); }
.grid {
  margin: auto 8px 0; padding: 10px 4px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px 2px;
  background: rgba(253, 254, 254, .82); border-radius: 8px;
  box-shadow: 0 4px 14px rgba(11, 95, 69, .2);
  backdrop-filter: blur(4px);
}
.app { background: none; border: 1.5px solid transparent; border-radius: 6px; padding: 6px 2px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-decoration: none; color: var(--char); }
.app:hover, .app:focus-visible { border-color: var(--leaf); background: var(--mint-soft); outline: none; }
.ico { width: 44px; height: 44px; border-radius: 10px; position: relative; display: grid; place-items: center; box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 2px 4px rgba(11,95,69,.35); }
.ico::after { content: ""; position: absolute; inset: 0 0 50%; border-radius: 10px 10px 40% 40% / 10px 10px 8px 8px; background: linear-gradient(rgba(255,255,255,.4), rgba(255,255,255,.05)); }
.ico svg { width: 24px; height: 24px; fill: none; stroke: var(--white); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; position: relative; z-index: 1; }
.ico svg .thin { stroke-width: 1.4; opacity: .85; }
.ico-msg { background: linear-gradient(var(--emerald-hi), var(--emerald-dk)); }
.ico-karve { background: linear-gradient(#c81048, var(--berry)); }
.ico-contact { background: linear-gradient(var(--leaf), var(--emerald)); }
.ico-about { background: linear-gradient(var(--white), var(--mint)); }
.ico-about svg, .ico-deck svg { stroke: var(--emerald-dk); }
.ico-deck { background: linear-gradient(var(--mint), var(--leaf)); }
.ico-web { background: linear-gradient(var(--emerald), #084a36); }
.ico-ig { background: linear-gradient(var(--crimson), var(--berry)); }
.ico-opt { background: linear-gradient(#7b2a43, var(--berry)); }
.badge { position: absolute; z-index: 2; top: -6px; right: -6px; min-width: 18px; height: 18px; border-radius: 9px; padding: 0 5px; background: var(--crimson); color: var(--white); font: 700 11px/18px var(--body); text-align: center; box-shadow: 0 0 0 2px var(--white); }
.lbl { font-size: 11.5px; line-height: 1.15; text-align: center; font-weight: 600; }
.home-foot { margin: 8px 0 0; text-align: center; font-size: 11px; color: var(--white); font-weight: 600; text-shadow: 0 1px 2px rgba(0,0,0,.35); }

/* ---------- chat ---------- */
.scr-chat { background: var(--mint-soft); }
.chat-head { display: flex; gap: 10px; align-items: center; padding: 8px 12px; background: var(--mint); border-bottom: 1px solid var(--mint-line); }
.chat-head b { display: block; font: 700 14px/1.2 var(--display); color: var(--emerald-dk); }
.chat-head small { display: block; color: var(--ink-dim); font-size: 11.5px; }
.avatar { width: 36px; height: 36px; flex: none; border-radius: 6px; display: grid; place-items: center; font: 700 14px/1 var(--display); color: var(--white); background: linear-gradient(var(--crimson), var(--berry)); box-shadow: inset 0 1px 0 rgba(255,255,255,.35); }
.avatar.big { width: 56px; height: 56px; font-size: 20px; border-radius: 10px; }
.chat-log { flex: 1; padding: 10px 10px 4px; display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 86%; padding: 7px 10px; border-radius: 6px; font-size: 14px; line-height: 1.38; position: relative; }
.msg.in { align-self: flex-start; background: var(--white); border: 1px solid var(--mint-line); box-shadow: 0 1px 1px rgba(11,95,69,.08); }
.msg.out { align-self: flex-end; background: var(--leaf); color: var(--char); padding-right: 26px; }
.msg.out .dr { position: absolute; right: 6px; bottom: 4px; font: 700 10px/1 var(--display); color: var(--emerald-dk); }
.msg .who { display: block; font: 700 11px/1.2 var(--display); color: var(--crimson); margin-bottom: 2px; }
.typing { align-self: flex-start; color: var(--ink-dim); font-size: 12px; font-style: italic; padding: 2px 4px; margin: 0; }
.chat-replies { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 10px 12px; border-top: 1px solid var(--mint-line); background: var(--white); }
.chip { border: 1.5px solid var(--emerald); background: var(--white); color: var(--emerald-dk); border-radius: 14px; padding: 6px 11px; font: 700 13px/1 var(--body); }
.chip:hover { background: var(--mint-soft); }

/* ---------- karve ---------- */
.scr-karve { background: var(--mint-soft); }
.karve-bar { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 10px; }
.seg { display: flex; border: 1.5px solid var(--emerald); border-radius: 4px; overflow: hidden; }
.seg button { border: 0; padding: 6px 10px; font: 700 12.5px/1 var(--display); background: var(--white); color: var(--emerald-dk); }
.seg button + button { border-left: 1.5px solid var(--emerald); }
.seg button[aria-checked="true"] { background: var(--emerald); color: var(--white); }
.meter { font-size: 12.5px; color: var(--ink-dim); white-space: nowrap; }
.meter b { color: var(--crimson); font-variant-numeric: tabular-nums; }
.karve-stage { position: relative; margin: 0 10px; flex: 1; min-height: 220px; border-radius: 4px; overflow: hidden; box-shadow: 0 0 0 2px var(--emerald-dk), 0 6px 14px rgba(11,95,69,.3); touch-action: none; }
.karve-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#shavings { pointer-events: none; }
.karve-hint { position: absolute; inset: auto 0 14px; margin: 0; text-align: center; font: 700 13px/1.35 var(--display); color: rgba(255,255,255,.75); white-space: pre-line; pointer-events: none; transition: opacity .4s; }
.karve-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px 10px 0; }
.scr-karve .fine { padding: 0 12px 12px; text-align: center; }

/* ---------- about ---------- */
.about p { margin: 0; }
.layers { display: flex; height: 16px; border-radius: 2px; overflow: hidden; margin: 6px 0; box-shadow: 0 0 0 1px var(--mint-line); }
.layers i { flex: 1; }
.layers i:nth-child(1){background:#000000}.layers i:nth-child(2){background:#f4633a}.layers i:nth-child(3){background:#47d7ac}.layers i:nth-child(4){background:#003087}.layers i:nth-child(5){background:#ffffff}
.tidy { margin: 0; padding-left: 18px; display: grid; gap: 3px; }
.tidy li::marker { color: var(--emerald); }
.bliss { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin: 2px 0 0; }
.bliss div { background: var(--mint-soft); border: 1px solid var(--mint-line); border-radius: 4px; padding: 6px 2px; text-align: center; }
.bliss dt { font: 700 20px/1 var(--display); color: var(--emerald); }
.bliss dd { margin: 2px 0 0; font-size: 10.5px; color: var(--ink-dim); }
.socials { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 8px; font-size: 13.5px; font-weight: 600; }

/* ---------- contact ---------- */
.card-head { display: flex; gap: 12px; align-items: center; }
.kv { list-style: none; margin: 4px 0; padding: 0; border: 1px solid var(--mint-line); border-radius: 4px; background: var(--mint-soft); }
.kv li { display: grid; grid-template-columns: 74px 1fr auto; gap: 8px; align-items: center; padding: 9px 10px; min-width: 0; }
.kv li + li { border-top: 1px solid var(--mint-line); }
.kv span { font-size: 12px; color: var(--ink-dim); }
.kv b, .kv a { font-weight: 700; overflow-wrap: anywhere; min-width: 0; }
.mini { border: 1.5px solid var(--emerald); background: var(--white); color: var(--emerald-dk); border-radius: 3px; padding: 4px 8px; font-size: 12px; font-weight: 700; }
.tick { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--mint); }
.tick svg { width: 30px; height: 30px; fill: none; stroke: var(--emerald-dk); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- options ---------- */
.opts { list-style: none; margin: 0; padding: 0; border: 1px solid var(--mint-line); border-radius: 4px; background: var(--mint-soft); }
.opts li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px; }
.opts li + li { border-top: 1px solid var(--mint-line); }
.opts b { display: block; }
.opts small { display: block; color: var(--ink-dim); font-size: 12px; }
.toggle { flex: none; width: 46px; height: 26px; border-radius: 13px; border: 1.5px solid var(--emerald); background: var(--white); position: relative; padding: 0; }
.toggle i { position: absolute; top: 2px; left: 2px; width: 19px; height: 19px; border-radius: 50%; background: var(--emerald); transition: transform .15s; }
.toggle[aria-checked="true"] { background: var(--leaf); }
.toggle[aria-checked="true"] i { transform: translateX(19px); background: var(--white); }

/* ---------- toast ---------- */
.toast { position: absolute; left: 10px; right: 10px; bottom: 10px; z-index: 10; background: var(--emerald-dk); color: var(--white); border-radius: 5px; padding: 9px 12px; font-size: 13.5px; text-align: center; box-shadow: 0 4px 12px rgba(0,0,0,.2); transform: translateY(150%); transition: transform .25s ease; }
.toast.show { transform: none; }

/* ---------- hardware buttons ---------- */
.hw { flex: none; display: grid; grid-template-columns: 1fr 1fr 1.2fr 1fr 1fr; align-items: center; gap: 6px; padding: 8px 2px 6px; }
.hw-btn, .hw-pad { height: 46px; border: 0; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(var(--emerald-hi), var(--emerald-dk)); box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 2px 3px rgba(5,50,36,.5); }
.hw-btn:active, .hw-pad:active { transform: translateY(1px); }
.hw-btn svg { width: 20px; height: 20px; fill: none; stroke: var(--white); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.hw-call { background: linear-gradient(#7ff0bd, var(--leaf)); }
.hw-call svg { stroke: var(--emerald-dk); }
.hw-end { background: linear-gradient(var(--crimson), var(--berry)); }
.hw-pad { width: 60px; height: 46px; justify-self: center; border-radius: 12px; background: linear-gradient(var(--white), var(--mint)); }
.hw-pad i { width: 36px; height: 26px; border-radius: 8px; background: linear-gradient(145deg, var(--mint), #8fe3bb); box-shadow: inset 0 1px 2px rgba(11,95,69,.45), 0 1px 0 rgba(255,255,255,.8); }

/* ---------- keyboard ---------- */
.kbd { display: none; flex-direction: column; gap: 5px; padding: 6px 6px 4px; }
.krow { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; }
.key {
  height: 30px; border: 0; padding: 0;
  border-radius: 4px 4px 9px 9px / 4px 4px 8px 8px;
  background: linear-gradient(var(--white), #dff5ea 75%);
  box-shadow: inset 0 1px 0 #fff, 0 2px 0 var(--emerald-dk);
  color: var(--char); font: 700 12px/1 var(--display);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
}
.key small { font-size: 8px; color: var(--crimson); font-weight: 700; }
.key:active, .key.down { transform: translateY(1px); background: var(--mint); box-shadow: inset 0 1px 0 #fff; }
.key.wide { grid-column: span 3; }
.key.mid { grid-column: span 2; }
.chin { display: none; text-align: center; padding-top: 8px; font: 700 8px/1 var(--display); letter-spacing: .5em; text-indent: .5em; color: var(--mint); }

/* ---------- party mode ---------- */
.party .scr-home { animation: party-bg 8s linear infinite; }
@keyframes party-bg { 0%,100% { background-color: #9e0535; } 25% { background-color: #610421; } 50% { background-color: #0b5f45; } 75% { background-color: #003087; } }
.party .ico { animation: bob .6s ease-in-out infinite alternate; }
.party .app:nth-child(2n) .ico { animation-delay: .3s; }
.party .led { animation: led-party .5s steps(1) infinite !important; }
@keyframes hue { to { filter: hue-rotate(360deg); } }
@keyframes bob { to { transform: translateY(-3px) rotate(-3deg); } }
@keyframes led-party { 0% { background: #ff2a4a; box-shadow: 0 0 12px 3px #ff2a4a } 33% { background: var(--leaf); box-shadow: 0 0 12px 3px var(--leaf) } 66% { background: var(--mint); box-shadow: 0 0 12px 3px var(--mint) } }

@media (prefers-reduced-motion: reduce) {
  .scr { animation: none; }
  .party .scr-home, .party .ico, .party .led, .led.on-red, .led.on-green { animation: none !important; }
  .led.on-red { background: #ff2a4a; }
  .led.on-green { background: var(--mint); }
}

/* ---------- larger screens: show the app inside a handset ---------- */
@media (min-width: 561px) and (min-height: 701px) {
  body {
    overflow: auto;
    background: linear-gradient(175deg, var(--white) 0%, var(--mint-soft) 45%, var(--mint) 100%);
  }
  .desk { height: auto; min-height: 100%; display: grid; place-items: center; padding: 28px 16px; }
  .device {
    width: 384px; height: auto;
    border-radius: 46px 46px 58px 58px;
    padding: 0 18px 18px;
    background:
      linear-gradient(180deg, rgba(255,255,255,.22), rgba(255,255,255,0) 16%),
      linear-gradient(160deg, var(--emerald-hi), var(--emerald) 40%, var(--emerald-dk) 100%);
    box-shadow:
      0 0 0 2px var(--emerald-dk), 0 0 0 4px var(--mint), 0 0 0 5px var(--emerald-dk),
      0 36px 70px rgba(11, 95, 69, .35), inset 0 1px 0 rgba(255,255,255,.35);
  }
  .bezel-top { height: 46px; }
  .speaker {
    display: block; grid-column: 2; grid-row: 1; justify-self: center;
    width: 70px; height: 6px; border-radius: 3px;
    background: repeating-linear-gradient(90deg, var(--emerald-dk) 0 3px, #084a36 3px 5px);
    box-shadow: inset 0 1px 1px rgba(0,0,0,.35);
    transform: translateY(-8px);
  }
  .brand { font-size: 11px; transform: translateY(9px); }
  .screen { flex: none; height: 470px; }
  .hw { gap: 4px; padding: 12px 4px 10px; }
  .hw-btn, .hw-pad { height: 38px; }
  .hw-pad { width: 56px; height: 42px; }
  .kbd { display: flex; }
  .chin { display: block; }
  .is-full .device { transform: scale(1.12); transform-origin: center; }
}
@media (max-width: 360px) {
  .ico { width: 40px; height: 40px; }
  .home-time { font-size: 38px; }
}

/* ---------- additions: Oct 2026 update ---------- */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.lang-pick { align-self: flex-end; display: inline-flex; align-items: center; gap: 4px; margin: -6px 0 -2px; }
.lang-select { border: 1.5px solid var(--mint-line); border-radius: 4px; background: var(--white); padding: 4px 6px; font-size: 13px; color: var(--emerald-dk); font-weight: 700; }
.lang-select.small { flex: none; max-width: 130px; }
.globe { font-size: 14px; }
.req { color: var(--crimson); margin-left: 2px; font-weight: 700; }
.req-note { margin: 0; font-size: 12px; color: var(--ink-dim); }

/* avatar photo */
.avatar.has-photo { background: var(--mint); padding: 0; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: inherit; }

/* compose box in Messages */
.compose { position: sticky; bottom: 0; z-index: 2; gap: 4px; padding: 8px 10px 10px; background: var(--white); border-top: 1px solid var(--mint-line); }
.compose-row { display: grid; grid-template-columns: 1fr auto; gap: 6px; align-items: stretch; }
.compose textarea { resize: none; width: 100%; border: 1.5px solid var(--mint-line); border-radius: 4px; padding: 7px 8px; font-size: 15px; line-height: 1.3; background: var(--white); }
.compose textarea:focus { outline: 2px solid var(--leaf); outline-offset: 0; border-color: var(--emerald); }
.btn.send { width: auto; padding: 0 14px; }
.compose-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-dim); }
.check-sm { display: inline-flex; align-items: center; gap: 6px; }
.check-sm input { width: 16px; height: 16px; margin: 0; accent-color: var(--emerald); }
.count { font-variant-numeric: tabular-nums; }
.count.low { color: var(--crimson); font-weight: 700; }

/* karve help + tooltips */
.help-btn { flex: none; width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--emerald); background: var(--white); color: var(--emerald-dk); font: 700 14px/1 var(--display); padding: 0; }
.help-btn[aria-expanded="true"] { background: var(--emerald); color: var(--white); }
.tip-line { margin: -2px 10px 6px; min-height: 16px; font-size: 12px; line-height: 1.3; color: var(--ink-dim); }
.karve-help { position: absolute; inset: 8px; z-index: 4; overflow: auto; background: rgba(255,255,255,.97); border-radius: 6px; padding: 12px; box-shadow: 0 4px 16px rgba(0,0,0,.2); display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.karve-help h2 { margin: 0; color: var(--emerald-dk); }
.karve-help p { margin: 0; }
.layer-key { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; text-align: center; font-size: 11px; font-weight: 700; }
.layer-key i { display: block; height: 18px; border-radius: 3px; box-shadow: 0 0 0 1px rgba(0,0,0,.2); margin-bottom: 3px; }
.tip-list { margin: 0; padding-left: 16px; display: grid; gap: 3px; font-size: 12.5px; }

/* contact extras */
#cRemind[disabled] { opacity: .8; cursor: default; background: var(--mint-soft); }

/* party: icons run away when tapped + confetti */
.ico.runaway { animation: runaway .9s cubic-bezier(.2,.8,.3,1.2); }
@keyframes runaway {
  0% { transform: none; }
  35% { transform: translate(var(--run-x), var(--run-y)) rotate(var(--run-r)) scale(1.15); }
  70% { transform: translate(calc(var(--run-x) * -.3), calc(var(--run-y) * -.2)) rotate(calc(var(--run-r) * -.5)); }
  100% { transform: none; }
}
.confetti { position: absolute; z-index: 40; width: 7px; height: 10px; border-radius: 1px; pointer-events: none; box-shadow: 0 0 0 1px rgba(0,0,0,.15); animation: confetti 1.05s ease-out forwards; }
@keyframes confetti {
  to { transform: translate(var(--dx), calc(var(--dy) + 180px)) rotate(var(--rot)); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .ico.runaway { animation: none; } }

/* ---------- additions: 28 Oct check-in ---------- */
.boot-logo { width: 170px; }
.boot-logo svg { display: block; width: 100%; height: auto; fill: var(--white); stroke: none; }
.boot-tag { margin-top: 6px; }

.fs-btn { width: 16px; height: 16px; padding: 0; border: 0; background: none; color: var(--white); display: grid; place-items: center; }
.fs-btn svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.is-full .fs-btn svg { transform: rotate(180deg); }

.share-sheet { position: absolute; inset: 0; z-index: 30; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; }
.share-card { width: 100%; background: var(--white); border-radius: 10px 10px 0 0; padding: 14px 12px 12px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 -6px 20px rgba(0,0,0,.2); animation: sheet-up .2s ease-out; }
.share-card h2 { margin: 0; color: var(--emerald-dk); }
@keyframes sheet-up { from { transform: translateY(40%); opacity: .4; } }
.share-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px 4px; }
.share-opt { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 4px 0; border: 0; background: none; text-decoration: none; color: var(--char); font-size: 11.5px; font-weight: 600; border-radius: 6px; }
.share-opt:hover, .share-opt:focus-visible { background: var(--mint-soft); }
.share-opt i { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #fff; font: 700 17px/1 var(--display); font-style: normal; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
@media (prefers-reduced-motion: reduce) { .share-card { animation: none; } }

/* optional section on the sign-up form */
.opt-head { margin: 8px 0 -2px; padding-top: 8px; border-top: 1px dashed var(--mint-line); font: 700 12px/1 var(--display); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-dim); }

/* Contact Shaun lock + qualifying chat */
.lock { position: absolute; z-index: 2; right: -6px; bottom: -6px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--crimson); box-shadow: 0 0 0 2px var(--white); }
.lock svg { width: 12px !important; height: 12px !important; stroke: var(--white); stroke-width: 2.4; fill: none; }
.q-replies { flex-direction: column; align-items: stretch; }
.q-replies .chip { text-align: left; padding: 10px 14px; font-size: 14px; border-radius: 18px; }
.q-replies a.chip { text-decoration: none; display: block; }
.q-form { gap: 8px; }
.q-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.q-fields input { width: 100%; min-width: 0; border: 1.5px solid var(--mint-line); border-radius: 4px; padding: 9px 8px; font-size: 16px; background: var(--white); }
.q-fields input:focus { outline: 2px solid var(--leaf); outline-offset: 0; border-color: var(--emerald); }
.q-form .btn { width: 100%; }

/* ---------- Easter egg: hold Back for 3 s, the screen peels away layer by layer ---------- */
.screen.egg-tease .view { animation: egg-tease .22s ease-in-out infinite alternate; transform-origin: 0 100%; }
@keyframes egg-tease { from { transform: none; } to { transform: rotate(-.6deg) translateY(-2px); } }
.egg { position: absolute; inset: 0; z-index: 30; overflow: hidden; }
.egg[hidden] { display: none; }
.egg-layer {
  position: absolute; inset: -2px; background: var(--c);
  transform-origin: 0 100%;
  box-shadow: 6px -6px 18px rgba(0,0,0,.35);
}
/* a carved K on each layer */
.egg-layer::after {
  content: "K"; position: absolute; left: 50%; top: 38%; transform: translate(-50%, -50%);
  font: 800 130px/1 var(--display, sans-serif); color: rgba(127,127,127,.18);
}
/* the curl highlight on the peeling corner */
.egg-layer::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(225deg, rgba(255,255,255,.55) 0%, rgba(255,255,255,0) 22%, rgba(0,0,0,.18) 23%, rgba(0,0,0,0) 40%);
  opacity: 0;
}
.egg.peeled .egg-layer { animation: egg-peel .75s cubic-bezier(.55,.05,.6,1) forwards; animation-delay: calc(var(--i) * .27s); }
.egg.peeled .egg-layer::before { animation: egg-curl .75s ease-in forwards; animation-delay: calc(var(--i) * .27s); }
@keyframes egg-peel {
  0%   { transform: none; }
  25%  { transform: rotate(-4deg) translate(2%, -3%) skewX(-2deg); }
  100% { transform: rotate(-38deg) translate(-25%, -150%) skewX(-8deg); opacity: .9; }
}
@keyframes egg-curl { 0% { opacity: 0; } 20% { opacity: 1; } 100% { opacity: 1; } }
.egg-reveal {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; padding: 24px; text-align: center; color: var(--white);
  background: radial-gradient(circle at 50% 30%, #c40a45 0%, var(--crimson) 45%, var(--berry) 100%);
}
.egg-reveal h2 { color: var(--white) !important; margin: 4px 0 0; font: 800 22px/1.15 var(--display, sans-serif); letter-spacing: .01em; }
.egg-reveal p { margin: 0; max-width: 300px; font-size: 15px; line-height: 1.45; opacity: .95; }
.egg-reveal .btn { min-width: 210px; text-align: center; text-decoration: none; }
.egg-reveal #eggClose { background: transparent; color: var(--white); border: 1px solid rgba(255,255,255,.6); }
.egg-av { width: 84px !important; height: 84px !important; font-size: 26px; box-shadow: 0 0 0 4px rgba(255,255,255,.85), 0 8px 24px rgba(0,0,0,.35); }
.egg.peeled .egg-reveal > * { animation: egg-pop .5s cubic-bezier(.2,.9,.3,1.3) backwards; animation-delay: 1.5s; }
.egg.peeled .egg-reveal > :nth-child(2) { animation-delay: 1.6s; }
.egg.peeled .egg-reveal > :nth-child(3) { animation-delay: 1.7s; }
.egg.peeled .egg-reveal > :nth-child(n+4) { animation-delay: 1.85s; }
@keyframes egg-pop { from { transform: scale(.6) translateY(12px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .screen.egg-tease .view { animation: none; }
  .egg.peeled .egg-layer { animation: none; display: none; }
  .egg.peeled .egg-reveal > * { animation: none; }
}

/* ---------- 30 Oct: Shaun's review ---------- */
/* Karve: a big featured tile across the top of the home grid */
.app-hero {
  grid-column: 1 / -1; order: -1; flex-direction: row; justify-content: flex-start; gap: 12px;
  padding: 10px 12px; margin: 0 2px 4px; border-radius: 10px;
  background: linear-gradient(135deg, #c81048, var(--crimson) 55%, var(--berry));
  color: var(--white); text-align: left;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 3px 8px rgba(97,4,33,.35);
}
.app-hero:hover, .app-hero:focus-visible { border-color: var(--leaf); background: linear-gradient(135deg, #d8164f, var(--crimson) 55%, var(--berry)); }
.app-hero .ico { width: 54px; height: 54px; border-radius: 12px; background: rgba(255,255,255,.16); box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.5); flex: none; }
.app-hero .ico svg { width: 30px; height: 30px; }
.hero-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.hero-txt b { font: 800 17px/1.15 var(--display); letter-spacing: .01em; }
.hero-txt small { font-size: 12px; opacity: .9; }
.hero-go { font: 700 30px/1 var(--display); opacity: .85; margin-right: 2px; }

/* Party music player, sitting on the home wallpaper */
.home-tv { margin: auto auto 0; width: min(88%, 320px); display: flex; flex-direction: column; gap: 6px; padding-top: 6px; }
.home-tv[hidden] { display: none; }
.tv-frame { position: relative; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: #000; box-shadow: 0 0 0 3px rgba(255,255,255,.85), 0 10px 26px rgba(0,0,0,.4); }
.tv-frame iframe, .tv-frame > div { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.tv-cap { margin: 0; display: flex; align-items: center; justify-content: center; gap: 6px; font: 700 12px/1.2 var(--display); color: var(--white); text-shadow: 0 1px 3px rgba(0,0,0,.4); }
.eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 11px; }
.eq i { width: 3px; background: var(--leaf); border-radius: 1px; animation: eq .8s ease-in-out infinite alternate; }
.eq i:nth-child(2) { animation-delay: .25s; } .eq i:nth-child(3) { animation-delay: .5s; }
@keyframes eq { from { height: 3px; } to { height: 11px; } }
.home-tv:not([hidden]) + .grid { margin-top: 10px; }
@media (prefers-reduced-motion: reduce) { .eq i { animation: none; height: 8px; } .party .scr-home { animation: none; } }

/* Desktop: a taller, wider handset while karving, so the Kanvas has more room */
@media (min-width: 561px) and (min-height: 701px) {
  .on-karve .device { width: min(560px, 92vw); }
  .on-karve .screen { height: max(470px, min(820px, calc(100vh - 170px))); }
  .on-karve .kbd { display: none; }
}
.ico-kollage { background: linear-gradient(#f4633a, #b8401c); }

/* ---------- 3 Nov: Shaun's phone test ---------- */
/* hardware buttons: no iOS long-press highlight, text selection or callout */
.hw-btn, .hw-pad, .app { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
/* native song player */
.home-tv.is-audio .tv-frame { display: none; }
.home-tv.is-audio { margin-top: auto; }
.home-tv.is-audio .tv-cap { align-self: center; padding: 8px 14px 8px 8px; border-radius: 999px; background: rgba(0,0,0,.28); box-shadow: inset 0 0 0 1px rgba(255,255,255,.35); font-size: 13px; }
.song-btn { display: none; width: 34px; height: 34px; border: 0; border-radius: 50%; place-items: center; background: var(--white); color: var(--crimson); cursor: pointer; }
.is-audio .song-btn { display: grid; }
.song-btn svg { width: 16px; height: 16px; fill: currentColor; stroke: currentColor; stroke-width: 3; stroke-linecap: round; }
.song-btn .i-play { display: none; } .paused .song-btn .i-play { display: block; } .paused .song-btn .i-pause { display: none; }
.paused .eq i { animation-play-state: paused; }
#cRemind.btn-call[disabled] { opacity: 1; background: var(--mint-soft); color: var(--emerald-dk); box-shadow: inset 0 0 0 1.5px var(--leaf); }

/* ---------- 3 Nov: user-testing fixes (thumb-sized targets, small phones) ---------- */
.chip { min-height: 38px; padding: 9px 13px; border-radius: 19px; }
.chat-replies { gap: 8px; }
.seg button { padding: 10px 12px; min-height: 36px; }
.help-btn { width: 34px; height: 34px; font-size: 16px; }
.mini { min-height: 32px; padding: 6px 10px; }
.toggle { width: 52px; height: 30px; border-radius: 15px; }
.toggle i { width: 23px; height: 23px; }
.toggle[aria-checked="true"] i { transform: translateX(22px); }
.fs-btn { width: 30px; height: 24px; margin: -4px -6px; }
.boot-tag { color: #ffffff; font-size: 13px; }
/* the how-to card scrolls by finger on small phones, and "Got it" is always visible */
.karve-help { touch-action: pan-y; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
#karveHelpOk { position: sticky; bottom: -12px; flex: none; box-shadow: 0 -10px 12px rgba(255,255,255,.95); }
.check input, .check-sm input { width: 22px; height: 22px; flex: none; }
