/* somanyapikeys — dense ops console
   Visual thesis: dark graphite control room, single neon-jade accent,
   IBM Plex mono for metrics, DM Sans for UI. No purple gradients. */

:root {
  --bg-0: #0b0d10;
  --bg-1: #11151b;
  --bg-2: #171c24;
  --bg-3: #1e2530;
  --bg-hover: #232b38;
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.12);
  --text-0: rgba(255, 255, 255, 0.92);
  --text-1: rgba(255, 255, 255, 0.68);
  --text-2: rgba(255, 255, 255, 0.42);
  --text-3: rgba(255, 255, 255, 0.28);
  --accent: #3dd68c;
  --accent-dim: rgba(61, 214, 140, 0.14);
  --accent-glow: rgba(61, 214, 140, 0.28);
  --danger: #ff6b6b;
  --danger-dim: rgba(255, 107, 107, 0.14);
  --warn: #f0b429;
  --warn-dim: rgba(240, 180, 41, 0.14);
  --info: #6cb6ff;
  --info-dim: rgba(108, 182, 255, 0.14);
  --purple: #b794f6;
  --purple-dim: rgba(183, 148, 246, 0.14);
  --radius: 10px;
  --radius-sm: 6px;
  --font-ui: "DM Sans", "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", "SF Mono", ui-monospace, monospace;
  --shadow-panel: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 12px 40px rgba(0, 0, 0, 0.35);
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --sidebar-w: 240px;
  --topbar-h: 56px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg-0);
  color: var(--text-0);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  background-image:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(61, 214, 140, 0.07), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(108, 182, 255, 0.05), transparent 50%),
    linear-gradient(180deg, var(--bg-0), #090b0e 100%);
  background-attachment: fixed;
}

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

button {
  cursor: pointer;
  border: none;
  background: none;
  touch-action: manipulation;
}

a {
  color: var(--accent);
  text-decoration: none;
}

/* ── Layout ── */

.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 20px 14px;
  border-right: 1px solid var(--line);
  background: rgba(11, 13, 16, 0.82);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  gap: 20px;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px 8px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background:
    linear-gradient(145deg, rgba(61, 214, 140, 0.25), rgba(61, 214, 140, 0.05)),
    var(--bg-2);
  border: 1px solid rgba(61, 214, 140, 0.35);
  display: grid;
  place-items: center;
  box-shadow: 0 0 24px var(--accent-glow);
  flex-shrink: 0;
}

.brand-mark svg {
  width: 18px;
  height: 18px;
  color: var(--accent);
}

.brand-text {
  min-width: 0;
}

.brand-name {
  font-weight: 650;
  font-size: 14.5px;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.brand-sub {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-2);
  letter-spacing: 0.02em;
  margin-top: 2px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 10px 10px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  color: var(--text-1);
  transition: background 160ms var(--ease), color 160ms var(--ease), transform 100ms var(--ease);
  text-align: left;
  width: 100%;
}

.nav-item svg {
  width: 16px;
  height: 16px;
  opacity: 0.75;
  flex-shrink: 0;
}

.nav-item:hover {
  background: var(--bg-2);
  color: var(--text-0);
}

.nav-item.active {
  background: var(--accent-dim);
  color: var(--accent);
}

.nav-item.active svg {
  opacity: 1;
  color: var(--accent);
}

.nav-item:active {
  transform: scale(0.98);
}

.sidebar-foot {
  margin-top: auto;
  padding: 12px 10px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.seg-lang {
  align-self: flex-start;
}

.seg-lang button {
  min-width: 36px;
  height: 26px;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* GitHub source links */
.github-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-2);
  text-decoration: none;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.github-link svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.github-link:hover {
  color: var(--text-1);
}

.github-link-side {
  margin-top: 4px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text-3);
  justify-content: flex-start;
}

.github-link-side:hover {
  color: var(--text-1);
  border-color: var(--text-3);
  background: rgba(255, 255, 255, 0.03);
}

.github-link-top.icon-btn {
  text-decoration: none;
  color: var(--text-2);
}

.github-link-top.icon-btn:hover {
  color: var(--text-1);
  background: rgba(255, 255, 255, 0.06);
}

.github-link-top svg {
  width: 18px;
  height: 18px;
}

.github-link-login {
  justify-content: center;
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text-3);
  padding: 8px 0 0;
}

.github-link-login:hover {
  color: var(--accent);
}

