/*
 *  public/style.css — Stylesheet Halaman Status & Pengaturan VTX Downloader
 *  Usage:
 *    <link rel="stylesheet" href="style.css"> di index.html & settings.html
 *
 *  Design system kalem: dua tema (gelap / terang), IBM Plex Sans + Mono,
 *  garis tipis sebagai pemisah, layout satu kolom yang aman sampai layar 320px.
 */

:root {
  --font-sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --bg: #111110;
  --bg-raised: #191918;
  --bg-hover: #222220;
  --line: #2a2a27;
  --line-strong: #3a3935;
  --fg: #ededea;
  --fg-muted: #a3a29b;
  --fg-faint: #75746d;

  --accent: #2aabee;
  --accent-hover: #1f9ad9;
  --accent-fg: #ffffff;
  --accent-soft: rgba(42, 171, 238, 0.14);

  --ok: #4cb361;
  --warn: #e5a12a;
  --err: #ec5d5e;
  --ok-soft: rgba(76, 179, 97, 0.14);
  --warn-soft: rgba(229, 161, 42, 0.14);
  --err-soft: rgba(236, 93, 94, 0.14);

  --radius: 10px;
  --radius-sm: 7px;
  --header-h: 56px;
  --container: 960px;
  --gutter: 24px;

  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #fbfbf9;
  --bg-raised: #f3f2ee;
  --bg-hover: #ebeae5;
  --line: #e4e2dc;
  --line-strong: #d0cdc5;
  --fg: #1b1b18;
  --fg-muted: #5e5d57;
  --fg-faint: #8c8a83;

  --accent: #1683c4;
  --accent-hover: #12719f;
  --accent-soft: rgba(22, 131, 196, 0.12);

  --ok: #2c8a41;
  --warn: #a96d10;
  --err: #cf3337;
  --ok-soft: rgba(44, 138, 65, 0.1);
  --warn-soft: rgba(169, 109, 16, 0.1);
  --err-soft: rgba(207, 51, 55, 0.1);

  color-scheme: light;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, p, dl, dd, ul, ol, figure {
  margin: 0;
}

ul, ol {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
}

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

button {
  cursor: pointer;
}

code, .mono {
  font-family: var(--font-mono);
}

.tabular {
  font-variant-numeric: tabular-nums;
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

::selection {
  background: var(--accent-soft);
}

.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

main {
  flex: 1;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
}

.site-header .container {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
  min-width: 0;
}

.brand-mark {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: var(--fg);
  color: var(--bg);
}

.brand-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  color: var(--fg-muted);
  font-size: 14px;
  text-decoration: none;
  transition: color 0.15s, background-color 0.15s;
}

.nav-link[aria-current="page"] {
  color: var(--fg);
  font-weight: 500;
}

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

.only-mobile {
  display: none !important;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--fg);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s, transform 0.06s;
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

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

.btn svg {
  flex-shrink: 0;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-fg);
}

.btn-danger {
  color: var(--err);
  border-color: color-mix(in srgb, var(--err) 38%, var(--line));
  background: transparent;
}

.btn-danger.is-armed {
  background: var(--err);
  border-color: var(--err);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--fg-muted);
}

.btn-icon {
  width: 36px;
  padding: 0;
}

.btn-sm {
  height: 30px;
  padding: 0 10px;
  font-size: 13px;
}

.btn-sm.btn-icon {
  width: 30px;
  padding: 0;
}

.btn-lg {
  height: 44px;
  padding: 0 18px;
  font-size: 15px;
}

.btn-block {
  width: 100%;
}

.btn .count {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-faint);
  font-weight: 400;
  min-width: 3ch;
  text-align: right;
}

.btn.is-spinning svg {
  animation: spin 0.8s linear infinite;
}

@media (hover: hover) {
  .nav-link:hover {
    color: var(--fg);
    background: var(--bg-hover);
  }

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

  .btn-primary:hover:not(:disabled) {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
  }

  .btn-danger:hover:not(:disabled) {
    background: var(--err-soft);
  }

  .btn-danger.is-armed:hover:not(:disabled) {
    background: var(--err);
  }

  .btn-ghost:hover:not(:disabled) {
    color: var(--fg);
  }
}

