:root {
  --bg1: #effbf6;
  --bg2: #eaf4ff;
  --ink: #0f2a2a;
  --muted: #5a6f73;
  --card: #ffffff;
  --line: #dcebe6;
  --green: #0eae74;
  --green-d: #08915f;
  --blue: #0a8bd6;
  --red: #ef4444;
  --red-d: #d22f2f;
  --wa: #25d366;
  --soft: #eef7f3;
  --amber: #f59e0b;
  --shadow: 0 10px 30px rgba(14, 80, 70, .10), 0 2px 6px rgba(14, 80, 70, .06);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  min-height: 100dvh;
  background: radial-gradient(1200px 600px at 100% -10%, #d7f6ea 0, transparent 60%),
              radial-gradient(900px 500px at -10% 110%, #dcecff 0, transparent 60%),
              linear-gradient(160deg, var(--bg1), var(--bg2));
  color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Tahoma, "Noto Sans Arabic", "Noto Sans", Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
[hidden] { display: none !important; }

.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; max-width: 520px; margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-size: 20px; }
.logo { width: 36px; height: 36px; display: block; }
.lang {
  border: 1px solid var(--line); background: rgba(255,255,255,.8); color: var(--ink);
  border-radius: 999px; padding: 7px 14px; font: inherit; font-size: 14px; cursor: pointer;
}

main { max-width: 520px; margin: 0 auto; padding: 0 16px 32px; }
.view { display: flex; flex-direction: column; gap: 16px; }

.hero { text-align: center; padding: 18px 4px 4px; }
.hero-badge {
  width: 76px; height: 76px; margin: 0 auto 14px; border-radius: 24px; display: grid; place-items: center;
  color: #fff; background: linear-gradient(135deg, #14c08a, #0a8bd6); box-shadow: 0 12px 28px rgba(10,139,214,.28);
}
.hero-badge svg { width: 38px; height: 38px; }
h1 { font-size: 26px; line-height: 1.3; margin: 0 0 8px; }
.sub { color: var(--muted); margin: 0; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 22px;
  padding: 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  border: 0; border-radius: 16px; padding: 13px 18px; font: inherit; font-weight: 600;
  text-decoration: none; cursor: pointer; user-select: none; min-height: 50px;
  transition: transform .08s ease, filter .15s ease, background .15s ease;
}
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .6; cursor: default; }
.btn.big { min-height: 60px; font-size: 18px; border-radius: 18px; }
.btn.primary { color: #fff; background: linear-gradient(135deg, var(--green), #0b9fb0); box-shadow: 0 10px 22px rgba(14,174,116,.30); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.soft { background: var(--soft); color: var(--ink); border: 1px solid var(--line); }
.btn.wa { background: var(--wa); color: #fff; }
.btn svg { width: 24px; height: 24px; }
.btn.call svg { width: 26px; height: 26px; }

.row2 { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 10px; }
.okline { margin: 0; font-weight: 600; color: var(--green-d); }
.tick { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #d8f7ea; }
.linkbox {
  background: #f6fbf9; border: 1px dashed #bfe3d5; border-radius: 14px; padding: 12px 14px;
  font: 15px/1.4 ui-monospace, Menlo, Consolas, monospace; word-break: break-all; text-align: left;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 600; font-size: 14px; }
.field input {
  font: inherit; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: #fbfefd;
}
.err { margin: 0; color: var(--red-d); font-weight: 600; }
.hint { margin: 0; color: var(--muted); font-size: 14px; text-align: center; }

.feats { list-style: none; padding: 0; margin: 4px 0 0; display: grid; gap: 8px; }
.feats li {
  display: flex; align-items: center; gap: 12px; background: rgba(255,255,255,.7);
  border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px;
}
.fi { font-size: 20px; }

/* ---------- call ---------- */
.stage { text-align: center; padding: 26px 0 6px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.orb { position: relative; width: 170px; height: 170px; margin-bottom: 14px; display: grid; place-items: center; }
.orb-core {
  position: relative; z-index: 2; width: 116px; height: 116px; border-radius: 50%;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, #14c08a, #0a8bd6); box-shadow: 0 16px 34px rgba(10,139,214,.30);
  transition: background .3s ease;
}
.orb-core svg { width: 52px; height: 52px; }
.ring { position: absolute; inset: 27px; border-radius: 50%; border: 3px solid rgba(14,174,116,.35); opacity: 0; }
.orb[data-state="waiting"] .ring, .orb[data-state="connecting"] .ring { animation: pulse 2.4s ease-out infinite; }
.orb[data-state="waiting"] .r2, .orb[data-state="connecting"] .r2 { animation-delay: .8s; }
.orb[data-state="waiting"] .r3, .orb[data-state="connecting"] .r3 { animation-delay: 1.6s; }
.orb[data-state="connected"] .ring { inset: 18px; opacity: 1; border-color: rgba(14,174,116,.25); transform: scale(var(--lvl, 1)); transition: transform .12s linear; }
.orb[data-state="connected"] .r2, .orb[data-state="connected"] .r3 { display: none; }
.orb[data-state="reconnecting"] .orb-core { background: linear-gradient(135deg, #f7b733, #f59e0b); }
.orb[data-state="reconnecting"] .ring { border-color: rgba(245,158,11,.35); animation: pulse 1.6s ease-out infinite; }
.orb[data-state="ended"] .orb-core, .orb[data-state="error"] .orb-core { background: linear-gradient(135deg, #9fb3b8, #7d9399); box-shadow: none; }
@keyframes pulse { 0% { transform: scale(1); opacity: .9; } 100% { transform: scale(1.75); opacity: 0; } }

h2 { margin: 0; font-size: 24px; line-height: 1.35; }
.timer { font: 600 22px/1 ui-monospace, Menlo, Consolas, monospace; color: var(--green-d); direction: ltr; margin-top: 4px; }
.quality { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); background: rgba(255,255,255,.75); border: 1px solid var(--line); padding: 6px 12px; border-radius: 999px; }
.bars { display: inline-flex; align-items: flex-end; gap: 3px; height: 16px; direction: ltr; }
.bars i { width: 4px; border-radius: 2px; background: #cfdcd8; display: block; }
.bars i:nth-child(1) { height: 5px; } .bars i:nth-child(2) { height: 8px; } .bars i:nth-child(3) { height: 12px; } .bars i:nth-child(4) { height: 16px; }
.bars[data-q="4"] i, .bars[data-q="3"] i:nth-child(-n+3) { background: var(--green); }
.bars[data-q="2"] i:nth-child(-n+2) { background: var(--amber); }
.bars[data-q="1"] i:nth-child(1) { background: var(--red); }

.actions { display: flex; flex-direction: column; gap: 12px; margin-top: 6px; }
.controls { display: flex; justify-content: center; gap: 34px; margin-top: 14px; }
.round {
  width: 84px; display: flex; flex-direction: column; align-items: center; gap: 8px;
  border: 0; background: none; font: inherit; font-size: 14px; color: var(--ink); cursor: pointer; padding: 0;
}
.round svg { width: 72px; height: 72px; padding: 20px; border-radius: 50%; box-sizing: border-box; transition: background .15s ease, transform .08s ease; }
.round:active svg { transform: scale(.95); }
.round.soft svg { background: #fff; color: var(--ink); border: 1px solid var(--line); box-shadow: var(--shadow); }
.round.danger svg { background: var(--red); color: #fff; box-shadow: 0 10px 22px rgba(239,68,68,.35); }
.round .ic-off { display: none; }
.round[aria-pressed="true"] .ic-mic { display: none; }
.round[aria-pressed="true"] .ic-off { display: block; background: #1f2f33; color: #fff; border-color: #1f2f33; }

@media (max-width: 360px) {
  h1 { font-size: 22px; }
  .orb { width: 150px; height: 150px; }
  .orb-core { width: 100px; height: 100px; }
}
@media (prefers-reduced-motion: reduce) { .ring { animation: none !important; } }
