:root {
  --bg: #f5f6fa;
  --surface: #ffffff;
  --surface-2: #f0f2f7;
  --text: #0f1424;
  --muted: #667085;
  --line: rgba(15, 20, 36, .09);
  --accent: #5b5bf0;
  --accent-2: #a855f7;
  --accent-ink: #ffffff;
  --focus: rgba(91, 91, 240, .35);
  --ok: #0f9f6e;
  --ok-bg: #e7f7f0;
  --warn: #b7791f;
  --warn-bg: #fdf4e3;
  --danger: #dc3545;
  --danger-bg: #fdecee;
  --shadow: 0 1px 2px rgba(15, 20, 36, .05), 0 8px 24px -12px rgba(15, 20, 36, .12);
  --shadow-lg: 0 2px 4px rgba(15, 20, 36, .04), 0 24px 48px -20px rgba(15, 20, 36, .25);
  --radius: 18px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI Variable Display", "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0c11;
    --surface: #12151d;
    --surface-2: #1a1e28;
    --text: #eef1f7;
    --muted: #8d96a8;
    --line: rgba(255, 255, 255, .08);
    --accent: #7c7cff;
    --focus: rgba(124, 124, 255, .4);
    --ok: #34d399;
    --ok-bg: rgba(52, 211, 153, .12);
    --warn: #fbbf24;
    --warn-bg: rgba(251, 191, 36, .12);
    --danger: #f87171;
    --danger-bg: rgba(248, 113, 113, .12);
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px -12px rgba(0, 0, 0, .6);
    --shadow-lg: 0 24px 60px -24px rgba(0, 0, 0, .8);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--display); letter-spacing: -.02em; margin: 0; }
