:root {
    color-scheme: light;
    --page: #f4f7fa;
    --surface: #fff;
    --ink: #142336;
    --muted: #526374;
    --stroke: #dce5ea;
    --nav: #112132;
    --nav-hover: #223c4c;
    --accent: #006b60;
    --accent-hover: #00594f;
    --ace-light: #d9f2e8;
    --mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 15px;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--page); line-height: 1.55; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.9rem, 4vw, 2.55rem); line-height: 1.15; letter-spacing: -.042em; overflow-wrap: anywhere; }
h2 { font-size: 1.12rem; letter-spacing: -.016em; }
h3 { font-size: 1rem; }
a { color: var(--accent); }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
:focus-visible { outline: 3px solid #1b9e8c; outline-offset: 3px; }

.layout { display: grid; grid-template-columns: 15.65rem minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 1.6rem 1rem 1rem; background: var(--nav); color: white; }
.brand { display: inline-flex; align-items: center; gap: .65rem; font-size: 1.25rem; font-weight: 750; letter-spacing: -.035em; color: var(--ink); text-decoration: none; width: fit-content; }
.brand-icon, .empty-icon { display: grid; place-items: center; border-radius: .62rem; background: var(--ace-light); color: #075c53; width: 2.15rem; aspect-ratio: 1; font: 800 .95rem var(--mono); }
.sidebar .brand { color: #f7fbff; margin: 0 0 2rem .45rem; }
.sidebar nav { display: grid; gap: .3rem; }
.sidebar nav a { display: flex; align-items: center; gap: .63rem; padding: .68rem .7rem; color: #c2d1dd; text-decoration: none; border-radius: .5rem; font-weight: 600; white-space: nowrap; }
.sidebar nav a:hover, .sidebar nav a.active { color: #fff; background: var(--nav-hover); }
.sidebar nav a.active { box-shadow: inset 3px 0 #69d3b8; }
.sidebar nav a span { width: 1.15rem; text-align: center; color: #83d9c5; font-size: 1.15rem; line-height: 1; }
.identity { margin-top: auto; padding: .95rem 0 0; border-top: 1px solid #385062; display: flex; align-items: center; gap: .55rem; }
.avatar { display: grid; flex: 0 0 2rem; aspect-ratio: 1; border-radius: 50%; place-items: center; background: #2b4959; color: #e4f6ef; font-weight: 700; }
.identity-label { min-width: 0; flex: 1; }
.identity-label strong, .identity-label span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .78rem; }
.identity-label span { color: #b1c4d4; }
.signout { border: 1px solid #4a6071; border-radius: .42rem; background: none; color: white; padding: .23rem .5rem; }
.signout:hover { background: var(--nav-hover); }

.topbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .92rem clamp(1.1rem, 4vw, 3.3rem); background: var(--surface); border-bottom: 1px solid var(--stroke); min-height: 4.3rem; }
.topbar div { display: flex; gap: .65rem; flex-wrap: wrap; font-weight: 650; font-size: .92rem; overflow-wrap: anywhere; min-width: 0; }
.topbar div a { color: var(--muted); text-decoration: none; }
.topbar div a:hover { text-decoration: underline; }
.topbar div span { color: #728a97; }
.topbar .button { flex: 0 0 auto; }
.content { padding: clamp(1.65rem, 4vw, 3.15rem) clamp(1.1rem, 4vw, 3.3rem) 3rem; margin-inline: auto; max-width: 110rem; }
.intro { margin: .55rem 0 1.75rem; color: var(--muted); }
.content > .notice { margin-top: 1rem; }

.surface { background: var(--surface); border: 1px solid var(--stroke); border-radius: .8rem; min-width: 0; }
.panel, .panel-head { padding: 1.3rem; }
.panel-head { border-bottom: 1px solid var(--stroke); }
.form-panel { max-width: 42rem; }
.metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .9rem; margin-bottom: 1.35rem; }
.metric { padding: 1rem 1.2rem; display: grid; gap: .35rem; }
.metric span { color: var(--muted); font-size: .86rem; font-weight: 640; }
.metric strong { font-size: 1.72rem; font-weight: 740; font-variant-numeric: tabular-nums; }
.empty { text-align: center; display: grid; justify-items: center; gap: .45rem; padding: 3rem 1rem; }
.empty-icon { width: 2.85rem; font-size: 1.2rem; margin-bottom: .2rem; }
.empty p { color: var(--muted); }
.empty .button { margin-top: .55rem; }

.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: .9rem 1.2rem; border-bottom: 1px solid var(--stroke); white-space: nowrap; }
th { color: var(--muted); font-size: .8rem; font-weight: 700; background: #f7f9fb; }
td { font-size: .9rem; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f9fbfc; }
.endpoint-name { color: var(--ink); font-weight: 700; text-decoration: none; white-space: normal; overflow-wrap: anywhere; }
.endpoint-name:hover { text-decoration: underline; }
.row-id { display: block; margin-top: .18rem; color: var(--muted); font-size: .75rem; }
.arrow { font-size: 1.25rem; text-decoration: none; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; width: fit-content; border: 1px solid transparent; border-radius: .48rem; padding: .58rem .9rem; text-decoration: none; font-weight: 680; font-size: .91rem; line-height: 1.3; }
.button.primary { background: var(--accent); color: white; }
.button.primary:hover { background: var(--accent-hover); }
.button.secondary { background: var(--surface); color: var(--ink); border-color: #c8d6dd; }
.button.secondary:hover { background: var(--page); }
.button.danger { background: #fff5f5; color: #9b2631; border-color: #f0c8cc; }
.button.danger:hover { background: #fce8e9; }
.button.small { padding: .46rem .65rem; font-size: .82rem; }
.pill { display: inline-block; border-radius: .35rem; padding: .15rem .42rem; white-space: nowrap; line-height: 1.4; font-size: .75rem; font-weight: 740; }
.pill.get, .pill.public { background: #ddf5ed; color: #085f49; }
.pill.post { background: #e7effe; color: #264f97; }
.pill.private { background: #edf1f6; color: #42566a; }

.detail-grid { display: grid; align-items: start; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: .95rem; }
.guide-grid { display: grid; gap: .95rem; max-width: 55rem; }
.section-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .45rem; }
.subheading { padding-top: .65rem; border-top: 1px solid var(--stroke); }
.copy-box { display: flex; gap: .45rem; }
.copy-box .button { flex-shrink: 0; }
.copy-box input { font: .82rem var(--mono); }
code, pre { font-family: var(--mono); }
pre { margin: 0; background: #12263a; color: #e1f6ef; font-size: .83rem; border-radius: .45rem; padding: .82rem; overflow-wrap: anywhere; white-space: pre-wrap; }
.saved-value { max-height: 16rem; overflow: auto; }
details { border-top: 1px solid var(--stroke); padding-top: .7rem; }
summary { cursor: pointer; font-weight: 650; font-size: .9rem; color: var(--accent); }
.test-form { margin-top: .6rem; }
.test-result:empty { display: none; }
.test-result { font-size: .9rem; }

.auth-body { background: radial-gradient(ellipse at 15% 10%, #e5f3f0, transparent 60%), var(--page); min-height: 100vh; }
.auth-wrap { width: min(calc(100% - 2rem), 30rem); margin: 0 auto; padding: clamp(2rem, 7vw, 5rem) 0 2rem; }
.install-wrap { width: min(calc(100% - 2rem), 45rem); padding-top: clamp(1.5rem, 4vw, 3rem); }
.auth-wrap .brand { margin-bottom: 1.1rem; }
.auth-panel { padding: clamp(1.15rem, 4vw, 2.05rem); box-shadow: 0 8px 28px #1423360a; }
.auth-panel h1 { font-size: clamp(1.6rem, 4vw, 1.98rem); }
.auth-panel > p.muted { margin: .5rem 0 1.2rem; }
.auth-panel .button.primary { width: 100%; }
.auth-link { margin-top: 1rem; text-align: center; }
.stack { display: grid; gap: .85rem; min-width: 0; }
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
fieldset { display: grid; gap: .66rem; min-width: 0; margin: 0; padding: .7rem .8rem .9rem; border: 1px solid var(--stroke); border-radius: .5rem; }
legend { padding: 0 .25rem; font-weight: 700; }
label { display: grid; gap: .35rem; font-size: .9rem; font-weight: 650; }
input:not([type=checkbox]), textarea { min-width: 0; width: 100%; padding: .55rem .65rem; border: 1px solid #bdcbd4; border-radius: .42rem; color: var(--ink); background: var(--surface); }
textarea { resize: vertical; }
input[readonly] { background: #f4f7f9; }
.check { display: flex; align-items: baseline; gap: .48rem; font-weight: 600; }
input[type=checkbox] { margin: 0; accent-color: var(--accent); }
.muted, .hint { color: var(--muted); }
.hint { font-size: .83rem; }
.actions { display: flex; flex-wrap: wrap; gap: .55rem; }
.notice { padding: .65rem .8rem; margin-bottom: .95rem; border-radius: .48rem; font-size: .91rem; }
.notice.error { background: #fff0f0; border: 1px solid #f3c4c7; color: #8c2030; }
.notice.success { background: #e7f7f0; border: 1px solid #b6e5d0; color: #085f49; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@media (max-width: 950px) {
    .detail-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 680px) {
    .layout { display: block; }
    .sidebar { position: static; height: auto; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .65rem; padding: .7rem 1rem; }
    .sidebar .brand { margin: 0; }
    .sidebar nav { grid-row: 2; grid-column: span 2; display: flex; flex-wrap: wrap; }
    .sidebar nav a { padding: .4rem .58rem; font-size: .85rem; }
    .identity { border: 0; padding: 0; margin: 0; }
    .identity-label { display: none; }
    .topbar { min-height: 3.6rem; padding-block: .6rem; }
    .metric-grid { gap: .45rem; }
    .metric { padding: .6rem; }
    .metric span { font-size: .77rem; }
    .panel, .panel-head { padding: .9rem; }
}
@media (max-width: 440px) {
    .pair { grid-template-columns: minmax(0, 1fr); }
}
