/* =====================================================
   Hassette Design System — Components
   Tokens live in tokens.css; this file is theme-agnostic.
   ===================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  line-height: 1.5;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 0.5em;
  line-height: 1.25;
}

p, ul, ol, table, pre, blockquote {
  margin: 0 0 1em;
}

img, svg {
  max-width: 100%;
  vertical-align: middle;
}

button {
  cursor: pointer;
}

[x-cloak] {
  display: none !important;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
  width: 100%;
}

/* — Base Typography ———————————————————————————————————— */
body {
  font-family: var(--ht-font-body);
  font-size: var(--ht-text-base);
  color: var(--ht-text);
  background: var(--ht-surface-canvas);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--ht-font-heading);
  font-weight: 600;
  color: var(--ht-text);
}

code, pre {
  font-family: var(--ht-font-mono);
  font-size: 0.9em;
  color: var(--ht-text);
}

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

a:hover {
  text-decoration: underline;
}

a code {
  color: var(--ht-info);
}

a:hover code {
  text-decoration: underline;
}

strong {
  font-weight: 600;
}

/* — Layout ————————————————————————————————————————————— */
.ht-layout {
  display: flex;
  min-height: 100vh;
  position: relative;
}

.ht-main {
  flex: 1;
  background: var(--ht-surface-canvas);
  overflow-y: auto;
  min-width: 0;
}

.ht-section {
  padding: 1.5rem;
}

/* 12-column CSS grid */
.ht-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--ht-sp-6);
}

.ht-grid-col-5  { grid-column: span 5; }
.ht-grid-col-6  { grid-column: span 6; }
.ht-grid-col-7  { grid-column: span 7; }
.ht-grid-col-12 { grid-column: span 12; }

/* Level (horizontal bar) */
.ht-level {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ht-sp-4);
}

.ht-level-start {
  display: flex;
  align-items: center;
  gap: var(--ht-sp-3);
  flex-wrap: wrap;
}

.ht-level-end {
  display: flex;
  align-items: center;
  gap: var(--ht-sp-3);
  flex-wrap: wrap;
}

.ht-level-item {
  display: flex;
  align-items: center;
  flex-direction: column;
  text-align: center;
}

/* — Sidebar ———————————————————————————————————————————— */
.ht-sidebar {
  width: 220px;
  background: var(--ht-surface-sidebar);
  color: var(--ht-sidebar-text);
  display: flex;
  flex-direction: column;
  padding: 1rem 0;
  flex-shrink: 0;
  transition: width 0.25s ease;
  overflow: hidden;
  z-index: 30;
}

/* Icon rail: collapsed sidebar shows icons only */
.ht-sidebar:not(.is-open) {
  width: 56px;
}

/* Pre-paint: prevent flicker when sidebar was closed in previous session */
html.ht-sidebar-closed .ht-sidebar:not(.is-open) {
  transition: none;
}

.ht-sidebar:not(.is-open) .ht-sidebar-brand {
  justify-content: center;
  padding: 0.75rem 0 1.5rem;
}

.ht-sidebar:not(.is-open) .ht-brand-text,
.ht-sidebar:not(.is-open) .ht-sidebar-footer,
.ht-sidebar:not(.is-open) .ht-sidebar-toggle {
  display: none;
}

.ht-sidebar:not(.is-open) .ht-nav-list a {
  justify-content: center;
  padding: 0.6rem 0;
}

.ht-sidebar:not(.is-open) .ht-nav-list a span:not(.ht-icon) {
  display: none;
}

.ht-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem 1.5rem;
  font-family: var(--ht-font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ht-sidebar-brand-color);
}

.ht-brand-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: inherit;
  text-decoration: none;
}

.ht-brand-link:hover {
  opacity: 0.85;
  text-decoration: none;
}

/* Navigation list */
.ht-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ht-nav-list a {
  color: var(--ht-sidebar-text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  border-radius: 0;
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
}

.ht-nav-list a:hover {
  background: var(--ht-sidebar-hover-bg);
  color: var(--ht-sidebar-text-hover);
  text-decoration: none;
}

.ht-nav-list a.is-active {
  background: var(--ht-sidebar-active-bg);
  color: var(--ht-sidebar-active-color);
  font-weight: 600;
}

.ht-sidebar-footer {
  margin-top: auto;
  padding: 1rem 1.25rem;
}

/* Sidebar hamburger toggle — hidden by default, shown on mobile */
.ht-sidebar-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--ht-sidebar-text);
  cursor: pointer;
  margin-left: auto;
  padding: 0.25rem;
  font-size: 1.1rem;
}

