:root {
  --bg: #f4f1ea;
  --card: #fffdf7;
  --ink: #1a1a1a;
  --muted: #6a655b;
  --accent: #116466;
  --danger: #b23a48;
  --ok: #2a7f62;
  --warn: #c07a00;
  --line: #ddd6c8;
  --shadow: 0 12px 36px rgba(29, 24, 16, 0.12);
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 20%, #e4dccf 0%, transparent 35%),
    radial-gradient(circle at 88% 18%, #f5d9b8 0%, transparent 28%),
    linear-gradient(160deg, #f6f3ed 0%, #efe8dc 100%);
  min-height: 100vh;
}

.hidden { display: none !important; }
.muted-text { color: var(--muted); font-size: 0.8rem; }

.page {
  max-width: 1440px;
  margin: 0 auto;
  padding: 14px;
}

/* ── topbar ──────────────────────────────────────────── */
.topbar {
  background: linear-gradient(120deg, #0f4c5c 0%, #1f7a8c 65%, #2f9daf 100%);
  color: #f9fbfb;
  border-radius: 18px;
  padding: 16px 22px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}

.topbar h1 {
  margin: 0;
  font-size: clamp(1.1rem, 2.5vw, 1.6rem);
  font-weight: 700;
  flex: 0 0 auto;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex: 1 1 auto;
}

.status-line {
  color: rgba(249, 251, 251, 0.82);
  font-size: 0.88rem;
  flex: 1 1 auto;
  text-align: right;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-user {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.95);
  font-size: 0.8rem;
  font-weight: 600;
}

.topbar-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.14);
  color: #f9fbfb;
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 700;
  padding: 8px 12px;
}

.topbar-link:hover {
  filter: brightness(1.08);
}

.robot-alert {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  border: 1px solid rgba(255, 124, 124, 0.45);
  background: rgba(178, 58, 72, 0.16);
  color: #ffd6d6;
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 6px 10px;
}

.users-wrap {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 14px;
  margin-bottom: 12px;
}

.users-wrap h2 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.users-create-grid {
  display: grid;
  grid-template-columns: 1.1fr 1.2fr 1fr 0.8fr 0.8fr auto;
  gap: 8px;
}

.users-create-grid input,
.users-create-grid select,
.users-table input,
.users-table select {
  border: 1px solid #cdbda0;
  border-radius: 9px;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 0.86rem;
  background: #fffaf1;
}

.plans-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 8px;
}

.plans-grid input {
  border: 1px solid #cdbda0;
  border-radius: 9px;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 0.86rem;
  background: #fffaf1;
}

.plans-grid button {
  justify-self: start;
}

.users-table-wrap {
  overflow: auto;
}

.users-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 920px;
}

.users-table th,
.users-table td {
  border-bottom: 1px solid #ede9e0;
  padding: 8px;
  text-align: left;
}

.users-table th {
  background: #ede7db;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #5a5248;
}

