/* Sangam - Chariot showcase: shared styles (self-contained, no external resources) */
:root {
  --bg: #07080c;
  --bg-2: #0d0f15;
  --panel: #12141c;
  --panel-2: #181b25;
  --line: #242836;
  --line-2: #2f3446;
  --ink: #eef0f6;
  --ink-2: #b7bccb;
  --muted: #7d8396;
  --accent: #7b80f2;
  --accent-2: #a9adff;
  --accent-ink: #0b0c18;
  --teal: #46dcb4;
  --amber: #f0b450;
  --danger: #ff6b6b;
  --danger-bg: rgba(255, 107, 107, .08);
  --ok: #46dcb4;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 10px 40px rgba(0, 0, 0, .45);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Noto Sans Devanagari", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  background-image: radial-gradient(1200px 600px at 80% -10%, rgba(123, 128, 242, .10), transparent 60%),
                    radial-gradient(900px 500px at -10% 110%, rgba(70, 220, 180, .06), transparent 60%);
  background-attachment: fixed;
  color: var(--ink);
  font: 15px/1.55 var(--font);
  min-height: 100vh;
  min-height: 100dvh;
}
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: rgba(123, 128, 242, .35); }

/* ---- header ---- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px;
  padding: 12px 20px;
  background: rgba(7, 8, 12, .82);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 650; letter-spacing: .02em; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  background: radial-gradient(circle at 35% 30%, #d3d5ff, #7b80f2 55%, #30338f);
  box-shadow: 0 0 18px rgba(123, 128, 242, .45);
}
.brand small { color: var(--muted); font-weight: 500; letter-spacing: .04em; }
.nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; align-items: center; }
.nav a {
  color: var(--ink-2); padding: 6px 11px; border-radius: 8px; font-size: 14px;
}
.nav a:hover { background: var(--panel-2); color: var(--ink); text-decoration: none; }
.nav a.active { color: var(--ink); background: var(--panel-2); }
.keylink { color: var(--muted) !important; font-size: 13px !important; }
.keylink .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); margin-right: 6px; vertical-align: 1px; }
.keylink.has-key .dot { background: var(--ok); }

@media (max-width: 640px) {
  .site-header { flex-wrap: wrap; padding: 10px 14px; gap: 6px; }
  .brand small { display: none; }
  .nav { margin-left: 0; width: 100%; justify-content: space-between; gap: 0; }
  .nav a { padding: 6px 8px; font-size: 13.5px; }
}

/* ---- layout ---- */
.wrap { max-width: 1040px; margin: 0 auto; padding: 28px 20px 60px; }
.wrap.narrow { max-width: 820px; }
@media (max-width: 640px) { .wrap { padding: 18px 14px 40px; } }
h1 { font-size: 30px; line-height: 1.2; margin: 0 0 8px; letter-spacing: -.01em; }
h2 { font-size: 21px; margin: 32px 0 10px; letter-spacing: -.005em; }
h3 { font-size: 16px; margin: 22px 0 8px; }
p { margin: 0 0 12px; }
.lede { color: var(--ink-2); font-size: 16.5px; max-width: 680px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.eyebrow { color: var(--accent-2); font-size: 12.5px; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; margin-bottom: 10px; }

.panel {
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}

/* ---- cards (landing) ---- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-top: 28px; }
.card {
  display: flex; flex-direction: column; gap: 10px;
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  color: var(--ink);
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.card:hover { border-color: var(--line-2); transform: translateY(-2px); box-shadow: var(--shadow); text-decoration: none; }
.card h3 { margin: 0; font-size: 18px; }
.card p { color: var(--ink-2); margin: 0; flex: 1; }
.card .go { color: var(--accent-2); font-weight: 600; font-size: 14px; }
.card .icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; }
.card .icon svg { width: 22px; height: 22px; }
.icon.chat { background: rgba(123, 128, 242, .14); color: var(--accent-2); }
.icon.audio { background: rgba(240, 180, 80, .13); color: var(--amber); }
.icon.voice { background: rgba(70, 220, 180, .12); color: var(--teal); }
.icon.api { background: rgba(183, 188, 203, .10); color: var(--ink-2); }
.tag { display: inline-block; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line-2); border-radius: 99px; padding: 2px 8px; align-self: flex-start; }

/* ---- controls ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line-2); background: var(--panel-2); color: var(--ink);
  border-radius: 10px; padding: 9px 15px; cursor: pointer; font-weight: 550; font-size: 14.5px;
  min-height: 40px; transition: background .15s ease, border-color .15s ease, opacity .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: #1f2330; border-color: #3a4057; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #8a8ef5; }
.btn.danger { border-color: rgba(255, 107, 107, .5); color: #ffb3b3; }
.btn.ghost { background: transparent; }
.btn.sm { padding: 5px 10px; min-height: 32px; font-size: 13px; }
.btn.rec { border-color: rgba(255, 107, 107, .55); }
.btn.rec .rdot { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); }
.btn.rec.on { background: rgba(255, 107, 107, .14); }
.btn.rec.on .rdot { animation: blink 1s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .25; } }

input[type=text], input[type=password], textarea, select {
  width: 100%; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 10px;
  padding: 10px 12px; color: var(--ink); outline: none; font-size: 15px;
}
textarea { resize: vertical; min-height: 46px; line-height: 1.45; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(123, 128, 242, .18); }
select { appearance: none; -webkit-appearance: none; padding-right: 30px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }

/* toggle switch */
.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; font-size: 14px; color: var(--ink-2); }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 36px; height: 20px; border-radius: 99px; background: var(--line-2); position: relative; transition: background .2s ease; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #cfd3e0; transition: transform .2s ease; }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(16px); background: #fff; }
.switch input:focus-visible + .track { box-shadow: 0 0 0 3px rgba(123, 128, 242, .35); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line-2); background: transparent; color: var(--ink-2); border-radius: 99px; padding: 5px 12px; font-size: 13px; cursor: pointer; }
.chip:hover { border-color: var(--accent); color: var(--ink); }