.ht-sidebar-toggle:hover {
  color: var(--ht-sidebar-text-hover);
}

/* Sidebar backdrop overlay (mobile only) */
.ht-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--ht-backdrop);
  z-index: 20;
}

/* Hamburger menu toggle — always visible */
.ht-menu-toggle {
  display: inline-flex;
  background: none;
  border: none;
  color: var(--ht-text-muted);
  cursor: pointer;
  padding: 0.25rem;
  font-size: 1.1rem;
}

.ht-menu-toggle:hover {
  color: var(--ht-text);
}

/* — Cards —————————————————————————————————————————————— */
.ht-card {
  background: var(--ht-surface-card);
  border: 1px solid var(--ht-border);
  border-radius: var(--ht-radius-md);
  padding: var(--ht-sp-6);
}

.ht-card--full-height {
  height: 100%;
}

/* — Tables ————————————————————————————————————————————— */
.ht-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--ht-surface-card);
}

.ht-table th {
  text-align: left;
  font-weight: 600;
  font-size: var(--ht-text-sm);
  color: var(--ht-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: var(--ht-sp-2) var(--ht-sp-3);
  border-bottom: 1px solid var(--ht-border-strong);
}

.ht-table td {
  padding: var(--ht-sp-2) var(--ht-sp-3);
  border-bottom: 1px solid var(--ht-border-subtle);
  vertical-align: middle;
}

.ht-table tbody tr:hover {
  background: var(--ht-slate-50);
}

.ht-table--dense th,
.ht-table--dense td {
  padding: 0.3em 0.5em;
}

.ht-table--striped tbody tr:nth-child(even) {
  background: var(--ht-slate-50);
}

/* Narrow variant (used in health badge config tables) */
.ht-table--narrow th,
.ht-table--narrow td {
  padding: 0.25em 0.5em;
}

/* — Badges ————————————————————————————————————————————— */
.ht-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25em;
  font-size: var(--ht-text-xs);
  font-weight: 500;
  padding: 0.15em 0.55em;
  border-radius: var(--ht-radius-full);
  line-height: 1.6;
  white-space: nowrap;
  vertical-align: middle;
}

.ht-badge--sm {
  font-size: 0.6875rem;
  padding: 0.1em 0.45em;
}

.ht-badge--md {
  font-size: var(--ht-text-sm);
  padding: 0.2em 0.65em;
}

/* Semantic badge variants */
.ht-badge--success {
  color: var(--ht-success-text);
  background: var(--ht-success-light);
}

.ht-badge--danger {
  color: var(--ht-danger-text);
  background: var(--ht-danger-light);
}

.ht-badge--warning {
  color: var(--ht-warning-text);
  background: var(--ht-warning-light);
}

.ht-badge--info {
  color: var(--ht-info-text);
  background: var(--ht-info-light);
}

.ht-badge--link {
  color: var(--ht-link-text);
  background: var(--ht-link-light);
}

.ht-badge--neutral {
  color: var(--ht-text-muted);
  background: var(--ht-slate-100);
}

/* App status badges */
.ht-status-stopped {
  color: var(--ht-warning-text);
  background: var(--ht-warning-light);
}

.ht-status-disabled {
  color: var(--ht-text-muted);
  background: var(--ht-slate-100);
}

.ht-status-blocked {
  color: var(--ht-link-text);
  background: var(--ht-link-light);
}

/* Entity state badges */
.ht-entity-on {
  color: var(--ht-text-on-dark);
  background: var(--ht-success);
}

.ht-entity-off {
  color: var(--ht-text-muted);
  background: var(--ht-slate-200);
}

.ht-entity-unavailable {
  color: var(--ht-text-on-dark);
  background: var(--ht-danger);
}

/* Log level badges */
.ht-log-debug    { color: var(--ht-text-muted); }
.ht-log-info     { color: var(--ht-info); }
.ht-log-warning  { color: var(--ht-text-on-dark); background: var(--ht-warning); }
.ht-log-error    { color: var(--ht-text-on-dark); background: var(--ht-danger); }
.ht-log-critical { color: var(--ht-text-on-dark); background: var(--ht-critical); font-weight: 700; }

/* — Buttons ———————————————————————————————————————————— */
.ht-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  font-family: var(--ht-font-body);
  font-size: var(--ht-text-sm);
  font-weight: 500;
  padding: 0.4em 0.85em;
  border: 1px solid var(--ht-border-strong);
  border-radius: var(--ht-radius-md);
  background: var(--ht-surface-card);
  color: var(--ht-text);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  text-decoration: none;
  line-height: 1.5;
}

