:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #171717;
  background: #fff;
  font-synthesis: none;
  --bg: #fff;
  --subtle: #f7f7f8;
  --surface: #fff;
  --line: #e5e5e5;
  --line-strong: #d0d0d0;
  --text: #171717;
  --muted: #6b6b6b;
  --faint: #909090;
  --accent: #10a37f;
  --accent-strong: #0d8a6c;
  --danger: #c83b46;
  --danger-soft: #fff4f4;
  --radius: 14px;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body { min-height: 100vh; margin: 0; color: var(--text); background: var(--bg); }
a { color: inherit; }
button, input, select { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.site-shell { width: min(1120px, calc(100% - 40px)); margin: 0 auto; }
.site-header {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 650; text-decoration: none; letter-spacing: -.02em; }
.brand::before { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 7px; color: #fff; background: var(--text); content: "D"; font-size: 12px; font-weight: 750; }
.site-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.site-nav a { padding: 8px 10px; border-radius: 8px; color: var(--muted); text-decoration: none; font-size: 14px; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); background: var(--subtle); }
.language-toggle { min-height: 34px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: #fff; font: inherit; font-size: 13px; }
.language-toggle:hover { color: var(--text); background: var(--subtle); }

.hero { max-width: 820px; padding: 110px 0 76px; }
.eyebrow { margin: 0 0 18px; color: var(--muted); font-size: 12px; font-weight: 650; letter-spacing: .09em; text-transform: uppercase; }
.hero h1 { max-width: 760px; margin: 0; font-size: clamp(44px, 7vw, 72px); line-height: 1.04; letter-spacing: -.055em; font-weight: 620; }
.hero-copy { max-width: 650px; margin: 24px 0 0; color: var(--muted); font-size: 18px; line-height: 1.7; }
.card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding-bottom: 92px; }
.card { min-height: 190px; display: flex; flex-direction: column; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); text-decoration: none; transition: background-color .15s ease, border-color .15s ease; }
.card:hover { border-color: var(--line-strong); background: var(--subtle); }
.card-mark { color: var(--faint); font-size: 12px; font-weight: 650; letter-spacing: .06em; }
.card h2 { margin: 28px 0 8px; font-size: 21px; letter-spacing: -.025em; font-weight: 620; }
.card p { margin: 0; color: var(--muted); line-height: 1.6; }
.card-arrow { margin-top: auto; padding-top: 20px; color: var(--text); font-size: 14px; font-weight: 600; }
.site-footer { padding: 28px 0 42px; border-top: 1px solid var(--line); color: var(--faint); font-size: 13px; }

