:root {
  color-scheme: light;
  --bg: #f7f8f6;
  --surface: #ffffff;
  --surface-soft: #f0f6f7;
  --ink: #24303f;
  --muted: #66768a;
  --line: #d8e0e4;
  --accent: #0b7f87;
  --accent-strong: #075f66;
  --danger: #b42318;
  --warning: #996300;
  --ok: #0f7a43;
  --shadow: 0 18px 42px rgba(31, 45, 61, 0.09);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
}

button,
input,
textarea {
  font: inherit;
}

.shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.topbar,
.toolbar,
.tabs,
.layout {
  display: flex;
  gap: 16px;
}

.topbar {
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 22px;
}

.kicker {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 32px;
  line-height: 1.1;
  letter-spacing: 0;
}

.session {
  color: var(--muted);
  font-size: 14px;
  text-align: right;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.toolbar {
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.segmented,
.tabs {
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(31, 45, 61, 0.03);
}

.segmented button,
.tabs button {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  padding: 0 14px;
  background: transparent;
  color: var(--muted);
  font-weight: 750;
  cursor: pointer;
}

.segmented button.active,
.tabs button.active {
  background: var(--accent);
  color: #fff;
}

.secondary,
.primary,
.link-button {
  min-height: 40px;
  border-radius: 7px;
  border: 1px solid var(--line);
  padding: 0 16px;
  font-weight: 800;
  cursor: pointer;
}

.secondary {
  background: var(--surface);
  color: var(--ink);
}

.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.link-button {
  min-height: 34px;
  background: transparent;
  color: var(--muted);
}

.primary:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.notice {
  min-height: 44px;
  margin: 12px 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 14px;
}

.notice.error {
  border-color: #f4c7c3;
  background: #fff4f2;
  color: var(--danger);
}

.notice.ok {
  border-color: #bce7cd;
  background: #effaf3;
  color: var(--ok);
}

.layout {
  align-items: flex-start;
}

.summary,
.editor {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.summary {
  width: 330px;
  flex: 0 0 330px;
  padding: 18px;
}

.editor {
  flex: 1;
  min-width: 0;
  padding: 20px;
}

.summary h2,
.editor h2 {
  margin: 0 0 16px;
  font-size: 18px;
  line-height: 1.25;
  letter-spacing: 0;
}

.kv {
  display: grid;
  grid-template-columns: 118px 1fr;
  gap: 9px 10px;
  font-size: 13px;
}

.kv dt {
  color: var(--muted);
}

.kv dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 10px;
  background: #eef2f7;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.badge.ok {
  background: #e6f6ec;
  color: var(--ok);
}

.badge.warn {
  background: #fff4d8;
  color: var(--warning);
}

.form-grid {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 7px;
}

.field label,
.switch-row span,
.confirm-row span {
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.hint {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

input[type="text"],
input[type="url"],
input[type="number"],
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfd;
  color: var(--ink);
  padding: 10px 11px;
  outline: none;
}

textarea {
  min-height: 108px;
  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(11, 127, 135, 0.13);
}

.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.switch-row,
.confirm-row,
.actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.switch-row,
.confirm-row {
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfd;
}

.toggle {
  width: 48px;
  height: 28px;
  position: relative;
  display: inline-flex;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #c7d2dc;
  transition: 160ms ease;
}

.slider::before {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(31, 45, 61, 0.24);
  transition: 160ms ease;
}

.toggle input:checked + .slider {
  background: var(--accent);
}

.toggle input:checked + .slider::before {
  transform: translateX(20px);
}

.confirm-row {
  justify-content: flex-start;
  border-color: #f0d6a5;
  background: #fff9ed;
}

.confirm-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.actions {
  justify-content: flex-end;
  padding-top: 4px;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.login-panel {
  width: min(420px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 24px;
}

.login-copy {
  margin: 8px 0 18px;
  color: var(--muted);
}

pre {
  max-height: 260px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f9fbfc;
  color: #334155;
  font-size: 12px;
  line-height: 1.5;
}

@media (max-width: 860px) {
  .shell {
    width: min(100vw - 20px, 720px);
    padding-top: 18px;
  }

  .topbar,
  .toolbar,
  .layout {
    flex-direction: column;
    align-items: stretch;
  }

  .session {
    text-align: left;
    justify-content: space-between;
  }

  .summary {
    width: 100%;
    flex-basis: auto;
  }

  .two-col {
    grid-template-columns: 1fr;
  }
}