.login-github {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: center;
}

.about-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.github-link-about.btn {
  text-decoration: none;
}

.github-link-about svg {
  width: 15px;
  height: 15px;
}

.pill-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-2);
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-3);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.04);
}

.dot.ok {
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim), 0 0 12px var(--accent-glow);
}

.dot.warn {
  background: var(--warn);
  box-shadow: 0 0 0 3px var(--warn-dim);
}

.dot.bad {
  background: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-dim);
}

.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  height: var(--topbar-h);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(11, 13, 16, 0.75);
  backdrop-filter: blur(14px);
}

.topbar-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.topbar-meta {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-2);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.content {
  padding: 24px 28px 48px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: enter 320ms var(--ease) both;
}

@keyframes enter {
  from {
    opacity: 0;
    transform: translateY(8px);
    filter: blur(3px);
  }
  to {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── Cards / panels ── */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.stats-grid-5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

/* Dashboard layout: overview → tokens | keys */
.dash-layout {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dash-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dash-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.dash-section-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.dash-section-sub {
  margin-top: 3px;
  font-size: 12px;
  color: var(--text-2);
  font-family: var(--font-mono);
}

.dash-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}

.dash-panel {
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.dash-keys .panel-body {
  flex-shrink: 0;
}

.key-banner {
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(61, 214, 140, 0.35);
  background:
    linear-gradient(135deg, rgba(61, 214, 140, 0.08), transparent 60%),
    var(--bg-0);
}

.key-banner-secret {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  word-break: break-all;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--accent);
  user-select: all;
}

@media (max-width: 1100px) {
  .dash-split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1200px) {
  .stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .stats-grid-5 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .app {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: relative;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }
  .stats-grid,
  .stats-grid-5 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .content,
  .topbar {
    padding-left: 16px;
    padding-right: 16px;
  }
}

.stat-card {
  position: relative;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px 12px;
  overflow: hidden;
  box-shadow: var(--shadow-panel);
  transition: border-color 180ms var(--ease), transform 120ms var(--ease);
}

.stat-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 2px;
  background: var(--card-accent, var(--line-strong));
  opacity: 0.9;
}

.stat-card:hover {
  border-color: var(--line-strong);
}

.stat-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-2);
  letter-spacing: 0.02em;
  margin-bottom: 8px;
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: var(--text-0);
}

.stat-hint {
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-3);
  font-family: var(--font-mono);
}

.panel {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-panel);
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent);
}

.panel-title {
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.panel-sub {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 2px;
}

.panel-body {
  padding: 16px;
}

.panel-body.tight {
  padding: 0;
}

/* ── Controls ── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 550;
  letter-spacing: -0.01em;
  border: 1px solid transparent;
  transition:
    background 160ms var(--ease),
    border-color 160ms var(--ease),
    color 160ms var(--ease),
    transform 100ms var(--ease),
    box-shadow 160ms var(--ease);
  white-space: nowrap;
}

.btn:active:not(:disabled) {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn svg {
  width: 14px;
  height: 14px;
}

.btn-primary {
  background: var(--accent);
  color: #062416;
  box-shadow: 0 0 0 1px rgba(61, 214, 140, 0.3), 0 6px 20px rgba(61, 214, 140, 0.18);
}

@media (hover: hover) {
  .btn-primary:hover:not(:disabled) {
    filter: brightness(1.05);
  }
}

.btn-secondary {
  background: var(--bg-3);
  border-color: var(--line-strong);
  color: var(--text-0);
}

@media (hover: hover) {
  .btn-secondary:hover:not(:disabled) {
    background: var(--bg-hover);
  }
}

.btn-ghost {
  background: transparent;
  color: var(--text-1);
  border-color: transparent;
}

@media (hover: hover) {
  .btn-ghost:hover:not(:disabled) {
    background: var(--bg-2);
    color: var(--text-0);
  }
}

.btn-danger {
  background: var(--danger-dim);
  color: var(--danger);
  border-color: rgba(255, 107, 107, 0.25);
}

@media (hover: hover) {
  .btn-danger:hover:not(:disabled) {
    background: rgba(255, 107, 107, 0.22);
  }
}

.btn-sm {
  height: 30px;
  padding: 0 10px;
  font-size: 12.5px;
  border-radius: 7px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-2);
}

.input,
.textarea,
.select {
  width: 100%;
  background: var(--bg-0);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 9px 11px;
  color: var(--text-0);
  outline: none;
  transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease);
}

.input:focus,
.textarea:focus,
.select:focus {
  border-color: rgba(61, 214, 140, 0.55);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.textarea {
  min-height: 160px;
  resize: vertical;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.5;
}

.input-sm {
  height: 34px;
  padding: 0 11px;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.toolbar .grow {
  flex: 1;
  min-width: 160px;
}

.seg {
  display: inline-flex;
  padding: 3px;
  background: var(--bg-0);
  border: 1px solid var(--line);
  border-radius: 9px;
  gap: 2px;
}

.seg button {
  height: 28px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 12px;
  color: var(--text-2);
  font-weight: 500;
  transition: background 140ms var(--ease), color 140ms var(--ease);
}

.seg button.active {
  background: var(--bg-3);
  color: var(--text-0);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04);
}

/* ── Table ── */

.table-wrap {
  overflow: auto;
  max-height: calc(100vh - 320px);
  min-height: 280px;
}

table.keys {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

table.keys th {
  position: sticky;
  top: 0;
  z-index: 2;
  text-align: left;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
  background: var(--bg-2);
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  white-space: nowrap;
}

table.keys td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  color: var(--text-1);
}

table.keys tr:hover td {
  background: rgba(255, 255, 255, 0.015);
}

table.keys tr.selected td {
  background: var(--accent-dim);
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
}

.key-prefix {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-0);
  letter-spacing: 0.01em;
}

