:root {
  --hi-bg: #f4f7fb;
  --hi-bg-mid: #eef3f8;
  --hi-bg-top: #f7fafc;
  --hi-surface: #ffffff;
  --hi-surface-2: #eef3f8;
  --hi-border: #d5dee8;
  --hi-text: #152033;
  --hi-muted: #5b6b7c;
  --hi-accent: #0d9488;
  --hi-accent-2: #c2410c;
  --hi-danger: #dc2626;
  --hi-ok: #15803d;
  --hi-glow-1: rgba(13, 148, 136, 0.10);
  --hi-glow-2: rgba(194, 65, 12, 0.06);
  --hi-shadow: rgba(21, 32, 51, 0.08);
  --hi-panel-shadow: rgba(21, 32, 51, 0.04);
  --hi-btn-text: #ffffff;
  --hi-score-bg: #f0fdfa;
  --hi-ok-bg: #f0fdf4;
  --hi-run-bg: #f0fdfa;
  --hi-err-bg: #fef2f2;
  --hi-shimmer-mid: #ffffff;
  --hi-font: "IBM Plex Sans", "Segoe UI", sans-serif;
  --hi-display: "IBM Plex Sans Condensed", "Segoe UI", sans-serif;
  --hi-mono: "IBM Plex Mono", ui-monospace, monospace;
  --hi-radius: 10px;
  --hi-max: 1120px;
}

html[data-theme="dark"] {
  --hi-bg: #0f1419;
  --hi-bg-mid: #121820;
  --hi-bg-top: #151c24;
  --hi-surface: #1a222c;
  --hi-surface-2: #222b36;
  --hi-border: #2e3a48;
  --hi-text: #e8eef4;
  --hi-muted: #9aa8b6;
  --hi-accent: #2dd4bf;
  --hi-accent-2: #fb923c;
  --hi-danger: #f87171;
  --hi-ok: #4ade80;
  --hi-glow-1: rgba(45, 212, 191, 0.08);
  --hi-glow-2: rgba(251, 146, 60, 0.05);
  --hi-shadow: rgba(0, 0, 0, 0.35);
  --hi-panel-shadow: rgba(0, 0, 0, 0.25);
  --hi-btn-text: #042f2e;
  --hi-score-bg: rgba(45, 212, 191, 0.12);
  --hi-ok-bg: rgba(74, 222, 128, 0.10);
  --hi-run-bg: rgba(45, 212, 191, 0.10);
  --hi-err-bg: rgba(248, 113, 113, 0.10);
  --hi-shimmer-mid: #2a3440;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--hi-font);
  color: var(--hi-text);
  background:
    radial-gradient(1000px 480px at 8% -8%, var(--hi-glow-1), transparent 55%),
    radial-gradient(800px 420px at 100% 0%, var(--hi-glow-2), transparent 50%),
    linear-gradient(180deg, var(--hi-bg-top) 0%, var(--hi-bg-mid) 45%, var(--hi-bg) 100%);
  min-height: 100vh;
  line-height: 1.5;
  transition: background 0.25s ease, color 0.2s ease;
}

a { color: var(--hi-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.hi-wrap {
  width: min(100% - 2rem, var(--hi-max));
  margin-inline: auto;
}

.hi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 0;
  gap: 1rem;
}
.hi-brand {
  font-family: var(--hi-display);
  font-weight: 700;
  font-size: 1.6rem;
  letter-spacing: -0.03em;
  color: var(--hi-text);
  text-decoration: none;
}
.hi-brand span { color: var(--hi-accent); }
.hi-nav { display: flex; gap: 0.85rem; flex-wrap: wrap; align-items: center; }
.hi-nav a { color: var(--hi-muted); font-size: 0.95rem; text-decoration: none; }
.hi-nav a:hover { color: var(--hi-text); }

.hi-theme-toggle {
  display: inline-flex;
  align-items: stretch;
  padding: 0;
  border-radius: 8px;
  border: 1px solid var(--hi-border);
  background: var(--hi-surface-2);
  overflow: hidden;
  height: 2.1rem;
  box-shadow: none;
}
.hi-theme-toggle:hover { transform: none; border-color: var(--hi-border); }
.hi-theme-toggle:focus-visible { outline: none; }
.hi-theme-btn {
  appearance: none;
  border: 0;
  margin: 0;
  background: transparent;
  color: var(--hi-muted);
  font: 600 0.78rem/1 var(--hi-font);
  letter-spacing: 0.01em;
  padding: 0 0.75rem;
  cursor: pointer;
  min-width: 4.25rem;
}
.hi-theme-btn:hover { color: var(--hi-text); }
.hi-theme-btn.is-active {
  background: var(--hi-surface);
  color: var(--hi-text);
  box-shadow: inset 0 0 0 1px var(--hi-accent);
}
.hi-theme-btn:focus-visible {
  outline: 2px solid var(--hi-accent);
  outline-offset: -2px;
}

.hi-hero {
  padding: 3.5rem 0 2.5rem;
  animation: hi-fade-up 0.7s ease both;
}
.hi-hero h1 {
  font-family: var(--hi-display);
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.1;
  margin: 0 0 0.75rem;
  letter-spacing: -0.03em;
  max-width: 16ch;
}
.hi-hero p {
  color: var(--hi-muted);
  font-size: 1.1rem;
  max-width: 42ch;
  margin: 0 0 1.5rem;
}

.hi-lookup {
  display: flex;
  gap: 0.5rem;
  max-width: 640px;
  background: var(--hi-surface);
  border: 1px solid var(--hi-border);
  border-radius: 999px;
  padding: 0.35rem;
  box-shadow: 0 10px 28px var(--hi-shadow);
}
.hi-lookup input {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--hi-text);
  font: inherit;
  padding: 0.85rem 1.1rem;
  outline: none;
}
.hi-lookup input::placeholder { color: var(--hi-muted); }
.hi-lookup button {
  border: 0;
  border-radius: 999px;
  background: var(--hi-accent);
  color: var(--hi-btn-text);
  font-weight: 700;
  padding: 0.85rem 1.35rem;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.15s ease;
}
.hi-lookup button:hover { filter: brightness(1.08); }
.hi-lookup button:active { transform: scale(0.98); }

