:root {
  color-scheme: dark;
  --ink: #eaf2ff;
  --muted: #8ea4c6;
  --faint: #5e7497;
  --bg: #071326;
  --surface: #0d1d35;
  --surface-2: #102744;
  --line: #1e3a60;
  --blue: #2d8cff;
  --blue-2: #63b3ff;
  --green: #42d99a;
  --amber: #f5bd62;
  --red: #ff718b;
  --radius: 16px;
  --shadow: 0 16px 36px rgba(0, 0, 0, .22);
  font-family: "Noto Sans", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--ink); }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 3px solid var(--blue-2); outline-offset: 3px; }
.skip-link { position: fixed; z-index: 50; left: 16px; top: -60px; padding: 10px 14px; border-radius: 10px; background: var(--blue); color: #fff; }
.skip-link:focus { top: 16px; }
.app-shell { display: flex; min-height: 100vh; }
.sidebar { width: 250px; flex: 0 0 250px; display: flex; flex-direction: column; padding: 25px 16px 18px; border-right: 1px solid var(--line); background: #091a31; }
.brand { display: flex; align-items: center; gap: 11px; margin: 0 10px 40px; font-weight: 800; letter-spacing: .13em; font-size: 14px; }
.brand img, .profile-chip img { border-radius: 11px; object-fit: cover; }
.side-nav { display: grid; gap: 7px; }
.nav-item { display: flex; align-items: center; gap: 12px; border: 0; border-radius: 11px; padding: 12px 13px; color: var(--muted); background: transparent; cursor: pointer; text-align: left; }
.nav-item:hover, .nav-item.active { background: var(--surface-2); color: var(--ink); }
.nav-item.active { box-shadow: inset 3px 0 0 var(--blue); }
.nav-icon { width: 18px; height: 18px; display: inline-grid; place-items: center; color: currentColor; }
.nav-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-foot { display: flex; align-items: center; gap: 8px; margin: auto 10px 0; color: var(--faint); font-size: 12px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(66,217,154,.12); }
.main-content { width: min(1180px, 100%); margin: 0 auto; padding: 30px 42px 56px; }
.topbar { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 30px; }
.eyebrow { margin: 0 0 8px; color: var(--blue-2); font-size: 10px; font-weight: 800; letter-spacing: .15em; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(26px, 3vw, 34px); letter-spacing: -.03em; }
h2 { margin-bottom: 6px; font-size: 20px; }
h3 { margin-bottom: 5px; font-size: 15px; }
.profile-chip { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 13px; }
.notice { margin-bottom: 18px; padding: 12px 14px; border-radius: 12px; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); }
.notice.error { color: #ffd6dc; border-color: rgba(255,113,139,.45); background: rgba(255,113,139,.1); }
.notice.success { color: #d6ffed; border-color: rgba(66,217,154,.45); background: rgba(66,217,154,.1); }
.grid { display: grid; gap: 16px; }
.stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 26px; }
.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hero { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 18px; padding: 22px; background: linear-gradient(135deg, #102d59, #0d1d35 65%); }
.hero h2 { margin-bottom: 4px; font-size: 25px; }
.hero .eyebrow { margin-bottom: 6px; }
.quick-links { margin-top: 24px; padding: 18px; }
.team-stack { display: grid; gap: 10px; }
.team-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px; }
.team-card .eyebrow { margin-bottom: 5px; }
.team-card h3 { margin: 0; }
.log-row { width: 100%; border: 1px solid var(--line); color: inherit; text-align: left; cursor: pointer; }
.log-row:hover { border-color: var(--blue); background: var(--surface-2); }
.log-row:disabled { cursor: default; opacity: 1; }
.log-row > span:first-child { display: grid; gap: 4px; }
.detail-card { max-width: 760px; padding: 23px; }
.detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 24px; }
.detail-list { display: grid; gap: 1px; margin: 0 0 23px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.detail-list > div { display: flex; justify-content: space-between; gap: 16px; padding: 13px 14px; background: #091a31; }
.detail-list > div + div { border-top: 1px solid var(--line); }
.detail-list dt { color: var(--muted); font-size: 12px; }
.detail-list dd { margin: 0; text-align: right; font-size: 13px; }
.detail-list a { color: var(--blue-2); }
.profile-card { padding: 22px; margin-bottom: 18px; }
.profile-large { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.profile-large img { border-radius: 16px; object-fit: cover; }
.profile-large h2 { margin-bottom: 4px; }
.profile-tag-form { display: grid; gap: 7px; margin-bottom: 22px; }
.profile-tag-form > label { color: var(--muted); font-size: 12px; font-weight: 650; }
.profile-tag-form .inline-actions { justify-content: stretch; }
.profile-tag-form input { min-width: 0; flex: 1; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; color: var(--ink); background: #091a31; }
.compact-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; }
.compact-stats > div { padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #091a31; }
.card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.stat-card { padding: 19px; }
.stat-value { display: block; margin: 4px 0 5px; font-size: 25px; font-weight: 750; }
.stat-label, .meta { color: var(--muted); font-size: 12px; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 13px; }
.section-head h2 { margin-bottom: 0; }
.card-list { display: grid; gap: 8px; }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 65px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(13,29,53,.72); }
.list-row strong { display: block; font-size: 14px; }
.list-row .meta { margin-top: 4px; }
.status { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; border-radius: 999px; padding: 5px 9px; color: var(--muted); background: #152b49; font-size: 11px; }
.status.success { color: #a6f5d5; background: rgba(66,217,154,.12); }
.status.warning { color: #ffe0a2; background: rgba(245,189,98,.13); }
.status.danger { color: #ffd2da; background: rgba(255,113,139,.12); }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; border: 1px solid var(--line); border-radius: 10px; padding: 0 15px; color: var(--ink); background: var(--surface-2); cursor: pointer; font-weight: 650; font-size: 13px; }
.button:hover { border-color: var(--blue); }
.button.primary { border-color: var(--blue); color: white; background: var(--blue); }
.button.ghost { background: transparent; }
.button.danger { color: #ffd2da; border-color: rgba(255,113,139,.45); }
.form-card { max-width: 700px; padding: 22px; }
.field { display: grid; gap: 7px; margin-bottom: 16px; }
.field label { color: var(--muted); font-size: 12px; font-weight: 650; }
.field-hint { color: var(--faint); font-size: 11px; font-weight: 400; }
.field input, .field textarea, .field select { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; color: var(--ink); background: #091a31; }
.field textarea { min-height: 130px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: var(--faint); }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 20px; }
.inline-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.template-row { align-items: flex-start; }
.template-row .meta { max-width: 500px; white-space: pre-wrap; }
.success-card { max-width: 700px; padding: 28px; }
.success-mark { display: grid; width: 38px; height: 38px; margin-bottom: 16px; place-items: center; border-radius: 50%; color: #071326; background: var(--green); font-size: 22px; font-weight: 800; }
.generated-link { overflow: auto; margin-top: 18px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 10px; color: var(--blue-2); background: #091a31; }
.generated-link code { font-family: "Noto Sans Mono", ui-monospace, monospace; font-size: 13px; white-space: nowrap; }
.success-card > .button { margin-top: 12px; }
.empty { padding: 38px 20px; border: 1px dashed var(--line); border-radius: 14px; color: var(--muted); text-align: center; }
.empty h3 { color: var(--ink); }
.loading { position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); background: rgba(7,19,38,.94); }
.loading[hidden], .gate[hidden] { display: none; }
.spinner { width: 18px; height: 18px; border: 2px solid var(--line); border-top-color: var(--blue-2); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.gate { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at 50% 20%, #102e57 0, var(--bg) 54%); }
.gate-card { width: min(390px, 100%); padding: 35px 28px; border: 1px solid var(--line); border-radius: 22px; background: rgba(13,29,53,.9); box-shadow: var(--shadow); text-align: center; }
.gate-card h1 { font-size: 27px; line-height: 1.15; }
.gate-card p:not(.eyebrow) { margin: 12px 0 25px; color: var(--muted); line-height: 1.55; }
.gate-avatar { display: block; margin: 0 auto 22px; border-radius: 20px; object-fit: cover; box-shadow: 0 10px 25px rgba(45,140,255,.25); }
.bottom-nav { display: none; }
@media (max-width: 800px) {
  .sidebar { display: none; }
  .main-content { padding: 23px 17px calc(92px + env(safe-area-inset-bottom)); }
  .topbar { margin-bottom: 23px; }
  .profile-chip span { display: none; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .stat-card { padding: 15px; }
  .stat-value { font-size: 21px; }
  .two-col { grid-template-columns: 1fr; }
  .hero { align-items: flex-start; flex-direction: column; }
  .hero .button { width: 100%; }
  .compact-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-head { flex-direction: column; }
  .bottom-nav { position: fixed; z-index: 20; right: 0; bottom: 0; left: 0; display: flex; justify-content: space-around; padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgba(9,26,49,.95); backdrop-filter: blur(14px); }
  .bottom-nav .nav-item { display: grid; justify-items: center; gap: 3px; padding: 7px 12px; font-size: 10px; }
  .bottom-nav .nav-item.active { box-shadow: inset 0 -2px 0 var(--blue); }
}