.muted {
  color: var(--text-2);
}

.err-cell {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-2);
  font-size: 11.5px;
}

/* ── Modal (key chat probe) ── */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal {
  width: min(560px, 100%);
  max-height: min(90vh, 720px);
  overflow: auto;
  background: var(--bg-1);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  box-shadow: var(--shadow-panel), 0 24px 80px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--line);
}

.modal-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-0);
}

.modal-sub {
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-3);
}

.modal-body {
  padding: 16px 18px;
  flex: 1;
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 18px 16px;
  border-top: 1px solid var(--line);
}

.key-test-result {
  margin-top: 14px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg-2);
}

.key-test-result.ok {
  border-color: rgba(61, 214, 140, 0.35);
  background: var(--accent-dim);
}

.key-test-result.err {
  border-color: rgba(255, 107, 107, 0.35);
  background: var(--danger-dim);
}

.key-test-result.running {
  color: var(--text-2);
  font-size: 13px;
}

.key-test-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 12px;
}

.key-test-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  margin-bottom: 4px;
}

.key-test-content pre,
.key-test-raw pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-0);
  max-height: 180px;
  overflow: auto;
}

.key-test-content pre.err-text {
  color: var(--danger);
}

.key-test-raw {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-2);
}

.key-test-raw summary {
  cursor: pointer;
  user-select: none;
  color: var(--text-2);
}

.key-test-raw summary:hover {
  color: var(--text-0);
}

.key-test-raw pre {
  margin-top: 8px;
  max-height: 220px;
  color: var(--text-2);
}

/* badges */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  text-transform: lowercase;
}

.badge::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.badge-valid {
  color: var(--accent);
  background: var(--accent-dim);
  border-color: rgba(61, 214, 140, 0.2);
}

.badge-unknown {
  color: var(--text-1);
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--line-strong);
}

.badge-invalid {
  color: var(--danger);
  background: var(--danger-dim);
  border-color: rgba(255, 107, 107, 0.22);
}

.badge-exhausted {
  color: #ff8e53;
  background: rgba(255, 142, 83, 0.14);
  border-color: rgba(255, 142, 83, 0.22);
}

.badge-rate_limited {
  color: var(--warn);
  background: var(--warn-dim);
  border-color: rgba(240, 180, 41, 0.22);
}

.badge-error {
  color: var(--purple);
  background: var(--purple-dim);
  border-color: rgba(183, 148, 246, 0.22);
}

.toggle {
  position: relative;
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: var(--bg-0);
  border: 1px solid var(--line-strong);
  transition: background 160ms var(--ease), border-color 160ms var(--ease);
}

.toggle.on {
  background: var(--accent);
  border-color: rgba(61, 214, 140, 0.5);
}

.toggle::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  transition: transform 160ms var(--ease);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.toggle.on::after {
  transform: translateX(16px);
}

/* empty / loading */

