:root {
  color-scheme: light;
  --ink: #102a43;
  --ink-muted: #627d98;
  --blue: #0b63ce;
  --blue-dark: #084b9c;
  --line: #d9e2ec;
  --surface: #ffffff;
  --surface-soft: #f5f8fb;
  --warning: #9a6700;
  --warning-bg: #fff8e6;
  --danger: #b42318;
  --success: #137333;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: #f1f5f9; color: var(--ink); line-height: 1.5; }
a { color: var(--blue); }
button, input, textarea { font: inherit; }
.hidden { display: none !important; }
.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 10; padding: 8px 12px; background: var(--ink); color: white; border-radius: 6px; }
.skip-link:focus { left: 8px; }
.topbar { min-height: 76px; padding: 14px clamp(16px, 5vw, 72px); background: var(--ink); color: white; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.brand-block, .topbar-actions, .section-heading, .hero, .inline-notice { display: flex; align-items: center; }
.brand-block { gap: 12px; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.45); border-radius: 11px; color: #b9e6ff; font-weight: 800; }
.eyebrow { margin: 0 0 2px; font-size: 10px; letter-spacing: .14em; font-weight: 750; color: var(--ink-muted); }
.topbar .eyebrow { color: #9fb3c8; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 20px; letter-spacing: -.02em; }
h2 { margin-bottom: 8px; font-size: clamp(22px, 3vw, 30px); letter-spacing: -.03em; }
h3 { margin-bottom: 18px; font-size: 18px; }
.shell { width: min(1440px, 100%); margin: 0 auto; padding: 28px clamp(16px, 5vw, 72px) 52px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 8px 24px rgba(16,42,67,.05); }
.hero { justify-content: space-between; gap: 28px; padding: clamp(22px, 4vw, 36px); margin-bottom: 18px; }
.hero p:not(.eyebrow), .login-panel p:not(.eyebrow), .notice-panel p { margin-bottom: 0; color: var(--ink-muted); }
.inline-notice { max-width: 460px; padding: 12px 14px; color: var(--warning); background: var(--warning-bg); border: 1px solid #f3d98b; border-radius: 10px; font-size: 13px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat-card { padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; min-width: 0; }
.stat-card span:last-child { color: var(--ink-muted); font-size: 12px; }
.stat-card strong { display: block; margin: 2px 0 2px; font-size: 28px; letter-spacing: -.04em; }
.stat-label { color: var(--ink-muted); font-size: 12px; font-weight: 700; }
.section-nav { display: flex; gap: 8px; overflow-x: auto; padding: 2px 1px 16px; scrollbar-width: thin; }
.section-nav a { flex: 0 0 auto; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; background: var(--surface); color: var(--ink); font-size: 13px; }
.section-nav a:hover, .section-nav a:focus-visible { border-color: var(--blue); color: var(--blue); }
.section-block { scroll-margin-top: 18px; margin-bottom: 18px; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 340px); gap: 18px; align-items: start; }
.content-grid > *, .table-panel, .form-panel, .system-panel, .safety-panel { min-width: 0; }
.table-panel, .form-panel, .system-panel, .safety-panel { padding: 22px; }
.section-heading { justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.section-heading h2 { margin-bottom: 0; font-size: 22px; }
.count-label { color: var(--ink-muted); font-size: 12px; white-space: nowrap; }
.table-wrap { max-width: 100%; min-width: 0; overflow-x: auto; }
table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 13px; }
th, td { padding: 12px 10px; text-align: left; border-bottom: 1px solid #edf2f7; vertical-align: top; }
th { color: var(--ink-muted); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; font-weight: 750; }
td { overflow-wrap: anywhere; }
tr:last-child td { border-bottom: 0; }
.empty-cell { padding: 28px 10px; color: var(--ink-muted); text-align: center; }
.status-chip, .tag { display: inline-flex; align-items: center; width: fit-content; border-radius: 999px; padding: 3px 9px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.status-neutral { color: #d9e2ec; border: 1px solid #486581; }
.status-ok, .tag-allow, .tag-active { color: var(--success); background: #e9f7ef; }
.status-warn, .tag-pending, .tag-draft { color: var(--warning); background: var(--warning-bg); }
.status-danger, .tag-deny, .tag-disabled { color: var(--danger); background: #fff0ef; }
.form-panel { display: grid; gap: 8px; }
.form-panel .eyebrow { margin-bottom: -2px; }
label { margin-top: 4px; font-size: 13px; font-weight: 700; }
label span { color: var(--ink-muted); font-weight: 400; }
input, textarea { width: 100%; border: 1px solid #9fb3c8; border-radius: 8px; padding: 9px 10px; color: var(--ink); background: white; }
input:focus, textarea:focus { outline: 3px solid rgba(11,99,206,.18); border-color: var(--blue); }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 9px 14px; border: 1px solid transparent; border-radius: 8px; font-weight: 700; font-size: 13px; text-decoration: none; cursor: pointer; }
.button:focus-visible { outline: 3px solid rgba(11,99,206,.28); outline-offset: 2px; }
.button-primary { background: var(--blue); color: white; }
.button-primary:hover { background: var(--blue-dark); }
.button-secondary { background: white; border-color: #9fb3c8; color: var(--ink); }
.button-quiet { color: white; border-color: #486581; }
.form-message { min-height: 20px; margin: 2px 0 0; color: var(--ink-muted); font-size: 12px; }
.details-list { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px 16px; margin: 0; font-size: 13px; }
.details-list dt { color: var(--ink-muted); }
.details-list dd { margin: 0; overflow-wrap: anywhere; text-align: right; font-weight: 700; }
.safety-list { margin: 0; padding-left: 19px; color: var(--ink-muted); font-size: 13px; }
.safety-list li + li { margin-top: 8px; }
.login-panel, .notice-panel { padding: clamp(22px, 5vw, 42px); display: flex; align-items: center; justify-content: space-between; gap: 26px; }
.notice-panel { border-color: #f3d98b; background: var(--warning-bg); }
.notice-icon { display: grid; flex: 0 0 34px; height: 34px; place-items: center; border-radius: 50%; background: #f3d98b; color: var(--warning); font-weight: 800; }
.error-panel { margin-top: 20px; padding: 24px; border-color: #f1b8b4; }
.error-panel p { color: var(--ink-muted); }
.footer { width: min(1440px, 100%); margin: 0 auto; padding: 0 clamp(16px, 5vw, 72px) 26px; display: flex; justify-content: space-between; gap: 12px; color: var(--ink-muted); font-size: 11px; }

@media (max-width: 860px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .content-grid { grid-template-columns: 1fr; }
  .hero, .login-panel, .notice-panel { align-items: flex-start; flex-direction: column; }
  .inline-notice { max-width: none; width: 100%; }
}
@media (max-width: 520px) {
  .topbar { align-items: flex-start; flex-direction: column; }
  .topbar-actions { width: 100%; justify-content: space-between; }
  .shell { padding-top: 18px; }
  .stat-grid { gap: 9px; }
  .stat-card { padding: 14px; }
  .stat-card strong { font-size: 24px; }
  .table-panel, .form-panel, .system-panel, .safety-panel { padding: 16px; border-radius: 13px; }
  .footer { align-items: flex-start; flex-direction: column; }
}