h1 { font-size: clamp(28px, 4.2vw, 40px); font-weight: 700; line-height: 1.1; }
h2 { font-size: 17px; font-weight: 650; display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
h2 .ic { color: var(--muted); }
h3 { font-size: 14px; font-weight: 600; color: var(--muted); margin: 24px 0 8px; }
.muted { color: var(--muted); font-weight: 400; }
.center { text-align: center; }
.ic { flex: none; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 8px; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 28px;
  padding: 14px max(20px, env(safe-area-inset-right)) 14px max(20px, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 700; font-size: 17px; letter-spacing: -.02em; }
.topnav { display: flex; gap: 4px; flex: 1; }
.topnav a { padding: 7px 12px; border-radius: 10px; color: var(--muted); font-weight: 550; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; transition: background .15s, color .15s; }
.topnav a:hover { color: var(--text); background: var(--surface-2); }
.topnav a.on { color: var(--text); background: var(--surface); box-shadow: var(--shadow); }

.menu { position: relative; }
.menu summary { list-style: none; cursor: pointer; border-radius: 50%; }
.menu summary::-webkit-details-marker { display: none; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: inline-grid; place-items: center; flex: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-weight: 650; font-size: 15px;
}
.avatar.sm { width: 34px; height: 34px; font-size: 14px; }
.avatar.lg { width: 64px; height: 64px; font-size: 26px; }
.menu-pop {
  position: absolute; right: 0; top: calc(100% + 10px); width: 250px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 6px;
  box-shadow: var(--shadow-lg); animation: pop .14s ease-out;
}
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
.menu-head { padding: 10px 12px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; display: grid; }
.menu-head small { color: var(--muted); }
.menu-pop a, .menu-pop button {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 10px 12px; border-radius: 10px; border: 0; background: none;
  font: inherit; font-weight: 500; color: inherit; cursor: pointer; text-align: left;
}
.menu-pop a:hover, .menu-pop button:hover { background: var(--surface-2); }
.menu-pop .ic { color: var(--muted); }
.menu-pop form { margin: 0; }
.badge {
  min-width: 19px; height: 19px; padding: 0 6px; border-radius: 10px;
  background: var(--danger); color: #fff; font-size: 11.5px; font-weight: 700;
  display: inline-grid; place-items: center; margin-left: auto;
}
h2 .badge, .topnav .badge { margin-left: 0; }

/* ---------- layout ---------- */
.page { width: 100%; max-width: 1040px; margin: 0 auto; padding: 40px 20px 56px; flex: 1; }
.page.narrow { max-width: 680px; }
.page-head { margin-bottom: 28px; }
.member-head { display: flex; align-items: center; gap: 18px; }
.lede { color: var(--muted); font-size: 16px; margin: 8px 0 0; }
.foot { text-align: center; color: var(--muted); font-size: 12.5px; padding: 0 20px 28px; }

/* ---------- hub ---------- */
.hero { padding: 24px 0 36px; }
.eyebrow { margin: 0 0 6px; color: var(--muted); font-weight: 550; }
.hero h1 { font-size: clamp(34px, 6vw, 54px); }
.apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 20px; }
.app {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: 24px; overflow: hidden;
  box-shadow: var(--shadow); transition: transform .2s ease, box-shadow .2s ease;
}
a.app:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
a.app:active { transform: translateY(-1px); }
.app-art {
  height: 168px; display: grid; place-items: center; color: #fff; position: relative; overflow: hidden;
}
.app-art .ic {
  width: 64px; height: 64px; padding: 16px; border-radius: 22px;
  background: rgba(255, 255, 255, .18); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); position: relative;
}
.app-art::before, .app-art::after { content: ""; position: absolute; border-radius: 50%; filter: blur(2px); }
.app-art::before { width: 220px; height: 220px; right: -60px; top: -90px; background: rgba(255, 255, 255, .14); }
.app-art::after { width: 160px; height: 160px; left: -50px; bottom: -80px; background: rgba(0, 0, 0, .12); }
.stream .app-art { background: linear-gradient(135deg, #f43f5e 0%, #e11d48 35%, #7c3aed 100%); }
.photos .app-art { background: linear-gradient(135deg, #f59e0b 0%, #f97316 40%, #ec4899 100%); }
.app-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.app-art:has(.app-photo)::before, .app-art:has(.app-photo)::after { display: none; }
.app-art .app-photo + .ic { position: absolute; left: 14px; bottom: 14px; width: 44px; height: 44px; padding: 11px; border-radius: 15px; z-index: 1;
  background: rgba(0, 0, 0, .28); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .3); }
.app-body { padding: 20px 22px 6px; }
.app-body h2 { font-size: 21px; margin: 0 0 4px; }
.app-body p { margin: 0; color: var(--muted); }
.app-go { display: inline-flex; align-items: center; gap: 6px; padding: 14px 22px 20px; font-weight: 600; color: var(--accent); }
a.app:hover .app-go .ic { transform: translateX(3px); }
.app-go .ic { transition: transform .2s; }
.app.soon .app-art { filter: saturate(.55); opacity: .75; }
.app.soon .pill { margin: 14px 22px 20px; align-self: flex-start; }

/* ---------- cards & rows ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; margin-bottom: 20px; box-shadow: var(--shadow);
}
.card.attention { border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }
.center-card { text-align: center; padding: 40px 28px; }
.center-card h1 { font-size: 28px; }
.big-icon { width: 60px; height: 60px; margin: 0 auto 16px; border-radius: 18px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.count { color: var(--muted); font-weight: 500; font-size: 14px; }
.empty { display: flex; align-items: center; gap: 8px; color: var(--muted); margin: 0; }
.empty .ic { color: var(--ok); }
.rows { list-style: none; margin: 0; padding: 0; }
.rows > li + li { border-top: 1px solid var(--line); }
.row { display: flex; align-items: center; gap: 14px; padding: 13px 0; }
.rows.compact .row { padding: 9px 0; }
.link-row { margin: 0 -12px; padding: 12px; border-radius: 12px; transition: background .15s; }
.link-row:hover { background: var(--surface-2); }
.members > li + li { border-top: 0; }
.row-main { flex: 1; min-width: 0; display: grid; }
.row-main b { font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row-main small { color: var(--muted); font-size: 13px; }
.chev { color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot.ok { background: var(--ok); }
.dot.danger { background: var(--danger); }

.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted); font-size: 13px; font-weight: 600; white-space: nowrap;
}
.pill.sm { padding: 3px 9px; font-size: 12px; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.danger { background: var(--danger-bg); color: var(--danger); }

/* reviews */
.review { padding: 18px; border-radius: 14px; background: var(--surface-2); }
.review + .review { margin-top: 12px; }
.review-head { display: flex; gap: 12px; align-items: center; }
.review-icon { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--danger-bg); color: var(--danger); flex: none; }
.attempts { list-style: none; margin: 14px 0 0; padding: 0; font-size: 13px; }
.attempts li { display: grid; grid-template-columns: 130px 1fr 1.2fr auto; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); }
.review .hint { margin: 12px 0 0; }
.review .actions { margin-top: 14px; }

/* table */
.table-wrap { overflow-x: auto; margin: 0 -24px; padding: 0 24px; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; padding: 0 10px 10px 0; }
.table td { padding: 10px 10px 10px 0; border-top: 1px solid var(--line); white-space: nowrap; }

/* ---------- forms ---------- */
.field { display: grid; gap: 7px; margin-bottom: 16px; }
.field > span { font-size: 13.5px; font-weight: 600; }
input[type=text], input[type=password], input:not([type]) {
  width: 100%; height: 46px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface-2); color: var(--text);
  font: inherit; font-size: 16px; /* 16px stops iPhone zooming in */
  transition: border-color .15s, box-shadow .15s, background .15s;
}
input::placeholder { color: var(--muted); opacity: .8; }
input:focus { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 4px var(--focus); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.checks { border: 0; padding: 0; margin: 4px 0 16px; display: grid; gap: 10px; }
.checks legend { font-size: 13.5px; font-weight: 600; margin-bottom: 8px; padding: 0; }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
.hint { color: var(--muted); font-size: 13.5px; margin: -4px 0 16px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 0; }
.actions.center { justify-content: center; margin-top: 24px; }
.actions form { margin: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font: inherit; font-weight: 600; font-size: 14.5px;
  cursor: pointer; transition: transform .1s, background .15s, box-shadow .15s, filter .15s; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: scale(.98); }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13.5px; border-radius: 10px; }
