/* RABBAT V2. Existing structural classes and IDs remain compatible. */
:root {
  --bg:#f5f7f3; --surface:#fff; --surface-2:#eef3eb; --surface-3:#eef3eb;
  --text:#172d25; --muted:#58675f; --border:#dbe3d9;
  --accent:#286044; --accent-strong:#1f4c36; --accent-ink:#fff;
  --danger:#a3342f; --shadow:0 4px 22px #203b2610; --radius:18px; --nav-height:80px;
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}
body { background:var(--bg); }
.review-banner { padding:9px 16px; font-size:11px; line-height:1.5; background:#eee7ce; color:#514628; text-align:center; border-bottom:1px solid #ded5b3; }
button,input,select { font-size:16px; }
button { cursor:pointer; min-height:44px; }
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible { outline:3px solid #4b8665; outline-offset:3px; }
input,select { min-height:46px; border-radius:10px; border:1px solid #cbd7cb; background:#fff; max-width:100%; color:var(--text); }
input[type=checkbox] { min-height:22px; width:22px; height:22px; accent-color:var(--accent); flex-shrink:0; }
.eyebrow { color:var(--accent); letter-spacing:.1em; font-size:11px; }
.app-view { max-width:1180px; padding:0 0 calc(100px + env(safe-area-inset-bottom)); margin:auto; }
.app-header { position:relative; top:auto; background:transparent; backdrop-filter:none; border:0; box-shadow:none; padding:calc(25px + env(safe-area-inset-top)) 16px 22px; align-items:center; gap:12px; }
.app-header h1 { font-size:26px; letter-spacing:-1px; line-height:1.15; }
.brand-wordmark { text-transform:none; font-size:20px; font-weight:850; letter-spacing:-1px; margin-bottom:15px; }
.brand-wordmark span { color:var(--muted); font-size:10px; font-weight:500; letter-spacing:0; }
.header-actions { gap:7px; }
.icon-button { width:44px; height:44px; min-width:44px; border-radius:50%; border:1px solid var(--border); background:#fff; color:var(--text); box-shadow:none; }
.page-content { padding:0 16px 24px; }
.page-content:focus { outline:none; }
.page-section { animation:none; }
.section-heading { margin:26px 0 18px; align-items:flex-start; gap:12px; }
.section-heading h2 { font-size:23px; letter-spacing:-.7px; margin-bottom:8px; }
.section-heading .muted { margin-bottom:0; font-size:14px; }
.section-heading .freshness { font-size:11px; max-width:100px; text-align:right; line-height:1.5; white-space:normal; }
.personal-hero { position:relative; overflow:hidden; padding:25px 22px; border-radius:22px; background:#193e2e; color:#f6faef; }
.personal-hero::after { content:'%'; position:absolute; right:-12px; top:10px; font-size:180px; line-height:1; font-weight:700; color:#fff; opacity:.045; pointer-events:none; }
.source-tag { display:inline-block; font-size:10px; font-weight:600; padding:7px 10px; border:1px solid #ffffff30; border-radius:50px; }
.personal-hero h2 { position:relative; font-size:29px; font-weight:550; line-height:1.2; letter-spacing:-1.2px; margin:22px 0 14px; }
.personal-hero em { color:#c4df9a; font-style:normal; }
.personal-hero p { max-width:390px; font-size:13px; line-height:1.65; color:#dce8da; }
.hero-link { border:0; color:#fff; background:transparent; padding:0; font-size:13px; font-weight:650; display:flex; align-items:center; gap:16px; }
.hero-link span { font-size:22px; }
.offers-toolbar,.start-toolbar { display:grid; grid-template-columns:1fr; gap:7px; padding:16px; border:1px solid var(--border); background:#edf2e9; border-radius:14px; margin-bottom:20px; }
.offers-toolbar label { display:block; font-size:11px; color:var(--muted); }
.offers-toolbar select { width:100%; font-size:14px; }
.section-nav { display:flex; flex-wrap:wrap; gap:6px; padding:0 16px 4px; }
.section-nav button { padding:9px 12px; min-height:44px; border:1px solid var(--border); border-radius:30px; background:transparent; color:var(--muted); font-size:12px; font-weight:600; }
.section-nav button.active { background:#e1eadb; color:#23482f; border-color:#c6d7bc; }
.card-list { display:grid; grid-template-columns:minmax(0,1fr); gap:14px; }
.product-card { display:grid; grid-template-columns:86px minmax(0,1fr); gap:0 14px; padding:18px; border:1px solid var(--border); background:#fff; border-radius:16px; box-shadow:none; overflow:hidden; }
.product-image-wrap { grid-column:1; grid-row:1; width:86px; height:100px; border:0; border-radius:12px; background:#f5f6f1; margin-top:13px; }
.product-image { width:100%; height:100%; object-fit:contain; padding:8px; }
.image-placeholder { color:#7a8577; font-size:11px; background:#f2f4ed; }
.product-body { grid-column:2; min-width:0; padding:0; }
.product-title { font-size:16px; line-height:1.4; letter-spacing:-.3px; padding-right:10px; margin:7px 0; overflow-wrap:anywhere; }
.badge-row { gap:4px; padding-right:8px; }
.badge,.badge.offer,.badge.favorite { background:#edf4e5; color:#375b31; border:0; border-radius:5px; font-size:9px; font-weight:650; max-width:100%; overflow-wrap:anywhere; }
.badge.permanent-price { background:#f0f1ee; color:#586256; }
.product-copy { font-size:12px; line-height:1.5; margin-bottom:10px; color:var(--muted); }
.price-row { display:block; margin-top:8px; }
.price-label { display:none; }
.price { font-size:24px; font-weight:750; color:#173c29; letter-spacing:-1px; }
.base-price,.inventory,.validity,.price-comparison { font-size:11px; line-height:1.5; margin:5px 0; }
.price-comparison strong { color:#376730; }
.price-comparison.missing { color:var(--muted); font-size:10px; }
.observed-at { font-size:10px; color:var(--muted); line-height:1.5; margin:8px 0; }
.hide-card-button { width:44px; height:44px; top:0; right:0; border:0; border-radius:0; background:transparent; color:#6c786e; font-size:20px; min-width:44px; }
.hide-card-button:hover { background:#f0f3ed; }
.card-actions { grid-column:1/-1; display:grid; grid-template-columns:1fr 1fr .75fr; gap:6px; border:0; padding:14px 0 0; background:transparent; margin-top:0; }
.card-actions button { padding:8px 3px; min-height:44px; border:1px solid var(--border); border-radius:9px; font-size:11px; font-weight:650; background:#fff; color:var(--text); white-space:normal; }
.card-actions button:first-child { background:#e8efdf; color:#2d4c28; border-color:#e8efdf; }
.primary-button { background:#286044; color:#fff; border:1px solid #286044; border-radius:10px; box-shadow:none; }
.primary-button:hover { background:#204c36; }
.secondary-button { border-radius:10px; background:#fff; border:1px solid var(--border); box-shadow:none; }
.text-button { font-size:13px; color:var(--accent); white-space:normal; }
.danger { color:var(--danger); }
.primary-button.danger { background:var(--danger); color:#fff; border-color:var(--danger); }
.search-panel,.manual-item-form,.settings-card,.totals-card,.login-card { background:#fff; border:1px solid var(--border); border-radius:16px; box-shadow:none; }
.search-panel { padding:18px; gap:10px; }
.search-panel>label { font-size:12px; }
.search-row { display:flex; gap:8px; }
.search-row input { min-width:0; width:100%; }
.search-row button { font-size:13px; }
.catalog-controls { display:grid; gap:10px; margin:18px 0; }
.catalog-controls>label:first-child { font-size:12px; }
.catalog-controls.live-search>label,.catalog-controls.live-search>select { display:none; }
.toggle-filter { display:flex; align-items:center; gap:10px; min-height:44px; font-size:13px; }
.source-note,.store-list-note { color:var(--muted); font-size:12px; line-height:1.7; }
.search-summary { color:var(--muted); font-size:12px; margin:20px 0 14px; }
.settings-card { padding:20px; margin-bottom:16px; }
.settings-card h3 { font-size:18px; letter-spacing:-.4px; }
.settings-card p { font-size:13px; line-height:1.65; }
.profile-form { display:grid; grid-template-columns:minmax(0,1fr); gap:14px; }
.profile-form label { display:grid; gap:6px; font-size:12px; }
.inline-form { display:flex; flex-wrap:wrap; gap:8px; }
.inline-form input { flex:1 1 140px; min-width:0; }
.inline-form select { flex:1 1 130px; min-width:0; }
.inline-form button { flex:1 1 auto; font-size:13px; }
.visibility-row { display:flex; justify-content:space-between; align-items:center; gap:12px; border-top:1px solid var(--border); padding:10px 0; font-size:13px; }
.visibility-row strong { overflow-wrap:anywhere; min-width:0; }
.visibility-row button { flex:0 0 100px; }
.editable-item,.favorite-item,.category-group { border-color:var(--border); background:#f7f9f4; box-shadow:none; }
.category-group summary { font-size:13px; }
.category-count { color:#345632; background:#e6eedc; }
.chip { background:#f1f4ed; color:var(--text); border-color:var(--border); }
.roadmap { background:#edf1e7; border-style:dashed; }
.manual-item-form { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:12px; padding:18px; }
.manual-item-form .grow { grid-column:1/-1; }
.manual-item-form .primary-button { grid-column:1/-1; width:100%; }
.manual-item-form label { font-size:12px; }
.manual-item-form .field { width:auto; min-width:0; }
.shopping-item { padding:16px 12px; border:1px solid var(--border); border-radius:14px; box-shadow:none; background:#fff; gap:10px; }
.shopping-price-meta { font-size:11px; }
.shopping-name { font-size:15px; overflow-wrap:anywhere; }
.shopping-fields input { width:100%; }
.shopping-fields { grid-template-columns:65px minmax(85px,1fr); }
.totals-card { margin-top:18px; padding:20px; color:var(--text); background:#e8efdf; }
.totals-card strong { color:var(--text); }
.totals-card div { gap:16px; }
.totals-card span { font-size:12px; }
.totals-card strong { font-size:16px; text-align:right; white-space:nowrap; }
.totals-card div:last-child { padding-top:16px; border-top:1px solid #cdd9c0; }
.totals-card div:last-child strong { font-size:26px; }
.tinder-stage { touch-action:pan-y; }
.tinder-card { background:#fff; border:1px solid var(--border); border-radius:20px; box-shadow:var(--shadow); max-width:560px; }
.tinder-card .product-image-wrap { width:100%; height:220px; margin:0; }
.tinder-copy { padding:20px; }
.tinder-copy h3 { font-size:23px; }
.tinder-copy strong { color:#254f35; }
.tinder-actions { display:grid; grid-template-columns:1fr 1fr; gap:8px; padding:0 16px 16px; }
.tinder-actions button { font-size:12px; padding:9px; }
.swipe-hint { text-align:center; font-size:11px; color:var(--muted); padding:0 14px 16px; line-height:1.5; }
.store-option { border-color:var(--border); border-radius:10px; background:#f7f9f4; }
.upload-drop { background:#edf3e6; border-color:#adc4a2; color:var(--text); border-radius:12px; }
.receipt-photo-grid div { background:#f3f6ee; }
.receipt-item { background:#f4f7ef; border-color:var(--border); }
.bottom-nav { position:fixed; bottom:0; left:0; right:0; width:100%; max-width:none; transform:none; display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:4px; padding:9px max(12px,calc((100vw - 750px)/2)) calc(9px + env(safe-area-inset-bottom)); background:#fffffff5; border:0; border-top:1px solid var(--border); border-radius:0; box-shadow:0 -5px 25px #18302106; backdrop-filter:blur(14px); z-index:50; }
.bottom-nav button { border:0; min-width:0; border-radius:12px; color:#667566; background:transparent; font-size:10px; font-weight:600; gap:4px; min-height:56px; padding:4px; }
.bottom-nav button span:first-child { font-size:23px; line-height:1.15; }
.bottom-nav button.active { background:#e9f0e1; color:#244b32; }
.empty-state,.loading-state,.error-state { grid-column:1/-1; border:1px dashed #c8d5c1; background:#f8faf5; border-radius:16px; box-shadow:none; padding:28px 20px; }
.empty-state p,.error-state p { font-size:13px; line-height:1.6; }
.loader { border-top-color:var(--accent); }
.login-view { background:var(--bg); padding:24px 16px; }
.login-card { padding:30px 24px; max-width:440px; }
.login-card h1 { font-size:36px; letter-spacing:-1.4px; line-height:1.15; }
.brand-mark { background:#1f4a34; color:#e5f0ce; border-radius:16px; box-shadow:none; font-size:35px; letter-spacing:-3px; }
.auth-tabs { background:#eef3e8; }
.auth-tab.active { background:#fff; color:#254e32; }
.app-dialog,.confirm-dialog { border:1px solid var(--border); border-radius:20px; box-shadow:0 24px 80px #11281940; background:#fff; max-height:90dvh; width:calc(100% - 24px); max-width:700px; }
.app-dialog::backdrop,.confirm-dialog::backdrop { background:#102b2080; backdrop-filter:blur(3px); }
.dialog-header { background:#fff; border-color:var(--border); }
.dialog-content { padding:20px; }
.metric,.status-row { background:#f1f5eb; border-color:var(--border); }
.notice,.warning-box,.saving-box { background:#f1f5e9; border-color:#cbd9b9; color:#345032; }
.toast { background:#1f4432; color:#fff; border-radius:12px; box-shadow:var(--shadow); }
.toast-region { bottom:calc(90px + env(safe-area-inset-bottom)); }
@media(min-width:600px) {
  .page-content { padding:0 24px 30px; }
  .app-header { padding-left:24px; padding-right:24px; }
  .section-nav { padding-left:24px; }
  .card-list { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .personal-hero { padding:36px; }
  .personal-hero h2 { font-size:43px; }
  .personal-hero p { font-size:15px; }
  .offers-toolbar { grid-template-columns:auto minmax(0,1fr) auto minmax(0,1fr); align-items:center; gap:10px; }
  .start-toolbar { grid-template-columns:auto minmax(0,1fr) auto minmax(0,1fr) auto minmax(0,1fr); }
  .catalog-controls { grid-template-columns:minmax(0,1fr) minmax(0,1fr); align-items:center; }
  .manual-item-form { grid-template-columns:minmax(0,2fr) minmax(0,1fr) minmax(0,1fr) auto; }
  .manual-item-form .grow,.manual-item-form .primary-button { grid-column:auto; }
  .profile-form { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .app-header h1 { font-size:32px; }
}
@media(min-width:1000px) {
  .card-list { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .personal-hero h2 { font-size:50px; }
  .personal-hero::after { font-size:300px; right:50px; top:0; opacity:.07; }
}
@media(max-width:599px) {
  .app-dialog[open] { position:fixed; inset:auto 0 0; margin:0 auto; width:100%; max-height:92dvh; border-radius:22px 22px 0 0; padding-bottom:env(safe-area-inset-bottom); }
  .metric-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .editable-item { grid-template-columns:1fr; }
  .favorite-item { grid-template-columns:minmax(0,1fr) auto; }
}
@media(prefers-reduced-motion:reduce) { *,*::before,*::after { animation:none!important; transition:none!important; scroll-behavior:auto!important; } }
