:root {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-soft: #f7f8fa;
  --surface-muted: #f1f3f5;
  --text: #111318;
  --muted: #68707d;
  --line: #e5e8ec;
  --line-strong: #d6dbe1;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --accent-soft: #eef4ff;
  --positive: #138a57;
  --positive-soft: #ecf9f2;
  --negative: #c24141;
  --negative-soft: #fff1f1;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 12px 36px rgba(17, 24, 39, 0.07);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .6; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
[hidden] { display: none !important; }

.shell { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255,255,255,.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}
.header-inner { min-height: 72px; display: flex; align-items: center; gap: 28px; }
.brand { display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: #111318;
  color: #fff;
  font-weight: 900;
  font-size: .78rem;
  letter-spacing: -.02em;
}
.brand strong, .brand small { display: block; }
.brand strong { font-size: .98rem; }
.brand small { margin-top: 1px; color: var(--muted); font-size: .72rem; }
.header-nav { display: flex; align-items: center; gap: 20px; margin-right: auto; }
.header-nav a { color: var(--muted); font-size: .88rem; font-weight: 650; }
.header-nav a:hover { color: var(--text); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.connection-status { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: .8rem; }
.connection-status i { width: 7px; height: 7px; border-radius: 50%; background: #c6cbd2; }
.connection-status i.live { background: #18a66a; box-shadow: 0 0 0 4px rgba(24,166,106,.09); }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 17px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-weight: 750;
  transition: .18s ease;
}
.button:hover { transform: translateY(-1px); }
.button.primary { background: var(--text); color: #fff; }
.button.primary:hover { background: #252931; }
.button.secondary { background: #fff; color: var(--text); border-color: var(--line-strong); }
.button.secondary:hover { background: var(--surface-soft); }
.button.compact { min-height: 38px; padding: 0 13px; border-radius: 10px; font-size: .86rem; }
.button.full { width: 100%; }
.text-button { border: 0; background: transparent; padding: 4px 0; color: var(--accent); font-weight: 700; }
.danger-text { color: var(--negative); }

.hero { padding: 84px 0 56px; }
.hero-copy { max-width: 900px; }
.hero-centered { margin: 0 auto; text-align: center; }
.eyebrow {
  color: var(--accent);
  font-size: .76rem;
  text-transform: uppercase;
  letter-spacing: .13em;
  font-weight: 850;
}
.hero h1 {
  max-width: 860px;
  margin: 14px auto 18px;
  font-size: clamp(2.5rem, 6vw, 5.5rem);
  line-height: .98;
  letter-spacing: -.055em;
}
.hero p { max-width: 760px; margin: 0 auto; color: var(--muted); line-height: 1.7; font-size: 1.08rem; }

.smart-form { max-width: 980px; margin: 38px auto 0; text-align: left; }
.smart-input-row {
  display: grid;
  grid-template-columns: minmax(0,1fr) 170px auto;
  gap: 9px;
  padding: 9px;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow);
}
.smart-input-wrap { position: relative; }
.smart-icon { position: absolute; left: 17px; top: 50%; transform: translateY(-50%); color: #9097a2; font-size: 1.25rem; }
.smart-input-wrap input {
  height: 54px;
  padding: 0 16px 0 48px;
  border: 0;
  outline: 0;
  font-size: 1.02rem;
  background: transparent;
}
.scope-select { height: 54px; border: 0; border-left: 1px solid var(--line); padding: 0 12px; color: #343943; background: #fff; outline: 0; }
.smart-submit { min-height: 54px; border-radius: 12px; padding-inline: 22px; }
.smart-form-foot { display: flex; justify-content: space-between; gap: 16px; padding: 11px 8px 0; color: var(--muted); font-size: .82rem; }
.smart-message { min-height: 20px; margin: 8px 8px 0; }

.advanced-panel {
  margin-top: 14px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}
.advanced-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.advanced-grid.two-wide { grid-template-columns: repeat(2, minmax(0,1fr)); margin-top: 14px; }
.days-fieldset { border: 0; margin: 18px 0 0; padding: 0; }
.days-fieldset legend { margin-bottom: 9px; font-size: .86rem; font-weight: 750; }
.day-grid { display: grid; grid-template-columns: repeat(7, minmax(48px,1fr)); gap: 7px; }
.day-grid label { position: relative; display: block; cursor: pointer; }
.day-grid input { position: absolute; opacity: 0; pointer-events: none; }
.day-grid span {
  display: grid;
  place-items: center;
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--muted);
  background: #fff;
  font-size: .8rem;
  font-weight: 750;
}
.day-grid input:checked + span { border-color: #a8c2fa; background: var(--accent-soft); color: var(--accent-dark); }
.trust-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 18px; margin-top: 22px; color: var(--muted); font-size: .83rem; }

label { display: grid; gap: 7px; }
label > span, legend { font-size: .86rem; font-weight: 750; }
label small { color: var(--muted); font-size: .76rem; font-weight: 500; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: #fff;
  color: var(--text);
  outline: none;
  padding: 11px 12px;
  transition: border-color .18s ease, box-shadow .18s ease;
}
input:focus, select:focus, textarea:focus { border-color: #8bb1fb; box-shadow: 0 0 0 4px rgba(37,99,235,.07); }
textarea { resize: vertical; }
.input-affix { position: relative; }
.input-affix input { padding-right: 50px; }
.input-affix > span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: .76rem; }

.auth-section {
  display: grid;
  grid-template-columns: 1fr minmax(320px, 430px);
  gap: 54px;
  align-items: center;
  margin-top: 20px;
  margin-bottom: 70px;
  padding: 42px;
  border-radius: 24px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
}
.auth-intro h2, .section-header h2 { margin: 8px 0 10px; letter-spacing: -.035em; font-size: clamp(1.8rem, 3vw, 2.7rem); }
.auth-intro p, .section-header p { color: var(--muted); line-height: 1.65; }
.feature-lines { display: grid; gap: 8px; margin-top: 20px; color: #424852; font-size: .9rem; }
.auth-card { padding: 26px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: 0 8px 28px rgba(17,24,39,.05); }
.auth-card-head h2 { margin: 7px 0 4px; }
.auth-card-head p { margin: 0 0 18px; color: var(--muted); }
.google-button { width: 100%; min-height: 46px; border: 1px solid var(--line-strong); border-radius: 11px; background: #fff; font-weight: 750; }
.google-g { display: inline-grid; place-items: center; margin-right: 8px; width: 22px; height: 22px; border-radius: 50%; color: #4285f4; font-weight: 900; }
.divider { display: flex; align-items: center; gap: 10px; margin: 17px 0; color: #9aa1aa; font-size: .75rem; }
.divider::before, .divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 10px; background: var(--surface-muted); margin-bottom: 15px; }
.auth-tab { min-height: 35px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-weight: 750; }
.auth-tab.active { background: #fff; color: var(--text); box-shadow: 0 2px 8px rgba(17,24,39,.06); }
.auth-form { display: grid; gap: 12px; }
.form-message { margin: 0; color: var(--muted); font-size: .82rem; line-height: 1.5; }

.dashboard { padding-bottom: 72px; }
.account-strip { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 18px 0 26px; border-bottom: 1px solid var(--line); }
.account-main { display: flex; align-items: center; gap: 12px; }
.avatar { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; overflow: hidden; background: #eef1f4; font-weight: 800; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.account-main small, .account-main strong, .account-main span { display: block; }
.account-main small, .account-main span { color: var(--muted); font-size: .78rem; }
.account-badges { display: flex; gap: 7px; }
.account-badges span { padding: 6px 9px; border-radius: 999px; background: var(--surface-soft); color: var(--muted); font-size: .75rem; }
.metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; margin: 26px 0 56px; }
.metric-card { padding: 21px; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
.metric-card small, .metric-card span { display: block; color: var(--muted); }
.metric-card strong { display: block; margin: 6px 0 2px; font-size: 1.9rem; letter-spacing: -.04em; }
.metric-card span { font-size: .78rem; }
.content-section { padding-top: 26px; margin-top: 26px; }
.content-section + .content-section { margin-top: 54px; border-top: 1px solid var(--line); }
.section-header { display: flex; justify-content: space-between; gap: 24px; align-items: end; margin-bottom: 20px; }
.section-header h2 { font-size: 2rem; }
.section-header p { margin: 0; max-width: 720px; }
.card-list { display: grid; gap: 12px; }
.data-card {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: 18px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}
.product-card { grid-template-columns: 92px minmax(0,1fr) auto; }
.product-thumb { width: 92px; height: 92px; border-radius: 13px; overflow: hidden; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; }
.product-thumb img { width: 100%; height: 100%; object-fit: contain; }
.product-thumb-empty { background: var(--surface-soft); color: #a0a7b1; font-weight: 900; }
.data-card h3 { margin: 8px 0 6px; font-size: 1.1rem; }
.card-kicker { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; color: var(--muted); font-size: .74rem; }
.status-pill { padding: 5px 8px; border-radius: 999px; background: var(--surface-muted); color: #626a74; font-weight: 700; }
.status-pill.positive { background: var(--positive-soft); color: var(--positive); }
.status-pill.negative { background: var(--negative-soft); color: var(--negative); }
.source-link { display: block; max-width: 760px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--accent); font-size: .8rem; }
.card-description { color: var(--muted); line-height: 1.55; }
.price-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; margin-top: 17px; }
.price-grid > div { padding: 12px; border-radius: 11px; background: var(--surface-soft); }
.price-grid small, .price-grid span { display: block; color: var(--muted); font-size: .72rem; }
.price-grid strong { display: block; margin: 4px 0 2px; font-size: 1.05rem; }
.small-strong { font-size: .88rem !important; }
.positive-value { color: var(--positive) !important; }
.negative-value { color: var(--negative) !important; }
.neutral-value { color: var(--muted) !important; }
.card-actions { display: flex; flex-direction: column; align-items: stretch; justify-content: center; gap: 7px; min-width: 105px; }
.empty-state { display: grid; gap: 4px; place-items: center; text-align: center; padding: 42px 20px; border: 1px dashed var(--line-strong); border-radius: 15px; color: var(--muted); }
.empty-state strong { color: var(--text); }

.site-footer { border-top: 1px solid var(--line); padding: 24px 0 34px; color: var(--muted); font-size: .78rem; }
.site-footer .shell { display: flex; justify-content: space-between; gap: 20px; }

/* Product detail page */
.product-detail-main { padding-top: 34px; padding-bottom: 70px; }
.detail-back { display: inline-block; margin-bottom: 18px; color: var(--muted); font-size: .86rem; }
.detail-panel { padding: 24px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.detail-panel h1, .detail-panel h2 { letter-spacing: -.035em; }
.detail-panel h1 { margin: 8px 0 10px; font-size: clamp(2rem,5vw,3.8rem); }
.detail-panel h2 { margin: 8px 0 16px; }
.detail-hero { display: grid; grid-template-columns: minmax(0,1fr) 310px; gap: 14px; }
.detail-price { display: flex; flex-direction: column; justify-content: center; }
.detail-price > strong { margin: 8px 0 18px; font-size: 2.5rem; letter-spacing: -.05em; }
.hero-trend-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.hero-trend-grid > div { padding: 10px; border-radius: 10px; background: var(--surface-soft); }
.hero-trend-grid small, .hero-trend-grid b { display: block; }
.hero-trend-grid small { color: var(--muted); }
.detail-meta { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 16px; }
.detail-meta span { padding: 6px 8px; background: var(--surface-soft); border-radius: 999px; color: var(--muted); font-size: .75rem; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.history-chart { display: flex; align-items: end; gap: 4px; min-height: 160px; padding-top: 15px; overflow-x: auto; }
.history-chart > div { min-width: 9px; border-radius: 4px 4px 0 0; background: #7da2f7; }
.offer-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.offer-table th, .offer-table td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.offer-table th { color: var(--muted); font-size: .75rem; }

@media (max-width: 900px) {
  .header-nav, .connection-status { display: none; }
  .smart-input-row { grid-template-columns: 1fr auto; }
  .scope-select { grid-row: 2; grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--line); }
  .advanced-grid, .advanced-grid.two-wide { grid-template-columns: 1fr 1fr; }
  .auth-section { grid-template-columns: 1fr; gap: 28px; }
  .metric-grid { grid-template-columns: 1fr 1fr 1fr; }
  .product-card { grid-template-columns: 72px minmax(0,1fr); }
  .product-thumb { width: 72px; height: 72px; }
  .product-card .card-actions { grid-column: 1 / -1; flex-direction: row; justify-content: flex-start; }
  .data-card:not(.product-card) { grid-template-columns: 1fr; }
  .data-card:not(.product-card) .card-actions { flex-direction: row; justify-content: flex-start; }
  .price-grid { grid-template-columns: 1fr 1fr; }
  .detail-hero, .detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .shell { width: min(100% - 20px, 1120px); }
  .site-header { position: static; }
  .header-inner { min-height: 64px; }
  .brand small { display: none; }
  .hero { padding: 58px 0 36px; }
  .hero h1 { font-size: clamp(2.4rem, 13vw, 4rem); }
  .hero p { font-size: .98rem; }
  .smart-input-row { display: grid; grid-template-columns: 1fr; padding: 7px; }
  .smart-submit, .scope-select { width: 100%; grid-column: auto; grid-row: auto; }
  .scope-select { border-top: 1px solid var(--line); border-left: 0; }
  .smart-form-foot { align-items: flex-start; flex-direction: column; }
  .advanced-grid, .advanced-grid.two-wide { grid-template-columns: 1fr; }
  .day-grid { grid-template-columns: repeat(4,1fr); }
  .trust-row { justify-content: flex-start; }
  .auth-section { padding: 22px; margin-bottom: 48px; }
  .auth-card { padding: 18px; }
  .account-strip, .section-header, .site-footer .shell { align-items: flex-start; flex-direction: column; }
  .account-badges { display: none; }
  .metric-grid { grid-template-columns: 1fr; }
  .product-card { grid-template-columns: 60px minmax(0,1fr); padding: 14px; }
  .product-thumb { width: 60px; height: 60px; }
  .price-grid { grid-template-columns: 1fr 1fr; }
  .card-actions { min-width: 0; flex-wrap: wrap; }
}