.empty {
  padding: 48px 24px;
  text-align: center;
  color: var(--text-2);
}

.empty-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-0);
  margin-bottom: 6px;
}

.skeleton {
  background: linear-gradient(90deg, var(--bg-2), var(--bg-3), var(--bg-2));
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
  border-radius: 6px;
  height: 14px;
}

@keyframes shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

/* toast */

.toasts {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(360px, calc(100vw - 32px));
}

.toast {
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  font-size: 13px;
  animation: toast-in 220ms var(--ease) both;
}

.toast.ok {
  border-color: rgba(61, 214, 140, 0.35);
}

.toast.err {
  border-color: rgba(255, 107, 107, 0.4);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* login */

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

.login-card {
  width: min(400px, 100%);
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px;
  box-shadow: var(--shadow-panel);
  animation: enter 360ms var(--ease) both;
}

.login-card h1 {
  margin: 0 0 6px;
  font-size: 20px;
  letter-spacing: -0.03em;
  font-weight: 650;
}

.login-card p {
  margin: 0 0 22px;
  color: var(--text-2);
  font-size: 13px;
}

.login-card .field {
  margin-bottom: 14px;
}

.login-card .btn {
  width: 100%;
  margin-top: 6px;
  height: 40px;
}

.login-hint {
  margin-top: 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
  line-height: 1.5;
}

/* settings grid */

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 800px) {
  .settings-grid {
    grid-template-columns: 1fr;
  }
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.setting-row:last-child {
  border-bottom: none;
}

.setting-row-stack {
  align-items: flex-start;
  flex-direction: column;
}

.setting-row-stack .interval-controls {
  width: 100%;
}

.interval-controls .seg {
  flex-wrap: wrap;
  width: 100%;
}

/* about page */
.about-hero {
  border-color: rgba(61, 214, 140, 0.18);
  background:
    radial-gradient(ellipse 70% 80% at 0% 0%, rgba(61, 214, 140, 0.1), transparent 55%),
    var(--bg-1);
}

.about-kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}

.about-title {
  margin: 0 0 10px;
  font-size: 28px;
  font-weight: 650;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.about-lead {
  margin: 0;
  max-width: 62ch;
  color: var(--text-1);
  font-size: 14.5px;
  line-height: 1.55;
  text-wrap: pretty;
}

.about-code {
  font-size: 12px !important;
}

.setting-title {
  font-weight: 550;
  font-size: 13.5px;
}

.setting-desc {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 3px;
  max-width: 42ch;
}

/* pagination */

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  color: var(--text-2);
  font-size: 12px;
  font-family: var(--font-mono);
}

.pager-btns {
  display: flex;
  gap: 6px;
}

/* checkbox */

.check {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* import layout */

.import-layout {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 16px;
}

@media (max-width: 900px) {
  .import-layout {
    grid-template-columns: 1fr;
  }
}

.help-list {
  margin: 0;
  padding-left: 18px;
  color: var(--text-2);
  font-size: 12.5px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.help-list li::marker {
  color: var(--accent);
}

.code {
  font-family: var(--font-mono);
  font-size: 11.5px;
  background: var(--bg-0);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 6px;
  color: var(--accent);
}

.hidden {
  display: none !important;
}

.row-actions {
  display: flex;
  gap: 4px;
}

.icon-btn {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  color: var(--text-2);
  transition: background 140ms var(--ease), color 140ms var(--ease);
}

@media (hover: hover) {
  .icon-btn:hover {
    background: var(--bg-3);
    color: var(--text-0);
  }
}

.icon-btn.danger:hover {
  background: var(--danger-dim);
  color: var(--danger);
}

.icon-btn svg {
  width: 14px;
  height: 14px;
}

.selection-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: linear-gradient(90deg, var(--accent-dim), transparent 70%);
  border-bottom: 1px solid rgba(61, 214, 140, 0.15);
  font-size: 12.5px;
}

.selection-bar strong {
  font-family: var(--font-mono);
  color: var(--accent);
  font-weight: 500;
}

/* focus */

:focus-visible {
  outline: 2px solid rgba(61, 214, 140, 0.55);
  outline-offset: 2px;
}

.mobile-nav-toggle {
  display: none;
}

@media (max-width: 720px) {
  .mobile-nav-toggle {
    display: inline-flex;
  }
  .sidebar.collapsed .nav,
  .sidebar.collapsed .sidebar-foot {
    display: none;
  }
}
