:root {
  --navy: #1e3a5f; --navy-2: #2c5282; --ink: #111827; --muted: #6b7280; --line: #e5e7eb;
  --bg: #f5f7fa; --card: #fff; --green: #15803d; --green-bg: #dcfce7; --red: #b91c1c; --red-bg: #fee2e2;
  --amber-bg: #fef3c7; --amber: #92400e; --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: var(--ink); background: var(--bg); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
h1 { font-size: 22px; margin: 4px 0 14px; }
h2 { font-size: 17px; margin: 0 0 12px; }
h3 { font-size: 15px; margin: 16px 0 8px; }

.top { background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; padding-top: max(12px, env(safe-area-inset-top)); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 17px; }
.logo { width: 34px; height: 34px; border-radius: 50%; background: #fff; object-fit: contain; padding: 1px; }
.top .link { color: #fff; }

.tabs { display: flex; gap: 2px; overflow-x: auto; background: #fff; border-bottom: 1px solid var(--line); padding: 0 8px; position: sticky; top: 0; z-index: 5; }
.tabs a { padding: 12px 12px; color: var(--muted); text-decoration: none; white-space: nowrap; border-bottom: 3px solid transparent; font-weight: 500; font-size: 15px; }
.tabs a.on { color: var(--navy); border-bottom-color: var(--navy); }

.wrap { max-width: 900px; margin: 0 auto; padding: 16px; padding-bottom: 60px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.narrow { max-width: 420px; margin: 24px auto; }

label { display: block; font-size: 14px; font-weight: 500; margin: 10px 0 4px; }
input, select, textarea { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid #cbd5e1; border-radius: 8px; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--navy-2); outline-offset: 0; border-color: var(--navy-2); }
textarea { min-height: 80px; resize: vertical; }
input[type=checkbox] { width: auto; margin-right: 8px; }
.check { display: flex; align-items: center; font-weight: 400; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 12px; }
@media (max-width: 560px) { .grid2, .grid3 { grid-template-columns: 1fr; } }

button, .btn { font: inherit; font-weight: 600; border: 0; border-radius: 8px; padding: 10px 16px; cursor: pointer; background: var(--navy); color: #fff; display: inline-block; text-decoration: none; }
button:hover, .btn:hover { background: var(--navy-2); }
button:disabled { opacity: .6; cursor: default; }
button.secondary, .btn.secondary { background: #e8eef6; color: var(--navy); }
button.danger { background: var(--red-bg); color: var(--red); }
button.go { background: var(--green); }
button.big { width: 100%; padding: 14px; font-size: 17px; }
button.sm { padding: 6px 10px; font-size: 14px; }
button.link { background: none; color: var(--navy-2); padding: 0; font-weight: 500; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row.end { justify-content: flex-end; }
.actions { margin-top: 14px; display: flex; gap: 8px; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }

.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tile { background: #f8fafc; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.tile .n { font-size: 22px; font-weight: 700; }
.tile .l { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }

.meeting-now { border: 2px solid var(--green); background: #f0fdf4; }
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: #eef2f7; color: #334155; }
.badge.open { background: var(--green-bg); color: var(--green); }
.badge.closed { background: #eef2f7; color: #475569; }
.badge.scheduled { background: var(--amber-bg); color: var(--amber); }
.badge.off { background: var(--red-bg); color: var(--red); }

table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
td.num, th.num { text-align: right; white-space: nowrap; }
tr.total td { font-weight: 700; border-top: 2px solid var(--line); }
.scroll { overflow-x: auto; }

.list-item { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }

.code-big { font: 700 34px/1 ui-monospace, Menlo, Consolas, monospace; letter-spacing: 6px; text-align: center; padding: 14px; background: #f8fafc; border: 1px dashed #94a3b8; border-radius: 10px; margin: 10px 0; }
.qr { display: block; margin: 10px auto; width: 220px; height: 220px; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; word-break: break-all; }
.err { color: var(--red); font-size: 14px; margin-top: 8px; min-height: 1em; }

.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%) translateY(120px); background: #111827; color: #fff; padding: 10px 16px; border-radius: 10px; transition: transform .25s; z-index: 50; max-width: 90vw; }
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.bad { background: var(--red); }

dialog { border: 0; border-radius: var(--radius); padding: 0; width: min(480px, 94vw); box-shadow: 0 20px 50px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(15, 23, 42, .45); }
dialog form { padding: 18px; }

/* utilities (no inline styles: the CSP blocks them) */
.m0 { margin: 0; }
.mt6 { margin: 6px 0 2px; }
.mt8 { margin: 8px 0 0; }
.mt10 { margin: 10px 0 0; }
.mt14 { margin-top: 14px; }
.my12 { margin: 12px 0; }
.grow { flex: 1; min-width: 200px; }
input.auto { width: auto; }
.spaced { justify-content: space-between; }
@media (max-width: 560px) { table { font-size: 14px; } th, td { padding: 7px 4px; } }

/* organization logo */
.signin-logo { display: block; width: 150px; height: 150px; object-fit: contain; margin: 0 auto 6px; }
.logo-preview { width: 140px; height: 140px; object-fit: contain; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.warn { color: var(--amber); }
.install { border: 2px dashed #93c5fd; background: #f0f7ff; }