.ht-btn:hover {
  background: var(--ht-slate-50);
  border-color: var(--ht-slate-300);
  text-decoration: none;
}

.ht-btn--sm {
  font-size: var(--ht-text-xs);
  padding: 0.25em 0.6em;
}

.ht-btn--xs {
  font-size: 0.6875rem;
  padding: 0.15em 0.45em;
}

.ht-btn--ghost {
  border-color: transparent;
  background: transparent;
}

.ht-btn--ghost:hover {
  background: var(--ht-slate-100);
  border-color: transparent;
}

.ht-btn--primary {
  background: var(--ht-amber);
  border-color: var(--ht-amber);
  color: var(--ht-text-on-dark);
}

.ht-btn--primary:hover {
  background: var(--ht-amber-hover);
  border-color: var(--ht-amber-hover);
}

.ht-btn--success {
  border-color: var(--ht-success);
  color: var(--ht-success);
}

.ht-btn--success:hover {
  background: var(--ht-success-light);
}

.ht-btn--warning {
  border-color: var(--ht-warning);
  color: var(--ht-warning);
}

.ht-btn--warning:hover {
  background: var(--ht-warning-light);
}

.ht-btn--info {
  border-color: var(--ht-info);
  color: var(--ht-info);
}

.ht-btn--info:hover {
  background: var(--ht-info-light);
}

.ht-btn--link {
  border-color: var(--ht-link);
  color: var(--ht-link);
}

.ht-btn--link:hover {
  background: var(--ht-link-light);
}

.ht-btn-group {
  display: flex;
  gap: var(--ht-sp-2);
  flex-wrap: wrap;
}

/* — Forms —————————————————————————————————————————————— */
.ht-input,
.ht-select select {
  font-family: var(--ht-font-body);
  font-size: var(--ht-text-sm);
  padding: 0.35em 0.6em;
  border: 1px solid var(--ht-border-strong);
  border-radius: var(--ht-radius-md);
  background: var(--ht-surface-card);
  color: var(--ht-text);
  line-height: 1.5;
}

.ht-input:focus,
.ht-select select:focus {
  outline: none;
  border-color: var(--ht-amber);
  box-shadow: 0 0 0 2px var(--ht-amber-dim);
}

.ht-input--sm,
.ht-select--sm select {
  font-size: var(--ht-text-xs);
  padding: 0.25em 0.5em;
}

.ht-select {
  display: inline-block;
  position: relative;
}

.ht-field-group {
  display: flex;
  align-items: center;
  gap: var(--ht-sp-3);
  flex-wrap: wrap;
}

.ht-control {
  display: inline-flex;
  align-items: center;
}

/* — Tabs ——————————————————————————————————————————————— */
.ht-tabs {
  border-bottom: 1px solid var(--ht-border);
  margin-bottom: var(--ht-sp-4);
}

.ht-tabs ul {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0;
}

.ht-tabs li a {
  display: block;
  padding: 0.4em 0.85em;
  font-size: var(--ht-text-sm);
  color: var(--ht-text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.ht-tabs li a:hover {
  color: var(--ht-text);
  text-decoration: none;
}

.ht-tabs li.is-active a {
  color: var(--ht-amber);
  border-bottom-color: var(--ht-amber);
  font-weight: 600;
}

/* — Notices ———————————————————————————————————————————— */
.ht-notice--info {
  background: var(--ht-info-light);
  color: var(--ht-info-text);
  border: 1px solid var(--ht-notice-info-border);
  border-radius: var(--ht-radius-md);
  padding: var(--ht-sp-4);
}

/* — Status Bar ————————————————————————————————————————— */
.ht-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 1.5rem;
  background: var(--ht-surface-card);
  border-bottom: 1px solid var(--ht-border);
  gap: 0.75rem;
}

.ht-ws-indicator {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* — Pulse Dot Signature ———————————————————————————————— */
.ht-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  background: var(--ht-amber);
  animation: ht-breathe 2s ease-in-out infinite;
}

.ht-pulse-dot--disconnected {
  background: var(--ht-danger);
  animation: none;
}

@keyframes ht-breathe {
  0%, 100% { opacity: 0.4; }
  50%      { opacity: 1; }
}

/* — Headings ——————————————————————————————————————————— */
.ht-heading-1 {
  font-family: var(--ht-font-heading);
  font-size: var(--ht-text-2xl);
  font-weight: 600;
  color: var(--ht-text-faint);
}

.ht-heading-4 {
  font-family: var(--ht-font-heading);
  font-size: var(--ht-text-lg);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.35em;
}

.ht-heading-5 {
  font-family: var(--ht-font-heading);
  font-size: var(--ht-text-base);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.35em;
}

.ht-subheading-4 {
  font-family: var(--ht-font-heading);
  font-size: var(--ht-text-lg);
  font-weight: 400;
  color: var(--ht-text-muted);
}

.ht-subheading-6 {
  font-size: var(--ht-text-sm);
  color: var(--ht-text-muted);
}

.ht-label {
  font-size: var(--ht-text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ht-text-muted);
  margin-bottom: 0.25em;
}

/* — Icons —————————————————————————————————————————————— */
.ht-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25em;
  height: 1.25em;
}