.users-actions {
  display: inline-flex;
  gap: 6px;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.auth-card {
  width: min(460px, 100%);
  background: linear-gradient(165deg, #fffdf8 0%, #f6efe4 100%);
  border: 1px solid #daccb3;
  border-radius: 22px;
  box-shadow: 0 20px 50px rgba(24, 19, 12, 0.18);
  padding: 26px;
}

.auth-brand {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  background: #e6ddcc;
  color: #5f5548;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.auth-card h1 {
  margin: 10px 0 8px;
  font-size: clamp(1.45rem, 3.8vw, 2rem);
}

.auth-sub {
  margin: 0 0 14px;
  color: #6a655b;
  font-size: 0.92rem;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.auth-tab {
  background: #e8deca;
  color: #50483d;
  border: 1px solid #d3c4a9;
}

.auth-tab.active {
  background: #116466;
  color: white;
}

.auth-form {
  display: grid;
  gap: 10px;
}

.auth-form label {
  display: grid;
  gap: 6px;
  font-size: 0.84rem;
  color: #61584b;
  font-weight: 600;
}

.auth-form input {
  border: 1px solid #cdbda0;
  border-radius: 10px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 0.95rem;
  background: #fffaf1;
}

.auth-status {
  min-height: 20px;
  margin: 10px 0 0;
  color: #2a7f62;
  font-size: 0.86rem;
  font-weight: 600;
}

.auth-status.is-error {
  color: #b23a48;
}

.auth-hint {
  margin-top: 14px;
  padding: 10px;
  border-radius: 10px;
  border: 1px dashed #d4c6ad;
  background: #fbf6ec;
  color: #5b5247;
  display: grid;
  gap: 3px;
  font-size: 0.8rem;
}

.auto-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(249, 251, 251, 0.9);
  font-size: 0.88rem;
  white-space: nowrap;
}

.auto-wrap input {
  width: 56px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.15);
  color: white;
  padding: 5px 8px;
  text-align: center;
  font-weight: 600;
  font-family: inherit;
}

/* ── buttons ─────────────────────────────────────────── */
button {
  border: 0;
  border-radius: 11px;
  background: var(--accent);
  color: white;
  font-weight: 700;
  padding: 9px 14px;
  cursor: pointer;
  font-size: 0.88rem;
  white-space: nowrap;
  font-family: inherit;
  line-height: 1.2;
}

button:hover { filter: brightness(1.12); }
button:disabled { opacity: 0.5; cursor: default; filter: none; }

button.secondary {
  background: rgba(255,255,255,0.18);
  color: white;
}

button.active { background: #d97706; }

/* ── table wrap ──────────────────────────────────────── */
.table-wrap {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: auto;
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 880px;
}

thead th:nth-child(2),
tbody td:nth-child(2) {
  width: 23%;
  max-width: 280px;
}

thead th:nth-child(3),
tbody td:nth-child(3) {
  width: auto;
}

thead th {
  text-align: left;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #5a5248;
  background: #ede7db;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 1;
}

.col-img { width: 56px; padding: 6px 4px 6px 12px !important; }
.col-del { width: 36px; }

tbody td {
  border-bottom: 1px solid #ede9e0;
  padding: 10px 12px;
  vertical-align: middle;
}

tbody tr {
  opacity: 0;
  transform: translateY(4px);
  animation: row-in 0.28s ease forwards;
}

@keyframes row-in { to { opacity: 1; transform: translateY(0); } }

/* ── product image ───────────────────────────────────── */
.product-thumb {
  width: 48px;
  height: 48px;
  object-fit: contain;
  object-position: center;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 2px;
  display: block;
}

.thumb-stack {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.reorder-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 32px;
  color: #9a8f7e;
  font-size: 13px;
  line-height: 1;
  letter-spacing: -1px;
  cursor: grab;
  user-select: none;
}

.product-row.dragging {
  opacity: 0.55;
}

.product-row.drag-over td {
  box-shadow: inset 0 2px 0 #2a7f62;
}

.thumb-placeholder {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: #ece5d8;
  border: 1px dashed #ccc;
}

/* ── product name ────────────────────────────────────── */
.url-link {
  font-size: 0.76rem;
  color: #2a7f9a;
  text-decoration: none;
}
.url-link:hover { text-decoration: underline; }

/* ── price input ─────────────────────────────────────── */
.price-input {
  width: 110px;
  border-radius: 9px;
  border: 1px solid #cbbfa7;
  padding: 7px 9px;
  font-weight: 600;
  background: #faf6ef;
  font-family: inherit;
}

.prod-name {
  display: -webkit-box;
  max-width: 100%;
  white-space: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.25;
  max-height: calc(1.25em * 2);
  vertical-align: bottom;
}

/* ── badges ──────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
}
.badge.ok     { background: rgba(42,127,98,0.15);  color: var(--ok); }
.badge.warn   { background: rgba(192,122,0,0.18);  color: var(--warn); }
.badge.danger { background: rgba(178,58,72,0.15);  color: var(--danger); }

/* ── delta ───────────────────────────────────────────── */
.delta.pos { color: var(--danger); font-weight: 700; }
.delta.neg { color: var(--ok);     font-weight: 700; }

/* ── competitor cell ─────────────────────────────────── */
.comp-cell {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.comp-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.pill {
  border-radius: 8px;
  background: #f0ebe0;
  border: 1px solid #dbd1bf;
  padding: 3px 7px;
  font-size: 0.78rem;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.pill a { color: #0f4c5c; text-decoration: none; }
.pill a:hover { text-decoration: underline; }

.pill.price-low {
  background: #e8f4ec;
  border-color: #b8d8c4;
}

.pill.price-high {
  background: #f8e8e8;
  border-color: #e2bcbc;
}

.pill.price-low.price-high {
  background: #f0ebe0;
  border-color: #dbd1bf;
}

.my-pill-label {
  color: #0f4c5c;
  font-weight: 700;
}

.pill.mine {
  border-width: 2px;
  border-color: #0f4c5c;
  box-shadow: 0 0 0 1px rgba(15, 76, 92, 0.2), inset 0 0 0 1px rgba(255, 255, 255, 0.45);
}

.price-trend {
  display: inline-block;
  font-weight: 800;
  margin-right: 4px;
  line-height: 1;
}

.price-trend.trend-down {
  color: #2a7f62;
}

.price-trend.trend-up {
  color: #b23a48;
}

/* ── prices cell ─────────────────────────────────────────────── */
.prices-cell { display: flex; flex-direction: column; gap: 5px; }

@media (max-width: 980px) {
  thead th:nth-child(2),
  tbody td:nth-child(2) {
    width: 28%;
    max-width: 220px;
  }
}

/* ── chart stats bar ─────────────────────────────────────────── */
.chart-stats {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 10px 16px 8px;
  border-bottom: 1px solid #ede7db;
}

.stat-item {
  font-size: 0.85rem;
  color: var(--ink);
  display: flex;
  gap: 4px;
  align-items: baseline;
}

.stat-lbl {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-item.delta.pos { color: var(--danger); font-weight: 700; }
.stat-item.delta.neg { color: var(--ok); font-weight: 700; }

.comp-price {
  cursor: pointer;
  border-bottom: 1px dashed currentColor;
  transition: color 0.15s;
}
.comp-price:hover { color: var(--accent); }

.del-comp-btn {
  background: none;
  color: #aaa;
  padding: 0 2px;
  font-size: 0.8rem;
  font-weight: 400;
  border-radius: 3px;
  line-height: 1;
}
.del-comp-btn:hover { color: var(--danger); background: none; filter: none; }

/* ── add competitor inline ───────────────────────────── */
.comp-add-wrap { display: flex; align-items: center; gap: 5px; }

.add-comp-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  padding: 0;
  font-size: 1.1rem;
  line-height: 1;
  background: rgba(17,100,102,0.1);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}
.add-comp-btn:hover { background: var(--accent); color: white; filter: none; }

.comp-url-row { display: flex; align-items: center; gap: 4px; }

.comp-url-input {
  border-radius: 8px;
  border: 1px solid #cbbfa7;
  padding: 5px 8px;
  font-size: 0.82rem;
  width: 200px;
  background: #faf6ef;
  font-family: inherit;
}

.comp-go-btn, .comp-cancel-btn { padding: 5px 9px; font-size: 0.82rem; }
.comp-cancel-btn { background: rgba(0,0,0,0.08); color: var(--ink); }
.comp-cancel-btn:hover { background: rgba(0,0,0,0.15); filter: none; }

/* ── row action buttons ──────────────────────────────────── */
.col-del { width: 76px; }

.row-actions {
  display: flex;
  gap: 2px;
  justify-content: flex-end;
  align-items: center;
}

.refresh-row-btn,
.chart-toggle-btn {
  background: none;
  color: #b0a898;
  padding: 3px 5px;
  font-size: 0.92rem;
  border-radius: 5px;
  font-weight: 400;
  line-height: 1;
  transition: transform 0.2s;
}
.refresh-row-btn:hover { color: var(--accent); background: rgba(17,100,102,0.08); filter: none; }
.chart-toggle-btn:hover { color: #d97706; background: rgba(217,119,6,0.08); filter: none; }
.chart-toggle-btn.chart-open { color: #d97706; transform: rotate(180deg); }

/* ── price history chart row ─────────────────────────────── */
.chart-row td { padding: 0; border-bottom: 1px solid var(--line); }
.chart-container { background: #faf7f1; border-top: 1px solid #ede7db; }
.chart-svg-wrap {
  position: relative;
  padding: 10px 16px 8px;
}

.chart-legend {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
}

.chart-tooltip {
  position: absolute;
  z-index: 3;
  min-width: 132px;
  max-width: 200px;
  padding: 9px 10px;
  border-radius: 10px;
  background: rgba(255, 253, 247, 0.96);
  border: 1px solid rgba(219, 209, 191, 0.9);
  box-shadow: 0 10px 24px rgba(29, 24, 16, 0.14);
  color: var(--ink);
  font-size: 0.78rem;
  line-height: 1.35;
  pointer-events: auto;
  backdrop-filter: blur(4px);
}

.chart-tip-title {
  font-weight: 700;
  color: #0f4c5c;
  margin-bottom: 3px;
}

.chart-tip-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.chart-tip-del-btn {
  border: none;
  background: rgba(178, 58, 72, 0.1);
  color: var(--danger);
  width: 20px;
  height: 20px;
  border-radius: 999px;
  padding: 0;
  line-height: 1;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
}

.chart-tip-del-btn:hover {
  background: rgba(178, 58, 72, 0.18);
  filter: none;
}

.chart-point-hit {
  cursor: pointer;
}

/* ── delete product ──────────────────────────────────── */
.del-prod-btn {
  background: none;
  color: #c0b8ac;
  padding: 4px 6px;
  font-size: 1rem;
  border-radius: 6px;
}
.del-prod-btn:hover { color: var(--danger); background: none; filter: none; }

/* ── add product bar ─────────────────────────────────── */
.add-product-bar {
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.add-trigger-btn {
  background: rgba(17,100,102,0.08);
  color: var(--accent);
  border: 1.5px dashed var(--accent);
  border-radius: 11px;
  font-size: 0.92rem;
}
.add-trigger-btn:hover { background: var(--accent); color: white; filter: none; }

.url-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  flex-wrap: wrap;
}

.url-input-row input[type="url"] {
  flex: 1;
  min-width: 260px;
  border-radius: 9px;
  border: 1px solid #cbbfa7;
  padding: 9px 12px;
  font-size: 0.92rem;
  background: #faf6ef;
  font-family: inherit;
}

/* ── modal ───────────────────────────────────────────── */
body.modal-open {
  overflow: hidden;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(33, 29, 22, 0.32);
  backdrop-filter: blur(4px);
}

.modal-card {
  width: min(100%, 460px);
  border: 1px solid rgba(219, 209, 191, 0.95);
  border-radius: 22px;
  background:
    radial-gradient(circle at top right, rgba(245, 217, 184, 0.55), transparent 34%),
    linear-gradient(180deg, #fffdf8 0%, #f7f1e6 100%);
  box-shadow: 0 24px 60px rgba(29, 24, 16, 0.22);
  padding: 22px 22px 18px;
}

.modal-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(217, 119, 6, 0.12);
  color: #c07a00;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.modal-card h2 {
  margin: 12px 0 8px;
  font-size: 1.35rem;
  line-height: 1.1;
}

.modal-copy {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.modal-product-name {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid #e2d7c5;
  color: #0f4c5c;
  font-weight: 700;
  line-height: 1.4;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.modal-btn-secondary {
  background: rgba(17, 100, 102, 0.08);
  color: var(--accent);
  border: 1px solid rgba(17, 100, 102, 0.16);
}

.modal-btn-secondary:hover {
  background: rgba(17, 100, 102, 0.14);
  filter: none;
}

.modal-btn-danger {
  background: linear-gradient(135deg, #c64f5b 0%, #b23a48 100%);
  color: white;
}

.modal-btn-danger:hover {
  filter: brightness(1.06);
}

.limit-modal-card {
  background:
    radial-gradient(circle at top right, rgba(15, 76, 92, 0.2), transparent 40%),
    radial-gradient(circle at bottom left, rgba(217, 119, 6, 0.16), transparent 40%),
    linear-gradient(180deg, #fffdf8 0%, #f7f1e6 100%);
}

/* ── responsive ──────────────────────────────────────── */
@media (max-width: 860px) {
  .page { padding: 8px; }
  .topbar { border-radius: 13px; padding: 12px 14px; }
  table { min-width: 760px; }
  .comp-url-input { width: 150px; }
  .modal-card {
    padding: 18px 16px 16px;
    border-radius: 18px;
  }

  .modal-actions {
    flex-direction: column-reverse;
  }

  .modal-actions button {
    width: 100%;
  }
}


* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 20%, #e4dccf 0%, transparent 35%),
    radial-gradient(circle at 88% 18%, #f5d9b8 0%, transparent 28%),
    linear-gradient(160deg, #f6f3ed 0%, #efe8dc 100%);
}

.page {
  max-width: 1320px;
  margin: 24px auto;
  padding: 16px;
}

.hero {
  background: linear-gradient(120deg, #0f4c5c 0%, #1f7a8c 65%, #2f9daf 100%);
  color: #f9fbfb;
  border-radius: 20px;
  padding: 22px;
  box-shadow: var(--shadow);
}

.hero h1 {
  margin: 0;
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 700;
}

.hero p {
  margin: 8px 0 0;
  color: rgba(249, 251, 251, 0.88);
}

.composer-grid {
  margin: 14px 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 12px;
}

.panel {
  background: rgba(255, 253, 247, 0.86);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.panel h3 {
  margin: 2px 0 6px;
  font-size: 1rem;
}

.panel input,
.panel select {
  width: 100%;
  border-radius: 10px;
  border: 1px solid #cbbfa7;
  padding: 10px;
  background: #fffdf8;
}

.auto-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.auto-row input {
  width: 90px;
}

.muted {
  color: var(--muted);
  font-size: 0.86rem;
  margin: 0;
}

.controls {
  margin: 14px 0 18px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

button {
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: white;
  font-weight: 700;
  padding: 12px 16px;
  cursor: pointer;
}

button:hover {
  filter: brightness(1.05);
}

button.secondary {
  background: #d4cec2;
  color: #2f2b23;
}

.status-line {
  color: var(--muted);
  font-size: 0.95rem;
}

.table-wrap {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: auto;
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 960px;
}

thead th {
  text-align: left;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  color: #3f392f;
  background: #efe9de;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
}

tbody td {
  border-bottom: 1px solid var(--line);
  padding: 12px;
  vertical-align: top;
}

tbody tr {
  opacity: 0;
  transform: translateY(6px);
  animation: row-in 0.34s ease forwards;
}

@keyframes row-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.price-input {
  width: 120px;
  border-radius: 10px;
  border: 1px solid #cbbfa7;
  padding: 8px 10px;
  font-weight: 600;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.8rem;
  font-weight: 700;
}

.badge.ok {
  background: rgba(42, 127, 98, 0.15);
  color: var(--ok);
}

.badge.warn {
  background: rgba(192, 122, 0, 0.18);
  color: var(--warn);
}

.badge.danger {
  background: rgba(178, 58, 72, 0.15);
  color: var(--danger);
}

.competitors {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pill {
  border-radius: 10px;
  background: #f3eee4;
  border: 1px solid #dbd1bf;
  padding: 5px 8px;
  font-size: 0.82rem;
}

.pill a {
  color: #0f4c5c;
  text-decoration: none;
}

.delta.pos {
  color: var(--danger);
  font-weight: 700;
}

.delta.neg {
  color: var(--ok);
  font-weight: 700;
}

@media (max-width: 960px) {
  .composer-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .page {
    margin: 10px auto;
    padding: 10px;
  }

  .hero {
    border-radius: 14px;
    padding: 14px;
  }

  table {
    min-width: 800px;
  }
}