.theme-toggle .icon-moon {
  display: none;
}

[data-theme="light"] .theme-toggle .icon-sun {
  display: none;
}

[data-theme="light"] .theme-toggle .icon-moon {
  display: block;
}

.hero {
  padding: 64px 0 40px;
}

.hero-handle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--fg-muted);
}

.hero-title {
  display: flex;
  align-items: center;
  gap: 0.36em;
  font-size: clamp(30px, 6vw, 48px);
  line-height: 1.08;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.status-dot {
  position: relative;
  width: 0.28em;
  height: 0.28em;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--fg-faint);
  color: var(--fg-faint);
  transition: background-color 0.3s;
}

.status-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: currentColor;
  opacity: 0;
}

[data-status="loading"] .status-dot::after {
  animation: breathe 1.4s ease-in-out infinite;
}

[data-status="ok"] .status-dot {
  background: var(--ok);
  color: var(--ok);
}

[data-status="ok"] .status-dot::after {
  animation: ping 2.4s cubic-bezier(0, 0, 0.2, 1) infinite;
}

[data-status="warn"] .status-dot {
  background: var(--warn);
  color: var(--warn);
}

[data-status="down"] .status-dot {
  background: var(--err);
  color: var(--err);
}

.hero-lede {
  max-width: 54ch;
  margin-top: 18px;
  color: var(--fg-muted);
  font-size: 16.5px;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 30px;
}

.check-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  margin-top: 18px;
  font-size: 13px;
  color: var(--fg-faint);
}

.check-meta .sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
}

.linklike {
  padding: 0;
  border: 0;
  background: none;
  color: var(--fg-muted);
  font-size: 13px;
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
}

@media (hover: hover) {
  .linklike:hover {
    color: var(--fg);
    text-decoration-color: currentColor;
  }
}

.facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
}

.fact {
  min-width: 0;
  padding: 18px 20px 20px;
  background: var(--bg);
}

.fact dt {
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--fg-muted);
}

.fact .fact-value {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fact .fact-value small {
  margin-left: 2px;
  font-size: 0.6em;
  font-weight: 400;
  color: var(--fg-muted);
  letter-spacing: 0;
}

.fact .fact-note {
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--fg-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fact-note.is-ok { color: var(--ok); }
.fact-note.is-warn { color: var(--warn); }
.fact-note.is-err { color: var(--err); }

.section {
  padding: 48px 0;
}

.section + .section {
  border-top: 1px solid var(--line);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 20px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.section-title {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.section-sub {
  margin-top: 4px;
  font-size: 14px;
  color: var(--fg-muted);
}

.section-sub code {
  font-size: 0.9em;
  color: var(--fg);
}

.facts + .section,
.section.is-first {
  margin-top: 16px;
}

.page-head + .section {
  padding-top: 32px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.chart-panel {
  padding: 20px;
}

.chart-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--fg-faint);
}

.chart-stats b {
  color: var(--fg);
  font-weight: 500;
}

.chart {
  position: relative;
  height: 150px;
  margin-top: 18px;
}

.chart svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.chart-grid line {
  stroke: var(--line);
  stroke-dasharray: 2 5;
  vector-effect: non-scaling-stroke;
}

.chart-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.75;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.chart-area {
  fill: var(--accent);
  opacity: 0.09;
}

.chart-axis {
  position: absolute;
  right: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-faint);
  background: var(--bg);
  padding-left: 6px;
  line-height: 1;
  transform: translateY(-50%);
}

.chart-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 13px;
  color: var(--fg-faint);
  text-align: center;
  padding: 0 16px;
}

.ticks-wrap {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.ticks-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 13px;
  color: var(--fg-muted);
}

.ticks-head .mono {
  color: var(--fg-faint);
  font-size: 12.5px;
}

.ticks {
  display: grid;
  grid-template-columns: repeat(var(--tick-count, 40), minmax(0, 1fr));
  gap: 3px;
  height: 30px;
}

.tick {
  padding: 0;
  border: 0;
  border-radius: 2px;
  background: var(--bg-hover);
}

.tick.is-ok { background: var(--ok); }
.tick.is-warn { background: var(--warn); }
.tick.is-err { background: var(--err); }

button.tick {
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s;
}

@media (hover: hover) {
  button.tick:hover {
    opacity: 0.75;
  }
}

.ticks-legend {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--fg-faint);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  margin-bottom: 14px;
}

