/* Price Watch — operational tool, not a marketing page.
   Palette: ink navy surfaces, signal-amber for "needs review", cool teal for
   confirmed/accepted. Monospace for anything numeric — prices and IDs are
   data, not prose, and should look like it. */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
  --ink-900: #10141a;
  --ink-800: #171d26;
  --ink-700: #1f2733;
  --ink-600: #2a3441;
  --line: #313c4a;
  --text-hi: #e8ecf1;
  --text-mid: #9aa7b8;
  --text-lo: #64707f;

  --amber: #e0a955;
  --amber-dim: #6b5732;
  --teal: #4fb8a8;
  --teal-dim: #2c5751;
  --coral: #d9755f;
  --coral-dim: #5c3830;

  --radius: 6px;
  font-family: 'IBM Plex Sans', -apple-system, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--ink-900);
  color: var(--text-hi);
  min-height: 100vh;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 28px;
  border-bottom: 1px solid var(--line);
  background: var(--ink-800);
  position: sticky;
  top: 0;
  z-index: 10;
  flex-wrap: wrap;
  gap: 12px;
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { color: var(--amber); font-size: 18px; }
.brand-name { font-weight: 600; font-size: 16px; letter-spacing: 0.2px; }

.env-tag {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.6px;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid var(--line);
  color: var(--text-mid);
}
.env-sandbox { color: var(--amber); border-color: var(--amber-dim); }
.env-production { color: var(--teal); border-color: var(--teal-dim); }

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

.notice {
  font-size: 12.5px;
  color: var(--text-mid);
  border-left: 2px solid var(--amber-dim);
  padding-left: 10px;
}

.btn-primary {
  background: var(--amber);
  color: var(--ink-900);
  border: none;
  padding: 9px 16px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  transition: filter 0.15s ease;
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary:disabled { opacity: 0.5; cursor: default; }

main { max-width: 920px; margin: 0 auto; padding: 24px 20px 80px; }

@media (min-width: 1400px) {
  main { max-width: 1400px; }
}
@media (min-width: 1900px) {
  main { max-width: 1860px; }
}

.status-strip {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  color: var(--text-lo);
  padding: 6px 4px 18px;
}

.empty-state {
  text-align: center;
  padding: 80px 20px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  margin-top: 20px;
}
.empty-title { font-size: 16px; font-weight: 600; margin: 0 0 6px; }
.empty-sub { color: var(--text-mid); font-size: 13.5px; max-width: 420px; margin: 0 auto 20px; }

.section-block { margin-bottom: 28px; }
.section-heading {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-mid);
  margin: 0 0 12px;
}
.section-raise .section-heading { color: var(--teal); }
.section-subtext {
  font-size: 12.5px;
  color: var(--text-mid);
  margin: -6px 0 14px;
}

.rows {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  align-items: start;
  gap: 12px;
}

.row-card {
  background: var(--ink-800);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  transition: border-color 0.15s ease;
}
.row-card:hover { border-color: var(--ink-600); }

.row-card--raise {
  border-color: var(--teal-dim);
  background: linear-gradient(180deg, rgba(79, 184, 168, 0.06), transparent 60%), var(--ink-800);
}
.row-card--raise:hover { border-color: var(--teal); }

.row-main { margin-bottom: 12px; }
.row-title { font-weight: 500; font-size: 14.5px; line-height: 1.4; }
.row-sub {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--text-lo);
  margin-top: 3px;
}
.row-sub a, .row-sub a:visited { color: var(--text-lo); text-decoration: none; }
.row-sub a:hover { color: var(--amber); text-decoration: underline; }

.row-prices {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.price-block { display: flex; flex-direction: column; gap: 2px; }
.price-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-lo); }
.price-value { font-family: 'IBM Plex Mono', monospace; font-size: 18px; font-weight: 500; }
.price-block.suggested .price-value { color: var(--amber); }
.price-arrow { color: var(--text-lo); font-size: 14px; }
.price-arrow.arrow-up { color: var(--teal); font-weight: 600; }
.price-arrow.arrow-down { color: var(--coral); font-weight: 600; }

.confidence {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 3px;
  align-self: center;
}
.conf-high { color: var(--teal); background: rgba(79, 184, 168, 0.12); }
.conf-medium { color: var(--amber); background: rgba(224, 169, 85, 0.12); }
.conf-low, .conf-none { color: var(--coral); background: rgba(217, 117, 95, 0.12); }
.conf-noaction { color: var(--text-lo); background: rgba(154, 167, 184, 0.1); }

.range-bar-wrap { margin: 14px 0 12px; }
.range-bar {
  position: relative;
  height: 8px;
  background: var(--ink-700);
  border-radius: 4px;
  overflow: visible;
}
.range-segment {
  position: absolute;
  top: 0;
  height: 8px;
  border-radius: 4px;
}
.active-range { background: rgba(154, 167, 184, 0.35); }
.sold-range { background: rgba(79, 184, 168, 0.55); top: 0; }
.range-marker {
  position: absolute;
  top: -3px;
  width: 2px;
  height: 14px;
  background: var(--coral);
  transform: translateX(-1px);
}
.range-marker-suggested {
  position: absolute;
  top: 8px;
  width: 2px;
  height: 8px;
  background: var(--amber);
  transform: translateX(-1px);
}
.range-tick {
  position: absolute;
  top: 0;
  width: 1px;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
}
.range-median {
  position: absolute;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-mid);
  border: 1px solid var(--ink-800);
  transform: translate(-3px, -50%);
}
.range-median.sold { background: var(--teal); }
.range-endpoints {
  display: flex;
  justify-content: space-between;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10.5px;
  color: var(--text-lo);
  margin-top: 4px;
}
.range-legend {
  display: flex;
  gap: 14px;
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-mid);
}
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; }
.active-dot { background: rgba(154, 167, 184, 0.7); }
.sold-dot { background: var(--teal); }

