:root {
  color-scheme: dark;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
  --bg: #111315;
  --surface: #191c1f;
  --surface-raised: #22272b;
  --surface-hover: #2b3237;
  --line: #343a3f;
  --line-strong: #4b555c;
  --line-hover: #697780;
  --text: #f4f6f7;
  --muted: #aeb7be;
  --accent: #42bde8;
  --accent-strong: #1599c6;
  --success: #83d9aa;
  --warning: #f2c66d;
  --danger: #ff8e8e;
  --header-height: 52px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--text);
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a,
label {
  -webkit-tap-highlight-color: transparent;
}

button,
.button,
.icon-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface-raised);
  color: var(--text);
  font-weight: 650;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition:
    background 120ms ease,
    border-color 120ms ease,
    color 120ms ease;
}

button:hover,
.button:hover,
.icon-button:hover {
  border-color: var(--line-hover);
  background: var(--surface-hover);
}

button:focus-visible,
.button:focus-visible,
.icon-button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

button:disabled,
.button[aria-disabled='true'] {
  cursor: not-allowed;
  opacity: 0.48;
}

.primary-button {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
  color: #061318;
}

.primary-button:hover {
  border-color: var(--accent);
  background: var(--accent);
}

.danger-button {
  border-color: var(--line-strong);
  color: var(--danger);
}

.danger-button:hover {
  border-color: var(--danger);
  color: var(--danger);
}

.icon-button {
  width: 42px;
  min-width: 42px;
  padding: 0;
}

button svg,
.button svg,
.icon-button svg,
.tool-link svg {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  stroke-width: 2;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: #101214;
  color: var(--text);
}

input,
select {
  min-height: 42px;
  padding: 8px 10px;
}

textarea {
  padding: 10px;
  line-height: 1.5;
  resize: vertical;
}

input:disabled,
select:disabled,
textarea:disabled {
  color: #7f898f;
  cursor: not-allowed;
  opacity: 0.7;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.app-shell {
  min-height: 100dvh;
}

.topbar {
  display: flex;
  min-width: 0;
  height: var(--header-height);
  align-items: center;
  gap: 16px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.brand-link {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
  color: var(--text);
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
}

.brand-link img {
  width: 30px;
  height: 30px;
  border-radius: 5px;
  object-fit: cover;
}

.surface-name {
  color: var(--muted);
  font-weight: 500;
}

.tool-nav {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 3px;
  margin-left: auto;
}

.tool-nav a {
  display: inline-flex;
  min-width: 40px;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 7px 9px;
  border-radius: 5px;
  color: var(--muted);
  font-size: 0.8rem;
  text-decoration: none;
}

.tool-nav a:hover,
.tool-nav a[aria-current='page'] {
  background: var(--surface-hover);
  color: var(--text);
}

.tool-nav svg {
  width: 18px;
  height: 18px;
}

.page-content {
  width: min(100%, 1120px);
  margin: 0 auto;
  padding: 28px 20px 40px;
}

.page-heading {
  margin-bottom: 24px;
}

.page-heading h1 {
  margin-bottom: 5px;
  font-size: 1.25rem;
  letter-spacing: 0;
}

.page-heading p,
.muted {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.status-line {
  min-height: 1.4em;
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.status-line[data-state='success'] {
  color: var(--success);
}
.status-line[data-state='warning'] {
  color: var(--warning);
}
.status-line[data-state='error'] {
  color: var(--danger);
}

.section-block {
  padding: 18px 0;
  border-top: 1px solid var(--line);
}

.section-block:first-child {
  padding-top: 0;
  border-top: 0;
}

.section-block h2 {
  margin-bottom: 14px;
  color: #cbd2d8;
  font-size: 0.84rem;
  letter-spacing: 0;
}

@media (max-width: 760px) {
  :root {
    --header-height: 48px;
  }
  .topbar {
    gap: 8px;
    padding: 0 8px;
  }
  .brand-link {
    gap: 7px;
    font-size: 0.9rem;
  }
  .brand-link img {
    width: 28px;
    height: 28px;
  }
  .surface-name,
  .nav-label {
    display: none;
  }
  .tool-nav {
    gap: 0;
  }
  .tool-nav a {
    min-width: 36px;
    min-height: 36px;
    padding: 6px;
  }
  .page-content {
    padding: 22px 14px 32px;
  }
}
