:root {
    --paper: #f3f0e8;
    --paper-deep: #e8e2d5;
    --surface: #fffdf8;
    --ink: #28362f;
    --ink-soft: #677269;
    --sage: #738d7d;
    --sage-deep: #4d6b5a;
    --sage-pale: #dfe8df;
    --clay: #b8755b;
    --clay-pale: #f5e4dc;
    --line: #dcd8cd;
    --shadow: 0 20px 60px rgba(45, 55, 48, .08);
    --shadow-small: 0 8px 24px rgba(45, 55, 48, .07);
    --radius-xl: 28px;
    --radius-lg: 20px;
    --radius-md: 14px;
    --serif: "Metric", "Pocket Metric", "Helvetica Neue", Arial, sans-serif;
    --sans: "Metric", "Pocket Metric", "Helvetica Neue", Arial, sans-serif;
}

/* Mobile participant cleanup: fewer frames, larger work areas and visible tools. */
.nav-icon { display: none; }

.notebook-sketch-undo {
    display: none;
    place-items: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 50%;
    color: var(--ink-soft);
    background: rgba(255,253,248,.9);
    cursor: pointer;
}
.notebook-sketch-undo svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.notebook-sketch-undo:disabled { cursor: default; opacity: .34; }

@media (max-width: 760px) {
    body[data-role="member"] .notebook-sketch-undo { display: grid; }
    body[data-role="member"] .journey-desktop-intro,
    body[data-role="member"] #two-week-card > .section-subheading,
    body[data-role="member"] #checkin-reflections,
    body[data-role="member"] #checkin-plan-options,
    body[data-role="member"] #checkin-plan-custom,
    body[data-role="member"] #checkin-prompts,
    body[data-role="member"] #checkin-note,
    body[data-role="member"] #two-week-card > .checkin-note-label,
    body[data-role="member"] #two-week-card > .checkin-actions {
        display: none !important;
    }
    body[data-role="member"] .topbar {
        min-height: 64px;
        padding: 0 14px;
    }
    body[data-role="member"] .brand,
    body[data-role="member"] .identity { gap: 8px; }
    body[data-role="member"] .brand-mark.small {
        width: 48px;
        height: 48px;
        flex-basis: 48px;
    }
    body[data-role="member"] .brand > div:last-child { height: 48px; }
    body[data-role="member"] .brand strong {
        font-size: 1.55rem;
        transform: translateY(.1em);
    }

    body[data-role="member"] .member-nav { min-height: 68px; }
    body[data-role="member"] .nav-button {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        min-height: 68px;
        font-size: .56rem;
        line-height: 1;
    }
    body[data-role="member"] .nav-icon {
        display: block;
        width: 22px;
        height: 22px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.8;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    body[data-role="member"] .notebook-shell {
        padding: 0 8px 18px;
        border: 0 !important;
        border-radius: 0 !important;
    }
    body[data-role="member"] .notebook-current-editor {
        border: 0 !important;
        border-top: 1px solid var(--line) !important;
        border-bottom: 1px solid var(--line) !important;
        border-radius: 0 !important;
    }
    body[data-role="member"] .notebook-media {
        border-radius: 0;
        background: transparent;
    }
    body[data-role="member"] .notebook-upload-pending { opacity: .82; }

    body[data-role="member"] .notebook-sketch-toolbar {
        z-index: 70;
        bottom: calc(76px + env(safe-area-inset-bottom));
        gap: 6px;
        width: calc(100vw - 16px);
        padding: 8px;
        border-radius: 14px;
        overflow-x: auto;
    }
    body[data-role="member"] .notebook-sketch-colors,
    body[data-role="member"] .notebook-sketch-sizes { gap: 4px; }
    body[data-role="member"] .notebook-sketch-colors button {
        width: 22px;
        height: 22px;
        flex: 0 0 22px;
    }
    body[data-role="member"] .notebook-sketch-sizes {
        padding-left: 7px;
    }
    body[data-role="member"] .notebook-sketch-sizes button {
        width: 25px;
        height: 25px;
    }
    body[data-role="member"] .notebook-sketch-eraser,
    body[data-role="member"] .notebook-sketch-undo,
    body[data-role="member"] #notebook-sketch-close {
        width: 30px;
        height: 30px;
        flex: 0 0 30px;
    }

    body[data-role="member"] .today-writing-composer {
        padding: 10px 0 18px !important;
        border: 0 !important;
        border-radius: 0 !important;
    }
    body[data-role="member"] .entry-mode-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        margin-bottom: 10px;
    }
    body[data-role="member"] .entry-mode-card {
        justify-content: center !important;
        gap: 6px;
        min-height: 44px;
        padding: 5px 8px;
        border: 0;
        border-bottom: 1px solid var(--line);
        border-radius: 0 !important;
    }
    body[data-role="member"] .entry-mode-icon {
        width: 25px;
        height: 25px;
    }
    body[data-role="member"] .entry-mode-icon svg {
        width: 17px;
        height: 17px;
    }
    body[data-role="member"] .entry-mode-card strong {
        font-size: .65rem;
    }
    body[data-role="member"] .draft-segment {
        padding: 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
    }
    body[data-role="member"] .composer .draft-segment textarea {
        min-height: 360px;
        padding: 16px 4px;
        border: 0;
        border-top: 1px solid var(--line);
        border-bottom: 1px solid var(--line);
        border-radius: 0 !important;
        background: transparent;
    }
    body[data-role="member"] .image-preview-wrap {
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    body[data-role="member"] .phase-banner,
    body[data-role="member"] .checkin-calendar,
    body[data-role="member"] .two-week-card,
    body[data-role="member"] .record-card,
    body[data-role="member"] .weekly-card {
        border-radius: 0 !important;
        box-shadow: none !important;
    }
    body[data-role="member"] .checkin-calendar,
    body[data-role="member"] .two-week-card {
        padding-right: 0;
        padding-left: 0;
        border: 0 !important;
    }
    body[data-role="member"] .record-card,
    body[data-role="member"] .weekly-card {
        border-right: 0 !important;
        border-left: 0 !important;
    }
    body[data-role="member"] .phase-banner {
        border-top: 0 !important;
        border-right: 0 !important;
        border-bottom: 0 !important;
        border-radius: 0 !important;
    }
}

/* Profile page and daily-card phone composition. */
body[data-role="member"] .profile-layout { grid-template-columns: 1fr; }

body[data-role="member"] .profile-editor-card,
body[data-role="member"] .profile-editor-card .profile-card-heading,
body[data-role="member"] .profile-editor-card form,
body[data-role="member"] .profile-editor-card form > label {
    text-align: left;
}

body[data-role="member"] .profile-editor-card .profile-card-heading { justify-content: flex-start; }
body[data-role="member"] .profile-editor-card input,
body[data-role="member"] .profile-editor-card textarea { text-align: left; text-align-last: left; }
body[data-role="member"] .profile-avatar-actions { justify-content: center; }
body[data-role="member"] .profile-avatar-actions .button {
    min-width: 150px;
    border-color: #D56B4A;
    color: #F8F4ED;
    background: #D56B4A;
}
body[data-role="member"] .profile-journey-card { padding: 0; border: 0; background: transparent; }
body[data-role="member"] .profile-journey-card form { margin-top: 0; }
body[data-role="member"] .profile-fieldset,
body[data-role="member"] .profile-fieldset > label,
body[data-role="member"] .profile-goals-field,
body[data-role="member"] .profile-goals-field > span { text-align: left; }

body[data-role="member"] .profile-choice-chips {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}
body[data-role="member"] .profile-choice-chips label > span,
body[data-role="member"] .profile-other-goal-row label > span {
    display: grid;
    place-items: center;
    min-height: 44px;
    margin: 0;
    padding: 6px 8px;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--ink-soft);
    background: transparent;
    font-size: .66rem;
    font-weight: 750;
    line-height: 1;
    white-space: nowrap;
}
body[data-role="member"] .profile-other-goal-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: end;
    gap: 12px;
    margin-top: 10px;
}
body[data-role="member"] .profile-other-goal-row label { cursor: pointer; }
body[data-role="member"] .profile-other-goal-row label input { position: absolute; opacity: 0; pointer-events: none; }
body[data-role="member"] .profile-other-goal-row label > span { min-width: 72px; }
body[data-role="member"] .profile-other-goal-row label input:checked + span { border-color: var(--ink); color: var(--paper); background: var(--ink); }
body[data-role="member"] #profile-goal-other {
    min-height: 44px;
    padding: 8px 2px;
    border: 0;
    border-bottom: 2px solid var(--line);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    text-align: left;
}
body[data-role="member"] #profile-goal-other:disabled { opacity: .45; }
body[data-role="member"] .profile-other-goal-row.active #profile-goal-other { border-bottom-color: #D56B4A; opacity: 1; }
body[data-role="member"] .profile-journey-card form > .button { justify-self: center; }

body[data-role="member"] .daily-card-header { align-items: flex-start; gap: 12px; }
body[data-role="member"] .daily-card-header > div:last-child { display: grid; align-content: center; }
body[data-role="member"] .daily-card-mark { width: 76px !important; height: 76px !important; flex-basis: 76px !important; margin: 0 !important; }
body[data-role="member"] .daily-card-header p { margin: 0 0 4px; font-size: .62rem; line-height: 1.1; letter-spacing: .08em; white-space: nowrap; }
body[data-role="member"] .daily-card-header time { font-size: .96rem; line-height: 1.2; white-space: nowrap; }
body[data-role="member"] .daily-card-header small { margin-top: 4px; font-size: .62rem; line-height: 1.15; white-space: nowrap; }
body[data-role="member"] .daily-card-accept {
    min-height: 58px;
    padding-right: 8px;
    padding-left: 8px;
    font-size: clamp(.62rem, 3vw, .78rem);
    letter-spacing: 0;
    white-space: nowrap;
}

@media (max-width: 760px) {
    body[data-role="member"] .profile-hero { align-items: center; gap: 16px; }
    body[data-role="member"] .profile-hero h1,
    body[data-role="member"] .profile-hero .eyebrow { text-align: left; }
    body[data-role="member"] .profile-card { padding: 20px 18px; }
    body[data-role="member"] .profile-form-grid.three-columns { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
    body[data-role="member"] .profile-form-grid.three-columns label > span { text-align: center; white-space: nowrap; }
    body[data-role="member"] .profile-form-grid.three-columns select {
        min-height: 50px;
        padding-right: 26px !important;
        padding-left: 8px;
        background-position: right 9px center !important;
        font-size: clamp(.58rem, 2.7vw, .7rem);
        text-align: center;
        text-align-last: center;
        white-space: nowrap;
    }
    body[data-role="member"] .profile-choice-chips label > span,
    body[data-role="member"] .profile-other-goal-row label > span { font-size: clamp(.5rem, 2.45vw, .62rem); }
    body[data-role="member"] #profile-goal-other { font-size: 16px; }
    body[data-role="member"] .profile-journey-card form > .button { width: min(100%, 300px); }
    body[data-role="member"] .daily-card-header { padding-right: 40px; }
    body[data-role="member"] .daily-card-mark { width: 72px !important; height: 72px !important; flex-basis: 72px !important; }
}

@media (max-width: 340px) {
    body[data-role="member"] .profile-card { padding-right: 14px; padding-left: 14px; }
    body[data-role="member"] .profile-fieldset { padding-right: 12px; padding-left: 12px; }
    body[data-role="member"] .profile-choice-chips { gap: 5px; }
    body[data-role="member"] .profile-choice-chips label > span { padding-right: 3px; padding-left: 3px; }
    body[data-role="member"] .daily-card-mark { width: 64px !important; height: 64px !important; flex-basis: 64px !important; }
    body[data-role="member"] .daily-card-header p { font-size: .52rem; }
    body[data-role="member"] .daily-card-header time { font-size: .8rem; }
    body[data-role="member"] .daily-card-header small { font-size: .54rem; }
}

/* Final mobile writing flow: clear copying, compact media tools and calmer cards. */
.notebook-selection-guide {
    position: relative;
    z-index: 3;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    margin: 12px 14px 4px;
    padding: 12px 14px;
    border: 1px solid rgba(213,107,74,.36);
    border-radius: 16px;
    color: #2B2B2B;
    background: rgba(248,226,215,.96);
    box-shadow: 0 10px 28px rgba(43,43,43,.10);
}
.notebook-selection-guide.hidden { display: none !important; }
.notebook-selection-guide-arrow { color: #D56B4A; font-size: 1.35rem; font-weight: 900; }
.notebook-selection-guide strong { display: block; font-size: .76rem; }
.notebook-selection-guide p { margin: 3px 0 0; color: var(--ink-soft); font-size: .64rem; line-height: 1.55; }
.notebook-selection-guide button { padding: 7px 10px; border: 0; border-radius: 999px; color: #fff; background: #D56B4A; font-size: .64rem; font-weight: 800; white-space: nowrap; }

body[data-role="member"] #journey-section .section-heading { margin-bottom: 12px !important; }
body[data-role="member"] #journey-section .journey-tabs { margin-top: 0 !important; }

body[data-role="member"] .daily-card-close {
    top: 18px;
    right: 18px;
    width: 52px;
    height: 52px;
    font-size: 1.8rem;
}
body[data-role="member"] .daily-card-header { gap: 4px !important; padding-right: 56px; }
body[data-role="member"] .daily-card-mark { width: 86px !important; height: 86px !important; flex-basis: 86px !important; }
body[data-role="member"] .daily-card-header > div:last-child { margin-left: -2px; }

.sketch-download-panel { border: 0 !important; box-shadow: 0 20px 58px rgba(43,43,43,.18) !important; }
#sketch-download-preview { border: 1px solid #A89E8F !important; border-radius: 14px !important; background: #F8F4ED !important; }

.image-preview-wrap {
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}
.image-preview-wrap img { border-radius: 14px; }
.image-preview-wrap button { top: 10px; right: 10px; }

.today-selected-media { grid-template-columns: 1fr; }
.today-selected-media figure { border-radius: 14px; background: #f4f1e8; }
.today-selected-media img { width: 100%; height: auto; max-height: 440px; object-fit: contain; }
.today-selected-media button {
    width: auto;
    height: auto;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: .7rem;
}

.dictation-status-row [data-dictation-stop],
.dictation-status-row [data-dictation-choose] { white-space: nowrap; color: #D56B4A; font-weight: 800; }

@media (max-width: 760px) {
    body[data-role="member"] .entry-mode-actions { margin-top: -10px; margin-bottom: 10px; gap: 8px; }
    body[data-role="member"] .entry-mode-card {
        min-height: 52px;
        padding: 6px 10px;
        gap: 7px;
    }
    body[data-role="member"] .entry-mode-icon { flex-basis: 27px; width: 27px; height: 27px; }
    body[data-role="member"] .entry-mode-icon svg { width: 22px; height: 22px; }
    body[data-role="member"] .entry-mode-card strong { font-size: clamp(.72rem, 3.7vw, .86rem); }
    body[data-role="member"] #open-sketch { color: #F8F4ED !important; }
    body[data-role="member"] #journey-section .section-heading { margin-bottom: 8px !important; }
}

@media (max-width: 560px) {
    .writing-dictation .dictation-popover {
        position: fixed;
        z-index: 120;
        right: 12px;
        bottom: calc(172px + env(safe-area-inset-bottom));
        left: 12px;
        width: auto;
        max-height: 42dvh;
        overflow-y: auto;
    }
    .dictation-status-row { flex-wrap: wrap; }
    .dictation-status-row p { flex-basis: 100%; }
    .notebook-selection-guide { grid-template-columns: auto minmax(0, 1fr); margin-inline: 8px; }
    .notebook-selection-guide button { grid-column: 2; justify-self: start; }
}
/* Palette-coded notebook tools and larger Today Writing media actions. */
body[data-role="member"] #notebook-image-trigger {
    border-color: #D56B4A;
    color: #F8F4ED;
    background: #D56B4A;
}
body[data-role="member"] #notebook-sketch-toggle {
    border-color: #8DAA8A;
    color: #F8F4ED;
    background: #8DAA8A;
}
body[data-role="member"] #notebook-voice-toggle {
    border-color: #E8C36A;
    color: #2B2B2B;
    background: #E8C36A;
}
body[data-role="member"] #notebook-image-trigger:hover,
body[data-role="member"] #notebook-image-trigger:focus-visible { color: #F8F4ED; background: #C75E41; }
body[data-role="member"] #notebook-sketch-toggle:hover,
body[data-role="member"] #notebook-sketch-toggle:focus-visible,
body[data-role="member"] #notebook-sketch-toggle.active { color: #F8F4ED; background: #789875; }
body[data-role="member"] #notebook-voice-toggle:hover,
body[data-role="member"] #notebook-voice-toggle:focus-visible,
body[data-role="member"] #notebook-voice-toggle.recording { color: #2B2B2B; background: #DDB354; }
body[data-role="member"] #notebook-image-trigger.limit-reached { opacity: .64; }

@media (max-width: 760px) {
    body[data-role="member"] #photo-mode-card,
    body[data-role="member"] #open-sketch {
        min-height: 76px;
        padding: 10px 14px;
        gap: 12px;
    }
    body[data-role="member"] #photo-mode-card .entry-mode-icon,
    body[data-role="member"] #open-sketch .entry-mode-icon {
        flex-basis: 40px;
        width: 40px;
        height: 40px;
    }
    body[data-role="member"] #photo-mode-card .entry-mode-icon svg,
    body[data-role="member"] #open-sketch .entry-mode-icon svg {
        width: 34px;
        height: 34px;
        stroke-width: 2;
    }
    body[data-role="member"] #photo-mode-card strong,
    body[data-role="member"] #open-sketch strong {
        font-size: clamp(.98rem, 4.8vw, 1.16rem);
        line-height: 1;
        white-space: nowrap;
    }
}


* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background:
        radial-gradient(circle at 10% 5%, rgba(255,255,255,.9), transparent 28rem),
        var(--paper);
    font-family: var(--sans);
    -webkit-font-smoothing: antialiased;
}

button, input, textarea { font: inherit; }
button, label[for] { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
.hidden { display: none !important; }
.language-link { float: right; color: var(--ink-soft); font-size: .72rem; font-weight: 600; text-decoration: none; }
.language-link:hover { color: var(--researcher-deep); }
.compact-link { float: none; white-space: nowrap; }

.eyebrow {
    margin: 0 0 12px;
    color: var(--sage-deep);
    font-size: .73rem;
    font-weight: 600;
    letter-spacing: .18em;
}

.muted { color: var(--ink-soft); }

.brand-mark {
    position: relative;
    width: 82px;
    height: 82px;
    margin-bottom: 36px;
}

.brand-mark span {
    position: absolute;
    inset: 0;
    border: 1px solid rgba(77,107,90,.65);
    border-radius: 50%;
}

.brand-mark span:nth-child(2) { transform: translateX(22px); }
.brand-mark span:nth-child(3) { transform: translate(11px, 19px); }

.brand-mark.small { width: 30px; height: 30px; margin: 0 14px 0 0; }
.brand-mark.small span:nth-child(2) { transform: translateX(8px); }
.brand-mark.small span:nth-child(3) { transform: translate(4px, 7px); }

.auth-layout {
    display: grid;
    grid-template-columns: minmax(420px, 1.05fr) minmax(480px, .95fr);
    min-height: 100vh;
}

.auth-story {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 10vw;
    overflow: hidden;
    position: relative;
}

.auth-story::after {
    content: "";
    position: absolute;
    width: 440px;
    height: 440px;
    left: -160px;
    bottom: -260px;
    border: 1px solid rgba(77,107,90,.2);
    border-radius: 50%;
    box-shadow: 80px -30px 0 -1px var(--paper), 80px -30px 0 0 rgba(77,107,90,.15), 160px 10px 0 -1px var(--paper), 160px 10px 0 0 rgba(77,107,90,.12);
}

.auth-story h1 {
    margin: 0;
    font: 500 clamp(3.4rem, 6vw, 6rem)/1.1 var(--serif);
    letter-spacing: .12em;
}

.auth-story .lead {
    max-width: 560px;
    margin: 30px 0 64px;
    color: var(--ink-soft);
    font: 400 1.15rem/2 var(--serif);
    letter-spacing: .05em;
}

.auth-panel {
    display: grid;
    place-items: center;
    padding: 7vw;
    background: rgba(255,253,248,.7);
    border-left: 1px solid rgba(220,216,205,.8);
}

.auth-card { width: min(100%, 470px); }
.auth-card h2 { margin: 0 0 12px; font: 500 1.9rem var(--serif); }
.auth-card > .muted { margin: 0 0 34px; line-height: 1.8; font-size: .91rem; }
.auth-tabs { display: flex; gap: 8px; margin: 0 0 18px; }
.auth-tab { flex: 1; min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-soft); background: transparent; cursor: pointer; font-size: .82rem; font-weight: 700; transition: .18s ease; }
.auth-tab.active { color: #fff; background: var(--sage-deep); border-color: transparent; }
.auth-pane.hidden { display: none; }
.auth-pane > .muted { margin: 0 0 18px; line-height: 1.8; font-size: .86rem; }
.privacy-details { margin: -12px 0 24px; border: 1px solid var(--line); border-radius: var(--radius-md); background: rgba(243,240,232,.58); }
.privacy-details summary { padding: 14px 16px; color: var(--sage-deep); cursor: pointer; font-size: .78rem; font-weight: 600; }
.privacy-details > div { padding: 0 16px 10px; color: var(--ink-soft); font-size: .7rem; line-height: 1.75; }
.privacy-details p { margin: 0 0 10px; }
.privacy-details strong { color: var(--ink); }

label:not(.consent-row):not(.share-choice):not(.photo-button):not(.observer-share):not(.share-option):not(.checkin-plan-option) {
    display: block;
    margin: 20px 0 9px;
    font-size: .84rem;
    font-weight: 600;
}

input[type="text"], input:not([type]), textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    outline: none;
    color: var(--ink);
    background: rgba(255,255,255,.72);
    transition: border-color .2s, box-shadow .2s, background .2s;
}