/* ---- notices ---- */
.notice { border-radius: 10px; padding: 10px 14px; font-size: 14px; margin: 12px 0; border: 1px solid var(--line-2); background: var(--panel); color: var(--ink-2); }
.notice.error { border-color: rgba(255, 107, 107, .45); background: var(--danger-bg); color: #ffc9c9; }
.notice.warn { border-color: rgba(240, 180, 80, .45); background: rgba(240, 180, 80, .07); color: #ffe0a8; }
.notice.ok { border-color: rgba(70, 220, 180, .4); background: rgba(70, 220, 180, .06); color: #bff3e4; }
.hidden { display: none !important; }

/* ---- modal ---- */
.modal-back { position: fixed; inset: 0; z-index: 100; background: rgba(3, 4, 7, .72); display: grid; place-items: center; padding: 16px; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.modal { width: 100%; max-width: 440px; background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.modal h3 { margin: 0 0 6px; font-size: 18px; }
.modal p { color: var(--ink-2); font-size: 14px; }
.modal .row { display: flex; gap: 10px; justify-content: flex-end; margin-top: 14px; }

/* ---- message rendering ---- */
.md p { margin: 0 0 10px; }
.md p:last-child { margin-bottom: 0; }
.md code { font-family: var(--mono); font-size: .9em; background: rgba(255, 255, 255, .07); border-radius: 5px; padding: 1px 5px; }
.md pre { position: relative; background: #0a0b10; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; overflow-x: auto; margin: 8px 0 12px; }
.md pre code { background: none; padding: 0; font-size: 13px; line-height: 1.5; white-space: pre; display: block; }
.md pre .lang { position: absolute; top: 6px; right: 10px; font-size: 11px; color: var(--muted); font-family: var(--mono); }

/* ---- code blocks (docs) ---- */
.code { position: relative; margin: 10px 0 16px; }
.code pre { background: #0a0b10; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; overflow-x: auto; margin: 0; font: 13px/1.55 var(--mono); color: #dfe3ee; }
.code .copy { position: absolute; top: 8px; right: 8px; font-size: 12px; padding: 4px 9px; border-radius: 7px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--ink-2); cursor: pointer; opacity: .85; }
.code .copy:hover { opacity: 1; color: var(--ink); }
.code .copy.done { color: var(--ok); border-color: rgba(70, 220, 180, .5); }

/* ---- footer ---- */
.site-footer { color: var(--muted); font-size: 12.5px; text-align: center; padding: 24px 16px 32px; }
