/* ============ Murmur — LLM thinking companion ============ */
:root {
  --paper: #FBF8F4; --paper-2: #F4EFE8; --card: #FFFDFA; --line: #E9E2D8; --line-2: #DDD4C8;
  --ink: #24211D; --ink-2: #6B645B; --ink-3: #8E867C;
  --apricot: #FFBE98; --blush: #FFB4C6; --butter: #FFE3A3; --sky: #BCDDFF; --rose: #C2415E;
  --font-display: 'Newsreader', Georgia, serif; --font-body: 'Albert Sans', system-ui, sans-serif;
  --t-xs: 12px; --t-sm: 14px; --t-md: 16px; --t-lg: 20px; --t-xl: 28px; --t-2xl: 40px;
  --r-sm: 12px; --r-md: 16px; --r-lg: 24px; --r-pill: 999px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --route-ms: 760; --in-y: 16px; --in-blur: 6px; --in-gap: 60ms; --in-delay: 160ms; --in-ms: 760ms;
}
body { background: var(--paper); color: var(--ink); font: 400 var(--t-md)/1.5 var(--font-body); }
.app { background: var(--paper); }
.screen { background: radial-gradient(420px 320px at 70% 8%, rgba(255,190,152,.16), transparent 70%), radial-gradient(360px 300px at 0% 40%, rgba(188,221,255,.14), transparent 70%), var(--paper); }
#bubble { position: absolute; inset: 0; width: 100%; height: 100%; }

