:root {
  --ink:#1e2921;
  --muted:#627064;
  --line:#b9c5ae;
  --paper:#e5e8d9;
  --panel:#f4f4e8;
  --white:#fffdf4;
  --accent:#5f7d4b;
  --accent-dark:#263c2b;
  --highlight:#95b35f;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}
* { box-sizing:border-box; }
[hidden] { display:none !important; }
body { margin:0; color:var(--ink); background:linear-gradient(rgba(30,41,33,.035) 1px,transparent 1px),var(--paper); background-size:100% 28px,auto; }
body:not(.authenticated) { overflow:hidden; }
button,input,select,textarea { font:inherit; }
button { cursor:pointer; }
.button { min-height:40px; padding:0 16px; border:1px solid transparent; border-radius:9px; font-size:11px; font-weight:850; }
.button-primary { color:white; border-color:var(--accent-dark); background:var(--accent-dark); }
.button-secondary { color:var(--ink); border-color:var(--line); background:var(--white); }
.auth-gate { min-height:100dvh; padding:16px; position:fixed; inset:0; z-index:100; display:grid; place-items:center; overflow:auto; background:radial-gradient(circle at 70% 12%,var(--accent),transparent 34rem),var(--accent-dark); }
.auth-gate.hidden { display:none; }
.login-card { width:min(420px,100%); padding:30px; display:grid; gap:14px; border:1px solid var(--line); border-radius:18px; background:var(--panel); box-shadow:0 35px 90px rgba(0,0,0,.34); }
.login-card h1 { margin:0; font:600 31px Georgia,serif; }
.login-card p,.login-card small { margin:0; color:var(--muted); font-size:10px; line-height:1.6; }
.login-card small { text-align:center; }
.login-card label,.control-card label { display:grid; gap:5px; color:var(--muted); font-size:8px; font-weight:850; text-transform:uppercase; }
.login-card input,.control-card input,.control-card select,.control-card textarea { min-width:0; width:100%; height:40px; padding:0 10px; border:1px solid var(--line); border-radius:7px; background:white; }
.control-card textarea { height:auto; padding:10px; }
.login-error { min-height:15px; color:#9a4138 !important; font-weight:750; }
.login-divider { display:grid; grid-template-columns:1fr auto 1fr; align-items:center; gap:10px; color:var(--muted); font-size:9px; text-transform:uppercase; }
.login-divider::before,.login-divider::after { content:""; height:1px; background:var(--line); }
.oauth-actions,.login-secondary-actions { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.oauth-button { display:flex; align-items:center; justify-content:center; gap:6px; }
.oauth-button b { width:20px; height:20px; display:grid; place-items:center; border-radius:50%; color:white; background:var(--accent-dark); }
.topbar { min-height:76px; padding:10px clamp(18px,4vw,64px); display:flex; align-items:center; justify-content:space-between; gap:18px; border-bottom:1px solid rgba(30,41,33,.12); background:color-mix(in srgb,var(--paper) 92%,white 8%); }
.brand { display:flex; align-items:center; gap:12px; color:inherit; text-decoration:none; }
.brand-mark { width:38px; height:38px; border-radius:10px; background:linear-gradient(135deg,var(--accent-dark),var(--accent)); transform:rotate(-5deg); }
.brand strong { font-size:13px; letter-spacing:.14em; text-transform:uppercase; }
.top-actions { display:flex; align-items:center; gap:8px; }
main { width:min(1240px,calc(100% - 40px)); margin:0 auto; }
.hero { max-width:780px; padding:54px 0 26px; }
.eyebrow { margin:0 0 8px; color:var(--accent-dark); font-size:10px; font-weight:900; letter-spacing:.16em; text-transform:uppercase; }
.hero h1 { margin:0; font:600 clamp(35px,6vw,66px)/.98 Georgia,serif; letter-spacing:-.045em; }
.hero p:last-child { margin:16px 0 0; color:var(--muted); font-size:12px; line-height:1.7; }
.generator-workspace { display:grid; grid-template-columns:minmax(310px,.72fr) minmax(520px,1.28fr); gap:18px; align-items:start; }
.control-card,.preview-card,.quote-card { border:1px solid var(--line); border-radius:14px; background:var(--panel); box-shadow:0 18px 45px rgba(0,0,0,.08); overflow:hidden; }
.card-heading { min-height:68px; padding:15px 18px; display:flex; align-items:center; justify-content:space-between; gap:12px; border-bottom:1px solid var(--line); }
.card-heading h2 { margin:0; font:600 21px Georgia,serif; }
.control-body,.quote-body { padding:18px; display:grid; gap:12px; }
.field-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; }
.field-grid.single-field { grid-template-columns:1fr; }
.preview-stage { min-height:430px; padding:18px; position:relative; display:grid; place-items:center; touch-action:none; background:radial-gradient(circle,var(--white),var(--paper)); }
.preview-angle-controls { position:absolute; top:12px; right:12px; z-index:2; display:flex; gap:5px; }
.preview-angle-controls button { min-height:32px; padding:0 10px; border:1px solid var(--line); border-radius:7px; color:var(--ink); background:rgba(255,253,244,.9); font-size:9px; font-weight:850; }
.preview-stage svg { width:100%; max-height:390px; }
.stats { display:grid; grid-template-columns:repeat(4,1fr); border-top:1px solid var(--line); }
.stats div { padding:13px; border-right:1px solid var(--line); }
.stats div:last-child { border-right:0; }
.stats span,.stats strong { display:block; }
.stats span { color:var(--muted); font-size:8px; font-weight:850; text-transform:uppercase; }
.stats strong { margin-top:4px; font-size:11px; }
.quote-card { margin-top:18px; }
.quote-list { display:grid; gap:8px; }
.quote-list article { padding:11px; display:grid; grid-template-columns:1fr auto auto; gap:10px; align-items:center; border:1px solid var(--line); border-radius:9px; background:white; }
.quote-list small { color:var(--muted); }
.toast { position:fixed; right:20px; bottom:20px; z-index:120; padding:12px 16px; border-radius:8px; color:white; background:var(--ink); opacity:0; transform:translateY(10px); transition:.18s; font-size:10px; font-weight:800; }
.toast.visible { opacity:1; transform:none; }
@media (max-width:900px){.generator-workspace{grid-template-columns:1fr}.topbar{align-items:flex-start;flex-direction:column}.top-actions{width:100%;justify-content:flex-end}}
@media (max-width:620px){body:not(.authenticated){overflow:auto}.auth-gate{place-items:start center}main{width:calc(100% - 22px)}.field-grid,.stats,.upload-actions{grid-template-columns:1fr 1fr}.quote-list article{grid-template-columns:1fr}.top-actions{display:grid;grid-template-columns:1fr 1fr;width:100%}.upload-picker{grid-template-columns:1fr}.upload-cta{justify-self:start}.saved-upload-list article{grid-template-columns:1fr}}
