/* ============================================================
   COPPER_AGENT_CARTRIDGE — styles.css
   Created: 2026-06-26  Reason: faithful port of the source Copper
   app to the universal cartridge socket. The copper
   palette is preserved EXACTLY from source. Google Fonts
   (Playfair Display / Cormorant Garamond) and Font Awesome are
   REMOVED — replaced with native device serif/sans stacks. No
   external requests of any kind. Additions over source: .lang-toggle
   (EN/ES), setup modal, toast, settings gear, [data-i18n] helpers.
   Byte-identical across all 3 targets.
   ============================================================ */
*{box-sizing:border-box;margin:0;padding:0;-webkit-tap-highlight-color:transparent}
:root{
  --bg:#fdf5ee;--bg2:#f5e8d8;--card:#fff;
  --copper:#b45309;--copper2:#92400e;--copper3:#78350f;
  --bronze:#c87941;--gold:#d97706;
  --text:#1c0e05;--text2:#5a3018;--text3:#a08060;
  --border:#e0c8a8;--border2:#c8a880;
  --green:#059669;--greenlight:#d1fae5;
  --warn:#fff8e1;--warnborder:#f0c040;
  --red:#991b1b;--redlight:#fee2e2;
  /* native font stacks (replaces Google Fonts) */
  --font-sans:-apple-system,BlinkMacSystemFont,'Segoe UI',Helvetica,Arial,sans-serif;
  --font-serif:Georgia,'Iowan Old Style','Times New Roman',serif;
  --font-mono:'Courier New',Courier,monospace;
}
body{font-family:var(--font-sans);background:var(--bg);color:var(--text);max-width:480px;margin:0 auto;min-height:100vh;font-size:15px}
button{font-family:inherit}
.app-shell{position:sticky;top:0;z-index:100;box-shadow:0 4px 18px rgba(120,53,15,.30)}
.header{position:relative;text-align:center;padding:24px 20px 20px;background:radial-gradient(ellipse 130% 100% at 50% 0%,#d97706 0%,#b45309 50%,#5a2807 100%);color:#fff;overflow:hidden}
.header::before{content:"";position:absolute;inset:0;background:radial-gradient(circle at 85% 12%,rgba(253,230,138,.22),transparent 55%),radial-gradient(circle at 12% 88%,rgba(217,119,6,.20),transparent 55%);pointer-events:none}
.header::after{content:"";position:absolute;left:50%;bottom:0;transform:translateX(-50%);width:90px;height:2px;background:linear-gradient(90deg,transparent,#fde68a,transparent);opacity:.85}
.header>*{position:relative;z-index:1}
.header-title{font-family:var(--font-serif);font-size:30px;font-weight:700;color:#fff;letter-spacing:.5px;line-height:1.1}
.header-sub{font-family:var(--font-serif);font-style:italic;font-size:17px;color:rgba(255,255,255,.86);margin-top:6px;letter-spacing:.3px}
.header-email{font-family:var(--font-serif);font-size:13px;color:#fde68a;font-weight:500;margin-top:6px;letter-spacing:.8px}
.header-email:empty{display:none}

/* ── LANGUAGE TOGGLE (added for EN/ES) ── */
.lang-toggle{position:absolute;top:10px;left:12px;display:flex;gap:5px;z-index:3}
.lang-toggle button{background:rgba(255,255,255,.18);border:1px solid rgba(255,255,255,.45);color:#fff;font-size:11px;font-weight:700;letter-spacing:.4px;padding:4px 9px;border-radius:999px;cursor:pointer;line-height:1.3}
.lang-toggle button.on,.lang-toggle button[aria-pressed="true"]{background:#fff;color:var(--copper2);border-color:#fff}

/* ── SETTINGS GEAR (added; source button was orphaned) ── */
.settings-btn{position:absolute;top:10px;right:12px;background:rgba(255,255,255,.18);border:1px solid rgba(255,255,255,.45);color:#fff;width:30px;height:30px;border-radius:8px;font-size:15px;cursor:pointer;display:flex;align-items:center;justify-content:center;z-index:3;line-height:1}

.tab-bar{display:flex;background:linear-gradient(180deg,var(--copper3),#5a2807);overflow-x:auto;scrollbar-width:none;border-bottom:1px solid rgba(253,230,138,.22)}
.tab-bar::-webkit-scrollbar{display:none}
.tab-btn{flex:none;padding:9px 13px;font-size:12px;font-weight:700;color:rgba(255,255,255,.65);background:none;border:none;cursor:pointer;letter-spacing:.4px;transition:all .2s;white-space:nowrap}
.tab-btn.active{color:#fff;background:rgba(255,255,255,.15);border-bottom:2px solid #fde68a}
.panel{display:none;padding:14px}
.panel.active{display:block}
.card{background:var(--card);border-radius:12px;padding:14px;margin-bottom:12px;border:1px solid var(--border);box-shadow:0 1px 4px rgba(0,0,0,.07)}
.card-title{font-size:14px;font-weight:800;color:var(--copper);margin-bottom:8px}

/* ── ACCORDIONS (category pills, default open) ── */
.acc-item{background:var(--card);border:1px solid var(--border);border-left:3px solid var(--copper);border-radius:10px;margin-bottom:10px;overflow:hidden;box-shadow:0 1px 3px rgba(120,53,15,.06)}
.acc-head{display:flex;align-items:center;padding:13px 14px;cursor:pointer;gap:10px;-webkit-tap-highlight-color:transparent;background:linear-gradient(180deg,#fff8ee 0%,#fff 100%)}
.acc-head:active{background:var(--bg2)}
.acc-cat{font-size:10px;font-weight:800;padding:3px 8px;border-radius:20px;white-space:nowrap;flex-shrink:0;letter-spacing:.4px}
.acc-label{flex:1;font-size:15px;font-weight:700;color:var(--copper2);letter-spacing:.1px;line-height:1.3}
.acc-arrow{color:var(--copper);font-size:14px;flex-shrink:0;transition:transform .2s}
.cat-health{background:#fef3c7;color:#78350f}
.cat-history{background:#e0f2fe;color:#0c4a6e}
.cat-cooking{background:#fce7f3;color:#831843}
.cat-science{background:#d1fae5;color:#064e3b}
.cat-invest{background:#ede9fe;color:#3730a3}
.cat-experiments{background:#fce8d4;color:#7a3a08}
.acc-item.open .acc-arrow{transform:rotate(180deg)}
.acc-body{display:none;padding:0 12px 12px;font-size:14px;line-height:1.65;color:var(--text2)}
.acc-item.open .acc-body{display:block}
.acc-warn{background:var(--redlight);border:1px solid #fca5a5;border-radius:8px;padding:10px;margin-top:10px;font-size:13px;color:var(--red)}
.acc-warn.caution{background:var(--warn);border-color:var(--warnborder);color:#78350f}
.acc-body ul{padding-left:18px;margin:6px 0}
.acc-body li{margin-bottom:4px}
.acc-body strong{color:var(--text)}
.acc-body p{margin-bottom:8px}
.acc-body ol{padding-left:18px;margin:6px 0}
.acc-body ol li{margin-bottom:5px}
.data-box{background:var(--bg2);border-left:3px solid var(--copper);padding:8px 12px;border-radius:0 8px 8px 0;margin:8px 0;font-size:13px;color:var(--copper2)}

/* ── FACT ROTATOR ── */
.fact-box{background:linear-gradient(135deg,#78350f,#b45309);border-radius:12px;padding:16px;margin-bottom:14px;color:#fff}
.fact-label{font-size:10px;font-weight:800;letter-spacing:1.2px;opacity:.7;margin-bottom:6px}
.fact-text{font-size:15px;line-height:1.6;font-weight:500}
.fact-nav{display:flex;align-items:center;gap:10px;margin-top:10px}
.fact-nav button{background:rgba(255,255,255,.2);border:none;color:#fff;padding:4px 12px;border-radius:20px;font-size:12px;cursor:pointer}
.fact-counter{font-size:11px;opacity:.75}

/* ── QUICK LOOKUP CARDS ── */
.lookup-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-bottom:14px}
.lookup-card{background:var(--card);border:1px solid var(--border);border-radius:10px;padding:10px;text-align:center}
.lookup-val{font-size:19px;font-weight:800;color:var(--copper)}
.lookup-lbl{font-size:10px;color:var(--text3);margin-top:2px;line-height:1.4}

/* ── FOOD TABLE ── */
.food-table{width:100%;border-collapse:collapse;font-size:13px;margin:8px 0}
.food-table th{background:var(--copper);color:#fff;padding:6px 8px;text-align:left}
.food-table td{padding:6px 8px;border-bottom:1px solid var(--border);color:var(--text2)}
.food-table tr:nth-child(even) td{background:var(--bg2)}

/* ── PRICE TRACKER ── */
.price-box{background:var(--card);border:1px solid var(--border);border-radius:12px;padding:14px;margin-bottom:12px}
.price-title{font-size:13px;font-weight:800;color:var(--copper);margin-bottom:10px}
.price-input{display:flex;gap:8px;margin-bottom:8px;align-items:center}
.price-input label{font-size:12px;color:var(--text3);flex:none;width:80px}
input[type=number],input[type=text],input[type=email]{width:100%;padding:9px 11px;border:1px solid var(--border);border-radius:8px;font-size:14px;background:var(--card);color:var(--text);outline:none;font-family:inherit}
input:focus{border-color:var(--copper)}
.btn{display:block;width:100%;padding:12px;border-radius:10px;border:none;font-size:15px;font-weight:700;cursor:pointer;text-align:center;margin-bottom:8px;font-family:inherit}
.btn-copper{background:linear-gradient(135deg,var(--copper),var(--copper2));color:#fff}
.btn-gold{background:var(--gold);color:#fff}
.btn-outline{background:none;border:2px solid var(--copper);color:var(--copper2)}
.result-box{background:var(--bg2);border:1px solid var(--border2);border-radius:10px;padding:12px;margin-top:10px;font-size:14px;color:var(--text2)}
.result-val{font-size:22px;font-weight:800;color:var(--copper)}

/* ── NOTES ── */
.note-item{background:var(--bg2);border-radius:8px;padding:10px;margin-bottom:8px;border-left:3px solid var(--copper)}
.note-author{font-size:11px;color:var(--text3);margin-bottom:3px}
.note-text{font-size:14px;color:var(--text2)}
.note-input{display:flex;gap:8px;margin-top:10px}
.note-input input{flex:1}
.note-input button{padding:9px 14px;background:var(--copper);color:#fff;border:none;border-radius:8px;font-weight:700;cursor:pointer;white-space:nowrap;font-size:13px;font-family:inherit}

/* ── FOOTER ── */
.site-footer{max-width:480px;margin:24px auto 0;padding:22px 22px 28px;text-align:center;font-family:var(--font-serif);font-size:14.5px;color:#7a4a2a;line-height:1.85;background:#fffaf2;border-top:1px solid #e8d8b8}
.site-footer-rule{width:90px;height:1px;background:linear-gradient(90deg,transparent,#b45309,transparent);margin:0 auto 14px}
.site-footer .ftr-line{margin:2px 0}
.site-footer a{color:#b45309;text-decoration:none;font-weight:600;border-bottom:1px dotted rgba(180,83,9,.35);transition:color .15s,border-color .15s}
.site-footer a:hover{color:#78350f;border-bottom-color:#78350f}
.site-footer .ftr-copy{font-style:italic}
.site-footer .ftr-namaste{font-family:var(--font-serif);font-style:normal;font-size:13px;font-weight:700;color:#3a1d0b;letter-spacing:3px;margin-top:10px}

/* ── SETUP MODAL ── */
.setup-overlay{position:fixed;inset:0;background:rgba(58,29,11,.9);z-index:999;display:none;align-items:center;justify-content:center;padding:20px;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px)}
.setup-overlay.show{display:flex}
.setup-card{background:#fff;border-radius:16px;padding:30px 22px;max-width:360px;width:100%;text-align:center}
.setup-icon{font-size:38px;margin-bottom:10px;line-height:1}
.setup-card h2{font-size:18px;font-weight:700;color:var(--copper);margin-bottom:8px}
.setup-card p{font-size:13px;color:var(--text2);line-height:1.55;margin-bottom:18px}
.setup-card input{margin-bottom:4px}
.setup-note{font-size:11px;color:var(--text3);margin-top:10px;line-height:1.5}
.setup-err{display:none;font-size:12px;color:var(--red);margin-top:6px}

/* ── SETTINGS PANEL ── */
.settings-overlay{position:fixed;inset:0;background:rgba(0,0,0,.5);z-index:998;display:none}
.settings-panel{position:fixed;right:0;top:0;bottom:0;width:290px;background:#fff;z-index:999;padding:20px;display:none;overflow-y:auto;box-shadow:-4px 0 20px rgba(0,0,0,.2)}
.settings-panel h3{font-size:17px;font-weight:800;color:var(--copper);margin-bottom:16px}
.settings-label{font-size:12px;font-weight:700;color:var(--text3);margin-bottom:4px;margin-top:12px}
.close-btn{float:right;background:none;border:none;font-size:22px;cursor:pointer;color:var(--text3)}

/* ── TOAST ── */
.toast{position:fixed;bottom:30px;left:50%;transform:translateX(-50%) translateY(12px);background:#3a1d0b;color:#fff;padding:9px 18px;border-radius:18px;font-size:12.5px;font-weight:600;opacity:0;transition:opacity .25s,transform .25s;z-index:1000;pointer-events:none;white-space:nowrap;max-width:90vw;text-align:center}
.toast.show{opacity:1;transform:translateX(-50%) translateY(0)}