input[type="text"], input:not([type]) { height: 54px; padding: 0 17px; }
textarea { padding: 18px; resize: vertical; line-height: 1.8; }
input:focus, textarea:focus { border-color: var(--sage); background: #fff; box-shadow: 0 0 0 4px rgba(115,141,125,.12); }

.consent-row, .share-choice, .observer-share { display: flex; align-items: flex-start; gap: 11px; cursor: pointer; }
.consent-row { margin: 24px 0; color: var(--ink-soft); font-size: .76rem; line-height: 1.7; }
input[type="checkbox"] { width: 17px; height: 17px; margin: 2px 0 0; flex: 0 0 auto; accent-color: var(--sage-deep); }

.button {
    min-height: 50px;
    padding: 0 22px;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 600;
    letter-spacing: .03em;
    transition: transform .2s, box-shadow .2s, background .2s, opacity .2s;
}

.button:hover:not(:disabled) { transform: translateY(-2px); }
.button:disabled { cursor: wait; opacity: .55; }
.button.primary { color: #fff; background: var(--sage-deep); box-shadow: 0 9px 24px rgba(77,107,90,.2); }
.button.primary:hover:not(:disabled) { background: #3f5d4d; box-shadow: 0 12px 28px rgba(77,107,90,.26); }
.button.secondary { border: 1px solid var(--line); background: var(--surface); }
.button.compact { min-height: 40px; padding: 0 18px; font-size: .8rem; }
.auth-card .button { width: 100%; }
.safety-note { margin: 24px 0 0; color: #8a756d; font-size: .72rem; text-align: center; }

.toast {
    position: fixed;
    z-index: 100;
    left: 50%;
    top: 20px;
    max-width: calc(100vw - 32px);
    padding: 12px 18px;
    border-radius: 999px;
    color: #fff;
    background: var(--ink);
    box-shadow: var(--shadow-small);
    opacity: 0;
    transform: translate(-50%, -20px);
    pointer-events: none;
    transition: .25s ease;
    font-size: .84rem;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: #8b4f43; }
.toast.success { background: var(--sage-deep); }

.topbar {
    position: sticky;
    z-index: 20;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 76px;
    padding: 0 max(28px, calc((100vw - 1180px)/2));
    border-bottom: 1px solid rgba(220,216,205,.8);
    background: rgba(243,240,232,.9);
    backdrop-filter: blur(18px);
}

.brand { display: flex; align-items: center; color: inherit; text-decoration: none; }
.brand-daily-button { padding: 0; border: 0; text-align: left; background: transparent; cursor: pointer; }
.brand-daily-button .brand-mark { transition: transform .25s ease; }
.brand-daily-button:hover .brand-mark { transform: rotate(-7deg) scale(1.05); }
.brand strong { display: block; font: 800 1.04rem var(--serif); letter-spacing: .08em; }
.brand small, .identity small { display: block; margin-top: 3px; color: var(--ink-soft); font-size: .67rem; }
.identity { display: flex; align-items: center; gap: 10px; font-size: .8rem; }
.identity > * { flex: 0 0 auto; }
.observer-group-switcher {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid rgba(55,127,189,.24);
    border-radius: 999px;
    color: var(--researcher-deep);
    background: rgba(232,244,252,.7);
}
.observer-group-switcher > span {
    font-size: .62rem;
    font-weight: 700;
    letter-spacing: .08em;
    white-space: nowrap;
}
.observer-group-switcher select {
    width: 100%;
    min-width: 0;
    max-width: 200px;
    padding: 0;
    border: 0;
    color: var(--researcher-deep);
    background-color: transparent;
    font: 700 .72rem var(--sans);
    cursor: pointer;
}
.observer-group-switcher select:focus { outline: 0; }
.avatar { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; color: #fff; background: var(--sage); font-family: var(--serif); }
.identity-profile-entry { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 4px 10px 4px 5px; border: 0; border-radius: 999px; text-align: left; background: transparent; cursor: pointer; transition: background .2s ease, transform .2s ease; }
.identity-profile-entry:hover:not(:disabled) { background: rgba(255,255,255,.58); transform: translateY(-1px); }
.identity-profile-entry:disabled { cursor: default; }
.identity-profile-copy { display: block; }
.identity-profile-copy strong { display: block; }
.text-button { display: grid; place-items: center; min-height: 40px; border: 0; border-left: 1px solid var(--line); margin-left: 8px; padding: 5px 0 5px 16px; color: var(--ink-soft); background: none; cursor: pointer; font-size: .75rem; }

.daily-card-dialog { width: min(94vw, 570px); max-width: none; max-height: 94dvh; padding: 0; border: 0; overflow: visible; background: transparent; }
.daily-card-dialog::backdrop { background: rgba(25,39,37,.64); backdrop-filter: blur(11px); }
.daily-card-panel { position: relative; max-height: 94dvh; padding: 20px; overflow-y: auto; border-radius: 34px; background: #f5f0e5; box-shadow: 0 34px 110px rgba(17,48,42,.38); }
.daily-card-close { position: absolute; z-index: 4; top: 30px; right: 30px; display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 1px solid rgba(8,112,88,.22); border-radius: 50%; color: var(--member-deep); background: rgba(255,250,239,.88); cursor: pointer; font-size: 1.35rem; line-height: 1; }
.daily-card { --daily-card-paper: #fffaef; --daily-card-position: center; --daily-card-overlay: linear-gradient(90deg, rgba(255,250,239,.92) 0%, rgba(255,250,239,.82) 47%, rgba(255,250,239,.18) 72%, rgba(255,250,239,.02) 100%); position: relative; min-height: 620px; padding: 38px 40px 34px; overflow: hidden; border: 4px solid var(--member-deep); border-radius: 28px; color: #193b33; background: var(--daily-card-paper) url("assets/daily-card-puzzle-bg-v1.png?v=2") var(--daily-card-position)/cover no-repeat; isolation: isolate; }
.daily-card::before { content: ""; position: absolute; z-index: 0; inset: 0; background: var(--daily-card-overlay); pointer-events: none; }
.daily-card::after { display: none; }
.daily-card-header { position: relative; z-index: 2; display: flex; align-items: center; gap: 15px; padding-right: 40px; }
.daily-card-mark { flex: 0 0 auto; width: 58px !important; height: 58px !important; margin-right: 4px !important; }
.daily-card-variant-1 { --daily-card-paper: #f7f2ea; --daily-card-position: 58% center; --daily-card-overlay: linear-gradient(96deg, rgba(247,242,234,.94) 0%, rgba(247,242,234,.8) 52%, rgba(236,215,205,.14) 100%); }
.daily-card-variant-2 { --daily-card-paper: #f4f5ea; --daily-card-position: 43% center; --daily-card-overlay: linear-gradient(88deg, rgba(244,245,234,.93) 0%, rgba(244,245,234,.78) 48%, rgba(209,225,211,.12) 100%); }
.daily-card-variant-3 { --daily-card-paper: #fbf2e7; --daily-card-position: 66% center; --daily-card-overlay: linear-gradient(100deg, rgba(251,242,231,.94) 0%, rgba(251,242,231,.8) 54%, rgba(231,203,165,.12) 100%); }
.daily-card-header p { margin: 0 0 10px; color: var(--member-deep); font-size: .66rem; font-weight: 900; letter-spacing: .16em; }
.daily-card-header time, .daily-card-header small { display: block; }
.daily-card-header time { font-size: .78rem; font-weight: 800; }
.daily-card-header small { margin-top: 3px; color: #6c786e; font-size: .63rem; letter-spacing: .04em; }
.daily-card blockquote { position: relative; z-index: 2; margin: 128px 0 0; }
.daily-card blockquote p { margin: 0; }
.daily-card blockquote p:first-child { color: #164c3e; font: 900 clamp(2rem, 8vw, 2.7rem)/1.28 var(--sans); letter-spacing: -.045em; text-wrap: balance; }
.daily-card blockquote p:first-child > span { display: block; width: max-content; max-width: 100%; white-space: nowrap; }
.daily-card blockquote p[lang="en"] { width: 90%; margin-top: 24px; color: var(--ai-deep); font: 700 1rem/1.55 var(--sans); letter-spacing: .01em; }
.daily-card footer { position: absolute; z-index: 2; left: 40px; bottom: 34px; }
.daily-card footer strong, .daily-card footer small { display: block; }
.daily-card footer strong { font-size: .72rem; }
.daily-card footer small { margin-top: 5px; color: #66766d; font-size: .62rem; letter-spacing: .08em; }
.daily-card-accept { width: 100%; margin-top: 14px; background: var(--member-deep) !important; }
.daily-card-dialog.after-submission .daily-card { border-color: var(--ai-deep); }
.daily-card-dialog.after-submission .daily-card-accept { background: var(--ai-deep) !important; }

.member-app, .observer-app { width: min(100% - 40px, 1180px); margin: 0 auto; }
.member-app { padding: 34px 0 80px; }
.member-nav { display: flex; justify-content: center; gap: 6px; margin-bottom: 62px; }
.nav-button, .filter-button { border: 0; border-radius: 999px; padding: 9px 18px; color: var(--ink-soft); background: transparent; cursor: pointer; font-size: .82rem; }
.nav-button.active, .filter-button.active { color: var(--sage-deep); background: var(--sage-pale); font-weight: 600; }
.member-section { display: none; }
.member-section.active { display: block; animation: enter .35s ease both; }
#notebook-section.member-section.active { animation: none; transform: none; }
@keyframes enter { from { opacity: 0; transform: translateY(8px); } }

.welcome-block { max-width: 680px; margin: 0 auto 34px; text-align: center; }
.welcome-block h1, .section-heading h1, .observer-heading h1 { margin: 0; font: 500 clamp(1.8rem, 3.5vw, 2.7rem)/1.35 var(--serif); letter-spacing: .03em; }
.welcome-block > p:last-child { margin: 14px 0 0; color: var(--ink-soft); font-family: var(--serif); }

#checkin-form[hidden] { display: none !important; }
.notebook-workspace { display: grid; grid-template-columns: minmax(0, 840px) 56px; align-items: start; justify-content: center; gap: 22px; width: 100%; }
.notebook-shell { position: relative; width: 100%; margin: 0; overflow: visible; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.notebook-shell::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .13; background-image: linear-gradient(rgba(8,112,88,.10) 1px, transparent 1px), linear-gradient(90deg, rgba(8,112,88,.07) 1px, transparent 1px); background-size: 18px 18px; }
.notebook-cover { position: relative; z-index: 1; display: block; padding: 0 0 25px; border-bottom: 1px solid rgba(27,154,116,.18); background: transparent; }
.notebook-cover .eyebrow { color: var(--member-deep); }
.notebook-cover h2 { margin: 5px 0 7px; font-size: clamp(1.6rem, 3vw, 2.35rem); font-weight: 900; }
.notebook-cover p:last-child { max-width: 540px; margin: 0; color: var(--ink-soft); font-size: .75rem; line-height: 1.75; }
.notebook-private-seal { display: none; }
.notebook-days { position: relative; z-index: 1; padding: 10px 0 0; }
.notebook-day { position: relative; padding: 20px 0 6px; }
.notebook-day.past { opacity: .56; transition: opacity .2s ease; }
.notebook-day.past[open] { opacity: .82; }
.notebook-day > summary { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 14px; list-style: none; cursor: pointer; color: var(--member-deep); font-size: .72rem; font-weight: 850; letter-spacing: .08em; }
.notebook-day > summary::-webkit-details-marker { display: none; }
.notebook-day > summary::before, .notebook-day > summary::after { content: ""; height: 1px; background: linear-gradient(90deg, transparent, rgba(8,112,88,.32)); }
.notebook-day > summary::after { background: linear-gradient(90deg, rgba(8,112,88,.32), transparent); }
.notebook-day > summary small { display: block; margin-top: 3px; text-align: center; color: var(--ink-soft); font-size: .58rem; font-weight: 500; letter-spacing: .02em; }
.notebook-day > summary > span { position: relative; z-index: 4; min-width: 112px; text-align: center; }
.notebook-blocks { display: grid; gap: 12px; padding: 18px 0 8px; }
.notebook-block { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 34px; gap: 12px; align-items: start; padding: 15px 0 18px; border-bottom: 1px solid rgba(27,154,116,.11); border-radius: 0; background: transparent; transition: border-color .2s ease; }
.notebook-block:focus-within, .notebook-block:hover { border-bottom-color: rgba(27,154,116,.28); background: transparent; }
.notebook-block textarea { min-height: 70px; padding: 6px 4px; overflow: hidden; resize: none; border: 0; background: transparent; box-shadow: none; font: 400 1rem/1.95 var(--serif); }
.notebook-block-status { position: absolute; left: 20px; bottom: 4px; color: var(--ink-soft); font-size: .52rem; opacity: 0; transition: opacity .2s ease; }
.notebook-block.saving .notebook-block-status, .notebook-block.saved .notebook-block-status { opacity: 1; }
.notebook-selector { position: relative; z-index: 4; display: grid; place-items: center; width: 31px; height: 31px; padding: 0; border: 0; border-radius: 50%; color: var(--member-deep); background: transparent; cursor: pointer; font-size: 1.5rem; line-height: 1; }
.notebook-selector.selected { color: var(--member-deep); font-size: 1.35rem; }
.notebook-selector:disabled { cursor: default; opacity: .24; }
.notebook-media { overflow: hidden; border-radius: 17px; background: rgba(243,240,232,.72); }
.notebook-media img { display: block; width: 100%; max-height: 520px; object-fit: contain; }
.notebook-photo-stage { position: relative; }
.notebook-photo-stage > .notebook-photo-ink-preview { position: absolute; inset: 0; width: 100%; height: 100%; max-height: none; object-fit: fill; pointer-events: none; }
.notebook-media-caption { padding: 9px 12px; color: var(--ink-soft); font-size: .6rem; }
.notebook-voice-card { display: flex; align-items: center; gap: 13px; min-height: 74px; padding: 14px 16px; border-radius: 18px; background: linear-gradient(135deg, rgba(242,138,61,.15), rgba(255,250,239,.86)); }
.notebook-voice-card > span { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; color: #fff; background: var(--ai-deep); font-size: 1rem; }
.notebook-voice-card audio { width: min(100%, 390px); height: 34px; }
.notebook-voice-card time { margin-left: auto; color: var(--ai-deep); font-size: .72rem; font-weight: 800; }
.notebook-current-editor { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; margin: 10px 0 0; padding: 18px 0 22px; border: 0; border-bottom: 1px solid rgba(27,154,116,.18); border-radius: 0; background: transparent; }
.notebook-current-editor textarea { min-height: 115px; padding: 7px 4px; overflow: hidden; border: 0; resize: none; background: transparent; box-shadow: none; font: 400 1.03rem/2 var(--serif); }
.notebook-current-editor #notebook-current-selector { position: relative; z-index: 3; grid-column: 2; grid-row: 1; justify-self: end; }
.notebook-current-editor textarea { position: relative; z-index: 1; grid-column: 1 / -1; grid-row: 1; padding-right: 42px; }
#notebook-autosave-status { grid-column: 1 / -1; justify-self: center; text-align: center; color: var(--ink-soft); font-size: .58rem; }
.notebook-new-fragment { display: block; margin: 8px auto 0; padding: 7px 12px; border: 0; border-radius: 999px; color: var(--member-deep); background: rgba(217,243,231,.68); cursor: pointer; font-size: .7rem; font-weight: 850; letter-spacing: .02em; }
.notebook-tool-dock { position: fixed; z-index: 7; top: 50%; right: max(12px, calc((100vw - 918px) / 2)); display: flex; flex-direction: column; align-items: center; gap: 12px; width: 56px; height: max-content; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; transform: translateY(-50%); }
.notebook-tool { display: grid; place-items: center; flex: 0 0 auto; box-sizing: border-box; width: 50px; height: 50px; margin: 0; padding: 0; border: 1px solid rgba(27,154,116,.22); border-radius: 50%; color: var(--member-deep); background: rgba(255,250,239,.94); box-shadow: 0 8px 20px rgba(8,112,88,.08); cursor: pointer; line-height: 0; }
.notebook-tool-dock label.notebook-tool { display: grid; place-items: center; margin: 0; }
.notebook-tool:hover, .notebook-tool.recording, .notebook-tool.active { color: #fff; background: var(--member-deep); }
.notebook-tool.recording { background: #bd5648; animation: notebook-pulse 1.3s ease infinite; }
@keyframes notebook-pulse { 50% { box-shadow: 0 0 0 7px rgba(189,86,72,.14); } }
.notebook-tool svg { display: block; width: 23px; height: 23px; margin: auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.notebook-voice-time { padding: 3px 0; color: #9b473c; font-size: .62rem; font-weight: 800; }
.notebook-paper-ink-preview { position: absolute; z-index: 2; left: 0; display: block; width: 100%; pointer-events: none; object-fit: fill; }
.notebook-inline-sketch { position: absolute; z-index: 6; left: 0; right: 0; margin: 0; overflow: visible; border: 0; border-radius: 0; background: transparent; }
.notebook-sketch-base-canvas { position: absolute; z-index: 0; left: 0; top: 0; display: block; width: 100%; height: auto; pointer-events: none; }
#notebook-sketch-canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; border: 0; touch-action: none; background: transparent; cursor: crosshair; }
.notebook-sketch-toolbar { position: fixed; z-index: 9; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 14px; width: min(calc(100vw - 28px), 720px); padding: 10px 13px; overflow-x: auto; border: 1px solid rgba(27,154,116,.22); border-radius: 999px; background: rgba(255,250,239,.96); box-shadow: 0 18px 55px rgba(23,63,53,.18); transform: translateX(-50%); backdrop-filter: blur(12px); }
.notebook-sketch-colors, .notebook-sketch-sizes { display: flex; align-items: center; gap: 7px; }
.notebook-sketch-colors button { width: 24px; height: 24px; padding: 0; border: 3px solid #f7f3e8; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 1px rgba(30,50,45,.16); cursor: pointer; }
.notebook-sketch-colors button.active { box-shadow: 0 0 0 2px var(--member-deep), 0 0 0 5px #f7f3e8; }
.notebook-sketch-sizes { padding-left: 13px; border-left: 1px solid var(--line); }
.notebook-sketch-sizes button { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; background: transparent; cursor: pointer; }
.notebook-sketch-sizes button.active { background: rgba(217,243,231,.86); }
.notebook-sketch-sizes i { width: var(--size); height: var(--size); border-radius: 50%; background: var(--member-deep); }
.notebook-sketch-eraser { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 1px solid var(--line); border-radius: 50%; color: var(--ink-soft); background: rgba(255,253,248,.9); cursor: pointer; transition: .15s ease; }
.notebook-sketch-eraser svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.notebook-sketch-eraser.active { color: #fff; border-color: var(--member-deep); background: var(--member-deep); }
.notebook-sketch-eraser:focus-visible { outline: 2px solid rgba(27,154,116,.55); outline-offset: 2px; }
#notebook-sketch-status { margin-left: auto; color: var(--ink-soft); font-size: .58rem; white-space: nowrap; }
#notebook-sketch-close { width: 34px; height: 34px; border: 0; border-radius: 50%; color: var(--member-deep); background: rgba(217,243,231,.72); cursor: pointer; }
.notebook-reflection-guide { position: relative; z-index: 1; margin: 0; padding: 18px 0 8px; color: var(--ink-soft); font-size: .66rem; line-height: 1.7; }
.notebook-reflection-guide span { margin-right: 5px; color: var(--member-deep); font-size: 1rem; }
.reflection-window-callout { display: flex; align-items: center; justify-content: space-between; gap: 18px; width: min(100%, 840px); margin: 14px auto 0; padding: 15px 20px; border: 1px solid rgba(242,138,61,.22); border-radius: 18px; color: var(--ink-soft); background: rgba(255,236,217,.48); font-size: .7rem; }
.reflection-window-callout strong { color: var(--ai-deep); font-size: .66rem; letter-spacing: .08em; }
.reflection-panel { width: min(100%, 840px); margin: 18px auto 0; padding: 30px; border: 2px solid var(--ai-deep); border-radius: 28px; background: #fff8ed; box-shadow: 0 24px 70px rgba(179,91,39,.12); }
.reflection-panel > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.reflection-panel h2 { margin: 5px 0 7px; font-size: 1.7rem; }
.reflection-panel header p:last-child { max-width: 570px; margin: 0; color: var(--ink-soft); font-size: .7rem; line-height: 1.7; }
#reflection-window-badge { flex: 0 0 auto; padding: 8px 11px; border-radius: 999px; color: var(--ai-deep); background: rgba(242,138,61,.13); font-size: .6rem; font-weight: 800; }
.reflection-items { display: grid; gap: 10px; }
.reflection-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 14px; border: 1px solid rgba(242,138,61,.18); border-radius: 18px; background: rgba(255,253,246,.72); }
.reflection-item textarea { min-height: 96px; border: 0; padding: 4px; background: transparent; box-shadow: none; font: 400 .92rem/1.8 var(--serif); }
.reflection-item img { display: block; width: 100%; max-height: 360px; object-fit: contain; border-radius: 13px; background: #f4f1e8; }
.reflection-item-actions { display: flex; flex-direction: column; gap: 5px; }
.reflection-item-actions button { display: grid; place-items: center; width: 31px; height: 31px; padding: 0; border: 0; border-radius: 50%; color: var(--ai-deep); background: rgba(242,138,61,.10); cursor: pointer; }
.reflection-summary { display: block; margin-top: 18px; }
.reflection-summary > span { display: block; margin-bottom: 7px; font-size: .74rem; font-weight: 800; }
.reflection-summary small { color: var(--ink-soft); font-weight: 400; }
.reflection-summary textarea { min-height: 120px; }
.reflection-share-choice { margin-top: 16px; background: rgba(242,138,61,.09); }
.reflection-panel > footer { display: grid; grid-template-columns: .8fr 1.2fr; gap: 10px; margin-top: 18px; }
.reflection-panel > footer .button { width: 100%; }

.journey-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 34px; }
.shared-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 34px; }
.journey-tab, .shared-tab { min-height: 62px; padding: 12px 18px; border: 1px solid rgba(27,154,116,.18); border-radius: 20px; color: var(--ink-soft); background: rgba(255,253,246,.65); cursor: pointer; font-size: .82rem; font-weight: 750; transition: .18s ease; }
.journey-tab.active, .shared-tab.active { border-color: var(--member); color: #fff; background: var(--member); box-shadow: 0 10px 25px rgba(8,112,88,.16); }
.journey-collection, .shared-collection { margin-top: 28px; }
.journey-pane, .shared-pane { display: none; min-width: 0; }
.journey-pane.active, .shared-pane.active { display: block; animation: enter .25s ease both; }
.journey-pane-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.journey-pane-heading > div { display: flex; align-items: center; gap: 12px; }
.journey-pane-heading span { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: #fff; background: var(--member); font-size: .58rem; font-weight: 850; }
.journey-pane-heading h2 { margin: 0; font-size: 1.15rem; }
.journey-pane-heading p { margin: 0; color: var(--ink-soft); font-size: .67rem; }

.phase-banner { width: min(100%, 780px); margin: 0 auto 26px; padding: 13px 18px; border: 1px dashed rgba(27,154,116,.35); border-radius: 16px; color: var(--member-deep); background: rgba(217,243,231,.5); font-size: .76rem; line-height: 1.7; text-align: center; }
.checkin-calendar { width: min(100%, 780px); margin: 0 auto 34px; padding: 22px 24px 24px; border: 1px solid rgba(220,216,205,.9); border-radius: var(--radius-lg); background: rgba(255,253,248,.74); box-shadow: var(--shadow); }
.checkin-calendar-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.checkin-calendar-head h3 { margin: 0; font: 500 1.15rem var(--serif); }
.checkin-calendar-nav { display: flex; gap: 8px; }
.checkin-calendar-nav button { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 1px solid var(--line); border-radius: 50%; color: var(--member-deep); background: rgba(255,253,248,.9); cursor: pointer; font-size: 1.05rem; transition: .15s ease; }
.checkin-calendar-nav button:hover { border-color: var(--sage); background: rgba(217,243,231,.7); }
.checkin-calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.checkin-calendar-dow { padding: 4px 0 8px; color: var(--ink-soft); font-size: .66rem; font-weight: 700; text-align: center; }
.checkin-calendar-day { position: relative; display: grid; place-items: center; height: 42px; border-radius: 12px; color: var(--ink); font-size: .78rem; }
.checkin-calendar-day.future { color: rgba(60,70,64,.28); }
.checkin-calendar-day.today { box-shadow: inset 0 0 0 1.5px var(--member); font-weight: 800; }
.checkin-calendar-day.marked { background: rgba(217,243,231,.85); color: var(--member-deep); font-weight: 700; cursor: pointer; }
.checkin-calendar-day.marked:hover { background: rgba(196,230,214,.95); }
.checkin-calendar-day.marked::after { content: ""; position: absolute; bottom: 5px; width: 5px; height: 5px; border-radius: 50%; background: var(--member); }
.checkin-calendar-day.blank { color: rgba(60,70,64,.35); }
.checkin-calendar-day.empty { color: transparent; }
.checkin-calendar-hint { margin: 14px 0 0; color: var(--ink-soft); font-size: .66rem; line-height: 1.6; }
.two-week-card { width: min(100%, 720px); margin: 0 auto; padding: 30px; border: 1px solid rgba(220,216,205,.9); border-radius: var(--radius-xl); background: rgba(255,253,248,.8); box-shadow: var(--shadow); }
.two-week-card h2 { margin: 6px 0 10px; font: 500 1.5rem var(--serif); }
.two-week-card > p { margin: 0; color: var(--ink-soft); line-height: 1.9; font-size: .82rem; }
.checkin-prompts { margin: 18px 0 0; padding: 0; list-style: none; }
.checkin-prompts li { position: relative; margin: 9px 0; padding-left: 22px; color: var(--ink); font-size: .8rem; line-height: 1.7; }
.checkin-prompts li::before { content: "·"; position: absolute; left: 6px; color: var(--member); font-weight: 900; }
.checkin-plan-options { display: grid; gap: 10px; margin: 14px 0 4px; }
.checkin-plan-option { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-md); background: rgba(255,253,248,.85); cursor: pointer; transition: .15s ease; }
.checkin-plan-option:has(input:checked) { border-color: var(--member); background: rgba(223,232,223,.5); }
.checkin-plan-option input { margin-top: 3px; accent-color: var(--member); }
.checkin-plan-option span { display: grid; gap: 3px; }
.checkin-plan-option strong { font-size: .86rem; }
.checkin-plan-option small { color: var(--ink-soft); font-size: .74rem; line-height: 1.55; }
.checkin-note-label { display: block; margin: 22px 0 9px; font-size: .82rem; font-weight: 700; }
.two-week-card textarea { min-height: 150px; }
.two-week-card #checkin-plan-custom { min-height: 84px; }
.checkin-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
.checkin-saved-hint { color: var(--ink-soft); font-size: .7rem; }
.phase-plan-option-row { display: grid; gap: 8px; grid-template-columns: 1fr; margin: 10px 0; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-md); background: rgba(255,253,248,.8); }
.phase-plan-option-row .text-button { justify-self: start; min-height: 30px; padding: 0; border: 0; border-left: 0; margin: 0; color: var(--clay); font-size: .72rem; }
.phase-plan-option-title { width: 100%; }
.phase-plan-option-description { min-height: 52px; }
.phase-plan-save-row { justify-content: flex-start; margin-top: 16px; }

.today-writing-composer { width: min(100%, 760px); margin-top: 0; }
.today-writing-composer .checkin-segment-text:focus::placeholder { color: transparent; }
.today-selected-media { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.today-selected-media figure { position: relative; min-width: 0; margin: 0; overflow: hidden; border-radius: 18px; background: rgba(243,240,232,.76); }
.today-selected-media img { display: block; width: 100%; height: 230px; object-fit: contain; }
.today-selected-media button { position: absolute; top: 9px; right: 9px; display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; color: #fff; background: rgba(23,63,53,.78); cursor: pointer; font-size: 1rem; }

.composer { width: min(100%, 720px); margin: 0 auto; padding: 28px; border: 1px solid rgba(220,216,205,.9); border-radius: var(--radius-xl); background: rgba(255,253,248,.8); box-shadow: var(--shadow); }
.composer-topline { display: flex; justify-content: space-between; color: var(--ink-soft); font-size: .76rem; }
.composer-topline span:first-child { color: var(--ink); font-weight: 600; }
.composer textarea { min-height: 190px; margin-top: 18px; border: 0; padding: 0; background: transparent; font: 400 1rem/2 var(--serif); box-shadow: none; }
.composer-actions { display: flex; justify-content: space-between; align-items: center; padding: 16px 0 22px; color: var(--ink-soft); font-size: .72rem; }
.photo-button { display: inline-flex; align-items: center; gap: 10px; color: var(--sage-deep); cursor: pointer; font-weight: 700; }
.entry-mode-card.has-visual { border-color: rgba(27,154,116,.55); background: rgba(217,243,231,.72); }
.entry-mode-card.has-visual .entry-mode-icon { box-shadow: 0 0 0 5px rgba(27,154,116,.11), 0 7px 18px rgba(8,112,88,.18); }
.visual-input-icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 2px solid var(--member-deep);
    border-radius: 50%;
    color: #fff;
    background: var(--member-deep);
    box-shadow: 0 7px 18px rgba(8,112,88,.18);
}
.visual-input-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.image-preview-wrap {
    position: relative;
    margin: 2px 0 16px;
    overflow: hidden;
    scroll-margin-top: 110px;
    border: 1px solid rgba(27,154,116,.25);
    border-radius: var(--radius-lg);
    background: rgba(233,247,239,.66);
    box-shadow: 0 14px 34px rgba(8,112,88,.10);
}
.image-preview-wrap.revealed { animation: visual-arrival .46s ease both; }
@keyframes visual-arrival { from { opacity: .45; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
.visual-added-note { display: flex; align-items: center; gap: 11px; padding: 12px 14px; color: var(--member-deep); background: rgba(217,243,231,.84); }
.visual-added-note > span { display: grid; place-items: center; width: 27px; height: 27px; flex: 0 0 auto; border-radius: 50%; color: #fff; background: var(--member-deep); font-size: .74rem; font-weight: 800; }
.visual-added-note strong, .visual-added-note small { display: block; }
.visual-added-note strong { font-size: .76rem; }
.visual-added-note small { margin-top: 2px; color: var(--ink-soft); font-size: .65rem; }
.image-preview-wrap img { display: block; width: 100%; max-height: 440px; object-fit: contain; background: #f4f1e8; }
.image-preview-wrap button { position: absolute; top: 62px; right: 12px; padding: 7px 12px; border: 0; border-radius: 999px; color: #fff; background: rgba(20,30,24,.76); cursor: pointer; font-size: .72rem; }
.share-choice { margin: 0 -4px 22px; padding: 16px; border-radius: var(--radius-md); background: rgba(223,232,223,.48); }
.share-choice strong, .share-choice small { display: block; }
.share-choice strong { margin-bottom: 4px; font-size: .82rem; }
.share-choice small { color: var(--ink-soft); line-height: 1.6; font-size: .7rem; }
.share-choice-group { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 -4px 16px; padding: 0; border: 0; }
.share-option { position: relative; display: flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 18px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-soft); background: rgba(223,232,223,.48); cursor: pointer; font-size: .8rem; font-weight: 700; transition: .18s ease; user-select: none; }
.share-option input { position: absolute; opacity: 0; pointer-events: none; }
.share-option:has(input:checked), .share-option.checked-option { border-color: var(--member); color: var(--member-deep); background: linear-gradient(110deg, rgba(217,243,231,.85), rgba(246,203,85,.18)); box-shadow: 0 8px 20px rgba(8,112,88,.10); }
.share-option:has(input:focus-visible) { outline: 2px solid rgba(27,154,116,.55); outline-offset: 2px; }
.share-option-icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.silent-submit-button { display: flex; align-items: center; justify-content: center; gap: 9px; width: calc(100% + 8px); margin: 0 -4px 22px; min-height: 52px; border: 1.5px dashed rgba(27,154,116,.6); border-radius: 999px; color: var(--sage-deep); background: rgba(255,253,248,.92); cursor: pointer; font-size: .86rem; font-weight: 800; letter-spacing: .02em; transition: .18s ease; }
.silent-submit-button svg { width: 19px; height: 19px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.silent-submit-button:hover:not(:disabled) { border-style: solid; border-color: var(--sage); background: rgba(217,243,231,.78); transform: translateY(-1px); }
.silent-submit-button:disabled { cursor: wait; opacity: .6; }
.composer > .button { width: 100%; }

.submitted-state { width: min(100%, 620px); margin: 80px auto; text-align: center; }
.success-ring { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 24px; border: 1px solid var(--sage); border-radius: 50%; color: var(--sage-deep); font-size: 1.5rem; }
.submitted-state h2 { font: 500 1.7rem var(--serif); }
.submitted-state p { max-width: 520px; margin: 14px auto 28px; color: var(--ink-soft); line-height: 1.9; }

.section-heading, .observer-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; margin-bottom: 42px; }
.section-heading > p, .observer-heading > div > p:last-child { max-width: 520px; margin: 0; color: var(--ink-soft); font-size: .8rem; line-height: 1.8; text-align: right; }
.timeline { width: min(100%, 780px); margin: 0 auto; }
.timeline-item { display: grid; grid-template-columns: 22px 1fr; gap: 17px; position: relative; padding-bottom: 28px; }
.timeline-item::before { content: ""; position: absolute; top: 17px; bottom: -17px; left: 5px; width: 1px; background: var(--line); }
.timeline-item:last-child::before { display: none; }
.timeline-marker { z-index: 1; width: 11px; height: 11px; margin-top: 12px; border: 3px solid var(--paper); border-radius: 50%; background: var(--sage); box-shadow: 0 0 0 1px var(--sage); }
.record-card { padding: 24px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: rgba(255,253,248,.74); }
.record-meta { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; color: var(--ink-soft); font-size: .72rem; }
.status { display: inline-flex; align-items: center; padding: 5px 10px; border-radius: 999px; font-size: .68rem; white-space: nowrap; }
.status.waiting { color: #846550; background: #f3e8dc; }
.status.responded { color: var(--sage-deep); background: var(--sage-pale); }
.silent-day-body { display: flex; align-items: center; gap: 13px; padding: 14px 0 4px; color: var(--ink-soft); }
.silent-day-mark { display: grid; place-items: center; width: 30px; height: 30px; flex: 0 0 auto; border: 1px solid rgba(27,154,116,.4); border-radius: 50%; color: var(--sage-deep); font-size: .9rem; }
.silent-day-body p { margin: 0; font: 400 1.02rem var(--serif); }
.silent-inbox-note { margin: 0; color: var(--ink-soft); font-style: italic; }
.checkin-notes-block { width: min(100%, 780px); margin: 0 auto 26px; }
.checkin-notes-block h3 { margin: 0 0 12px; font-size: .8rem; color: var(--researcher-deep); }
.checkin-note-card { margin-bottom: 12px; padding: 16px 18px; border-left: 3px solid var(--researcher); border-radius: 0 14px 14px 0; background: rgba(220,238,250,.5); }
.checkin-note-card .eyebrow { margin: 0 0 6px; }
.checkin-note-card p:last-child { margin: 0; color: var(--ink); line-height: 1.8; font-size: .8rem; }
.record-text { margin: 0; white-space: pre-wrap; font: 400 .95rem/1.9 var(--serif); }
.record-image { display: block; width: 100%; max-height: 420px; margin-top: 17px; border-radius: var(--radius-md); object-fit: cover; }
.record-image-gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 17px; }
.record-image-gallery.count-1 { grid-template-columns: 1fr; }
.record-image-gallery .record-image { height: 100%; min-height: 180px; margin: 0; object-fit: cover; }
.share-label { margin: 15px 0 0; color: var(--sage-deep); font-size: .7rem; }
.observer-response { margin-top: 22px; padding: 20px; border-left: 2px solid var(--sage); background: rgba(223,232,223,.4); }
.observer-response span { color: var(--sage-deep); font-size: .7rem; font-weight: 600; letter-spacing: .08em; }
.observer-response p { margin: 9px 0 0; white-space: pre-wrap; font: 400 .9rem/1.9 var(--serif); }

.shared-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    align-items: start;
    gap: clamp(54px, 7vw, 92px) 22px;
    padding: 8px 0 58px;
}
.shared-card {
    grid-column: var(--share-start, 1) / span var(--share-columns, 6);
    align-self: start;
    min-width: 0;
    height: auto;
    padding: clamp(24px, 3vw, 34px);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: rgba(255,253,248,.72);
    transform: translateY(var(--share-shift, 0)) rotate(var(--share-rotation, 0deg));
    transform-origin: center;
}
.shared-card--compact { border-radius: 30px 19px 27px 22px; }
.shared-card--medium { border-radius: 23px 32px 21px 29px; }
.shared-card--long { border-radius: 31px 21px 35px 19px; }
.shared-card--wide { border-radius: 25px 34px 23px 31px; }
.quote-mark { display: block; height: 30px; color: var(--sage); font: 3rem/1 var(--serif); }
.shared-card-header {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 24px;
    margin-bottom: clamp(27px, 3vw, 39px);
}
.shared-member-link {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    color: var(--ink);
    background: transparent;
    cursor: pointer;
    text-align: left;
}
.shared-member-link:hover .shared-member-name,
.shared-member-link:focus-visible .shared-member-name { color: var(--member-deep); }
.shared-member-avatar {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    flex: 0 0 auto;
    border-radius: 46% 54% 44% 56%;
    color: #fff;
    background: var(--member-deep);
    font-size: .9rem;
    font-weight: 800;
}
.shared-member-avatar.has-image { background-size: cover; background-position: center; }
.shared-member-copy {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: baseline;
    column-gap: 10px;
    row-gap: 2px;
    min-width: 0;
}
.shared-member-name {
    overflow: hidden;
    font-size: 1rem;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color .18s ease;
}
.shared-member-code {
    color: var(--member-deep);
    font-size: .67rem;
    font-weight: 700;
    letter-spacing: .08em;
    white-space: nowrap;
}
.shared-member-hint {
    grid-column: 1/-1;
    display: block;
    margin: 4px 0 0 !important;
    color: var(--ink-soft);
    font-size: .61rem;
}
.shared-card-date {
    display: grid;
    justify-items: end;
    gap: 3px;
    min-width: max-content;
    padding-left: 18px;
    border-left: 1px solid rgba(27,154,116,.18);
}
.shared-card-date strong {
    color: var(--member-deep);
    font-size: .72rem;
    letter-spacing: .1em;
    white-space: nowrap;
}
.shared-card-date span {
    color: var(--ink-soft);
    font-size: .63rem;
    letter-spacing: .13em;
}
.shared-card-body {
    position: relative;
    z-index: 1;
    min-height: 0;
    margin: 0 0 28px;
    white-space: pre-wrap;
    font: 400 .94rem/1.9 var(--serif);
}
.shared-visibility-note {
    position: relative;
    z-index: 1;
    display: block;
    margin: 24px 0 0;
    padding-top: 16px;
    border-top: 1px solid rgba(27,154,116,.13);
    color: var(--ink-soft);
    font-size: .66rem;
    line-height: 1.6;
}
.shared-ai-reply { position: relative; z-index: 1; margin: 14px 0 0; padding: 14px 16px; border-left: 3px solid var(--researcher); border-radius: 0 14px 14px 0; background: rgba(220,238,250,.55); }
.shared-ai-reply span { display: block; margin-bottom: 6px; color: var(--researcher-deep); font-size: .68rem; font-weight: 800; }
.shared-ai-reply p { margin: 0; color: var(--ink); white-space: pre-wrap; font: 400 .84rem/1.85 var(--serif); }
.public-share-card .record-image-gallery { position: relative; z-index: 1; }
.atmosphere-card { grid-column: span 1; }
.atmosphere-card h3 { margin: 8px 0 18px; font: 500 1.12rem var(--serif); }
.echo-themes { display: grid; gap: 9px; }
.echo-themes p { margin: 0; padding: 11px 13px; border-radius: 10px; background: var(--paper); font: 400 .82rem/1.6 var(--serif); }

.empty-state { grid-column: 1/-1; padding: 76px 20px; text-align: center; color: var(--ink-soft); }
.empty-state h3 { margin: 18px 0 6px; color: var(--ink); font: 500 1.15rem var(--serif); }
.empty-state p { margin: 0; font-size: .8rem; }
.empty-orbit { width: 38px; height: 38px; margin: auto; border: 1px solid var(--sage); border-radius: 50%; box-shadow: 12px 0 0 -1px var(--paper), 12px 0 0 0 var(--sage); opacity: .6; }

.observer-app { padding: 54px 0 90px; }
.observer-heading { align-items: center; }
.observer-heading-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px; }
.observer-heading-actions small { color: var(--ink-soft); font-size: .78rem; line-height: 1.5; }
.observer-heading-actions .button { white-space: nowrap; }
@media (max-width: 700px) {
    .observer-heading-actions { justify-content: flex-start; }
    .observer-heading-actions small { flex-basis: 100%; order: 3; }
}
.observer-heading > div > p:last-child { margin-top: 12px; text-align: left; }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 42px; }
.metrics article { padding: 20px 22px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: rgba(255,253,248,.72); }
.metrics span { display: block; color: var(--ink-soft); font-size: .72rem; }
.metrics strong { display: block; margin-top: 8px; font: 500 2rem var(--serif); }
.inbox-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.filter-tabs { display: flex; gap: 6px; }
#inbox-count { color: var(--ink-soft); font-size: .72rem; }
.observer-inbox { display: grid; gap: 18px; }
.inbox-card { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-xl); background: rgba(255,253,248,.82); box-shadow: var(--shadow-small); }
.inbox-card.attention { border-color: rgba(184,117,91,.6); }
.inbox-card > header { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.person { display: flex; align-items: center; gap: 12px; }
.person > span { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; color: var(--sage-deep); background: var(--sage-pale); font-family: var(--serif); }
.person strong, .person small { display: block; }
.person strong { font-size: .86rem; }
.person small { margin-top: 3px; color: var(--ink-soft); font-size: .68rem; }
.card-tags { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.risk-tag { padding: 5px 10px; border-radius: 999px; color: #8b4f43; background: var(--clay-pale); font-size: .68rem; }
.member-submission { padding: 28px 28px 10px; }
.member-submission > p { margin: 0; white-space: pre-wrap; font: 400 1rem/1.9 var(--serif); }
.member-submission .record-image { max-width: 520px; }
.draft-area { margin: 20px 28px; padding: 20px; border-radius: var(--radius-lg); background: rgba(223,232,223,.45); }
.draft-area > div { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.draft-area span { color: var(--sage-deep); font-size: .75rem; font-weight: 600; }
.draft-area small { color: var(--ink-soft); font-size: .67rem; }
.draft-area textarea { min-height: 280px; max-height: 62dvh; resize: vertical; border-color: rgba(115,141,125,.28); background: rgba(255,255,255,.7); font: 400 .88rem/1.8 var(--serif); }
.inbox-card > footer { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 0 28px 24px; }
.observer-share { color: var(--ink-soft); font-size: .75rem; }
.observer-share-control { display: flex; flex-direction: column; align-items: flex-start; gap: 9px; }
.observer-share { cursor: default; }
.observer-share input:disabled + span { opacity: 1; }
.observer-share.private-status { opacity: .62; }
.share-approval-action { color: var(--researcher-deep); border-color: rgba(55,127,189,.34); background: var(--researcher-pale); }
.share-approval-action.approved { color: #8b4f43; border-color: rgba(184,92,43,.28); background: rgba(255,230,210,.66); }
.response-actions, .safety-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }

.safety-panel { margin: 20px 28px; padding: 20px; border: 1px solid rgba(184,117,91,.55); border-radius: var(--radius-lg); background: var(--clay-pale); }
.safety-panel.critical { border-width: 2px; background: #f4ddd7; }
.safety-panel h3 { margin: 0 0 8px; color: #7d4137; font: 600 1rem var(--serif); }
.safety-panel > p { margin: 0 0 15px; color: #725b54; font-size: .74rem; line-height: 1.75; }
.safety-panel > small { display: block; margin: 12px 0; color: #86675e; font-size: .65rem; line-height: 1.6; }
.safety-panel textarea { min-height: 100px; margin: 8px 0; border-color: rgba(184,117,91,.35); background: rgba(255,255,255,.7); font-size: .78rem; }
.safety-flow { display: flex; flex-wrap: wrap; gap: 6px; }
.safety-flow span { padding: 6px 9px; border: 1px solid rgba(184,117,91,.3); border-radius: 999px; color: #8c746d; background: rgba(255,255,255,.55); font-size: .61rem; }
.safety-flow span.complete { color: #fff; border-color: #8b4f43; background: #8b4f43; }
.safety-actions { margin-top: 10px; justify-content: flex-start; }

.version-history, .interaction-history { margin: 14px 28px; padding: 15px 18px; border: 1px solid var(--line); border-radius: var(--radius-md); background: rgba(255,253,248,.6); }
.version-history summary, .interaction-history summary { color: var(--sage-deep); cursor: pointer; font-size: .73rem; font-weight: 600; }
.version-list { display: grid; gap: 10px; margin-top: 14px; }
.version-list article { padding: 14px; border-left: 3px solid var(--sage); border-radius: 8px; background: var(--paper); }
.version-list article > div { display: flex; justify-content: space-between; gap: 12px; }
.version-list strong { font-size: .69rem; }
.version-list time { color: var(--ink-soft); font-size: .62rem; }
.version-list p { margin: 9px 0 0; white-space: pre-wrap; font: 400 .76rem/1.7 var(--serif); }
.interaction-history ol { display: grid; gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; }
.interaction-history li { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.interaction-history li:last-child { border: 0; }
.interaction-history strong { font-size: .68rem; }
.interaction-history time { color: var(--ink-soft); font-size: .62rem; }

@media (max-width: 840px) {
    .auth-layout { grid-template-columns: 1fr; }
    .auth-story { min-height: 42vh; padding: 60px 28px 48px; }
    .auth-story .brand-mark { width: 48px; height: 48px; margin-bottom: 28px; }
    .auth-story .brand-mark span:nth-child(2) { transform: translateX(13px); }
    .auth-story .brand-mark span:nth-child(3) { transform: translate(6px, 11px); }
    .auth-story h1 { font-size: 2.8rem; }
    .auth-story .lead { margin: 20px 0 0; font-size: .95rem; }
    .auth-panel { padding: 42px 24px 60px; border: 0; border-top: 1px solid var(--line); }
    .topbar { padding: 0 20px; }
    .brand small { display: none; }
    .member-app, .observer-app { width: min(100% - 28px, 1180px); }
    .section-heading { display: block; }
    .section-heading > p { margin-top: 12px; text-align: left; }
    .metrics { grid-template-columns: repeat(2, 1fr); }
    .shared-grid {
        display: block;
        padding-bottom: 22px;
    }
    .shared-card {
        width: var(--share-mobile-width, 88%);
        margin: 0 0 58px;
        transform: rotate(var(--share-rotation, 0deg));
    }
    .shared-card:nth-of-type(even) { margin-left: auto; }
    .shared-card--compact { --share-mobile-width: 74%; }
    .shared-card--medium { --share-mobile-width: 85%; }
    .shared-card--long { --share-mobile-width: 94%; }
    .shared-card--wide { --share-mobile-width: 100%; }
    .group-recap-card {
        width: 100%;
        margin-left: 0;
    }
}

@media (max-width: 560px) {
    .topbar { height: 68px; }
    .brand-mark.small { width: 24px; height: 24px; margin-right: 10px; }
    .identity > div:not(.avatar) { display: none; }
    .identity-profile-entry { padding: 2px; }
    .identity-profile-copy { display: none; }
    .avatar { width: 32px; height: 32px; }
    .daily-card-dialog { width: min(96vw, 470px); }
    .daily-card-panel { padding: 10px; border-radius: 27px; }
    .daily-card { min-height: 570px; padding: 28px 24px 26px; border-width: 3px; border-radius: 23px; }
    .daily-card-close { top: 19px; right: 19px; }
    .daily-card-header { padding-right: 35px; }
    .daily-card-mark { width: 52px !important; height: 52px !important; }
    .daily-card::before { background: linear-gradient(90deg, rgba(255,250,239,.94) 0%, rgba(255,250,239,.86) 59%, rgba(255,250,239,.2) 100%); }
    .daily-card blockquote { margin-top: 132px; }
    .daily-card blockquote p:first-child { font-size: clamp(1.62rem, 8vw, 2.25rem); }
    .daily-card blockquote p[lang="en"] { width: 94%; font-size: .88rem; }
    .daily-card footer { left: 24px; bottom: 27px; }
    .daily-card-accept { margin-top: 10px; }
    .member-app { padding-top: 20px; }
    .member-nav { position: sticky; z-index: 10; top: 68px; justify-content: flex-start; margin: 0 -14px 42px; padding: 10px 8px; overflow-x: auto; border-radius: 0; background: rgba(243,240,232,.94); backdrop-filter: blur(14px); scrollbar-width: none; }
    .member-nav::-webkit-scrollbar { display: none; }
    .nav-button { flex: 0 0 auto; padding: 8px 11px; font-size: .7rem; }
    .welcome-block { text-align: left; }
    .welcome-block h1 { font-size: 1.75rem; }
    .composer { padding: 20px; border-radius: 22px; }
    .composer textarea { min-height: 180px; }
    .submitted-state { margin: 54px auto; }
    .metrics { grid-template-columns: 1fr; }
    .shared-card { padding: 22px 20px; }
    .shared-card--compact { --share-mobile-width: 88%; }
    .shared-card--medium { --share-mobile-width: 94%; }
    .shared-card--long, .shared-card--wide { --share-mobile-width: 100%; }
    .shared-card-header {
        grid-template-columns: 1fr;
        gap: 15px;
        margin-bottom: 28px;
    }
    .shared-member-link {
        grid-template-columns: 46px minmax(0, 1fr);
        gap: 12px;
    }
    .shared-member-avatar { width: 46px; height: 46px; }
    .shared-card-date {
        grid-auto-flow: column;
        justify-content: start;
        justify-items: start;
        align-items: baseline;
        gap: 10px;
        padding: 12px 0 0;
        border-top: 1px solid rgba(27,154,116,.18);
        border-left: 0;
    }
    .timeline-item { grid-template-columns: 13px 1fr; gap: 10px; }
    .record-card { padding: 19px; }
    .record-meta { align-items: flex-start; }
    .observer-app { padding-top: 34px; }
    .notebook-workspace { grid-template-columns: minmax(0, 1fr) 44px; gap: 7px; }
    .notebook-shell { border-radius: 0; }
    .notebook-cover { display: block; padding: 0 0 21px; }
    .notebook-days { padding: 8px 0 0; }
    .notebook-day > summary { gap: 8px; }
    .notebook-block { grid-template-columns: minmax(0, 1fr) 30px; gap: 5px; padding-left: 10px; }
    .notebook-current-editor { margin: 8px 0 0; }
    .notebook-tool-dock { top: 50%; right: 5px; width: 44px; margin: 0; gap: 9px; transform: translateY(-50%); }
    .notebook-tool { width: 42px; height: 42px; }
    .notebook-tool svg { width: 21px; height: 21px; }
    .notebook-inline-sketch { margin: 0; border-radius: 0; }
    .notebook-sketch-toolbar { gap: 9px; }
    #notebook-sketch-status { display: none; }
    .notebook-reflection-guide { padding: 16px 0 8px; }
    .reflection-window-callout { align-items: flex-start; flex-direction: column; gap: 5px; }
    .reflection-panel { padding: 21px 17px; border-radius: 23px; }
    .reflection-panel > header { display: block; }
    #reflection-window-badge { display: inline-block; margin-top: 12px; }
    .reflection-panel > footer { grid-template-columns: 1fr; }
    .journey-tabs, .shared-tabs { gap: 8px; }
    .journey-tab { min-height: 52px; padding: 10px 5px; border-radius: 16px; font-size: .71rem; }
    .shared-tab { min-height: 54px; padding: 10px; border-radius: 16px; font-size: .74rem; }
    .share-choice-group { grid-template-columns: 1fr; }
    .journey-pane-heading { display: block; }
    .journey-pane-heading > p { margin: 8px 0 0 46px; }
    .today-selected-media { grid-template-columns: 1fr; }
    .today-selected-media img { height: auto; max-height: 330px; }
    .observer-heading { display: block; }
    .observer-heading .button { margin-top: 20px; }
    .metrics { grid-template-columns: repeat(2, 1fr); gap: 9px; }
    .metrics article { padding: 16px; }
    .inbox-toolbar { align-items: flex-end; }
    .filter-button { padding: 8px 11px; }
    .inbox-card > header { align-items: flex-start; padding: 18px; }
    .card-tags { max-width: 120px; }
    .member-submission { padding: 22px 18px 8px; }
    .draft-area { margin: 18px; padding: 16px; }
    .draft-area > div { display: block; }
    .draft-area small { display: block; margin-top: 4px; }
    .inbox-card > footer { display: grid; padding: 0 18px 20px; }
    .inbox-card > footer .button { width: 100%; }
    .response-actions { display: grid; }
    .safety-panel, .version-history, .interaction-history { margin-left: 18px; margin-right: 18px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

/* Research platform modules */
select, input[type="date"] {
    min-height: 42px;
    padding: 0 13px;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--ink);
    background: var(--surface);
    outline: none;
}

.inline-action {
    margin-top: 14px;
    padding: 0;
    border: 0;
    color: var(--sage-deep);
    background: none;
    cursor: pointer;
    font-size: .7rem;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.weekly-list { display: grid; gap: 18px; width: min(100%, 820px); margin: 0 auto; }
.weekly-card { padding: 28px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: rgba(255,253,248,.78); box-shadow: var(--shadow-small); }
.weekly-card h2 { margin: 0 0 16px; font: 500 1.25rem var(--serif); }
.weekly-body { margin: 14px 0 0; white-space: pre-wrap; font: 400 .9rem/1.9 var(--serif); }
.group-recap-card {
    grid-column: 1/-1;
    border-color: rgba(115,141,125,.55);
    background: rgba(223,232,223,.44);
    transform: none;
}
.group-recap-card h3 { margin: 6px 0 4px; font: 500 1.15rem var(--serif); }
.group-recap-card > p {
    min-height: auto;
    margin: 8px 0 0;
    white-space: pre-wrap;
    font: 400 .92rem/1.85 var(--serif);
}

.research-nav {
    position: sticky;
    z-index: 15;
    top: 76px;
    display: flex;
    gap: 5px;
    margin: -20px 0 44px;
    padding: 12px;
    border: 1px solid rgba(220,216,205,.75);
    border-radius: 999px;
    background: rgba(243,240,232,.94);
    backdrop-filter: blur(18px);
}

.research-nav-button {
    flex: 1;
    min-height: 38px;
    padding: 0 14px;
    border: 0;
    border-radius: 999px;
    color: var(--ink-soft);
    background: transparent;
    cursor: pointer;
    font-size: .78rem;
}
.research-nav-button.active { color: #fff; background: var(--sage-deep); font-weight: 600; }
.research-section { display: none; }
.research-section.active { display: block; animation: enter .3s ease both; }
.heading-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 9px; }

.privacy-banner {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: -18px 0 24px;
    padding: 14px 18px;
    border: 1px solid rgba(115,141,125,.35);
    border-radius: var(--radius-md);
    background: rgba(223,232,223,.48);
    color: var(--ink-soft);
    font-size: .74rem;
    line-height: 1.6;
}
.privacy-banner strong { color: var(--sage-deep); white-space: nowrap; }

.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.chart-card { min-width: 0; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: rgba(255,253,248,.8); }
.chart-card.wide { grid-column: 1/-1; }
.chart-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; margin-bottom: 22px; }
.chart-heading h2 { margin: 0; font: 500 1rem var(--serif); }
.chart-heading p { margin: 5px 0 0; color: var(--ink-soft); font-size: .68rem; }
.chart-legend { display: flex; gap: 14px; color: var(--ink-soft); font-size: .65rem; }
.chart-legend span::before { content: ""; display: inline-block; width: 9px; height: 9px; margin-right: 5px; border-radius: 2px; background: var(--sage); }
.chart-legend .legend-emotion::before { border-radius: 50%; background: var(--clay); }
.trend-chart h3 { margin: 20px 0 10px; color: var(--ink-soft); font-size: .67rem; font-weight: 500; }
.activity-bars { display: flex; align-items: flex-end; gap: 2px; height: 92px; padding-top: 8px; border-bottom: 1px solid var(--line); }
.activity-bars span { position: relative; flex: 1; min-width: 2px; border-radius: 2px 2px 0 0; background: var(--sage); }
.activity-bars span[data-label]::after { content: attr(data-label); position: absolute; left: 0; top: calc(100% + 4px); color: var(--ink-soft); font-size: 8px; }
.trend-chart svg { display: block; width: 100%; max-height: 190px; overflow: visible; }
.trend-chart svg text { fill: var(--ink-soft); font: 9px var(--sans); }
.chart-grid { stroke: #e8e4db; stroke-width: 1; }
.zero-grid { stroke: #a8aea9; stroke-width: 1.2; }
.emotion-line { fill: none; stroke: var(--clay); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.trend-chart circle { fill: var(--surface); stroke: var(--clay); stroke-width: 2; }
.sparse-note { padding: 14px; border-radius: 12px; background: var(--paper); color: var(--ink-soft); font-size: .72rem; line-height: 1.7; }
.sparse-days { display: grid; gap: 7px; }
.sparse-days > div { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: .72rem; }
.sparse-days strong { font-weight: 600; }
.sparse-days em { color: var(--ink-soft); font-style: normal; text-align: right; }
.bar-chart { display: grid; gap: 13px; }
.bar-row { display: grid; grid-template-columns: 92px 1fr 28px; align-items: center; gap: 10px; font-size: .7rem; }
.bar-row > div { height: 10px; overflow: hidden; border-radius: 999px; background: var(--paper-deep); }
.bar-row i { display: block; height: 100%; border-radius: inherit; background: var(--sage); }
.bar-row strong { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .7rem; }
th, td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
th { color: var(--ink-soft); font-weight: 500; }
.method-note { margin: 16px 2px 0; color: var(--ink-soft); font-size: .65rem; line-height: 1.7; }

.coding-strip { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 18px; }
.coding-strip span { padding: 5px 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-soft); background: var(--paper); font-size: .65rem; }
.coding-strip .theme-chip { color: var(--sage-deep); border-color: rgba(115,141,125,.35); background: var(--sage-pale); }
.research-note-area { margin: 0 28px 20px; padding: 15px 18px; border: 1px dashed var(--line); border-radius: var(--radius-md); }
.research-note-area summary { color: var(--sage-deep); cursor: pointer; font-size: .73rem; font-weight: 600; }
.research-note-area textarea { min-height: 110px; margin: 14px 0 10px; font-size: .8rem; }

.research-timeline { display: grid; gap: 14px; }
.timeline-research-card { padding: 22px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: rgba(255,253,248,.78); }
.timeline-research-head { display: flex; justify-content: space-between; gap: 15px; margin-bottom: 14px; }
.timeline-research-head strong { font-size: .82rem; }
.timeline-research-head time { color: var(--ink-soft); font-size: .68rem; }
.coding-detail { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 18px; }
.coding-detail > div { padding: 12px; border-radius: 10px; background: var(--paper); }
.coding-detail span, .coding-detail strong { display: block; }
.coding-detail span { color: var(--ink-soft); font-size: .63rem; }
.coding-detail strong { margin-top: 4px; font: 500 1.05rem var(--serif); }
.coding-detail > p { grid-column: 1/-1; margin: 2px 0 0; color: var(--ink-soft); font-size: .67rem; }
.timeline-note { margin-top: 13px; padding: 13px; border-left: 2px solid var(--clay); background: var(--clay-pale); white-space: pre-wrap; font-size: .72rem; line-height: 1.7; }

.weekly-workspace { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.weekly-workspace > .workspace-card:nth-child(3) { grid-column: 1 / -1; }
.weekly-workspace > .workspace-card:nth-child(-n+2) { display: flex; flex-direction: column; }
.weekly-workspace > .workspace-card:nth-child(-n+2) > p { min-height: 3.4em; text-align: left; }
.weekly-workspace > .workspace-card:nth-child(-n+2) > .form-row { align-items: center; margin-top: auto; }
.weekly-workspace .weekly-generation-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(170px, .88fr);
    gap: 14px;
    width: 100%;
}
.weekly-workspace .weekly-generation-controls select,
.weekly-workspace .weekly-generation-controls input[type="date"] {
    width: 100%;
    min-width: 0;
    min-height: 52px;
}
.weekly-workspace .weekly-generation-controls > .button {
    grid-column: 1;
    justify-self: start;
    min-height: 52px;
}
.workspace-card, .prompt-editor-card { padding: 25px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: rgba(255,253,248,.8); }
.workspace-card h2, .prompt-editor-card h2 { margin: 0 0 10px; font: 500 1.05rem var(--serif); }
.workspace-card > p { margin: 0 0 18px; color: var(--ink-soft); font-size: .72rem; line-height: 1.7; }
.form-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.form-row select { flex: 1; min-width: 170px; }
.editor-meta { margin: 12px 0 8px; color: var(--ink-soft); font-size: .68rem; }
#weekly-editor, #group-weekly-editor { min-height: 230px; font: 400 .82rem/1.8 var(--serif); }
#weekly-editor-wrap .button, #group-weekly-editor-wrap .button { margin-top: 10px; }
.section-subheading { margin: 38px 0 16px; }
.section-subheading h2 { font: 500 1.1rem var(--serif); }
.compact-weekly { padding: 20px; }
.compact-weekly .status { float: right; margin-top: -31px; }

.private-status-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.private-status-grid article { min-width: 0; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: rgba(255,253,248,.78); }
.private-status-grid span, .private-status-grid strong, .private-status-grid small { display: block; }
.private-status-grid span { color: var(--ink-soft); font-size: .68rem; }
.private-status-grid strong { margin: 9px 0 6px; overflow-wrap: anywhere; font: 500 .95rem/1.5 var(--serif); }
.private-status-grid small { color: var(--ink-soft); font-size: .65rem; line-height: 1.6; }
.invite-workspace { margin-top: 16px; }
.invite-heading p { margin: 0; color: var(--ink-soft); font-size: .72rem; line-height: 1.7; }
.invite-workspace .form-row input { flex: 2; min-width: 220px; }
.invite-workspace .form-row select { flex: 0 0 110px; min-width: 110px; }
.section-subheading { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.section-subheading p { margin: 0; color: var(--ink-soft); font-size: .68rem; }
.invite-list { display: grid; gap: 10px; }
.invite-card { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(210px, auto) auto; align-items: center; gap: 14px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius-md); background: rgba(255,253,248,.78); }
.invite-card strong, .invite-card small { display: block; }
.invite-card strong { font-size: .8rem; }
.invite-card small { margin-top: 5px; color: var(--ink-soft); font-size: .65rem; }
.invite-code { padding: 8px 12px; border: 1px dashed rgba(77,107,90,.5); border-radius: 9px; color: var(--sage-deep); background: var(--sage-pale); cursor: pointer; font: 600 .72rem ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .06em; }
.invite-card .stop-invite { margin: 0; padding-left: 14px; }

.engine-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.engine-grid article { padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-md); background: rgba(255,253,248,.76); }
.engine-grid article.engine-privacy { border-color: rgba(115,141,125,.4); background: var(--sage-pale); }
.engine-grid article.engine-connection.available { border-color: rgba(115,141,125,.55); background: var(--sage-pale); }
.engine-grid article.engine-connection.unavailable { border-color: rgba(184,117,91,.55); background: var(--clay-pale); }
.engine-grid h3 { margin: 0; font: 500 .85rem var(--serif); }
.engine-grid p { margin: 7px 0 0; color: var(--ink-soft); font-size: .68rem; line-height: 1.6; }
.prompt-editor-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; }
.prompt-editor-heading p { margin: 0; color: var(--ink-soft); font-size: .68rem; }
.prompt-editor-list { display: grid; gap: 18px; }
.prompt-purpose { margin: 12px 0 0; color: var(--ink-soft); font-size: .72rem; line-height: 1.7; }
.prompt-editor { min-height: 440px; margin-top: 18px; font: 400 .76rem/1.65 ui-monospace, SFMono-Regular, Menlo, monospace; }
.agent-config-scope-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px; }
.agent-config-scope-row label { margin: 0; }
.agent-config-version { flex: 1 1 160px; color: var(--ink-soft); font-size: .66rem; }
.agent-config-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.agent-config-grid label { margin: 0; }
.agent-response-presets { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-top: 18px; }
.agent-response-presets strong { margin-right: 3px; color: var(--ink-soft); font-size: .7rem; }
.agent-custom-instruction { display: grid; gap: 8px; margin-top: 18px; }
.agent-custom-instruction textarea { min-height: 92px; resize: vertical; }
.agent-config-fieldset { margin: 22px 0 0; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius-md); }
.agent-config-fieldset legend { padding: 0 8px; color: var(--ink-soft); font-size: .68rem; font-weight: 800; }
.agent-config-toggles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.agent-toggle.locked { opacity: .72; cursor: not-allowed; }
.agent-toggle { display: flex !important; align-items: flex-start; gap: 10px; margin: 0 !important; padding: 11px 13px; border: 1px solid var(--line); border-radius: var(--radius-md); background: rgba(255,253,248,.7); cursor: pointer; }
.agent-toggle input { flex: 0 0 auto; margin-top: 2px; }
.agent-toggle span { display: grid; gap: 3px; font-size: .7rem; font-weight: 700; }
.agent-toggle small { color: var(--ink-soft); font-size: .6rem; font-weight: 400; line-height: 1.5; }
.agent-toggle.danger { border-color: rgba(184,117,91,.5); background: var(--clay-pale); }
.agent-config-history { margin-top: 22px; }
.agent-config-history summary { cursor: pointer; color: var(--member-deep); font-size: .72rem; font-weight: 800; }
.agent-config-history-list { display: grid; gap: 9px; margin-top: 13px; }
.config-version-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 11px 14px; border: 1px solid var(--line); border-radius: var(--radius-md); font-size: .68rem; }
.config-version-row.active { border-color: rgba(27,154,116,.5); background: var(--member-pale, var(--sage-pale)); }
.config-version-row button { margin-left: auto; }
.family-member-summary { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; }
.family-member-chip { padding: 9px 14px; border: 1px solid var(--line); border-radius: 999px; font-size: .68rem; background: rgba(255,253,248,.8); }
.member-onboarding-section { margin: 24px 0 30px; }
.member-onboarding-section .section-subheading { margin: 0 0 16px; }
.member-onboarding-section .section-subheading h3,
.family-relationship-subheading h3 { margin: 0; font-size: .82rem; }
.member-onboarding-section .section-subheading p,
.family-relationship-subheading p { margin: 5px 0 0; color: var(--ink-soft); font-size: .64rem; line-height: 1.6; }
.member-onboarding-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.member-onboarding-card { padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-md); background: rgba(255,253,248,.72); }
.member-onboarding-card header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 15px; }
.member-onboarding-card header > div { display: grid; gap: 4px; }
.member-onboarding-card header strong { font-size: .78rem; }
.member-onboarding-card header small { color: var(--ink-soft); font-size: .58rem; }
.member-onboarding-status { flex: 0 0 auto; padding: 4px 9px; border-radius: 999px; background: var(--clay-pale); color: #8c4f38; font-size: .54rem; font-weight: 800; }
.member-onboarding-status.complete { background: var(--sage-pale); color: var(--member-deep); }
.member-onboarding-details { display: grid; gap: 0; margin: 0; }
.member-onboarding-details > div { display: grid; grid-template-columns: minmax(110px, .36fr) minmax(0, 1fr); gap: 14px; padding: 10px 0; border-top: 1px solid rgba(154,144,126,.22); }
.member-onboarding-details dt { color: var(--ink-soft); font-size: .6rem; font-weight: 700; }
.member-onboarding-details dd { margin: 0; font-size: .64rem; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.family-relationship-subheading { margin: 30px 0 0; }

@media (max-width: 560px) {
    .member-onboarding-details > div { grid-template-columns: 1fr; gap: 4px; }
}
.family-relationship-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: end; }
.family-relationship-form label { margin: 0; }
.family-relationship-form .button { grid-column: span 3; justify-self: start; }
.family-relationship-list { display: grid; gap: 9px; margin: 16px 0; }
.family-relationship-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 11px 14px; border: 1px solid var(--line); border-radius: var(--radius-md); font-size: .68rem; }
.family-relationship-row strong { font-weight: 800; }
.family-relationship-row button { margin-left: auto; }
.agent-runs-list { display: grid; gap: 10px; margin-top: 16px; }
.agent-run-row { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-md); background: rgba(255,253,248,.72); font-size: .68rem; }
.agent-run-row header { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 7px; }
.agent-run-row header strong { font-size: .72rem; }
.agent-run-badge { padding: 3px 9px; border-radius: 999px; background: var(--sage-pale); color: var(--member-deep); font-size: .58rem; font-weight: 800; }
.agent-run-badge.family { background: var(--clay-pale); color: #8c4f38; }
.agent-run-row p { margin: 0; color: var(--ink-soft); line-height: 1.65; }

@media (max-width: 840px) {
    .research-nav { top: 68px; overflow-x: auto; border-radius: 16px; }
    .research-nav-button { flex: 0 0 auto; }
    .dashboard-grid, .weekly-workspace, .private-status-grid { grid-template-columns: 1fr; }
    .engine-grid { grid-template-columns: repeat(2, 1fr); }
    .agent-config-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .agent-config-toggles, .family-relationship-form { grid-template-columns: 1fr; }
    .family-relationship-form .button { grid-column: 1; }
    .observer-heading { align-items: flex-start; }
    .heading-actions { justify-content: flex-start; margin-top: 18px; }
}

@media (max-width: 560px) {
    .research-nav { margin-top: -18px; margin-bottom: 30px; padding: 8px; }
    .privacy-banner { align-items: flex-start; }
    .privacy-banner strong { white-space: normal; }
    .heading-actions { display: grid; grid-template-columns: 1fr 1fr; }
    .heading-actions select { grid-column: 1/-1; }
    .chart-card { padding: 18px; }
    .sparse-days > div { grid-template-columns: 1fr; }
    .sparse-days em { text-align: left; }
    .coding-detail { grid-template-columns: 1fr; }
    .coding-detail > p { grid-column: 1; }
    .engine-grid { grid-template-columns: 1fr; }
    .agent-config-grid { grid-template-columns: 1fr; }
    .agent-config-scope-row { display: grid; grid-template-columns: 1fr; }
    .agent-config-version { flex: none; }
    .prompt-editor-heading { display: block; }
    .prompt-editor-heading .button { margin-top: 14px; }
    .prompt-editor { min-height: 380px; }
    .invite-card { grid-template-columns: 1fr auto; }
    .invite-code { grid-column: 1/-1; grid-row: 2; text-align: left; overflow-wrap: anywhere; }
    .invite-card .stop-invite { grid-column: 2; grid-row: 1; }
}

/*
 * Permanent visual language
 * Participant = green · Researcher = blue · AI = warm orange.
 * The soft colour fields and fine grain are inspired by the supplied references.
 */
:root {
    --paper: #f8f5ea;
    --paper-deep: #eee9dc;
    --surface: rgba(255, 253, 246, .86);
    --ink: #243438;
    --ink-soft: #6f7b7b;
    --line: rgba(55, 76, 79, .14);
    --member: #1b9a74;
    --member-deep: #087058;
    --member-pale: #d9f3e7;
    --researcher: #377fbd;
    --researcher-deep: #205c91;
    --researcher-pale: #dceefa;
    --ai: #ef8a48;
    --ai-deep: #b85c2b;
    --ai-pale: #ffe6d2;
    --rose: #ef91a1;
    --sun: #f6cb55;
    --sage: var(--member);
    --sage-deep: var(--member-deep);
    --sage-pale: var(--member-pale);
    --clay: var(--ai);
    --clay-pale: var(--ai-pale);
    --shadow: 0 24px 70px rgba(33, 65, 68, .10);
    --shadow-small: 0 10px 30px rgba(33, 65, 68, .08);
    --radius-xl: 32px;
    --radius-lg: 24px;
    --radius-md: 16px;
    --sans: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
    --serif: var(--sans);
}

body {
    position: relative;
    font-family: var(--sans);
    font-weight: 400;
    background-color: var(--paper);
    background-image:
        radial-gradient(ellipse at 10% 4%, rgba(239,145,161,.25) 0, rgba(239,145,161,0) 30%),
        radial-gradient(ellipse at 88% 16%, rgba(246,203,85,.24) 0, rgba(246,203,85,0) 32%),
        radial-gradient(ellipse at 62% 100%, rgba(75,163,201,.18) 0, rgba(75,163,201,0) 34%);
    background-attachment: fixed;
}

body::before {
    content: "";
    position: fixed;
    z-index: 90;
    inset: 0;
    pointer-events: none;
    opacity: .13;
    background-image: radial-gradient(rgba(25,45,48,.55) .48px, transparent .7px);
    background-size: 3px 3px;
    mix-blend-mode: multiply;
}

body[data-role="member"] {
    background-image:
        radial-gradient(ellipse at 4% 8%, rgba(27,154,116,.20) 0, transparent 31%),
        radial-gradient(ellipse at 98% 24%, rgba(246,203,85,.19) 0, transparent 28%),
        radial-gradient(ellipse at 72% 95%, rgba(239,145,161,.14) 0, transparent 34%);
}

body[data-role="observer"] {
    background-image:
        radial-gradient(ellipse at 3% 6%, rgba(55,127,189,.22) 0, transparent 32%),
        radial-gradient(ellipse at 97% 26%, rgba(138,184,217,.25) 0, transparent 31%),
        radial-gradient(ellipse at 70% 100%, rgba(239,138,72,.10) 0, transparent 30%);
}

.auth-story {
    isolation: isolate;
    z-index: 91;
    background:
        radial-gradient(rgba(73,86,79,.16) .45px, transparent .7px) 0 0 / 4px 4px,
        radial-gradient(ellipse at 18% 24%, rgba(239,145,161,.86) 0 11%, transparent 31%),
        radial-gradient(ellipse at 75% 18%, rgba(74,157,191,.75) 0 15%, transparent 37%),
        radial-gradient(ellipse at 23% 78%, rgba(246,203,85,.78) 0 17%, transparent 38%),
        radial-gradient(ellipse at 80% 77%, rgba(27,154,116,.70) 0 15%, transparent 38%),
        #f6f2e7;
}
.auth-story::before {
    content: "";
    position: absolute;
    z-index: -1;
    width: 48%;
    aspect-ratio: .78;
    right: 6%;
    bottom: -8%;
    border-radius: 48% 52% 22% 78% / 54% 30% 70% 46%;
    background: linear-gradient(145deg, rgba(55,127,189,.78), rgba(27,154,116,.66) 43%, rgba(239,138,72,.73) 75%, rgba(239,145,161,.70));
    box-shadow: -12vw -11vw 0 -9vw rgba(246,203,85,.7);
    filter: blur(1px);
}
.auth-story::after { opacity: .32; }
.auth-story h1 {
    position: relative;
    width: max-content;
    color: #fffaef;
    background: none;
    -webkit-text-fill-color: #fffaef;
    font-size: clamp(4.35rem, 7vw, 7.5rem);
    font-weight: 900;
    line-height: .96;
    letter-spacing: .045em;
    text-shadow: none;
}
.auth-story .lead { color: rgba(36,52,56,.78); font-weight: 300; }
.auth-panel { background: rgba(255,253,246,.80); backdrop-filter: blur(24px); }
.auth-card h2, .welcome-block h1, .section-heading h1, .observer-heading h1 { font-weight: 700; }
.auth-card > .muted, .section-heading > p, .observer-heading > div > p:last-child { font-weight: 300; }

.topbar {
    border-bottom-color: rgba(55,76,79,.12);
    background: rgba(248,245,234,.82);
    box-shadow: 0 8px 30px rgba(33,65,68,.04);
}
body[data-role="member"] .topbar { border-bottom-color: rgba(27,154,116,.22); }
body[data-role="observer"] .topbar { border-bottom-color: rgba(55,127,189,.22); }
body[data-role="member"] .avatar { background: var(--member); }
body[data-role="observer"] .avatar { background: var(--researcher); }
body[data-role="member"] .brand-mark span { border-color: rgba(27,154,116,.75); }
body[data-role="observer"] .brand-mark span { border-color: rgba(55,127,189,.75); }

.member-nav {
    width: max-content;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding: 6px;
    border: 1px solid rgba(27,154,116,.18);
    border-radius: 999px;
    background: rgba(255,253,246,.62);
}
.nav-button.active { color: #fff; background: var(--member); box-shadow: 0 8px 20px rgba(27,154,116,.20); }
.member-app .button.primary { background: var(--member-deep); box-shadow: 0 10px 25px rgba(8,112,88,.22); }
.member-app input:focus, .member-app textarea:focus { border-color: var(--member); box-shadow: 0 0 0 4px rgba(27,154,116,.12); }
.composer, .record-card, .shared-card, .weekly-card {
    border-color: rgba(27,154,116,.17);
    background: rgba(255,253,246,.75);
    backdrop-filter: blur(16px);
}
.composer { box-shadow: 0 26px 70px rgba(8,112,88,.10); }
.composer-topline span:first-child, .photo-button, .share-label, .inline-action { color: var(--member-deep); }
.share-choice { background: linear-gradient(110deg, rgba(217,243,231,.82), rgba(246,203,85,.16)); }
.timeline-marker { border-color: var(--paper); background: var(--member); box-shadow: 0 0 0 1px var(--member); }
.public-share-card { position: relative; overflow: hidden; }
.public-share-card::after { content: ""; position: absolute; width: 90px; height: 90px; right: -26px; top: -35px; border-radius: 55% 45% 60% 40%; background: rgba(27,154,116,.13); }

.observer-response {
    border-left-color: var(--researcher);
    background: rgba(220,238,250,.66);
}
.observer-response span { color: var(--researcher-deep); }

.research-nav {
    border-color: rgba(55,127,189,.20);
    background: rgba(241,248,252,.88);
    box-shadow: 0 14px 34px rgba(32,92,145,.08);
}
.research-nav-button.active { color: #fff; background: var(--researcher); box-shadow: 0 8px 20px rgba(32,92,145,.22); }
.observer-app .button.primary { background: var(--researcher-deep); box-shadow: 0 10px 25px rgba(32,92,145,.20); }
.observer-app input:focus, .observer-app textarea:focus, .observer-app select:focus { border-color: var(--researcher); box-shadow: 0 0 0 4px rgba(55,127,189,.11); }
.metrics article, .inbox-card, .chart-card, .timeline-research-card, .workspace-card, .private-status-grid article, .invite-card {
    border-color: rgba(55,127,189,.16);
    background: rgba(255,253,246,.78);
    backdrop-filter: blur(14px);
}
.metrics strong { color: var(--researcher-deep); font-weight: 700; }
.filter-button.active { color: var(--researcher-deep); background: var(--researcher-pale); }
.person > span { color: var(--researcher-deep); background: var(--researcher-pale); }
.coding-strip .theme-chip { color: var(--researcher-deep); border-color: rgba(55,127,189,.24); background: var(--researcher-pale); }
.research-note-area summary, .version-history summary, .interaction-history summary { color: var(--researcher-deep); }
.activity-bars span, .bar-row i { background: var(--researcher); }
.chart-legend span::before { background: var(--researcher); }

.member-submission {
    margin: 18px 28px 8px;
    padding: 24px;
    border-left: 4px solid var(--member);
    border-radius: 18px;
    background: linear-gradient(110deg, rgba(217,243,231,.56), rgba(255,253,246,.42));
}
.draft-area {
    border: 1px solid rgba(239,138,72,.24);
    background: linear-gradient(115deg, rgba(255,230,210,.84), rgba(255,248,234,.68));
}
.draft-area span { color: var(--ai-deep); }
.draft-area textarea { border-color: rgba(239,138,72,.28); }
.button.ai-action { color: #fff; border: 0; background: var(--ai-deep); box-shadow: 0 9px 22px rgba(184,92,43,.20); }
.button.ai-action:hover:not(:disabled) { background: #9f4d24; }
.version-list article { border-left-color: var(--researcher); }
.version-list article.version-ai-draft { border-left-color: var(--ai); background: rgba(255,230,210,.52); }
.version-list article.version-researcher-edit, .version-list article.version-final { border-left-color: var(--researcher); background: rgba(220,238,250,.45); }

#research-ai-section .observer-heading .eyebrow,
#research-ai-section .observer-heading h1,
#research-ai-section .prompt-editor-heading h2 { color: var(--ai-deep); }
#research-ai-section .engine-grid article,
#research-ai-section .prompt-editor-card { border-color: rgba(239,138,72,.25); background: rgba(255,246,234,.78); }
#research-ai-section .engine-grid article.engine-connection.available,
#research-ai-section .engine-grid article.engine-privacy { border-color: rgba(239,138,72,.32); background: var(--ai-pale); }
#research-ai-section .button.primary { background: var(--ai-deep); box-shadow: 0 10px 24px rgba(184,92,43,.20); }
#research-ai-section .prompt-editor:focus { border-color: var(--ai); box-shadow: 0 0 0 4px rgba(239,138,72,.12); }

.eyebrow { font-weight: 700; }
.record-text, .member-submission > p, .draft-area textarea, .weekly-body, .observer-response p { font-weight: 300; }
.button, .nav-button.active, .research-nav-button.active { font-weight: 700; }

.draft-explainer {
    margin: 14px 0 20px;
    color: var(--ink-soft);
    font-size: .76rem;
    font-weight: 300;
    line-height: 1.75;
}
.submission-window-note {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 18px;
    padding: 13px 16px;
    border: 1px solid rgba(27,154,116,.20);
    border-radius: 16px;
    background: rgba(217,243,231,.58);
    color: var(--ink-soft);
    font-size: .72rem;
    line-height: 1.55;
}
.submission-window-note strong { flex: 0 0 auto; color: var(--member-deep); font-size: .74rem; }
.submission-window-note.closed { border-color: rgba(239,138,72,.28); background: rgba(255,230,210,.58); }
.submission-window-note.closed strong { color: var(--ai-deep); }

.response-schedule-controls input[type="datetime-local"] {
    width: 100%;
    height: 44px;
    padding: 0 13px;
    border: 1px solid rgba(55,127,189,.22);
    border-radius: 13px;
    color: var(--ink);
    background: rgba(255,255,255,.78);
}

.draft-area > .response-timing-panel {
    display: grid;
    align-items: stretch;
    gap: 12px;
    margin: 14px 0 0;
    padding: 15px;
    border: 1px solid rgba(239,138,72,.24);
    border-radius: 16px;
    background: rgba(255,248,234,.82);
}
.timing-advice-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.timing-advice-heading strong { color: var(--ai-deep); font-size: .75rem; }
.timing-advice-heading em { padding: 5px 9px; border-radius: 999px; color: var(--ai-deep); background: var(--ai-pale); font-size: .64rem; font-style: normal; font-weight: 700; }
.response-timing-panel > p { margin: 0; color: #79513a; font-size: .72rem; line-height: 1.65; }
.response-schedule-controls { display: grid; grid-template-columns: minmax(230px, 1fr) auto; align-items: end; gap: 10px; }
.response-schedule-controls label { margin: 0 !important; }
.response-schedule-controls label span { display: block; margin-bottom: 7px; color: var(--ink-soft); font-size: .66rem; }
.response-schedule-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.scheduled-response-note { margin: 0 !important; padding: 10px 12px; border-radius: 12px; color: var(--researcher-deep) !important; background: var(--researcher-pale); font-weight: 700; }
.timing-safety-note { color: #934a35 !important; background: rgba(255,230,210,.75) !important; }
.draft-segments { display: grid; gap: 12px; }
.draft-segment {
    padding: 16px 17px 10px;
    border: 1px solid rgba(27,154,116,.16);
    border-radius: 18px;
    background: rgba(233,247,239,.42);
}
.draft-segment-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.draft-segment-heading strong { color: var(--member-deep); font-size: .74rem; letter-spacing: .04em; }
.draft-segment-heading small { padding: 4px 8px; border-radius: 999px; color: var(--member-deep); background: rgba(217,243,231,.85); font-size: .62rem; font-weight: 700; }
.composer .draft-segment textarea {
    min-height: 210px;
    margin: 0;
    padding: 8px 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}
.entry-mode-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 0 0 20px;
}
.entry-mode-card {
    position: relative;
    display: flex !important;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    min-width: 0;
    min-height: 76px;
    padding: 10px 13px;
    overflow: hidden;
    border: 1px solid rgba(27,154,116,.22);
    border-radius: 20px;
    color: var(--member-deep);
    background: rgba(255,253,246,.92);
    box-shadow: none;
    cursor: pointer;
    font: inherit;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.entry-mode-card::after {
    content: "";
    position: absolute;
    width: 48px;
    height: 48px;
    right: -22px;
    bottom: -25px;
    border-radius: 58% 42% 46% 54%;
    background: rgba(246,203,85,.20);
}
.entry-mode-card:hover, .entry-mode-card:focus-visible {
    transform: translateY(-2px);
    border-color: rgba(27,154,116,.48);
    box-shadow: none;
}
.entry-mode-card strong { position: relative; z-index: 1; white-space: nowrap; font-size: .78rem; font-weight: 800; letter-spacing: .02em; }
.entry-mode-icon {
    position: relative;
    z-index: 1;
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 52px;
    height: 52px;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: var(--member-deep);
    box-shadow: none;
}
.entry-mode-icon::after { content: none; }
.entry-mode-icon svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.palette-icon .palette-dot { stroke: none; }
.palette-icon .dot-one { fill: #f3c64f; }
.palette-icon .dot-two { fill: #ff9b68; }
.palette-icon .dot-three { fill: #f19db2; }
.palette-icon .dot-four { fill: #8ed4e5; }
.sketch-open-button { font: inherit; }
.composer-count-row { justify-content: flex-end; padding: 12px 0 20px; }
.draft-footer { padding-top: 2px; }
.draft-status { margin: 0 0 10px; color: var(--member-deep); font-size: .71rem; }
#character-count.over-limit { color: #9f493b; font-weight: 700; }
.draft-actions { display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 10px; }
.draft-actions .button { width: 100%; padding: 0 16px; }
.draft-icon-button { display: grid; place-items: center; width: 50px; height: 50px; padding: 0; border-radius: 50%; cursor: pointer; }
.draft-icon-button svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.draft-delete { border: 1px solid rgba(139,79,67,.30); color: #8b4f43; background: rgba(255,253,248,.82); }
.draft-save { border: 1px solid var(--member-deep); color: #fff; background: var(--member-deep); box-shadow: 0 8px 20px rgba(8,112,88,.18); }
.draft-icon-button:disabled { cursor: wait; opacity: .55; }
.record-segments { display: grid; gap: 12px; margin: 18px 0; }
.record-segment { padding-left: 14px; border-left: 2px solid rgba(27,154,116,.30); }
.record-segment > span { color: var(--member-deep); font-size: .66rem; font-weight: 600; }
.record-segment .record-text { margin: 5px 0 0; }

.profile-hero {
    display: flex;
    align-items: center;
    gap: 22px;
    width: min(100%, 960px);
    margin: 0 auto 28px;
}
.profile-page-avatar {
    display: grid;
    place-items: center;
    width: 86px;
    height: 86px;
    flex: 0 0 auto;
    border-radius: 42% 58% 48% 52% / 55% 42% 58% 45%;
    color: #fff;
    background: linear-gradient(145deg, var(--member), var(--member-deep));
    box-shadow: 0 16px 34px rgba(8,112,88,.20);
    font-size: 1.8rem;
    font-weight: 800;
}
.profile-hero button.profile-page-avatar { padding: 0; border: 0; cursor: pointer; font-family: inherit; }
.profile-hero button.profile-page-avatar:focus-visible { outline: 3px solid var(--member-deep); outline-offset: 4px; }
.profile-hero .eyebrow { margin-bottom: 6px; color: var(--member-deep); }
.profile-hero h1 { margin: 0; font-size: clamp(2rem, 4vw, 3.2rem); font-weight: 800; }
.profile-hero > div:last-child > p:last-child { margin: 7px 0 0; color: var(--ink-soft); }
.profile-layout { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(320px, .92fr); gap: 18px; width: min(100%, 960px); margin: 0 auto; }
.profile-summary { display: grid; gap: 18px; }
.profile-card { padding: 26px; border: 1px solid rgba(27,154,116,.17); border-radius: 26px; background: rgba(255,253,246,.78); box-shadow: 0 20px 54px rgba(8,112,88,.08); }
.profile-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.profile-card h2 { margin: 0; font-size: 1.25rem; }
.profile-card-heading > span { padding: 6px 10px; border-radius: 999px; color: var(--member-deep); background: var(--member-pale); font-size: .72rem; font-weight: 800; }
.profile-editor-card textarea { min-height: 140px; }
.profile-editor-card .button { width: 100%; margin-top: 18px; }
.profile-avatar-actions { display: flex; align-items: center; gap: 12px; margin: 20px 0 18px; }
.profile-avatar-actions .button { width: auto; margin: 0; cursor: pointer; }
.profile-avatar-actions .text-button { margin: 0; padding-left: 12px; }
.profile-visibility-note { margin: 8px 0 0; color: var(--ink-soft); font-size: .68rem; line-height: 1.65; }
.profile-visibility-note.public { color: var(--member-deep); }
.profile-membership dl { display: grid; gap: 13px; margin: 20px 0 0; }
.profile-membership dl div { display: flex; justify-content: space-between; gap: 18px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.profile-membership dl div:last-child { padding-bottom: 0; border: 0; }
.profile-membership dt { color: var(--ink-soft); font-size: .75rem; }
.profile-membership dd { margin: 0; font-size: .78rem; font-weight: 700; }
.profile-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.profile-stats article { padding: 18px 12px; border: 1px solid rgba(27,154,116,.16); border-radius: 20px; text-align: center; background: linear-gradient(150deg, rgba(217,243,231,.82), rgba(255,253,246,.72)); }
.profile-stats span, .profile-stats small { display: block; color: var(--ink-soft); font-size: .64rem; }
.profile-stats strong { display: inline-block; margin: 8px 3px 2px 0; color: var(--member-deep); font-size: 1.75rem; line-height: 1; }
.profile-stats small { display: inline; }
.profile-journey-card { width: min(100%, 960px); margin: 18px auto 0; }
.profile-journey-card .profile-card-heading > div > p:last-child { margin: 8px 0 0; color: var(--ink-soft); font-size: .72rem; line-height: 1.7; }
.profile-journey-card form { display: grid; gap: 16px; margin-top: 24px; }
.profile-fieldset { display: grid; gap: 15px; margin: 0; padding: 20px; border: 1px solid rgba(27,154,116,.16); border-radius: 20px; background: rgba(233,247,239,.32); }
.profile-fieldset legend { padding: 0 8px; color: var(--member-deep); font-size: .82rem; font-weight: 900; }
.profile-rhythm-edit-note { margin: 0; padding: 10px 12px; border-radius: 13px; color: var(--member-deep); background: rgba(217,243,231,.72); font-size: .68rem; line-height: 1.6; }
.profile-rhythm-edit-note.locked { color: #7a5b31; background: rgba(246,203,85,.22); }
.profile-fieldset select:disabled { cursor: not-allowed; opacity: .62; }
.profile-fieldset label > span, .profile-goals-field > span { display: block; margin-bottom: 7px; font-size: .74rem; font-weight: 750; }
.profile-fieldset label > small, .profile-goals-field small { display: block; margin: -2px 0 7px; color: var(--ink-soft); font-size: .65rem; font-weight: 400; line-height: 1.6; }
.profile-fieldset textarea { min-height: 112px; }
.profile-form-grid { display: grid; gap: 12px; }
.profile-form-grid.three-columns { grid-template-columns: repeat(3, 1fr); }
.profile-choice-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.profile-choice-chips label { cursor: pointer; }
.profile-choice-chips input { position: absolute; opacity: 0; pointer-events: none; }
.profile-choice-chips label > span { margin: 0; padding: 8px 13px; border: 1px solid rgba(27,154,116,.22); border-radius: 999px; color: var(--ink-soft); background: #fffcf4; font-size: .7rem; }
.profile-choice-chips input:checked + span { border-color: var(--member-deep); color: #fff; background: var(--member-deep); }
.profile-goals-field > input { margin-top: 10px; }
.profile-privacy-summary { grid-template-columns: repeat(3, 1fr); }
.profile-privacy-summary legend { grid-column: 1 / -1; }
.profile-privacy-summary label { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px; border-radius: 15px; background: rgba(255,253,246,.78); }
.profile-privacy-summary label > span { margin: 0; }
.profile-privacy-summary label b, .profile-privacy-summary label small { display: block; }
.profile-privacy-summary label small { margin: 3px 0 0; }
.profile-privacy-summary input[type="checkbox"] { width: 20px; height: 20px; flex: 0 0 auto; opacity: 1; accent-color: var(--member-deep); }
.profile-journey-card form > .button { width: min(100%, 320px); justify-self: end; }

.public-profile-dialog { width: min(92vw, 560px); max-width: none; padding: 0; border: 0; border-radius: 30px; background: transparent; }
.public-profile-dialog::backdrop { background: rgba(25,39,37,.58); backdrop-filter: blur(10px); }
.public-profile-panel { position: relative; padding: 32px; overflow: hidden; border: 2px solid var(--member-deep); border-radius: 28px; background: #fffaef; box-shadow: 0 34px 100px rgba(17,48,42,.30); }
.public-profile-panel::after { content: ""; position: absolute; z-index: 0; width: 170px; height: 170px; right: -80px; top: -85px; border-radius: 44% 56% 62% 38%; background: rgba(244,200,74,.32); }
.public-profile-close { position: absolute; z-index: 3; top: 20px; right: 20px; display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 1px solid rgba(8,112,88,.25); border-radius: 50%; color: var(--member-deep); background: #fffaef; cursor: pointer; font-size: 1.35rem; }
.public-profile-hero { position: relative; z-index: 1; display: flex; align-items: center; gap: 18px; padding-right: 45px; }
.public-profile-hero .profile-page-avatar { width: 74px; height: 74px; font-size: 1.5rem; }
.public-profile-hero h2 { margin: 2px 0 0; font-size: 1.8rem; }
.public-profile-hero p:last-child { margin: 5px 0 0; color: var(--ink-soft); font-size: .7rem; }
.public-profile-bio { position: relative; z-index: 1; min-height: 48px; margin: 24px 0 16px; padding: 18px; border-left: 3px solid var(--member); color: var(--ink); background: rgba(233,247,239,.58); font: 400 .88rem/1.8 var(--serif); white-space: pre-wrap; }
.public-profile-membership { position: relative; z-index: 1; padding: 20px; box-shadow: none; }
.public-profile-membership h3 { margin: 0; font-size: 1.05rem; }
.public-profile-stats { position: relative; z-index: 1; margin-top: 12px; }
.public-profile-privacy { position: relative; z-index: 1; margin: 16px 4px 0; color: var(--ink-soft); font-size: .65rem; line-height: 1.6; }

.sketch-dialog {
    width: min(920px, calc(100vw - 32px));
    max-height: 92dvh;
    padding: 0;
    border: 0;
    border-radius: 28px;
    color: var(--ink);
    background: transparent;
    box-shadow: 0 36px 100px rgba(24,50,45,.28);
}
.sketch-dialog::backdrop { background: rgba(28,42,39,.52); backdrop-filter: blur(8px); }
.sketch-panel {
    max-height: 92dvh;
    padding: 20px 26px 22px;
    overflow-y: auto;
    border: 1px solid rgba(27,154,116,.20);
    border-radius: 28px;
    background: #f7f3e8;
}
.sketch-heading {
    position: sticky;
    top: -26px;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin: -20px -26px 0;
    padding: 22px 26px 14px;
    border-bottom: 1px solid rgba(27,154,116,.12);
    background: rgba(247,243,232,.94);
    backdrop-filter: blur(12px);
}
.sketch-heading .eyebrow { margin-bottom: 4px; color: var(--member-deep); }
.sketch-heading h2 { margin: 0; font-size: 1.45rem; }
.sketch-heading-actions,
.sketch-secondary-actions {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 8px;
}
.sketch-icon-button {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid rgba(27,154,116,.20);
    border-radius: 50%;
    color: var(--member-deep);
    background: rgba(255,253,246,.84);
    cursor: pointer;
    transition: transform .16s ease, border-color .16s ease, background .16s ease;
}
.sketch-icon-button:hover:not(:disabled) { transform: translateY(-1px); border-color: rgba(27,154,116,.48); background: #fffdf6; }
.sketch-icon-button svg,
.sketch-mode-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sketch-icon-button.primary-icon { color: #fff; border-color: var(--member-deep); background: var(--member-deep); box-shadow: 0 7px 18px rgba(8,112,88,.18); }
.save-sketch-button { color: #fff; border-color: var(--member-deep); background: var(--member-deep); box-shadow: 0 7px 18px rgba(8,112,88,.18); }
.save-sketch-button.saved { color: var(--member-deep); border-color: rgba(8,112,88,.30); background: rgba(255,253,246,.92); box-shadow: none; }
.sketch-use-action { width: auto; min-height: 42px; padding: 0 18px; white-space: nowrap; }
.sketch-note { margin: 9px 0 12px; color: var(--ink-soft); font-size: .75rem; line-height: 1.7; }
.sketch-note strong { display: inline-block; margin-left: 8px; color: var(--member-deep); font-size: .67rem; }
.sketch-canvas-wrap {
    width: min(100%, max(270px, calc((92dvh - 300px) * 1.5)));
    margin-inline: auto;
    overflow: hidden;
    border: 1px solid rgba(27,154,116,.20);
    border-radius: 20px;
    background: #fffdf6;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.65);
}
#sketch-canvas {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 2;
    cursor: crosshair;
    touch-action: none;
}
#sketch-canvas.eraser-active { cursor: cell; }
.sketch-tool-row {
    display: grid;
    grid-template-columns: auto minmax(220px, 1fr) minmax(220px, 1fr);
    align-items: center;
    gap: 14px;
    margin-top: 12px;
    padding: 10px;
    border: 1px solid rgba(27,154,116,.14);
    border-radius: 16px;
    background: rgba(255,253,246,.58);
    overflow-x: auto;
}
.sketch-tool-settings { display: contents; }
.sketch-mode-toggle { display: flex; gap: 5px; padding: 4px; border-radius: 999px; background: rgba(217,243,231,.72); }
.sketch-mode-toggle button {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: var(--ink-soft);
    background: transparent;
    cursor: pointer;
}
.sketch-mode-toggle button.active { color: #fff; background: var(--member-deep); box-shadow: 0 5px 14px rgba(8,112,88,.18); }
.brush-size-control { display: grid; grid-template-columns: auto minmax(90px, 1fr) auto; align-items: center; gap: 9px; min-width: 0; color: var(--ink-soft); font-size: .71rem; white-space: nowrap; }
.brush-size-control input { width: 100%; min-width: 90px; accent-color: var(--member-deep); cursor: pointer; }
.brush-size-control output { min-width: 24px; color: var(--member-deep); font-weight: 700; text-align: right; }
.opacity-control output { min-width: 42px; }
.sketch-controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 12px 0 0; padding: 2px; overflow-x: auto; }
.sketch-palette { display: flex; flex: 1 0 auto; flex-wrap: nowrap; align-items: center; justify-content: space-between; gap: 7px; min-width: 510px; }
.color-swatch {
    width: 28px;
    height: 28px;
    padding: 0;
    border: 3px solid #f7f3e8;
    border-radius: 50%;
    background: var(--swatch);
    box-shadow: 0 0 0 1px rgba(38,52,55,.18);
    cursor: pointer;
}
.color-swatch.active { box-shadow: 0 0 0 2px var(--member-deep), 0 0 0 5px #f7f3e8; }
.cream-swatch { box-shadow: 0 0 0 1px rgba(38,52,55,.34), inset 0 0 0 1px rgba(255,255,255,.95); }
.sketch-undo { border: 1px solid rgba(27,154,116,.28); color: var(--member-deep); background: rgba(217,243,231,.78); }
.sketch-undo:disabled { border-color: rgba(160,160,150,.18); color: #aaa69c; background: rgba(238,236,229,.62); cursor: default; }
.sketch-clear { border: 1px solid rgba(184,92,43,.26); color: #984f34; background: rgba(255,230,210,.72); }

.sketch-download-dialog {
    width: min(760px, calc(100vw - 32px));
    max-height: 94dvh;
    padding: 0;
    border: 0;
    border-radius: 28px;
    color: var(--ink);
    background: transparent;
    box-shadow: 0 36px 100px rgba(24,50,45,.34);
}
.sketch-download-dialog::backdrop { background: rgba(25,39,37,.62); backdrop-filter: blur(10px); }
.sketch-download-panel { padding: 24px; border: 1px solid rgba(27,154,116,.20); border-radius: 28px; background: #f7f3e8; }
.sketch-download-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.sketch-download-heading .eyebrow { margin-bottom: 4px; color: var(--member-deep); }
.sketch-download-heading h2 { margin: 0; font-size: 1.28rem; }
#sketch-download-preview { display: block; width: 100%; max-height: 65dvh; object-fit: contain; border: 1px solid rgba(27,154,116,.18); border-radius: 20px; background: #fffdf6; }
.sketch-download-actions { display: grid; grid-template-columns: .8fr 1.2fr; gap: 10px; margin-top: 18px; }
.sketch-download-actions .button { width: 100%; }

@media (max-width: 840px) {
    .auth-story h1 { font-size: clamp(3.2rem, 14vw, 5rem); }
}
@media (max-width: 560px) {
    body::before { opacity: .09; }
    .member-nav { width: auto; border-radius: 18px; }
    .member-submission { margin: 14px 18px 4px; padding: 18px; }
    .auth-story::before { width: 58%; right: -8%; bottom: -18%; }
    .composer { padding: 20px; }
    .draft-actions { grid-template-columns: 1fr 1fr; }
    .draft-actions #submit-checkin { grid-column: 1 / -1; }
    .draft-delete.hidden { display: none; }
    .composer-actions { align-items: flex-end; gap: 10px; }
    .entry-mode-actions { gap: 7px; }
    .entry-mode-card { flex-direction: column; justify-content: center; gap: 7px; min-height: 94px; padding: 9px 5px; border-radius: 17px; }
    .entry-mode-icon { width: 46px; height: 46px; }
    .entry-mode-icon svg { width: 27px; height: 27px; }
    .entry-mode-card strong { font-size: .69rem; }
    .sketch-dialog { width: calc(100vw - 14px); max-height: 96dvh; }
    .sketch-panel { max-height: 96dvh; padding: 14px; border-radius: 22px; }
    .sketch-heading { top: -18px; margin: -18px -18px 0; padding: 16px 18px 12px; }
    .sketch-heading { flex-wrap: wrap; }
    .sketch-heading-actions { width: 100%; justify-content: space-between; gap: 5px; }
    .sketch-icon-button { width: 38px; height: 38px; }
    .sketch-use-action { min-height: 38px; padding: 0 13px; font-size: .68rem; }
    .sketch-note { margin: 7px 0 9px; font-size: .66rem; }
    .sketch-note strong { margin-left: 4px; }
    .sketch-canvas-wrap { width: min(100%, max(220px, calc((96dvh - 370px) * 1.5))); border-radius: 15px; }
    .sketch-tool-row { grid-template-columns: auto minmax(0, 1fr); gap: 8px; margin-top: 9px; padding: 7px; overflow: visible; }
    .sketch-tool-row .opacity-control { grid-column: 1 / -1; }
    .brush-size-control { gap: 6px; font-size: .62rem; }
    .brush-size-control input { min-width: 70px; }
    .sketch-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin: 8px 0 0; overflow: visible; }
    .sketch-palette { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 7px; min-width: 0; }
    .color-swatch { width: 24px; height: 24px; border-width: 2px; }
    .sketch-secondary-actions { flex-direction: column; gap: 6px; }
    .sketch-download-panel { padding: 18px; }
    .profile-hero { align-items: flex-start; }
    .profile-page-avatar { width: 66px; height: 66px; font-size: 1.35rem; }
    .profile-layout { grid-template-columns: 1fr; }
    .profile-stats { grid-template-columns: repeat(3, 1fr); }
    .profile-journey-card { padding: 19px; }
    .profile-card-heading { align-items: flex-start; }
    .profile-form-grid.three-columns, .profile-privacy-summary { grid-template-columns: 1fr; }
    .profile-fieldset { padding: 16px; }
    .profile-journey-card form > .button { width: 100%; }
    .public-profile-dialog { width: calc(100vw - 24px); }
    .public-profile-panel { padding: 24px 18px; border-radius: 24px; }
    .public-profile-close { top: 14px; right: 14px; }
    .public-profile-hero { align-items: flex-start; gap: 13px; padding-right: 36px; }
    .public-profile-hero .profile-page-avatar { width: 58px; height: 58px; }
    .public-profile-hero h2 { font-size: 1.45rem; }
    .public-profile-stats article { padding: 15px 5px; }
    .public-profile-stats strong { font-size: 1.45rem; }
    .submission-window-note { align-items: flex-start; flex-direction: column; gap: 4px; }
    .response-schedule-controls { grid-template-columns: 1fr; }
}

@media (min-width: 561px) and (max-width: 840px) {
    .profile-layout { grid-template-columns: 1fr; }
}

/* Qualitative Research Dashboard */
#research-data-section {
    --research-paper: #f7f3ea;
    --research-ink: #173652;
    --research-line: rgba(55,127,189,.18);
}
#research-data-section > .observer-heading {
    align-items: flex-start;
    padding-bottom: 26px;
    border-bottom: 1px solid var(--research-line);
}
#research-data-section .observer-heading .eyebrow,
#research-data-section .research-chapter-heading p { color: var(--researcher-deep); }
#research-data-section .heading-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(130px, 1fr));
    gap: 9px;
    width: min(100%, 430px);
}
#research-data-section .heading-actions select,
#research-data-section .heading-actions .button {
    width: 100%;
    min-height: 42px;
    margin: 0;
}
.analytics-filter-status {
    grid-column: 1 / -1;
    min-height: 1.4em;
    color: var(--researcher-deep);
    font-size: .59rem;
    line-height: 1.4;
    text-align: right;
}
#research-data-section[aria-busy="true"] .research-chapter {
    opacity: .58;
    transition: opacity .16s ease;
}
#research-data-section .privacy-banner {
    border-color: rgba(55,127,189,.22);
    background: linear-gradient(100deg, rgba(220,238,250,.82), rgba(255,230,210,.36));
}
#research-data-section .privacy-banner strong { color: var(--researcher-deep); }
.research-journey {
    position: relative;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin: 24px 0 58px;
}
.research-journey::before {
    content: "";
    position: absolute;
    left: 9%;
    right: 9%;
    top: 28px;
    height: 1px;
    background: linear-gradient(90deg, var(--member), var(--researcher), var(--ai), var(--researcher-deep));
    opacity: .34;
}
.research-journey a {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 42px 1fr;
    grid-template-rows: auto auto;
    align-items: center;
    column-gap: 10px;
    min-height: 76px;
    padding: 13px;
    border: 1px solid var(--research-line);
    border-radius: 20px;
    color: var(--research-ink);
    background: rgba(255,253,246,.9);
    text-decoration: none;
    box-shadow: 0 9px 28px rgba(32,92,145,.06);
}
.research-journey a span {
    grid-row: 1 / 3;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    color: #fff;
    background: var(--researcher);
    font-size: .73rem;
    font-weight: 800;
}
.research-journey a:nth-child(1) span { background: var(--member); }
.research-journey a:nth-child(3) span { background: var(--ai); }
.research-journey a:nth-child(4) span { background: var(--researcher-deep); }
.research-journey strong { align-self: end; font-size: .77rem; letter-spacing: .04em; }
.research-journey small { align-self: start; margin-top: 3px; color: var(--ink-soft); font-size: .62rem; }
.research-chapter {
    position: relative;
    scroll-margin-top: 96px;
    margin: 0 0 72px;
    padding: 34px 0 0;
    border-top: 1px solid var(--research-line);
}
.research-chapter-heading {
    display: flex;
    align-items: flex-start;
    gap: 17px;
    margin-bottom: 26px;
}
.research-chapter-heading > span {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    flex: 0 0 auto;
    border: 1px solid var(--research-line);
    border-radius: 20px 45% 45% 20px;
    color: var(--researcher-deep);
    background: var(--researcher-pale);
    font-size: .82rem;
    font-weight: 800;
}
.participation-chapter .research-chapter-heading > span { color: var(--member-deep); background: var(--member-pale); }
.emotion-chapter .research-chapter-heading > span { color: var(--ai-deep); background: var(--ai-pale); }
.research-chapter-heading p { margin: 2px 0 6px; font-size: .67rem; font-weight: 800; letter-spacing: .16em; }
.research-chapter-heading h2 { margin: 0; color: var(--research-ink); font-size: clamp(1.18rem, 2.2vw, 1.65rem); line-height: 1.45; }
.qual-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}
.qual-metrics article {
    min-height: 126px;
    padding: 18px;
    border: 1px solid rgba(27,154,116,.18);
    border-radius: 22px;
    background: linear-gradient(145deg, rgba(217,243,231,.64), rgba(255,253,246,.92));
}
.qual-metrics span,
.qual-metrics small,
.qual-metrics strong { display: block; }
.qual-metrics span { color: var(--member-deep); font-size: .69rem; font-weight: 700; }
.qual-metrics strong { margin: 12px 0 8px; color: var(--research-ink); font-size: clamp(1.38rem, 2.5vw, 2rem); line-height: 1; font-variant-numeric: tabular-nums; }
.qual-metrics small { color: var(--ink-soft); font-size: .61rem; line-height: 1.5; }
.qualitative-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.qualitative-grid .wide { grid-column: 1 / -1; }
#research-data-section .chart-card,
.relationship-timeline-card {
    min-width: 0;
    padding: 22px;
    border: 1px solid var(--research-line);
    border-radius: 24px;
    background: rgba(255,253,246,.88);
    box-shadow: 0 13px 38px rgba(32,92,145,.055);
}
#research-data-section .chart-heading { margin-bottom: 18px; }
#research-data-section .chart-heading h3 { margin: 0 0 5px; color: var(--research-ink); font-size: .94rem; }
#research-data-section .chart-heading p { margin: 0; color: var(--ink-soft); font-size: .63rem; line-height: 1.55; }
.research-chart svg,
.theme-river svg,
.emotion-timeline svg,
.relationship-timeline svg { display: block; width: 100%; height: auto; overflow: visible; }
.research-chart svg text,
.theme-river svg text,
.emotion-timeline svg text { fill: var(--ink-soft); font-family: var(--sans); font-size: 10px; }
.qual-grid-line { stroke: rgba(55,127,189,.14); stroke-width: 1; }
.participation-line { fill: none; stroke: var(--member); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.research-chart circle { fill: var(--member); stroke: #fffdf6; stroke-width: 2; }
.sparse-note,
.research-empty {
    margin: 0;
    padding: 13px 14px;
    border-radius: 14px;
    color: var(--ink-soft);
    background: rgba(220,238,250,.42);
    font-size: .66rem;
    line-height: 1.6;
}
.week-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 9px; margin-top: 12px; }
.week-cards article { padding: 13px; border: 1px solid rgba(27,154,116,.17); border-radius: 16px; background: var(--member-pale); }
.week-cards span, .week-cards strong, .week-cards small { display: block; }
.week-cards span, .week-cards small { color: var(--ink-soft); font-size: .6rem; }
.week-cards strong { margin: 6px 0; color: var(--member-deep); font-size: .86rem; }
.participation-heatmap { overflow-x: auto; }
.calendar-heat-grid { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 13px); grid-auto-columns: 13px; gap: 3px; width: max-content; min-width: 100%; }
.heat-cell { border: 1px solid rgba(27,154,116,.10); border-radius: 3px; background: color-mix(in srgb, var(--member) calc(var(--heat, 0) * 88%), #eef4ed); }
.heat-cell.empty { visibility: hidden; }
.heat-legend { margin-top: 10px; color: var(--ink-soft); font-size: .59rem; }
.qual-timeline { display: grid; gap: 9px; max-height: 360px; overflow-y: auto; }
.qual-timeline article {
    display: grid;
    grid-template-columns: 78px 64px 1fr;
    align-items: start;
    gap: 9px;
    padding: 11px 0;
    border-bottom: 1px solid var(--research-line);
}
.qual-timeline article:last-child { border-bottom: 0; }
.qual-timeline time,
.qual-timeline article > span { color: var(--ink-soft); font-size: .62rem; }
.qual-timeline strong { color: var(--researcher-deep); font-size: .65rem; }
.qual-timeline p { margin: 0; color: var(--ink-soft); font-size: .64rem; line-height: 1.55; }
.theme-status-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.theme-status-grid > article { min-height: 96px; padding: 16px; border: 1px solid var(--research-line); border-radius: 20px; background: rgba(220,238,250,.38); }
.theme-status-grid > article:nth-child(2) { background: rgba(217,243,231,.42); }
.theme-status-grid > article:nth-child(3) { background: rgba(255,230,210,.34); }
.theme-status-grid > article > span { display: block; margin-bottom: 11px; color: var(--researcher-deep); font-size: .65rem; font-weight: 800; }
.theme-chip-list { display: flex; flex-wrap: wrap; gap: 6px; }
.theme-chip-list span { padding: 5px 8px; border-radius: 999px; color: var(--researcher-deep); background: #fffdf6; font-size: .61rem; }
.theme-chip-list small { color: var(--ink-soft); font-size: .61rem; }
.theme-week-list { display: grid; gap: 9px; margin-top: 12px; }
.theme-week-list article { display: grid; grid-template-columns: 82px 1fr; gap: 10px; align-items: start; }
.theme-week-list time { color: var(--ink-soft); font-size: .61rem; }
.theme-week-list div { display: flex; flex-wrap: wrap; gap: 5px; }
.theme-week-list span { padding: 5px 7px; border-radius: 999px; color: var(--researcher-deep); background: var(--researcher-pale); font-size: .59rem; }
.river-legend { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 11px; }
.river-legend span { display: inline-flex; align-items: center; gap: 5px; color: var(--ink-soft); font-size: .59rem; }
.river-legend span::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--river-color); }
.movement-chart { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.movement-chart article { padding: 13px; border-radius: 17px; background: var(--researcher-pale); }
.movement-chart article[data-movement="Expand"],
.movement-chart article[data-movement="Action"] { background: var(--member-pale); }
.movement-chart article[data-movement="Reframe"] { background: var(--ai-pale); }
.movement-chart article[data-movement="Silence"] { background: #ecebe5; }
.movement-chart span, .movement-chart strong, .movement-chart small { display: block; }
.movement-chart span { color: var(--ink-soft); font-size: .61rem; }
.movement-chart strong { display: inline-block; margin: 8px 4px 0 0; font-size: 1.5rem; }
.movement-chart small { display: inline; color: var(--ink-soft); font-size: .6rem; }
.emotion-bars .bar-row i { background: var(--ai); }
.volatility-list { display: grid; gap: 9px; }
.volatility-list article { display: grid; grid-template-columns: 60px 78px 1fr; gap: 9px; align-items: center; padding: 12px; border-radius: 15px; background: rgba(255,230,210,.4); }
.volatility-list strong { color: var(--researcher-deep); font-size: .67rem; }
.volatility-list span { color: var(--ai-deep); font-size: .66rem; font-weight: 700; }
.volatility-list small { color: var(--ink-soft); font-size: .61rem; line-height: 1.45; }
.relationship-indicators { margin-bottom: 18px; }
.relationship-radar-panel {
    min-width: 0;
    padding: 22px 26px 18px;
    border: 1px solid rgba(55,127,189,.2);
    border-radius: 26px;
    background: linear-gradient(150deg, rgba(220,238,250,.5), rgba(255,253,246,.94));
    box-shadow: 0 13px 38px rgba(32,92,145,.055);
}
.relationship-radar-panel > header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}
.relationship-radar-panel h3 { margin: 0 0 5px; color: var(--research-ink); font-size: .94rem; }
.relationship-radar-panel p { margin: 0; color: var(--ink-soft); font-size: .63rem; line-height: 1.55; }
.relationship-radar-panel > header > span {
    flex: 0 0 auto;
    padding: 6px 9px;
    border-radius: 999px;
    color: var(--researcher-deep);
    background: rgba(220,238,250,.82);
    font-size: .6rem;
    font-weight: 750;
}
.relationship-radar-controls {
    display: grid;
    grid-template-columns: 38px minmax(240px, 430px) 38px;
    justify-content: center;
    gap: 8px;
    margin: 18px auto 4px;
}
.relationship-radar-controls select,
.relationship-radar-controls button {
    min-height: 38px;
    border: 1px solid rgba(55,127,189,.25);
    border-radius: 13px;
    color: var(--research-ink);
    background: rgba(255,253,246,.9);
    font-family: var(--sans);
    font-size: .64rem;
    font-weight: 700;
}
.relationship-radar-controls select { width: 100%; padding: 0 12px; }
.relationship-radar-controls button { padding: 0; color: var(--researcher-deep); font-size: .9rem; }
.relationship-radar-controls button:disabled { opacity: .32; cursor: not-allowed; }
.relationship-radar-comparison {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 9px 18px;
    min-height: 26px;
    margin-top: 9px;
}
.relationship-radar-comparison span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--ink-soft);
    font-size: .61rem;
}
.relationship-radar-comparison span::before {
    width: 27px;
    height: 0;
    border-top: 3px solid var(--researcher);
    content: "";
}
.relationship-radar-comparison span.previous::before {
    border-top-color: rgba(55,127,189,.5);
    border-top-style: dashed;
}
.relationship-radar-host { min-height: 420px; }
.relationship-radar-chart {
    display: block;
    width: min(100%, 780px);
    height: auto;
    margin: 2px auto 0;
    overflow: visible;
}
.relationship-radar-ring {
    stroke: rgba(55,127,189,.58);
    stroke-width: 1.45;
    stroke-linejoin: round;
}
.relationship-radar-ring.level-5 { fill: rgba(55,127,189,.11); stroke-width: 2.2; }
.relationship-radar-ring.level-3 { fill: rgba(55,127,189,.075); }
.relationship-radar-ring.level-1 { fill: rgba(55,127,189,.065); }
.relationship-radar-axis { stroke: rgba(55,127,189,.2); stroke-width: 1.2; }
.relationship-radar-shape {
    fill: rgba(55,127,189,.34);
    stroke: var(--researcher);
    stroke-width: 3;
    stroke-linejoin: round;
}
.relationship-radar-shape.previous {
    fill: rgba(55,127,189,.08);
    stroke: rgba(55,127,189,.54);
    stroke-width: 2.4;
    stroke-dasharray: 8 7;
}
.relationship-radar-shape.current { fill: rgba(55,127,189,.34); }
.relationship-radar-point { fill: var(--researcher-deep); stroke: #fffdf6; stroke-width: 2.2; }
.relationship-radar-scale {
    fill: var(--researcher-deep);
    font-family: var(--sans);
    font-size: 12px;
    font-weight: 800;
}
.relationship-radar-label {
    fill: var(--research-ink);
    font-family: var(--sans);
    font-size: 13px;
    font-weight: 750;
}
.relationship-radar-value {
    fill: var(--researcher-deep);
    font-size: 12px;
    font-weight: 850;
}
.relationship-timeline { display: grid; gap: 10px; }
.relationship-timeline article { display: grid; grid-template-columns: 150px minmax(0, 1fr); align-items: center; gap: 16px; padding: 12px; border: 1px solid rgba(55,127,189,.12); border-radius: 18px; background: rgba(220,238,250,.2); }
.relationship-timeline article > div { display: grid; gap: 5px; }
.relationship-timeline article > div strong { color: var(--researcher-deep); font-size: .67rem; }
.relationship-timeline article > div span { color: var(--ink-soft); font-size: .6rem; }
.relationship-line { fill: none; stroke: var(--researcher); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.relationship-timeline circle { fill: var(--researcher); stroke: #fffdf6; stroke-width: 2; }
#research-data-section .table-wrap table { width: 100%; border-collapse: collapse; }
#research-data-section .table-wrap th,
#research-data-section .table-wrap td { padding: 11px 10px; border-bottom: 1px solid var(--research-line); text-align: left; white-space: nowrap; font-size: .64rem; }
#research-data-section .table-wrap th { color: var(--researcher-deep); font-weight: 700; }
#research-data-section .table-wrap td { color: var(--ink-soft); }
#research-data-section > .method-note { margin-top: -38px; padding: 16px; border-radius: 16px; background: rgba(220,238,250,.35); line-height: 1.7; }
.observer-response.response-read-confirmed { box-shadow: inset 3px 0 0 rgba(55,127,189,.28); }

@media (max-width: 980px) {
    .qual-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .research-journey { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .research-journey::before { display: none; }
}
@media (max-width: 720px) {
    #research-data-section > .observer-heading { display: block; }
    #research-data-section .heading-actions { grid-template-columns: 1fr 1fr; width: 100%; margin-top: 18px; }
    .qualitative-grid { grid-template-columns: 1fr; }
    .qualitative-grid .wide { grid-column: auto; }
    .theme-status-grid { grid-template-columns: 1fr; }
    .relationship-timeline article { grid-template-columns: 1fr; }
    .relationship-radar-panel { padding: 18px 12px 12px; }
}
@media (max-width: 500px) {
    .research-journey { grid-template-columns: 1fr; }
    .qual-metrics { grid-template-columns: 1fr 1fr; }
    .qual-metrics article { min-height: 112px; padding: 14px; }
    .qual-timeline article { grid-template-columns: 68px 58px 1fr; }
    .movement-chart { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .relationship-radar-panel > header { display: block; padding: 0 6px; }
    .relationship-radar-panel > header > span { display: inline-block; margin-top: 9px; }
    .relationship-radar-controls { grid-template-columns: 35px minmax(0, 1fr) 35px; }
    .relationship-radar-controls select { padding: 0 7px; font-size: .58rem; }
    .relationship-radar-comparison { justify-content: flex-start; padding: 0 6px; }
    .relationship-radar-chart { width: calc(100% + 14px); margin-left: -7px; }
    #research-data-section .heading-actions { grid-template-columns: 1fr; }
}

/* First-entry journey */
.journey-entry-button {
    display: grid;
    gap: 1px;
    align-content: center;
    min-height: 40px;
    padding: 7px 13px;
    border: 1px solid rgba(27,154,116,.26);
    border-radius: 999px;
    color: var(--member-deep);
    background: linear-gradient(120deg, rgba(217,243,231,.88), rgba(246,203,85,.24));
    cursor: pointer;
    text-align: left;
}
.journey-entry-button span { font-size: .7rem; font-weight: 800; }
.journey-entry-button small { color: var(--ink-soft); font-size: .52rem; }
.onboarding-dialog {
    width: min(900px, calc(100vw - 28px));
    max-height: 94dvh;
    padding: 0;
    border: 0;
    border-radius: 34px;
    color: var(--ink);
    background: transparent;
    box-shadow: 0 42px 120px rgba(21,54,49,.30);
}
.onboarding-dialog::backdrop { background: rgba(23,44,42,.58); backdrop-filter: blur(10px); }
.onboarding-shell {
    position: relative;
    max-height: 94dvh;
    overflow-y: auto;
    border: 1px solid rgba(27,154,116,.24);
    border-radius: 34px;
    background:
        radial-gradient(ellipse at 3% 8%, rgba(239,145,161,.25), transparent 30%),
        radial-gradient(ellipse at 100% 16%, rgba(246,203,85,.28), transparent 28%),
        radial-gradient(ellipse at 80% 100%, rgba(27,154,116,.16), transparent 35%),
        #f8f5ea;
}
.onboarding-topline {
    position: sticky;
    z-index: 4;
    top: 0;
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 13px;
    padding: 18px 24px 12px;
    background: rgba(248,245,234,.92);
    backdrop-filter: blur(16px);
}
.onboarding-progress { height: 5px; overflow: hidden; border-radius: 999px; background: rgba(27,154,116,.13); }
.onboarding-progress i { display: block; width: 20%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--member), #5ebc91); transition: width .28s ease; }
.onboarding-topline > span { min-width: 34px; color: var(--member-deep); font-size: .62rem; font-weight: 800; }
.onboarding-close {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid rgba(27,154,116,.20);
    border-radius: 50%;
    color: var(--member-deep);
    background: rgba(255,253,246,.78);
    cursor: pointer;
    font-size: 1.3rem;
    line-height: 1;
}
#onboarding-form { min-height: 620px; }
.onboarding-step { display: none; min-height: 500px; padding: 44px clamp(26px, 7vw, 72px) 20px; animation: onboarding-enter .28s ease both; }
.onboarding-step.active { display: block; }
@keyframes onboarding-enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.welcome-step { text-align: center; padding-top: 85px; }
.onboarding-welcome-mark { position: relative; width: 76px; height: 76px; margin: 0 auto 34px; }
.onboarding-welcome-mark span { position: absolute; inset: 0; border: 2px solid var(--member); border-radius: 50%; }
.onboarding-welcome-mark span:nth-child(2) { transform: translateX(20px); border-color: var(--ai); }
.onboarding-welcome-mark span:nth-child(3) { transform: translate(10px, 18px); border-color: var(--researcher); }
.welcome-step .eyebrow { color: var(--member-deep); }
.welcome-step h1 { margin: 26px 0 18px; font-size: clamp(2.25rem, 6vw, 4.3rem); font-weight: 900; letter-spacing: .02em; }
.welcome-step > p:last-child { margin: 0 auto; color: var(--ink-soft); font-size: clamp(.9rem, 2vw, 1.1rem); font-weight: 300; line-height: 1.9; }
.onboarding-step-heading { display: flex; align-items: flex-start; gap: 17px; margin-bottom: 32px; }
.onboarding-step-heading > span {
    display: grid;
    place-items: center;
    width: 50px;
    height: 50px;
    flex: 0 0 auto;
    border-radius: 42% 58% 48% 52%;
    color: #fff;
    background: var(--member);
    font-size: .72rem;
    font-weight: 800;
}
.onboarding-step-heading .eyebrow { margin-bottom: 5px; color: var(--member-deep); }
.onboarding-step-heading h2 { margin: 0; font-size: clamp(1.5rem, 3vw, 2.15rem); line-height: 1.35; }
.onboarding-step-heading div > p:last-child { margin: 9px 0 0; color: var(--ink-soft); font-size: .72rem; line-height: 1.7; }
.onboarding-profile-grid { display: grid; grid-template-columns: 190px 1fr; gap: 34px; align-items: start; }
.onboarding-avatar-field { display: grid; justify-items: center; gap: 8px; }
.onboarding-avatar-preview {
    position: relative;
    display: grid !important;
    place-items: center;
    width: 150px;
    height: 150px;
    margin: 0 !important;
    overflow: hidden;
    border: 2px dashed rgba(27,154,116,.38);
    border-radius: 46% 54% 45% 55% / 54% 44% 56% 46%;
    color: #fff;
    background: linear-gradient(145deg, var(--member), var(--member-deep));
    cursor: pointer;
    box-shadow: 0 18px 38px rgba(8,112,88,.16);
}
.onboarding-avatar-preview img { width: 100%; height: 100%; object-fit: cover; }
.onboarding-avatar-preview > span { font-size: 2.4rem; font-weight: 900; }
.onboarding-avatar-preview small { position: absolute; right: 0; bottom: 0; left: 0; padding: 8px; color: #fff; background: rgba(8,70,55,.62); text-align: center; font-size: .58rem; }
.onboarding-avatar-field .text-button { border: 0; margin: 0; padding: 4px 8px; color: var(--member-deep); }
.onboarding-step label:not(.onboarding-avatar-preview) { margin-top: 0 !important; }
.onboarding-profile-grid > div:last-child > label { display: flex !important; justify-content: space-between; margin-bottom: 8px !important; }
.onboarding-profile-grid label em,
.onboarding-profile-grid label small { color: var(--ink-soft); font-size: .61rem; font-style: normal; font-weight: 400; }
.onboarding-profile-grid input { margin-bottom: 22px; }
.onboarding-profile-grid textarea { min-height: 128px; }
.rhythm-periods,
.onboarding-questions fieldset { padding: 0; border: 0; }
.rhythm-periods legend,
.onboarding-questions legend { margin-bottom: 13px; color: var(--ink-soft); font-size: .68rem; font-weight: 700; }
.rhythm-periods { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.rhythm-periods legend { grid-column: 1 / -1; }
.rhythm-periods label { position: relative; margin: 0 !important; cursor: pointer; }
.rhythm-periods input { position: absolute; opacity: 0; }
.rhythm-periods label > span { display: grid; gap: 8px; min-height: 94px; padding: 18px; border: 1px solid rgba(27,154,116,.18); border-radius: 21px; background: rgba(255,253,246,.68); transition: .18s ease; }
.rhythm-periods b { color: var(--ink); font-size: .82rem; }
.rhythm-periods small { color: var(--ink-soft); font-size: .58rem; }
.rhythm-periods input:checked + span { border-color: var(--member); color: var(--member-deep); background: var(--member-pale); box-shadow: inset 0 0 0 1px var(--member); transform: translateY(-2px); }
.rhythm-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 24px; }
.rhythm-detail-grid label { padding: 15px; border: 1px solid rgba(27,154,116,.16); border-radius: 19px; background: rgba(255,253,246,.68); }
.rhythm-detail-grid label > span { display: block; margin-bottom: 9px; color: var(--member-deep); font-size: .66rem; font-weight: 700; }
.rhythm-detail-grid select { width: 100%; min-height: 46px; border: 1px solid var(--line); border-radius: 13px; color: var(--ink); background: #fffdf6; padding: 0 12px; }
.onboarding-questions { display: grid; gap: 25px; }
.onboarding-questions > label > span,
.onboarding-questions legend { display: block; color: var(--ink); font-size: .78rem; font-weight: 800; }
.onboarding-questions > label > small { display: block; margin: 8px 0 10px; color: var(--ink-soft); font-size: .62rem; line-height: 1.55; }
.onboarding-questions textarea { min-height: 108px; margin-top: 10px; }
.onboarding-choice-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.onboarding-choice-chips label,
.onboarding-radio-list label { position: relative; margin: 0 !important; cursor: pointer; }
.onboarding-choice-chips input,
.onboarding-radio-list input { position: absolute; opacity: 0; }
.onboarding-choice-chips span { display: block; padding: 10px 15px; border: 1px solid rgba(27,154,116,.20); border-radius: 999px; background: rgba(255,253,246,.72); font-size: .68rem; }
.onboarding-choice-chips input:checked + span { color: #fff; border-color: var(--member); background: var(--member); }
.onboarding-other-input { width: 100%; margin-top: 12px; }
.onboarding-radio-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.onboarding-radio-list span { display: flex; align-items: center; min-height: 52px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 17px; background: rgba(255,253,246,.72); font-size: .66rem; }
.onboarding-radio-list input:checked + span { color: var(--member-deep); border-color: var(--member); background: var(--member-pale); box-shadow: inset 0 0 0 1px var(--member); }
.onboarding-privacy-list { display: grid; gap: 11px; }
.onboarding-privacy-list label { display: grid !important; grid-template-columns: 1fr auto; align-items: center; gap: 16px; margin: 0 !important; padding: 18px; border: 1px solid rgba(27,154,116,.17); border-radius: 21px; background: rgba(255,253,246,.72); cursor: pointer; }
.onboarding-privacy-list label.fixed { cursor: default; }
.onboarding-privacy-list b,
.onboarding-privacy-list small { display: block; }
.onboarding-privacy-list b { font-size: .76rem; }
.onboarding-privacy-list small { margin-top: 4px; color: var(--ink-soft); font-size: .61rem; font-weight: 400; }
.onboarding-privacy-list input { position: absolute; opacity: 0; }
.onboarding-privacy-list i { position: relative; width: 46px; height: 26px; border-radius: 99px; background: #d6d9d2; transition: .18s ease; }
.onboarding-privacy-list i::after { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; border-radius: 50%; background: #fff; box-shadow: 0 2px 7px rgba(20,40,36,.16); transition: .18s ease; }
.onboarding-privacy-list input:checked + i {
    background: #6f9274;
    box-shadow: inset 0 0 0 1px rgba(43, 82, 54, .18);
}
.onboarding-privacy-list input:checked + i::after { transform: translateX(20px); }
.onboarding-public-note { margin: -8px 0 20px; padding: 13px 15px; border-left: 3px solid var(--member); color: var(--member-deep); background: rgba(217,243,231,.56); font-size: .7rem; line-height: 1.7; }
.onboarding-rhythm-edit-note { margin-top: 9px !important; padding: 9px 12px; border-radius: 12px; color: var(--member-deep) !important; background: rgba(217,243,231,.65); font-size: .66rem !important; font-weight: 700; }
.onboarding-rhythm-edit-note.locked { color: #7a5b31 !important; background: rgba(246,203,85,.24); }
.rhythm-periods input:disabled + span, .rhythm-detail-grid select:disabled { cursor: not-allowed; opacity: .58; }
.onboarding-memory-notice { margin: 18px 0; padding: 14px 16px; border-left: 3px solid var(--ai); border-radius: 12px; color: var(--ink-soft); background: var(--ai-pale); font-size: .62rem; line-height: 1.7; }
.onboarding-finish-copy { display: grid; gap: 5px; text-align: center; margin-top: 26px; }
.onboarding-finish-copy strong { color: var(--member-deep); font-size: .82rem; }
.onboarding-finish-copy span { color: var(--ink-soft); font-size: .62rem; }
.onboarding-actions { position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: 10px; padding: 14px 24px 22px; background: linear-gradient(180deg, rgba(248,245,234,0), #f8f5ea 28%); }
.onboarding-actions .button { min-width: 160px; }

@media (max-width: 720px) {
    .journey-entry-button { padding: 7px 10px; }
    .journey-entry-button small { display: none; }
    .observer-group-switcher { min-width: 132px; padding: 5px 8px; }
    .observer-group-switcher > span { display: none; }
    .observer-group-switcher select { font-size: .66rem; }
    .onboarding-step { min-height: 560px; padding: 34px 20px 16px; }
    .onboarding-profile-grid { grid-template-columns: 1fr; gap: 22px; }
    .onboarding-avatar-preview { width: 118px; height: 118px; }
    .rhythm-periods { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .rhythm-detail-grid { grid-template-columns: 1fr; }
    .onboarding-radio-list { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
    .journey-entry-button { max-width: 82px; }
    .identity { gap: 7px; }
    .identity .compact-link { display: none; }
    body[data-role="observer"] .journey-entry-button { display: none; }
    .observer-group-switcher { min-width: 104px; max-width: 118px; }
    .onboarding-dialog { width: calc(100vw - 14px); }
    .onboarding-shell { border-radius: 25px; }
    .onboarding-topline { padding: 13px 15px 9px; }
    .onboarding-step-heading > span { width: 42px; height: 42px; }
    .welcome-step { padding-top: 70px; }
    .onboarding-actions { padding: 13px 15px 17px; }
    .onboarding-actions .button { min-width: 0; flex: 1; }
}

/* Compact microphone beside the formal send action. */
.draft-actions { position: relative; grid-template-columns: auto auto auto minmax(0, 1fr); }
.draft-actions #submit-checkin { grid-column: -2 / -1; }
.writing-dictation { position: relative; margin: 0; padding: 0; }
.dictation-mic-button {
    display: grid;
    place-items: center;
    width: 50px;
    height: 50px;
    padding: 0;
    border: 1px solid var(--member-deep);
    border-radius: 50%;
    color: var(--member-deep);
    background: rgba(255,253,248,.82);
    cursor: pointer;
    transition: color .18s ease, background .18s ease, transform .18s ease;
}
.dictation-mic-button:hover,
.dictation-mic-button:focus-visible { color: #fff; background: var(--member-deep); transform: translateY(-1px); }
.dictation-mic-button:disabled { cursor: wait; opacity: .72; }
.dictation-mic-button svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.writing-dictation[data-phase="recording"] .dictation-mic-button { color: #fff; border-color: #d15d4e; background: #d15d4e; }
.dictation-popover {
    position: absolute;
    z-index: 12;
    right: 34px;
    bottom: calc(100% + 12px);
    display: none;
    width: min(520px, calc(100vw - 48px));
    padding: 14px;
    border: 1px solid rgba(27,154,116,.24);
    border-radius: 18px;
    background: #fffdf8;
    box-shadow: 0 18px 48px rgba(24,50,45,.16);
}
.writing-dictation:not([data-phase="idle"]) .dictation-popover,
.writing-dictation[data-phase="idle"] .dictation-popover:has([data-dictation-status]:not([hidden])) { display: block; }
.dictation-status-row { display: flex; align-items: center; gap: 9px; min-height: 28px; }
.dictation-status-row p { flex: 1; margin: 0; color: var(--ink-soft); font-size: .73rem; line-height: 1.5; }
.dictation-live-dot { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: var(--member); }
.writing-dictation[data-phase="recording"] .dictation-live-dot { background: #d15d4e; animation: dictation-pulse 1.15s ease-in-out infinite; }
.dictation-status-row .text-button { padding: 4px 6px; font-size: .7rem; }
.dictation-review { margin-top: 10px; }
.dictation-review textarea { display: block; width: 100%; min-height: 104px; margin: 0 0 10px; }
.dictation-review .button { width: 100%; min-height: 42px; }
.writing-dictation [hidden] { display: none !important; }
@keyframes dictation-pulse { 50% { opacity: .32; transform: scale(.72); } }

@media (max-width: 560px) {
    .draft-actions { grid-template-columns: auto auto auto minmax(0, 1fr); gap: 7px; }
    .draft-actions #submit-checkin { grid-column: -2 / -1; padding-inline: 10px; font-size: .72rem; }
    .draft-icon-button, .dictation-mic-button { width: 46px; height: 46px; }
    .dictation-popover { right: -8px; width: min(500px, calc(100vw - 58px)); }
}

/* Homepage concept 01 — in my pocket / 里袋 */
@font-face {
    font-family: "Pocket Metric";
    src: local("Metric Regular"), local("Metric");
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: "Pocket Metric";
    src: local("Metric Semibold"), local("Metric SemiBold");
    font-style: normal;
    font-weight: 600;
    font-display: swap;
}

@font-face {
    font-family: "Pocket Lanting";
    src: local("方正兰亭黑"), local("FZLanTingHei-R-GBK"), local("FZLanTingHeiS-R-GB");
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}

#auth-view {
    --home-ink: #2B2B2B;
    --home-paper: #F8F4ED;
    --home-khaki: #A89F8F;
    --home-blue: #7B8CA7;
    --home-yellow: #E8C36A;
    --home-orange: #D56B4A;
    --home-green: #8DAA8A;
    position: relative;
    z-index: 91;
    grid-template-columns: minmax(0, 1.45fr) minmax(420px, .75fr);
    grid-template-rows: 132px minmax(0, 1fr);
    min-height: 100svh;
    color: var(--home-ink);
    background: var(--home-paper);
    font-family: "Pocket Lanting", "FZLanTingHei-R-GBK", "PingFang SC", sans-serif;
}

#auth-view [lang="en"],
#auth-view .auth-index {
    font-family: "Pocket Metric", "Helvetica Neue", Arial, sans-serif;
}

#auth-view .home-header {
    grid-column: 1 / -1;
    grid-row: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: 0;
    padding: 0 clamp(28px, 4.5vw, 72px);
    border-bottom: 1px solid var(--home-ink);
}

.home-wordmark {
    display: block;
    color: var(--home-ink);
    text-decoration: none;
}

.home-wordmark h1 {
    margin: 0;
    line-height: 0;
}

.home-wordmark img {
    display: block;
    width: clamp(132px, 11vw, 188px);
    height: auto;
}

.home-header-brand {
    display: flex;
    align-items: center;
    gap: clamp(22px, 2vw, 32px);
}

.home-header-brand p {
    width: auto;
    margin: 0;
    color: var(--home-khaki);
    font-size: .88rem;
    line-height: 1.65;
    letter-spacing: .035em;
    white-space: nowrap;
    transform: translateY(7px);
}

#auth-view .language-link {
    float: none;
    display: grid;
    place-items: center;
    width: 42px;
    height: 30px;
    border: 1px solid var(--home-ink);
    border-radius: 999px;
    color: var(--home-ink);
    font: 600 .82rem/1 "Pocket Metric", "Helvetica Neue", Arial, sans-serif;
    letter-spacing: .08em;
    transition: color .18s ease, background .18s ease;
}

#auth-view .language-link:hover {
    color: var(--home-paper);
    background: var(--home-ink);
}

#auth-view .auth-story {
    grid-column: 1;
    grid-row: 2;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(250px, .95fr);
    grid-template-rows: auto auto auto auto;
    align-items: center;
    align-content: center;
    gap: clamp(15px, 2.2vh, 24px) 0;
    min-width: 0;
    min-height: 0;
    padding: clamp(42px, 6vh, 76px) clamp(28px, 4.5vw, 72px) 34px;
    isolation: auto;
    overflow: hidden;
    background: var(--home-paper);
}

#auth-view .auth-story::before,
#auth-view .auth-story::after {
    content: none;
}

.home-copy {
    position: relative;
    z-index: 2;
    align-self: center;
    width: min(100%, 390px);
    min-width: 0;
}

.home-kicker {
    grid-column: 1 / -1;
    grid-row: 1;
    align-self: end;
    margin: 0;
    color: var(--home-blue);
    width: max-content;
    max-width: 100%;
    font-size: clamp(.88rem, 1vw, 1.02rem);
    font-weight: 600;
    line-height: 1.55;
    letter-spacing: .24em;
    white-space: nowrap;
}

.home-kicker span { display: block; }

.home-en-intro { margin-top: 0; }

.home-en-title {
    display: grid;
    margin: 0;
    color: var(--home-ink);
    font: 600 clamp(4.1rem, 7vw, 6.8rem)/.72 "Pocket Metric", "Helvetica Neue", Arial, sans-serif;
    letter-spacing: -.045em;
}

.home-en-title span:last-child { margin-left: .3em; }

.home-slogan {
    position: relative;
    z-index: 3;
    grid-column: 1 / -1;
    grid-row: 3;
    width: 52.5%;
    max-width: 390px;
    margin: 0;
    color: var(--home-ink);
    font-size: clamp(.78rem, .9vw, .9rem);
    font-weight: 400;
    line-height: 1.9;
    letter-spacing: .1em;
    text-align: justify;
    text-align-last: justify;
    white-space: nowrap;
}

.home-illustration {
    position: relative;
    z-index: 1;
    align-self: center;
    justify-self: start;
    width: min(153%, 530px);
    margin: 0 0 0 -50%;
}

.home-illustration img {
    display: block;
    width: 100%;
    height: auto;
}

.home-principles {
    grid-column: 1 / -1;
    grid-row: 4;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--home-ink);
    list-style: none;
}

.home-principles li {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 88px;
    padding: 14px 18px 12px;
    border-right: 1px solid var(--home-ink);
    text-align: center;
}

.home-principles li:first-child { padding-left: 18px; }
.home-principles li:last-child { border-right: 0; }
.home-principle-title { display: flex; align-items: baseline; justify-content: center; gap: 12px; }
.home-principles span { color: var(--home-orange); font: 600 .72rem/1 "Pocket Metric", sans-serif; letter-spacing: .08em; }
.home-principles strong { display: block; font-size: .78rem; font-weight: 500; letter-spacing: .1em; }
.home-principles p {
    max-width: 240px;
    margin: 0;
    color: var(--home-khaki);
    font-size: .66rem;
    font-weight: 400;
    line-height: 1.55;
    letter-spacing: .04em;
    text-align: center;
}

#auth-view .auth-panel {
    grid-column: 2;
    grid-row: 2;
    display: block;
    min-width: 0;
    min-height: 0;
    padding: clamp(46px, 6vh, 72px) clamp(34px, 4.2vw, 68px) 56px;
    overflow-y: auto;
    border: 0;
    border-left: 1px solid var(--home-ink);
    background: var(--home-paper);
    backdrop-filter: none;
}

#auth-view .auth-card { width: min(100%, 470px); margin: 0 auto; }

.auth-card-heading {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 7px 18px;
    align-items: baseline;
    margin-bottom: clamp(34px, 5vh, 52px);
}

.auth-card-heading .auth-index {
    grid-column: 1 / -1;
    margin: 0 0 12px;
    color: var(--home-orange);
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .14em;
}

#auth-view .auth-card-heading h2 {
    margin: 0;
    font: 400 clamp(1.8rem, 2.7vw, 2.45rem)/1.2 "Pocket Lanting", "PingFang SC", sans-serif;
    letter-spacing: .08em;
}

.auth-card-heading > p:last-child {
    justify-self: end;
    margin: 0;
    color: var(--home-khaki);
    font-size: .73rem;
    letter-spacing: .08em;
}

#auth-view .auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    margin: 0 0 28px;
    border-bottom: 1px solid var(--home-khaki);
}

#auth-view .auth-tab {
    min-height: 46px;
    padding: 0 4px;
    border: 0;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    color: var(--home-khaki);
    background: transparent;
    font-size: .78rem;
    font-weight: 400;
    letter-spacing: .05em;
}

#auth-view .auth-tab.active {
    color: var(--home-ink);
    border-bottom-color: var(--home-orange);
    background: transparent;
}

#auth-view .auth-pane > .muted {
    margin: 0 0 22px;
    color: var(--home-khaki);
    font-size: .76rem;
    line-height: 1.75;
}

#auth-view .privacy-details {
    margin: 0 0 28px;
    border: 1px solid var(--home-khaki);
    border-radius: 0;
    background: transparent;
}

#auth-view .privacy-details summary {
    padding: 13px 14px;
    color: var(--home-ink);
    font-size: .72rem;
    font-weight: 400;
    letter-spacing: .03em;
}

#auth-view .privacy-details > div {
    padding: 2px 14px 10px;
    color: var(--home-khaki);
    font-size: .68rem;
}

#auth-view .privacy-details strong { color: var(--home-ink); font-weight: 400; }

#auth-view label:not(.consent-row) {
    margin: 18px 0 8px;
    font-size: .76rem;
    font-weight: 400;
    letter-spacing: .05em;
}

#auth-view input[type="text"],
#auth-view input[type="password"],
#auth-view input:not([type]) {
    width: 100%;
    height: 50px;
    padding: 0 14px;
    border: 1px solid var(--home-khaki);
    border-radius: 0;
    outline: none;
    color: var(--home-ink);
    background: transparent;
    box-shadow: none;
}

#auth-view input::placeholder { color: var(--home-khaki); opacity: .82; }

#auth-view input:focus {
    border-color: var(--home-blue);
    background: transparent;
    box-shadow: inset 3px 0 0 var(--home-blue);
}

#auth-view .consent-row {
    align-items: center;
    justify-content: center;
    margin: 22px 0;
    color: var(--home-khaki);
    font-size: .71rem;
    text-align: left;
}

#auth-view .consent-row input[type="checkbox"] { margin-top: 0; }

#auth-view input[type="checkbox"] { accent-color: var(--home-blue); }

#auth-view .button.primary {
    min-height: 52px;
    border: 1px solid var(--home-ink);
    border-radius: 0;
    color: var(--home-paper);
    background: var(--home-ink);
    box-shadow: none;
    font-size: .78rem;
    font-weight: 400;
    letter-spacing: .1em;
}

#auth-view .button.primary:hover:not(:disabled) {
    color: var(--home-ink);
    background: var(--home-yellow);
    box-shadow: none;
    transform: none;
}

#auth-view .safety-note {
    margin: 24px 0 0;
    padding-left: 12px;
    border-left: 3px solid var(--home-orange);
    color: var(--home-khaki);
    font-size: .67rem;
    line-height: 1.65;
    text-align: left;
}

@media (max-width: 1120px) {
    #auth-view { grid-template-columns: minmax(0, 1.2fr) minmax(390px, .8fr); }
    #auth-view .auth-story { grid-template-columns: minmax(0, 1fr) minmax(190px, .8fr); }
    .home-en-title { font-size: clamp(3.8rem, 7.4vw, 5.7rem); }
    .home-slogan { width: 55.55%; }
}

@media (max-width: 840px) {
    #auth-view {
        display: grid;
        grid-template-columns: 1fr;
        grid-template-rows: 116px auto auto;
    }

    #auth-view .home-header { grid-column: 1; grid-row: 1; padding: 0 24px; }
    #auth-view .auth-story {
        grid-column: 1;
        grid-row: 2;
        grid-template-columns: minmax(0, 1fr) minmax(180px, .62fr);
        min-height: auto;
        padding: 52px 24px 24px;
    }
    .home-slogan { width: min(100%, 390px); }
    .home-en-title { font-size: clamp(4.5rem, 13vw, 7rem); }
    #auth-view .auth-panel {
        grid-column: 1;
        grid-row: 3;
        padding: 54px 24px 72px;
        overflow: visible;
        border-left: 0;
        border-top: 1px solid var(--home-ink);
    }
}

/* Final profile and daily-card alignment overrides. */
body[data-role="member"] .profile-editor-card { text-align: left !important; }
body[data-role="member"] .profile-editor-card .profile-card-heading,
body[data-role="member"] .profile-editor-card .profile-card-heading > div,
body[data-role="member"] .profile-editor-card form > label { text-align: left !important; }
body[data-role="member"] .profile-avatar-actions { justify-content: center !important; }
body[data-role="member"] .profile-avatar-actions .button {
    border-color: #D56B4A !important;
    color: #F8F4ED !important;
    background: #D56B4A !important;
}
body[data-role="member"] .profile-form-grid.three-columns { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
body[data-role="member"] .profile-choice-chips { display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
body[data-role="member"] .daily-card-mark { width: 76px !important; height: 76px !important; flex-basis: 76px !important; margin: 0 !important; }
body[data-role="member"] .daily-card-header { align-items: flex-start !important; gap: 12px !important; }
body[data-role="member"] .daily-card-header p { margin-bottom: 4px !important; letter-spacing: .08em !important; white-space: nowrap; }
body[data-role="member"] .daily-card-header time { font-size: .96rem !important; white-space: nowrap; }
body[data-role="member"] .daily-card-header small { font-size: .62rem !important; white-space: nowrap; }
body[data-role="member"] .daily-card-accept { white-space: nowrap !important; }

@media (max-width: 340px) {
    body[data-role="member"] .daily-card-mark { width: 64px !important; height: 64px !important; flex-basis: 64px !important; }
    body[data-role="member"] .daily-card-header p { font-size: .52rem !important; }
    body[data-role="member"] .daily-card-header time { font-size: .8rem !important; }
    body[data-role="member"] .daily-card-header small { font-size: .54rem !important; }
}

/* Mobile writing controls: stable type sizes, palette buttons and export card chrome. */
.sketch-download-panel {
    border: 2px solid #2B2B2B;
    background: #F8F4ED;
    box-shadow: 8px 8px 0 #8DAA8A, -5px -5px 0 #D56B4A;
}

.sketch-download-heading .eyebrow { color: #7B8CA7; }

#sketch-download-preview {
    border: 2px solid #2B2B2B;
    border-radius: 16px;
    background: #E9E4D8;
}

@media (max-width: 760px) {
    body[data-role="member"] .notebook-current-editor textarea,
    body[data-role="member"] .checkin-segment-text {
        font-size: 16px !important;
    }

    body[data-role="member"] .entry-mode-card {
        min-height: 66px;
        padding: 8px 14px;
        gap: 12px;
        border: 0 !important;
        box-shadow: none !important;
    }

    body[data-role="member"] #photo-mode-card {
        color: #F8F4ED;
        background: #D56B4A !important;
    }

    body[data-role="member"] #open-sketch {
        color: #2B2B2B;
        background: #8DAA8A !important;
    }

    body[data-role="member"] .entry-mode-icon {
        flex: 0 0 34px;
        width: 34px;
        height: 34px;
        border-radius: 0;
        color: inherit;
        background: transparent !important;
        box-shadow: none !important;
    }

    body[data-role="member"] .entry-mode-icon svg {
        width: 28px;
        height: 28px;
    }

    body[data-role="member"] .entry-mode-card strong {
        font-size: clamp(.82rem, 3.7vw, .96rem);
        line-height: 1;
        white-space: nowrap;
    }

    body[data-role="member"] .writing-choice-row .share-option,
    body[data-role="member"] .writing-choice-row .silent-submit-button {
        min-height: 56px;
        padding: 7px 3px;
        gap: 4px;
        font-size: clamp(.58rem, 2.8vw, .72rem);
        font-weight: 760;
        line-height: 1;
        white-space: nowrap;
    }

    body[data-role="member"] .writing-choice-row .share-option-icon,
    body[data-role="member"] .writing-choice-row .silent-submit-button svg {
        flex: 0 0 15px;
        width: 15px;
        height: 15px;
    }

    body[data-role="member"] .writing-choice-row .silent-submit-button span::after {
        content: "Skip today";
        font-size: clamp(.58rem, 2.8vw, .72rem);
        white-space: nowrap;
    }

    .sketch-download-panel { padding: 18px; }
    .sketch-download-heading h2 {
        font-size: clamp(1rem, 5.4vw, 1.3rem);
        white-space: nowrap;
    }
    .sketch-download-actions .button {
        min-width: 0;
        padding-right: 8px;
        padding-left: 8px;
        font-size: clamp(.78rem, 4vw, .96rem);
        white-space: nowrap;
    }
}

@media (max-width: 560px) {
    #auth-view { grid-template-rows: 82px auto auto; }
    #auth-view .home-header { padding: 0 16px; }
    .home-header-brand { gap: 10px; }
    .home-wordmark img { width: 88px; }
    .home-header-brand p {
        width: min(49vw, 170px);
        font-size: .56rem;
        line-height: 1.45;
        white-space: normal;
        transform: translateY(2px);
    }
    #auth-view .language-link { width: 34px; height: 26px; font-size: .66rem; }
    #auth-view .auth-story {
        grid-template-columns: minmax(0, .78fr) minmax(150px, 1.22fr);
        grid-template-rows: auto auto auto auto;
        gap: 12px 0;
        padding: 22px 18px 18px;
    }
    .home-kicker {
        grid-column: 1 / -1;
        grid-row: 1;
        font-size: .55rem;
        line-height: 1.4;
        letter-spacing: .1em;
    }
    .home-copy { grid-column: 1; grid-row: 2; width: 100%; }
    .home-en-title { font-size: clamp(2.75rem, 14vw, 3.45rem); line-height: .78; }
    .home-en-title span:last-child { margin-left: .18em; }
    .home-illustration {
        grid-column: 2;
        grid-row: 2;
        align-self: center;
        justify-self: end;
        width: min(61vw, 238px);
        margin: -14px -8px -14px -24px;
    }
    .home-slogan {
        grid-column: 1 / -1;
        grid-row: 3;
        width: auto;
        max-width: 100%;
        margin-top: -4px;
        font-size: .65rem;
        line-height: 1.6;
        letter-spacing: .06em;
        text-align: left;
        text-align-last: auto;
        white-space: normal;
    }
    .home-principles { grid-column: 1 / -1; grid-row: 4; grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .home-principles li {
        min-height: 104px;
        padding: 10px 1px 8px;
        border-right: 1px solid var(--home-khaki);
        border-bottom: 0;
        gap: 7px;
    }
    .home-principles li:first-child { padding-left: 1px; }
    .home-principles li:last-child { border-right: 0; }
    .home-principle-title { gap: 3px; }
    .home-principles span { font-size: .5rem; }
    .home-principles strong {
        font-size: 0;
        letter-spacing: 0;
        white-space: nowrap;
    }
    .home-principles strong::after { font-size: .57rem; }
    .home-principles li:nth-child(1) strong::after { content: "Facing Loss"; }
    .home-principles li:nth-child(2) strong::after { content: "Your Story"; }
    .home-principles li:nth-child(3) strong::after { content: "Relationships"; }
    .home-principles p { font-size: .55rem; line-height: 1.45; letter-spacing: .01em; }
    .auth-card-heading { grid-template-columns: 1fr; }
    .auth-card-heading > p:last-child { justify-self: start; }
}

/* Participant visual system — aligned with the In My Pocket home page. */
@media (min-width: 841px) {
    #auth-view .home-kicker { transform: translateY(-18px); }
    #auth-view .home-copy { transform: translateY(-12px); }
    #auth-view .home-illustration { transform: translateY(-28px); }
    #auth-view .home-slogan { transform: translateY(-44px); }
    #auth-view .home-principles { transform: translateY(24px); }
}

@media (min-width: 841px) and (max-width: 1120px) {
    #auth-view .home-kicker { transform: translateY(-42px); }
}

body[data-role="member"] {
    --paper: #F8F4ED;
    --paper-deep: #F8F4ED;
    --surface: #F8F4ED;
    --ink: #2B2B2B;
    --ink-soft: #786f63;
    --line: #A89F8F;
    --member: #7B8CA7;
    --member-deep: #2B2B2B;
    --member-pale: #ece8df;
    --ai: #D56B4A;
    --ai-deep: #D56B4A;
    --ai-pale: #f2dfd7;
    min-height: 100%;
    color: var(--ink);
    background: var(--paper);
    background-image: none;
    font-family: "Pocket Lanting", "FZLanTingHeiS-R-GB", "PingFang SC", sans-serif;
}

body[data-role="member"]::before { display: none; }
body[data-role="member"] [lang="en"],
body[data-role="member"] .eyebrow { font-family: "Pocket Metric", "Helvetica Neue", Arial, sans-serif; }

body[data-role="member"] .topbar {
    min-height: 86px;
    padding: 0 clamp(24px, 4vw, 64px);
    border-bottom: 1px solid var(--ink);
    background: var(--paper);
    box-shadow: none;
    backdrop-filter: none;
}

body[data-role="member"] .brand { gap: 12px; }
body[data-role="member"] .brand-mark.small {
    width: 52px;
    height: 52px;
    margin: 0;
    border-radius: 0;
    background: url("assets/pocket-mark-isolated-v1.png") center / contain no-repeat;
}
body[data-role="member"] .brand-mark.small span { display: none; }
body[data-role="member"] .brand strong { color: var(--ink); font: 600 1.35rem/1 "Pocket Metric", "Helvetica Neue", Arial, sans-serif; letter-spacing: .01em; text-transform: lowercase; }
body[data-role="member"] .brand small { margin-top: 4px; color: var(--ink-soft); font-size: .62rem; }
body[data-role="member"] .avatar { color: var(--paper); background: var(--ink); }
body[data-role="member"] .identity-button { border-color: var(--ink); border-radius: 0; background: transparent; box-shadow: none; }

body[data-role="member"] .member-app { width: min(calc(100% - 64px), 1180px); padding: 36px 0 96px; }
body[data-role="member"] .member-nav {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: 100%;
    margin: 0 0 52px;
    padding: 0;
    border: 0;
    border-top: 1px solid var(--ink);
    border-bottom: 1px solid var(--ink);
    border-radius: 0;
    background: transparent;
}

body[data-role="member"] .nav-button {
    position: relative;
    min-height: 58px;
    padding: 0 16px;
    border: 0;
    border-right: 1px solid var(--line);
    border-radius: 0;
    color: var(--ink-soft);
    background: transparent;
    font-size: .78rem;
    letter-spacing: .06em;
}
body[data-role="member"] .nav-button:last-child { border-right: 0; }
body[data-role="member"] .nav-button.active {
    color: var(--ink);
    background: transparent;
    box-shadow: inset 0 -4px 0 var(--home-orange, #D56B4A);
    font-weight: 800;
}
body[data-role="member"] .nav-button:hover { color: var(--ink); background: rgba(168,159,143,.09); }

body[data-role="member"] .welcome-block,
body[data-role="member"] .section-heading { width: min(100%, 960px); margin-right: auto; margin-left: auto; }
body[data-role="member"] .welcome-block h1,
body[data-role="member"] .section-heading h1 { color: var(--ink); font-size: clamp(2rem, 4vw, 3.7rem); font-weight: 800; letter-spacing: -.025em; }
body[data-role="member"] .section-heading > p,
body[data-role="member"] .welcome-block > p { color: var(--ink-soft); }

body[data-role="member"] .button { border-radius: 0; box-shadow: none; transform: none; }
body[data-role="member"] .button:hover:not(:disabled) { box-shadow: none; transform: none; }
body[data-role="member"] .button.primary,
body[data-role="member"] .member-app .button.primary { border: 1px solid var(--ink); color: var(--paper); background: var(--ink); box-shadow: none; }
body[data-role="member"] .button.primary:hover:not(:disabled),
body[data-role="member"] .member-app .button.primary:hover:not(:disabled) { color: var(--ink); background: var(--home-yellow, #E8C36A); }
body[data-role="member"] .button.secondary { border-color: var(--ink); background: transparent; }

body[data-role="member"] input,
body[data-role="member"] textarea,
body[data-role="member"] select { border-color: var(--line); border-radius: 0; background: transparent; box-shadow: none; }
body[data-role="member"] input:focus,
body[data-role="member"] textarea:focus,
body[data-role="member"] select:focus,
body[data-role="member"] .member-app input:focus,
body[data-role="member"] .member-app textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }

body[data-role="member"] .notebook-workspace { grid-template-columns: minmax(0, 900px) 56px; }
body[data-role="member"] .notebook-shell { border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
body[data-role="member"] .notebook-shell::before { display: none; }
body[data-role="member"] .notebook-cover { padding: 28px 0 26px; border-bottom-color: var(--line); }
body[data-role="member"] .notebook-cover .eyebrow { color: var(--home-blue, #7B8CA7); letter-spacing: .14em; }
body[data-role="member"] .notebook-cover h2 { color: var(--ink); }
body[data-role="member"] .notebook-day > summary::before,
body[data-role="member"] .notebook-day > summary::after { background: var(--line); }
body[data-role="member"] .notebook-day > summary { color: var(--ink); }
body[data-role="member"] .notebook-block { border-bottom-color: rgba(168,159,143,.55); }
body[data-role="member"] .notebook-block:focus-within,
body[data-role="member"] .notebook-block:hover { border-bottom-color: var(--ink); }
body[data-role="member"] .notebook-current-editor { border-bottom-color: var(--ink); }
body[data-role="member"] .notebook-new-fragment {
    margin-top: 14px;
    border: 1px solid var(--ink);
    border-radius: 0;
    color: var(--ink);
    background: transparent;
}
body[data-role="member"] .notebook-tool { border-color: var(--ink); color: var(--ink); background: var(--paper); box-shadow: none; }
body[data-role="member"] .notebook-tool:hover,
body[data-role="member"] .notebook-tool.active { color: var(--paper); background: var(--ink); }
body[data-role="member"] .notebook-tool.recording { color: var(--paper); background: var(--home-orange, #D56B4A); }
body[data-role="member"] .notebook-voice-card { border: 1px solid var(--line); border-radius: 0; background: transparent; }
body[data-role="member"] .notebook-voice-card > span { background: var(--home-orange, #D56B4A); }
body[data-role="member"] .notebook-sketch-toolbar { border-color: var(--ink); border-radius: 0; background: var(--paper); box-shadow: none; backdrop-filter: none; }

body[data-role="member"] .composer,
body[data-role="member"] .reflection-panel,
body[data-role="member"] .submitted-state {
    width: min(100%, 900px);
    border: 1px solid var(--ink);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
}
body[data-role="member"] .composer { padding: clamp(24px, 4vw, 44px); }
body[data-role="member"] .reflection-panel { border-color: var(--home-orange, #D56B4A); }
body[data-role="member"] .entry-mode-card,
body[data-role="member"] .draft-segment,
body[data-role="member"] .share-option,
body[data-role="member"] .silent-submit-button,
body[data-role="member"] .submission-window-note {
    border-color: var(--line);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}
body[data-role="member"] .entry-mode-card::after { display: none; }
body[data-role="member"] .entry-mode-card:hover,
body[data-role="member"] .entry-mode-card:focus-visible { border-color: var(--ink); box-shadow: none; transform: none; }
body[data-role="member"] .entry-mode-icon { width: 46px; height: 46px; color: var(--paper); background: var(--home-blue, #7B8CA7); box-shadow: none; }
body[data-role="member"] .draft-segment-heading small { border-radius: 0; color: var(--ink); background: rgba(232,195,106,.32); }
body[data-role="member"] .share-option:has(input:checked),
body[data-role="member"] .share-option.checked-option { border-color: var(--ink); color: var(--ink); background: rgba(123,140,167,.17); box-shadow: inset 0 -3px 0 var(--home-blue, #7B8CA7); }
body[data-role="member"] .silent-submit-button { border-style: solid; color: var(--ink); }
body[data-role="member"] .silent-submit-button:hover:not(:disabled) { border-color: var(--ink); background: rgba(232,195,106,.18); transform: none; }
body[data-role="member"] .submission-window-note { border-left: 4px solid var(--home-blue, #7B8CA7); color: var(--ink-soft); }
body[data-role="member"] .submission-window-note.closed { border-color: var(--line); border-left-color: var(--home-orange, #D56B4A); background: transparent; }
body[data-role="member"] .draft-save { border-color: var(--ink); color: var(--paper); background: var(--ink); box-shadow: none; }
body[data-role="member"] .draft-delete { border-color: var(--line); background: transparent; }

body[data-role="member"] .journey-tabs,
body[data-role="member"] .shared-tabs {
    gap: 0;
    width: min(100%, 960px);
    margin-right: auto;
    margin-left: auto;
    border-bottom: 1px solid var(--ink);
}
body[data-role="member"] .journey-tab,
body[data-role="member"] .shared-tab {
    min-height: 48px;
    padding: 0 20px;
    border: 0;
    border-radius: 0;
    color: var(--ink-soft);
    background: transparent;
}
body[data-role="member"] .journey-tab.active,
body[data-role="member"] .shared-tab.active { color: var(--ink); background: transparent; box-shadow: inset 0 -4px 0 var(--home-orange, #D56B4A); }
body[data-role="member"] .phase-banner,
body[data-role="member"] .checkin-calendar,
body[data-role="member"] .record-card,
body[data-role="member"] .weekly-card,
body[data-role="member"] .two-week-card,
body[data-role="member"] .checkin-plan-option {
    border: 1px solid var(--line);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}
body[data-role="member"] .phase-banner { border-left: 4px solid var(--home-blue, #7B8CA7); color: var(--ink); }
body[data-role="member"] .checkin-calendar-day {
    border: 1px solid transparent;
    border-radius: 0;
    color: var(--ink);
    background: transparent;
    box-shadow: none;
    appearance: none;
}
body[data-role="member"] .checkin-calendar-day.today { border-color: var(--home-blue, #7B8CA7); box-shadow: none; }
body[data-role="member"] .checkin-calendar-day.marked { color: var(--ink); background: rgba(141,170,138,.24); }
body[data-role="member"] .checkin-calendar-day.marked::after { background: var(--home-green, #8DAA8A); }
body[data-role="member"] .checkin-plan-option:has(input:checked) { border-color: var(--ink); background: rgba(123,140,167,.12); }

body[data-role="member"] .shared-grid { width: min(100%, 960px); margin: 0 auto; gap: 24px; }
body[data-role="member"] .shared-card {
    border-color: var(--line);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    transform: none;
    backdrop-filter: none;
}
body[data-role="member"] .shared-member-avatar { border-radius: 50%; background: var(--home-blue, #7B8CA7); }
body[data-role="member"] .shared-card-date { border-left-color: var(--line); }
body[data-role="member"] .shared-ai-reply { border-left-color: var(--home-blue, #7B8CA7); border-radius: 0; background: rgba(123,140,167,.12); }
body[data-role="member"] .empty-orbit { border-color: var(--home-blue, #7B8CA7); box-shadow: 12px 0 0 -1px var(--paper), 12px 0 0 0 var(--home-orange, #D56B4A); }

body[data-role="member"] .profile-hero,
body[data-role="member"] .profile-layout,
body[data-role="member"] .profile-journey-card { width: min(100%, 960px); }
body[data-role="member"] .profile-page-avatar { border-radius: 50%; color: var(--paper); background: var(--ink); box-shadow: none; }
body[data-role="member"] .profile-card,
body[data-role="member"] .profile-stats article,
body[data-role="member"] .profile-fieldset,
body[data-role="member"] .profile-privacy-summary label {
    border-color: var(--line);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}
body[data-role="member"] .profile-card-heading > span,
body[data-role="member"] .profile-rhythm-edit-note { border-radius: 0; color: var(--ink); background: rgba(232,195,106,.25); }
body[data-role="member"] .profile-choice-chips label > span { border-color: var(--line); border-radius: 0; background: transparent; }
body[data-role="member"] .profile-choice-chips input:checked + span { border-color: var(--ink); color: var(--paper); background: var(--ink); }

body[data-role="member"] .daily-card-panel,
body[data-role="member"] .public-profile-panel { border-radius: 0; background: var(--paper); box-shadow: none; }
body[data-role="member"] .daily-card { border: 1px solid var(--ink); border-radius: 0; background: var(--daily-card-paper) url("assets/daily-card-puzzle-bg-v1.png?v=2") var(--daily-card-position)/cover no-repeat; }
body[data-role="member"] .daily-card::before { background: var(--daily-card-overlay); }
body[data-role="member"] .public-profile-panel { border: 1px solid var(--ink); }
body[data-role="member"] .public-profile-panel::after { display: none; }

@media (max-width: 760px) {
    body[data-role="member"] .topbar { min-height: 72px; padding: 0 18px; }
    body[data-role="member"] .brand-mark.small { width: 38px; height: 38px; }
    body[data-role="member"] .member-app { width: min(calc(100% - 32px), 1180px); padding-top: 24px; }
    body[data-role="member"] .member-nav { grid-template-columns: repeat(2, 1fr); margin-bottom: 34px; }
    body[data-role="member"] .nav-button:nth-child(2) { border-right: 0; }
    body[data-role="member"] .nav-button:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
    body[data-role="member"] .notebook-workspace { grid-template-columns: 1fr; }
    body[data-role="member"] .notebook-tool-dock { border-color: var(--ink); border-radius: 0; background: var(--paper); box-shadow: none; }
    body[data-role="member"] .profile-layout { grid-template-columns: 1fr; }
    body[data-role="member"] .shared-grid { grid-template-columns: 1fr; }
    body[data-role="member"] .shared-card { grid-column: 1; }
}

/* Softer participant controls and notebook treatment. */
#auth-view .privacy-details,
#auth-view input[type="text"],
#auth-view input[type="password"],
#auth-view input:not([type]),
#auth-view .button.primary { border-radius: 14px; }

#auth-view input[type="text"],
#auth-view input[type="password"],
#auth-view input:not([type]),
#auth-view .button.primary,
#auth-view .privacy-details summary { text-align: center; }

#auth-view #account-login-button { margin-top: 22px; }

body[data-role="member"] .identity-button,
body[data-role="member"] .member-nav,
body[data-role="member"] .notebook-shell,
body[data-role="member"] .notebook-new-fragment,
body[data-role="member"] .notebook-voice-card,
body[data-role="member"] .notebook-sketch-toolbar,
body[data-role="member"] .composer,
body[data-role="member"] .reflection-panel,
body[data-role="member"] .submitted-state,
body[data-role="member"] .entry-mode-card,
body[data-role="member"] .draft-segment,
body[data-role="member"] .share-option,
body[data-role="member"] .silent-submit-button,
body[data-role="member"] .submission-window-note,
body[data-role="member"] .journey-tabs,
body[data-role="member"] .shared-tabs,
body[data-role="member"] .phase-banner,
body[data-role="member"] .checkin-calendar,
body[data-role="member"] .record-card,
body[data-role="member"] .weekly-card,
body[data-role="member"] .two-week-card,
body[data-role="member"] .checkin-plan-option,
body[data-role="member"] .shared-card,
body[data-role="member"] .profile-card,
body[data-role="member"] .profile-stats article,
body[data-role="member"] .profile-fieldset,
body[data-role="member"] .profile-privacy-summary label,
body[data-role="member"] .daily-card-panel,
body[data-role="member"] .daily-card,
body[data-role="member"] .public-profile-panel,
body[data-role="member"] input,
body[data-role="member"] textarea,
body[data-role="member"] select,
body[data-role="member"] .button { border-radius: 16px; }

body[data-role="member"] .member-nav,
body[data-role="member"] .journey-tabs,
body[data-role="member"] .shared-tabs { overflow: hidden; }

body[data-role="member"] .nav-button,
body[data-role="member"] .journey-tab,
body[data-role="member"] .shared-tab { border-radius: 0; text-align: center; }

body[data-role="member"] .notebook-shell {
    padding: 0 28px 22px;
    background-color: rgba(248,244,237,.9);
    background-image:
        linear-gradient(rgba(123,140,167,.16) 1px, transparent 1px),
        linear-gradient(90deg, rgba(123,140,167,.16) 1px, transparent 1px);
    background-position: -1px -1px;
    background-size: 24px 24px;
}

body[data-role="member"] .notebook-cover,
body[data-role="member"] .notebook-days,
body[data-role="member"] .notebook-current-editor,
body[data-role="member"] .notebook-block,
body[data-role="member"] .notebook-block textarea,
body[data-role="member"] .notebook-current-editor textarea { background: rgba(248,244,237,.72); }

body[data-role="member"] .notebook-current-editor {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 16px;
}

body[data-role="member"] .button,
body[data-role="member"] .nav-button,
body[data-role="member"] .journey-tab,
body[data-role="member"] .shared-tab,
body[data-role="member"] .entry-mode-card,
body[data-role="member"] .share-option,
body[data-role="member"] .silent-submit-button,
body[data-role="member"] .submission-window-note,
body[data-role="member"] .phase-banner,
body[data-role="member"] .checkin-calendar,
body[data-role="member"] .record-card,
body[data-role="member"] .weekly-card,
body[data-role="member"] .two-week-card,
body[data-role="member"] .checkin-plan-option,
body[data-role="member"] .shared-card,
body[data-role="member"] .profile-card,
body[data-role="member"] .profile-stats article,
body[data-role="member"] .profile-fieldset,
body[data-role="member"] .profile-privacy-summary label,
body[data-role="member"] input,
body[data-role="member"] textarea,
body[data-role="member"] select { text-align: center; }

body[data-role="member"] .entry-mode-card,
body[data-role="member"] .submission-window-note,
body[data-role="member"] .checkin-plan-option { justify-content: center; }

body[data-role="member"] .profile-card-heading { justify-content: center; text-align: center; }
body[data-role="member"] .profile-membership dl div { align-items: center; }
body[data-role="member"] .profile-membership dt,
body[data-role="member"] .profile-membership dd { flex: 1; text-align: center; }

body[data-role="member"] .draft-icon-button,
body[data-role="member"] .notebook-tool,
body[data-role="member"] .avatar,
body[data-role="member"] .profile-page-avatar,
body[data-role="member"] .shared-member-avatar,
body[data-role="member"] .checkin-calendar-nav button { border-radius: 50%; }

/* Shared signed-in brand alignment. */
body[data-role="member"] #group-name,
body[data-role="observer"] #group-name { display: none; }

body[data-role="member"] .brand,
body[data-role="observer"] .brand { align-items: center; gap: 14px; }

body[data-role="member"] .brand-mark.small,
body[data-role="observer"] .brand-mark.small {
    width: 76px;
    height: 76px;
    flex: 0 0 76px;
    margin: 0;
    background: url("assets/pocket-mark-isolated-v1.png") center / contain no-repeat;
}

body[data-role="member"] .brand strong,
body[data-role="observer"] .brand strong {
    display: block;
    margin: 0;
    color: #2B2B2B;
    font: 600 1.45rem/1 "Pocket Metric", "Helvetica Neue", Arial, sans-serif;
    letter-spacing: .01em;
    text-transform: lowercase;
}

body[data-role="member"] .topbar,
body[data-role="observer"] .topbar { min-height: 100px; }

/* Researcher workspace — follows the participant visual system. */
body[data-role="observer"] {
    --paper: #F8F4ED;
    --paper-deep: #F8F4ED;
    --surface: #F8F4ED;
    --ink: #2B2B2B;
    --ink-soft: #786f63;
    --line: #A89F8F;
    --researcher: #7B8CA7;
    --researcher-deep: #2B2B2B;
    --researcher-pale: #e8ebef;
    --member: #8DAA8A;
    --member-deep: #566e54;
    --ai: #D56B4A;
    --ai-deep: #D56B4A;
    --ai-pale: #f2dfd7;
    min-height: 100%;
    color: var(--ink);
    background: var(--paper);
    background-image: none;
    font-family: "Pocket Lanting", "FZLanTingHeiS-R-GB", "PingFang SC", sans-serif;
}

body[data-role="observer"]::before { display: none; }
body[data-role="observer"] [lang="en"],
body[data-role="observer"] .eyebrow { font-family: "Pocket Metric", "Helvetica Neue", Arial, sans-serif; }

body[data-role="observer"] .topbar {
    padding: 0 clamp(24px, 4vw, 64px);
    border-bottom: 1px solid var(--ink);
    background: var(--paper);
    box-shadow: none;
    backdrop-filter: none;
}

body[data-role="observer"] .brand-mark.small span { display: none; }
body[data-role="observer"] .avatar { color: var(--paper); background: var(--ink); }
body[data-role="observer"] .identity-profile-entry,
body[data-role="observer"] .observer-group-switcher select { border-color: var(--ink); border-radius: 16px; background: transparent; box-shadow: none; }

body[data-role="observer"] .observer-app {
    width: min(calc(100% - 64px), 1320px);
    margin: 0 auto;
    padding: 36px 0 96px;
}

body[data-role="observer"] .research-nav {
    top: 100px;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0;
    width: 100%;
    margin: 0 0 52px;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--ink);
    border-radius: 18px;
    background: var(--paper);
    box-shadow: none;
    backdrop-filter: none;
}

body[data-role="observer"] .research-nav-button {
    min-height: 58px;
    padding: 0 12px;
    border: 0;
    border-right: 1px solid var(--line);
    border-radius: 0;
    color: var(--ink-soft);
    background: transparent;
    box-shadow: none;
    text-align: center;
}
body[data-role="observer"] .research-nav-button:last-child { border-right: 0; }
body[data-role="observer"] .research-nav-button.active {
    color: var(--ink);
    background: transparent;
    box-shadow: inset 0 -4px 0 var(--home-orange, #D56B4A);
    font-weight: 800;
}

body[data-role="observer"] .observer-heading {
    width: 100%;
    margin-bottom: 34px;
}
body[data-role="observer"] .observer-heading h1 {
    color: var(--ink);
    font-size: clamp(2rem, 4vw, 3.7rem);
    font-weight: 800;
    letter-spacing: -.025em;
}
body[data-role="observer"] .observer-heading > div > p:last-child { color: var(--ink-soft); }

body[data-role="observer"] .button,
body[data-role="observer"] input,
body[data-role="observer"] textarea,
body[data-role="observer"] select,
body[data-role="observer"] .filter-button {
    border-radius: 16px;
    box-shadow: none;
    text-align: center;
}
body[data-role="observer"] .button:hover:not(:disabled) { box-shadow: none; transform: none; }
body[data-role="observer"] .observer-app .button.primary,
body[data-role="observer"] #research-ai-section .button.primary {
    border: 1px solid var(--ink);
    color: var(--paper);
    background: var(--ink);
    box-shadow: none;
}
body[data-role="observer"] .observer-app .button.primary:hover:not(:disabled),
body[data-role="observer"] #research-ai-section .button.primary:hover:not(:disabled) { color: var(--ink); background: var(--home-yellow, #E8C36A); }
body[data-role="observer"] .button.secondary { border-color: var(--ink); background: transparent; }
body[data-role="observer"] input,
body[data-role="observer"] textarea,
body[data-role="observer"] select { border-color: var(--line); background: transparent; }
body[data-role="observer"] input:focus,
body[data-role="observer"] textarea:focus,
body[data-role="observer"] select:focus,
body[data-role="observer"] .observer-app input:focus,
body[data-role="observer"] .observer-app textarea:focus,
body[data-role="observer"] .observer-app select:focus { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }

body[data-role="observer"] .metrics article,
body[data-role="observer"] .inbox-card,
body[data-role="observer"] .chart-card,
body[data-role="observer"] .timeline-research-card,
body[data-role="observer"] .workspace-card,
body[data-role="observer"] .prompt-editor-card,
body[data-role="observer"] .private-status-grid article,
body[data-role="observer"] .invite-card,
body[data-role="observer"] .engine-grid article,
body[data-role="observer"] .qual-metrics article,
body[data-role="observer"] .theme-status-grid > article,
body[data-role="observer"] .research-note-area,
body[data-role="observer"] .version-history,
body[data-role="observer"] .interaction-history,
body[data-role="observer"] .agent-config-fieldset,
body[data-role="observer"] .agent-toggle,
body[data-role="observer"] .config-version-row,
body[data-role="observer"] .family-member-chip,
body[data-role="observer"] .family-relationship-row,
body[data-role="observer"] .agent-run-row {
    border-color: var(--line);
    border-radius: 18px;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
}

body[data-role="observer"] .metrics article,
body[data-role="observer"] .engine-grid article,
body[data-role="observer"] .qual-metrics article,
body[data-role="observer"] .theme-status-grid > article,
body[data-role="observer"] .private-status-grid article,
body[data-role="observer"] .invite-card { text-align: center; }

body[data-role="observer"] .metrics strong { color: var(--ink); }
body[data-role="observer"] .filter-tabs {
    display: flex;
    gap: 0;
    overflow: hidden;
    border: 1px solid var(--ink);
    border-radius: 16px;
}
body[data-role="observer"] .filter-button { border: 0; border-right: 1px solid var(--line); border-radius: 0; background: transparent; }
body[data-role="observer"] .filter-button:last-child { border-right: 0; }
body[data-role="observer"] .filter-button.active { color: var(--ink); background: rgba(123,140,167,.18); box-shadow: inset 0 -3px 0 var(--home-blue, #7B8CA7); }

body[data-role="observer"] .privacy-banner {
    justify-content: center;
    border-color: var(--line);
    border-radius: 16px;
    color: var(--ink-soft);
    background: rgba(123,140,167,.11);
    text-align: center;
}
body[data-role="observer"] .privacy-banner strong { color: var(--ink); }

body[data-role="observer"] .research-journey {
    overflow: hidden;
    border: 1px solid var(--ink);
    border-radius: 18px;
}
body[data-role="observer"] .research-journey::before { background: var(--line); }
body[data-role="observer"] .research-journey a { text-align: center; }
body[data-role="observer"] .research-chapter { border-top-color: var(--ink); }
body[data-role="observer"] .research-chapter-heading { justify-content: center; text-align: center; }
body[data-role="observer"] .research-chapter-heading > span { background: var(--home-blue, #7B8CA7); }

body[data-role="observer"] .chart-heading,
body[data-role="observer"] .prompt-editor-heading,
body[data-role="observer"] .invite-heading { justify-content: center; text-align: center; }
body[data-role="observer"] .chart-heading > div,
body[data-role="observer"] .prompt-editor-heading > div,
body[data-role="observer"] .invite-heading > div { flex: 1; }
body[data-role="observer"] .chart-heading p,
body[data-role="observer"] .workspace-card > p,
body[data-role="observer"] .prompt-purpose,
body[data-role="observer"] .method-note { text-align: center; }

body[data-role="observer"] .member-submission { border-left-color: var(--home-blue, #7B8CA7); border-radius: 16px; background: rgba(123,140,167,.1); }
body[data-role="observer"] .draft-area { border: 1px solid var(--home-orange, #D56B4A); border-radius: 18px; background: rgba(213,107,74,.08); }
body[data-role="observer"] .draft-area textarea,
body[data-role="observer"] .prompt-editor { text-align: left; }
body[data-role="observer"] .version-list article { border-radius: 14px; background: rgba(123,140,167,.08); }

body[data-role="observer"] .daily-response-controls {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin: 20px 0;
}
body[data-role="observer"] .daily-response-controls label { display: grid; gap: 9px; margin: 0; text-align: center; }
body[data-role="observer"] .daily-response-controls select { width: 100%; min-height: 48px; }
body[data-role="observer"] #research-weekly-section .workspace-card > p { text-align: left; }
body[data-role="observer"] #research-weekly-section .weekly-workspace > .workspace-card:nth-child(3) { width: 100%; }

body[data-role="observer"] .agent-config-scope-row,
body[data-role="observer"] .agent-response-presets,
body[data-role="observer"] .family-relationship-form { justify-content: center; }
body[data-role="observer"] .agent-toggle { align-items: center; text-align: center; }
body[data-role="observer"] .agent-toggle span { flex: 1; }
body[data-role="observer"] .family-relationship-form .button { justify-self: center; }

@media (max-width: 980px) {
    body[data-role="observer"] .research-nav { grid-template-columns: repeat(3, 1fr); }
    body[data-role="observer"] .research-nav-button:nth-child(3n) { border-right: 0; }
    body[data-role="observer"] .research-nav-button:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
    body[data-role="observer"] .engine-grid,
    body[data-role="observer"] .agent-config-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
    body[data-role="member"] .brand-mark.small,
    body[data-role="observer"] .brand-mark.small { width: 60px; height: 60px; flex-basis: 60px; }
    body[data-role="member"] .topbar,
    body[data-role="observer"] .topbar { min-height: 84px; }
    body[data-role="observer"] .observer-app { width: min(calc(100% - 32px), 1320px); padding-top: 24px; }
    body[data-role="observer"] .research-nav { top: 84px; grid-template-columns: repeat(2, 1fr); }
    body[data-role="observer"] .research-nav-button:nth-child(3n) { border-right: 1px solid var(--line); }
    body[data-role="observer"] .research-nav-button:nth-child(2n) { border-right: 0; }
    body[data-role="observer"] .research-nav-button:nth-child(-n+4) { border-bottom: 1px solid var(--line); }
    body[data-role="observer"] .dashboard-grid,
    body[data-role="observer"] .weekly-workspace,
    body[data-role="observer"] .private-status-grid,
    body[data-role="observer"] .engine-grid,
    body[data-role="observer"] .agent-config-grid,
    body[data-role="observer"] .agent-config-toggles,
    body[data-role="observer"] .family-relationship-form { grid-template-columns: 1fr; }
    body[data-role="observer"] .daily-response-controls { grid-template-columns: 1fr; }
    body[data-role="observer"] .family-relationship-form .button { grid-column: 1; }
}

/* Keep both access paths the same visual length. */
@media (min-width: 841px) {
    #auth-view .home-copy { transform: translateY(28px); }

    #auth-view .auth-panel { padding-top: 32px; padding-bottom: 32px; }
    #auth-view .auth-card-heading { margin-bottom: 24px; }
    #auth-view .auth-tabs { margin-bottom: 20px; }

    #auth-view .auth-pane:not(.hidden) {
        display: flex;
        flex-direction: column;
        min-height: 392px;
    }

    #auth-view .auth-pane > form {
        display: flex;
        flex: 1;
        flex-direction: column;
        min-height: 0;
    }

    #auth-view .auth-pane > .muted { margin-bottom: 14px; line-height: 1.6; }
    #auth-view #auth-pane-invite .privacy-details { margin-bottom: 14px; }
    #auth-view #auth-pane-invite .privacy-details summary { padding-top: 10px; padding-bottom: 10px; }
    #auth-view #auth-pane-invite label:not(.consent-row) { margin-top: 11px; margin-bottom: 6px; }
    #auth-view #auth-pane-invite input[type="text"],
    #auth-view #auth-pane-invite input:not([type]) { height: 46px; }
    #auth-view #auth-pane-invite .consent-row {
        margin: auto 0 16px;
        line-height: 1.45;
    }

    #auth-view #login-button { margin-top: 0; }
    #auth-view #account-login-button { margin-top: auto; }
}

@media (max-width: 840px) {
    #auth-view .auth-pane:not(.hidden) { min-height: 0; }
    #auth-view #account-login-button { margin-top: 22px; }
}

/* Signed-in brand scale and roomier researcher controls. */
body[data-role="member"] .brand,
body[data-role="observer"] .brand {
    align-items: center;
    gap: 10px;
}

body[data-role="member"] .brand > div:last-child,
body[data-role="observer"] .brand > div:last-child {
    display: flex;
    align-items: center;
    height: 82px;
}

body[data-role="member"] .brand-mark.small,
body[data-role="observer"] .brand-mark.small {
    width: 82px;
    height: 82px;
    flex-basis: 82px;
}

body[data-role="member"] .brand strong,
body[data-role="observer"] .brand strong {
    font-size: 2.6rem;
    line-height: 1;
    letter-spacing: -.025em;
    transform: translateY(.18em);
    white-space: nowrap;
}

body[data-role="observer"] .observer-group-switcher {
    display: flex !important;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 0;
    min-height: 0;
    margin: 0 !important;
    padding: 0;
    border: 0;
    border-radius: 0;
    text-align: left;
    background: transparent;
    font-size: inherit;
    font-weight: 400;
}

body[data-role="observer"] .observer-group-switcher > span {
    display: block;
    width: auto;
    color: var(--ink-soft);
    font-size: .68rem;
    font-weight: 500;
    letter-spacing: .02em;
    text-align: left;
}

body[data-role="observer"] .observer-group-switcher select {
    width: auto;
    min-width: 166px;
    max-width: 210px;
    min-height: 42px;
    padding: 0 34px 0 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    color: var(--ink);
    background: var(--paper);
    font-size: .76rem;
    font-weight: 600;
    text-align: center;
    text-align-last: center;
}

body[data-role="observer"] #research-private-section .workspace-card { padding: clamp(30px, 3.2vw, 44px); }

body[data-role="observer"] #research-private-section .agent-config-scope-row {
    align-items: end;
    gap: 22px;
}

body[data-role="observer"] #research-private-section .agent-config-scope-row label,
body[data-role="observer"] #research-private-section .agent-config-grid label,
body[data-role="observer"] #research-private-section .family-relationship-form label {
    display: grid;
    gap: 11px;
    margin: 0;
    text-align: center;
}

body[data-role="observer"] #research-private-section .agent-config-grid {
    gap: 28px 30px;
    margin-top: 34px;
}

body[data-role="observer"] #research-private-section .agent-response-presets {
    gap: 14px;
    margin-top: 30px;
}

body[data-role="observer"] #research-private-section .agent-response-presets strong { margin-right: 12px; }

body[data-role="observer"] #research-private-section input:not([type="checkbox"]):not([type="hidden"]),
body[data-role="observer"] #research-private-section select {
    width: 100%;
    min-width: 112px;
    min-height: 52px;
    padding: 0 18px;
    border: 1px solid var(--line);
    border-radius: 18px;
    color: var(--ink);
    background: transparent;
    text-align: center;
    text-align-last: center;
}

body[data-role="observer"] #research-private-section input[type="number"] { font-size: .88rem; font-variant-numeric: tabular-nums; }

body[data-role="observer"] #research-private-section .button {
    min-height: 48px;
    padding-right: 24px;
    padding-left: 24px;
}

body[data-role="observer"] #research-private-section .agent-custom-instruction { gap: 12px; margin-top: 30px; text-align: center; }
body[data-role="observer"] #research-private-section .agent-custom-instruction textarea { padding: 20px; }

body[data-role="observer"] #research-private-section .agent-config-fieldset {
    margin-top: 30px;
    padding: 24px;
}

body[data-role="observer"] #research-private-section .agent-config-toggles { gap: 16px; }
body[data-role="observer"] #research-private-section .agent-toggle { gap: 14px; padding: 17px 18px; }
body[data-role="observer"] #research-private-section .agent-config-history { margin-top: 30px; }
body[data-role="observer"] #research-private-section .family-relationship-form { gap: 24px 22px; margin-top: 24px; }
body[data-role="observer"] #research-private-section .form-row { gap: 14px; margin: 22px 0; }
body[data-role="observer"] #research-private-section .private-status-grid { gap: 18px; }
body[data-role="observer"] #research-private-section .invite-workspace { margin-top: 22px; }

@media (max-width: 760px) {
    body[data-role="member"] .brand-mark.small,
    body[data-role="observer"] .brand-mark.small { width: 64px; height: 64px; flex-basis: 64px; }
    body[data-role="member"] .brand strong,
    body[data-role="observer"] .brand strong {
        font-size: 2rem;
        line-height: 1;
    }
    body[data-role="member"] .brand > div:last-child,
    body[data-role="observer"] .brand > div:last-child { height: 64px; }
    body[data-role="observer"] .observer-group-switcher { min-width: 128px; min-height: 54px; padding: 7px 10px; }
    body[data-role="observer"] .observer-group-switcher > span { display: none; }
    body[data-role="observer"] #research-private-section .workspace-card { padding: 24px 18px; }
}

/* Keep every native select arrow comfortably inside its control. */
select:not([multiple]) {
    -webkit-appearance: none;
    appearance: none;
    padding-right: 48px !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 10'%3E%3Cpath d='M2 2l6 6 6-6' fill='none' stroke='%232B2B2B' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 22px center !important;
    background-size: 12px 8px !important;
}

@media (max-width: 640px) {
    .weekly-workspace .weekly-generation-controls { grid-template-columns: 1fr; }
    .weekly-workspace .weekly-generation-controls > .button { grid-column: 1; }
}


/* Final phone layout overrides. */
@media (max-width: 760px) {
    body[data-role="member"] .topbar { min-height: 64px; padding: 0 14px; }
    body[data-role="member"] .brand-mark.small {
        width: 48px;
        height: 48px;
        flex-basis: 48px;
    }
    body[data-role="member"] .brand > div:last-child { height: 48px; }
    body[data-role="member"] .brand strong { font-size: 1.55rem; transform: translateY(.1em); }

    body[data-role="member"] .member-nav { min-height: 68px; }
    body[data-role="member"] .nav-button {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        min-height: 68px;
        padding: 4px 2px;
        font-size: .56rem;
        line-height: 1;
    }
    body[data-role="member"] .nav-icon {
        display: block;
        width: 22px;
        height: 22px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.8;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    body[data-role="member"] .notebook-shell {
        padding: 0 8px 18px;
        border: 0 !important;
        border-radius: 0 !important;
    }
    body[data-role="member"] .notebook-current-editor {
        border: 0 !important;
        border-top: 1px solid var(--line) !important;
        border-bottom: 1px solid var(--line) !important;
        border-radius: 0 !important;
    }
    body[data-role="member"] .notebook-sketch-toolbar {
        z-index: 70;
        bottom: calc(76px + env(safe-area-inset-bottom));
        gap: 6px;
        width: calc(100vw - 16px);
        padding: 8px;
        border-radius: 14px;
        overflow-x: auto;
    }
    body[data-role="member"] .notebook-sketch-colors,
    body[data-role="member"] .notebook-sketch-sizes { gap: 4px; }
    body[data-role="member"] .notebook-sketch-colors button { width: 22px; height: 22px; flex: 0 0 22px; }
    body[data-role="member"] .notebook-sketch-sizes { padding-left: 7px; }
    body[data-role="member"] .notebook-sketch-sizes button { width: 25px; height: 25px; }
    body[data-role="member"] .notebook-sketch-eraser,
    body[data-role="member"] .notebook-sketch-undo,
    body[data-role="member"] #notebook-sketch-close { width: 30px; height: 30px; flex: 0 0 30px; }

    body[data-role="member"] .today-writing-composer {
        padding: 10px 0 18px !important;
        border: 0 !important;
        border-radius: 0 !important;
    }
    body[data-role="member"] .entry-mode-actions { gap: 8px; margin-bottom: 10px; }
    body[data-role="member"] .entry-mode-card {
        justify-content: center !important;
        gap: 6px;
        min-height: 44px;
        padding: 5px 8px;
        border: 0;
        border-bottom: 1px solid var(--line);
        border-radius: 0 !important;
    }
    body[data-role="member"] .entry-mode-icon { width: 25px; height: 25px; }
    body[data-role="member"] .entry-mode-icon svg { width: 17px; height: 17px; }
    body[data-role="member"] .entry-mode-card strong { font-size: .65rem; }
    body[data-role="member"] .draft-segment {
        padding: 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
    }
    body[data-role="member"] .composer .draft-segment textarea {
        min-height: 360px;
        padding: 16px 4px;
        border: 0;
        border-top: 1px solid var(--line);
        border-bottom: 1px solid var(--line);
        border-radius: 0 !important;
        background: transparent;
    }
    body[data-role="member"] .image-preview-wrap { border: 0; border-radius: 0; box-shadow: none; }

    body[data-role="member"] .checkin-calendar,
    body[data-role="member"] .two-week-card {
        padding-right: 0;
        padding-left: 0;
        border: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }
    body[data-role="member"] .record-card,
    body[data-role="member"] .weekly-card {
        border-right: 0 !important;
        border-left: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }
    body[data-role="member"] .phase-banner {
        border-top: 0 !important;
        border-right: 0 !important;
        border-bottom: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }
}

/* Compact participant navigation and writing controls on phones. */
@media (max-width: 760px) {
    body[data-role="member"] .member-app {
        padding-bottom: calc(92px + env(safe-area-inset-bottom));
    }

    body[data-role="member"] .member-nav {
        position: fixed;
        z-index: 50;
        inset: auto 0 0;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        width: 100%;
        margin: 0;
        padding: 0 6px env(safe-area-inset-bottom);
        overflow: visible;
        border: 0;
        border-top: 1px solid var(--ink);
        border-radius: 0;
        background: rgba(248,244,237,.97);
        box-shadow: 0 -8px 24px rgba(43,43,43,.08);
        backdrop-filter: blur(14px);
    }

    body[data-role="member"] .nav-button {
        min-width: 0;
        min-height: 58px;
        padding: 4px 2px;
        border-right: 1px solid var(--line);
        border-bottom: 0 !important;
        font-size: .64rem;
        letter-spacing: .02em;
        white-space: nowrap;
    }
    body[data-role="member"] .nav-button:nth-child(2) { border-right: 1px solid var(--line); }
    body[data-role="member"] .nav-button:last-child { border-right: 0; }

    body[data-role="member"] input:not([type="radio"]):not([type="checkbox"]):not([type="file"]):not([type="range"]):not([type="color"]),
    body[data-role="member"] textarea,
    body[data-role="member"] select {
        text-align: left;
        text-align-last: left;
    }

    body[data-role="member"] .notebook-current-editor { padding: 12px; }
    body[data-role="member"] .notebook-current-editor textarea {
        min-height: 78px;
        padding: 8px 36px 8px 2px;
        font-size: .72rem;
        line-height: 1.6;
        text-align: left;
    }
    body[data-role="member"] #notebook-autosave-status {
        justify-self: start;
        text-align: left;
        font-size: .52rem;
    }

    body[data-role="member"] .writing-choice-row {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
        margin: 0 0 16px;
    }
    body[data-role="member"] .writing-choice-row .share-choice-group { display: contents; }
    body[data-role="member"] .writing-choice-row .share-option,
    body[data-role="member"] .writing-choice-row .silent-submit-button {
        width: 100%;
        min-height: 44px;
        margin: 0;
        padding: 5px 3px;
        gap: 3px;
        font-size: .54rem;
        line-height: 1.2;
        letter-spacing: 0;
        white-space: nowrap;
    }
    body[data-role="member"] .writing-choice-row .share-option-icon {
        position: static;
        width: 13px;
        height: 13px;
        flex: 0 0 13px;
        transform: none;
    }
    body[data-role="member"] .writing-choice-row .silent-submit-button svg {
        width: 13px;
        height: 13px;
    }
    body[data-role="member"] .writing-choice-row .silent-submit-button span { font-size: 0; }
    body[data-role="member"] .writing-choice-row .silent-submit-button span::after {
        content: "Skip today";
        font-size: .56rem;
    }

    body[data-role="member"] .today-writing-composer > .submission-window-note {
        width: min(100%, 900px);
        margin: 12px auto 18px;
        padding: 4px 2px;
        border: 0;
        border-left: 0;
        border-radius: 0;
        background: transparent;
        font-size: .61rem;
    }
    body[data-role="member"] .today-writing-composer > .submission-window-note strong { font-size: .62rem; }
}



/* English edition: Metric-led typography and alignment safeguards. */
html[lang="en"] body,
html[lang="en"] button,
html[lang="en"] input,
html[lang="en"] textarea,
html[lang="en"] select,
html[lang="en"] #auth-view,
html[lang="en"] #auth-view [lang="en"] {
    font-family: "Metric", "Pocket Metric", "Helvetica Neue", Arial, sans-serif;
}

html[lang="en"] .home-header-brand p {
    max-width: min(38vw, 410px);
    line-height: 1.42;
    white-space: normal;
}

html[lang="en"] .home-principles strong {
    min-width: 0;
    font-size: clamp(.84rem, 1.05vw, .92rem);
    line-height: 1.1;
    letter-spacing: .015em;
    text-align: left;
    white-space: nowrap;
}

html[lang="en"] .home-principles span {
    flex: 0 0 auto;
    font-size: .78rem;
}

html[lang="en"] .home-principles p {
    display: none;
}

html[lang="en"] .home-principles li {
    align-items: stretch;
    justify-content: flex-start;
    min-height: 82px;
    padding-top: 22px;
    text-align: left;
}

html[lang="en"] .home-principle-title {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 10px;
    width: 100%;
}

html[lang="en"] .auth-card-heading,
html[lang="en"] .section-heading,
html[lang="en"] .observer-heading,
html[lang="en"] .profile-card-heading {
    align-items: center;
}

html[lang="en"] #auth-view .auth-card-heading {
    grid-template-columns: 1fr;
    gap: 8px;
    align-items: start;
}

html[lang="en"] #auth-view .auth-card-heading > p:last-child {
    justify-self: start;
    font-size: .76rem;
    line-height: 1.35;
    letter-spacing: .055em;
}

html[lang="en"] .button,
html[lang="en"] .nav-button,
html[lang="en"] .auth-tab,
html[lang="en"] .filter-button {
    line-height: 1.25;
    text-align: center;
}

html[lang="en"] select {
    padding-right: 48px;
    text-overflow: ellipsis;
}

html[lang="en"] .brand strong {
    font-size: 1.18rem;
    line-height: 1;
}

html[lang="en"] .compact-link {
    min-width: 42px;
    text-align: center;
}

html[lang="en"] body[data-role="observer"] #research-private-section .agent-response-presets {
    display: grid;
    grid-template-columns: minmax(180px, .72fr) repeat(3, minmax(0, 1fr));
    align-items: stretch;
    gap: 14px;
}

html[lang="en"] body[data-role="observer"] #research-private-section .agent-response-presets strong {
    display: flex;
    align-items: center;
    margin: 0;
    line-height: 1.25;
}

html[lang="en"] body[data-role="observer"] #research-private-section .agent-response-presets .button {
    width: 100%;
    min-width: 0;
    padding-right: 14px;
    padding-left: 14px;
    font-size: clamp(.68rem, .9vw, .78rem);
    white-space: nowrap;
}

@media (max-width: 1080px) {
    html[lang="en"] body[data-role="observer"] #research-private-section .agent-response-presets {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    html[lang="en"] body[data-role="observer"] #research-private-section .agent-response-presets strong {
        grid-column: 1 / -1;
    }
}

@media (max-width: 560px) {
    html[lang="en"] .home-header-brand p { max-width: min(45vw, 235px); }
    html[lang="en"] .home-principles li {
        justify-content: center;
        min-height: 82px;
        padding: 8px 2px;
    }
    html[lang="en"] .home-principles li:first-child { padding-left: 2px; }
    html[lang="en"] .home-principle-title { gap: 4px; }
    html[lang="en"] .home-principles span { font-size: .52rem; }
    html[lang="en"] .home-principles strong { font-size: 0; }
    html[lang="en"] .home-principles strong::after { font-size: .62rem; }
    html[lang="en"] body[data-role="observer"] #research-private-section .agent-response-presets {
        grid-template-columns: 1fr;
    }
    html[lang="en"] body[data-role="observer"] #research-private-section .agent-response-presets strong {
        grid-column: 1;
    }
}

/* Home access heading and fixed phone composition. */
#auth-view .auth-card-heading {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 5px;
    text-align: center;
}

#auth-view .auth-card-heading h2 {
    font-size: clamp(1.55rem, 2.25vw, 2rem);
    font-weight: 700;
}

#auth-view .auth-card-heading > p:last-child {
    justify-self: center;
    text-align: center;
}

@media (max-width: 560px) {
    #auth-view { overflow-x: hidden; }

    #auth-view .auth-story {
        position: relative;
        left: 50%;
        width: 390px;
        max-width: none;
        grid-template-columns: 146px 220px;
        grid-template-rows: 124px 50px 255px 46px;
        gap: 0;
        padding: 0 12px 18px;
        transform: translateX(-50%);
    }

    #auth-view .home-principles {
        grid-column: 1 / -1;
        grid-row: 1;
        border-top: 0;
        border-bottom: 1px solid var(--home-ink);
    }

    #auth-view .home-principles li {
        display: grid;
        grid-template-rows: auto 2.9em;
        align-content: center;
        justify-items: center;
        min-height: 124px;
        padding: 14px 6px 12px;
        gap: 9px;
    }

    #auth-view .home-principle-title { gap: 6px; }
    #auth-view .home-principles span { font-size: .62rem; }
    #auth-view .home-principles strong {
        font-size: .88rem;
        font-weight: 600;
        letter-spacing: .035em;
        white-space: nowrap;
    }
    #auth-view .home-principles p {
        align-self: start;
        width: 112px;
        max-width: 112px;
        font-size: .58rem;
        line-height: 1.5;
        letter-spacing: .01em;
        text-align: center;
    }

    #auth-view .home-kicker {
        grid-column: 1 / -1;
        grid-row: 2;
        align-self: center;
        justify-self: end;
        width: auto;
        max-width: 260px;
        margin: 0 2px 0 0;
        font-size: .57rem;
        line-height: 1.42;
        letter-spacing: .1em;
        text-align: right;
        transform: none;
    }

    #auth-view .home-copy {
        grid-column: 1;
        grid-row: 3;
        align-self: center;
        width: 146px;
        transform: none;
    }

    #auth-view .home-en-title {
        font-size: 3.28rem;
        line-height: .78;
    }

    #auth-view .home-en-title span:last-child { margin-left: .18em; }

    #auth-view .home-illustration {
        grid-column: 2;
        grid-row: 3;
        align-self: center;
        justify-self: start;
        width: 232px;
        margin: -10px 0 -10px -25px;
        transform: none;
    }

    #auth-view .home-slogan {
        grid-column: 1 / -1;
        grid-row: 4;
        align-self: start;
        width: 354px;
        max-width: none;
        margin: 0 0 0 2px;
        font-size: .65rem;
        line-height: 1.55;
        letter-spacing: .055em;
        text-align: left;
        text-align-last: auto;
        white-space: nowrap;
        transform: none;
    }

    #auth-view .auth-card-heading {
        justify-items: center;
        margin-bottom: 28px;
    }
    #auth-view .auth-card-heading h2 { font-size: 1.52rem; }
    #auth-view .auth-card-heading > p:last-child { justify-self: center; }
}

@media (max-width: 560px) {
    html[lang="en"] #auth-view .home-principles strong { font-size: 0; }
    html[lang="en"] #auth-view .home-principles strong::after { font-size: .74rem; }
}

/* Final participant phone refinements: keep the desktop composition unchanged. */
@media (max-width: 760px) {
    body[data-role="member"] .nav-button {
        font-size: .72rem;
        line-height: 1.08;
    }

    body[data-role="member"] .nav-icon {
        width: 24px;
        height: 24px;
    }

    body[data-role="member"] .notebook-media {
        width: 100%;
        margin: 0;
    }

    body[data-role="member"] .notebook-media img {
        width: 100%;
        max-height: 620px;
    }

    body[data-role="member"] .notebook-voice-card > span:first-child {
        display: grid;
        flex: 0 0 34px;
        width: 34px;
        min-width: 34px;
        height: 34px;
        min-height: 34px;
        padding: 0;
        border-radius: 50%;
        aspect-ratio: 1;
        line-height: 1;
    }

    body[data-role="member"] .today-writing-composer {
        display: flex;
        flex-direction: column;
    }

    body[data-role="member"] .entry-mode-actions {
        width: 100%;
        gap: 10px;
        margin-bottom: 14px;
    }

    body[data-role="member"] .entry-mode-card {
        flex-direction: row !important;
        align-items: center;
        justify-content: center !important;
        gap: 9px;
        min-height: 52px;
        padding: 7px 10px;
        border: 1px solid var(--line) !important;
        border-radius: 999px !important;
        background: rgba(255,253,248,.66) !important;
    }

    body[data-role="member"] .entry-mode-icon {
        flex: 0 0 30px;
        width: 30px;
        height: 30px;
    }

    body[data-role="member"] .entry-mode-icon svg {
        width: 19px;
        height: 19px;
    }

    body[data-role="member"] .entry-mode-card strong {
        font-size: .72rem;
    }

    body[data-role="member"] .today-writing-composer > .draft-footer {
        order: 90;
    }

    body[data-role="member"] .today-writing-composer > .submission-window-note {
        order: 100;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 5px;
        width: 100%;
        margin: 24px auto 0;
        padding: 7px 8px 0;
        text-align: center;
    }

    body[data-role="member"] .today-writing-composer > .submission-window-note strong,
    body[data-role="member"] .today-writing-composer > .submission-window-note span {
        width: 100%;
        text-align: center;
    }
}

/* Phone sketch studio: a locked landscape workbench with side tool rails. */
.sketch-zoom-action,
.sketch-palette-toggle { display: none; }

@media (max-width: 760px), (pointer: coarse) and (max-height: 760px) {
    html.sketch-mode-open,
    html.sketch-mode-open body { overflow: hidden; overscroll-behavior: none; }

    .sketch-dialog[open] {
        position: fixed;
        inset: 0;
        box-sizing: border-box;
        width: 100vw;
        max-width: none;
        height: 100dvh;
        max-height: none;
        margin: 0;
        overflow: visible;
        border-radius: 0;
        box-shadow: none;
    }

    .sketch-dialog::backdrop { background: rgba(35, 45, 42, .68); }

    .sketch-panel {
        box-sizing: border-box;
        display: grid;
        grid-template-columns: 58px minmax(0, 1fr) 58px;
        grid-template-rows: 52px minmax(0, 1fr);
        gap: 7px 9px;
        width: 100%;
        height: 100%;
        max-height: none;
        padding: 7px 9px;
        overflow: hidden;
        border: 0;
        border-radius: 0;
        background: #f7f3e8;
    }

    .sketch-heading {
        position: relative;
        top: auto;
        grid-column: 1 / -1;
        grid-row: 1;
        min-width: 0;
        margin: 0;
        padding: 3px 4px 6px;
        border-bottom: 1px solid rgba(27,154,116,.14);
        background: transparent;
        backdrop-filter: none;
    }

    .sketch-heading > div:first-child { flex: 0 0 auto; }
    .sketch-heading .eyebrow { margin: 0 0 1px; font-size: .52rem; }
    .sketch-heading h2 { font-size: 1.08rem; line-height: 1.05; }
    .sketch-heading-actions {
        width: auto;
        min-width: 0;
        justify-content: flex-end;
        gap: 5px;
    }
    .sketch-heading-actions .sketch-icon-button {
        flex: 0 0 34px;
        width: 34px;
        height: 34px;
    }
    .sketch-heading-actions .sketch-icon-button svg { width: 17px; height: 17px; }
    .sketch-use-action {
        min-height: 34px;
        padding: 0 13px;
        border-radius: 999px;
        font-size: .64rem;
    }

    .sketch-note { display: none; }

    .sketch-canvas-wrap {
        grid-column: 2;
        grid-row: 2;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 100%;
        min-height: 0;
        margin: 0;
        overflow: auto;
        border: 1px solid rgba(27,154,116,.24);
        border-radius: 12px;
        background: #fffdf6;
        overscroll-behavior: contain;
        scrollbar-width: thin;
        touch-action: none;
    }

    .sketch-canvas-wrap.zoomed {
        align-items: flex-start;
        justify-content: flex-start;
    }

    #sketch-canvas {
        display: block;
        width: auto;
        max-width: 100%;
        height: var(--sketch-zoom-size, 100%);
        max-height: 100%;
        aspect-ratio: 16 / 9;
        flex: 0 0 auto;
    }
    #sketch-canvas.zoomed {
        width: auto;
        max-width: none;
        max-height: none;
    }

    .sketch-tool-row {
        position: relative;
        z-index: 8;
        grid-column: 1;
        grid-row: 2;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        gap: 8px;
        min-width: 0;
        height: 100%;
        margin: 0;
        padding: 4px 5px 8px;
        overflow: visible;
        border: 1px solid rgba(27,154,116,.14);
        border-radius: 12px;
        background: rgba(255,253,246,.62);
    }

    .sketch-mode-toggle {
        display: flex;
        flex-direction: column;
        gap: 8px;
        padding: 4px;
        border-radius: 12px;
    }
    .sketch-mode-toggle button { flex: 0 0 38px; width: 38px; height: 38px; }

    .sketch-tool-settings {
        position: absolute;
        z-index: 12;
        top: 4px;
        left: calc(100% + 8px);
        display: none;
        width: 158px;
        padding: 9px 10px;
        border: 1px solid rgba(27,154,116,.22);
        border-radius: 12px;
        background: rgba(255,253,246,.97);
        box-shadow: 0 8px 24px rgba(38,52,55,.16);
    }
    .sketch-tool-row.settings-open .sketch-tool-settings { display: grid; gap: 8px; }

    .brush-size-control,
    .sketch-tool-row .opacity-control {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-rows: auto auto;
        gap: 3px 5px;
        min-width: 0;
        padding: 0;
        border: 0;
        font-size: .54rem;
        white-space: normal;
    }
    .brush-size-control input {
        grid-column: 1 / -1;
        grid-row: 2;
        width: 100%;
        min-width: 0;
        margin: 0;
    }
    .brush-size-control output {
        grid-column: 2;
        grid-row: 1;
        min-width: 20px;
        font-size: .55rem;
    }

    .sketch-controls { display: contents; }

    .sketch-secondary-actions {
        z-index: 6;
        grid-column: 2;
        grid-row: 2;
        align-self: start;
        justify-self: end;
        gap: 5px;
        margin: 7px;
    }
    .sketch-secondary-actions .sketch-icon-button {
        width: 27px;
        height: 27px;
        flex: 0 0 27px;
    }
    .sketch-secondary-actions .sketch-icon-button svg { width: 14px; height: 14px; }
    .sketch-zoom-action {
        display: none !important;
    }

    .sketch-palette {
        grid-column: 3;
        grid-row: 2;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        gap: 8px;
        min-width: 0;
        width: 58px;
        max-height: 100%;
        padding: 4px 5px 8px;
        overflow-x: hidden;
        overflow-y: auto;
        border: 1px solid rgba(27,154,116,.14);
        border-radius: 12px;
        background: rgba(255,253,246,.62);
        scrollbar-width: thin;
        overscroll-behavior: contain;
    }

    .sketch-palette-toggle {
        position: sticky;
        z-index: 2;
        top: 0;
        display: grid;
        place-items: center;
        flex: 0 0 auto;
        width: 42px;
        min-height: 32px;
        padding: 3px;
        border: 0;
        border-radius: 10px;
        color: var(--member-deep);
        background: #f7f3e8;
        cursor: pointer;
        font-size: .48rem;
        font-weight: 800;
    }
    .sketch-palette-toggle span { display: block; }
    .sketch-palette-toggle svg {
        width: 13px;
        height: 13px;
        fill: none;
        stroke: currentColor;
        stroke-width: 2;
        stroke-linecap: round;
        stroke-linejoin: round;
        transition: transform .18s ease;
    }
    .sketch-palette.collapsed {
        align-self: start;
        max-height: 88px;
        overflow: hidden;
    }
    .sketch-palette.collapsed .color-swatch:not(.active) { display: none; }
    .sketch-palette.collapsed .sketch-palette-toggle svg { transform: rotate(-90deg); }

    .sketch-palette .color-swatch {
        flex: 0 0 30px;
        width: 30px;
        height: 30px;
    }
}

@media (max-width: 760px) and (orientation: portrait) {
    .sketch-dialog[open] {
        inset: auto;
        top: 50%;
        left: 50%;
        width: 100dvh;
        height: 100vw;
        transform: translate(-50%, -50%) rotate(90deg);
        transform-origin: center;
    }
}

@media (max-width: 760px) and (orientation: landscape),
       (pointer: coarse) and (max-height: 760px) and (orientation: landscape) {
    .sketch-dialog[open] {
        inset: 0;
        width: 100vw;
        height: 100dvh;
        transform: none;
    }
}

/* Compact stage marker on the participant journey page (mobile only). */
@media (max-width: 760px) {
    body[data-role="member"] .phase-banner:not(.hidden) {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 174px;
        min-height: 48px;
        margin: 0 auto 22px;
        padding: 10px 18px;
        border: 1px solid rgba(123, 140, 167, .34) !important;
        border-left: 5px solid var(--home-blue, #7B8CA7) !important;
        border-radius: 14px !important;
        color: var(--ink);
        background: linear-gradient(135deg, rgba(123, 140, 167, .16), rgba(141, 170, 138, .10)) !important;
        box-shadow: none !important;
        font-size: 1rem;
        font-weight: 850;
        line-height: 1.15;
        letter-spacing: .08em;
        white-space: nowrap;
    }
}

/* Final fixed-ratio phone landing composition. Desktop rules stay unchanged. */
.safety-note-mobile { display: none; }

@media (max-width: 560px) {
    #auth-view .home-header { padding-right: 12px; padding-left: 12px; }
    #auth-view .home-header-brand { min-width: 0; gap: 8px; }
    #auth-view .home-wordmark { flex: 0 0 88px; }
    #auth-view .home-header-brand p {
        flex: 0 1 auto;
        width: auto;
        max-width: none;
        min-width: 0;
        font-size: min(1.72vw, .43rem);
        line-height: 1;
        letter-spacing: 0;
        white-space: nowrap;
        transform: translateY(5px);
    }
    #auth-view .language-link { flex: 0 0 34px; }

    #auth-view .auth-story {
        position: relative;
        left: 50%;
        display: block;
        width: min(100vw, 390px);
        height: min(105vw, 410px);
        padding: 0;
        overflow: hidden;
        transform: translateX(-50%);
    }
    #auth-view .home-kicker {
        position: absolute;
        z-index: 4;
        top: min(2.5vw, 10px);
        right: min(3.6vw, 14px);
        width: min(70vw, 273px);
        max-width: none;
        margin: 0;
        font-size: min(2.95vw, .72rem);
        font-weight: 650;
        line-height: 1.3;
        letter-spacing: .09em;
        text-align: right;
        white-space: nowrap;
        transform: none;
    }
    #auth-view .home-copy {
        position: absolute;
        z-index: 3;
        top: min(34.6vw, 135px);
        left: min(3.6vw, 14px);
        width: min(41vw, 160px);
        margin: 0;
        transform: none;
    }
    #auth-view .home-en-title {
        font-size: min(12.1vw, 2.95rem);
        line-height: .78;
        letter-spacing: -.045em;
    }
    #auth-view .home-en-title span:last-child { margin-left: .16em; }
    #auth-view .home-illustration {
        position: absolute;
        z-index: 2;
        top: min(10vw, 39px);
        left: min(40.5vw, 158px);
        width: min(59.5vw, 232px);
        margin: 0;
        transform: none;
    }
    #auth-view .home-slogan {
        position: absolute;
        z-index: 4;
        top: min(66.7vw, 260px);
        left: min(3.6vw, 14px);
        width: min(92vw, 359px);
        max-width: none;
        margin: 0;
        font-size: min(2.75vw, .67rem);
        line-height: 1.35;
        letter-spacing: .08em;
        text-align: left;
        text-align-last: auto;
        white-space: nowrap;
        transform: none;
    }
    #auth-view .home-principles {
        position: absolute;
        top: min(81.8vw, 319px);
        left: min(3.1vw, 12px);
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        width: min(93.8vw, 366px);
        height: min(19.2vw, 75px);
        margin: 0;
        padding: 0;
        border-top: 1px solid var(--home-ink);
        border-bottom: 0;
    }
    #auth-view .home-principles li,
    #auth-view .home-principles li:first-child {
        position: relative;
        display: grid;
        place-items: center;
        min-height: 0;
        padding: 0;
        overflow: hidden;
        border-right: 1px solid rgba(168, 159, 143, .65);
    }
    #auth-view .home-principles li:last-child { border-right: 0; }
    #auth-view .home-principles p { display: none; }
    #auth-view .home-principle-title {
        position: static;
        display: grid;
        place-items: center;
        width: 100%;
        height: 100%;
    }
    #auth-view .home-principles span {
        position: absolute;
        z-index: 0;
        top: 60%;
        left: 50%;
        color: rgba(213, 107, 74, .25);
        font-size: min(10.5vw, 2.55rem);
        font-weight: 750;
        line-height: 1;
        letter-spacing: -.04em;
        transform: translate(-50%, -50%);
    }
    #auth-view .home-principles strong {
        position: absolute;
        z-index: 1;
        top: min(2.1vw, 8px);
        left: 50%;
        width: 100%;
        font-size: min(3.6vw, .88rem);
        font-weight: 750;
        line-height: 1;
        letter-spacing: .035em;
        text-align: center;
        white-space: nowrap;
        transform: translateX(-50%);
    }
    html[lang="en"] #auth-view .home-principles strong { font-size: 0; }
    html[lang="en"] #auth-view .home-principles strong::after {
        font-size: min(3.3vw, .8rem);
        font-weight: 750;
        line-height: 1;
        white-space: nowrap;
    }
    #auth-view .safety-note {
        padding-left: 8px;
        font-size: min(1.85vw, .46rem);
        line-height: 1.35;
        white-space: nowrap;
    }
    #auth-view .safety-note-full { display: none; }
    #auth-view .safety-note-mobile { display: inline; }
}

/* Keep the signed-in pocket mark in proportion with the wordmark on every phone page. */
@media (max-width: 760px) {
    body[data-role="member"] .topbar,
    body[data-role="observer"] .topbar { min-height: 72px; }

    body[data-role="member"] .brand-mark.small,
    body[data-role="observer"] .brand-mark.small {
        width: 60px;
        height: 60px;
        flex-basis: 60px;
    }

    body[data-role="member"] .brand > div:last-child,
    body[data-role="observer"] .brand > div:last-child { height: 60px; }
}

/* Mobile landing and onboarding copy lockup. */
.onboarding-dialog[open] {
    top: 50%;
    right: auto;
    bottom: auto;
    left: 50%;
    height: min(94dvh, 940px);
    max-height: none;
    margin: 0;
    overflow: hidden;
    transform: translate(-50%, -50%);
}

.onboarding-dialog[open] .onboarding-shell {
    height: 100%;
    max-height: none;
}

.onboarding-step p,
.onboarding-step label,
.onboarding-step legend,
.onboarding-step button,
.onboarding-finish-copy {
    line-break: strict;
    text-wrap: pretty;
}

.onboarding-fixed-lines > span { display: block; }

.welcome-step .onboarding-welcome-logo {
    width: 176px;
    height: 148px;
    margin: -8px auto 18px;
}

.onboarding-welcome-mark img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.onboarding-rhythm-edit-note {
    margin: 24px 0 0 !important;
    text-align: center;
}

.onboarding-actions { flex-wrap: wrap; }
.onboarding-actions .onboarding-rhythm-edit-note {
    flex: 0 0 100%;
    margin: 0 !important;
}

.onboarding-actions .button,
.onboarding-choice-chips span,
.onboarding-radio-list span {
    overflow-wrap: normal;
    word-break: keep-all;
}

.onboarding-actions .button,
.onboarding-choice-chips span { white-space: nowrap; }

@media (max-width: 560px) {
    #auth-view .auth-story {
        width: min(100vw, 390px);
        height: min(80.8vw, 315px);
    }

    #auth-view .home-kicker {
        top: min(5.1vw, 20px);
        right: min(3.6vw, 14px);
    }

    #auth-view .home-copy {
        top: min(36.2vw, 141px);
        left: min(3.6vw, 14px);
        width: min(40vw, 156px);
    }

    #auth-view .home-illustration {
        top: min(14.9vw, 58px);
        left: min(36.4vw, 142px);
        width: min(62vw, 242px);
    }

    #auth-view .home-slogan {
        top: min(70.5vw, 275px);
    }

    .onboarding-step {
        padding-right: 18px;
        padding-bottom: 108px;
        padding-left: 18px;
    }

    .onboarding-step-heading > div { min-width: 0; }

    .onboarding-fixed-lines > span {
        white-space: nowrap;
    }

    .onboarding-rhythm-copy {
        font-size: clamp(.56rem, 2.65vw, .68rem) !important;
        line-height: 1.75 !important;
    }

    .welcome-step .onboarding-welcome-logo {
        width: min(39vw, 152px);
        height: min(34vw, 133px);
        margin: -18px auto 12px;
    }

    .welcome-step h1 {
        margin-top: 18px;
        margin-bottom: 16px;
        font-size: clamp(2rem, 10vw, 2.7rem);
        white-space: nowrap;
    }

    .welcome-step > .onboarding-welcome-copy {
        font-size: clamp(.72rem, 3.5vw, .92rem);
        line-height: 1.82;
    }

    .onboarding-step-heading h2,
    .onboarding-questions legend,
    .onboarding-questions > label > span {
        text-wrap: balance;
    }

    .onboarding-memory-notice {
        font-size: clamp(.56rem, 2.65vw, .64rem);
        line-height: 1.75;
    }

    .onboarding-radio-list span { white-space: nowrap; }

    .onboarding-actions .button {
        min-width: 0;
        padding-right: 8px;
        padding-left: 8px;
        font-size: clamp(.76rem, 3.65vw, .92rem);
        line-height: 1;
        letter-spacing: 0;
        white-space: nowrap;
    }
}

@media (max-width: 760px) {
    body {
        line-break: strict;
        text-wrap: pretty;
    }
}

@media (max-width: 340px) {
    .onboarding-step { padding-right: 14px; padding-left: 14px; }
    .onboarding-step-heading { gap: 11px; }
    .onboarding-step-heading > span { width: 38px; height: 38px; }
    .onboarding-choice-chips { gap: 6px; }
    .onboarding-choice-chips span { padding-right: 11px; padding-left: 11px; font-size: .62rem; }
    .onboarding-actions .button { font-size: .72rem; }
}

html[lang="en"] .onboarding-fixed-lines > span {
    display: inline;
    white-space: normal;
}

html[lang="en"] .onboarding-fixed-lines > span + span::before { content: " "; }

@media (max-width: 560px) {
    html[lang="en"] .welcome-step h1 {
        font-size: clamp(1.65rem, 8vw, 2.15rem);
        line-height: 1.15;
        white-space: normal;
        text-wrap: balance;
    }
}

/* Latest requested phone alignment overrides. */
body[data-role="member"] .daily-card-close { top: 18px; right: 18px; width: 52px; height: 52px; font-size: 1.8rem; }
body[data-role="member"] .daily-card-mark { width: 86px !important; height: 86px !important; flex-basis: 86px !important; }
body[data-role="member"] .daily-card-header { gap: 4px !important; padding-right: 56px; }
body[data-role="member"] .daily-card-header > div:last-child { margin-left: -2px; }
body[data-role="member"] #journey-section .section-heading { margin-bottom: 8px !important; }
body[data-role="member"] #journey-section .journey-tabs { margin-top: 0 !important; }
.sketch-download-panel { border: 0 !important; box-shadow: 0 20px 58px rgba(43,43,43,.18) !important; }
#sketch-download-preview { border: 1px solid #A89E8F !important; background: #F8F4ED !important; }

@media (max-width: 760px) {
    body[data-role="member"] .entry-mode-actions { margin-top: -10px; margin-bottom: 10px; gap: 8px; }
    body[data-role="member"] .entry-mode-card { min-height: 52px; padding: 6px 10px; gap: 7px; }
    body[data-role="member"] .entry-mode-icon { flex-basis: 27px; width: 27px; height: 27px; }
    body[data-role="member"] .entry-mode-icon svg { width: 22px; height: 22px; }
    body[data-role="member"] .entry-mode-card strong { font-size: clamp(.72rem, 3.7vw, .86rem); }
    body[data-role="member"] #open-sketch { color: #F8F4ED !important; }
}

@media (max-width: 340px) {
    body[data-role="member"] .daily-card-mark { width: 72px !important; height: 72px !important; flex-basis: 72px !important; }
}
/* Local send-window reminder and first-entry dot guide. */
.notebook-current-editor,
.notebook-block { position: relative; }

.notebook-selection-guide {
    position: absolute;
    z-index: 30;
    top: 42px;
    right: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    width: min(300px, calc(100vw - 78px));
    margin: 0;
    padding: 12px 12px 12px 14px;
    border: 1px solid rgba(213,107,74,.42);
    border-radius: 16px;
    background: rgba(248,226,215,.98);
    box-shadow: 0 12px 28px rgba(43,43,43,.14);
}
.notebook-selection-guide > div { min-width: 0; }
.notebook-selection-guide strong,
.notebook-selection-guide p { text-align: left; }
.notebook-selection-guide button {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
    justify-self: end;
    padding: 8px 12px;
}
.notebook-block .notebook-selection-guide { top: 40px; }

body[data-role="member"] .writing-choice-row .submission-window-note {
    grid-column: 2 / -1;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-height: 38px;
    width: 100%;
    margin: 0;
    padding: 8px 11px;
    border: 1px solid rgba(213,107,74,.42);
    border-left: 3px solid #D56B4A;
    border-radius: 12px;
    color: #805044;
    background: rgba(248,226,215,.84);
    font-size: clamp(.58rem, 2.9vw, .7rem);
    line-height: 1.45;
    text-align: left;
}
body[data-role="member"] .writing-choice-row .submission-window-note.hidden { display: none !important; }
body[data-role="member"] .writing-choice-row .submission-window-note span { width: 100%; text-align: left; }
body[data-role="member"] .writing-choice-row .submission-window-note.attention { animation: local-reminder-pulse .42s ease-out; }
@keyframes local-reminder-pulse {
    0% { transform: scale(.98); opacity: .55; }
    100% { transform: scale(1); opacity: 1; }
}

@media (max-width: 560px) {
    .notebook-selection-guide {
        grid-template-columns: minmax(0, 1fr) auto;
        right: 34px;
        width: min(300px, calc(100vw - 78px));
        margin: 0;
    }
    .notebook-selection-guide button { grid-column: 2; grid-row: 1; justify-self: end; }
}
/* Final palette and media-action sizing overrides. */
body[data-role="member"] #notebook-image-trigger {
    border-color: #D56B4A !important;
    color: #F8F4ED !important;
    background: #D56B4A !important;
}
body[data-role="member"] #notebook-sketch-toggle {
    border-color: #8DAA8A !important;
    color: #F8F4ED !important;
    background: #8DAA8A !important;
}
body[data-role="member"] #notebook-voice-toggle {
    border-color: #E8C36A !important;
    color: #2B2B2B !important;
    background: #E8C36A !important;
}
body[data-role="member"] #notebook-image-trigger.limit-reached { opacity: .64; }

@media (max-width: 760px) {
    body[data-role="member"] #photo-mode-card,
    body[data-role="member"] #open-sketch {
        min-height: 76px !important;
        padding: 10px 14px !important;
        gap: 12px !important;
    }
    body[data-role="member"] #photo-mode-card .entry-mode-icon,
    body[data-role="member"] #open-sketch .entry-mode-icon {
        flex-basis: 40px !important;
        width: 40px !important;
        height: 40px !important;
    }
    body[data-role="member"] #photo-mode-card .entry-mode-icon svg,
    body[data-role="member"] #open-sketch .entry-mode-icon svg {
        width: 34px !important;
        height: 34px !important;
        stroke-width: 2;
    }
    body[data-role="member"] #photo-mode-card strong,
    body[data-role="member"] #open-sketch strong {
        font-size: clamp(.98rem, 4.8vw, 1.16rem) !important;
        line-height: 1 !important;
        white-space: nowrap;
    }
}

/* Final compact writing actions and inline submission-window time. */
@media (max-width: 760px) {
    body[data-role="member"] .entry-mode-actions {
        width: 90% !important;
        margin-right: auto !important;
        margin-left: auto !important;
        gap: 8px !important;
    }
    body[data-role="member"] #photo-mode-card,
    body[data-role="member"] #open-sketch {
        min-height: 56px !important;
        padding: 6px 10px !important;
        gap: 8px !important;
    }
    body[data-role="member"] #photo-mode-card .entry-mode-icon,
    body[data-role="member"] #open-sketch .entry-mode-icon {
        flex-basis: 31px !important;
        width: 31px !important;
        height: 31px !important;
    }
    body[data-role="member"] #photo-mode-card .entry-mode-icon svg,
    body[data-role="member"] #open-sketch .entry-mode-icon svg {
        width: 27px !important;
        height: 27px !important;
    }
    body[data-role="member"] #photo-mode-card strong,
    body[data-role="member"] #open-sketch strong {
        font-size: clamp(.84rem, 4.1vw, 1rem) !important;
        line-height: 1 !important;
        white-space: nowrap !important;
    }
    body[data-role="member"] .draft-actions {
        align-items: start;
        row-gap: 4px;
    }
    body[data-role="member"] .draft-actions #submit-checkin {
        min-width: 0;
        font-size: clamp(.78rem, 3.7vw, .9rem) !important;
        line-height: 1 !important;
        letter-spacing: 0;
        white-space: nowrap !important;
    }
    body[data-role="member"] .draft-actions > .submission-window-note {
        grid-column: -2 / -1;
        grid-row: 2;
        display: block;
        width: 100%;
        min-height: 0;
        margin: 0;
        padding: 1px 0 0;
        border: 0 !important;
        border-radius: 0 !important;
        color: var(--ink-soft);
        background: transparent !important;
        box-shadow: none !important;
        font-size: clamp(.5rem, 2.35vw, .62rem);
        line-height: 1.15;
        text-align: center;
        white-space: nowrap;
    }
    body[data-role="member"] .draft-actions > .submission-window-note.hidden { display: none !important; }
    body[data-role="member"] .draft-actions > .submission-window-note span {
        display: block;
        width: 100%;
        text-align: center;
        white-space: nowrap;
    }
}

/* Researcher phone navigation: four destinations, with local switches for merged areas. */
.research-mobile-nav,
.research-mobile-subnav { display: none; }

@media (max-width: 760px) {
    body[data-role="observer"] { overflow-x: clip; }
    body[data-role="observer"] .topbar {
        height: auto;
        min-height: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
        padding: 9px 14px 10px;
    }
    body[data-role="observer"] .brand { min-width: 0; max-width: 100%; gap: 8px; }
    body[data-role="observer"] .brand-mark.small {
        width: 42px;
        height: 42px;
        flex-basis: 42px;
    }
    body[data-role="observer"] .brand > div:last-child { min-width: 0; height: auto; }
    body[data-role="observer"] .brand strong {
        font-size: clamp(1.25rem, 5.6vw, 1.55rem);
        line-height: 1.1;
        transform: none;
    }
    body[data-role="observer"] .brand small { display: none; }
    body[data-role="observer"] .identity {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 42px auto;
        align-items: center;
        gap: 8px;
        width: 100%;
        min-width: 0;
    }
    body[data-role="observer"] .identity .compact-link,
    body[data-role="observer"] .identity-profile-copy { display: none; }
    body[data-role="observer"] .observer-group-switcher {
        width: 100%;
        min-width: 0;
        max-width: none;
        min-height: 42px;
        padding: 0 !important;
    }
    body[data-role="observer"] .observer-group-switcher select {
        width: 100%;
        min-width: 0;
        max-width: none;
        min-height: 42px;
        padding: 0 34px 0 12px !important;
        background-position: right 12px center !important;
        font-size: .74rem;
        text-align: left;
        text-align-last: left;
        text-overflow: ellipsis;
    }
    body[data-role="observer"] .identity-profile-entry {
        width: 42px;
        min-height: 42px;
        padding: 3px;
        justify-content: center;
    }
    body[data-role="observer"] .identity-profile-entry .avatar { width: 36px; height: 36px; }
    body[data-role="observer"] #logout-button {
        min-height: 42px;
        margin: 0;
        padding: 0 4px 0 10px;
        white-space: nowrap;
    }
    body[data-role="observer"] .observer-app {
        width: calc(100% - 28px);
        max-width: 100%;
        min-width: 0;
        padding: 20px 0 calc(96px + env(safe-area-inset-bottom));
    }
    body[data-role="observer"] .research-nav { display: none; }
    body[data-role="observer"] .research-mobile-nav {
        position: fixed;
        z-index: 50;
        inset: auto 0 0;
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        width: 100%;
        margin: 0;
        padding: 0 4px env(safe-area-inset-bottom);
        border-top: 1px solid var(--ink);
        background: rgba(248, 244, 237, .97);
        box-shadow: 0 -8px 24px rgba(43, 43, 43, .08);
        backdrop-filter: blur(14px);
    }
    body[data-role="observer"] .research-mobile-nav-button {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        min-width: 0;
        min-height: 68px;
        padding: 5px 1px;
        border: 0;
        border-right: 1px solid var(--line);
        color: var(--ink-soft);
        background: transparent;
        font-size: clamp(.59rem, 2.75vw, .7rem);
        font-weight: 600;
        line-height: 1.1;
        white-space: nowrap;
        cursor: pointer;
    }
    body[data-role="observer"] .research-mobile-nav-button:last-child { border-right: 0; }
    body[data-role="observer"] .research-mobile-nav-button.active {
        color: var(--ink);
        box-shadow: inset 0 -4px 0 var(--home-orange, #D56B4A);
        font-weight: 800;
    }
    body[data-role="observer"] .research-mobile-nav-button svg {
        width: 23px;
        height: 23px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.8;
        stroke-linecap: round;
        stroke-linejoin: round;
    }
    body[data-role="observer"] .research-mobile-subnav:not(.hidden) {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        margin: 0 0 20px;
    }
    body[data-role="observer"] .research-mobile-subnav-button {
        min-width: 0;
        min-height: 44px;
        padding: 7px 8px;
        border: 1px solid var(--line);
        border-radius: 12px;
        color: var(--ink-soft);
        background: var(--paper);
        font-size: .78rem;
        white-space: nowrap;
        cursor: pointer;
    }
    body[data-role="observer"] .research-mobile-subnav-button.active {
        border-color: var(--ink);
        color: var(--ink);
        box-shadow: inset 0 -3px 0 var(--home-orange, #D56B4A);
        font-weight: 800;
    }
    body[data-role="observer"] .research-section { min-width: 0; max-width: 100%; }
    body[data-role="observer"] .observer-heading-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
        gap: 8px;
    }
    body[data-role="observer"] .observer-heading-actions .button {
        min-width: 0;
        margin-top: 8px;
        padding-right: 8px;
        padding-left: 8px;
    }
    body[data-role="observer"] .observer-heading-actions small { grid-column: 1 / -1; }
}
