:root {
  color-scheme: light;
  --bg: #f3efe6;
  --bg-2: #e6dfd2;
  --surface: rgba(255, 252, 247, 0.9);
  --ink: #1a1612;
  --muted: #5a534a;
  --line: rgba(26, 22, 18, 0.14);
  --accent: #8c3b1c;
  --accent-ink: #fffaf6;
  --good: #145c3e;
  --danger: #8d1d2c;
  --focus: #1a1612;
  --shadow: 0 30px 70px rgba(48, 28, 12, 0.12);
  --radius: 28px;
  --font: "Avenir Next", "Segoe UI", sans-serif;
  --display: "Iowan Old Style", Palatino, "Palatino Linotype", Georgia, serif;
  --tap: 44px;
  --text: 100%;
  --space: 1;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  --bg: #f2f2f7;
  --bg-2: #f2f2f7;
  --surface: #ffffff;
  --ink: #1c1c1e;
  --muted: #3a3a3c;
  --line: rgba(60, 60, 67, 0.18);
  --good: #146c2e;
  --danger: #d70015;
}
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000000;
  --bg-2: #000000;
  --surface: #1c1c1e;
  --ink: #f5f5f7;
  --muted: #d1d1d6;
  --line: rgba(255, 255, 255, 0.16);
  --accent: #ffb3c0;
  --accent-ink: #1c1c1e;
  --good: #30d158;
  --danger: #ff453a;
  --focus: #f5f5f7;
  --shadow: none;
}
[data-contrast="high"] {
  --bg: #fff;
  --bg-2: #fff;
  --surface: #fff;
  --ink: #000;
  --muted: #1a1a1a;
  --line: #000;
  --accent: #6f2200;
  --accent-ink: #fff;
  --good: #044a28;
  --danger: #6d0010;
  --focus: #000;
}
[data-theme="dark"][data-contrast="high"] {
  --bg: #000;
  --bg-2: #000;
  --surface: #000;
  --ink: #fff;
  --muted: #f3f3f3;
  --line: #fff;
  --accent: #ffd7bd;
  --accent-ink: #000;
  --good: #c8ffe4;
  --danger: #ffd0d6;
  --focus: #fff;
}
[data-font="readable"] {
  --font: Verdana, "Trebuchet MS", sans-serif;
  --display: Verdana, sans-serif;
  --space: 1.04;
}
html { font-size: var(--text); scroll-padding-bottom: calc(10rem + env(safe-area-inset-bottom)); }
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; min-height: 100dvh; }
body {
  font-family: var(--font);
  letter-spacing: calc((var(--space) - 1) * 0.02em);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.35;
}
button, input, select { font: inherit; color: inherit; touch-action: manipulation; }
button { min-height: var(--tap); min-width: var(--tap); }
input, select, textarea { font-size: max(16px, 1rem); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.skip {
  position: absolute; left: 12px; top: -40px; background: var(--accent); color: var(--accent-ink);
  padding: 8px 12px; z-index: 5;
}
.skip:focus { top: 12px; }
.shell {
  max-width: 480px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column;
  padding: max(20px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) calc(10rem + env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
}
.top { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 18px; }
.brand { font-family: var(--display); font-size: 1.7rem; line-height: 1; letter-spacing: -0.03em; }
.brand small { display: block; margin-top: 6px; font-family: var(--font); font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.balance-pill {
  border: 1px solid var(--line); background: var(--surface); border-radius: 999px;
  padding: 10px 14px; text-decoration: none; color: inherit; min-height: var(--tap);
  display: inline-flex; align-items: center;
}
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px;
}
label { display: block; font-size: 0.92rem; margin: 14px 0 6px; }
input, select {
  width: 100%; min-height: var(--tap); border-radius: 16px; border: 1px solid var(--line);
  background: transparent; padding: 0 14px;
}
.primary, .ghost, .danger {
  width: 100%; border-radius: 18px; border: 0; margin-top: 14px; padding: 0 16px; cursor: pointer;
}
.primary { background: var(--accent); color: var(--accent-ink); }
.ghost { background: transparent; border: 1px solid var(--line); }
.danger { background: var(--danger); color: #fff; }
[data-theme="dark"] .danger { color: #1a0a0d; }
.check { display: flex; gap: 12px; align-items: flex-start; margin-top: 16px; }
.check input { width: 24px; height: 24px; min-height: 24px; margin-top: 4px; }
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: space-around; gap: 0;
  padding: 6px max(8px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid var(--line);
}
.nav a, .nav button {
  text-decoration: none; color: var(--muted); background: transparent; border: 0; border-radius: 12px;
  min-width: 44px; min-height: 44px; width: auto; margin: 0; padding: 4px 6px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 0.68rem; line-height: 1.1;
}
.tab-icon { width: 26px; height: 22px; display: flex; }
.tab-icon svg { width: 24px; height: 22px; }
.nav [aria-current="page"], .nav [aria-current="page"] .tab-icon { color: var(--good); }
.nav [aria-current="page"] { background: var(--surface); }
.list { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; max-height: 50dvh; overflow: auto; }
.list button, .menu a {
  text-align: start; background: transparent; border: 1px solid var(--line); border-radius: 16px;
  padding: 12px 14px; text-decoration: none; color: inherit; display: flex; justify-content: space-between; width: 100%;
}
.flag-img { width: 24px; height: 18px; object-fit: cover; display: block; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.18); }
.lang-row, .number-row { position: relative; z-index: 1; }
.lang-row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px; align-items: stretch; }
.lang-pick, .swap, .sheet-close { width: auto; margin-top: 0; }
.lang-pick {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center;
  gap: 2px; min-width: 0; text-align: start; padding: 10px 12px; border-radius: 18px;
  border: 1px solid var(--line); background: transparent; white-space: normal;
}
.lang-copy { display: flex; flex-direction: column; min-width: 0; }
.lang-copy .role, .lang-copy small { color: var(--muted); font-size: 0.78rem; }
.lang-copy .lang-en, .lang-copy small { white-space: normal; line-height: 1.15; }
.swap {
  width: 48px; min-width: 48px; padding: 0; border-radius: 16px; border: 1px solid var(--line); background: transparent;
}
.number-row {
  display: flex; align-items: center; gap: 8px; min-height: 48px;
  border: 1px solid var(--line); border-radius: 16px; padding-inline: 4px 12px;
}
.country-pick {
  display: inline-flex; align-items: center; gap: 6px; width: auto; margin: 0; padding: 0 10px;
  border: 0; background: transparent; flex: none; font-variant-numeric: tabular-nums;
}
.number-row input { border: 0; background: transparent; min-width: 0; flex: 1; padding: 0; }
body.sheet-open { overflow: hidden; }
.sheet {
  position: fixed; z-index: 40; inset: 0; background: rgba(0, 0, 0, 0.36);
  display: flex; align-items: flex-end; color: var(--ink);
}
.sheet-panel {
  width: 100%; max-height: 92dvh; min-height: 70dvh; background: var(--bg); color: var(--ink);
  border-radius: 16px 16px 0 0; display: flex; flex-direction: column;
  padding: 8px 16px calc(12px + env(safe-area-inset-bottom));
  transition: transform .45s cubic-bezier(.2, .9, .2, 1);
}
.grabber {
  width: 36px; height: 5px; min-height: 5px; min-width: 36px; margin: 4px auto 8px; padding: 10px 0;
  border: 0; border-radius: 999px; background: transparent; position: relative;
}
.grabber::before {
  content: ""; position: absolute; left: 0; right: 0; top: 12px; height: 5px; border-radius: 999px; background: var(--muted);
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sheet-head h2 { margin: 0; font-size: 1.35rem; }
.sheet-close { width: auto; padding: 0 14px; }
.sheet input { margin: 12px 0; }
#lang-list { flex: 1; min-height: 0; overflow: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.sheet-options { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.sheet-options button {
  text-align: start; background: transparent; border: 1px solid var(--line); border-radius: 16px;
  padding: 12px 14px; display: flex; align-items: center; gap: 10px; width: 100%;
}
.section-label { margin: 16px 0 6px; color: var(--muted); font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; }
.lang-option { align-items: center; gap: 10px; }
.lang-option .mark { width: 1.2rem; margin-inline-start: auto; color: var(--accent); font-size: 1.1rem; }
.lang-option[aria-selected="true"] { border-color: var(--accent); }
.call-screen { min-height: 70dvh; display: flex; flex-direction: column; justify-content: space-between; }
.orb {
  width: 148px; height: 148px; margin: 12px auto; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff 0, var(--accent) 42%, transparent 70%);
  box-shadow: 0 0 0 14px color-mix(in srgb, var(--accent) 18%, transparent);
}
[data-motion="on"] .orb { animation: breathe 3.6s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.04); } }
.timer { font-variant-numeric: tabular-nums; font-size: 3.4rem; font-weight: 300; text-align: center; font-family: var(--display); margin: 8px 0; letter-spacing: -0.03em; }
.meters { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.meters div { border: 1px solid var(--line); border-radius: 16px; padding: 10px; }
.meters span { display: block; color: var(--muted); font-size: 0.78rem; }
.controls { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.pad button { border-radius: 18px; border: 1px solid var(--line); background: var(--surface); font-size: 1.3rem; }
.warn { border-color: var(--danger); }
.footer { position: relative; z-index: 1; margin-top: 22px; margin-bottom: 12px; color: var(--muted); font-size: 0.85rem; }
.banner {
  position: sticky; bottom: 84px; margin: 12px auto; max-width: 480px; background: var(--ink); color: var(--bg);
  border-radius: 16px; padding: 12px 14px; display: flex; gap: 12px; align-items: center;
}
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
[data-motion="off"] *, [data-motion="off"] *::before, [data-motion="off"] *::after {
  animation: none !important; transition: none !important;
}
.large-bar {
  position: sticky; top: 0; z-index: 5; margin: 0 -18px 8px; padding: 8px 18px 10px;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
}
.large-bar-inner { display: flex; align-items: flex-end; gap: 10px; }
.brand-mark { width: 36px; height: 36px; flex: none; }
.large-kicker { margin: 0; color: var(--muted); font-size: 0.75rem; letter-spacing: 0.04em; }
.large-title { margin: 0; font-size: 2rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1.05; font-family: var(--display); }
.large-bar.compact .large-title { font-size: 1.15rem; }
.large-bar.compact .large-kicker { display: none; }
.balance-pill { margin-left: auto; align-self: center; font-weight: 600; }
.card, .group { border-radius: 12px; }
.login-lockup { width: min(100%, 320px); height: auto; display: block; margin: 12px auto 18px; }
#start.call-go, .call-go {
  background: var(--good); color: #fff; border-radius: 999px; font-weight: 600; min-height: 52px;
}
#start.call-go:disabled { background: #d1d1d6; color: #3a3a3c; }
[data-theme="dark"] #start.call-go:disabled { background: #3a3a3c; color: #d1d1d6; }
.dial-pad, .pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 14px 0; justify-items: center; }
.round-key {
  width: 74px; height: 74px; min-width: 74px; min-height: 74px; border-radius: 50%;
  border: 0; background: var(--surface); font-size: 1.7rem; box-shadow: inset 0 0 0 1px var(--line);
}
.text-btn { width: auto; min-width: 44px; margin: 8px 0 0; background: transparent; border: 0; color: var(--good); font-weight: 600; }
.call-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 16px; }
.round-action {
  min-height: 64px; border-radius: 18px; border: 0; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line);
  font-size: 0.75rem; padding: 8px;
}
.round-action.on { background: var(--ink); color: var(--bg); }
.round-action.end, #hang.end { background: var(--danger); color: #fff; }
.bubbles { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; max-height: 28dvh; overflow: auto; }
.bubble { margin: 0; max-width: 85%; padding: 8px 12px; border-radius: 16px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.bubble.mine { align-self: flex-end; }
.bubble.theirs { align-self: flex-start; }
.balance-hero { font-size: 3rem; font-weight: 700; letter-spacing: -0.03em; margin: 8px 0; font-variant-numeric: tabular-nums; }
.balance-minutes { color: var(--muted); }
.topup-actions { display: flex; flex-direction: column; gap: 8px; }
.recents { list-style: none; margin: 0; padding: 0; background: var(--surface); border-radius: 12px; overflow: hidden; }
.recent { border-bottom: 1px solid var(--line); }
.recent-main {
  width: 100%; margin: 0; border: 0; background: transparent; display: flex; gap: 10px; align-items: center;
  text-align: start; padding: 10px 14px; min-height: 60px;
}
.recent-main span { display: flex; flex-direction: column; min-width: 0; }
.recent-main small { color: var(--muted); }
.empty { color: var(--muted); }