.search {
  position: relative;
  flex: 1 1 220px;
  max-width: 300px;
}

.search svg {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--fg-faint);
  pointer-events: none;
}

.input {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-size: 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
}

.input::placeholder {
  color: var(--fg-faint);
}

.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.search .input {
  padding-left: 34px;
}

.input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.chips {
  display: flex;
  gap: 6px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.chips::-webkit-scrollbar {
  display: none;
}

.chip {
  flex-shrink: 0;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--fg-muted);
  font-size: 13px;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s, background-color 0.15s;
}

.chip::first-letter {
  text-transform: uppercase;
}

.chip .n {
  margin-left: 4px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  opacity: 0.7;
}

.chip[aria-pressed="true"] {
  background: var(--fg);
  border-color: var(--fg);
  color: var(--bg);
}

@media (hover: hover) {
  .chip:hover:not([aria-pressed="true"]) {
    color: var(--fg);
    border-color: var(--line-strong);
  }
}

.cmd-list {
  overflow: hidden;
}

.cmd-row {
  display: grid;
  grid-template-columns: minmax(130px, 200px) minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 4px 20px;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
}

.cmd-row:first-child {
  border-top: 0;
}

.cmd-name {
  justify-self: start;
  padding: 2px 0;
  border: 0;
  background: none;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  color: var(--fg);
  text-align: left;
  cursor: copy;
  transition: color 0.15s;
}

.cmd-name.is-copied {
  color: var(--ok);
}

@media (hover: hover) {
  .cmd-name:hover {
    color: var(--accent);
  }
}

.cmd-desc {
  font-size: 14px;
  color: var(--fg-muted);
  min-width: 0;
}

.cmd-extra {
  display: block;
  margin-top: 3px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-faint);
  overflow-wrap: anywhere;
}

.cmd-cat {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-faint);
  text-transform: lowercase;
  white-space: nowrap;
}

.cmd-empty {
  padding: 32px 18px;
  text-align: center;
  font-size: 14px;
  color: var(--fg-faint);
}

.skeleton-line {
  display: block;
  height: 12px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--bg-hover) 0%, var(--bg-raised) 50%, var(--bg-hover) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}

.disclosure + .disclosure {
  margin-top: 12px;
}

.disclosure summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 12px 18px;
  list-style: none;
  cursor: pointer;
  font-weight: 500;
  user-select: none;
  border-radius: var(--radius);
}

.disclosure summary::-webkit-details-marker {
  display: none;
}

.disclosure summary .summary-meta {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 400;
  color: var(--fg-faint);
}

.disclosure summary .chev {
  flex-shrink: 0;
  color: var(--fg-faint);
  transition: transform 0.2s;
}

.disclosure[open] summary {
  border-bottom: 1px solid var(--line);
  border-radius: var(--radius) var(--radius) 0 0;
}

.disclosure[open] summary .chev {
  transform: rotate(180deg);
}

@media (hover: hover) {
  .disclosure summary:hover {
    background: var(--bg-raised);
  }
}

.kv {
  display: grid;
  grid-template-columns: minmax(160px, 220px) minmax(0, 1fr);
}

.kv > div {
  display: contents;
}

.kv dt,
.kv dd {
  padding: 11px 18px;
  border-top: 1px solid var(--line);
  font-size: 14px;
}

.kv > div:first-child dt,
.kv > div:first-child dd {
  border-top: 0;
}

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

.kv dd {
  font-family: var(--font-mono);
  font-size: 13.5px;
  overflow-wrap: anywhere;
}

.log {
  max-height: 300px;
  overflow-y: auto;
  padding: 10px 0;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.75;
  overscroll-behavior: contain;
}

