:root {
  --bg: #f5f0e7;
  --bg-accent: #e7dcc7;
  --surface: rgba(255, 252, 246, 0.9);
  --surface-strong: #fffaf2;
  --border: rgba(34, 42, 37, 0.12);
  --text: #1f2722;
  --muted: #66706a;
  --accent: #0f6a66;
  --accent-soft: rgba(15, 106, 102, 0.12);
  --success: #1f7a45;
  --success-soft: rgba(31, 122, 69, 0.12);
  --warning: #9c5a12;
  --warning-soft: rgba(156, 90, 18, 0.14);
  --stopped: #5e6862;
  --stopped-soft: rgba(94, 104, 98, 0.12);
  --danger: #b74434;
  --danger-soft: rgba(183, 68, 52, 0.12);
  --shadow: 0 20px 60px rgba(29, 36, 31, 0.08);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Avenir Next", "Segoe UI Variable", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(15, 106, 102, 0.1), transparent 28%),
    radial-gradient(circle at top right, rgba(156, 90, 18, 0.12), transparent 24%),
    linear-gradient(180deg, var(--bg), #fbf7f0);
}

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

a:hover {
  text-decoration: underline;
}

button,
input {
  font: inherit;
}

.page-shell {
  width: min(1440px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.surface {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.masthead {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  padding: 32px;
  position: relative;
  overflow: hidden;
}

.masthead::after {
  content: "";
  position: absolute;
  inset: auto -12% -45% auto;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(15, 106, 102, 0.14), transparent 62%);
  pointer-events: none;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  font-weight: 700;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
  font-weight: 700;
  letter-spacing: -0.03em;
}

h1 {
  font-size: clamp(2.6rem, 5vw, 4.6rem);
  line-height: 0.95;
  max-width: 10ch;
}

h2 {
  font-size: 1.8rem;
}

h3 {
  font-size: 1.3rem;
}

.lede {
  max-width: 58ch;
  margin: 16px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.masthead-actions {
  display: grid;
  gap: 16px;
  align-content: start;
  justify-items: end;
}

.host-meta,
.inventory-meta {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.refresh-button {
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid rgba(15, 106, 102, 0.22);
  background: var(--accent);
  color: #f7fbfa;
  cursor: pointer;
}

.refresh-button:hover,
.refresh-button:focus-visible {
  background: #0c5956;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
  padding: 18px 20px;
}

.search-field {
  flex: 1 1 340px;
  min-height: 52px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid rgba(15, 106, 102, 0.14);
  background: var(--surface-strong);
}

.search-icon,
.clear-button {
  color: var(--muted);
}

.search-field input {
  width: 100%;
  padding: 14px 0;
  border: 0;
  background: transparent;
  outline: 0;
  color: var(--text);
}

.clear-button {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
}

.clear-button:hover,
.clear-button:focus-visible {
  background: rgba(31, 39, 34, 0.06);
}

.segment {
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(31, 39, 34, 0.06);
}

.segment-button {
  min-height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.segment-button.active {
  background: #1f2722;
  color: #fbf7f0;
}

.warning-stack {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.warning {
  padding: 14px 18px;
  border-color: rgba(183, 68, 52, 0.24);
  background: rgba(255, 247, 244, 0.94);
}

.warning p {
  margin: 0;
  color: var(--danger);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.summary-card {
  padding: 22px;
}

.summary-label {
  margin: 0;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.78rem;
  font-weight: 700;
}

.summary-value {
  margin: 14px 0 10px;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1;
  font-weight: 800;
}

.summary-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.table-shell {
  margin-top: 20px;
  padding: 22px;
}

.section-header {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 18px;
}

.table-scroll {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 1080px;
  border-collapse: collapse;
}

thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 14px 16px;
  background: var(--surface-strong);
  border-bottom: 1px solid var(--border);
  text-align: left;
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

tbody td {
  padding: 16px;
  vertical-align: top;
  border-bottom: 1px solid rgba(31, 39, 34, 0.08);
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover {
  background: rgba(255, 250, 242, 0.6);
}

.numeric {
  text-align: right;
}

.project-cell {
  display: grid;
  gap: 8px;
}

.project-heading {
  display: grid;
  gap: 8px;
}

.project-name {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.meta-row,
.stack-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.meta-pill,
.port-pill,
.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
}

.meta-pill {
  background: rgba(31, 39, 34, 0.06);
  color: var(--muted);
}

.port-pill {
  background: rgba(15, 106, 102, 0.08);
  color: var(--accent);
}

.status-running {
  background: var(--success-soft);
  color: var(--success);
}

.status-partial,
.status-failed {
  background: var(--warning-soft);
  color: var(--warning);
}

.status-stopped {
  background: var(--stopped-soft);
  color: var(--stopped);
}

.project-detail {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.project-detail.note {
  color: var(--warning);
}

.mono {
  font-family: "JetBrains Mono", "SFMono-Regular", "Menlo", monospace;
  font-size: 0.85rem;
}

.clamp {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

.empty-state {
  padding: 36px 20px 28px;
  text-align: center;
  color: var(--muted);
}

.empty-state p {
  max-width: 48ch;
  margin: 12px auto 0;
  line-height: 1.6;
}

.hidden {
  display: none;
}

@media (max-width: 1024px) {
  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .page-shell {
    width: min(100vw - 20px, 100%);
    padding-top: 20px;
  }

  .masthead {
    grid-template-columns: 1fr;
    padding: 24px;
  }

  .masthead-actions {
    justify-items: start;
  }

  .controls,
  .section-header {
    align-items: stretch;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }

  .table-shell {
    padding: 18px;
  }
}