.ht-icon--sm {
  width: 1em;
  height: 1em;
}

/* — Utilities —————————————————————————————————————————— */
/* Text alignment */
.ht-text-center { text-align: center; }
.ht-text-right  { text-align: right; }

/* Text color */
.ht-text-muted   { color: var(--ht-text-muted); }
.ht-text-faint   { color: var(--ht-text-faint); }
.ht-text-danger  { color: var(--ht-danger); }
.ht-text-success { color: var(--ht-success); }

/* Text size */
.ht-text-xs { font-size: var(--ht-text-xs); }
.ht-text-sm { font-size: var(--ht-text-sm); }

/* Flex */
.ht-flex     { display: flex; }
.ht-flex-col { flex-direction: column; }
.ht-flex-grow { flex-grow: 1; }

/* Spacing: margin */
.ht-mb-3 { margin-bottom: var(--ht-sp-3); }
.ht-mb-4 { margin-bottom: var(--ht-sp-4); }
.ht-mb-5 { margin-bottom: 1.25rem; }
.ht-mb-6 { margin-bottom: var(--ht-sp-6); }
.ht-ml-2 { margin-left: var(--ht-sp-2); }
.ht-mr-2 { margin-right: var(--ht-sp-2); }
.ht-mt-3 { margin-top: var(--ht-sp-3); }
.ht-mt-4 { margin-top: var(--ht-sp-4); }
.ht-mt-auto { margin-top: auto; }

/* Spacing: padding */
.ht-p-hero  { padding: var(--ht-sp-12) var(--ht-sp-4); }
.ht-pl-6 { padding-left: var(--ht-sp-6); }

/* Width */
.ht-w-full { width: 100%; }

/* Nowrap */
.ht-nowrap { white-space: nowrap; }

/* — Animations ————————————————————————————————————————— */
@keyframes ht-pulse {
  0%   { opacity: 0.5; }
  100% { opacity: 1; }
}

.ht-live-pulse {
  animation: ht-pulse 0.6s ease-in-out;
}

/* — Log container —————————————————————————————————————— */
.ht-log-container {
  overflow-y: auto;
}

/* — Group / instance rows —————————————————————————————— */
.ht-group-header {
  background: var(--ht-slate-50);
}

.ht-instance-row td:first-child {
  padding-left: var(--ht-sp-6);
}

/* Event list (event feed partial) */
.ht-event-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.ht-event-list li {
  padding: 0.2em 0;
}

/* — Responsive: tablet & mobile (max-width: 768px) ———— */
@media screen and (max-width: 768px) {
  .ht-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
  }

  .ht-sidebar.is-open {
    width: 260px;
  }

  .ht-sidebar.is-open .ht-sidebar-toggle {
    display: inline-flex;
  }

  .ht-sidebar-backdrop {
    display: block;
  }

  .ht-main {
    margin-left: 56px;
  }

  .ht-status-bar {
    padding: 0.4rem 1rem;
  }

  .ht-section {
    padding: 1rem;
  }

  /* Grid: stack columns */
  .ht-grid {
    grid-template-columns: 1fr;
  }

  .ht-grid-col-5,
  .ht-grid-col-6,
  .ht-grid-col-7,
  .ht-grid-col-12 {
    grid-column: span 1;
  }

  /* Tables: horizontal scroll */
  .ht-card > .ht-table,
  .ht-card > div > .ht-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Level: wrap */
  .ht-level {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .ht-level-start,
  .ht-level-end {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  /* Tabs: scroll horizontally */
  .ht-tabs ul {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .ht-tabs li {
    flex-shrink: 0;
  }

  /* Field groups: stack */
  .ht-field-group {
    flex-wrap: wrap;
  }

  /* Headings: smaller */
  .ht-heading-4 {
    font-size: 1.1rem;
  }

  .ht-heading-5 {
    font-size: 1rem;
  }
}

/* — Alert Banner ———————————————————————————————————————— */
.ht-alert-banner {
  padding: 0 var(--ht-sp-4);
}

.ht-alert-banner:empty {
  display: none;
}

.ht-alert {
  display: flex;
  align-items: center;
  gap: var(--ht-sp-2);
  padding: var(--ht-sp-2) var(--ht-sp-3);
  border-radius: var(--ht-radius-md);
  font-size: var(--ht-text-sm);
  margin-bottom: var(--ht-sp-2);
}

.ht-alert--warning {
  background: var(--ht-warning-bg);
  border: 1px solid var(--ht-warning-border);
  color: var(--ht-warning-text);
}

.ht-alert--danger {
  background: var(--ht-danger-bg);
  border: 1px solid var(--ht-danger-border);
  color: var(--ht-danger-text);
  flex-direction: column;
  align-items: stretch;
}

.ht-alert-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ht-sp-2);
}

