:root {
  --bg: #111418;
  --card: rgba(27, 31, 37, 0.96);
  --line: rgba(255, 255, 255, 0.08);
  --text: #f3f4f6;
  --muted: #b8bec8;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: #111418; color: var(--text); }
.bg { position: fixed; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(255,255,255,0.015), transparent 24%); }
.container { position: relative; max-width: 1180px; margin: 0 auto; padding: 40px 20px 80px; }
.hero { display: flex; justify-content: space-between; gap: 20px; align-items: flex-end; margin-bottom: 24px; }
.hero-main { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.hero-title-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.hero-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.view-tabs { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-start; }
.hero-link { color: #93c5fd; text-decoration: none; font-size: 14px; }
.hero-link:hover { text-decoration: underline; }
.view-panel { display: none; }
.view-panel.is-active { display: block; }
.eyebrow { margin: 0 0 8px; color: #9ca3af; font-size: 14px; }
h1, h2, h3, h4, p { margin-top: 0; }
h1 { font-size: clamp(32px, 6vw, 52px); margin-bottom: 12px; color: #fff; font-weight: 800; }
h2, h3, h4 { color: var(--text); }
.section-title p, .muted, .deals-updated { color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; margin-bottom: 34px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 24px; padding: 24px; box-shadow: 0 16px 50px rgba(0,0,0,0.25); backdrop-filter: blur(10px); }
.stats-card { margin-top: 18px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.shared-form-grid { margin-top: 18px; }
label span { display: block; margin-bottom: 8px; color: var(--muted); font-size: 14px; }
input, select, button { width: 100%; border: 1px solid rgba(255,255,255,0.09); border-radius: 14px; background: rgba(19,23,28,0.98); color: var(--text); padding: 14px 16px; font-size: 15px; }
input::-webkit-outer-spin-button, input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }
input::placeholder { color: #8b94a3; }
button { cursor: pointer; font-weight: 700; }
button.secondary { max-width: 140px; }
.actions { margin-top: 16px; display: flex; justify-content: flex-end; }
.item-rows { display: grid; gap: 14px; }
.item-row { position: relative; border: 1px solid var(--line); border-radius: 16px; background: rgba(19,23,28,0.76); padding: 14px; }
.item-row-top { display: flex; align-items: center; justify-content: flex-start; margin-bottom: 10px; }
.item-row-top strong { font-size: 15px; line-height: 1.2; }
.item-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.item-form-grid > label:first-child, .item-form-grid > label.item-custom-name:not(.is-disabled) { grid-column: 1 / -1; }
.item-custom-name.is-disabled { display: none; }
.item-custom-name.is-disabled input { pointer-events: none; }
.form-row-actions { margin-top: 14px; }
.primary-action-button { width: auto; padding: 11px 16px; border-radius: 6px; background: #2563eb; border: 1px solid #60a5fa; color: #f8fbff; }
.primary-action-button:hover { background: #1d4ed8; }
.remove-item-button, .danger-action-button { position: absolute; top: 14px; right: 14px; width: auto; padding: 0 12px; height: 32px; border-radius: 6px; background: #7f1d1d; border: 1px solid #ef4444; color: #fee2e2; font-size: 12px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; }
.remove-item-button:hover, .danger-action-button:hover { background: #991b1b; }
.headline-result { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 18px; margin: 18px 0 20px; border-radius: 20px; background: rgba(19,23,28,0.98); border: 1px solid var(--line); }
.headline-result h3 { font-size: 32px; margin-bottom: 0; }
.result-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.metric { border: 1px solid var(--line); background: rgba(19,23,28,0.98); border-radius: 18px; padding: 14px; }
.metric span { display: block; color: var(--muted); font-size: 14px; margin-bottom: 10px; }
.metric strong { font-size: 20px; }
.summary-strip { display: grid; gap: 12px; margin-top: 14px; }
.summary-strip.two-cols { grid-template-columns: 1fr 1fr; }
.summary-strip.one-col { grid-template-columns: 1fr; margin-top: 12px; }
.summary-pill { border: 1px solid var(--line); background: rgba(19,23,28,0.98); border-radius: 18px; padding: 16px; }
.summary-pill span { display: block; color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.summary-pill strong { display: block; font-size: 24px; }
.summary-pill-wide strong { font-size: 16px; line-height: 1.5; word-break: keep-all; }
.period-comparison { margin-top: 24px; }
.period-badges { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.period-chip, .period-chip.badge { display: flex; flex-direction: column; gap: 3px; min-width: 0; padding: 10px; border-radius: 0 !important; border: 1px solid rgba(255,255,255,0.16); background: rgba(19,23,28,0.98); }
.period-chip small { color: var(--muted); font-size: 12px; }
.period-chip strong { font-size: 14px; line-height: 1.2; }
.period-chip span { font-size: 12px; color: var(--muted); line-height: 1.2; }
.section-title-spacious { margin-bottom: 18px; }
.section-title-spacious h2 { margin-bottom: 10px; }
.board-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 0 18px; }
.brand-tabs { display: flex; flex-wrap: nowrap; gap: 10px; margin: 0; overflow-x: auto; overflow-y: hidden; white-space: nowrap; padding-bottom: 4px; scrollbar-width: thin; }
.brand-tabs::-webkit-scrollbar { height: 6px; }
.brand-tabs::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 999px; }
.tab { display: inline-flex; align-items: center; justify-content: center; width: auto; min-width: max-content; flex: 0 0 auto; border-radius: 999px; padding: 10px 16px; border: 1px solid var(--line); background: rgba(19,23,28,0.98); font-size: 14px; font-weight: 700; color: var(--text); }
.tab.active { background: rgba(96,165,250,0.18); border-color: rgba(96,165,250,0.34); }
.toggle-option { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; white-space: nowrap; }
.toggle-option input { width: 16px; height: 16px; margin: 0; padding: 0; accent-color: #60a5fa; }
.toggle-option span { margin: 0; color: var(--muted); font-size: 14px; }
.deal-board { border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: rgba(19,23,28,0.98); }
.deal-board-head, .deal-row { display: grid; grid-template-columns: minmax(90px,0.55fr) minmax(240px,1.7fr) minmax(110px,0.7fr) minmax(320px,1.5fr); gap: 14px; align-items: center; }
.deal-board-head { padding: 14px 18px; background: rgba(255,255,255,0.03); color: var(--muted); font-size: 13px; font-weight: 700; }
.deals-list { display: block; }
.deal-row { padding: 16px 18px; border-top: 1px solid var(--line); }
.deal-row:hover { background: rgba(255,255,255,0.02); }
.deal-link { color: inherit; text-decoration: none; }
.deal-main { min-width: 0; }
.deal-title { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.deal-sub { font-size: 13px; color: var(--muted); margin-top: 4px; }
.deal-brand { font-size: 14px; font-weight: 700; color: var(--text); }
.deal-price { font-size: 15px; font-weight: 700; }
.deal-grades-wrap { display: flex; flex-direction: column; gap: 8px; min-width: 0; width: 100%; }
.deal-grades { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-start; overflow: visible; }
.deal-note-row, .deal-brand-badge-row { display: flex; justify-content: flex-start; width: 100%; }
.deal-brand-badge-row .badge { max-width: 100%; }
.badge { display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; padding: 8px 10px; border: 1px solid var(--line); background: rgba(19,23,28,0.98); font-size: 12px; font-weight: 700; color: var(--text); white-space: nowrap; flex: 0 0 auto; }
.badge-primary { font-size: 13px; padding: 9px 12px; }
.badge-subtle { opacity: 0.92; }
.badge.rare { background: rgba(34,197,94,0.2); color: #bbf7d0; }
.badge.good { background: rgba(56,189,248,0.2); color: #bae6fd; }
.badge.mid { background: rgba(245,158,11,0.2); color: #fde68a; }
.badge.bad { background: rgba(239,68,68,0.18); color: #fecaca; }
.badge.neutral { background: rgba(148,163,184,0.18); color: #e2e8f0; }
.deal-note-popover-wrap { position: relative; display: inline-flex; align-items: flex-start; }
.deal-note { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; border-radius: 999px; padding: 6px 10px; border: 1px solid var(--line); background: rgba(255,255,255,0.03); }
.deal-note.good { color: #bae6fd; border-color: rgba(56,189,248,0.28); }
.deal-note.bad { color: #fecaca; border-color: rgba(239,68,68,0.24); }
.deal-note.neutral { color: #e2e8f0; }
.deal-note-button { cursor: pointer; width: auto; max-width: 100%; }
.deal-note-icon { opacity: 0.9; }
.deal-note-popover { position: absolute; top: calc(100% + 8px); left: 0; z-index: 30; width: min(320px, calc(100vw - 48px)); padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: rgba(17,20,24,0.98); box-shadow: 0 18px 40px rgba(0,0,0,0.35); }
.deal-note-popover::before { content: ''; position: absolute; top: -7px; left: 18px; width: 12px; height: 12px; background: rgba(17,20,24,0.98); border-left: 1px solid var(--line); border-top: 1px solid var(--line); transform: rotate(45deg); }
.deal-note-close { position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; padding: 0; border-radius: 999px; border: 1px solid rgba(255,255,255,0.08); background: rgba(255,255,255,0.04); color: var(--muted); font-size: 14px; line-height: 1; }
.deal-note-panel-title { font-size: 13px; font-weight: 700; color: var(--text); margin: 0 24px 6px 0; word-break: break-word; }
.deal-note-panel-sub { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.deal-note-link, .deal-note-link-inline { font-size: 12px; color: #93c5fd; text-decoration: none; }
.deal-note-link:hover, .deal-note-link-inline:hover { text-decoration: underline; }
.deal-note-link-inline { margin-left: 8px; align-self: center; }
.deal-reference-box { display: flex; flex-direction: column; gap: 6px; width: 100%; padding: 10px 12px; border-radius: 14px; border: 1px solid rgba(96,165,250,0.2); background: rgba(37,99,235,0.08); }
.deal-reference-box.is-muted { border-color: rgba(255,255,255,0.08); background: rgba(255,255,255,0.03); }
.quickbuy-card { margin-top: 6px; }
.hero-topline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.visit-counter { color: #93c5fd; font-size: 12px; font-weight: 600; }
.quickbuy-intro { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.quickbuy-list { display: grid; gap: 12px; }
.quickbuy-row { display: grid; grid-template-columns: minmax(0,1.8fr) minmax(220px,0.9fr); gap: 16px; border: 1px solid var(--line); border-radius: 16px; padding: 16px; background: rgba(19,23,28,0.82); }
.quickbuy-row-table { grid-template-columns: minmax(180px,0.72fr) minmax(0,1.9fr); align-items: start; }
.quickbuy-main-collapsible { display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
.quickbuy-main-texts { min-width: 0; }
.quickbuy-collapse-button { border: 1px solid var(--line); background: rgba(255,255,255,0.04); color: var(--text); border-radius: 12px; padding: 8px 12px; white-space: nowrap; align-self: flex-start; }
.quickbuy-brand { font-size: 13px; color: #93c5fd; font-weight: 700; margin-bottom: 6px; }
.quickbuy-title { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.quickbuy-sub { font-size: 12px; color: var(--muted); line-height: 1.5; }
.quickbuy-table { display: grid; gap: 8px; }
.quickbuy-rank-row { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.06); }
.quickbuy-rank-row:last-child { border-bottom: 0; }
.quickbuy-rank-topline, .quickbuy-rank-priceline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.quickbuy-rank-label { font-size: 12px; font-weight: 800; color: #dbeafe; }
.quickbuy-rank-mall { font-size: 13px; color: var(--text); font-weight: 600; }
.quickbuy-rank-price { font-size: 14px; color: #f8fafc; font-weight: 800; }
.quickbuy-rank-unit { font-size: 12px; color: var(--muted); }
.quickbuy-rank-link { grid-column: 2; grid-row: 1 / span 2; text-align: right; align-self: center; }
.quickbuy-variants-grid { display: grid; gap: 10px; }
.quickbuy-row.is-collapsed .quickbuy-variants-grid { display: none; }
.quickbuy-variant-block { border: 1px solid rgba(255,255,255,0.07); border-radius: 14px; padding: 12px; background: rgba(255,255,255,0.02); }
.quickbuy-variant-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.quickbuy-variant-weight { font-size: 14px; color: var(--text); }
.quickbuy-variant-meta { font-size: 11px; color: var(--muted); }
.quickbuy-variant-query { font-size: 11px; color: var(--muted); margin-bottom: 10px; }
.deal-reference-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.deal-reference-title { font-size: 12px; color: #bfdbfe; }
.deal-reference-price { font-size: 13px; font-weight: 700; color: var(--text); }
.deal-reference-meta { font-size: 11px; line-height: 1.45; color: var(--muted); }
.empty-state { padding: 22px 18px; color: var(--muted); }
@media (max-width: 1024px) {
  .deal-board-head { display: none; }
  .deal-row { grid-template-columns: 1fr; gap: 10px; }
  .deal-price { font-size: 14px; }
  .item-form-grid { grid-template-columns: 1fr 1fr; }
  .headline-result { flex-direction: column; align-items: flex-start; }
  .result-grid { grid-template-columns: 1fr 1fr; }
  .result-grid-mobile-priority .metric-full-row { grid-column: 1 / -1; }
  .summary-strip.two-cols { grid-template-columns: 1fr 1fr; }
  .summary-strip.one-col { grid-template-columns: 1fr; }
}
.item-product-picker-button { width: 100%; text-align: left; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: rgba(19,23,28,0.98); color: var(--text); font: inherit; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.picker-modal { position: fixed; inset: 0; z-index: 1000; }
.picker-modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.55); }
.picker-sheet { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); width: min(720px, 100%); max-height: 70vh; overflow: auto; background: #0f1720; border: 1px solid rgba(255,255,255,0.08); border-radius: 22px 22px 0 0; padding: 16px; }
.picker-sheet-head { display: flex; align-items: center; justify-content: flex-start; gap: 12px; margin-bottom: 12px; }
.picker-options { display: grid; gap: 8px; }
.picker-option { width: 100%; text-align: left; padding: 12px 14px; border-radius: 14px; border: 1px solid rgba(255,255,255,0.08); background: rgba(255,255,255,0.03); color: var(--text); font: inherit; }
.picker-option.is-active { border-color: rgba(96,165,250,0.45); background: rgba(96,165,250,0.12); color: #dbeafe; }
@media (max-width: 640px) {
  .container { padding: 24px 14px 60px; }
  .card { padding: 18px; border-radius: 20px; }
  .hero { align-items: stretch; }
  .hero-topline { flex-direction: column; align-items: flex-start; gap: 4px; }
  .hero-title-row { align-items: stretch; }
  .hero-actions { align-items: stretch; gap: 8px; }
  .hero-link { display: block; width: 100%; text-align: center; }
  .view-tabs { justify-content: stretch; }
  .quickbuy-row, .quickbuy-row-table { grid-template-columns: 1fr; gap: 12px; }
  .quickbuy-row { padding: 14px; }
  .quickbuy-variants-grid { gap: 8px; }
  .quickbuy-variant-block { padding: 10px; }
  .quickbuy-table { gap: 6px; }
  .quickbuy-table-head { display: none; }
  .quickbuy-rank-row {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 10px;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    background: rgba(255,255,255,0.02);
  }
  .quickbuy-rank-topline, .quickbuy-rank-priceline { gap: 6px; }
  .quickbuy-rank-label { font-size: 11px; }
  .quickbuy-rank-mall, .quickbuy-rank-price, .quickbuy-rank-unit, .quickbuy-rank-link { text-align: left; }
  .quickbuy-rank-price { font-size: 15px; }
  .quickbuy-rank-link { grid-column: auto; grid-row: auto; }
  .picker-sheet { width: 100%; max-height: 70vh; }
  .headline-result h3 { font-size: 26px; }
  .result-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .result-grid-mobile-priority .metric-full-row { grid-column: 1 / -1; }
  .metric { padding: 12px; min-height: 84px; display: flex; flex-direction: column; justify-content: center; }
  .metric span { font-size: 12px; margin-bottom: 6px; }
  .metric strong { font-size: 18px; line-height: 1.25; }
  .summary-strip.two-cols { grid-template-columns: 1fr 1fr; gap: 10px; }
  .summary-strip.one-col { grid-template-columns: 1fr; }
  .summary-pill { min-height: 84px; display: flex; flex-direction: column; justify-content: center; }
  .summary-pill span { font-size: 12px; }
  .summary-pill strong { font-size: 18px; line-height: 1.25; }
  .summary-pill-wide { min-height: auto; }
  .stats-card { margin-top: 24px; }
  .board-toolbar { flex-direction: column; align-items: stretch; }
  .toggle-option { justify-content: flex-end; }
  .period-badges { gap: 6px; }
  .period-chip, .period-chip.badge { padding: 9px 8px; border-radius: 0 !important; }
  .period-chip small, .period-chip span { font-size: 11px; }
  .period-chip strong { font-size: 13px; }
  .item-form-grid { grid-template-columns: 1fr 1fr; }
  .summary-strip.one-col { grid-template-columns: 1fr; }
  .deal-grades { gap: 4px; }
  .deal-grades .badge { padding: 5px 6px; font-size: 10px; }
  .deal-note { font-size: 11px; }
  .deal-note-popover { width: min(280px, calc(100vw - 36px)); padding: 10px 12px; }
}
