/* The support page. One column, built for a phone first. Light and dark follow the device. */
:root {
  --bg: #f4f6fa;
  --panel: #ffffff;
  --ink: #101828;
  --muted: #667085;
  --line: #e4e7ec;
  --accent: #2563eb;
  --accent-ink: #ffffff;
  --mine: #2563eb;
  --mine-ink: #ffffff;
  --theirs: #ffffff;
  --ok: #067647;
  --ok-bg: #ecfdf3;
  --ok-line: #abefc6;
  --danger: #d92d20;
  --glow-a: #38bdf8;
  --glow-b: #6366f1;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 6px 20px rgba(16, 24, 40, 0.06);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1220;
    --panel: #111a2e;
    --ink: #e6ecf7;
    --muted: #93a0b8;
    --line: #22304d;
    --accent: #5b9dff;
    --accent-ink: #06122b;
    --mine: #2f6df2;
    --theirs: #15203a;
    --ok: #75e0a7;
    --ok-bg: #0c2a20;
    --ok-line: #1c5a41;
    --danger: #f97066;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 26px rgba(0, 0, 0, 0.35);
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--ink); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Devanagari", sans-serif; -webkit-font-smoothing: antialiased; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---- the two faces: his, and Jarvis ---------------------------------------------------------- */
.faces { display: flex; align-items: center; }
.face {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; flex: none;
  font-weight: 700; font-size: 17px; color: #fff;
  background: linear-gradient(135deg, #334155, #0f172a);
  background-size: cover; background-position: center;
  border: 2px solid var(--panel);
}
.face.orb {
  margin-left: -12px;
  background: radial-gradient(circle at 35% 30%, #e0f2fe 0 8%, var(--glow-a) 28%, var(--glow-b) 62%, #1e1b4b 100%);
  box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.5);
}
.face.orb.busy { animation: breathe 1.4s ease-in-out infinite; }
.face.orb.speaking { animation: speak 0.5s ease-in-out infinite alternate; }
.face.mini { width: 26px; height: 26px; margin: 0; border-width: 0; }
.faces.big .face { width: 60px; height: 60px; font-size: 24px; }
.faces.big .face.orb { margin-left: -18px; }
@keyframes breathe { 0%, 100% { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.55); transform: scale(1); } 50% { box-shadow: 0 0 0 9px rgba(56, 189, 248, 0); transform: scale(1.06); } }
@keyframes speak { from { transform: scale(1); box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.45); } to { transform: scale(1.12); box-shadow: 0 0 0 8px rgba(99, 102, 241, 0.08); } }
@media (prefers-reduced-motion: reduce) { .face.orb.busy, .face.orb.speaking, .dots i, .recording .dot { animation: none !important; } }

/* ---- the front door ---------------------------------------------------------------------------- */
.enter { min-height: 100dvh; display: grid; place-items: center; padding: 20px; }
.card { width: min(400px, 100%); display: flex; flex-direction: column; gap: 14px; align-items: center; text-align: center; padding: 32px 24px; background: var(--panel); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); }
.card h1 { margin: 6px 0 0; font-size: 22px; }
.card input { width: 100%; height: 54px; padding: 0 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); font-size: 22px; letter-spacing: 0.14em; text-align: center; }
.card .primary { width: 100%; }
.primary { height: 46px; padding: 0 20px; border-radius: 14px; background: var(--accent); color: var(--accent-ink); font-weight: 650; }
.ghost { height: 38px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); color: var(--muted); }
.sub { margin: 0; font-size: 13px; color: var(--muted); }
.error { margin: 8px 4px 0; color: var(--danger); font-size: 13px; }

