/* Lumen look: Mindset Mastery Talk palette (bronze / brown / gold), Inter self-hosted. */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 800; font-display: swap; src: url("fonts/inter-latin-var.woff2") format("woff2"); }
:root {
    --font-ui: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --page: #f3eadc; --bar: #3d2a16; --bar-text: #f5ead8; --ink: #3d2e16; --muted: #8a7048;
    --gold: #785c30; --gold-light: #f5ead8; --line: #d9cfc2; --mine: #e6d2a8; --theirs: #fffaf3;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--page); color: var(--ink); font: 16px/1.35 var(--font-ui); }
button, select, textarea, input { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--font-ui); font-weight: 700; letter-spacing: .01em; }
button { background: var(--gold); color: var(--gold-light); border: 0; border-radius: 999px; padding: .55rem 1rem; font-weight: 600; }
button:disabled { opacity: .5; }
.ghost { background: transparent; color: var(--bar-text); border: 1px solid rgba(245, 234, 216, .35); border-radius: 999px; padding: .4rem .75rem; text-decoration: none; font-weight: 600; font-size: .9rem; white-space: nowrap; }
.face { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: var(--theirs); }
.face.sm { width: 28px; height: 28px; }

.app { display: flex; flex-direction: column; height: 100dvh; max-width: 760px; margin: 0 auto; position: relative; background: var(--page); }
.app::before { content: ""; position: absolute; inset: 0; background: url("img/mark-white-transparent.png") repeat; background-size: 168px 168px; opacity: .07; pointer-events: none; }
.bar { position: relative; z-index: 1; display: flex; gap: .5rem; align-items: center; padding: .55rem .8rem; padding-top: max(.55rem, env(safe-area-inset-top));
       background: var(--bar) url("img/bg-bronze-field.jpg") center / cover; color: var(--bar-text); border-bottom: 1px solid rgba(245, 234, 216, .18); }
.bar select { flex: 1; min-width: 0; background: rgba(245, 234, 216, .12); color: var(--bar-text); border: 1px solid rgba(245, 234, 216, .35); border-radius: 999px; padding: .4rem .7rem; font-weight: 600; }
.bar select option { color: var(--ink); }
/* column-reverse keeps the log pinned to the newest message without any JS. */
.log { position: relative; z-index: 1; flex: 1; overflow-y: auto; display: flex; flex-direction: column-reverse; }
.inner { display: flex; flex-direction: column; gap: .35rem; padding: 1rem 1.1rem .5rem; }
.row { display: flex; align-items: flex-end; gap: .4rem; }
.row.mine { justify-content: flex-end; }
.msg { max-width: min(78%, 36rem); padding: .45rem .7rem; border-radius: .7rem; white-space: pre-wrap; overflow-wrap: anywhere; box-shadow: 0 1px 2px rgba(92, 69, 34, .08); }
.msg.user { background: var(--mine); border-bottom-right-radius: .2rem; }
.msg.assistant { background: var(--theirs); border-bottom-left-radius: .2rem; }
.msg.assistant:empty::after { content: "…"; color: var(--muted); }
.msg.error, .error { color: #9b2c1f; }
.hint { color: var(--muted); text-align: center; margin-top: 30vh; }
.composer { position: relative; z-index: 2; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .4rem; align-items: center;
            padding: .65rem .8rem calc(.85rem + env(safe-area-inset-bottom, 0px)); background: rgba(245, 234, 216, .96); border-top: 1px solid var(--line); }
.composer textarea { resize: none; min-height: 44px; max-height: 120px; border: 1px solid var(--line); border-radius: 1.2rem; padding: .55rem .85rem; background: var(--theirs); color: var(--ink); font-size: 16px; line-height: 1.35; }
.composer textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 .15rem rgba(120, 92, 48, .2); }
.composer button { height: 44px; }

.login { display: flex; min-height: 100dvh; align-items: flex-start; justify-content: center; }
.card { width: min(360px, 92vw); margin-top: 16vh; padding: 1.5rem; background: var(--theirs); border: 1px solid var(--line); border-radius: 1rem; display: flex; flex-direction: column; gap: .8rem; box-shadow: 0 1px 2px rgba(92, 69, 34, .08); }
.card h1 { margin: 0 0 .4rem; color: var(--gold); display: flex; align-items: center; gap: .6rem; font-size: 1.5rem; }
.card label { display: flex; flex-direction: column; gap: .25rem; color: var(--muted); font-size: .9rem; }
.card input { background: #fff; border: 1px solid var(--line); border-radius: .7rem; padding: .6rem; font-size: 16px; color: var(--ink); }
.card input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 .15rem rgba(120, 92, 48, .2); }