.log-row {
  display: grid;
  grid-template-columns: auto 4ch minmax(0, 1fr);
  gap: 14px;
  padding: 0 18px;
}

.log-time {
  color: var(--fg-faint);
}

.log-level {
  font-weight: 500;
  color: var(--fg-faint);
}

.log-row.ok .log-level { color: var(--ok); }
.log-row.warn .log-level { color: var(--warn); }
.log-row.err .log-level { color: var(--err); }

.log-msg {
  color: var(--fg-muted);
  overflow-wrap: anywhere;
}

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

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--bg-hover);
  color: var(--fg-muted);
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
}

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

.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-err { background: var(--err-soft); color: var(--err); }
.badge-accent { background: var(--accent-soft); color: var(--accent); }

.site-footer {
  border-top: 1px solid var(--line);
  padding: 24px 0 calc(24px + env(safe-area-inset-bottom));
  font-size: 13px;
  color: var(--fg-faint);
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 20px;
}

.site-footer a {
  color: var(--fg-muted);
  text-decoration: none;
}

@media (hover: hover) {
  .site-footer a:hover {
    color: var(--fg);
    text-decoration: underline;
    text-underline-offset: 3px;
  }
}

.toasts {
  position: fixed;
  z-index: 60;
  right: 20px;
  bottom: 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 380px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  background: var(--fg);
  color: var(--bg);
  font-size: 14px;
  line-height: 1.4;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
  pointer-events: auto;
  animation: toast-in 0.2s ease-out;
}

.toast::before {
  content: "";
  width: 7px;
  height: 7px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--accent);
}

.toast.ok::before { background: var(--ok); }
.toast.warn::before { background: var(--warn); }
.toast.err::before { background: var(--err); }

.toast.is-leaving {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.2s, transform 0.2s;
}

.auth {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  padding: 72px 0 80px;
}

.auth-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  margin-bottom: 22px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--fg-muted);
}

.auth-title {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.auth-desc {
  margin-top: 10px;
  color: var(--fg-muted);
}

.form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 28px;
}

.field label {
  display: block;
  margin-bottom: 7px;
  font-size: 13.5px;
  font-weight: 500;
}

.input-wrap {
  position: relative;
}

.input-wrap .input {
  height: 44px;
  padding-right: 48px;
  font-family: var(--font-mono);
  font-size: 14px;
}

.input-addon {
  position: absolute;
  right: 5px;
  top: 50%;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  transform: translateY(-50%);
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--fg-faint);
}

.input-addon .icon-eye-off {
  display: none;
}

.input-addon[aria-pressed="true"] .icon-eye {
  display: none;
}

.input-addon[aria-pressed="true"] .icon-eye-off {
  display: block;
}

@media (hover: hover) {
  .input-addon:hover {
    color: var(--fg);
    background: var(--bg-hover);
  }
}

.alert {
  padding: 11px 14px;
  border: 1px solid;
  border-radius: var(--radius-sm);
  font-size: 14px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.alert-ok {
  background: var(--ok-soft);
  border-color: color-mix(in srgb, var(--ok) 32%, transparent);
}

.alert-err {
  background: var(--err-soft);
  border-color: color-mix(in srgb, var(--err) 32%, transparent);
}

.note {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 13.5px;
  color: var(--fg-muted);
  line-height: 1.6;
}

.note code,
.prose code {
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  font-size: 0.88em;
  color: var(--fg);
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 56px 0 8px;
}

.page-title {
  font-size: clamp(28px, 5vw, 36px);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.page-sub {
  margin-top: 8px;
  color: var(--fg-muted);
}

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

.field-row + .field-row {
  margin-top: 18px;
}

.field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13.5px;
  color: var(--fg-muted);
}

.copy-field {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 5px 5px 5px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-raised);
}

.copy-field code {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  white-space: nowrap;
  font-size: 13px;
  scrollbar-width: none;
}

.copy-field code::-webkit-scrollbar {
  display: none;
}

.copy-field code.is-empty {
  color: var(--fg-faint);
  font-family: var(--font-sans);
}

.copy-btn .icon-check {
  display: none;
}

