:root {
  --ink: #172a29;
  --muted: #3c5655;
  --line: #b7c9c4;
  --paper: #edf3ee;
  --selection: #d3e6de;
  --font: Tahoma, Verdana, "Segoe UI", sans-serif;
  --rim: clamp(14px, 3.4svh, 31px);
  --half-height: clamp(180px, calc(48svh - 12px), 372px);
  --lcd-height: max(134px, calc(var(--half-height) - clamp(55px, 12svh, 86px)));
  --control-height: clamp(46px, 10.4svh, 83px);
  --key-gap: clamp(4px, .82svh, 8px);
  --text-size: clamp(1rem, 2.2svh, 1.16rem);
  --small-size: clamp(.79rem, 1.9svh, .9rem);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: clamp(6px, 1.35svh, 15px) clamp(8px, 3vw, 22px);
  background:
    radial-gradient(ellipse at 50% 48%, #53847828, transparent 46%),
    radial-gradient(ellipse at 79% 9%, #31575870, transparent 46%),
    radial-gradient(ellipse at 17% 97%, #78513769, transparent 45%),
    repeating-linear-gradient(117deg, #dae7d804 0 1px, transparent 1px 7px),
    linear-gradient(154deg, #151e20, #10191a 47%, #1c1915);
  font: 1rem/1.48 var(--font);
}
body.transparent-stage { background: transparent; }
noscript { color: #e5eee7; }
.transparent-stage noscript { color: var(--ink); }
button, input, textarea { font: inherit; }
button { cursor: pointer; color: inherit; }
button:focus-visible, input:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid #e8ab68; outline-offset: -2px;
}
.handset {
  width: min(100%, clamp(215px, calc(var(--half-height) + 32px), 390px));
  border-radius: 38px;
  isolation: isolate;
  filter: drop-shadow(0 3px 4px #0008) drop-shadow(0 20px 26px #050909a8);
}
.transparent-stage .handset { filter: drop-shadow(0 5px 10px #0006); }
.handset[data-power="off"] .lcd {
  border-color: #33423a;
  background: linear-gradient(150deg, #25322c 0%, #171f1b 43%, #111815 100%);
  box-shadow: inset 0 2px 6px #0e15128a, inset 0 0 0 1px #b6c4ac16;
}
.handset[data-power="booting"] .lcd {
  background: repeating-linear-gradient(0deg, #203f3013 0 1px, transparent 1px 3px), #cdddc1;
}
.handset:not([data-power="on"]) :is(.status, .soft-labels) { visibility: hidden; }
.boot-display {
  display: grid;
  place-content: center;
  gap: .55rem;
  flex: 1;
  text-align: center;
  color: #233e32;
  font: 700 clamp(.85rem, 2.4svh, 1.16rem)/1.2 var(--font);
  letter-spacing: .02em;
}
.boot-progress {
  display: block;
  width: clamp(72px, 17svh, 122px);
  height: 6px;
  overflow: hidden;
  border: 1px solid #6b826a;
  border-radius: 2px;
  background: #e2ecd8;
}
.boot-progress::after {
  display: block;
  height: 100%;
  background: #42644c;
  content: "";
  transform-origin: left;
  animation: boot-progress .8s cubic-bezier(.28,.65,.34,1) both;
}
@keyframes boot-progress {
  from { transform: scaleX(.04); }
  to { transform: scaleX(1); }
}
@media (prefers-reduced-motion: reduce) {
  .boot-progress::after { animation: none; }
}
.lid, .base {
  height: var(--half-height);
  border: 1px solid #74847e;
  background:
    linear-gradient(167deg, #e1c49b15, transparent 37%),
    linear-gradient(112deg, #5d706b 0%, #394c47 12%, #263733 36%, #33453f 71%, #172623 100%);
  box-shadow: inset 0 1px 2px #e6f4eb5c, inset 0 -2px 2px #0f201ae6, inset 0 0 0 4px #14211e55;
}
.lid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 7px auto;
  align-content: center;
  gap: clamp(8px, 1.5svh, 14px);
  border-radius: 12% 12% 5% 5%;
  padding: 0 var(--rim) 4px;
}
.earpiece {
  width: clamp(39px, 7.8svh, 68px); height: 7px; border-radius: 8px; margin: 0 auto;
  background: repeating-linear-gradient(90deg, #132520 0 2px, #5d7168 2px 3px);
  border: 1px solid #1d3129; box-shadow: 0 1px 0 #9fb3aa75;
}
.bezel {
  min-width: 0;
  border-radius: 12px; padding: clamp(5px, .8svh, 8px); background: #101e1c;
  box-shadow: 0 1px 1px #b4c8bd61, inset 0 2px 4px #060e0d;
}
.lcd {
  height: var(--lcd-height); min-width: 0; overflow: hidden;
  display: flex; flex-direction: column; border: 1px solid #81948a; border-radius: 6px;
  color: var(--ink); background: var(--paper); color-scheme: light;
  box-shadow: inset 0 0 0 1px #f6fdf7bd;
}
.status {
  display: flex; align-items: center; gap: 5px; padding: 1px 9px;
  flex: 0 0 clamp(15px, 2.5svh, 22px);
  border-bottom: 1px solid #a2b8ab; color: #2b483c;
  background: linear-gradient(#dce9dd, #bfd2c5);
  font: 700 .68rem/1 var(--font); letter-spacing: .03em;
}
.reception { display: inline-flex; align-items: end; gap: 2px; height: 9px; }
.reception i { display: block; width: 2px; background: #345747; }
.reception i:nth-child(1) { height: 3px; }.reception i:nth-child(2) { height: 5px; }
.reception i:nth-child(3) { height: 7px; }.reception i:nth-child(4) { height: 9px; }
.battery {
  margin: 0 3px 0 auto; width: 14px; height: 7px; padding: 1px; border: 1px solid #345747;
  background: linear-gradient(90deg,#345747 76%,transparent 76%) content-box; position: relative; border-radius: 1px;
}
.battery::after { content: ""; height: 3px; width: 2px; background: #345747; position: absolute; right: -3px; top: 1px; }
.screen { min-height: 0; flex: 1; display: flex; flex-direction: column; }
.screen-title {
  margin: 0; padding: clamp(3px, .7svh, 7px) 10px;
  background: linear-gradient(#51766a, #32564d);
  color: #fcfff9; font-size: var(--text-size); font-weight: 700; line-height: 1.28;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.screen-body {
  min-height: 0; flex: 1; overflow: auto; overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: #819e91 #e4eee6;
}
.screen-tabs { display: grid; grid-template-columns: repeat(2, 1fr); background: #dce9e0; border-bottom: 1px solid var(--line); }
.screen-tabs button { border: 0; background: transparent; padding: 4px 6px; color: #294947; font-size: var(--small-size); font-weight: 700; }
.screen-tabs button[aria-current="page"] { color: #183330; background: #f0f7f1; box-shadow: inset 0 -2px #537f71; }
.screen-row {
  display: block; width: 100%; min-height: 32px; text-align: left;
  border: 0; border-bottom: 1px solid var(--line); padding: 7px 10px;
  color: var(--ink); background: none; line-height: 1.3;
}
.screen-row:hover, .screen-row.is-focused { background: var(--selection); }
.screen-row strong { display: block; font-size: var(--text-size); overflow-wrap: anywhere; }
.screen-row small {
  display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  font-size: var(--small-size); color: var(--muted); margin-top: 2px;
}
.message {
  display: block; width: 100%; text-align: left; padding: 6px 10px 7px; border: 0;
  border-bottom: 1px solid var(--line); background: transparent; color: var(--ink);
  overflow-wrap: anywhere;
}
.message.outgoing { background: #e0ebe2; }
.message.is-focused, button.message:hover { background: var(--selection); }
.message .sender { display: block;
  color: #315b51; font-size: var(--small-size); font-weight: 700; margin: 0 0 3px;
  line-height: 1.25;
}
.message .line { display: block; margin: 0; white-space: pre-wrap; font-size: var(--text-size); line-height: 1.4; }
.message .line + .line { margin-top: 5px; }
.reading { padding: 9px 10px; font-size: var(--text-size); overflow-wrap: anywhere; }
.reading p { margin: 0 0 7px; white-space: pre-wrap; }
.reading p:last-child { margin-bottom: 0; }
.call-time { padding: 4px 10px; background: #dce9e0; border-bottom: 1px solid var(--line); color: var(--muted); font-size: var(--small-size); font-weight: 600; }
.soft-labels {
  flex: 0 0 clamp(22px, 3.1svh, 27px); display: flex; justify-content: space-between;
  background: linear-gradient(#e3eee5, #c8dcd0); border-top: 1px solid #aac0b3;
}
.soft-labels button {
  min-width: 67px; padding: 1px 10px; background: none; border: 0;
  color: #20453b; font: 700 var(--small-size)/1.2 var(--font);
}
.soft-labels button:first-child { text-align: left; }.soft-labels button:last-child { text-align: right; }
.soft-labels button:hover { background: #c3ded0; }
.hinge {
  display: flex; height: clamp(9px, 2svh, 15px); margin: -1px clamp(15px, 3.3svh, 28px);
  overflow: hidden; border: 1px solid #23362f; border-radius: 4px;
  background: linear-gradient(#1a2b26, #75897e 38%, #435a50 60%, #192b25);
}
.hinge i { flex: 1; border-right: 1px solid #23382e; }
.hinge i:nth-child(2) { flex: 2.6; background: #11291d50; }
.base {
  display: grid;
  grid-template-rows: var(--control-height) minmax(0, 1fr) 3px;
  gap: var(--key-gap);
  border-radius: 5% 5% 12% 12%;
  padding: clamp(10px, 2.1svh, 19px) var(--rim) clamp(9px, 1.7svh, 16px);
}
.controls {
  display: grid; grid-template-columns: minmax(0, 1fr) clamp(57px, 11svh, 96px) minmax(0, 1fr);
  gap: clamp(5px, 1.2svh, 10px); align-items: stretch;
}
.side-keys { display: grid; min-height: 0; grid-template-rows: 1fr 1fr; gap: var(--key-gap); }
.key, .digit {
  min-height: 0; padding: 0; display: grid; place-items: center;
  border: 1px solid #1b2b26; border-radius: clamp(6px, 1.3svh, 10px);
  background: linear-gradient(#5f746c, #3c5149 76%, #2d4239); color: #f5faf2;
  box-shadow: inset 0 1px 1px #d2e8d973, 0 2px 2px #0e2019bf;
}
.key.soft { background: linear-gradient(#899e94, #536a60); }
.key.soft span { font: 700 var(--small-size)/1 var(--font); }
.key.dial { color: #d1f6b8; }
.receiver {
  display: block; width: clamp(14px, 2.4svh, 21px); height: 8px; border: 2px solid currentColor;
  border-bottom: 0; border-radius: 8px 8px 3px 3px;
}
.key:hover, .digit:hover, .dpad button:hover { filter: brightness(1.19); }
.key:active, .digit:active, .dpad button:active { transform: translateY(1px); }
.key.power {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(3px, .75svh, 7px);
  color: #ffd2be;
}
.power-symbol {
  position: relative;
  width: clamp(10px, 2.1svh, 16px);
  aspect-ratio: 1;
  border: 1.5px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
}
.power-symbol::after {
  position: absolute;
  left: 50%;
  top: -1px;
  width: 1.5px;
  height: 55%;
  border-radius: 2px;
  background: currentColor;
  content: "";
  transform: translateX(-50%);
}
.power-label { font: 700 var(--small-size)/1 var(--font); }
.handset:not([data-power="off"]) .power-label { display: none; }
.handset[data-power="off"] .key.power {
  border-color: #603e37;
  background: linear-gradient(#754d43, #453631);
}
.handset:not([data-power="on"]) :is(.key, .digit, .dpad button):disabled {
  cursor: default;
  filter: brightness(.8);
}
.key.power[aria-disabled="true"] { cursor: progress; }
.dpad {
  display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); min-height: 0; gap: 1px;
  padding: 3px; background: linear-gradient(#879d92, #4a6559);
  border: 1px solid #20372d; border-radius: 14px;
  box-shadow: inset 0 1px 0 #dcece287, 0 2px 3px #0b1b15cf;
}
.dpad button { display: grid; min-height: 0; place-items: center; padding: 0; border: 0; background: #172f255e; border-radius: 4px; color: #f1f8f2; }
.dpad span { width: 0; height: 0; border: 3px solid transparent; }
.dpad .north { grid-area: 1 / 2; }.dpad .north span { border-bottom-color: #e8f4eb; transform: translateY(-2px); }
.dpad .west { grid-area: 2 / 1; }.dpad .west span { border-right-color: #e8f4eb; transform: translateX(-2px); }
.dpad .ok { grid-area: 2 / 2; background: #c2d7ca; color: #213e32; font: 700 var(--small-size)/1 var(--font); }
.dpad .east { grid-area: 2 / 3; }.dpad .east span { border-left-color: #e8f4eb; transform: translateX(2px); }
.dpad .south { grid-area: 3 / 2; }.dpad .south span { border-top-color: #e8f4eb; transform: translateY(2px); }
.keypad { display: grid; grid-template: repeat(4, minmax(0, 1fr)) / repeat(3, minmax(0, 1fr)); gap: var(--key-gap); }
.digit {
  display: flex; justify-content: center; align-items: center; gap: clamp(4px, 1svh, 9px);
  font: 700 clamp(.94rem, 2.55svh, 1.3rem)/1 var(--font);
}
.digit span { min-width: 2.6ch; color: #dfede4; font-weight: 400; font-size: clamp(.64rem, 1.5svh, .79rem); }
.microphone { height: 3px; width: 20px; border-radius: 4px; margin: 0 auto; background: #10211b; box-shadow: 0 1px #7f9b8985; }
.screen[data-view="menu"] .screen-body { overflow: hidden; }
.phone-menu {
  display: grid;
  grid-template: repeat(2, minmax(0, 1fr)) / repeat(3, minmax(0, 1fr));
  height: 100%;
  padding: clamp(2px, .75svh, 7px);
  gap: clamp(2px, .6svh, 6px);
  background: linear-gradient(160deg, #f8faf3, #deebe2);
}
.menu-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  gap: clamp(0px, .3svh, 3px);
  border: 1px solid #aebfb4;
  border-radius: 4px;
  padding: 1px 2px;
  background: linear-gradient(#f7faf4, #e0ebe0);
  color: #223f35;
  font: 700 clamp(.69rem, 1.95svh, .96rem)/1.12 var(--font);
  text-align: center;
  text-decoration: none;
}
.menu-item:hover, .menu-item.is-focused { background: #c9e2d4; border-color: #709285; }
.menu-item:focus-visible { outline: 2px solid #587b6b; outline-offset: -2px; }
.menu-item[data-sheet] { grid-column: span 2; }
.menu-icon {
  color: #346554;
  font: 700 clamp(.89rem, 3.8svh, 1.65rem)/1 "Segoe UI Symbol", var(--font);
}
.contact-group h2 {
  position: sticky;
  top: 0;
  z-index: 1;
  margin: 0;
  border-bottom: 1px solid #aebfb4;
  padding: 4px 8px;
  background: #d5e4d9;
  color: #2b4840;
  font: 700 var(--small-size)/1.2 var(--font);
}
.contact-group ul { list-style: none; margin: 0; padding: 0; }
.contact-entry {
  display: flex;
  min-height: 41px;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border-bottom: 1px solid var(--line);
  font-size: var(--text-size);
  line-height: 1.2;
}
.contact-entry strong { overflow-wrap: anywhere; min-width: 0; }
.contact-photo {
  flex: none;
  width: clamp(30px, 5.7svh, 43px);
  aspect-ratio: 1;
  background: #a7bbb0 url("portraits.webp?v=7") var(--portrait-x) var(--portrait-y) / 500% 400% no-repeat;
  border-radius: 3px;
  outline: 1px solid #31554c33;
  outline-offset: -1px;
}
.contact-number {
  flex: none;
  margin-left: auto;
  color: #28603d;
  font: 700 1rem/1 "Segoe UI Symbol", var(--font);
}
.soft-labels button:disabled { visibility: hidden; }
@media (max-width: 245px) {
  :root { --rim: 12px; }
  .controls { grid-template-columns: minmax(0, 1fr) 54px minmax(0, 1fr); gap: 4px; }
}

