:root {
    color-scheme: dark;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #09090b;
    color: #f4f4f5;
    --accent: #4f46e5;
    --accent-dark: #3730a3;
    --panel: rgba(9, 9, 11, .82);
    --line: rgba(255, 255, 255, .1);
    --muted: #a1a1aa;
}

* { box-sizing: border-box; }
html, body { width: 100%; min-height: 100%; }
body { margin: 0; overflow: hidden; background: #09090b; }
button, textarea { font: inherit; }

.page-background,
.page-shade { position: fixed; inset: 0; }
.page-background {
    background-image: url("/Assets/Hero_image.jpg");
    background-position: center;
    background-size: cover;
    filter: brightness(.28) saturate(.5);
    transform: scale(1.02);
}
.page-shade { background: rgba(24, 24, 27, .5); }

.home-link {
    position: fixed;
    z-index: 20;
    top: max(16px, env(safe-area-inset-top));
    left: max(16px, env(safe-area-inset-left));
    padding: 8px 14px;
    border-radius: 8px;
    background: rgba(0, 0, 0, .9);
    color: white;
    font-size: .875rem;
    font-weight: 500;
    text-decoration: none;
}

.chat-shell {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    max-width: 760px;
    margin: 0 auto;
    padding: max(64px, calc(env(safe-area-inset-top) + 56px)) 16px max(12px, env(safe-area-inset-bottom));
}

.chat-header { text-align: center; margin-bottom: 12px; }
.chat-header h1 {
    margin: 0;
    font-family: "Playfair Display", Georgia, serif;
    font-weight: 600;
    font-size: 1.5rem;
    letter-spacing: .01em;
}
.chat-sub { margin: 4px 0 0; color: var(--muted); font-size: .875rem; }
.chat-sub a { color: #c7d2fe; text-decoration: none; border-bottom: 1px solid rgba(199, 210, 254, .4); }

.thread {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--panel);
    backdrop-filter: blur(6px);
    -webkit-overflow-scrolling: touch;
}

.bubble {
    max-width: 88%;
    margin: 0 0 12px;
    padding: 10px 14px;
    border-radius: 14px;
    line-height: 1.5;
    font-size: 1rem;
}
.bubble p { margin: 2px 0 0; white-space: pre-wrap; }
.bubble .who {
    display: block;
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
}
.bubble-simons { background: rgba(255, 255, 255, .06); margin-right: auto; }
.bubble-user { background: rgba(79, 70, 229, .28); margin-left: auto; }
.bubble.pending p { color: var(--muted); }

.composer {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    margin-top: 10px;
}
.composer textarea {
    flex: 1;
    resize: none;
    min-height: 44px;
    max-height: 160px;
    padding: 11px 14px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(0, 0, 0, .55);
    color: #f4f4f5;
    line-height: 1.4;
}
.composer textarea:focus { outline: none; border-color: rgba(129, 140, 248, .8); }
.composer button {
    height: 44px;
    padding: 0 18px;
    border: 0;
    border-radius: 12px;
    background: var(--accent);
    color: white;
    font-weight: 600;
    cursor: pointer;
}
.composer button:hover { background: var(--accent-dark); }
.composer button:disabled { opacity: .55; cursor: default; }

.status { min-height: 1.2em; margin: 6px 2px 0; color: var(--muted); font-size: .85rem; }
.fine-print { margin: 4px 2px 0; color: #71717a; font-size: .75rem; line-height: 1.4; }
.fine-print a { color: #a5b4fc; text-decoration: none; }

@media (max-width: 480px) {
    .chat-header h1 { font-size: 1.25rem; }
    .bubble { max-width: 94%; font-size: .95rem; }
}
