:root {
  --bg: #0b0b0c;
  --surface: #111113;
  --surface-2: #18181b;
  --ink: #f4f4f5;
  --muted: #a1a1aa;
  --faint: #71717a;
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.16);
  --ok: #86efac;
  --warn: #fbbf24;
  --danger: #fca5a5;
  --radius: 14px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  font-family: Inter, "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
button:disabled { cursor: wait; opacity: 0.55; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }

.mark {
  width: 56px; height: 56px; border-radius: 16px;
  background: var(--surface-2); border: 1px solid var(--line);
  color: #fafafa; display: grid; place-items: center;
  font-size: 22px; font-weight: 650; letter-spacing: -0.04em;
}
.mark.small { width: 36px; height: 36px; border-radius: 11px; font-size: 15px; }

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 18px; border-radius: 999px;
  font-weight: 550; transition: background 160ms var(--ease), border-color 160ms var(--ease), color 160ms var(--ease);
}
.button.primary { background: #f4f4f5; color: #0b0b0c; }
.button.primary:hover { background: #fff; }
.button.ghost { border: 1px solid var(--line); color: #e4e4e7; }
.button.ghost:hover { background: rgba(255,255,255,0.05); border-color: var(--line-strong); }
.button.danger { border: 1px solid rgba(252,165,165,0.35); color: var(--danger); }
.button.danger:hover { background: rgba(252,165,165,0.08); }
.button.compact { min-height: 34px; padding: 0 14px; font-size: 13px; }
.button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid rgba(255,255,255,0.28); outline-offset: 2px;
}

input, select {
  width: 100%; min-height: 42px; padding: 10px 12px;
  background: #0f0f11; border: 1px solid var(--line); border-radius: 10px; color: var(--ink);
}
label { display: block; font-size: 12px; font-weight: 500; color: #d4d4d8; margin-bottom: 7px; }
.hint { color: var(--muted); font-size: 13px; margin-top: 4px; }
.caption { color: var(--faint); font-size: 12px; line-height: 1.55; margin-top: 8px; }
.error-text { min-height: 18px; color: var(--danger); font-size: 12px; text-align: center; }
.muted { color: var(--muted); }

/* Login — same language as access-id */
.login-screen {
  min-height: 100vh; display: grid; place-items: center;
  background: var(--bg); padding: 32px 20px;
}
.login-card { width: min(420px, 100%); text-align: center; }
.login-marks { display: flex; justify-content: center; margin-bottom: 36px; }
.login-card h1 {
  font-size: 32px; line-height: 1.15; letter-spacing: -0.04em; font-weight: 600; text-wrap: balance;
}
.login-card .muted { font-size: 15px; margin: 14px auto 0; max-width: 34ch; }
.login-card .muted strong { color: #e4e4e7; font-weight: 550; }
.login-card form { margin-top: 36px; text-align: left; }
.login-card input { margin-bottom: 14px; }
.login-actions { display: flex; justify-content: center; gap: 12px; margin-top: 8px; }
.login-actions .button { min-width: 132px; }

/* App shell */
.shell { min-height: 100vh; }
.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 22px; border-bottom: 1px solid var(--line);
  background: rgba(11, 11, 12, 0.88); backdrop-filter: blur(12px);
}
.top-brand { display: flex; align-items: center; gap: 12px; }
.top-brand strong { display: block; font-size: 14px; font-weight: 600; letter-spacing: -0.02em; }
.top-brand small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.top-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.page {
  width: min(760px, calc(100% - 40px));
  margin: 0 auto; padding: 36px 0 64px;
  display: grid; gap: 22px;
}

.banner {
  padding: 12px 14px; border-radius: 12px; font-size: 13px;
  background: rgba(251, 191, 36, 0.08); border: 1px solid rgba(251, 191, 36, 0.28); color: #fde68a;
}

.block {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.block-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 20px 20px 14px; border-bottom: 1px solid var(--line);
}
.block-head h2 { font-size: 16px; font-weight: 600; letter-spacing: -0.02em; }

.list { display: grid; }
.row {
  display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center;
  padding: 16px 20px; border-top: 1px solid var(--line);
}
.row:first-child { border-top: 0; }
.row:hover { background: rgba(255,255,255,0.02); }
.row-main strong { display: block; font-size: 14px; font-weight: 550; letter-spacing: -0.01em; }
.row-main small { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; word-break: break-all; }
.row-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 26px; padding: 0 10px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted); font-size: 12px; white-space: nowrap;
}
.pill.ok { color: var(--ok); border-color: rgba(134, 239, 172, 0.28); }
.pill.warn { color: var(--warn); border-color: rgba(251, 191, 36, 0.28); }
.pill.off { color: var(--faint); }

.stack { display: grid; gap: 0; }
.card {
  display: grid; gap: 10px; padding: 18px 20px; border-top: 1px solid var(--line);
}
.card:first-child { border-top: 0; }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-title strong { font-size: 13px; font-weight: 550; }
.people { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; min-height: 28px; padding: 0 10px;
  border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line);
  color: #e4e4e7; font-size: 12px;
}
.chip small { color: var(--faint); margin-left: 6px; }