.page-main { padding: 56px 0 88px; }
.page-heading { max-width: 760px; margin: 0 0 30px; }
.page-heading h1 { margin: 0 0 12px; font-size: clamp(34px, 5vw, 50px); line-height: 1.08; letter-spacing: -.045em; font-weight: 620; }
.page-heading p { margin: 0; color: var(--muted); line-height: 1.65; }
.panel { padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.panel + .panel { margin-top: 14px; }
.panel h2 { margin: 0 0 20px; font-size: 19px; font-weight: 620; letter-spacing: -.02em; }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.field { display: grid; gap: 7px; color: var(--muted); font-size: 13px; font-weight: 600; }
.field input, .field select { width: 100%; min-height: 42px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 9px; color: var(--text); background: #fff; outline: none; }
.field input:focus, .field select:focus { border-color: var(--text); box-shadow: 0 0 0 1px var(--text); }
.actions { display: flex; gap: 9px; align-items: end; flex-wrap: wrap; }
.panel-title-row { justify-content: space-between; align-items: center; }
.panel-title-row h2 { margin: 0; }
.button { min-height: 40px; padding: 0 15px; border: 1px solid var(--line-strong); border-radius: 9px; background: #fff; color: var(--text); font-weight: 600; }
.button:hover:not(:disabled) { background: var(--subtle); }
.button.primary { border-color: var(--text); background: var(--text); color: #fff; }
.button.primary:hover:not(:disabled) { background: #333; }
.button.danger { border-color: #efc5c8; color: var(--danger); }
.button:disabled { cursor: not-allowed; opacity: .5; }
.message { margin: 16px 0 0; padding: 11px 13px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: var(--subtle); line-height: 1.5; }
.message[data-tone="danger"] { border-color: #f0c8ca; color: var(--danger); background: var(--danger-soft); }
.message[data-tone="success"] { border-color: #b9dfd4; color: #08765b; background: #f2fbf8; }
.user-list { display: grid; gap: 8px; margin-top: 18px; }
.user-row { display: grid; grid-template-columns: minmax(150px, 1.2fr) minmax(100px, .7fr) minmax(110px, .6fr) minmax(180px, 1fr) auto; align-items: end; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 11px; }
.user-name { align-self: center; }
.user-name strong { display: block; }
.user-name small { color: var(--faint); }
.checkbox-field { min-height: 42px; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 600; }
.auth-panel { width: min(520px, 100%); margin: 20px auto 0; }
.auth-form { display: grid; gap: 16px; }
.auth-actions { display: flex; justify-content: flex-end; gap: 10px; }

.speed-summary { display: grid; grid-template-columns: minmax(260px, .8fr) minmax(0, 1.2fr); gap: 14px; }
.latency-primary { min-height: 260px; display: flex; flex-direction: column; justify-content: space-between; }
.latency-value { margin: 12px 0 0; font-size: clamp(58px, 10vw, 92px); line-height: 1; letter-spacing: -.065em; font-weight: 560; }
.latency-value span { margin-left: 7px; color: var(--muted); font-size: 18px; letter-spacing: 0; }
.latency-grade { color: var(--muted); font-size: 14px; }
.metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--line); }
.metric { min-height: 112px; padding: 18px; background: #fff; }
.metric-label { display: block; color: var(--muted); font-size: 12px; }
.metric-value { display: block; margin-top: 16px; font-size: 23px; font-weight: 620; letter-spacing: -.025em; }
.speed-chart { width: 100%; height: 190px; display: block; margin-top: 20px; }
.speed-note { margin: 14px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.navigation-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.navigation-step { padding: 15px; border: 1px solid var(--line); border-radius: 10px; }
.navigation-step span { display: block; color: var(--muted); font-size: 12px; }
.navigation-step strong { display: block; margin-top: 9px; font-size: 18px; font-weight: 620; }

.db-layout { min-height: 620px; display: grid; grid-template-columns: 230px minmax(0, 1fr); overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); }
.db-sidebar { padding: 14px; border-right: 1px solid var(--line); background: var(--subtle); }
.db-sidebar-head { padding: 8px 8px 14px; }
.db-sidebar-head strong { display: block; font-size: 14px; }
.db-sidebar-head span { display: block; margin-top: 5px; color: var(--faint); font-size: 12px; }
.db-table-list { display: grid; gap: 3px; }
.db-table-button { width: 100%; display: flex; justify-content: space-between; gap: 8px; padding: 10px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; text-align: left; }
.db-table-button:hover, .db-table-button[aria-current="true"] { color: var(--text); background: #e9e9eb; }
.db-table-button small { color: var(--faint); }
.db-main { min-width: 0; padding: 22px; }
.db-toolbar { min-height: 46px; display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.db-title { margin: 0; font-size: 24px; font-weight: 620; letter-spacing: -.03em; }
.db-subtitle { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.db-tabs { display: flex; gap: 4px; margin: 18px 0 12px; }
.db-tab { min-height: 36px; padding: 0 12px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; font-weight: 600; }
.db-tab[aria-pressed="true"] { color: var(--text); background: var(--subtle); }
.db-table-wrap { width: 100%; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.db-data-table { width: 100%; border-spacing: 0; border-collapse: separate; font-size: 13px; }
.db-data-table th { position: sticky; z-index: 1; top: 0; padding: 10px 12px; border-bottom: 1px solid var(--line); color: var(--muted); background: var(--subtle); font-weight: 600; text-align: left; white-space: nowrap; }
.db-data-table td { max-width: 420px; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.db-data-table tr:last-child td { border-bottom: 0; }
.db-cell { max-height: 180px; margin: 0; overflow: auto; color: var(--text); font: 12px/1.55 "SFMono-Regular", Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.db-null { color: var(--faint); font-style: italic; }
.db-sensitive { color: var(--danger); }
.db-type { color: var(--muted); font-family: "SFMono-Regular", Consolas, monospace; font-size: 12px; }
.db-key { display: inline-flex; margin-left: 6px; padding: 2px 5px; border-radius: 5px; color: #08765b; background: #edf8f5; font-size: 10px; }
.db-pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; color: var(--muted); font-size: 13px; }
.db-empty { display: grid; min-height: 360px; place-items: center; color: var(--muted); text-align: center; }
.security-note { margin: 14px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }

@media (max-width: 900px) {
  .form-grid, .speed-summary { grid-template-columns: 1fr; }
  .navigation-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .user-row { grid-template-columns: 1fr 1fr; }
  .user-name { grid-column: 1 / -1; }
  .db-layout { grid-template-columns: 1fr; }
  .db-sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
  .db-table-list { display: flex; overflow-x: auto; }
  .db-table-button { width: auto; min-width: 130px; }
}

@media (max-width: 620px) {
  .site-shell { width: min(100% - 24px, 1120px); }
  .site-header { min-height: auto; align-items: flex-start; flex-direction: column; padding: 14px 0; }
  .hero { padding: 72px 0 54px; }
  .card-grid, .metric-grid, .navigation-grid { grid-template-columns: 1fr; }
  .page-main { padding-top: 38px; }
  .panel { padding: 18px; }
  .user-row { grid-template-columns: 1fr; }
  .user-name { grid-column: auto; }
  .db-main { padding: 16px; }
  .db-toolbar { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
