/* Visual language shared with Selvam Send: Manrope, navy/blue palette, square corners. */
:root {
  --background: #f9f9fb;
  --surface: #ffffff;
  --foreground: #0e1a2b;
  --muted: #5b6879;
  --border: #e5e7eb;
  --navy: #0e1a2b;
  --primary: #225c8d;
  --primary-hover: #1b4a72;
  --accent: #0090d3;
  --danger: #b3261e;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--background);
  color: var(--foreground);
  font: 16px/1.5 Manrope, -apple-system, "system-ui", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
img { max-width: 100%; }

.wrap { width: 100%; max-width: 64rem; margin: 0 auto; padding: 0 24px; }

#home { min-height: 100%; display: flex; flex-direction: column; }
.view { flex: 1; display: flex; flex-direction: column; }

.top { border-bottom: 1px solid var(--border); background: rgba(255, 255, 255, .9); }
.top-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 16px; padding-bottom: 16px; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--muted); }
.brand img { height: 32px; width: auto; }
.brand span { font-size: 14px; font-weight: 600; letter-spacing: .05em; }

.hero { flex: 1; display: flex; background: var(--navy); color: #fff; }
.hero-inner { display: flex; flex-direction: column; justify-content: center; gap: 24px; padding-top: 72px; padding-bottom: 72px; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--accent); }
h1 { margin: 0; max-width: 36rem; font-size: clamp(2rem, 5vw, 3rem); font-weight: 600; line-height: 1.15; }
.accent { color: var(--accent); }

.card {
  width: 100%; max-width: 24rem; display: flex; flex-direction: column; gap: 16px;
  padding: 24px; background: var(--surface); color: var(--foreground);
}
label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
label span { font-weight: 600; }
.hero label { color: var(--foreground); }
input {
  font: inherit; color: var(--foreground); background: var(--surface);
  border: 1px solid var(--border); border-radius: 0; padding: 8px 12px; outline: none;
}
input:focus { border-color: var(--primary); }
#hostId { font-variant-numeric: tabular-nums; letter-spacing: .08em; }

.btn, .bar button {
  font: inherit; font-weight: 600; cursor: pointer; border: 0; border-radius: 0;
  background: var(--primary); color: #fff; padding: 8px 16px;
}
.btn:hover, .bar button:hover { background: var(--primary-hover); }
.btn:disabled { opacity: .5; cursor: default; }
.btn:focus-visible, .bar button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.error { color: var(--danger); font-size: 14px; margin: 0; min-height: 0; }
.error:empty { display: none; }

.foot { background: var(--navy); color: rgba(255, 255, 255, .7); border-top: 1px solid rgba(255, 255, 255, .1); }
.foot-inner { display: flex; flex-direction: column; gap: 8px; padding-top: 32px; padding-bottom: 32px; font-size: 14px; }
.foot-name { color: #fff; }
@media (min-width: 640px) {
  .foot-inner { flex-direction: row; align-items: center; justify-content: space-between; }
}

#session { position: fixed; inset: 0; display: flex; flex-direction: column; background: #000; }
.bar {
  display: flex; align-items: center; gap: 12px; background: var(--navy); color: #fff;
  padding: 8px 16px; padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
}
.bar img { height: 24px; width: auto; filter: brightness(0) invert(1); }
.bar-title { font-size: 13px; font-weight: 600; letter-spacing: .05em; color: rgba(255, 255, 255, .7); }
.bar-status { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: rgba(255, 255, 255, .7); }
.bar button { padding: 6px 12px; font-size: 14px; }
.bar button.danger { background: var(--danger); }
.bar button.danger:hover { background: #8f1f19; }
.stage { flex: 1; min-height: 0; }
video { display: block; width: 100%; height: 100%; object-fit: contain; background: #000; outline: none; cursor: none; touch-action: none; }

/* Navigation (same pattern as Selvam Send) */
#nav { display: flex; align-items: center; gap: 20px; min-width: 0; overflow-x: auto; white-space: nowrap; font-size: 14px; font-weight: 500; }
#nav a { color: var(--foreground); text-decoration: none; }
#nav a:hover, #nav a[aria-current] { color: var(--primary); }
#nav .who { color: var(--muted); }
#nav button { padding: 6px 12px; }
.linkbtn { background: none; border: 0; color: var(--foreground); font: inherit; font-weight: 500; cursor: pointer; padding: 0; }
.linkbtn:hover { color: var(--primary); background: none; }

/* Plain pages */
.page { width: 100%; max-width: 64rem; margin: 0 auto; padding: 32px 24px 64px; display: flex; flex-direction: column; gap: 24px; }
.page.center { align-items: center; justify-content: center; flex: 1; max-width: none; }
.page h1 { font-size: 24px; margin: 0; }
.page h2 { font-size: 18px; margin: 0; font-weight: 600; }
.panel { background: var(--surface); border: 1px solid var(--border); padding: 20px; display: flex; flex-direction: column; gap: 14px; max-width: 28rem; width: 100%; }
.panel.wide { max-width: none; }
.stackform { display: flex; flex-direction: column; gap: 14px; width: 100%; max-width: 24rem; }
.muted { color: var(--muted); font-size: 14px; margin: 0; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.notice { padding: 12px 16px; border-left: 4px solid var(--warning, #b6650f); background: var(--surface); border-top: 1px solid var(--border); border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); font-size: 14px; }
.ok { color: #1a7f4e; font-size: 14px; margin: 0; }
.ghost { background: transparent; color: var(--primary); border: 1px solid var(--border); padding: 4px 10px; font-size: 13px; font-weight: 600; cursor: pointer; border-radius: 0; font-family: inherit; }
.ghost:hover { background: var(--background); }
.ghost.warn { color: var(--danger); }
.btn.inline { width: auto; align-self: flex-start; }
.check { flex-direction: row; align-items: center; gap: 8px; }
.check input { width: 16px; height: 16px; accent-color: var(--primary); }
select { font: inherit; color: var(--foreground); background: var(--surface); border: 1px solid var(--border); border-radius: 0; padding: 8px 12px; }
.totp-input { text-align: center; font-size: 20px; letter-spacing: .3em; }
.qr { width: 180px; height: 180px; image-rendering: pixelated; border: 1px solid var(--border); }
code.secret { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 13px; word-break: break-all; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); }
.tabs button { background: none; color: var(--muted); padding: 8px 14px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; font: inherit; font-weight: 600; cursor: pointer; }
.tabs button:hover { background: none; color: var(--primary); }
.tabs button[aria-selected=true] { color: var(--primary); border-bottom-color: var(--primary); }
.tablewrap { overflow-x: auto; border: 1px solid var(--border); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
.badge { display: inline-block; padding: 1px 8px; font-size: 12px; font-weight: 600; border: 1px solid var(--border); }
.badge.good { color: #1a7f4e; border-color: #1a7f4e; }
.badge.bad { color: var(--danger); border-color: var(--danger); }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }

dialog { border: 1px solid var(--border); border-radius: 0; padding: 20px; width: min(24rem, calc(100vw - 32px)); color: var(--foreground); }
dialog::backdrop { background: rgba(14, 26, 43, .5); }
dialog form { display: flex; flex-direction: column; gap: 14px; }
dialog h2 { margin: 0; font-size: 18px; }

.pad { padding: 14px; }
