/* Wrapit design system — forest + lime (the prototype / Wise palette), Linear-grade polish, light theme only.
   One synced theme across every page and both windows. Loaded LAST so these tokens and components win.
   Motion (tilt/parallax/hover) and the click-sound toggle live in wrapit-fx.js. */
:root {
  /* brand + palette (exact prototype tokens) */
  --forest: #163300; --deep: #0f2400; --lime: #9fe870; --lime2: #93e062; --spruce: #054d28;
  --linen: #e2f6d5; --mint: #f2faea; --ink: #0e0f0c; --ink-2: #454745; --muted: #6a6c6a; --faint: #8d908b;
  --hair: rgba(14, 15, 12, .10); --hair2: rgba(14, 15, 12, .16);
  --bg: #f4f5f1; --paper: #ffffff; --fog: #e8ebe6; --soft: #f3f5f1;
  --blue: #0b4c72; --blue-s: #e3f0f7; --amber: #8a5a00; --amber-s: #fdf0d5; --red: #cb272f; --red-s: #fbe7e8; --violet: #5b3fa8; --violet-s: #ece7fa;
  --sh: 0 1px 2px rgba(14,15,12,.05), 0 8px 24px rgba(14,15,12,.06); --sh2: 0 24px 70px rgba(14,15,12,.16);
  --ring: 0 0 0 4px rgba(159,232,112,.45);
  /* aliases used across the existing pages → mapped to the forest/lime system */
  --green: var(--forest); --green-deep: var(--deep); --leaf: var(--lime); --sprout: var(--spruce);
  --cream: var(--linen); --white: var(--paper); --mist: var(--soft); --stone: var(--fog); --graphite: var(--ink-2);
  --forest2: var(--spruce); --lime-2: var(--lime2); --hairline: var(--hair); --hairline-soft: var(--hair);
  --line: var(--hair); --line2: var(--hair2); --surface: var(--paper); --surface-2: var(--soft); --wash: var(--bg); --wash2: var(--soft);
  --text: var(--ink-2); --heading: var(--ink); --body: var(--ink-2); --pebble: var(--faint); --slate: var(--muted); --obsidian: var(--ink);
  --me-bubble: var(--forest); --me-text: #fff; --them-bubble: var(--fog); --them-text: var(--ink); --danger-soft: var(--red-s);
  --shadow: var(--sh); --shadow-lg: var(--sh2); --shadow-card: var(--sh2);
  /* ONE radius everywhere — 16px on cards, buttons, inputs, tabs, chips, tags (Apple-style rounded rect). Circles (avatars, dots, switches) keep their own. */
  --them: var(--blue); --alarm: var(--red); --r: 16px; --r-sm: 16px; --r-lg: 16px; --r-pill: 16px; --r-img: 16px;
  --gap: 12px; --pad: 20px; --section: 64px; --max: 1240px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
html { -webkit-font-smoothing: antialiased; }
body { font-family: var(--font); font-size: 15px; line-height: 1.5; letter-spacing: -.006em; color: var(--ink-2); background: var(--bg); }
h1, h2, h3, h4, .h1, .h2, .h3 { color: var(--ink); margin: 0; letter-spacing: -.03em; line-height: 1.14; }
h1, .h1 { font-size: 34px; font-weight: 800; } h2, .h2 { font-size: 22px; font-weight: 700; } h3, .h3 { font-size: 16px; font-weight: 700; letter-spacing: -.015em; }
.display { font-size: 48px; font-weight: 800; letter-spacing: -.035em; line-height: 1.05; color: var(--ink); }
.sub, .lead { color: var(--muted); font-size: 16px; } small, .caption { font-size: 12.5px; color: var(--muted); }
a { color: inherit; } b, strong { font-weight: 600; color: var(--ink); } ::selection { background: var(--linen); }
.ic, svg.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ic.sm { width: 15px; height: 15px; } .ic.lg { width: 22px; height: 22px; }
::-webkit-scrollbar { width: 10px; height: 10px; } ::-webkit-scrollbar-thumb { background: #d6d9d2; border-radius: 10px; } ::-webkit-scrollbar-thumb:hover { background: #c2c6bd; }
.hidden { display: none !important; }

/* Buttons — pill, one lime primary per screen; motion on hover */
.btn, button.btn, .btn.primary, .btn.lime, .btn.dark, .btn.ghost, .btn.sm, .btn.go, button.go, button.primary, .mb-ctl, .pill-btn {
  font-family: var(--font); font-weight: 600; font-size: 15px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: var(--r-pill); border: 1px solid var(--hair2); background: var(--paper); color: var(--ink);
  cursor: pointer; box-shadow: none; transition: transform .14s, box-shadow .16s, background .14s, border-color .14s, color .14s;
}
.btn:hover, button.btn:hover { box-shadow: 0 6px 16px rgba(14,15,12,.10); transform: translateY(-1px); }
.btn:active, button.btn:active { transform: translateY(0) scale(.985); }
.btn.primary, .btn.lime, .btn.go, button.go, button.primary { background: var(--lime); border-color: transparent; color: var(--forest); box-shadow: 0 8px 22px rgba(159,232,112,.4); }
.btn.primary:hover, .btn.lime:hover, .btn.go:hover, button.go:hover, button.primary:hover { background: var(--lime2); box-shadow: 0 12px 28px rgba(159,232,112,.55); }
.btn.dark { background: var(--forest); border-color: transparent; color: #fff; } .btn.dark:hover { background: var(--deep); }
.btn.ghost { background: transparent; border-color: transparent; } .btn.ghost:hover { background: var(--soft); box-shadow: none; transform: none; }
.btn.quiet, .btn.link { border-color: transparent; color: var(--spruce); } .btn.quiet:hover, .btn.link:hover { background: var(--linen); box-shadow: none; }
.btn.sm, .mb-ctl { min-height: 34px; padding: 0 13px; font-size: 13px; } .btn.lg { min-height: 52px; padding: 0 26px; font-size: 16px; }
.btn.danger, .btn.red { border-color: transparent; color: var(--red); } .btn.danger:hover { background: var(--red-s); }
.btn.icon { width: 40px; padding: 0; } .btn:disabled, button:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: none; box-shadow: var(--ring); }

/* Pills, tags, badges */
.tag, .chip, .np-tag, .guard, .sg-badge { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 11px; border-radius: var(--r-pill); font-size: 12px; font-weight: 600; background: var(--fog); color: var(--ink); white-space: nowrap; border: 0; }
.tag.g, .chip.g, .tag.green { background: var(--linen); color: var(--spruce); } .tag.b { background: var(--blue-s); color: var(--blue); } .tag.a { background: var(--amber-s); color: var(--amber); } .tag.r { background: var(--red-s); color: var(--red); }
.guard { background: var(--fog); color: var(--muted); } .guard::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.guard.ok { background: var(--linen); color: var(--spruce); } .guard.bad { background: var(--red-s); color: var(--red); }
.wash-label { display: inline-block; background: var(--linen); color: var(--spruce); padding: 4px 8px; border-radius: 7px; font-size: 13px; font-weight: 600; }

/* Nav — top bar (shell) OR left sidebar; both forest/lime */
.wp-nav { display: flex; align-items: center; gap: 14px; min-height: 60px; padding: 0 22px; background: rgba(255,255,255,.78); backdrop-filter: blur(14px); border-bottom: 1px solid var(--hair); position: sticky; top: 0; z-index: 40; }
.wp-nav .mark, .brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; letter-spacing: -.04em; color: var(--ink); text-decoration: none; }
.wp-nav .mark i, .brand i { width: 30px; height: 30px; border-radius: 9px; background: var(--lime); color: var(--forest); display: grid; place-items: center; font-style: normal; font-weight: 800; font-size: 15px; box-shadow: 0 4px 14px rgba(159,232,112,.5); transition: transform .5s cubic-bezier(.2,.8,.2,1); }
.wp-nav .mark:hover i, .brand:hover i { transform: rotate(-8deg) scale(1.06); }
.wp-nav .links { display: flex; gap: 4px; margin: 0 auto; }
nav.tabs, .wp-nav .links { display: flex; gap: 4px; background: transparent; border: 0; padding: 0; box-shadow: none; }
nav.tabs .tab, .wp-nav .links .tab, .wp-nav .links a { font: 600 14.5px/1 var(--font); color: var(--ink-2); background: transparent; border: 0; border-radius: 11px; padding: 10px 14px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; transition: background .14s, color .14s; }
nav.tabs .tab:hover, .wp-nav .links .tab:hover { background: var(--soft); color: var(--ink); }
nav.tabs .tab.active, .wp-nav .links .tab.active { background: var(--linen); color: var(--spruce); }
.wp-nav .right { display: flex; align-items: center; gap: 10px; }
.wp-nav .avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--forest); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; }