/* ---------- type ---------- */
.display { font: 400 var(--t-2xl)/1.02 var(--font-display); letter-spacing: -0.025em; font-optical-sizing: auto; }
.display em { font-style: italic; color: #B4693F; }
.lede { color: var(--ink-2); font-size: var(--t-md); margin-top: 12px; line-height: 1.55; }
.eyebrow { font: 600 var(--t-xs)/1 var(--font-body); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.link { color: var(--ink); font-weight: 600; text-decoration: none; background: linear-gradient(90deg, var(--apricot), var(--blush)) left 100% / 100% 2px no-repeat; padding-bottom: 2px; transition: background-size .4s var(--ease); }
.link:hover { background-size: 100% 100%; }
.link:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 4px; }

.pad { padding-inline: 26px; }
.top { display: flex; align-items: center; gap: 10px; padding: 10px 26px 0; height: 52px; }
.wordmark { font: italic 400 24px/1 var(--font-display); letter-spacing: -.02em; }
.top .aside { margin-left: auto; }
.back { width: 44px; height: 44px; margin-left: -10px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; transition: background .3s; }
.back:hover { background: var(--paper-2); }
.back:focus-visible { outline: 2px solid var(--ink); }

/* ---------- fields ---------- */
.field { display: grid; gap: 7px; margin-bottom: 14px; }
.field > label, .field .row > label { font: 600 var(--t-xs)/1 var(--font-body); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.control { position: relative; display: flex; align-items: center; }
.control input {
  width: 100%; height: 54px; border: 1px solid var(--line); outline: 0; border-radius: var(--r-md); background: var(--card);
  padding: 0 52px 0 16px; font: 500 var(--t-md)/1 var(--font-body); color: var(--ink);
  transition: border-color .35s var(--ease), box-shadow .35s var(--ease), background .35s;
}
.control input::placeholder { color: var(--ink-3); }
.control input:focus { border-color: var(--ink); box-shadow: 0 0 0 4px rgba(255,190,152,.28), 0 10px 24px -14px rgba(180,105,63,.45); }
.control .eye { position: absolute; right: 5px; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: var(--ink-2); font-size: 20px; transition: background .3s; }
.control .eye:hover { background: var(--paper-2); }
.control .eye:focus-visible { outline: 2px solid var(--ink); }
.control .eye .ph-eye-slash, .control .eye.is-on .ph-eye { display: none; } .control .eye.is-on .ph-eye-slash { display: inline; }
.field.has-error input { border-color: var(--rose); box-shadow: 0 0 0 4px rgba(194,65,94,.12); }
.field-error { color: var(--rose); font-size: var(--t-sm); font-weight: 500; }

/* ---------- buttons ---------- */
.btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 56px; border-radius: var(--r-pill); background: var(--ink); color: var(--paper); font: 600 var(--t-md)/1 var(--font-body); letter-spacing: .01em; overflow: hidden; transition: transform .5s var(--ease), box-shadow .5s var(--ease); box-shadow: 0 14px 28px -16px rgba(36,33,29,.7); }
.btn::before { content: ""; position: absolute; inset: -1px; background: radial-gradient(120px 60px at var(--mx, 50%) 120%, rgba(255,190,152,.55), transparent 70%); opacity: 0; transition: opacity .4s; }
.btn:hover::before { opacity: 1; }
.btn:active { transform: scale(.975); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--ink); }
.btn i { font-size: 18px; transition: transform .5s var(--ease); }
.btn:hover i { transform: translateX(3px); }
.btn .spinner { width: 40px; height: 10px; display: none; }
.dots { display: flex; gap: 6px; justify-content: center; align-items: center; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--paper); animation: think 1.1s ease-in-out infinite; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes think { 0%, 100% { transform: translateY(0); opacity: .4; } 40% { transform: translateY(-4px); opacity: 1; } }
.btn-ghost { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--card); font-weight: 600; font-size: var(--t-sm); transition: border-color .3s, transform .4s var(--ease); }
.btn-ghost:hover { border-color: var(--line-2); }
.btn-ghost:active { transform: scale(.97); }
.btn-ghost:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.btn-ghost i { font-size: 19px; }
.socials { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.or { display: flex; align-items: center; gap: 12px; margin: 18px 0; font: italic 400 15px/1 var(--font-display); color: var(--ink-3); }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.foot { text-align: center; color: var(--ink-2); font-size: var(--t-sm); padding: 18px 0 8px; }

/* ---------- checkbox ---------- */
.check { display: flex; gap: 12px; align-items: flex-start; font-size: var(--t-sm); color: var(--ink-2); cursor: pointer; line-height: 1.45; }
.check input { appearance: none; flex: none; width: 22px; height: 22px; margin: 0; border-radius: 7px; border: 1.5px solid var(--line-2); background: var(--card); display: grid; place-items: center; cursor: pointer; transition: .35s var(--ease); }
.check input::after { content: ""; width: 10px; height: 5px; border: solid var(--paper); border-width: 0 0 2px 2px; rotate: -45deg; translate: 0 -1px; scale: 0; transition: scale .35s var(--ease); }
.check input:checked { background: var(--ink); border-color: var(--ink); }
.check input:checked::after { scale: 1; }
.check input:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.check a { color: var(--ink); font-weight: 600; }
.field.has-error .check input { border-color: var(--rose); }

/* ---------- strength: four warm lights ---------- */
.meter { display: flex; align-items: center; gap: 8px; margin: -2px 0 16px; }
.meter i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); transition: background .5s var(--ease), transform .5s var(--ease), box-shadow .5s; }
.meter[data-level="1"] i:nth-child(-n+1), .meter[data-level="2"] i:nth-child(-n+2), .meter[data-level="3"] i:nth-child(-n+3), .meter[data-level="4"] i:nth-child(-n+4) { transform: scale(1.15); }
.meter i:nth-child(1) { --c: var(--blush); } .meter i:nth-child(2) { --c: var(--apricot); } .meter i:nth-child(3) { --c: var(--butter); } .meter i:nth-child(4) { --c: #A9D8B8; }
.meter[data-level="1"] i:nth-child(-n+1), .meter[data-level="2"] i:nth-child(-n+2), .meter[data-level="3"] i:nth-child(-n+3), .meter[data-level="4"] i:nth-child(-n+4) { background: var(--c); box-shadow: 0 0 10px var(--c); }
.meter-label { margin-left: 6px; font: italic 400 15px/1 var(--font-display); color: var(--ink-2); }

/* ---------- layout per screen ---------- */
.anchor { pointer-events: none; }
.si-hero { position: relative; height: 290px; }
.si-hero .anchor { position: absolute; right: 22px; top: 6px; width: 212px; height: 212px; }
.si-hero .whisper { position: absolute; left: 26px; top: 44px; max-width: 120px; font: italic 400 15px/1.35 var(--font-display); color: var(--ink-2); }
.si-hero .whisper span { display: block; transition: opacity .5s var(--ease), transform .5s var(--ease); }
.si-copy { position: absolute; left: 26px; bottom: 0; right: 26px; }
.form { padding: 22px 26px 0; }

.su-head { position: relative; padding: 8px 26px 22px; }
.su-head .anchor { position: absolute; right: 22px; top: -40px; width: 96px; height: 96px; }
.su-head .display { max-width: 270px; font-size: 36px; min-height: 2.04em; }
.su-head .display .name { color: #B4693F; font-style: italic; }

.fp-art { position: relative; height: 220px; }
.fp-art .anchor { position: absolute; left: 50%; top: 14px; width: 170px; height: 170px; translate: -50% 0; }
.sent-chip { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; padding: 8px 14px; border-radius: var(--r-pill); background: var(--card); border: 1px solid var(--line); font-weight: 600; color: var(--ink); }
.resend { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 48px; margin-top: 10px; font-weight: 600; color: var(--ink); border-radius: var(--r-pill); font-size: var(--t-sm); }
.resend:disabled { color: var(--ink-2); cursor: default; }
.resend:focus-visible { outline: 2px solid var(--ink); }
.resend .ring { width: 20px; height: 20px; border-radius: 50%; background: conic-gradient(var(--apricot) calc(var(--progress, 0) * 360deg), var(--line) 0); -webkit-mask: radial-gradient(circle, transparent 6px, #000 7px); mask: radial-gradient(circle, transparent 6px, #000 7px); }
.resend:not(.is-waiting) .ring { display: none; }

/* ---------- home ---------- */
.home { padding-bottom: calc(var(--safe-bottom) + 96px); }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font: italic 400 18px/1 var(--font-display); background: var(--card); border: 1px solid var(--line); }
.home-hero { position: relative; height: 262px; }
.home-hero .anchor { position: absolute; left: 50%; top: 22px; width: 150px; height: 150px; translate: -50% 0; }
.home-hero .status { position: absolute; left: 0; right: 0; top: 186px; text-align: center; font: italic 400 15px/1 var(--font-display); color: var(--ink-2); transition: opacity .4s; }
.chips { position: absolute; inset: 0; pointer-events: none; }
.chip { position: absolute; pointer-events: auto; padding: 10px 14px; min-height: 40px; border-radius: var(--r-pill); background: rgba(255,253,250,.85); border: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--ink); box-shadow: 0 10px 24px -16px rgba(36,33,29,.35); backdrop-filter: blur(6px); animation: float 7s ease-in-out infinite; transition: transform .4s var(--ease), border-color .3s; }
.chip:nth-child(1) { left: 18px; top: 42px; animation-delay: -1s; } .chip:nth-child(2) { right: 14px; top: 112px; animation-delay: -3.5s; } .chip:nth-child(3) { left: 30px; top: 150px; animation-delay: -5s; }
.chip:hover { border-color: var(--ink); }
.chip:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
@keyframes float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -7px; } }
.composer { margin: 0 18px; display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 18px; border-radius: 26px; background: var(--card); border: 1px solid var(--line); box-shadow: 0 18px 36px -24px rgba(36,33,29,.4); transition: border-color .3s, box-shadow .4s var(--ease); }
.composer:focus-within { border-color: var(--ink); box-shadow: 0 0 0 4px rgba(255,190,152,.25), 0 18px 36px -24px rgba(36,33,29,.4); }
.composer input { flex: 1; min-width: 0; height: 44px; border: 0; outline: 0; background: transparent; font: 500 var(--t-md)/1 var(--font-body); }
.composer input::placeholder { color: var(--ink-3); }
.composer .mic, .composer .send { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-size: 20px; }
.composer .mic { color: var(--ink-2); } .composer .mic:hover { background: var(--paper-2); }
.composer .send { background: var(--ink); color: var(--paper); transition: transform .4s var(--ease); }
.composer .send:active { transform: scale(.92); }
.composer button:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.sec { display: flex; align-items: baseline; justify-content: space-between; padding: 30px 26px 10px; }
.sec h2 { font: 400 22px/1 var(--font-display); letter-spacing: -.01em; }
.sec a { min-height: 44px; display: inline-flex; align-items: center; font-size: var(--t-sm); }
.threads { padding: 0 26px; }
.thread { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 14px 0; border-top: 1px solid var(--line); cursor: pointer; transition: padding .4s var(--ease); }
.thread:hover { padding-left: 6px; }
.thread h3 { font: 500 18px/1.25 var(--font-display); }
.thread time { font-size: var(--t-xs); color: var(--ink-3); padding-top: 4px; }
.thread p { grid-column: 1 / -1; font-size: var(--t-sm); color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 8px; vertical-align: middle; }
.tabbar { position: absolute; left: 50%; translate: -50% 0; bottom: calc(var(--safe-bottom) - 2px); z-index: 10; display: flex; gap: 4px; padding: 6px; border-radius: var(--r-pill); background: rgba(255,253,250,.88); border: 1px solid var(--line); backdrop-filter: blur(14px); box-shadow: 0 16px 32px -20px rgba(36,33,29,.45); }
.tabbar button { position: relative; display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 16px; border-radius: var(--r-pill); color: var(--ink-2); font-size: 13px; font-weight: 600; transition: background .45s var(--ease), color .3s, padding .45s var(--ease); }
.tabbar button i { font-size: 21px; }
.tabbar button span { display: none; }
.tabbar button[aria-selected="true"] { background: var(--ink); color: var(--paper); padding: 0 18px 0 16px; }
.tabbar button[aria-selected="true"] span { display: inline; }
.tabbar button:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* ---------- transitions ---------- */
.screen.enter { animation: m-in .76s var(--ease) both; }
.screen.leave { animation: m-out .4s ease-in both; }
@keyframes m-in { from { opacity: 0; } }
@keyframes m-out { to { opacity: 0; filter: blur(6px); transform: translateY(-8px); } }
.shake { animation: nope .5s var(--ease); }
@keyframes nope { 20% { transform: translateX(-6px); } 45% { transform: translateX(5px); } 70% { transform: translateX(-2px); } }
.modal{position:absolute;inset:0;background:#24211d33;backdrop-filter:blur(6px);z-index:40;display:grid;align-items:end}.modal[hidden]{display:none}.modal-card{background:var(--paper);border-radius:28px 28px 0 0;padding:28px 26px calc(var(--safe-bottom) + 24px)}.modal-card h2{font:400 29px/1.2 var(--font-display);margin:15px 0}.modal-card p{font-size:14px;line-height:1.6;color:var(--ink-2);margin-bottom:20px}.modal-close{float:right;width:44px;height:44px;font-size:24px}.toast{position:absolute;bottom:120px;left:26px;right:26px;background:var(--ink);color:var(--paper);padding:14px 18px;border-radius:14px;z-index:30;font-size:12px}.toast:empty{display:none}.chip{min-height:44px}.check{min-height:44px;align-items:center}.thread:focus-visible{outline:2px solid var(--ink);outline-offset:2px}.status{padding-inline:18px;line-height:1.4!important}.screen:not(.is-active){pointer-events:none}.top .avatar{width:44px;height:44px}.field .row .link{min-height:28px;display:flex;align-items:center;margin-block:-6px}
.tabbar{position:fixed}
.wordmark{display:inline-flex;align-items:center;gap:7px}.wordmark svg{width:22px;height:22px}.field .row .link{min-height:44px;margin-block:-14px}
