@import url('/fonts/fonts.css');
/* Ak9 Connect - "Obsidian & Champagne": black lacquer, champagne-gold hairlines, deep sapphire for your own messages */
:root {
  --ink: #0a0a0c;          /* page */
  --ink-2: #111114;        /* raised */
  --panel: #16161b;        /* cards */
  --panel-2: #1c1c22;
  --hair: rgba(212, 178, 106, .22);   /* gold hairline */
  --hair-strong: rgba(212, 178, 106, .55);
  --gold: #d4b26a;         /* champagne gold */
  --gold-hi: #f1dca4;
  --gold-lo: #9c7a3c;
  --sapphire: #14254d;     /* your messages, accents */
  --sapphire-hi: #1f3a78;
  --text: #f4efe4;         /* warm ivory */
  --muted: #8f8a80;
  --ok: #2f9e6e; --danger: #c2413b;
  --gold-grad: linear-gradient(135deg, #f1dca4 0%, #d4b26a 48%, #9c7a3c 100%);
  --serif: 'Cormorant Garamond', 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --safe-top: env(safe-area-inset-top, 0px); --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; color: var(--text); font: 15px/1.45 var(--sans); overscroll-behavior: none; letter-spacing: .1px;
  background: radial-gradient(900px 520px at 50% -12%, rgba(212,178,106,.10), transparent 65%), var(--ink); }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input, select, textarea { font: inherit; color: var(--text); background: var(--ink-2); border: 1px solid var(--hair); border-radius: 12px; padding: 12px 14px; width: 100%; outline: none; transition: border-color .2s, box-shadow .2s; }
input::placeholder, textarea::placeholder { color: #5f5b54; }
input:focus, textarea:focus, select:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212,178,106,.12); }
.hidden { display: none !important; }
#app { height: 100%; display: flex; flex-direction: column; max-width: 900px; margin: 0 auto; }
.splash { margin: auto; text-align: center; color: var(--muted); font-family: var(--serif); font-size: 20px; }
.splash img { width: 96px; border-radius: 26px; }