.hi-grid {
  display: grid;
  grid-template-columns: 1.6fr 0.9fr;
  gap: 1.5rem;
  padding-bottom: 3rem;
}
@media (max-width: 860px) {
  .hi-grid { grid-template-columns: 1fr; }
  .hi-lookup { border-radius: 14px; flex-direction: column; }
}

.hi-panel {
  background: var(--hi-surface);
  border: 1px solid var(--hi-border);
  border-radius: var(--hi-radius);
  padding: 1.25rem;
  box-shadow: 0 4px 18px var(--hi-panel-shadow);
}
.hi-panel h2 {
  font-family: var(--hi-display);
  font-size: 1.15rem;
  margin: 0 0 1rem;
  letter-spacing: -0.02em;
}

.hi-list { list-style: none; margin: 0; padding: 0; }
.hi-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--hi-border);
  font-size: 0.95rem;
}
.hi-list li:last-child { border-bottom: 0; }
.hi-list a { color: var(--hi-text); }
.hi-muted { color: var(--hi-muted); }
.hi-mono { font-family: var(--hi-mono); font-size: 0.9rem; }

.hi-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--hi-surface-2);
  color: var(--hi-muted);
  font-size: 0.78rem;
}
.hi-badge.ok { background: rgba(21, 128, 61, 0.12); color: var(--hi-ok); }
.hi-badge.warn { background: rgba(194, 65, 12, 0.12); color: var(--hi-accent-2); }
.hi-badge.bad { background: rgba(220, 38, 38, 0.12); color: var(--hi-danger); }
html[data-theme="dark"] .hi-badge.ok { background: rgba(74, 222, 128, 0.14); }
html[data-theme="dark"] .hi-badge.warn { background: rgba(251, 146, 60, 0.14); }
html[data-theme="dark"] .hi-badge.bad { background: rgba(248, 113, 113, 0.14); }

.hi-stat-head {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}
.hi-stat-head h1 {
  font-family: var(--hi-display);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin: 0;
  letter-spacing: -0.03em;
}
.hi-score {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 3px solid var(--hi-accent);
  color: var(--hi-accent);
  font-family: var(--hi-display);
  font-size: 1.6rem;
  font-weight: 700;
  background: var(--hi-score-bg);
  animation: hi-pop 0.6s ease both;
}

.hi-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 1rem;
}
.hi-tabs a {
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  background: var(--hi-surface);
  border: 1px solid var(--hi-border);
  color: var(--hi-muted);
  text-decoration: none;
  font-size: 0.85rem;
}
.hi-tabs a:hover { color: var(--hi-text); border-color: var(--hi-accent); }

.hi-section { scroll-margin-top: 1.25rem; }

.hi-kv { width: 100%; border-collapse: collapse; }
.hi-kv th, .hi-kv td {
  text-align: left;
  padding: 0.55rem 0.35rem;
  border-bottom: 1px solid var(--hi-border);
  vertical-align: top;
  font-size: 0.92rem;
}
.hi-kv th { width: 38%; color: var(--hi-muted); font-weight: 500; }

.hi-section { margin-bottom: 1.25rem; scroll-margin-top: 1rem; }
.hi-section h2 {
  font-family: var(--hi-display);
  font-size: 1.2rem;
  margin: 0 0 0.75rem;
}