.btn.primary {
  border: 0; color: var(--accent-ink);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 6px 18px -8px color-mix(in srgb, var(--accent) 80%, transparent);
}
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { background: var(--danger); border-color: transparent; color: #fff; }
.btn.block { width: 100%; height: 48px; font-size: 16px; }
.link { color: var(--accent); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.danger-zone { border-color: color-mix(in srgb, var(--danger) 25%, var(--line)); }
.danger-zone h2 { color: var(--danger); }

.note {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px;
  font-size: 14px; margin-bottom: 18px; line-height: 1.45;
}
.note .ic { margin-top: 1px; }
.note.ok { background: var(--ok-bg); color: var(--ok); }
.note.warn { background: var(--warn-bg); color: var(--warn); }
.note.err { background: var(--danger-bg); color: var(--danger); }
.secret { display: grid; gap: 6px; padding: 16px; border-radius: 14px; margin-bottom: 20px; background: var(--surface); border: 1px dashed var(--accent); }
.secret code { font: 600 22px/1.2 ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace; letter-spacing: .04em; user-select: all; }
.secret small { color: var(--muted); }

/* ---------- sign-in ---------- */
body.auth { overflow-x: hidden; }
.auth-bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.auth-bg i { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; }
.auth-bg i:nth-child(1) { width: 520px; height: 520px; left: -140px; top: -160px; background: #818cf8; }
.auth-bg i:nth-child(2) { width: 460px; height: 460px; right: -160px; top: 20%; background: #c084fc; opacity: .4; }
.auth-bg i:nth-child(3) { width: 420px; height: 420px; left: 30%; bottom: -220px; background: #f472b6; opacity: .3; }
@media (prefers-color-scheme: dark) { .auth-bg i { opacity: .28; } .auth-bg i:nth-child(n+2) { opacity: .2; } }
.auth-wrap { position: relative; z-index: 1; flex: 1; display: grid; place-items: center; padding: 32px 16px; }
.auth-card {
  width: 100%; max-width: 410px; padding: 40px 32px 28px;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: blur(24px) saturate(160%); -webkit-backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid var(--line); border-radius: 28px; box-shadow: var(--shadow-lg);
}
.auth-brand { display: flex; justify-content: center; margin-bottom: 22px; }
.auth-brand .mark { filter: drop-shadow(0 8px 16px rgba(99, 102, 241, .35)); }
.auth-card h1 { text-align: center; font-size: 30px; }
.auth-sub { text-align: center; color: var(--muted); margin: 8px 0 28px; }
.auth-card .btn.block { margin-top: 8px; }
.auth-foot { display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--muted); font-size: 12.5px; margin: 22px 0 0; text-align: center; }

/* ---------- profile pictures ---------- */
img.avatar { object-fit: cover; padding: 0; }
.avatar.xl { width: 96px; height: 96px; font-size: 38px; flex: none; }
.pic-row { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.pic-main { flex: 1; min-width: 220px; display: grid; gap: 10px; }
.pic-main .hint { margin: 0; }
.pic-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0; }
.file-pick { position: relative; display: inline-flex; align-items: center; height: 42px; padding: 0 16px; border-radius: 12px;
  border: 1px dashed var(--accent); color: var(--accent); font-weight: 600; font-size: 14.5px; cursor: pointer; max-width: 100%; }
.file-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-pick span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- passkeys ---------- */
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; margin: 20px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-card .btn.block + .divider { margin-top: 20px; }
.big-passkey {
  width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 24px -10px color-mix(in srgb, var(--accent) 80%, transparent);
}
.key-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--surface-2); color: var(--accent); }
.passkey-add { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.rows + .passkey-add { margin-top: 8px; }
.pill .ic { margin-right: -2px; }
.perks { list-style: none; padding: 0; margin: 22px 0 18px; display: grid; gap: 10px; font-size: 14px; color: var(--muted); }
.perks li { display: flex; gap: 10px; align-items: flex-start; line-height: 1.4; }
.perks .ic { color: var(--ok); margin-top: 2px; }
.btn.subtle { background: transparent; border-color: transparent; color: var(--muted); }
.btn.subtle:hover { background: var(--surface-2); color: var(--text); }

/* ---------- small screens ---------- */
@media (max-width: 640px) {
  .topbar { gap: 12px; padding-top: 12px; padding-bottom: 12px; }
  .brand span { display: none; }
  .page { padding: 28px 16px 44px; }
  .hero { padding: 8px 0 24px; }
  .apps { grid-template-columns: 1fr; gap: 16px; }
  .app-art { height: 140px; }
  .card { padding: 20px 18px; border-radius: 16px; }
  .table-wrap { margin: 0 -18px; padding: 0 18px; }
  .grid2 { grid-template-columns: 1fr; }
  .attempts li { grid-template-columns: 1fr 1fr; }
  .auth-card { padding: 32px 22px 24px; border-radius: 24px; }
  .member-head { gap: 14px; }
  .avatar.lg { width: 52px; height: 52px; font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