.copy-btn.is-copied {
  color: var(--ok);
}

.copy-btn.is-copied .icon-copy {
  display: none;
}

.copy-btn.is-copied .icon-check {
  display: block;
}

.settings-body {
  padding: 24px;
}

.settings-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--line);
  background: var(--bg-raised);
  border-radius: 0 0 var(--radius) var(--radius);
}

.settings-foot .spacer {
  flex: 1;
}

.settings-foot + .alert,
.panel + .alert {
  margin-top: 14px;
}

.kv-plain {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px 24px;
  margin-top: 22px;
  font-size: 14px;
}

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

.kv-plain dd {
  font-family: var(--font-mono);
  font-size: 13.5px;
  text-align: right;
  overflow-wrap: anywhere;
}

.kv-plain dd.is-ok { color: var(--ok); }
.kv-plain dd.is-warn { color: var(--warn); }

.prose {
  font-size: 14px;
  color: var(--fg-muted);
  line-height: 1.65;
}

.prose a {
  color: var(--fg);
  text-underline-offset: 3px;
  text-decoration-color: var(--line-strong);
}

.prose + .field-row,
.field-row + .prose {
  margin-top: 18px;
}

.inline-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 20px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes ping {
  0% { transform: scale(1); opacity: 0.55; }
  80%, 100% { transform: scale(2.6); opacity: 0; }
}

@keyframes breathe {
  0%, 100% { opacity: 0; }
  50% { opacity: 0.6; }
}

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

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

@media (max-width: 760px) {
  :root {
    --gutter: 18px;
  }

  .hero {
    padding: 40px 0 32px;
  }

  .section {
    padding: 36px 0;
  }

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

  .fact {
    padding: 16px;
  }

  .fact .fact-value {
    font-size: 20px;
  }

  .cmd-row {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 14px 16px;
  }

  .cmd-cat {
    grid-row: 1;
    grid-column: 2;
  }

  .cmd-desc {
    grid-row: 2;
    grid-column: 1 / -1;
  }

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

  .kv dt {
    padding-bottom: 0;
    font-size: 13px;
  }

  .kv dd {
    padding-top: 2px;
    border-top: 0;
  }

  .kv > div:first-child dd {
    border-top: 0;
  }

  .search {
    max-width: none;
    flex-basis: 100%;
  }

  .chips {
    flex-basis: 100%;
    margin: 0 calc(var(--gutter) * -1);
    padding: 0 var(--gutter);
  }

  .settings-body {
    padding: 18px;
  }

  .settings-foot {
    padding: 14px 18px;
  }

  .page-head {
    padding-top: 40px;
  }

  .auth {
    padding: 48px 0 64px;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 14.5px;
  }

  .nav {
    display: none;
  }

  .only-mobile {
    display: inline-flex !important;
  }

  .hide-mobile {
    display: none !important;
  }

  .hero-lede {
    font-size: 15.5px;
  }

  .hero-actions .btn {
    flex: 1 1 auto;
  }

  .hero-actions .btn-primary {
    flex-basis: 100%;
  }

  .chart-panel {
    padding: 16px;
  }

  .chart {
    height: 120px;
  }

  .ticks {
    gap: 2px;
    height: 26px;
  }

  .log-row {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    padding: 0 14px;
  }

  .log-level {
    display: none;
  }

  .log-row.ok .log-time { color: var(--ok); }
  .log-row.warn .log-time { color: var(--warn); }
  .log-row.err .log-time { color: var(--err); }

  .settings-foot .btn {
    flex: 1 1 100%;
  }

  .settings-foot .spacer {
    display: none;
  }

  .kv-plain {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }

  .kv-plain dd {
    text-align: left;
    margin-bottom: 10px;
  }

  .toasts {
    left: 14px;
    right: 14px;
    bottom: calc(14px + env(safe-area-inset-bottom));
    align-items: stretch;
  }

  .toast {
    max-width: none;
  }

  .site-footer .container {
    flex-direction: column;
  }
}

@media (max-width: 360px) {
  .brand-name {
    display: none;
  }

  .fact .fact-value {
    font-size: 18px;
  }
}

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