.hi-footer {
  border-top: 1px solid var(--hi-border);
  padding: 1.5rem 0 2.5rem;
  color: var(--hi-muted);
  font-size: 0.9rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.hi-process {
  display: grid;
  gap: 0.5rem;
}
.hi-process .step {
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  background: var(--hi-surface-2);
  border: 1px solid var(--hi-border);
  font-size: 0.92rem;
}
.hi-process .ok { border-color: rgba(21,128,61,0.35); background: var(--hi-ok-bg); }
.hi-process .run { border-color: rgba(13,148,136,0.4); background: var(--hi-run-bg); }
.hi-process .err { border-color: rgba(220,38,38,0.35); background: var(--hi-err-bg); }

.hi-pricing {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  padding: 2rem 0 3rem;
}
@media (max-width: 860px) { .hi-pricing { grid-template-columns: 1fr; } }
.hi-price-card {
  background: var(--hi-surface);
  border: 1px solid var(--hi-border);
  border-radius: var(--hi-radius);
  padding: 1.5rem;
}
.hi-price-card.featured {
  border-color: var(--hi-accent);
  box-shadow: 0 0 0 1px rgba(13,148,136,0.2);
}
.hi-price-card h3 { margin: 0 0 0.35rem; font-family: var(--hi-display); }
.hi-price-card .price {
  font-size: 2rem;
  font-weight: 700;
  margin: 0.75rem 0;
  font-family: var(--hi-display);
}
.hi-price-card ul { padding-left: 1.1rem; color: var(--hi-muted); }
.hi-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin-top: 1rem;
  background: var(--hi-accent);
  color: var(--hi-btn-text) !important;
  text-decoration: none !important;
  font-weight: 700;
  font-size: 0.92rem;
  padding: 0.65rem 1.15rem;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: filter 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.hi-btn:hover { filter: brightness(1.08); text-decoration: none !important; }
.hi-btn.ghost {
  background: var(--hi-surface);
  color: var(--hi-text) !important;
  border: 1px solid var(--hi-border);
  filter: none;
}
.hi-btn.ghost:hover {
  border-color: var(--hi-accent);
  color: var(--hi-accent) !important;
}
.hi-btn.is-disabled,
.hi-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  filter: none !important;
}
.hi-update-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem 1.25rem;
  margin-top: 1rem;
}
.hi-update-row .hi-btn { margin-top: 0; }
.hi-update-meta { font-size: 0.9rem; }

.hi-note {
  font-size: 0.85rem;
  color: var(--hi-muted);
  margin-top: 0.5rem;
}

.hi-cta-strip {
  margin: 1rem 0;
  padding: 1rem 1.1rem;
  border-radius: var(--hi-radius);
  background: linear-gradient(90deg, var(--hi-glow-1), var(--hi-glow-2));
  border: 1px solid var(--hi-border);
}

@keyframes hi-fade-up {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
@keyframes hi-pop {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: none; }
}

.hi-empty { color: var(--hi-muted); font-style: italic; }

/* Homepage archive: small JPG thumbs → open HTML render */
.hi-archive { margin-top: 0.75rem; }
.hi-archive-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.65rem;
  margin-top: 0.55rem;
}
.hi-archive-thumb {
  display: block;
  text-decoration: none;
  color: var(--hi-muted);
  border: 1px solid var(--hi-border);
  border-radius: calc(var(--hi-radius) - 2px);
  overflow: hidden;
  background: var(--hi-surface-2);
  transition: border-color 0.15s ease, transform 0.15s ease, color 0.15s ease;
}
.hi-archive-thumb:hover,
.hi-archive-thumb.is-active {
  border-color: var(--hi-accent);
  color: var(--hi-text);
  transform: translateY(-1px);
}
.hi-archive-thumb img {
  display: block;
  width: 100%;
  height: 110px;
  object-fit: cover;
  object-position: top center;
  background: #0b0f14;
}
.hi-archive-thumb-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 110px;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  background: #0b0f14;
  color: #9ca3af;
}
.hi-archive-thumb-date {
  display: block;
  padding: 0.32rem 0.45rem;
  font-size: 0.66rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hi-skeleton {
  height: 0.9rem;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--hi-surface-2), var(--hi-shimmer-mid), var(--hi-surface-2));
  background-size: 200% 100%;
  animation: hi-shimmer 1.2s linear infinite;
}
@keyframes hi-shimmer {
  to { background-position: -200% 0; }
}

.hi-panel input,
.hi-panel textarea,
.hi-panel select {
  color: var(--hi-text);
  background: var(--hi-surface);
  border-color: var(--hi-border);
}