/* ---------- auth ---------- */
.auth { margin: auto; width: 100%; max-width: 420px; padding: 28px 22px calc(28px + var(--safe-bottom)); }
.auth .logo { display: block; width: 92px; margin: 6px auto 14px; border-radius: 24px; box-shadow: 0 0 0 1px var(--hair-strong), 0 18px 50px rgba(212,178,106,.18); }
.auth h1 { text-align: center; margin: 0; font: 600 38px/1.1 var(--serif); letter-spacing: .5px; background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth p.sub { text-align: center; color: var(--muted); margin: 6px 0 22px; font-size: 13px; letter-spacing: 2px; text-transform: uppercase; }
.auth p.sub span { color: var(--gold); }
.tabs { display: flex; border-bottom: 1px solid var(--hair); margin-bottom: 18px; }
.tabs button { flex: 1; padding: 12px; color: var(--muted); font-weight: 500; letter-spacing: 1.5px; text-transform: uppercase; font-size: 12px; position: relative; }
.tabs button.on { color: var(--gold-hi); }
.tabs button.on::after { content: ""; position: absolute; left: 25%; right: 25%; bottom: -1px; height: 2px; background: var(--gold-grad); border-radius: 2px; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 11px; color: var(--gold); margin: 0 0 6px 2px; letter-spacing: 1.4px; text-transform: uppercase; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--gold-grad); color: #1a1408; font-weight: 600; padding: 14px 18px; border-radius: 12px; width: 100%; letter-spacing: .6px; box-shadow: 0 10px 28px rgba(212,178,106,.18), inset 0 1px 0 rgba(255,255,255,.35); }
.btn:active { filter: brightness(.95); }
.btn.secondary { background: transparent; color: var(--gold-hi); border: 1px solid var(--hair-strong); box-shadow: none; }
.btn.danger { background: transparent; color: #e7908b; border: 1px solid rgba(194,65,59,.5); box-shadow: none; }
.btn.small { width: auto; padding: 8px 12px; font-size: 13px; border-radius: 10px; }
.err { color: #e7908b; min-height: 20px; font-size: 13px; margin: 4px 2px 10px; }
.note { background: rgba(212,178,106,.06); border: 1px solid var(--hair); border-radius: 12px; padding: 12px 14px; color: #cfc6b4; font-size: 13px; }

/* ---------- shell ---------- */
header.top { display: flex; align-items: center; gap: 12px; padding: calc(12px + var(--safe-top)) 16px 12px; background: rgba(10,10,12,.92); backdrop-filter: blur(14px); color: var(--text); position: sticky; top: 0; z-index: 5; border-bottom: 1px solid var(--hair); }
header.top h2 { margin: 0; font: 600 26px/1.1 var(--serif); letter-spacing: .4px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--gold-hi); }
header.top .sub { font-size: 12px; color: var(--muted); }
header.top .brandmark { width: 30px; height: 30px; border-radius: 9px; box-shadow: 0 0 0 1px var(--hair-strong); }
header.top button { color: var(--gold); padding: 7px; border-radius: 50%; display: flex; }
header.top button:active { background: rgba(212,178,106,.1); }
.conn { width: 8px; height: 8px; border-radius: 50%; background: #8a6d2b; }
.conn.ok { background: var(--ok); box-shadow: 0 0 8px rgba(47,158,110,.8); }
main { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
nav.bottom { display: flex; background: rgba(10,10,12,.96); backdrop-filter: blur(14px); border-top: 1px solid var(--hair); padding: 6px 4px calc(4px + var(--safe-bottom)); }
nav.bottom button { flex: 1; padding: 6px 0 8px; font-size: 10px; letter-spacing: 1.2px; text-transform: uppercase; color: #6f6a61; display: flex; flex-direction: column; align-items: center; gap: 4px; position: relative; transition: color .2s; }
nav.bottom button.on { color: var(--gold-hi); }
nav.bottom button.on svg.i { stroke: var(--gold); filter: drop-shadow(0 0 8px rgba(212,178,106,.45)); }
nav.bottom button.on::after { content: ""; position: absolute; bottom: 1px; width: 4px; height: 4px; border-radius: 50%; background: var(--gold); }
nav.bottom .badge { position: absolute; top: 0; left: 56%; }
svg.i { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- lists ---------- */
.list { list-style: none; margin: 0; padding: 4px 0; }
.row { display: flex; align-items: center; gap: 14px; padding: 13px 16px; border-bottom: 1px solid rgba(212,178,106,.08); background: transparent; transition: background .15s; }
.row:active { background: rgba(212,178,106,.05); }
.row .main { flex: 1; min-width: 0; }
.row .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.row .s { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.row .meta { text-align: right; font-size: 11px; color: var(--muted); display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.row .acts { display: flex; gap: 8px; }
.row .acts button { color: var(--gold); width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 1px solid var(--hair); }
.row .acts button svg.i { width: 18px; height: 18px; }
.row .acts button:active { background: rgba(212,178,106,.12); }
.avatar { width: 46px; height: 46px; border-radius: 50%; background: radial-gradient(circle at 30% 25%, #2a2a31, #121216); color: var(--gold-hi); display: flex; align-items: center; justify-content: center; font: 600 19px/1 var(--serif); letter-spacing: .5px; flex-shrink: 0; position: relative; box-shadow: 0 0 0 1px var(--hair-strong); }
.avatar.group { background: radial-gradient(circle at 30% 25%, var(--sapphire-hi), #0b1430); }
.avatar.missed { color: #e7908b; box-shadow: 0 0 0 1px rgba(194,65,59,.55); }
.avatar svg.i { width: 20px; height: 20px; }
.avatar .dot { position: absolute; right: 1px; bottom: 1px; width: 11px; height: 11px; border-radius: 50%; background: var(--ok); border: 2px solid var(--ink); }
.dot.busy { background: #d9534f !important; } .dot.away { background: #e5b04a !important; } .dot.offline { background: #55524c !important; }
.status-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.status-pick button { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border: 1px solid var(--hair); border-radius: 12px; color: var(--text); }
.status-pick button.on { border-color: var(--gold); background: rgba(212,178,106,.1); color: var(--gold-hi); }
.status-pick .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); display: inline-block; }
.badge { background: var(--gold-grad); color: #1a1408; border-radius: 10px; font-size: 10px; font-weight: 700; padding: 2px 7px; min-width: 18px; text-align: center; }
.section-title { padding: 18px 16px 6px; color: var(--gold); font-size: 11px; letter-spacing: 1.6px; text-transform: uppercase; }
.empty { text-align: center; color: var(--muted); padding: 56px 24px; font-family: var(--serif); font-size: 19px; line-height: 1.5; }
.empty b { color: var(--gold-hi); font-weight: 600; }
.fab { position: fixed; right: max(18px, calc(50% - 432px)); bottom: calc(86px + var(--safe-bottom)); background: var(--gold-grad); color: #1a1408; width: 56px; height: 56px; border-radius: 50%; display: flex; align-items: center; justify-content: center; box-shadow: 0 12px 30px rgba(212,178,106,.3); }
.search { padding: 12px 16px; position: sticky; top: 0; z-index: 2; background: var(--ink); }
.call-banner { background: linear-gradient(90deg, #12392a, #1b5a40); color: #dff5ea; padding: 10px 16px; display: flex; align-items: center; gap: 10px; font-weight: 500; border-bottom: 1px solid rgba(47,158,110,.5); }
.call-banner button { border: 1px solid rgba(223,245,234,.6); color: #dff5ea; border-radius: 20px; padding: 5px 14px; margin-left: auto; }

/* ---------- chat ---------- */
.chat { display: flex; flex-direction: column; height: 100%; }
.msgs { flex: 1; overflow-y: auto; padding: 14px 12px; display: flex; flex-direction: column; gap: 6px; }
.msg { max-width: 78%; padding: 9px 13px; border-radius: 18px; background: var(--panel); border: 1px solid rgba(212,178,106,.12); word-wrap: break-word; white-space: pre-wrap; align-self: flex-start; }
.msg.me { background: linear-gradient(160deg, var(--sapphire-hi), var(--sapphire)); border-color: rgba(120,150,220,.25); color: #eef2fb; align-self: flex-end; border-bottom-right-radius: 6px; }
.msg.them { border-bottom-left-radius: 6px; }
.msg .who { font-size: 11px; font-weight: 600; color: var(--gold); margin-bottom: 2px; letter-spacing: .4px; }
.msg .time { font-size: 10px; opacity: .55; text-align: right; margin-top: 3px; }
.msg.sys { align-self: center; background: none; border: 0; color: var(--muted); font-size: 12px; padding: 4px; letter-spacing: .3px; }
.msg.callrec { align-self: center; background: transparent; color: #cfc6b4; font-size: 13px; border: 1px solid var(--hair); display: flex; gap: 8px; align-items: center; border-radius: 20px; padding: 6px 14px; }
.msg.callrec svg.i { width: 16px; height: 16px; color: var(--gold); }
.msg.callrec.missed, .msg.callrec.missed svg.i { color: #e7908b; }
.composer { display: flex; gap: 10px; padding: 10px 12px calc(10px + var(--safe-bottom)); background: var(--ink); border-top: 1px solid var(--hair); align-items: flex-end; }
.composer textarea { resize: none; max-height: 120px; border-radius: 22px; padding: 11px 16px; }
.composer button { background: var(--gold-grad); color: #1a1408; width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.composer button svg.i { width: 19px; height: 19px; }
.private-note { font-size: 11px; text-align: center; color: var(--gold); padding: 6px; letter-spacing: 1px; text-transform: uppercase; border-bottom: 1px solid var(--hair); }
.typing { font-size: 12px; color: var(--gold); padding: 0 16px 4px; height: 18px; font-style: italic; }

/* ---------- cards / admin ---------- */
.pad { padding: 16px; }
.card { background: var(--panel); border: 1px solid var(--hair); border-radius: 18px; padding: 16px; margin-bottom: 14px; }
.card h3 { margin: 0 0 12px; font: 600 22px/1.2 var(--serif); color: var(--gold-hi); letter-spacing: .3px; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
.stat { background: linear-gradient(160deg, var(--panel-2), var(--ink-2)); border: 1px solid var(--hair); border-radius: 16px; padding: 14px 16px; }
.stat b { display: block; font: 600 34px/1 var(--serif); font-variant-numeric: lining-nums tabular-nums; background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat span { color: var(--muted); font-size: 11px; letter-spacing: 1.3px; text-transform: uppercase; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; }
.switch { position: relative; width: 46px; height: 26px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #2a2a31; border-radius: 26px; transition: .2s; border: 1px solid var(--hair); }
.switch span:before { content: ""; position: absolute; width: 20px; height: 20px; left: 2px; top: 2px; background: #8f8a80; border-radius: 50%; transition: .2s; }
.switch input:checked + span { background: rgba(212,178,106,.25); border-color: var(--gold); }
.switch input:checked + span:before { transform: translateX(20px); background: var(--gold-hi); }
.pill { font-size: 10px; padding: 2px 8px; border-radius: 10px; border: 1px solid var(--hair); color: var(--muted); letter-spacing: .8px; text-transform: uppercase; }
.pill.admin { color: var(--gold-hi); border-color: var(--hair-strong); }
.pill.private { color: #9fb5e8; border-color: rgba(120,150,220,.4); }
.pill.pending { color: #e5c07b; border-color: rgba(229,192,123,.4); }
.pill.off { color: #e7908b; border-color: rgba(194,65,59,.5); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
table.tbl th { color: var(--gold); font-weight: 500; letter-spacing: 1px; text-transform: uppercase; font-size: 10px; }
table.tbl td, table.tbl th { padding: 8px 6px; border-bottom: 1px solid rgba(212,178,106,.1); text-align: left; }
.check-row { display: flex; align-items: center; gap: 14px; padding: 11px 16px; border-bottom: 1px solid rgba(212,178,106,.08); }
.check-row input { width: 20px; height: 20px; accent-color: var(--gold); }

/* ---------- call screen ---------- */
.call { position: fixed; inset: 0; z-index: 50; color: var(--text); display: flex; flex-direction: column; padding: calc(16px + var(--safe-top)) 16px calc(22px + var(--safe-bottom));
  background: radial-gradient(600px 420px at 50% 22%, rgba(212,178,106,.16), transparent 70%), radial-gradient(800px 600px at 50% 120%, rgba(31,58,120,.35), transparent 70%), #060607; }
.call .who { text-align: center; margin-top: 7vh; }
.call .who .avatar { width: 124px; height: 124px; font-size: 46px; margin: 0 auto 20px; box-shadow: 0 0 0 1px var(--gold), 0 0 0 8px rgba(212,178,106,.08); }
.call .who .avatar.pulse { animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 1px var(--gold), 0 0 0 0 rgba(212,178,106,.35); } 70% { box-shadow: 0 0 0 1px var(--gold), 0 0 0 34px rgba(212,178,106,0); } 100% { box-shadow: 0 0 0 1px var(--gold), 0 0 0 0 rgba(212,178,106,0); } }
.call .who h2 { margin: 0; font: 600 36px/1.1 var(--serif); color: var(--gold-hi); }
.call .who p { margin: 8px 0 0; color: var(--muted); letter-spacing: 2px; text-transform: uppercase; font-size: 12px; }
.call .grid { flex: 1; display: grid; gap: 8px; margin: 12px 0; min-height: 0; grid-template-columns: 1fr; grid-auto-rows: 1fr; }
.call .grid.n4 { grid-template-columns: 1fr 1fr; }
.call .grid.many { grid-template-columns: repeat(3, 1fr); }
.tile { position: relative; background: #0e0e11; border: 1px solid var(--hair); border-radius: 18px; overflow: hidden; display: flex; align-items: center; justify-content: center; min-height: 0; }
.tile video { width: 100%; height: 100%; object-fit: cover; }
.tile.me video { transform: scaleX(-1); }
.tile .name { position: absolute; left: 10px; bottom: 10px; background: rgba(6,6,7,.7); backdrop-filter: blur(6px); padding: 4px 10px; border-radius: 10px; font-size: 12px; display: flex; gap: 6px; align-items: center; border: 1px solid var(--hair); }
.tile.speaking { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 0 24px rgba(212,178,106,.25); }
.tile .avatar { width: 76px; height: 76px; font-size: 30px; }
.q { display: inline-flex; gap: 1px; align-items: flex-end; height: 10px; }
.q i { width: 3px; background: rgba(255,255,255,.25); display: block; border-radius: 1px; }
.q i:nth-child(1) { height: 4px; } .q i:nth-child(2) { height: 7px; } .q i:nth-child(3) { height: 10px; }
.q.excellent i, .q.good i:nth-child(-n+2) { background: var(--gold); }
.q.poor i:nth-child(1) { background: #e5c07b; }
.call .controls { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; }
.cbtn { width: 62px; height: 62px; border-radius: 50%; background: rgba(255,255,255,.06); color: var(--text); display: flex; align-items: center; justify-content: center; border: 1px solid var(--hair); }
.cbtn svg.i { width: 24px; height: 24px; }
.cbtn.off { background: var(--text); color: #0a0a0c; border-color: var(--text); }
.cbtn.end { background: linear-gradient(160deg, #d24c45, #9e2f2a); border-color: transparent; color: #fff; }
.cbtn.accept { background: linear-gradient(160deg, #3bb07d, #23785a); border-color: transparent; color: #fff; width: 74px; height: 74px; }
.cbtn.accept.alt { background: rgba(255,255,255,.08); border: 1px solid var(--hair-strong); color: var(--gold-hi); }
.cbtn.decline { background: linear-gradient(160deg, #d24c45, #9e2f2a); border-color: transparent; color: #fff; width: 74px; height: 74px; }
.call .status { text-align: center; color: var(--gold); font-size: 13px; min-height: 20px; margin-bottom: 12px; letter-spacing: .5px; }
.call .topbar { display: flex; align-items: center; gap: 8px; }
.call .topbar .ttl { flex: 1; text-align: center; font: 600 20px/1.2 var(--serif); color: var(--gold-hi); }
.call .topbar .ttl span { font: 400 13px var(--sans); color: var(--muted); margin-left: 6px; }
.incoming-actions { display: flex; justify-content: space-around; margin-top: auto; margin-bottom: 5vh; }
.incoming-actions div { text-align: center; font-size: 11px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--muted); }
.incoming-actions .cbtn { margin: 0 auto 10px; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(96px + var(--safe-bottom)); background: #141418; color: var(--text); border: 1px solid var(--hair-strong); padding: 10px 18px; border-radius: 14px; z-index: 60; font-size: 13px; max-width: 90%; text-align: center; box-shadow: 0 12px 30px rgba(0,0,0,.5); }
.install-steps li { margin-bottom: 6px; }
@media (prefers-reduced-motion: reduce) { .call .who .avatar.pulse { animation: none; } }
.sheet { position: absolute; left: 12px; right: 12px; bottom: calc(110px + var(--safe-bottom)); background: #111114; border: 1px solid var(--hair-strong); border-radius: 18px; padding: 12px; display: flex; flex-direction: column; gap: 4px; box-shadow: 0 20px 50px rgba(0,0,0,.6); z-index: 2; max-width: 460px; margin: 0 auto; }
.sheet-h { font: 600 22px/1.2 var(--serif); color: var(--gold-hi); padding: 4px 6px 6px; }
.sheet-t { color: var(--gold); font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; padding: 8px 6px 2px; }
.sheet-n { color: #cfc6b4; font-size: 13px; padding: 6px; line-height: 1.5; }
.sheet-o { text-align: left; padding: 11px 12px; border-radius: 12px; color: var(--text); border: 1px solid transparent; }
.sheet-o.on { border-color: var(--hair-strong); color: var(--gold-hi); background: rgba(212,178,106,.08); }
.sheet-o.close { text-align: center; color: var(--muted); margin-top: 4px; }
.alert-banner { margin: 10px 12px 4px; padding: 14px; border-radius: 16px; border: 1px solid var(--hair-strong); background: linear-gradient(160deg, rgba(212,178,106,.14), rgba(20,37,77,.35)); display: flex; flex-direction: column; gap: 10px; }
.alert-banner b { font: 600 20px/1.2 var(--serif); color: var(--gold-hi); }
.alert-banner p { margin: 0; color: #cfc6b4; font-size: 13px; }
.call .controls { gap: 14px; }
.cwrap { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 10px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); min-width: 56px; }
.cwrap.hidden { display: none; }
.pill.ring-on { color: #8fd3a6; border-color: rgba(80,180,120,.45); }
.pill.ring-off { color: #e7908b; border-color: rgba(194,65,59,.5); }
