:root {
    color-scheme: light;
    --ink: #2e1f29;
    --muted: #765f6c;
    --paper: #fffaf6;
    --card: rgba(255, 255, 255, 0.88);
    --wine: #74304f;
    --wine-dark: #4e1e37;
    --peach: #ef9c78;
    --rose: #f6d8d3;
    --sage: #467260;
    --line: #eadbd6;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

.product-shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); grid-template-rows: 76px 1fr; min-height: 100dvh; }
.app-header { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0 2rem; border-bottom: 1px solid var(--line); background: var(--paper); position: sticky; top: 0; z-index: 5; }
.brand { display: inline-flex; align-items: center; gap: .8rem; color: var(--wine-dark); text-decoration: none; font-weight: 800; }
.brand-mark { display: grid; place-items: center; width: 2.8rem; height: 2.8rem; border-radius: 50%; background: var(--wine); color: white; font-size: 1.9rem; }
.desktop-tag { color: var(--muted); font-size: .85rem; }
.desktop-sidebar { border-right: 1px solid var(--line); padding: 2rem 1rem; background: rgba(255,255,255,.4); }
.app-nav { display: grid; gap: .5rem; }
.app-nav a { display: flex; align-items: center; gap: .8rem; border-radius: .8rem; padding: .9rem; color: var(--muted); text-decoration: none; font-weight: 650; }
.app-nav a span { font-size: .7rem; width: 1.2rem; opacity: .75; }
.app-nav a.active { background: var(--rose); color: var(--wine-dark); }
.app-nav a:hover { background: #f7e8e3; }
.nav-divider { height: 1px; background: var(--line); margin: 1rem .8rem; }
.sidebar-note { padding: 2rem .8rem; line-height: 1.6; color: var(--muted); font-family: Georgia,serif; font-size: 1.2rem; }
.product-main { min-width: 0; }
.product-footer { display: flex; flex-wrap: wrap; justify-content: center; gap: .75rem 1.5rem; padding: 1.25rem; color: var(--muted); font-size: .85rem; }
.product-footer a { color: var(--wine); padding: .5rem; }
.menu-toggle { display: none; }
.mobile-menu { border: 0; border-radius: 0 1.5rem 1.5rem 0; width: min(320px, 90vw); max-width: 90vw; height: 100dvh; max-height: 100dvh; margin: 0; padding: 1.5rem; background: var(--paper); color: var(--ink); }
.mobile-menu::backdrop { background: rgba(46,31,41,.45); }
.menu-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; }
.page-content { max-width: 1000px; margin: auto; padding: clamp(1.25rem,4vw,3rem); }
.page-content h1 { font-family: Georgia,serif; font-size: clamp(2rem,4vw,3.2rem); font-weight: 500; line-height: 1.12; margin: .6rem 0 1rem; }
h1[tabindex="-1"]:focus { outline: none; }
.page-intro { font-size: 1.05rem; color: var(--muted); line-height: 1.6; margin-bottom: 2rem; }
.home-page { max-width: 820px; }
.narrow-page { max-width: 680px; }
.profile-page { max-width: 1200px; }
.profile-grid, .profile-column { display: grid; gap: 1.25rem; align-content: start; min-width: 0; }
.profile-column > .card { margin: 0; min-width: 0; overflow-wrap: anywhere; }
@media (min-width: 1100px) {
    .profile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
}
.home-room-card { text-align: center; padding: clamp(2rem,5vw,3.5rem); margin-top: 1.5rem; }
.home-room-card h2 { margin: 1rem 0 .8rem; }
.home-room-card p { max-width: 32rem; margin: 1rem auto; line-height: 1.6; color: var(--muted); }
a.button { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.home-footnote { text-align: center; color: var(--muted); font-size: .85rem; padding: 1.5rem; line-height: 1.6; }
.connection-art { display: flex; align-items: center; justify-content: center; margin: 1rem; }
.connection-art span { width: 3.4rem; height: 3.4rem; border-radius: 50%; background: var(--wine); border: 5px solid var(--paper); box-shadow: 0 0 0 1px var(--rose); }
.connection-art span:last-child { background: var(--peach); }
.connection-art i { height: 1px; width: 3rem; background: var(--wine); }
.paired-avatars { display: flex; justify-content: center; gap: .5rem; margin: 1rem; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.subtle-link, .text-button { color: var(--wine); font-size: .85rem; }
.text-button { background: none; border: none; text-decoration: underline; cursor: pointer; padding: 1rem; min-height: 44px; }
.profile-editor h2 { margin-top: 1rem; }
.account-card { margin-top: 1.5rem; }
.invite-card { display: grid; gap: 1rem; margin-top: 1rem; }
.invite-card p { margin: 0; line-height: 1.5; }
.room-controls { margin-top: 1.5rem; text-align: right; }
.room-controls .card { text-align: left; }
.card.chat-card { padding: 0; overflow: hidden; }
.chat-heading { display: flex; align-items: center; gap: 1rem; padding: 1.25rem; border-bottom: 1px solid var(--line); }
.chat-heading .button { margin-left: auto; font-size: .8rem; }
.chat-heading .hint { margin: .2rem 0 0; }
.chat-thread { height: min(52dvh, 580px); min-height: 260px; overflow-y: auto; overscroll-behavior: contain; padding: 1.25rem; background: #fffaf6; }
.empty-conversation { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.empty-conversation > span { font: 3rem Georgia,serif; color: var(--wine); }
.message-list { display: flex; flex-direction: column; gap: .8rem; list-style: none; padding: 0; margin: 0; }
.message { align-self: flex-start; max-width: 85%; padding: .85rem 1rem; border-radius: 1rem 1rem 1rem .2rem; background: white; border: 1px solid var(--line); overflow-wrap: anywhere; }
.message--mine { align-self: flex-end; background: #f7e6e7; border-radius: 1rem 1rem .2rem 1rem; }
.message--pending { opacity: .75; border-style: dashed; }
.message p { margin: .3rem 0; white-space: pre-wrap; line-height: 1.5; }
.message-author { font-size: .72rem; font-weight: 800; color: var(--wine); }
.message small { font-size: .7rem; color: var(--muted); }
.message-composer { margin: 0; padding: 1.2rem; border-top: 1px solid var(--line); }
textarea { width: 100%; resize: vertical; min-height: 60px; border: 1px solid #d8c4cc; border-radius: .8rem; padding: .8rem; color: var(--ink); background: white; font: inherit; }
textarea:focus-visible { outline: 2px solid var(--wine); outline-offset: 2px; }
.composer-actions { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.composer-actions small { color: var(--muted); font-size: .75rem; }
.composer-actions .button { flex-shrink: 0; white-space: nowrap; }
.retry-message { margin-left: .5rem; border: none; text-decoration: underline; color: var(--wine); background: none; cursor: pointer; min-height: 32px; }
.history-button { display: block; margin: .75rem auto; }
@media (max-width: 800px) {
    .product-shell { display: block; }
    .app-header { height: 56px; min-height: 56px; padding: .3rem .75rem; }
    .desktop-sidebar, .desktop-tag { display: none; }
    .menu-toggle { display: inline-flex; }
    .brand { font-size: .9rem; gap: .6rem; }
    .brand-mark { width: 2rem; height: 2rem; font-size: 1.5rem; }
    .menu-toggle { min-height: 44px; padding: .5rem .75rem; }
    .chat-heading { gap: .6rem; padding: .9rem; flex-wrap: wrap; }
    .chat-heading h2 { font-size: 1.3rem; }
    .chat-heading .button { min-height: 38px; padding: .4rem .6rem; }
    .page-heading { align-items: flex-start; }
    .page-heading .subtle-link { margin-top: 1.3rem; }
}

html { background: var(--paper); }

body {
    margin: 0;
    min-width: 320px;
    color: var(--ink);
    background:
        radial-gradient(circle at 12% 10%, rgba(246, 216, 211, .8), transparent 26rem),
        radial-gradient(circle at 88% 22%, rgba(239, 156, 120, .16), transparent 22rem),
        var(--paper);
}

button, input { font: inherit; }
button { touch-action: manipulation; }
details > summary { min-height: 44px; padding: .65rem .25rem; cursor: pointer; font-weight: 700; }
details > summary:focus-visible { outline: 2px solid var(--wine); outline-offset: 3px; }
.activity-panel { margin-bottom: 1.25rem; }
.activity-title { display:flex; justify-content:space-between; align-items:center; gap:1rem; flex-wrap:wrap; }
.activity-title h2, .activity-title h3 { margin:.3rem 0; }
.activity-tag { font-size:.8rem; border-radius:999px; padding:.4rem .7rem; background:var(--rose); }
.activity-proposal, .activity-pending { padding:1rem; margin:1rem 0; border:1px solid #d8bbc7; border-radius:1rem; }
.activity-pending { background:#fff5e7; }
.activity-proposal select { display:block; width:100%; min-height:44px; padding:.6rem; margin:.4rem 0 1rem; border:1px solid #d8bbc7; border-radius:.6rem; background:white; color:var(--ink); font:inherit; }
.activity-answer-text { white-space:pre-wrap; overflow-wrap:anywhere; }
.progress-panel { margin-bottom:1rem; }
.progress-total { font-size:1.1rem; margin:.7rem 0; }
.progress-total strong { font-size:2rem; color:var(--wine); }
.progress-calendar-details, .progress-settings { margin-top:1rem; padding-top:.8rem; border-top:1px solid var(--line); }
.progress-settings input { margin:.5rem 0; }
.progress-panel p, .progress-milestones li { overflow-wrap:anywhere; }
.progress-month-controls { display:flex; gap:.5rem; align-items:center; justify-content:space-between; flex-wrap:wrap; margin-top:1rem; }
.progress-month-controls h3 { font-size:1rem; }
.progress-weekdays, .progress-calendar { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:.25rem; text-align:center; }
.progress-weekdays { margin-top:1rem; font-size:.75rem; }
.progress-calendar { list-style:none; margin:.4rem 0; padding:0; }
.calendar-day { min-height:3rem; padding:.35rem .1rem; border:1px solid transparent; border-radius:.6rem; font-size:.85rem; }
.calendar-day time, .calendar-day span { display:block; }
.calendar-day--earned { background:var(--rose); color:var(--wine-dark); font-weight:700; }
.calendar-day--today { border-color:var(--wine); }
.progress-milestones { padding-left:1.25rem; line-height:1.6; }
.prediction-results p { margin:.5rem 0; line-height:1.5; }
.prediction-results .prediction-guess { margin-top:1rem; }
.activity-ranking { list-style:none; padding:0; display:grid; gap:.75rem; }
.activity-ranking > li { border:1px solid #d8bbc7; border-radius:.8rem; padding:.8rem; min-width:0; }
.activity-ranking > li:focus { outline:2px solid var(--wine); outline-offset:3px; }
.ranking-option { display:block; overflow-wrap:anywhere; margin-bottom:.6rem; }
.ranking-buttons { display:flex; flex-wrap:wrap; gap:.5rem; }
.ranking-buttons .button { min-height:44px; padding:.5rem .8rem; }
.activity-ranking-result { margin:0; padding-left:1.25rem; white-space:normal; }
.activity-ranking-result li { margin:.35rem 0; overflow-wrap:anywhere; }
.activity-question { font-size:1.25rem; line-height:1.45; margin:1.25rem 0; }
.activity-choices { padding:0; border:0; margin:1rem 0; display:grid; gap:.7rem; min-width:0; }
.activity-choices legend { font-weight:700; margin-bottom:.6rem; }
.activity-choice { display:flex; align-items:center; gap:.8rem; padding:1rem; border:1px solid #d8bbc7; border-radius:1rem; cursor:pointer; min-height:52px; overflow-wrap:anywhere; }
.activity-choice input { width:auto; margin:0; flex:0 0 auto; accent-color:var(--wine); }
.activity-choice--selected { border:2px solid var(--wine); background:var(--rose); }
.activity-choice:focus-within { outline:2px solid var(--wine); outline-offset:3px; }
.activity-results { display:grid; grid-template-columns:repeat(auto-fit,minmax(125px,1fr)); gap:1rem; }
.activity-results div { background:var(--rose); padding:1rem; border-radius:1rem; }
.activity-results dt { font-weight:700; }.activity-results dd { margin:.5rem 0 0; overflow-wrap:anywhere; }
.activity-history-item { padding:1rem 0; border-bottom:1px solid #eadce2; }
.activity-recent { margin-top:1rem; border-top:1px solid #eadce2; padding-top:.5rem; }

.hero {
    min-height: 19rem;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 2rem;
    padding: clamp(2rem, 6vw, 5rem) max(1.25rem, calc((100vw - 72rem) / 2));
    color: white;
    overflow: hidden;
    background: linear-gradient(125deg, var(--wine-dark), var(--wine) 62%, #a94d66);
}

.hero__content { max-width: 46rem; }
.hero h1 { margin: .35rem 0 .8rem; font-family: Georgia, serif; font-size: clamp(2.5rem, 7vw, 5.5rem); line-height: .96; font-weight: 500; }
.hero p { max-width: 42rem; margin: 0; color: #f7e9ee; font-size: 1.05rem; line-height: 1.65; }
.hero__mark { width: clamp(7rem, 17vw, 13rem); aspect-ratio: 1; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.27); border-radius: 50%; background: rgba(255,255,255,.07); }
.hero__mark span { font-family: Georgia, serif; font-size: clamp(4rem, 11vw, 9rem); transform: translateY(-.08em); }

.eyebrow, .step-label { text-transform: uppercase; letter-spacing: .18em; font-weight: 800; font-size: .72rem; }
.content-wrap { width: min(72rem, calc(100% - 2rem)); margin: clamp(1.5rem, 4vw, 3.5rem) auto; }

.card, .profile-strip {
    border: 1px solid var(--line);
    border-radius: 1.5rem;
    background: var(--card);
    box-shadow: 0 1rem 3rem rgba(78, 30, 55, .07);
    backdrop-filter: blur(12px);
}

.card { padding: clamp(1.25rem, 3vw, 2rem); }
.card h2, .profile-strip h2 { margin: 0; font-family: Georgia, serif; font-size: 1.6rem; font-weight: 500; }
.card--center { max-width: 34rem; margin: 6rem auto; text-align: center; }
.auth-card { max-width: 32rem; margin: 1rem auto 5rem; }
.auth-card h2 { margin-top: .45rem; font-size: 2rem; }
.step-label, .number { color: var(--wine); }
.muted, .hint, .card-heading p { color: var(--muted); line-height: 1.55; }
.hint { margin: 1rem 0 0; font-size: .86rem; }

form { display: grid; gap: .75rem; margin-top: 1.4rem; }
.code-form { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
label { font-weight: 750; font-size: .9rem; }
input[type="email"], input[type="text"] {
    width: 100%; min-height: 3rem; padding: .7rem .9rem; color: var(--ink); background: #fff;
    border: 1px solid #d8c4cc; border-radius: .7rem; outline: none;
}
input:focus { border-color: var(--wine); box-shadow: 0 0 0 .2rem rgba(116, 48, 79, .13); }
.code-input { letter-spacing: .35em; font-size: 1.3rem; text-align: center; }
.checkbox-row { display: flex; gap: .7rem; align-items: flex-start; margin: .3rem 0; font-weight: 500; line-height: 1.4; }
.checkbox-row input { width: 1.15rem; height: 1.15rem; accent-color: var(--wine); }
.notification-settings fieldset { min-width: 0; border: 1px solid var(--line); border-radius: .75rem; padding: .8rem; }
.notification-settings legend { max-width: 100%; padding: 0 .3rem; }
.notification-settings fieldset > label:not(.checkbox-row) { display: block; margin: .85rem 0 .4rem; }
.notification-settings input[type="time"] { display: block; width: 100%; min-width: 0; max-width: 100%; min-height: 3rem; padding: .7rem; border: 1px solid #d8c4cc; border-radius: .7rem; background: white; font: inherit; }
.notification-settings .notice { overflow-wrap: anywhere; }
.notification-settings fieldset > button { margin-top: 1rem; }
.session-list { list-style: none; padding: 0; margin: 1rem 0; }
.session-row { display: grid; gap: .45rem; border-top: 1px solid var(--line); padding: 1rem 0; overflow-wrap: anywhere; }
.session-row > span { color: var(--muted); font-size: .85rem; }
.session-row button { justify-self: start; }
.session-management p { overflow-wrap: anywhere; }
.session-confirm { margin: 1rem 0; padding: .6rem; border: 1px solid var(--wine); border-radius: .75rem; }

.button { min-height: 2.85rem; padding: .65rem 1rem; border: 0; border-radius: 999px; font-weight: 800; cursor: pointer; transition: transform .15s ease, filter .15s ease; }
.button:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.05); }
.button:focus-visible { outline: .2rem solid var(--peach); outline-offset: .15rem; }
.button:disabled { opacity: .55; cursor: wait; }
.button--primary { color: white; background: var(--wine); }
.button--accent { color: var(--wine-dark); background: var(--peach); }
.button--secondary { color: var(--wine); background: var(--rose); }
.button--quiet { color: var(--wine); background: transparent; border: 1px solid #d8bbc7; }
.button-row { display: flex; gap: .65rem; flex-wrap: wrap; }

.notice { max-width: 50rem; margin: 0 auto 1rem; padding: .9rem 1.1rem; border-radius: .85rem; font-weight: 650; }
.notice--error { color: #712b2b; background: #ffe3df; border: 1px solid #f3b9b1; }
.notice--success { color: #245443; background: #e0f3ea; border: 1px solid #aed8c7; }

.profile-strip { display: grid; grid-template-columns: auto 1fr auto; gap: 1rem; align-items: center; padding: 1.2rem 1.4rem; margin-bottom: 1.25rem; }
.profile-strip p { margin: .25rem 0 0; color: var(--muted); }
.avatar { width: 3.5rem; height: 3.5rem; display: grid; place-items: center; color: white; background: var(--wine); border-radius: 50%; font-family: Georgia, serif; font-size: 1.35rem; }
.dashboard-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.card-heading { display: flex; gap: .9rem; align-items: flex-start; margin-bottom: 1.25rem; }
.card-heading p { margin: .2rem 0 0; font-size: .87rem; }
.number { min-width: 2rem; padding-top: .25rem; font-size: .75rem; font-weight: 900; letter-spacing: .08em; }
.status-row { display: flex; justify-content: space-between; gap: 1rem; margin: 1rem 0; padding: .85rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.status-row strong { color: var(--sage); }
.result { color: var(--sage); font-weight: 750; }

.call-card { margin-top: 1.25rem; }
.call-controls { display: grid; grid-template-columns: minmax(12rem, 1fr) repeat(3, auto); gap: .75rem; align-items: end; }
.call-controls label { display: block; margin-bottom: .45rem; }
.video-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-top: 1.25rem; }
figure { margin: 0; }
video { width: 100%; min-height: 13rem; display: block; object-fit: cover; border-radius: 1rem; background: #22151d; }
figcaption { margin-top: .4rem; color: var(--muted); font-size: .85rem; }

.pulse-heart { color: var(--wine); font: 4rem Georgia, serif; animation: pulse 1.5s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.08); opacity: .7; } }

footer { width: min(72rem, calc(100% - 2rem)); margin: 2rem auto; padding-top: 1.5rem; display: flex; justify-content: space-between; gap: 1rem; color: var(--muted); border-top: 1px solid var(--line); font-size: .82rem; }

#blazor-error-ui { display: none; position: fixed; inset: auto 0 0; z-index: 1000; padding: .8rem 1rem; color: white; background: #7a2525; }
.loading-progress { position: absolute; display: block; width: 7rem; height: 7rem; inset: 25vh 0 auto; margin: auto; }
.loading-progress circle { fill: none; stroke: var(--rose); stroke-width: .6rem; transform-origin: 50% 50%; transform: rotate(-90deg); }
.loading-progress circle:last-child { stroke: var(--wine); stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * .8), 500%; }
.loading-progress-text { position: absolute; inset: calc(25vh + 2.8rem) 0 auto; text-align: center; font-weight: 800; }
.loading-progress-text::after { content: var(--blazor-load-percentage-text, "Loading"); }

@media (max-width: 760px) {
    .hero { min-height: auto; grid-template-columns: 1fr; }
    .hero__mark { display: none; }
    .dashboard-grid, .video-grid { grid-template-columns: 1fr; }
    .call-controls { grid-template-columns: 1fr; align-items: stretch; }
    .profile-strip { grid-template-columns: auto 1fr; }
    .profile-strip__action { grid-column: 1 / -1; }
    footer { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
.report-panel { min-width: 0; overflow-wrap: anywhere; }
.report-panel fieldset { min-width: 0; margin: 1rem 0; }
.report-panel textarea, .report-panel select { width: 100%; max-width: 100%; box-sizing: border-box; }
.report-panel .report-message { display: flex; align-items: flex-start; gap: .6rem; margin: .75rem 0; }
.report-message input { flex: 0 0 auto; width: auto; margin-top: .3rem; }
