:root {
  --bg: #f5f6f4;
  --ink: #1c2420;
  --muted: #63706a;
  --line: #d9dfd9;
  --surface: #ffffff;
  --accent: #0f766e;
  --accent-2: #c2410c;
  --accent-3: #4f46e5;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", Arial, sans-serif;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px clamp(16px, 4vw, 40px) 18px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfa;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(22px, 3vw, 34px);
}

h2 {
  margin-bottom: 14px;
  font-size: 18px;
}

.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px clamp(16px, 4vw, 40px);
  background: #eef2ee;
  border-bottom: 1px solid var(--line);
}

.tab,
.icon-button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-weight: 650;
}

.tab {
  padding: 0 16px;
  white-space: nowrap;
}

.tab.active,
.icon-button:hover {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.icon-button {
  padding: 0 14px;
}

main {
  padding: 22px clamp(16px, 4vw, 40px) 48px;
}

.panel {
  display: none;
}

.panel.active {
  display: block;
}

.grid {
  display: grid;
  gap: 18px;
}

.grid.two {
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
}

.surface {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 28px rgba(28, 36, 32, 0.06);
}

.input {
  width: 100%;
  min-height: 42px;
  margin-bottom: 14px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.results {
  display: grid;
  gap: 10px;
}

.result-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.result-card strong {
  display: block;
  margin-bottom: 4px;
}

.stock {
  display: inline-flex;
  margin-top: 8px;
  padding: 5px 9px;
  border-radius: 7px;
  background: #e6f3f1;
  color: #075e57;
  font-weight: 750;
}

.table-wrap {
  max-height: 62vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #edf3f1;
  font-size: 12px;
  text-transform: uppercase;
}

.bars {
  display: grid;
  gap: 10px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(96px, 180px) 1fr minmax(62px, auto);
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.bar-label {
  overflow-wrap: anywhere;
  font-weight: 650;
}

.bar-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6eae6;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.empty {
  padding: 18px;
  color: var(--muted);
}

footer {
  position: fixed;
  right: 14px;
  bottom: 12px;
  max-width: min(520px, calc(100vw - 28px));
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 900px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

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

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