:root {
  --bg0: #1a1410;
  --bg1: #2a2118;
  --ink: #f4efe6;
  --muted: #cbbba6;
  --accent: #d97706;
  --danger: #b91c1c;
  --line: rgba(244, 239, 230, 0.12);
  --you: #3f2e1e;
  --bot: #1f2a24;
  --font-ui: "Segoe UI", "Noto Nastaliq Urdu", "Noto Sans Arabic", Tahoma, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(1200px 600px at 50% -10%, #4a3420 0%, transparent 55%),
    linear-gradient(180deg, #120e0b, #1a1410 40%, #0d0a08);
  color: var(--ink);
  font-family: var(--font-ui);
}

body {
  display: grid;
  place-items: center;
  padding: 16px;
}

.phone {
  width: min(420px, 100%);
  min-height: min(760px, 100dvh);
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.04), transparent 30%),
    var(--bg1);
  box-shadow: 0 30px 80px rgba(0,0,0,0.45);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.top {
  padding: 22px 22px 8px;
  text-align: center;
}

.brand {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  direction: rtl;
}

.sub {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 4px;
}

.status-block {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 8px 22px 14px;
  border-bottom: 1px solid var(--line);
}

.status {
  font-size: 1.05rem;
  font-weight: 600;
}

.timer {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.transcript {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bubble {
  max-width: 92%;
  padding: 10px 12px;
  border-radius: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.bubble.you {
  align-self: flex-end;
  background: var(--you);
}

.bubble.bot {
  align-self: flex-start;
  background: var(--bot);
}

.bubble .who {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 4px;
}

.bubble.rtl {
  direction: rtl;
  text-align: right;
}

.controls {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 10px;
  padding: 16px;
  border-top: 1px solid var(--line);
  background: rgba(0,0,0,0.18);
}

.btn {
  border: 1px solid var(--line);
  background: #3a2d22;
  color: var(--ink);
  border-radius: 12px;
  padding: 14px 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn.primary {
  background: var(--accent);
  color: #1a1008;
  border-color: transparent;
}

.btn.danger {
  background: var(--danger);
  border-color: transparent;
}

#remoteAudio { display: none; }
