:root {
  color-scheme: light;
  --navy: #0b203b;
  --muted: #64748b;
  --line: #d8e2ee;
  --canvas: #eef4f9;
  --surface: #ffffff;
  --blue: #0877f9;
  --blue-soft: #eaf3ff;
  --green: #07977d;
  --red: #c94655;
  font-family: Pretendard, "Noto Sans KR", Inter, system-ui, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; color: var(--navy); background: var(--canvas); }
button, input, select { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.gate { min-height: 100vh; background: #f4f7fb; }
.auth-gate { display: grid; grid-template-rows: 64px 1fr; padding: 0; }
.auth-head { display: flex; align-items: center; padding: 0 clamp(24px, 5vw, 72px); border-bottom: 1px solid var(--line); background: #fff; }
.auth-head .brand { margin: 0; }
.brand small { margin-left: 8px; color: #718096; font-size: 10px; font-weight: 700; letter-spacing: .12em; }
.auth-main { display: grid; place-items: center; padding: 56px 24px 80px; }
.auth-content { width: min(820px, 100%); text-align: center; }
.auth-title > p { margin: 0 0 10px; color: var(--blue); font-size: 14px; font-weight: 800; }
.auth-title h1 { margin: 0; font-size: clamp(32px, 5vw, 46px); letter-spacing: -.055em; }
.auth-title > span { display: block; margin-top: 14px; color: var(--muted); font-size: 15px; }
.auth-entry-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 38px auto 18px; }
.auth-entry { position: relative; display: grid; justify-items: start; min-height: 188px; padding: 24px; border: 1px solid #cad7e6; border-radius: 14px; background: #fff; color: var(--navy); text-align: left; box-shadow: 0 7px 24px rgba(12,32,58,.045); transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
.auth-entry:hover { transform: translateY(-2px); border-color: #7fb7fa; box-shadow: 0 12px 30px rgba(12,32,58,.1); }
.auth-entry.primary-entry { border-color: var(--blue); background: var(--blue); color: #fff; }
.entry-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--blue-soft); color: var(--blue); font-size: 20px; font-weight: 700; }
.primary-entry .entry-icon { background: rgba(255,255,255,.18); color: #fff; }
.auth-entry strong { align-self: end; font-size: 21px; line-height: 1.25; letter-spacing: -.03em; }
.auth-entry small { margin-top: 4px; color: #8090a4; font-size: 12px; }
.primary-entry small { color: rgba(255,255,255,.75); }
.auth-benefit { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px; min-height: 62px; padding: 0 20px; border: 1px solid #cfe0f2; border-radius: 11px; background: #fff; text-align: left; }
.auth-benefit span { color: var(--blue); font-size: 12px; font-weight: 800; }
.auth-benefit strong { font-size: 13px; }
.auth-benefit b { color: var(--blue); font-size: 16px; }
.auth-message { text-align: center; }
.auth-dialog { width: min(470px, calc(100% - 28px)); border: 0; border-radius: 15px; padding: 0; color: var(--navy); box-shadow: 0 24px 80px rgba(5,19,38,.28); }
.auth-dialog::backdrop { background: rgba(4,14,27,.62); backdrop-filter: blur(2px); }
.auth-dialog > form { padding: 26px; }
.auth-dialog header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 8px; }
.auth-dialog h2 { margin: 2px 0 0; font-size: 25px; letter-spacing: -.04em; }
.eyebrow { margin: 0; color: var(--blue); font-size: 11px; font-weight: 800; }
.dialog-close { width: 38px; height: 38px; border: 0; border-radius: 9px; background: #f2f6fa; color: #38506d; font-size: 24px; line-height: 1; }
.dialog-lead { margin: 0 0 18px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.dialog-submit { width: 100%; margin-top: 22px; }
.signup-dialog { width: min(610px, calc(100% - 28px)); }
.signup-progress { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin: 22px 0 26px; padding: 0; list-style: none; }
.signup-progress li { position: relative; display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 34px; border-bottom: 2px solid #dce5ee; color: #91a0b2; font-size: 12px; font-weight: 800; }
.signup-progress li.active { border-color: var(--blue); color: var(--blue); }
.signup-progress span { font-weight: 700; }
.signup-step { min-height: 250px; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.consent-row { display: flex; align-items: flex-start; gap: 10px; margin-top: 18px; padding: 13px 14px; border: 1px solid #dce5ee; border-radius: 9px; background: #f8fafc; text-align: left; }
.consent-row.optional { margin-top: 8px; background: #fff; }
.consent-row input { margin-top: 2px; accent-color: var(--blue); }
.consent-row strong, .consent-row small { display: block; }
.consent-row strong { font-size: 13px; }
.consent-row small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.otp-wrap { display: grid; grid-template-columns: 1fr auto; gap: 9px; }
.otp-wrap input { min-height: 54px; border: 1px solid #c8d5e3; border-radius: 9px; padding: 0 16px; font-size: 24px; font-weight: 800; letter-spacing: .34em; text-align: center; }
.signup-complete { display: grid; place-items: center; align-content: center; text-align: center; }
.complete-mark { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; background: #e1f8f1; color: var(--green); font-size: 28px; font-weight: 900; }
.signup-complete h3 { margin: 18px 0 4px; font-size: 22px; }
.signup-complete p { margin: 0; color: var(--muted); font-size: 13px; }
.gate-card {
  width: min(420px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 32px;
  box-shadow: 0 18px 60px rgba(11, 32, 59, .09);
}
.brand { margin: 0 0 28px; font-size: 20px; font-weight: 800; letter-spacing: -.03em; }
.brand span { color: #02b8df; }
.gate h1 { margin: 0 0 8px; font-size: 26px; letter-spacing: -.04em; }
.gate .lead { margin: 0 0 24px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.field { display: grid; gap: 8px; margin-top: 16px; }
.field label { font-size: 13px; font-weight: 700; }
.field input, .field select, .toolbar select {
  width: 100%; min-height: 44px; border: 1px solid #c8d5e3; border-radius: 8px;
  padding: 0 13px; color: var(--navy); background: #fff; outline: none;
}
.field input:focus, .field select:focus, .toolbar select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(8,119,249,.1); }
.primary, .secondary, .text-button {
  border-radius: 8px; min-height: 42px; padding: 0 16px; font-weight: 700;
}
.primary { border: 1px solid var(--blue); background: var(--blue); color: #fff; }
.secondary { border: 1px solid #c8d5e3; background: #fff; color: var(--navy); }
.text-button { border: 0; background: transparent; color: var(--blue); padding-inline: 4px; }
.primary:disabled, .secondary:disabled { cursor: default; opacity: .5; }
.gate .primary { width: 100%; margin-top: 24px; }
.message { min-height: 20px; margin: 14px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.message[data-tone="error"] { color: var(--red); }

.shell { min-height: 100vh; display: grid; grid-template-columns: 216px minmax(0, 1fr); }
.sidebar { background: #07101b; color: #c8d5e3; padding: 28px 20px; }
.sidebar .brand { color: #fff; }
.nav-label { margin: 26px 8px 9px; color: #718096; font-size: 11px; }
.nav-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 42px; padding: 0 12px; border: 0; border-radius: 8px; color: #aebed0; background: transparent; font-size: 14px; text-align: left; }
.nav-item.active { color: #6db5ff; background: #12345e; }
.main { min-width: 0; }
.topbar { height: 64px; display: flex; align-items: center; justify-content: flex-end; gap: 16px; padding: 0 30px; background: #fff; border-bottom: 1px solid var(--line); }
.identity { text-align: right; }
.identity strong { display: block; font-size: 13px; }
.identity span { color: var(--muted); font-size: 11px; }
.content { padding: 36px clamp(20px, 4vw, 56px) 60px; }
.page-head { display: flex; justify-content: space-between; gap: 20px; align-items: end; margin-bottom: 26px; }
.page-head h1 { margin: 0; font-size: 32px; letter-spacing: -.05em; }
.page-head p { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.toolbar { display: grid; grid-template-columns: repeat(2, minmax(120px, 170px)) auto; gap: 10px; align-items: end; }
.toolbar label { display: grid; gap: 6px; color: var(--muted); font-size: 11px; font-weight: 700; }
.toolbar select { min-height: 38px; }
.view-state { min-height: 24px; margin-bottom: 12px; color: var(--muted); font-size: 13px; }
.view-state[data-tone="error"] { color: var(--red); }
.cards { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.card { min-height: 132px; padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.card span { color: var(--muted); font-size: 13px; }
.card strong { display: block; margin-top: 14px; font-size: 28px; letter-spacing: -.04em; }
.card small { display: block; margin-top: 8px; color: var(--green); font-size: 11px; }
.chart { margin-top: 16px; min-height: 260px; padding: 22px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.chart h2 { margin: 0 0 6px; font-size: 18px; }
.chart p { margin: 0; color: var(--muted); font-size: 12px; }
.series { height: 150px; display: flex; align-items: end; gap: 6px; margin-top: 28px; border-bottom: 1px solid var(--line); }
.bar { flex: 1; min-width: 3px; max-width: 34px; border-radius: 4px 4px 0 0; background: #65aafc; }
.bar-1 { height: 5%; } .bar-2 { height: 10%; } .bar-3 { height: 15%; } .bar-4 { height: 20%; }
.bar-5 { height: 25%; } .bar-6 { height: 30%; } .bar-7 { height: 35%; } .bar-8 { height: 40%; }
.bar-9 { height: 45%; } .bar-10 { height: 50%; } .bar-11 { height: 55%; } .bar-12 { height: 60%; }
.bar-13 { height: 65%; } .bar-14 { height: 70%; } .bar-15 { height: 75%; } .bar-16 { height: 80%; }
.bar-17 { height: 85%; } .bar-18 { height: 90%; } .bar-19 { height: 95%; } .bar-20 { height: 100%; }
.mfa-actions { display: flex; gap: 8px; margin-top: 18px; }
.mfa-panel { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.mfa-panel code { display: block; overflow-wrap: anywhere; padding: 12px; border-radius: 8px; background: #f3f7fb; color: #344963; font-size: 11px; }
.mfa-panel canvas { display: block; width: min(240px, 100%); height: auto; margin: 0 auto; border: 10px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.settings-panel { padding: 24px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.settings-panel h2 { margin: 0; font-size: 18px; }
.settings-panel > p { margin: 7px 0 22px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.setting-row { display: flex; justify-content: space-between; gap: 20px; align-items: center; min-height: 56px; border-top: 1px solid #edf2f7; }
.setting-row:first-of-type { border-top: 0; }
.setting-row strong { display: block; font-size: 14px; }
.setting-row span { color: var(--muted); font-size: 11px; }
.setting-row input[type="checkbox"] { width: 38px; height: 22px; accent-color: var(--blue); }
.setting-row select { min-width: 132px; min-height: 36px; border: 1px solid #c8d5e3; border-radius: 7px; padding: 0 10px; background: #fff; }
.panel-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.integration-head { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto; gap: 10px; align-items: end; }
.integration-head .field { margin: 0; }
.table-wrap { margin-top: 16px; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th, .data-table td { padding: 14px 16px; border-bottom: 1px solid #e8eef5; text-align: left; white-space: nowrap; }
.data-table th { color: var(--muted); background: #f8fafc; font-size: 11px; }
.data-table tr:last-child td { border-bottom: 0; }
.row-actions { display: flex; gap: 8px; }
.row-actions button { min-height: 32px; padding: 0 10px; }
.row-actions .danger { color: var(--red); }
.empty-cell { padding-block: 34px !important; color: var(--muted); text-align: center !important; }
.status-pill { display: inline-flex; padding: 4px 8px; border-radius: 999px; background: #e7f8f2; color: #087f6b; font-size: 11px; font-weight: 700; }
.status-pill.retiring { background: #fff4df; color: #99610a; }
.status-pill.revoked { background: #eef2f6; color: #64748b; }
.secret-panel { margin: 16px 0; padding: 18px; border: 1px solid #7bb6ff; border-radius: 10px; background: #f4f9ff; }
.secret-panel strong { display: block; margin-bottom: 6px; }
.secret-panel p { margin: 0 0 12px; color: var(--muted); font-size: 12px; }
.secret-value { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; }
.secret-value input { min-width: 0; height: 40px; border: 1px solid #c8d5e3; border-radius: 7px; padding: 0 10px; background: #fff; }
.integration-section { margin-top: 24px; }
.panel-heading { display: flex; justify-content: space-between; align-items: start; gap: 16px; }
.panel-heading p { margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.event-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 18px 0 0; padding: 16px; border: 1px solid #e8eef5; border-radius: 8px; }
.event-grid legend { padding: 0 6px; color: var(--muted); font-size: 12px; font-weight: 700; }
.event-grid label { display: flex; gap: 8px; align-items: center; font-size: 13px; }
.safe-note { color: var(--muted); font-size: 12px; line-height: 1.6; }
.webhook-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; padding-top: 18px; border-top: 1px solid #edf2f7; }
.provider-toolbar { display: flex; justify-content: flex-end; margin-bottom: 12px; }
.provider-toolbar .field { width: min(220px, 100%); margin: 0; }
.provider-form { margin-bottom: 16px; }
.provider-form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 12px; }
.data-table input, .data-table select { min-height: 34px; border: 1px solid #c8d5e3; border-radius: 7px; padding: 0 8px; background: #fff; }
.notice-stack { margin: 0 0 18px; }
.notice-stack:has([data-notification-list]:empty) { margin-bottom: 0; }
.orange-notice { display: flex; align-items: stretch; margin: 8px 0; overflow: hidden; border: 1px solid #f0b35c; border-radius: 10px; background: #fff8e9; color: #5f3d08; }
.notice-copy { flex: 1; display: grid; gap: 4px; padding: 13px 15px; border: 0; background: transparent; color: inherit; text-align: left; }
.notice-copy strong { font-size: 13px; } .notice-copy span { font-size: 12px; line-height: 1.5; }
.notice-dismiss { width: 42px; min-height: 42px; padding: 0; border: 0; border-left: 1px solid #f0cf98; background: transparent; color: #895b13; font-size: 19px; }
.legal-notice { margin: 14px 24px 0; }
.notice-action { min-width: 88px; padding: 0 18px; border: 0; border-left: 1px solid #f0cf98; background: transparent; color: #754706; font-weight: 700; }
.legal-dialog { width: min(620px, calc(100% - 28px)); }
.legal-dialog section { display: grid; gap: 10px; padding-top: 4px; border-top: 1px solid #e5ebf1; }
.legal-dialog h3 { margin: 8px 0 0; font-size: 15px; }
.legal-document-list { display: grid; gap: 8px; }
.legal-document { display: grid; grid-template-columns: 1fr auto; gap: 8px 14px; align-items: center; padding: 11px 12px; border: 1px solid #d9e2eb; border-radius: 9px; }
.legal-document label { display: flex; align-items: center; gap: 8px; min-width: 0; }
.legal-document a { color: #9b5e08; font-size: 12px; font-weight: 700; }
.legal-check { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; line-height: 1.5; }
.filter-bar, .inline-form { display: flex; align-items: end; gap: 8px; flex-wrap: wrap; }
.filter-bar input, .filter-bar select, .inline-form input, .inline-form select { min-height: 42px; border: 1px solid #c8d5e3; border-radius: 8px; padding: 0 11px; background: #fff; }
.filter-bar input { min-width: min(320px, 100%); }
.split-view { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr); gap: 16px; align-items: start; }
.detail-panel { min-width: 0; margin-top: 16px; padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.detail-panel h2, .detail-panel h3, .content > h2 { margin: 0 0 12px; }
.detail-panel h3 { margin-top: 22px; font-size: 14px; }
.detail-panel dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 14px; font-size: 12px; }
.detail-panel dt { color: var(--muted); } .detail-panel dd { margin: 0; overflow-wrap: anywhere; }
.selectable { cursor: pointer; } .selectable:hover { background: #f5f9fd; }
.load-more { margin-top: 12px; }
.two-column { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 18px 0 28px; }
.cards.compact { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cards.compact .card { min-height: 104px; }
.request-messages { display: grid; gap: 8px; }
.request-messages article { padding: 12px; border-radius: 8px; background: #f5f8fb; }
.request-messages p { margin: 6px 0 0; white-space: pre-wrap; }
.request-response { display: grid; gap: 9px; margin-top: 18px; }
.request-response textarea { min-height: 100px; resize: vertical; border: 1px solid #c8d5e3; border-radius: 8px; padding: 10px; }
.timeline { display: grid; gap: 8px; padding-left: 20px; color: var(--muted); font-size: 12px; }
.admin-dialog { width: min(520px, calc(100% - 28px)); border: 0; border-radius: 14px; padding: 0; box-shadow: 0 22px 70px rgba(5, 19, 38, .3); }
.admin-dialog::backdrop { background: rgba(4, 14, 27, .62); }
.admin-dialog form { display: grid; gap: 14px; padding: 22px; }
.admin-dialog header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.admin-dialog h2 { margin: 0; }
.reauth-display { display: grid; place-items: center; min-height: 120px; padding: 12px; border-radius: 8px; background: #f4f7fa; }
.reauth-display canvas { max-width: 230px; width: 100%; height: auto; }
.reauth-display code { overflow-wrap: anywhere; }
.phone-reveal { padding: 16px; border: 1px solid #f0b35c; border-radius: 10px; background: #fff8e9; font-size: 20px; font-weight: 700; text-align: center; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 76px minmax(0, 1fr); }
  .sidebar { padding-inline: 12px; }
  .sidebar .brand { font-size: 0; }
  .sidebar .brand::after { content: "DP"; font-size: 17px; }
  .nav-item { justify-content: center; font-size: 0; }
  .nav-item::before { content: "•"; font-size: 22px; }
  .nav-label { display: none; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-head { align-items: start; flex-direction: column; }
  .settings-grid { grid-template-columns: 1fr; }
  .provider-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split-view { grid-template-columns: 1fr; }
  .cards.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .auth-main { padding: 34px 16px 52px; }
  .auth-entry-grid { grid-template-columns: 1fr; margin-top: 28px; }
  .auth-entry { min-height: 112px; grid-template-columns: auto 1fr; column-gap: 14px; align-items: center; }
  .auth-entry strong { align-self: center; }
  .auth-entry small { grid-column: 2; }
  .auth-benefit { grid-template-columns: 1fr auto; gap: 6px 12px; padding-block: 12px; }
  .auth-benefit strong { grid-column: 1 / -1; grid-row: 2; }
  .form-grid { grid-template-columns: 1fr; gap: 0; }
  .shell { display: block; }
  .sidebar { display: flex; position: sticky; top: 0; z-index: 10; gap: 6px; overflow-x: auto; padding: 10px 12px; }
  .sidebar .brand, .sidebar .nav-label { display: none; }
  .nav-item { flex: 0 0 auto; width: auto; min-height: 38px; padding-inline: 12px; font-size: 12px; }
  .nav-item::before { display: none; }
  .content { padding-inline: 16px; }
  .topbar { padding-inline: 16px; }
  .cards { grid-template-columns: 1fr; }
  .toolbar { width: 100%; grid-template-columns: 1fr 1fr; }
  .toolbar button { grid-column: 1 / -1; }
  .integration-head { grid-template-columns: 1fr; }
  .secret-value { grid-template-columns: 1fr; }
  .event-grid, .provider-form-grid { grid-template-columns: 1fr; }
  .two-column, .cards.compact { grid-template-columns: 1fr; }
  .panel-heading { flex-direction: column; }
}
