/* Chinese-only release refinements. Loaded after the existing theme. */
#auth-view .language-link[hidden],
#platform-view .language-link[hidden] { display: none !important; }
#auth-view .home-header-brand { align-items: flex-end; }
#auth-view .home-header-brand p { display: flex; flex-direction: column; transform: none; }
#auth-view .home-header-brand p span { display: block; }
#auth-view .privacy-details { margin: 4px 0 8px; border: 0; }
#auth-view .privacy-details summary { padding: 4px 0; color: #786F63; font-size: .73rem; }
#auth-view .consent-row { margin: 6px 0; }
#auth-view .consent-copy a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
#auth-view .notification-consent-row { margin-bottom: 14px; }
.dictation-popover {
    position: fixed !important;
    z-index: 200 !important;
    inset: 0 !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 100% !important;
    height: 100dvh;
    max-height: none !important;
    padding: 18px !important;
    overflow-y: auto;
    border: 0 !important;
    border-radius: 0 !important;
    background: rgba(43,43,43,.34) !important;
    box-shadow: none !important;
}
.dictation-popover[hidden] { display: none !important; }
.dictation-dialog-card {
    box-sizing: border-box;
    width: min(100%, 420px);
    margin: auto;
    padding: 22px;
    border: 1px solid #A89E8F;
    border-radius: 20px;
    background: #F8F4ED;
    box-shadow: 0 18px 50px rgba(43,43,43,.18);
}
.dictation-dialog-card h2 { margin: 0 0 16px; color: #2B2B2B; font-size: 1.1rem; text-align: center; }
.dictation-dialog-card .dictation-status-row { display: flex; align-items: flex-start; gap: 10px; }
.dictation-dialog-card .dictation-status-row p { flex: 1 1 auto; min-width: 0; margin: 0; font-size: .82rem; line-height: 1.6; overflow-wrap: anywhere; }
.dictation-dialog-card .dictation-live-dot { margin-top: .4em; }
.dictation-dialog-card .dictation-review { margin-top: 16px; }
.dictation-dialog-card .dictation-review textarea { box-sizing: border-box; width: 100%; min-height: 116px; padding: 12px; border: 1px solid #A89E8F; border-radius: 12px; background: #fffdf8; font-size: 1rem; }
.dictation-dialog-card .dictation-dialog-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 18px; }
.dictation-dialog-card .dictation-dialog-actions .button { flex: 1 1 130px; min-height: 42px; padding: 7px 10px; font-size: .78rem; }
.dictation-dialog-card .dictation-dialog-actions [data-dictation-cancel] { margin-left: auto; }
.phase-question-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin: 10px 0; padding: 12px; border: 1px solid var(--line); border-radius: 16px; }
.phase-question-field { display: grid; min-width: 0; gap: 6px; font-size: .76rem; font-weight: 700; }
.phase-question-title, .phase-question-choices { box-sizing: border-box; min-width: 0; width: 100%; }
.phase-question-choices-field { grid-column: 1 / -1; }
.phase-question-choices { min-height: 74px; }
.phase-question-row .text-button { grid-column: 2; grid-row: 1; align-self: end; color: var(--clay); }
.phase-question-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.phase-question-bank-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; }
.phase-question-bank-item { display: flex; align-items: center; gap: 9px; min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; font-size: .78rem; cursor: pointer; }
.phase-question-bank-item:has(input:checked) { border-color: #087058; background: rgba(141,170,138,.16); }
.phase-question-bank-item input { flex: 0 0 auto; accent-color: #087058; }
.phase-question-bank-item span { min-width: 0; overflow-wrap: anywhere; }
.phase-question-preview { display: grid; gap: 10px; margin: 10px 0 0; }
.phase-question-preview .checkin-question { background: #fffdf8; }
.phase-question-preview .checkin-question label { cursor: default; }
.questionnaire-workspace-card .invite-heading { margin-bottom: 18px; }
.questionnaire-workspace-card .section-subheading { margin-top: 18px; }
body[data-role="observer"] #research-weekly-section .weekly-workspace > .questionnaire-workspace-card { grid-column: 1 / -1; width: 100%; box-sizing: border-box; }
.checkin-questionnaire { display: grid; gap: 12px; margin-top: 18px; }
.checkin-question { display: grid; gap: 8px; min-width: 0; margin: 0; padding: 14px; border: 1px solid var(--line); border-radius: 16px; }
.checkin-question legend { padding: 0 5px; font-weight: 700; }
.checkin-question label { display: flex; align-items: center; gap: 9px; padding: 8px; border-radius: 10px; cursor: pointer; }
.checkin-question label:has(input:checked) { background: rgba(141,170,138,.18); }
.checkin-question input { accent-color: #087058; }
.checkin-answer { color: var(--ink-soft); font-size: .75rem; line-height: 1.6; }
.member-push-card { width: min(100%, 960px); margin: 0 auto 24px; }
.member-push-card p { color: var(--ink-soft); font-size: .76rem; line-height: 1.6; }
body[data-role="observer"] #research-weekly-section .workspace-card > p,
body[data-role="observer"] #research-weekly-section .invite-heading p,
body[data-role="observer"] #research-private-section .agent-runs-card > p { color: #8B8479; font-size: .72rem; line-height: 1.65; }
body[data-role="observer"] .phase-plan-option-description,
body[data-role="observer"] .phase-question-choices { color: #8B8479; font-size: .76rem; line-height: 1.6; }
@media (max-width: 760px) {
    body[data-role="member"]:has(#notebook-section.active) {
        background-color: #F8F4ED;
        background-image:
            linear-gradient(rgba(123,140,167,.12) 1px, transparent 1px),
            linear-gradient(90deg, rgba(123,140,167,.12) 1px, transparent 1px);
        background-size: 24px 24px;
    }
    body[data-role="member"] #notebook-section .notebook-shell {
        display: flex;
        flex-direction: column;
        box-sizing: border-box;
        min-height: calc(100dvh - 184px - env(safe-area-inset-bottom));
        background: transparent !important;
    }
    body[data-role="member"] #notebook-section .notebook-cover,
    body[data-role="member"] #notebook-section .notebook-days,
    body[data-role="member"] #notebook-section .notebook-current-editor,
    body[data-role="member"] #notebook-section .notebook-block,
    body[data-role="member"] #notebook-section .notebook-block textarea,
    body[data-role="member"] #notebook-section .notebook-current-editor textarea { background: transparent !important; }
    body[data-role="member"] #notebook-section .notebook-new-fragment {
        align-self: center;
        flex: 0 0 auto;
        margin: auto 0 12px;
    }
    body[data-role="member"] #notebook-section .notebook-shell { border-top: 0 !important; border-bottom: 0 !important; }
    body[data-role="member"] #notebook-section .notebook-cover { padding: 6px 0 12px; border-bottom: 0 !important; }
    body[data-role="member"] #notebook-section .notebook-days { padding-top: 0; }
    body[data-role="member"] #notebook-section .notebook-day { padding-top: 12px; }
    body[data-role="member"] #notebook-section .notebook-day > summary { grid-template-columns: 1fr; justify-items: center; }
    body[data-role="member"] #notebook-section .notebook-day > summary::before,
    body[data-role="member"] #notebook-section .notebook-day > summary::after { display: none; }
    body[data-role="member"] #notebook-section .notebook-current-editor { border-top: 0 !important; border-bottom: 0 !important; }
    body[data-role="member"] #notebook-section .notebook-block { border-bottom: 0 !important; }
    body[data-role="member"] #journey-section .section-heading .eyebrow { margin: 0; color: #087058; }
    body[data-role="member"] #journey-section .section-heading { margin-bottom: 8px !important; }
    #auth-view .home-header-brand { gap: clamp(20px, 5.5vw, 26px); }
    #auth-view .home-header-brand p { flex: 0 1 auto; max-width: 58vw; font-size: clamp(.58rem, 2.6vw, .66rem); line-height: 1.4; white-space: nowrap; }
    #auth-view .auth-panel { padding-top: clamp(22px, 6vw, 30px); }
    #auth-view .auth-card-heading { margin-bottom: 12px; }
    #auth-view .privacy-details:not([open]) { display: none; }
    #auth-view .privacy-details[open] { margin: 0 0 12px; padding: 8px 10px; border: 1px solid var(--home-khaki); border-radius: 12px; }
    #auth-view .privacy-details summary { font-size: .71rem; }
    #auth-view #login-form .consent-row { justify-content: flex-start; width: 100%; min-height: 0; gap: 8px; margin-right: 0; margin-left: 0; color: #786F63; font-size: .68rem; line-height: 1.45; }
    #auth-view .consent-row input { flex: 0 0 17px; width: 17px; height: 17px; margin-top: 2px; }
    #auth-view .consent-copy { display: block; }
    #auth-view .notification-consent-row { margin-bottom: 14px; }
    #auth-view #account-login-button { margin-top: 28px; }

    body[data-role="member"] .notebook-block { grid-template-columns: 30px minmax(0, 1fr); }
    body[data-role="member"] .notebook-block > .notebook-selector { grid-column: 1; grid-row: 1; justify-self: start; }
    body[data-role="member"] .notebook-block > textarea,
    body[data-role="member"] .notebook-block > figure,
    body[data-role="member"] .notebook-block > .notebook-voice-card { grid-column: 2; grid-row: 1; min-width: 0; }
    body[data-role="member"] .notebook-block > .notebook-block-status { grid-column: 2; }
    body[data-role="member"] .notebook-current-editor { grid-template-columns: 30px minmax(0, 1fr); }
    body[data-role="member"] .notebook-current-editor #notebook-current-selector { grid-column: 1; grid-row: 1; justify-self: start; }
    body[data-role="member"] .notebook-current-editor textarea { grid-column: 2; grid-row: 1; padding: 8px 2px; }
    body[data-role="member"] #notebook-autosave-status { grid-column: 2; }
    body[data-role="member"] .notebook-selection-guide { left: 0; right: auto; width: min(300px, calc(100vw - 78px)); }
    body[data-role="member"] .journey-tab { font-size: clamp(.82rem, 3.6vw, .96rem); }
    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-note,
    body[data-role="member"] #two-week-card > .checkin-note-label,
    body[data-role="member"] #two-week-card > .checkin-actions { display: revert !important; }
    body[data-role="member"] #checkin-plan-options,
    body[data-role="member"] .checkin-questionnaire { display: grid !important; }
    body[data-role="member"] #checkin-prompts { display: none !important; }
    body[data-role="member"] #checkin-reflections,
    body[data-role="member"] #two-week-card > .section-subheading { display: block !important; }
    body[data-role="member"] #two-week-card > .checkin-actions { display: flex !important; }

    body[data-role="member"] .today-writing-composer { position: relative; box-sizing: border-box; min-height: calc(100dvh - 172px - env(safe-area-inset-bottom)); padding: 0 0 12px !important; }
    body[data-role="member"] .entry-mode-actions { position: absolute; z-index: 5; top: 18px; right: 0; display: flex; flex-direction: column; width: 42px !important; margin: 0 !important; gap: 8px !important; }
    body[data-role="member"] #photo-mode-card,
    body[data-role="member"] #open-sketch,
    body[data-role="member"] #writing-dictation .dictation-mic-button { display: grid !important; place-items: center; box-sizing: border-box; width: 42px !important; height: 42px !important; min-height: 42px !important; margin: 0; padding: 4px !important; border: 0 !important; border-radius: 50% !important; box-shadow: none !important; }
    body[data-role="member"] #photo-mode-card { color: #fff !important; background: #D56B4A !important; }
    body[data-role="member"] #open-sketch { color: #fff !important; background: #8DAA8A !important; }
    body[data-role="member"] #writing-dictation .dictation-mic-button { color: #2B2B2B !important; background: #E8C36A !important; }
    body[data-role="member"] #photo-mode-card strong,
    body[data-role="member"] #open-sketch strong { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    body[data-role="member"] .entry-mode-icon,
    body[data-role="member"] #photo-mode-card .entry-mode-icon,
    body[data-role="member"] #open-sketch .entry-mode-icon { width: 34px !important; height: 34px !important; flex-basis: 34px !important; }
    body[data-role="member"] .entry-mode-icon svg,
    body[data-role="member"] #photo-mode-card .entry-mode-icon svg,
    body[data-role="member"] #open-sketch .entry-mode-icon svg,
    body[data-role="member"] #writing-dictation .dictation-mic-button svg { width: 23px !important; height: 23px !important; stroke-width: 1.8; }
    body[data-role="member"] #draft-segments { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
    body[data-role="member"] #draft-segments .draft-segment { position: relative; }
    body[data-role="member"] #draft-segments .draft-segment:only-child { flex: 1 1 auto; display: flex; flex-direction: column; }
    body[data-role="member"] #draft-segments .draft-segment:has(#checkin-text:placeholder-shown):not(:focus-within)::after {
        content: ""; position: absolute; top: 25px; left: 4px; width: 2px; height: 1.2em;
        background: #2B2B2B; pointer-events: none; animation: pocket-caret 1.1s steps(1) infinite;
    }
    @keyframes pocket-caret { 50% { opacity: 0; } }
    body[data-role="member"] .composer .draft-segment,
    body[data-role="member"] .composer .draft-segment:focus-within { border: 0 !important; outline: 0 !important; box-shadow: none !important; }
    body[data-role="member"] .composer .draft-segment textarea,
    body[data-role="member"] .composer .draft-segment textarea:focus { flex: 1 1 auto; min-height: clamp(150px, 25vh, 250px) !important; padding: 24px 50px 12px 4px !important; border: 0 !important; outline: 0 !important; box-shadow: none !important; background: transparent !important; resize: none; }
    body[data-role="member"] .composer-count-row { margin-top: auto; padding: 0 0 8px; border-top: 1px solid var(--line); }
    body[data-role="member"] .writing-choice-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) 42px; gap: 5px; margin: 0; }
    body[data-role="member"] .writing-choice-row #save-draft { grid-column: 4; width: 42px; height: 42px; min-height: 42px; align-self: center; border-color: var(--line); color: #817b70; background: #E9E4DB; box-shadow: none; }
    body[data-role="member"] .writing-choice-row #save-draft.saved { border-color: #2B2B2B; color: #fff; background: #2B2B2B; }
    body[data-role="member"] .writing-choice-row .share-option,
    body[data-role="member"] .writing-choice-row .silent-submit-button { min-height: 42px; padding: 4px 2px; font-size: clamp(.6rem, 2.8vw, .72rem); }
    body[data-role="member"] .writing-choice-row .silent-submit-button span::after { content: "今天不说"; font-size: clamp(.6rem, 2.8vw, .72rem) !important; }
    body[data-role="member"] .draft-footer { position: relative; }
    body[data-role="member"] .draft-status { margin: 4px 0 6px; padding-right: 38px; }
    body[data-role="member"] .draft-actions { display: block; width: 100%; }
    body[data-role="member"] .draft-actions #submit-checkin { display: block; width: 100%; min-height: 48px; margin: 0 auto; }
    body[data-role="member"] .draft-actions > .submission-window-note { display: block; width: 100%; margin: 4px auto 0; text-align: center; }
    body[data-role="member"] .draft-actions > .submission-window-note span { display: block; width: 100%; text-align: center; }
    body[data-role="member"] .draft-actions #delete-draft { position: absolute; top: 0; right: 0; width: 30px; height: 30px; min-height: 30px; }
}

@media (max-width: 760px) and (max-height: 650px) {
    body[data-role="member"] .composer .draft-segment textarea,
    body[data-role="member"] .composer .draft-segment textarea:focus { min-height: 120px !important; }
}
