:root {
    color-scheme: light;
    --ink: #18302f;
    --muted: #627270;
    --paper: #f7f8f4;
    --panel: #ffffff;
    --green: #123c3a;
    --green-2: #1d5d58;
    --mint: #dcece7;
    --coral: #d7664f;
    --line: #dfe6e2;
    --shadow: 0 24px 70px rgba(18, 60, 58, .16);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
    margin: 0;
    color: var(--ink);
    background:
        radial-gradient(circle at 9% 12%, rgba(215, 102, 79, .16), transparent 25rem),
        radial-gradient(circle at 88% 80%, rgba(29, 93, 88, .18), transparent 28rem),
        var(--paper);
}
button, textarea, input, select { font: inherit; }
button { cursor: pointer; }

.app-shell {
    width: min(100% - 2rem, 880px);
    min-height: 100vh;
    margin: 0 auto;
    padding: 1.5rem 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
}
.topbar {
    min-height: 74px;
    padding: .75rem 1.15rem;
    color: white;
    background: var(--green);
    border-radius: 22px 22px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: .75rem; color: inherit; text-decoration: none; }
.brand-mark, .avatar {
    width: 43px; height: 43px; border-radius: 50%; display: grid; place-items: center;
    font-family: Georgia, serif; font-size: 1.45rem; font-weight: 700;
}
.brand-mark { color: var(--green); background: #f7c9b7; }
.brand strong, .brand small { display: block; }
.brand strong { font-family: Georgia, serif; font-size: 1.35rem; letter-spacing: .01em; }
.brand small { margin-top: .08rem; color: #c8d9d5; font-size: .77rem; }
.availability { font-size: .82rem; color: #d9e7e4; }
.availability i { display: inline-block; width: 8px; height: 8px; margin-right: .35rem; border-radius: 50%; background: #79d8ad; box-shadow: 0 0 0 4px rgba(121,216,173,.12); }

.chat-panel {
    min-height: calc(100vh - 3rem - 74px);
    background: rgba(255,255,255,.94);
    border: 1px solid rgba(18, 60, 58, .08);
    border-top: 0;
    border-radius: 0 0 22px 22px;
    box-shadow: var(--shadow);
    overflow: hidden;
    display: grid;
    grid-template-rows: minmax(300px, 1fr) auto auto;
}
.messages { overflow-y: auto; padding: 1.6rem; scroll-behavior: smooth; }
.message { display: flex; align-items: flex-end; gap: .7rem; margin-bottom: 1.1rem; }
.message.user { justify-content: flex-end; }
.avatar { flex: 0 0 38px; width: 38px; height: 38px; color: white; background: var(--green-2); font-size: 1.08rem; }
.bubble { max-width: min(78%, 620px); padding: .9rem 1.05rem; background: #eff4f1; border-radius: 18px 18px 18px 5px; line-height: 1.52; }
.user .bubble { color: white; background: var(--green-2); border-radius: 18px 18px 5px 18px; }
.bubble p { margin: 0; white-space: pre-wrap; }
.bubble p + p { margin-top: .6rem; }
.bubble .note { color: var(--muted); font-size: .88rem; }
.user .bubble .note { color: #dbe9e6; }
.typing .bubble { display: flex; gap: .3rem; padding: 1rem 1.2rem; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: #7b918d; animation: pulse 1.15s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes pulse { 0%, 60%, 100% { opacity: .35; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-4px); } }

.suggestions { display: flex; flex-wrap: wrap; gap: .55rem; margin: .15rem 0 1.4rem 3rem; }
.suggestions button { padding: .55rem .8rem; color: var(--green-2); background: white; border: 1px solid #b8cec8; border-radius: 999px; font-size: .86rem; }
.suggestions button:hover { background: var(--mint); }
.results { margin: -.35rem 0 1.25rem 3rem; display: grid; gap: .65rem; }
.result-card { max-width: 620px; padding: .9rem 1rem; border: 1px solid var(--line); border-left: 4px solid var(--coral); border-radius: 12px; background: white; }
.result-card h3 { margin: 0 0 .4rem; font-family: Georgia, serif; font-size: 1.05rem; }
.result-card p { margin: .17rem 0; color: var(--muted); font-size: .88rem; }
.result-card a { color: var(--green-2); }

.composer { margin: 0 1.15rem; padding: .65rem; border: 1px solid #cbd8d4; border-radius: 16px; background: white; display: flex; align-items: flex-end; gap: .55rem; box-shadow: 0 7px 22px rgba(18,60,58,.08); }
.composer:focus-within { border-color: var(--green-2); box-shadow: 0 0 0 3px rgba(29,93,88,.1); }
.composer textarea { flex: 1; min-height: 42px; max-height: 130px; padding: .62rem .7rem; resize: none; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 1rem; line-height: 1.4; }
.composer button { flex: 0 0 42px; width: 42px; height: 42px; border: 0; border-radius: 12px; color: white; background: var(--coral); display: grid; place-items: center; }
.composer button:hover { background: #bd4f3a; }
.composer button:disabled { opacity: .5; cursor: wait; }
.composer svg { width: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.privacy { margin: .65rem 1.25rem 1rem; color: var(--muted); text-align: center; font-size: .76rem; line-height: 1.4; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 640px) {
    .app-shell { width: 100%; padding: 0; }
    .topbar, .chat-panel { border-radius: 0; }
    .chat-panel { min-height: calc(100vh - 74px); box-shadow: none; }
    .messages { padding: 1rem; }
    .bubble { max-width: 86%; }
    .suggestions, .results { margin-left: 0; }
    .availability { font-size: 0; }
    .availability i { margin: 0; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; }
}

