:root {
  --bg: #0b0b0d;
  --bg-elevated: #121216;
  --bg-panel: #15161b;
  --bg-soft: #1c1d24;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(212, 175, 55, 0.24);
  --text: #f5f2e8;
  --muted: rgba(245, 242, 232, 0.64);
  --faint: rgba(245, 242, 232, 0.38);
  --gold: #d2aa52;
  --gold-soft: rgba(210, 170, 82, 0.18);
  --green: #56c288;
  --amber: #d8a64b;
  --red: #d96f6f;
  --blue: #6ea3ff;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --sidebar-width: 280px;
  --drawer-width: 420px;
  --font-ui: Inter, ui-sans-serif, system-ui, sans-serif;
  --font-display: "Times New Roman", Georgia, serif;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(210, 170, 82, 0.08), transparent 34%),
    radial-gradient(circle at bottom right, rgba(110, 163, 255, 0.06), transparent 30%),
    var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
}

body {
  min-height: 100vh;
}

button,
input,
select {
  font: inherit;
}

.shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr) var(--drawer-width);
  min-height: 100vh;
}

.sidebar {
  border-right: 1px solid var(--line);
  background: rgba(10, 10, 13, 0.82);
  backdrop-filter: blur(18px);
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.main {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.drawer {
  border-left: 1px solid var(--line);
  background: rgba(18, 18, 22, 0.92);
  backdrop-filter: blur(16px);
  padding: 28px 22px;
  overflow-y: auto;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, rgba(210, 170, 82, 0.24), rgba(210, 170, 82, 0.06));
  border: 1px solid var(--line-strong);
  color: var(--gold);
  font-weight: 700;
  letter-spacing: 0.08em;
}

h1,
h2,
h3 {
  margin: 0;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.75rem);
  line-height: 1.02;
  max-width: 11ch;
  letter-spacing: -0.03em;
}

.eyebrow {
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  margin-bottom: 8px;
}

.sidebar-label,
.panel-label {
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.72rem;
}

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

.filter-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-pill,
.icon-button,
.search-input,
.select-input {
  border: 1px solid var(--line);
  background: var(--bg-panel);
  color: var(--text);
}

.filter-pill {
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
}

.filter-pill.active,
.gold-button {
  background: linear-gradient(180deg, rgba(210, 170, 82, 0.24), rgba(210, 170, 82, 0.1));
  color: var(--text);
  border-color: var(--line-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.gold-button {
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  border: 1px solid var(--line);
}

.status-badge.good {
  color: #9ef0be;
  background: rgba(86, 194, 136, 0.12);
}

.status-badge.warn {
  color: #ffd18c;
  background: rgba(216, 166, 75, 0.12);
}

.status-badge.bad {
  color: #ffadad;
  background: rgba(217, 111, 111, 0.12);
}

.status-badge.neutral {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
}

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

.search-input,
.select-input {
  min-height: 46px;
  padding: 0 14px;
  border-radius: 12px;
  outline: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.5fr 0.75fr 0.75fr;
  gap: 18px;
}

.hero-panel,
.table-section,
.priority-rail-wrap {
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.015));
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.hero-panel {
  padding: 24px;
  min-height: 180px;
}

.hero-panel-large {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.hero-score-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.mega-value {
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  font-weight: 700;
  letter-spacing: -0.04em;
}

.panel-value {
  font-size: 2.5rem;
  font-weight: 700;
  margin-top: 16px;
}

.accent {
  color: var(--gold);
}

.hero-meter {
  margin-top: 18px;
}

.meter-label-row,
.section-heading-row,
.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.meter-track {
  margin-top: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.07);
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7a5830, var(--gold));
}

.priority-rail-wrap,
.table-section {
  padding: 20px;
}

.priority-rail {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.priority-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg-panel);
  color: var(--text);
  padding: 16px;
  cursor: pointer;
  text-align: left;
  font: inherit;
}

.priority-card-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.priority-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.75rem;
  border: 1px solid var(--line);
  color: var(--muted);
}

.chip.gold {
  border-color: var(--line-strong);
  color: var(--gold);
  background: var(--gold-soft);
}

.chip.green { color: #9ef0be; }
.chip.red { color: #ffadad; }
.chip.amber { color: #ffd18c; }
.chip.blue { color: #b8ceff; }

.table-wrap {
  margin-top: 16px;
}

.app-table {
  width: 100%;
  border-collapse: collapse;
}

.app-table th,
.app-table td {
  text-align: left;
  padding: 14px 12px;
  border-top: 1px solid var(--line);
  vertical-align: top;
}

.app-table th {
  color: var(--faint);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.app-row {
  cursor: pointer;
  transition: background 160ms ease;
}

.app-row:hover {
  background: rgba(255,255,255,0.03);
}

.score-pill {
  min-width: 54px;
  display: inline-flex;
  justify-content: center;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.05);
}

.mobile-card-list {
  display: none;
  margin-top: 14px;
  gap: 12px;
}

.mobile-app-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg-panel);
  color: var(--text);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.mobile-card-top,
.mobile-card-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.drawer-header {
  position: sticky;
  top: 0;
  padding-bottom: 16px;
  background: inherit;
}

.drawer-content {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-bottom: 44px;
}

.drawer-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg-panel);
  padding: 16px;
}

.drawer-panel.placeholder {
  opacity: 0.55;
}

.drawer-panel.placeholder .detail-value {
  color: var(--faint);
}

.drawer-panel.computed {
  border-color: var(--line-strong);
}

.drawer-panel.computed .detail-value {
  color: var(--gold);
}

.criterion-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  vertical-align: middle;
}

.criterion-tag.placeholder-tag {
  background: rgba(255, 255, 255, 0.06);
  color: var(--faint);
  border: 1px solid var(--line);
}

.criterion-tag.computed-tag {
  background: var(--gold-soft);
  color: var(--gold);
  border: 1px solid var(--line-strong);
}

.drawer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.detail-key {
  color: var(--faint);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 6px;
}

.detail-value {
  color: var(--text);
  font-size: 0.95rem;
}

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

.small {
  font-size: 0.85rem;
}

.icon-button {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  cursor: pointer;
  font-size: 1.2rem;
}

@media (max-width: 1400px) {
  .shell {
    grid-template-columns: 240px minmax(0, 1fr) 360px;
  }

  .priority-rail {
    grid-template-columns: 1fr;
  }
}

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

  .sidebar,
  .drawer {
    border: none;
  }

  .drawer {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    width: min(92vw, 420px);
    transform: translateX(100%);
    transition: transform 180ms ease;
    z-index: 40;
  }

  .drawer.open {
    transform: translateX(0);
  }

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

  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-actions {
    flex-direction: column;
  }

  .search-input,
  .select-input {
    width: 100%;
  }

  .app-table {
    display: none;
  }

  .mobile-card-list {
    display: grid;
  }
}

@media (max-width: 640px) {
  .main,
  .sidebar,
  .drawer {
    padding: 18px;
  }

  .hero-score-row {
    grid-template-columns: 1fr;
  }

  .mega-value {
    font-size: 2.3rem;
  }
}
