/* EDENNE — /edenne/ in the prototype's own look and feel (v2 build).
   Reference: the deployed prototype app.edenne.life, whose source is
   projects/edenneos/design/app-v1/edenneos-full-dev (deployed copy: the app/ folder of the Codex
   worktree edenne-render-publish-20260908). Component shapes and values below are transplanted
   from that app.css, not re-derived. See docs/design/REFERENCE-LOCATION.md.

   Flow per the founder's board feedback (DEV-BRIEF §7): garden behind everything, the resident
   chosen on arrival, introduction collected inside the conversation. */

@font-face{font-family:EDisplay;src:url('display.woff2') format('woff2');font-display:swap}
@font-face{font-family:Belleza;src:url('belleza-400.ttf') format('truetype');font-weight:400;font-display:swap}

:root{
  color-scheme:light;
  --paper:#f6eeee; --ink-paper:#39232f; --muted:#755d69; --line-paper:#ddced3;
  --deep:#281923; --screen:#251821; --surface:rgba(41,23,35,.95);
  --accent:#f6b1d0; --accent-ink:#2a1723;
  --ink:#fff4f8; --ink-2:#f0dfe7; --ink-3:#e1cbd7; --line:#ffffff38;
}
body[data-resident="lynne"]{--accent:#e5c9a3;--surface:rgba(33,29,27,.96)}
*,*::before,*::after{box-sizing:border-box}
html,body{height:100%}
body{margin:0;overflow:hidden;font-family:'Segoe UI',Arial,sans-serif;background:var(--paper);color:var(--ink-paper)}
button,input,textarea,select{font:inherit}
button{cursor:pointer;border:0;background:none;color:inherit}
button:disabled{cursor:default;opacity:.55}
button:focus-visible,a:focus-visible,input:focus-visible,textarea:focus-visible{outline:3px solid #f192c5;outline-offset:3px}
h1,h2,h3,p{margin:0}
h1,h2,h3{font-family:Belleza,EDisplay,'PingFang SC','Hiragino Sans GB','Microsoft YaHei','Noto Sans CJK SC',Georgia,serif;font-weight:400;letter-spacing:.02em}
img{display:block;max-width:100%}
svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round;flex:none}
[hidden]{display:none!important}

/* ── the framed screen — the prototype's geometry ───────────────────────── */
.shell,.setup{
  position:fixed;left:50%;top:50%;transform:translate(-50%,-50%);
  width:min(430px,calc(100vw - 32px));height:min(760px,calc(100dvh - 48px));
  min-height:520px;overflow:hidden;isolation:isolate;border-radius:28px;
  background:var(--screen);color:var(--ink);box-shadow:0 22px 50px #39232f26;
}
.setup,.shell{display:block}
/* the app column: app.css makes .main a 0-height flex column, which collapses every
   absolutely positioned child onto the top edge. Give it the frame's full box. */
.main{position:absolute;inset:0;display:block;min-width:0;min-height:0;padding:0;background:var(--screen)}
.setup .bottom{bottom:52px}

/* scene + the resident standing on it (prototype .scene brightness .75 / .character) */
.hero,.setup .scene{position:absolute;inset:0;z-index:0;overflow:hidden;background:var(--screen)}
.hero-scene,.setup .scene{
  position:absolute;inset:0;width:100%;height:100%;
  background:url('backdrop-dream.webp') center 45%/cover no-repeat;filter:brightness(.96);
}
body[data-resident="lynne"] .hero-scene,
body[data-resident="lynne"] .setup .scene{background-image:url('backdrop-lynne.webp')}
body[data-resident="lynne"] .hero-scene,
body[data-resident="lynne"] .setup .scene{background-image:url('backdrop-lynne.webp')}
.hero-scene::before,.hero-scene::after{content:none!important;display:none!important}
.hero-figure,.setup .figure{
  position:absolute;z-index:1;left:8%;bottom:96px;width:78%;height:62%;
  background:url('cutout-dream.webp') bottom center/contain no-repeat;
  filter:drop-shadow(0 18px 34px rgba(8,3,7,.5));pointer-events:none;
}
body[data-resident="lynne"] .hero-figure,
body[data-resident="lynne"] .setup .figure{background-image:url('lynne.webp')}
.hero-scrim{position:absolute;inset:0;z-index:2;pointer-events:none;
  background:linear-gradient(180deg,#1c0e1abd,transparent 26%,transparent 42%,#21121b9c 67%,#21121bf5)}
body[data-resident="lynne"] .hero-scrim{background:linear-gradient(180deg,#191510cd,transparent 28%,transparent 45%,#191510a8 65%,#191510)}
.setup .scrim{position:absolute;inset:0;z-index:2;pointer-events:none;
  background:linear-gradient(180deg,#1c0e1abd,transparent 26%,transparent 42%,#21121b9c 67%,#21121bf5)}

/* ── header: lockup left, round menu right, resident line under it ──────── */
.topbar,.setup .head{position:absolute;z-index:6;inset:22px 20px auto;display:flex;align-items:flex-start;gap:10px}
.top-logo,.setup .head img{width:143px;height:auto;margin-top:2px}
.who-is{position:absolute;left:0;top:56px;font-size:11px;color:#f1dce6}
.who-is strong,.who-is small{display:inline;font-size:11px;font-weight:400;color:inherit}
.who-is small::before{content:' · '}
.icon-button{
  width:44px;height:44px;min-width:44px;min-height:44px;margin-left:auto;border-radius:50%;
  display:inline-flex;align-items:center;justify-content:center;
  background:#21172055;border:1px solid #ffffff38;color:var(--ink);font-size:19px;line-height:1;
}
.icon-button svg{width:20px;height:20px}
#topAvatar,#topMemory,#topSpeak{display:none!important}

/* ── bottom block (prototype .bottom) ──────────────────────────────────── */
.bottom{position:absolute;z-index:3;left:20px;right:20px;bottom:108px;max-height:56%;overflow:auto;scrollbar-width:thin}
.bottom h1{font-size:34px;line-height:1.12;margin:0 0 10px}
.bottom h3{font-size:30px;line-height:1.15;margin:0 0 12px}
.bottom p{font-size:13px;line-height:1.65;color:var(--ink-2)}
.overline{font-size:10px!important;letter-spacing:.1em;color:var(--accent);margin-bottom:9px;text-transform:uppercase}

/* the resident choice (prototype .resident-switch) */
.resident-switch{display:flex;gap:6px;margin:0 0 14px}
.resident-switch button{padding:11px 17px;border:1px solid var(--line);border-radius:28px;font-size:12px;color:var(--ink);background:none;min-height:44px}
.resident-switch button[aria-pressed="true"]{background:var(--ink);color:var(--screen);border-color:var(--ink)}

/* buttons (prototype .primary / .secondary / .hint) */
.primary,.secondary{min-height:44px;border-radius:18px;padding:12px 20px;display:flex;align-items:center;justify-content:center;gap:9px;font-size:12px;width:100%;margin-top:14px}
.primary{background:var(--accent);color:var(--accent-ink);font-weight:600}
.secondary{background:#ffffff0b;border:1px solid #ffffff59;color:var(--ink)}
.hint{font-size:11px;color:#f4e6ee;margin-top:12px;text-shadow:0 1px 3px #1b0e16b3}

/* ── conversation (prototype .dialogue / .bubble / .composer) ──────────── */
/* bottom clears the composer by its measured height, so the newest message is never tucked under the input
   row, even when a draft wraps onto several lines (--composer-h is set from the live element). */
.thread{position:absolute;z-index:3;left:20px;right:20px;bottom:calc(98px + var(--composer-h,46px));max-height:44%;overflow:auto;scrollbar-width:thin;display:flex;flex-direction:column;gap:9px;padding:8px 2px;background:none!important;border:0!important;border-radius:0!important;box-shadow:none!important;backdrop-filter:none!important;text-shadow:none!important}
.row{display:flex;align-items:flex-end;width:100%;max-width:none;margin:0}
.row.me{flex-direction:row;justify-content:flex-end}
.row .face{display:none!important}
.bubble{align-self:flex-start;background:#f5c8dceF;color:#34212e;border-radius:12px 12px 12px 4px;padding:10px 13px;max-width:88%;font-size:12px;line-height:1.5;overflow-wrap:anywhere;box-shadow:none}
.row.me .bubble,.bubble.user{align-self:flex-end;background:#392a34eF;color:#fff1f6;border-radius:12px 12px 4px 12px}
body[data-resident="lynne"] .row.her .bubble{background:#e9ddce;color:#29231e}
.bubble .meta,#thread .meta{display:flex;gap:10px;align-items:center;margin-top:6px;font-size:11px;color:inherit;opacity:.85}
.bubble .meta button{min-height:44px;min-width:44px;padding:0 6px;margin:-14px 0;font-size:11px;color:inherit;text-decoration:underline;background:none;border:0}
.typing{background:#f5c8dceF;border:0;box-shadow:none}
.typing i{background:#34212e}

/* the introduction the resident opens with (prototype .panel) */
.panel{background:var(--surface);border:1px solid #ffffff26;border-radius:18px;padding:20px}
.panel h3{font-size:25px}
.panel .detail{font-size:11px;line-height:1.6;color:#e4cfdc;margin-top:10px}

/* composer */
.composer{position:absolute;z-index:5;left:20px;right:20px;bottom:96px;display:flex;align-items:center;gap:8px;margin:0;padding:0;background:none;border:0}
.composer .icon.round,.composer .primary.round{width:44px;height:44px;min-width:44px;min-height:44px;padding:0;border-radius:50%;display:grid;place-items:center;margin:0}
#more,#mic{background:#21172055;border:1px solid var(--line);color:var(--ink)}
.composer .round svg{width:21px;height:21px}
#send{background:var(--accent);color:var(--accent-ink);border:0}
#input{width:0;flex:1;height:44px;min-height:44px;max-height:88px;resize:none;padding:13px 16px;border:1px solid #ffffff50;border-radius:18px;background:#271b24d9;color:#fff;font-size:12px;line-height:18px;outline:none;box-shadow:none}
#input::placeholder{color:var(--ink-3)}
#input:focus{border-color:var(--accent)}

/* the plus row (prototype .panel) */
.quick{display:none;position:absolute;z-index:8;left:20px;right:20px;bottom:150px;gap:7px;padding:10px;background:var(--surface);border:1px solid #ffffff26;border-radius:12px;overflow-x:auto}
.quick.open{display:flex}
.quick button{flex:1;min-width:max-content;min-height:44px;padding:10px 12px;border-radius:12px;border:1px solid #ffffff40;background:#ffffff0b;color:var(--ink);font-size:11px}

/* ── the dock: five tabs (prototype .dock) ─────────────────────────────── */
.dock{position:absolute;z-index:5;left:20px;right:20px;bottom:14px;display:flex;align-items:flex-end;justify-content:space-between;gap:4px;padding:10px 0 0;border-top:1px solid #ffffff24;background:none;box-shadow:none}
.dock button{display:flex;align-items:flex-end;justify-content:flex-end;flex-direction:column;gap:7px;min-width:46px;min-height:44px;padding:0;border:0;background:none;color:#fdf0f5;font-size:11px;font-weight:500}
.dock button svg{width:22px;height:22px;padding:5px;border-radius:50%;box-sizing:content-box;background:#ffffff14}
.dock button[aria-current="true"]{color:var(--accent)}
.dock button[aria-current="true"] svg{background:#f6b1d029}

/* ── drawer + sheets: prototype rows and cream dialogs ─────────────────── */
.scrim{position:absolute;inset:0;z-index:20;background:#1b111bbb}
.sidebar{position:absolute;z-index:30;inset:0 auto 0 0;width:min(86%,330px);height:100%;display:flex;flex-direction:column;gap:12px;padding:22px 20px;transform:translateX(-102%);visibility:hidden;transition:transform .22s ease,visibility 0s linear .22s;background:#f7eff2;color:var(--ink-paper);border-right:1px solid var(--line-paper);border-radius:0 18px 18px 0;overflow:auto}
.sidebar.open{transform:none;visibility:visible;transition:transform .22s ease,visibility 0s}
.side-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:4px}
.side-head img{width:118px}
.side-head .icon{width:44px;height:44px;border-radius:50%;background:#eadee4;color:var(--ink-paper);display:grid;place-items:center;font-size:19px;line-height:1}
.side-label{font-size:11px!important;letter-spacing:.1em;text-transform:uppercase;color:var(--accent)!important;margin:14px 0 2px}
.side-block{display:flex;flex-direction:column}
/* a tab is a tab: flat rows with a hairline, no button chrome */
.sidebar button,.sidebar .res-item,.sidebar .resident,.sidebar .conv,.side-foot button{
  display:flex;align-items:center;gap:12px;width:100%;text-align:left;padding:13px 0;border:0;border-bottom:1px solid #dfd0d6;border-radius:0;background:none;color:var(--ink-paper);font-size:13px;min-height:44px}
.sidebar .resident img,.side-block img{width:38px;height:38px;border-radius:50%;object-fit:cover;object-position:50% 12%;flex:none}
.sidebar strong{display:block;font-weight:600;color:var(--ink-paper)}
.sidebar .conv,.sidebar .recent{background:none!important;box-shadow:none!important;border-radius:0!important}
.sidebar small{display:block;font-size:11px;color:var(--muted);margin-top:3px}
.sidebar .who{font-size:11px;color:var(--muted);margin-top:auto;padding-top:12px}
.side-foot{display:flex;flex-direction:column;margin-top:auto}
/* the selected resident: flat row, tinted, with a non-colour cue (left bar + weight) */
.sidebar .resident[aria-pressed="true"],.sidebar .res-item[aria-pressed="true"],.sidebar .resident.sel,.sidebar .res-item.sel{
  background:#f0e2e9;box-shadow:none;border-radius:12px;padding-left:10px;padding-right:8px;
  box-shadow:inset 3px 0 0 var(--accent)}
.sidebar .resident[aria-pressed="true"] strong,.sidebar .res-item[aria-pressed="true"] strong{font-weight:700}

dialog#sheet.sheet,.sheet{width:min(420px,calc(100vw - 30px));max-height:85dvh;margin:auto;padding:0;background:#f7eff2;color:var(--ink-paper);border:1px solid var(--line-paper);border-radius:18px;overflow:hidden}
dialog#sheet::backdrop{background:#1b111bbb}
.sheet-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:20px 24px 14px;border-bottom:1px solid #dfd0d6}
.sheet-head h2{font-size:25px}
.sheet-head .icon{width:44px;height:44px;border-radius:50%;background:#eadee4;color:var(--ink-paper);font-size:19px;display:grid;place-items:center;line-height:1}
.sheet-body{padding:18px 24px 24px;max-height:calc(85dvh - 80px);overflow:auto}
.sheet-body p,.sheet-body small,.sheet-body .side-label{color:var(--muted)}
.sheet-body .note{padding:0;background:none;border:0;color:var(--muted);font-size:13px}
#sheetBody input,.sheet input,.sheet textarea{width:100%;min-height:44px;padding:12px;border:1px solid #bfa4b3;border-radius:12px;background:#fff;color:var(--ink-paper);font-size:12px}
.sheet .field{display:flex;align-items:center;gap:8px;margin-bottom:6px}
.sheet .field input{flex:1;min-width:0}
.sheet .field .primary,.sheet .primary{width:auto;min-height:44px;height:44px;padding:10px 18px;border-radius:18px;background:#3b2734;color:#fff;margin:0}
.sheet .mem-row,.sheet .setting{display:flex;align-items:center;gap:12px;padding:11px 0;border-bottom:1px solid #dfd0d6}
.sheet .mem-row p,.sheet .setting strong{flex:1;min-width:0;font-size:12px;line-height:1.5;color:var(--ink-paper)}
.sheet .mem-row button:not(.switch),.sheet .setting button:not(.switch){width:auto;min-height:44px;padding:8px 14px;border-radius:12px;background:#eadee4;color:var(--ink-paper);border:1px solid #dfd0d6;font-size:11px;white-space:nowrap}
.sheet .setting small{display:block;font-size:11px;color:var(--muted);margin-top:3px}
/* switch states must be unmistakable: grey off, plum on, knob travels */
.sheet .switch{width:58px;height:32px;border-radius:999px;background:#c6adba!important;border:1px solid #a98ea0!important;position:relative;flex:0 0 auto;transition:background .2s}
.sheet .switch::after{content:'';position:absolute;top:4px;left:4px;width:24px;height:24px;border-radius:50%;background:#fff;box-shadow:0 1px 3px #39232f33;transition:transform .2s}
.sheet .switch[aria-checked="true"]{background:#8d4f6c!important}
.sheet .switch[aria-checked="true"]::after{transform:translateX(26px)}
.toast{z-index:100;background:#f7eff2;color:var(--ink-paper);border:1px solid var(--line-paper);border-radius:12px;font-size:12px;padding:10px 14px}

/* the empty conversation, in the prototype's panel grammar */
.empty-thread{background:var(--surface);border:1px solid #ffffff26;border-radius:18px;padding:20px}
.empty-thread img{display:none}
.empty-thread h2{font-size:25px;margin:0 0 7px}
.empty-thread>p:not(.overline){font-size:13px;line-height:1.65;color:var(--ink-2);margin-bottom:12px}
.openers{display:flex;gap:6px;flex-wrap:wrap}
.opener{min-height:44px;padding:10px 13px;border-radius:12px;border:1px solid #ffffff40;background:#ffffff0b;color:var(--ink);font-size:11px}

@keyframes edenne-in{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
.bubble{animation:edenne-in .28s ease-out both}
@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}

/* phone: the frame fills the viewport, as the prototype does on mobile */
@media(max-width:650px){
  body{background:var(--deep)}
  .shell,.setup{width:100vw;height:100dvh;min-height:0;left:0;top:0;transform:none;border-radius:0;box-shadow:none}
  .topbar,.setup .head{inset:max(20px,env(safe-area-inset-top)) 20px auto}
  .bottom,.thread,.composer,.quick{left:16px;right:16px}
  .bottom{bottom:calc(max(18px,env(safe-area-inset-bottom)) + 92px)}
  .thread{bottom:calc(max(16px,env(safe-area-inset-bottom)) + 72px + var(--composer-h,46px))}
  .composer{bottom:calc(max(16px,env(safe-area-inset-bottom)) + 70px)}
  .quick{bottom:calc(max(16px,env(safe-area-inset-bottom)) + 122px)}
  .dock{left:16px;right:16px;bottom:max(12px,env(safe-area-inset-bottom))}
  .hero-figure,.setup .figure{left:6%;width:84%;height:54%;bottom:calc(max(18px,env(safe-area-inset-bottom)) + 122px)}
}
@media(max-height:700px){
  .bottom h1{font-size:28px}
  .thread{max-height:38%}
}
