:root {
  color-scheme: light dark;
  --bg: light-dark(#f2f2ef, #1b1c1a);
  --surface: light-dark(#fafaf7, #222320);
  --ink: light-dark(#20211f, #f1f1eb);
  --muted: light-dark(#73756e, #a8aaa1);
  --line: light-dark(#d3d4cd, #3d3e39);
  --yellow: #c49b22;
  --red: #c03530;
  --max: 1120px;
}
*, html {
  box-sizing: border-box;
}
html {
  min-width: 320px;
  background: var(--bg);
}
body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.45;
}
a { color: inherit; }
button, input, select { font: inherit; }
button:disabled { cursor: default; }
h1, h2, p, dl { margin: 0; }
h1 {
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1;
  letter-spacing: -0.06em;
  font-weight: 650;
}
h2 {
  font-size: 17px;
  line-height: 1.15;
  letter-spacing: -0.025em;
  font-weight: 650;
}
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
}
label {
  color: var(--muted);
  font-size: 12px;
}
input, select {
  width: 100%;
  min-height: 40px;
  padding: 9px 10px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 7px;
  outline: 0;
  background: transparent;
}
input:disabled, select:disabled {
  color: var(--muted);
  background: color-mix(in srgb, var(--surface), var(--ink) 6%);
}
.topbar, main, footer {
  width: min(calc(100% - 48px), var(--max));
  margin-inline: auto;
}
main {
  flex: 1;
  padding: 58px 0 60px;
}
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-4 { gap: 24px; }
.shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.topbar {
  min-height: 70px;
  display: flex;
  align-items: center;
  gap: 34px;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 400;
  letter-spacing: -0.02em;
}
.brand.is-current {
  color: var(--ink);
  font-weight: 700;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  color: var(--bg);
  background: var(--ink);
  font-size: 10px;
  letter-spacing: 0;
  border-radius: 6px;
}
.main-nav {
  display: flex;
  align-self: stretch;
  align-items: center;
  gap: 24px;
  flex: 1;
}
.main-nav a {
  display: inline-flex;
  align-items: center;
  height: 100%;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
}
.main-nav a.is-current {
  color: var(--ink);
  font-weight: 650;
  box-shadow: inset 0 -2px var(--ink);
}
.device-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.device-state i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
}
.browser-note {
  width: min(calc(100% - 48px), var(--max));
  margin: 18px auto 0;
}
.page-head { margin-bottom: 34px; }
.section-label {
  margin-bottom: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 10px;
  font-weight: 700;
}
.primary-status {
  padding: 23px 24px;
  color: var(--bg);
  background: var(--surface);
  border-radius: 10px;
}
.primary-status .section-label { margin-bottom: 4px; }
.primary-status .muted { color: var(--muted); }
.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 10px 15px;
  border: 1px solid transparent;
  border-radius: 7px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
}
.button-dark {
  color: var(--bg);
  background: var(--bg);
}
.primary-status .button-dark { color: var(--ink); }
.button-outline {
  border-color: var(--line);
  background: transparent;
}
.button-muted {
  color: var(--muted);
  background: color-mix(in srgb, var(--surface), var(--ink) 6%);
}
.form-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(240px, 0.8fr);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.form-main, .form-side {
  min-width: 0;
  background: var(--surface);
}
.form-side { border-left: 1px solid var(--line); }
.form-section, .section { padding: 24px; }
.form-section + .form-section, .section + .section { border-top: 1px solid var(--line); }
.form-section > p:not(.section-label), .section > p:not(.section-label) {
  margin: 6px 0 20px;
  color: var(--muted);
}
.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 17px;
}
.field { display: grid; gap: 7px; }
.field.full { grid-column: 1 / -1; }
.form-gap { margin-top: 22px; }
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 18px 24px;
  border-top: 1px solid var(--line);
}
.form-section-inner + .form-section-inner, .section-inner + .section-inner {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.notice, .browser-note {
  padding: 12px;
  color: var(--muted);
  font-size: 12px;
  background: color-mix(in srgb, var(--yellow), transparent 90%);
  border-radius: 6px;
}
.notice-warn { border-left-color: var(--yellow); }
.side-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}
.side-list li {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}
.side-list strong {
  color: var(--ink);
  font-weight: 500;
  text-align: right;
}
.mode-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  margin: 22px 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
}
.mode-tabs button {
  padding: 10px;
  border: 0;
  border-right: 1px solid var(--line);
  color: var(--muted);
  background: color-mix(in srgb, var(--surface), var(--ink) 6%);
  text-align: left;
  font-size: 13px;
}
.mode-tabs button:last-child { border-right: 0; }
.mode-tabs button[aria-selected="true"] {
  color: var(--ink);
  background: transparent;
}
.mode-panel[hidden] { display: none; }
.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 22px;
}
.empty-state {
  padding: 34px 0;
  color: var(--muted);
  text-align: center;
}

footer {
  display: flex;
  justify-content: space-between;
  padding: 16px 0 23px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}
@media (max-width: 760px) {
  .topbar, main, footer, .browser-note {
    width: min(calc(100% - 32px), var(--max));
  }
  .topbar {
    flex-wrap: wrap;
    gap: 0;
    padding: 14px 0 0;
  }
  .main-nav {
    order: 3;
    flex-basis: 100%;
    height: 43px;
    gap: 19px;
    overflow-x: auto;
  }
  .device-state { margin-left: auto; }
  main { padding-top: 39px; }
  .page-head { margin-bottom: 25px; }
  .primary-status {
    align-items: flex-start;
    flex-direction: column;
  }
  .form-layout { display: block; }
  .form-side {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  .field-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
}
@media (hover: hover) {
  button:hover:not(:disabled, [aria-selected="true"]) {
    cursor: pointer;
  }
}