.ht-alert-details {
  margin-top: var(--ht-sp-2);
  display: flex;
  flex-direction: column;
  gap: var(--ht-sp-2);
}

.ht-alert-item {
  padding: var(--ht-sp-2);
  background: var(--ht-surface-inset);
  border-radius: var(--ht-radius-sm);
}

.ht-alert-item-header {
  display: flex;
  align-items: center;
  gap: var(--ht-sp-2);
  flex-wrap: wrap;
}

.ht-alert-item-header a {
  color: inherit;
  text-decoration: underline;
}

.ht-traceback {
  margin: var(--ht-sp-2) 0 0;
  padding: var(--ht-sp-2) var(--ht-sp-3);
  background: var(--ht-surface-code);
  color: var(--ht-text-code);
  border-radius: var(--ht-radius-sm);
  font-family: var(--ht-font-mono);
  font-size: var(--ht-text-xs);
  overflow-x: auto;
  white-space: pre;
  line-height: 1.6;
}

/* — App Chips (dashboard) ————————————————————————————— */
.ht-app-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ht-sp-2);
}

.ht-app-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.25em 0.6em;
  font-size: var(--ht-text-sm);
  font-weight: 500;
  border-radius: var(--ht-radius-full);
  background: var(--ht-slate-100);
  color: var(--ht-text-muted);
  text-decoration: none;
  white-space: nowrap;
  transition: opacity 0.15s;
}

.ht-app-chip:hover {
  opacity: 0.8;
  text-decoration: none;
}

.ht-app-chip--running  { background: var(--ht-success-light); color: var(--ht-success-text); }
.ht-app-chip--failed   { background: var(--ht-danger-light);  color: var(--ht-danger-text); }
.ht-app-chip--stopped  { background: var(--ht-warning-light); color: var(--ht-warning-text); }
.ht-app-chip--disabled { background: var(--ht-slate-100);     color: var(--ht-text-muted); opacity: 0.6; }

/* — Timeline (dashboard) ————————————————————————————— */
.ht-timeline {
  display: flex;
  flex-direction: column;
  gap: var(--ht-sp-2);
  max-height: 300px;
  overflow-y: auto;
  overflow-x: hidden;
}

.ht-timeline-entry {
  display: flex;
  align-items: center;
  gap: var(--ht-sp-2);
  padding: var(--ht-sp-1) 0;
  border-bottom: 1px solid var(--ht-border-subtle);
  min-width: 0;
}

.ht-timeline-entry code {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1;
}

.ht-timeline-entry:last-child {
  border-bottom: none;
}

/* — Detail Row / Panel (expandable table rows) ————————— */
.ht-detail-row:hover {
  background: var(--ht-surface-inset);
}

.ht-detail-panel-row > td {
  padding: 0;
  border-top: none;
  border-bottom: none;
}

.ht-detail-panel {
  padding: var(--ht-sp-2) var(--ht-sp-4);
  background: var(--ht-surface-code);
  color: var(--ht-text-code);
  border-radius: var(--ht-radius-sm);
  margin: 0 var(--ht-sp-2) var(--ht-sp-2);
  display: flex;
  flex-wrap: wrap;
  gap: var(--ht-sp-3) var(--ht-sp-6);
}

.ht-detail-fields {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ht-sp-3) var(--ht-sp-6);
}

.ht-detail-field {
  display: flex;
  flex-direction: column;
  gap: var(--ht-sp-1);
}

.ht-detail-label {
  font-size: var(--ht-text-xs);
  color: var(--ht-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

.ht-detail-panel .ht-detail-label {
  color: var(--ht-text-code);
  opacity: 0.65;
}

/* — Responsive: small phones (max-width: 480px) ———————— */
@media screen and (max-width: 480px) {
  .ht-section {
    padding: 0.75rem;
  }

  .ht-card {
    padding: var(--ht-sp-3);
  }
}