/* Cards — white, hairline, soft shadow, lift+tilt ready */
.card, .panel, .box-card, .step-card, .cs-card { background: var(--paper); border: 1px solid var(--hair); border-radius: var(--r); box-shadow: var(--sh); padding: var(--pad); transition: transform .5s cubic-bezier(.2,.8,.2,1), box-shadow .3s; }
.card.flat, .panel.flat { box-shadow: none; } .card.tint, .card.cream { background: var(--mint); border-color: transparent; }
.card.forest { background: linear-gradient(120deg, var(--forest), var(--deep)); color: #fff; border: 0; } .card.forest h1, .card.forest h2, .card.forest h3 { color: #fff; }
.card.lime { background: linear-gradient(135deg, var(--lime), #b6f08a); border: 0; color: var(--forest); box-shadow: 0 14px 34px rgba(159,232,112,.35); }
[data-tilt] { will-change: transform; }
.band { background: var(--paper); border: 1px solid var(--hair); border-radius: var(--r); box-shadow: var(--sh); padding: 28px; }
.section-head { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.section-head .num, .cap { font-size: 11px; color: var(--faint); font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.hr { height: 1px; background: var(--hair); border: 0; margin: 0; }

/* Inputs */
input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="number"], input:not([type]), textarea, select, .input, .area, .select {
  font: 500 15px/1.45 var(--font); color: var(--ink); background: var(--paper); border: 1px solid var(--hair2); border-radius: 12px; padding: 11px 14px; outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus, select:focus { border-color: var(--forest); box-shadow: var(--ring); }
input::placeholder, textarea::placeholder { color: var(--faint); }
label, .label { font-size: 13px; font-weight: 600; color: var(--ink); } .help, .hint { font-size: 13.5px; color: var(--muted); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--forest); width: 18px; height: 18px; }
select { appearance: none; -webkit-appearance: none; padding-right: 38px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%230e0f0c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.sw { width: 42px; height: 24px; border-radius: 99px; border: 0; background: #cfd3cb; position: relative; cursor: pointer; flex: none; transition: background .15s; }
.sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: left .15s; }
.sw.on { background: var(--spruce); } .sw.on::after { left: 21px; }

/* Segmented / choice chips */
.seg, .chips { display: flex; flex-wrap: wrap; gap: 8px; }
.seg button, .chips button, .chip-btn, .chip { font: 600 14px/1 var(--font); color: var(--ink); background: var(--paper); border: 1px solid var(--hair2); border-radius: var(--r-pill); min-height: 36px; padding: 0 15px; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; transition: background .14s, border-color .14s, color .14s; }
.seg button:hover, .chips button:hover, .chip:hover { background: var(--soft); }
.seg button.on, .seg button.active, .chips button.on, .chip.on { background: var(--forest); border-color: var(--forest); color: #fff; }

/* Conversation bubbles */
.bub, .msg { border-radius: 14px; padding: 9px 13px; font-size: 15px; line-height: 1.46; }
.them .bub, .row.them .bub, .msg.them .b { background: var(--fog); color: var(--ink); border-bottom-left-radius: 5px; }
.me .bub, .row.me .bub, .msg.me .b { background: var(--forest); color: #fff; border-bottom-right-radius: 5px; }
.me .bub b, .row.me .bub b { color: rgba(255,255,255,.7); } .them .bub b, .row.them .bub b { color: var(--faint); }

/* Status dots */
.dot, .cap-dot { width: 9px; height: 9px; border-radius: 50%; background: #c3c8cc; display: inline-block; }
.dot.on, .cap-dot.live, .cap-dot.on { background: var(--lime); box-shadow: 0 0 0 4px rgba(159,232,112,.3); }

/* Orb — the single loading / thinking indicator (dots filled by wrapit-fx.js) */
.orb { position: relative; display: inline-block; width: 28px; height: 28px; flex: none; --orb: var(--spruce); }
.orb.lg { width: 44px; height: 44px; } .orb.xl { width: 72px; height: 72px; }
.orb i { position: absolute; left: 50%; top: 50%; width: 11%; height: 11%; margin: -5.5% 0 0 -5.5%; border-radius: 50%; background: var(--orb); opacity: .9; transform: rotate(var(--a)) translateX(var(--d)); animation: orb-breathe 2.4s ease-in-out infinite; animation-delay: var(--t); }
.orb[data-state="idle"] i { animation: none; opacity: .35; }
.orb[data-state="working"] { animation: orb-spin 3s linear infinite; } .orb[data-state="searching"] { animation: orb-spin 1.1s linear infinite; }
.orb[data-state="solving"] i { animation: orb-pulse 1.2s ease-in-out infinite; animation-delay: var(--t); }
.orb.on { --orb: var(--spruce); } .orb.them { --orb: var(--blue); } .orb.warn { --orb: var(--red); }
@keyframes orb-breathe { 0%,100% { transform: rotate(var(--a)) translateX(var(--d)); opacity: .35; } 50% { transform: rotate(var(--a)) translateX(calc(var(--d) * 1.25)); opacity: 1; } }
@keyframes orb-pulse { 0%,100% { transform: rotate(var(--a)) translateX(calc(var(--d) * .7)); opacity: .5; } 50% { transform: rotate(var(--a)) translateX(calc(var(--d) * 1.3)); opacity: 1; } }
@keyframes orb-spin { to { transform: rotate(360deg); } }
.orb-row { display: inline-flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; color: var(--ink); } .orb-row small { color: var(--muted); }

/* Sound toggle pill (wired by wrapit-fx.js) */
.wp-sound { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 13px; border-radius: 999px; background: var(--paper); border: 1px solid var(--hair); font-weight: 600; font-size: 13px; color: var(--ink); cursor: pointer; }
.wp-sound .sw { width: 34px; height: 20px; } .wp-sound .sw::after { width: 16px; height: 16px; } .wp-sound .sw.on::after { left: 16px; }

kbd, .kbd { font: 600 12px/1 var(--font); background: var(--paper); color: var(--ink); border: 1px solid var(--hair2); border-bottom-width: 2px; border-radius: 7px; padding: 4px 7px; }
@media (prefers-reduced-motion: reduce) { .orb, .orb i { animation: none !important; } [data-tilt] { transform: none !important; } }

/* ---- Breathing room + type polish (standard UX spacing; loaded last, no !important wars) ---- */
.main .headline h1, .main h1 { font-weight: 600; letter-spacing: -.025em; line-height: 1.12; }
.main .headline { margin-bottom: 24px; gap: 10px 14px; }
.main .page, .main .page-body { display: flex; flex-direction: column; gap: 22px; }
.grid2, .grid3, .setup-cols { gap: 22px; }
/* cards get consistent generous padding and internal rhythm */
.main .card, .main .panel, .main .step-card { padding: 22px 24px; }
.main .card > * + * { margin-top: 14px; }
.main .card h2, .main .card h3, .main .card .card-h { margin: 0; }
.main .card .card-h, .main .card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
/* section number chips (01 / 02) a touch of air */
.main .num { margin-right: 4px; }
/* labels above fields breathe */
.main label, .main .field > span, .main .label { margin-bottom: 7px; display: inline-flex; }
.main input, .main textarea, .main select { margin-top: 2px; }
/* helper text under fields/sections */
.main .sub, .main .help, .main .hint { line-height: 1.5; }
/* list rows (plan, knowledge, checkboxes) get vertical rhythm */
.main .card li, .main .opt-row, .main .check-row { padding-block: 7px; }
/* keep long text from feeling crushed */
.main p, .main li { max-width: 68ch; }

/* Breadcrumbs (replaces the top search bar — sidebar is the only nav) */
.crumbs { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); font-weight: 500; }
.crumbs .cr-home { color: var(--muted); } .crumbs .cr-sep { width: 15px; height: 15px; color: var(--faint); }
.crumbs b { color: var(--ink); font-weight: 600; }
.wp-top { min-height: 44px; }

/* Error / warning messages as a clean inline alert (not raw red text) */
.main .error:not(:empty), .error:not(:empty) { display: flex; align-items: flex-start; gap: 8px; background: color-mix(in srgb, var(--alarm) 9%, transparent); color: var(--alarm); border: 1px solid color-mix(in srgb, var(--alarm) 22%, transparent); border-radius: 12px; padding: 10px 14px; font-size: 13.5px; line-height: 1.45; font-weight: 500; }
.main .error:empty { display: none; }
.main .error:not(:empty)::before { content: ""; flex: none; width: 16px; height: 16px; margin-top: 1px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 8v5M12 16.5v.01'/%3E%3C/svg%3E") center/contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 8v5M12 16.5v.01'/%3E%3C/svg%3E") center/contain no-repeat; }