.empty {
  padding: 36px 20px; text-align: center; color: var(--muted);
}
.empty strong { display: block; color: var(--ink); font-size: 15px; font-weight: 550; margin-bottom: 8px; }

.guide { padding: 16px 20px 22px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.guide p { margin: 0 0 12px; }
.guide ol { margin: 0; padding-left: 1.2em; display: grid; gap: 10px; }
.guide li { padding-left: 4px; }
.guide code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px; background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 6px; padding: 1px 6px; color: #e4e4e7;
}

/* Dialog */
dialog {
  padding: 0; border: 1px solid var(--line-strong); border-radius: 18px;
  width: min(480px, calc(100vw - 28px)); background: var(--surface); color: var(--ink);
  box-shadow: 0 24px 80px rgba(0,0,0,0.55); max-height: 90vh; overflow: auto;
}
dialog::backdrop { background: rgba(0,0,0,0.62); backdrop-filter: blur(4px); }
.modal-header {
  display: flex; justify-content: space-between; gap: 12px; align-items: flex-start;
  padding: 22px 22px 12px;
}
.modal-header h2 { font-size: 20px; letter-spacing: -0.03em; font-weight: 600; }
.close-button { font-size: 22px; color: var(--faint); line-height: 1; padding: 4px; }
.close-button:hover { color: var(--ink); }
.modal-body { padding: 8px 22px 8px; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap;
  padding: 16px 22px 22px;
}
.field { margin-bottom: 16px; }
.steps { display: flex; gap: 8px; padding: 0 22px 14px; }
.step { flex: 1; height: 3px; border-radius: 999px; background: rgba(255,255,255,0.08); }
.step.active { background: #f4f4f5; }
.summary-card {
  padding: 14px 16px; border-radius: 12px; background: var(--surface-2);
  border: 1px solid var(--line); margin-bottom: 16px;
}
.summary-card strong, .summary-card small { display: block; }
.summary-card small { color: var(--muted); margin-top: 4px; font-size: 12px; }
.check-list { max-height: 240px; overflow: auto; display: grid; gap: 8px; }
.check-item {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px;
  border: 1px solid var(--line); border-radius: 12px; cursor: pointer; font-weight: 450;
}
.check-item:hover { background: rgba(255,255,255,0.03); }
.check-item input { width: 16px; height: 16px; margin-top: 2px; accent-color: #f4f4f5; }
.check-item small { display: block; color: var(--faint); font-size: 11px; margin-top: 2px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  max-width: min(520px, calc(100vw - 24px));
  background: #18181b; border: 1px solid var(--line-strong); color: #f4f4f5;
  padding: 12px 16px; border-radius: 12px; font-size: 13px; z-index: 20;
  box-shadow: 0 12px 40px rgba(0,0,0,0.45);
}

@media (max-width: 640px) {
  .page { width: calc(100% - 28px); padding-top: 24px; }
  .top { padding: 14px 14px; }
  .row { grid-template-columns: 1fr; gap: 12px; }
  .row-meta, .row-actions { justify-content: flex-start; }
  .block-head { flex-direction: column; }
  .login-card h1 { font-size: 28px; }
  .login-actions { flex-direction: column-reverse; }
  .login-actions .button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