/* ---- the page ----------------------------------------------------------------------------------- */
.chat { display: flex; flex-direction: column; height: 100dvh; max-width: 760px; margin: 0 auto; }
.top { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--panel); border-bottom: 1px solid var(--line); }
.who { flex: 1; min-width: 0; }
.who h1 { margin: 0; font-size: 16.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who h1 i { font-style: normal; color: var(--muted); font-weight: 500; }
.who .sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); flex: none; cursor: pointer; }
.icon:hover { background: var(--bg); color: var(--ink); }
.icon[aria-pressed="true"] { color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.pill { height: 36px; padding: 0 14px; border-radius: 18px; border: 1px solid var(--line); font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.pill b { color: var(--accent); font-weight: 700; }

/* requests */
.tickets { background: var(--panel); border-bottom: 1px solid var(--line); max-height: 46dvh; overflow-y: auto; }
.tickets ul { list-style: none; margin: 0; padding: 10px 14px 14px; display: grid; gap: 10px; }
.ticket { padding: 12px 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--bg); }
.ticket .line { display: flex; align-items: baseline; gap: 10px; }
.ticket .label { flex: 1; min-width: 0; font-weight: 600; font-size: 14.5px; overflow-wrap: anywhere; }
.state { flex: none; font-size: 12px; font-weight: 650; padding: 3px 10px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
.state.done { background: var(--ok-bg); color: var(--ok); }
.steps-bar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 10px; }
.steps-bar span { height: 5px; border-radius: 3px; background: var(--line); }
.steps-bar span.on { background: var(--accent); }
.ticket.done .steps-bar span.on { background: var(--ok); }
.steps-names { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 5px; font-size: 10.5px; color: var(--muted); }

/* the conversation */
.thread { flex: 1; overflow-y: auto; padding: 18px 14px 8px; display: flex; flex-direction: column; gap: 10px; scroll-behavior: smooth; }
.welcome { margin: auto; max-width: 420px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 12px; }
.welcome h2 { margin: 6px 0 0; font-size: 21px; }
.welcome p { margin: 0; color: var(--muted); font-size: 14.5px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 6px; }
.chip-btn { height: 38px; padding: 0 16px; border-radius: 19px; border: 1px solid var(--line); background: var(--panel); font-size: 14px; font-weight: 600; box-shadow: var(--shadow); }
.chip-btn:hover { border-color: var(--accent); color: var(--accent); }

.turn { display: flex; gap: 8px; align-items: flex-end; max-width: 92%; }
.turn.mine { align-self: flex-end; flex-direction: row-reverse; }
.turn .face { width: 30px; height: 30px; font-size: 13px; margin: 0; border-width: 0; }
.turn .body { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.turn .by { font-size: 11.5px; font-weight: 650; color: var(--muted); padding: 0 6px; }
.msg { padding: 10px 14px; border-radius: 18px; border-bottom-left-radius: 6px; background: var(--theirs); border: 1px solid var(--line); box-shadow: var(--shadow); overflow-wrap: anywhere; }
.turn.mine .msg { background: var(--mine); color: var(--mine-ink); border-color: transparent; border-radius: 18px; border-bottom-right-radius: 6px; }
.msg p { margin: 0; white-space: pre-wrap; }
.msg p + p, .msg p + ol, .msg ol + p { margin-top: 8px; }
.msg ol.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: 8px; }
.msg ol.steps li { counter-increment: step; display: grid; grid-template-columns: 26px 1fr; gap: 8px; align-items: start; }
.msg ol.steps li::before { content: counter(step); width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12.5px; font-weight: 700; background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.msg img { display: block; max-width: 100%; max-height: 280px; border-radius: 12px; margin-bottom: 6px; }
.msg audio { display: block; width: min(270px, 100%); margin-bottom: 6px; }
.msg .file { display: inline-block; font-size: 13px; margin-bottom: 4px; color: inherit; }
.msg.resolved { background: var(--ok-bg); border-color: var(--ok-line); }
.msg.resolved::before { content: "✓ Theek ho gaya"; display: block; font-size: 12px; font-weight: 700; color: var(--ok); margin-bottom: 4px; }
.meta { display: flex; align-items: center; gap: 8px; padding: 0 6px; font-size: 11px; color: var(--muted); }
.turn.mine .meta { justify-content: flex-end; }
.listen { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px; border-radius: 12px; font-size: 11.5px; font-weight: 650; color: var(--accent); }
.listen:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.listen[disabled] { opacity: 0.55; cursor: default; }

/* what Jarvis is doing right now */
.activity { display: flex; align-items: center; gap: 8px; padding: 4px 18px 10px; font-size: 13px; color: var(--muted); }
.dots { display: inline-flex; gap: 3px; }
.dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: 0.15s; }
.dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }

/* writing, attaching, recording */
.composer { padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: var(--panel); border-top: 1px solid var(--line); }
.row { display: flex; align-items: flex-end; gap: 6px; }
textarea { flex: 1; resize: none; max-height: 140px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 20px; background: var(--bg); }
.send { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); flex: none; }
.send:disabled { opacity: 0.5; cursor: default; }
.previews { display: flex; gap: 8px; flex-wrap: wrap; }
.previews:not(:empty) { margin-bottom: 8px; }
.chip { display: flex; align-items: center; gap: 6px; padding: 4px 6px 4px 10px; border: 1px solid var(--line); border-radius: 14px; font-size: 13px; background: var(--bg); }
.chip button { height: 22px; width: 22px; border-radius: 50%; color: var(--muted); font-size: 16px; line-height: 1; }
.chip audio { height: 30px; max-width: 190px; }
.recording { display: flex; align-items: center; gap: 10px; padding: 2px 4px; font-size: 14px; }
.recording .grow { flex: 1; color: var(--muted); }
.recording .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); animation: blink 1.2s infinite ease-in-out; }