.range-thin-note { font-size: 11.5px; color: var(--text-lo); margin: 0; font-style: italic; }

.reasoning {
  font-size: 12.5px;
  color: var(--text-mid);
  line-height: 1.55;
  margin: 10px 0 12px;
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--ink-700);
}

.suggestion-status {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-lo);
  margin-right: auto;
}
.status-accepted { color: var(--amber); }
.status-dismissed { color: var(--text-lo); text-decoration: line-through; }
.status-applied { color: var(--teal); }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text-mid);
  padding: 6px 13px;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-accept:hover { border-color: var(--teal-dim); color: var(--teal); }
.btn-dismiss:hover { border-color: var(--coral-dim); color: var(--coral); }

.in-range-section { margin-top: 20px; }
.in-range-section summary {
  cursor: pointer;
  font-size: 12.5px;
  color: var(--text-mid);
  padding: 10px 4px;
  border-top: 1px solid var(--line);
  list-style: none;
}
.in-range-section summary::-webkit-details-marker { display: none; }
.in-range-section summary::before { content: '▸ '; color: var(--text-lo); }
.in-range-section[open] summary::before { content: '▾ '; }
.in-range-section summary:hover { color: var(--text-hi); }
.in-range-section .rows { margin-top: 12px; }

.threshold-control {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-mid);
}
.threshold-control input {
  width: 52px;
  background: var(--ink-700);
  border: 1px solid var(--line);
  color: var(--text-hi);
  border-radius: 4px;
  padding: 5px 6px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12.5px;
}
.threshold-control input:disabled { opacity: 0.5; }

.dup-groups { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.dup-group {
  background: var(--ink-700);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
}
.dup-title { font-size: 13px; font-weight: 500; margin-bottom: 6px; }
.dup-items { display: flex; flex-wrap: wrap; gap: 10px; }
.dup-item {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11.5px;
  color: var(--text-mid);
}

.btn-queue { font-family: 'IBM Plex Mono', monospace; }
.btn-queue:hover { border-color: var(--amber-dim); color: var(--amber); }
.btn-queue.has-items {
  border-color: var(--amber-dim);
  color: var(--amber);
  background: rgba(224, 169, 85, 0.1);
  font-weight: 600;
}
.btn-queue.has-items:hover { background: rgba(224, 169, 85, 0.18); }

.user-email { font-size: 12px; color: var(--text-mid); font-family: 'IBM Plex Mono', monospace; }
.logout-form { display: inline-flex; margin: 0; }

.modal-confirm { max-width: 440px; }
.confirm-message { margin: 0 0 18px; color: var(--text-hi); }
.confirm-footer { justify-content: flex-end; border-top: none; padding-top: 0; }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 10, 14, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal-overlay.hidden { display: none; }

.modal {
  background: var(--ink-800);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  width: 100%;
  max-width: 560px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  padding: 22px 24px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.modal-header h2 { font-size: 16px; margin: 0; }

.modal-sub {
  color: var(--text-mid);
  font-size: 12.5px;
  line-height: 1.5;
  margin: 0 0 16px;
}

.queue-list {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.queue-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: var(--ink-700);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 13px;
}
.queue-item--error { border-color: var(--coral-dim); background: rgba(217, 117, 95, 0.06); }
.queue-item-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.queue-item-head { display: flex; align-items: baseline; gap: 12px; }
.queue-item-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue-item-prices { font-family: 'IBM Plex Mono', monospace; color: var(--amber); white-space: nowrap; }
.queue-item-error { font-size: 11.5px; color: var(--coral); line-height: 1.4; }
.queue-item-actions { display: flex; gap: 6px; flex-shrink: 0; }
.queue-item-actions .btn-ghost { padding: 5px 10px; font-size: 11.5px; }

.queue-empty { color: var(--text-lo); font-size: 13px; }

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--ink-700);
}

.btn-danger { background: var(--coral); }

.queue-results {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 160px;
  overflow-y: auto;
}
.queue-summary { font-size: 12.5px; color: var(--text-mid); margin: 0 0 4px; }
.queue-result { font-family: 'IBM Plex Mono', monospace; font-size: 12px; }
.queue-result.ok { color: var(--teal); }
.queue-result.error { color: var(--coral); }

.auth-page {
  max-width: none;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--ink-800);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 26px;
  text-align: center;
}
.auth-card .brand { justify-content: center; margin-bottom: 18px; }
.auth-title { font-size: 17px; font-weight: 600; margin: 0 0 8px; }
.auth-sub { color: var(--text-mid); font-size: 13px; line-height: 1.55; margin: 0 0 20px; }
.auth-form { display: flex; flex-direction: column; gap: 10px; }
.auth-form input[type="email"] {
  background: var(--ink-700);
  border: 1px solid var(--line);
  color: var(--text-hi);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 13.5px;
  font-family: inherit;
}
.auth-form .btn-primary { width: 100%; padding: 10px 16px; }
.auth-link-back, .auth-link-back-btn { display: inline-block; margin-top: 4px; }
.auth-link-back { color: var(--text-mid); font-size: 13px; }
.auth-link-back:hover { color: var(--text-hi); }
.auth-invite-sent { color: var(--teal); font-size: 13px; margin: 16px 0 0; }

@media (max-width: 600px) {
  .topbar { padding: 14px 16px; }
  main { padding: 16px 14px 60px; }
  .row-prices { gap: 10px; }
}
