/* 批改结果页与逐句批注（v2 手稿批注） */

.result-hero {
    display: flex;
    gap: 30px;
    align-items: center;
    padding: 0 0 30px;
    border-radius: 0;
    border: 0;
    border-bottom: 1px solid var(--line);
    background: transparent;
    box-shadow: none;
    flex-wrap: wrap;
}

.score-ring {
    position: relative;
    width: 124px;
    height: 124px;
    flex: none;
}

.score-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.score-ring circle {
    fill: none;
    stroke-width: 4;
}

.score-ring .track { stroke: var(--surface-3); }

.score-ring .bar {
    stroke: var(--brand);
    stroke-linecap: round;
    transition: stroke-dashoffset 1s var(--ease-out);
}

.score-ring.is-mid .bar { stroke: var(--warn); }
.score-ring.is-low .bar { stroke: var(--danger); }
.score-ring.is-good .bar { stroke: var(--success); }

.score-ring .ring-label {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
}

.score-ring .ring-score {
    font-family: var(--font-display);
    font-size: 34px;
    font-weight: var(--weight-semibold);
    letter-spacing: -0.04em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.score-ring .ring-score small {
    font-family: var(--font-ui);
    font-size: 12px;
    font-weight: var(--weight-regular);
    color: var(--muted-2);
    letter-spacing: 0;
}

.score-ring .ring-cap {
    font-size: 10px;
    letter-spacing: 0.1em;
    color: var(--muted-2);
    text-transform: none;
    margin-top: 3px;
}

.result-main { flex: 1; min-width: 240px; }

.result-kicker {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.result-title {
    font-family: var(--font-display);
    font-size: 32px;
    font-weight: var(--weight-semibold);
    letter-spacing: -0.03em;
    line-height: 1.25;
}

.result-meta {
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 12.5px;
    color: var(--muted);
}

.result-actions {
    display: flex;
    gap: 8px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.result-side {
    flex: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-end;
}

.score-line {
    display: flex;
    align-items: baseline;
    gap: 6px;
    font-variant-numeric: tabular-nums;
}

.score-line .big {
    font-family: var(--font-display);
    font-size: 46px;
    font-weight: var(--weight-semibold);
    letter-spacing: -0.04em;
    line-height: 1;
}

.score-line .unit { font-size: 12px; color: var(--muted-2); }

.score-sub {
    font-size: 11.5px;
    color: var(--muted-2);
    text-align: right;
}

.summary-card {
    padding: 24px 0;
    border-radius: 0;
    border: 0;
    border-top: 1px solid var(--line);
    background: transparent;
    box-shadow: none;
}

.result-label {
    font-size: 12px;
    font-weight: var(--weight-semibold);
    letter-spacing: 0.06em;
    color: var(--brand-strong);
    margin-bottom: 10px;
}

[data-theme="dark"] .result-label { color: var(--brand); }

.result-warn-inline {
    font-size: 12px;
    color: var(--accent);
    margin-bottom: 8px;
}

.summary-text {
    font-size: 15px;
    line-height: 1.85;
    color: var(--ink-2);
    max-width: 860px;
}

.top-issues {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px;
}

.issue-tile {
    padding: 16px 0 0;
    border-radius: 0;
    border: 0;
    border-top: 1px solid var(--line);
    background: transparent;
    position: relative;
    overflow: visible;
}

.issue-tile::before {
    content: "";
    position: absolute;
    left: 0;
    top: 16px;
    bottom: auto;
    width: 20px;
    height: 2px;
    background: var(--accent);
    opacity: 0.8;
}

.issue-tile .it-title {
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: var(--weight-semibold);
    letter-spacing: -0.02em;
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 8px;
}

.issue-tile .it-num {
    width: auto;
    height: auto;
    border-radius: 0;
    background: transparent;
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: var(--weight-semibold);
    display: inline;
    flex: none;
}

.issue-tile .it-detail {
    margin-top: 6px;
    font-size: 13px;
    color: var(--muted);
    line-height: 1.7;
}

.legend {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    font-size: 11.5px;
    color: var(--muted-2);
}

.legend span { display: inline-flex; align-items: center; gap: 5px; }

.legend .lg-spell { width: 18px; height: 2px; background: var(--danger); }
.legend .lg-grammar {
    width: 18px; height: 6px;
    border-bottom: 2px wavy var(--danger);
    border-radius: 0;
}
.legend .lg-add {
    width: 16px; height: 10px;
    background: var(--warn-soft);
    border-bottom: 1.5px solid var(--warn);
    border-radius: 2px 2px 0 0;
}

.sentence-card {
    border-radius: 0;
    border: 0;
    border-top: 1px solid var(--line);
    background: transparent;
    box-shadow: none;
    overflow: visible;
    animation: none;
}

.sentence-card + .sentence-card { margin-top: 0; }

.sc-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 0 10px;
    border-bottom: 0;
    background: transparent;
}

.sc-num {
    width: auto;
    height: auto;
    border-radius: 0;
    background: transparent;
    color: var(--brand);
    font-family: var(--font-mono);
    font-size: 11.5px;
    font-weight: var(--weight-semibold);
    display: inline;
    flex: none;
}

[data-theme="dark"] .sc-num { color: var(--brand); }

.sc-label {
    font-size: 11.5px;
    color: var(--muted-2);
    letter-spacing: 0.04em;
    text-transform: none;
    font-weight: var(--weight-medium);
}

.sc-score {
    margin-left: auto;
    font-size: 12px;
    color: var(--muted-2);
    font-variant-numeric: tabular-nums;
}

.sc-score b {
    font-family: var(--font-display);
    font-size: 19px;
    color: var(--ink);
    font-weight: var(--weight-semibold);
    letter-spacing: -0.02em;
}

.sc-body { padding: 0 0 22px; }

.zh-line {
    font-size: 14px;
    line-height: 1.8;
    color: var(--muted);
    padding-left: 12px;
    border-left: 2px solid var(--brand-line);
    margin-bottom: 16px;
}

.answer-line {
    font-family: var(--font-en);
    font-size: 20px;
    line-height: 1.95;
    color: var(--ink);
    letter-spacing: 0.002em;
    word-break: break-word;
}

.answer-line.is-empty {
    font-family: var(--font-ui);
    font-size: 13px;
    color: var(--muted-2);
    font-style: normal;
}

.issue-list {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 0;
    border-top: 1px solid var(--line);
}

.issue-item {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    border-radius: 0;
    border: 0;
    border-bottom: 1px solid var(--line);
    background: transparent;
    font-size: 13px;
    line-height: 1.7;
}

.issue-tag {
    flex: none;
    height: 20px;
    padding: 0 7px;
    border-radius: 4px;
    border: 1px solid var(--line);
    font-size: 10.5px;
    font-weight: var(--weight-semibold);
    display: inline-flex;
    align-items: center;
    letter-spacing: 0.02em;
    background: transparent;
    color: var(--muted);
    margin-top: 1px;
}

.issue-tag.t-spelling,
.issue-tag.t-extra { border-color: var(--danger-line); color: var(--danger); }
.issue-tag.t-grammar,
.issue-tag.t-agreement,
.issue-tag.t-tense,
.issue-tag.t-wordclass { border-color: var(--accent-line); color: var(--accent); }
.issue-tag.t-article,
.issue-tag.t-missing,
.issue-tag.t-preposition,
.issue-tag.t-plural { border-color: var(--warn-line); color: var(--warn); }
.issue-tag.t-chinglish { border-color: var(--info-line); color: var(--info); }

.issue-body { flex: 1; min-width: 0; }

.issue-change {
    font-family: var(--font-en);
    font-size: 14px;
    color: var(--ink-2);
    word-break: break-word;
}

.issue-change del {
    color: var(--danger);
    text-decoration: line-through;
}

.issue-change ins {
    color: var(--success);
    text-decoration: none;
    font-weight: var(--weight-semibold);
    background: var(--success-soft);
    border-radius: 3px;
    padding: 0 2px;
}

.issue-explain {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12.5px;
}

/* ------------------------------ 批注 ------------------------------ */

.ann { position: relative; cursor: help; border-radius: 3px; }

.ann-grammar {
    text-decoration: underline wavy var(--danger);
    text-decoration-skip-ink: none;
    text-underline-offset: 4px;
    background: linear-gradient(transparent 76%, var(--danger-soft) 0);
}

.ann-spell {
    color: var(--danger);
    text-decoration: line-through;
    text-decoration-thickness: 1.5px;
    text-decoration-color: var(--danger);
}

.ann-fix {
    color: var(--success);
    background: var(--success-soft);
    border-radius: 3px;
    padding: 0 3px;
    font-weight: var(--weight-semibold);
    white-space: nowrap;
}

.ann-add {
    background: var(--warn-soft);
    color: var(--warn);
    border-bottom: 1.5px solid var(--warn);
    border-radius: 3px 3px 0 0;
    padding: 0 2px;
    font-weight: var(--weight-semibold);
    white-space: nowrap;
}

.ann-extra {
    color: var(--danger);
    text-decoration: line-through;
    opacity: 0.75;
}

.ann:hover { background-color: color-mix(in srgb, var(--brand-soft) 55%, transparent); }

.sentence-versions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px;
    margin-top: 18px;
    border-top: 1px solid var(--line);
}

.version-box {
    padding: 14px 0 0;
    border-radius: 0;
    border: 0;
    background: transparent;
}

.version-box.is-high {
    background: transparent;
    border-color: transparent;
}

.version-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10.5px;
    font-weight: var(--weight-semibold);
    letter-spacing: 0.06em;
    color: var(--muted-2);
    text-transform: none;
    margin-bottom: 6px;
}

.version-box.is-high .version-label { color: var(--brand-strong); }
[data-theme="dark"] .version-box.is-high .version-label { color: var(--brand); }

.version-text {
    font-family: var(--font-en);
    font-size: 15px;
    line-height: 1.85;
    color: var(--ink-2);
}

.points-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 14px;
}

.point-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 8px;
    border-radius: var(--r-full);
    border: 1px solid var(--success-line);
    background: transparent;
    color: var(--success);
    font-size: 11px;
    font-weight: var(--weight-medium);
}

.point-chip svg { width: 11px; height: 11px; }

.sc-comment {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    font-size: 12.5px;
    color: var(--muted);
    line-height: 1.7;
}

.advice-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    border-top: 1px solid var(--line);
}

.advice-item {
    display: flex;
    gap: 12px;
    padding: 13px 0;
    border-radius: 0;
    border: 0;
    border-bottom: 1px solid var(--line);
    background: transparent;
    font-size: 13.5px;
    line-height: 1.75;
    color: var(--ink-2);
}

.advice-item .ai-num {
    width: auto;
    height: auto;
    border-radius: 0;
    background: transparent;
    color: var(--brand);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: var(--weight-semibold);
    display: inline;
    flex: none;
    margin-top: 3px;
}

[data-theme="dark"] .advice-item .ai-num { color: var(--brand); }

.result-bottom {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
    flex-wrap: wrap;
}

.result-note {
    text-align: center;
    font-size: 12px;
    color: var(--muted-2);
    margin-top: 16px;
    line-height: 1.7;
}

.result-note-muted {
    font-size: 11.5px;
    color: var(--muted-2);
}

@media (max-width: 900px) {
    .top-issues { grid-template-columns: minmax(0, 1fr); gap: 20px; }
    .sentence-versions { grid-template-columns: minmax(0, 1fr); gap: 18px; }
    .result-hero {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        align-items: center;
        gap: 14px 18px;
        padding-bottom: 24px;
    }
    .score-ring { grid-column: 1; grid-row: 1; width: 96px; height: 96px; }
    .score-ring .ring-score { font-size: 27px; }
    .result-side { grid-column: 2; grid-row: 1; align-items: flex-start; }
    .result-main { grid-column: 1 / -1; grid-row: 2; min-width: 0; }
    .result-title { font-size: 27px; }
    .result-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        width: 100%;
    }
    .result-actions .btn { width: 100%; }
    .result-actions #practice-again { display: none; }
    .sc-body { padding-bottom: 18px; }
    .answer-line { font-size: 18px; line-height: 1.9; }
    body.focus-mode .view { padding-bottom: 104px; }
    .result-bottom {
        position: sticky;
        bottom: calc(12px + env(safe-area-inset-bottom));
        background: var(--surface);
        padding: 10px;
        border: 1px solid var(--line);
        border-radius: 10px;
    }
    .result-bottom .btn { flex: 1; }
}

/* ------------------------------ 长按追问 ------------------------------ */

.sentence-ask-hint {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: -2px 0 8px;
    font-size: 11.5px;
    color: var(--muted-2);
    line-height: 1.5;
}

.sentence-ask-hint svg {
    width: 14px;
    height: 14px;
    flex: none;
    color: var(--brand);
}

.sentence-card {
    position: relative;
    user-select: text;
    -webkit-user-select: text;
    transition: background var(--dur-2), box-shadow var(--dur-2), border-radius var(--dur-2);
}

.sentence-card ::selection {
    background: var(--brand-soft);
    color: var(--ink);
}

.sentence-card .answer-line,
.sentence-card .zh-line,
.sentence-card .issue-change,
.sentence-card .issue-explain,
.sentence-card .version-text,
.sentence-card .sc-comment {
    -webkit-user-select: text;
    user-select: text;
}

.sc-ask {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 10px;
    padding: 3px 8px;
    border: 1px solid var(--brand-line);
    border-radius: var(--r-full);
    background: transparent;
    color: var(--brand-strong);
    font-family: var(--font-ui);
    font-size: 11px;
    cursor: pointer;
}

.sc-ask:hover {
    background: var(--brand-soft);
}

.sc-ask svg {
    width: 12px;
    height: 12px;
}

[data-theme="dark"] .sc-ask {
    color: var(--brand);
}

.issue-save {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    align-self: flex-start;
    margin-left: 10px;
    padding-top: 1px;
    color: var(--muted-2);
    font-size: 11px;
    cursor: pointer;
    user-select: none;
}

.issue-save input {
    width: 14px;
    height: 14px;
    margin: 0;
    accent-color: var(--brand);
    cursor: pointer;
}

.issue-save input:disabled {
    opacity: 0.5;
    cursor: default;
}

.issue-save:hover {
    color: var(--brand-strong);
}

[data-theme="dark"] .issue-save:hover {
    color: var(--brand);
}

@media (max-width: 640px) {
    .sc-ask span,
    .issue-save span {
        display: none;
    }
}

.sentence-ask-fab {
    position: fixed;
    z-index: 118;
    transform: translateX(-50%);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 18px;
    border: 0;
    border-radius: var(--r-full);
    background: var(--brand);
    color: var(--surface);
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: var(--weight-semibold);
    letter-spacing: 0.01em;
    white-space: nowrap;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    animation: ask-pop var(--dur-3) var(--ease-out);
}

.sentence-ask-fab.is-fixed-bottom {
    left: 50%;
    top: auto;
    bottom: calc(18px + env(safe-area-inset-bottom));
}

.sentence-ask-fab svg {
    width: 16px;
    height: 16px;
}

@keyframes ask-pop {
    from { opacity: 0; transform: translate(-50%, 8px) scale(0.96); }
    to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

.tutor-root {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 125;
}

.tutor-root.is-open {
    display: block;
}

.tutor-backdrop {
    position: absolute;
    inset: 0;
    background: var(--overlay);
    backdrop-filter: blur(3px);
    animation: fade-in var(--dur-2) var(--ease);
}

.tutor-drawer {
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: min(760px, 100%);
    max-height: min(86vh, 820px);
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-bottom: 0;
    border-radius: 22px 22px 0 0;
    box-shadow: var(--shadow-lg);
    animation: tutor-up var(--dur-4) var(--ease-out);
}

.tutor-drawer.is-closing {
    animation: tutor-down var(--dur-2) var(--ease) forwards;
}

@keyframes tutor-up {
    from { opacity: 0; transform: translate(-50%, 28px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes tutor-down {
    from { opacity: 1; transform: translate(-50%, 0); }
    to { opacity: 0; transform: translate(-50%, 30px); }
}

.tutor-grip {
    width: 40px;
    height: 4px;
    margin: 8px auto 0;
    border-radius: var(--r-full);
    background: var(--line-strong);
    flex: none;
}

.tutor-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 22px;
    border-bottom: 1px solid var(--line);
    flex: none;
}

.tutor-head-main {
    flex: 1;
    min-width: 0;
}

.tutor-eyebrow {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: var(--weight-semibold);
    letter-spacing: 0.06em;
    color: var(--brand-strong);
}

[data-theme="dark"] .tutor-eyebrow { color: var(--brand); }

.tutor-eyebrow svg {
    width: 14px;
    height: 14px;
}

.tutor-title {
    margin-top: 4px;
    font-family: var(--font-display);
    font-size: 18px;
    line-height: 1.5;
    color: var(--ink);
    max-height: 3em;
    overflow-y: auto;
    word-break: break-word;
}

.tutor-close {
    flex: none;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

.tutor-close:hover {
    border-color: var(--line-strong);
    color: var(--ink);
}

.tutor-close svg {
    width: 16px;
    height: 16px;
}

.tutor-context {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 12px 22px;
    border-bottom: 1px solid var(--line);
    background: var(--surface-2);
    flex: none;
}

.tutor-context-item span {
    display: block;
    margin-bottom: 3px;
    font-size: 10.5px;
    letter-spacing: 0.04em;
    color: var(--muted-2);
}

.tutor-context-item p {
    margin: 0;
    max-height: 3.2em;
    overflow-y: auto;
    font-family: var(--font-en);
    font-size: 13px;
    line-height: 1.6;
    color: var(--ink-2);
    word-break: break-word;
}

.tutor-context-item.is-high p {
    color: var(--brand-strong);
}

[data-theme="dark"] .tutor-context-item.is-high p { color: var(--brand); }

.tutor-thread {
    flex: 1;
    min-height: 180px;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 16px 22px 8px;
}

.tutor-intro {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    margin-bottom: 14px;
    padding: 9px 11px;
    border-radius: 10px;
    background: var(--brand-soft);
    color: var(--brand-strong);
    font-size: 11.5px;
    line-height: 1.6;
}

[data-theme="dark"] .tutor-intro { color: var(--brand); }

.tutor-intro svg {
    width: 14px;
    height: 14px;
    flex: none;
    margin-top: 2px;
}

.tutor-msg {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin-bottom: 14px;
}

.tutor-msg.is-user {
    justify-content: flex-end;
}

.tutor-avatar {
    width: 26px;
    height: 26px;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--brand-soft);
    color: var(--brand-strong);
}

[data-theme="dark"] .tutor-avatar { color: var(--brand); }

.tutor-avatar.is-error {
    background: var(--danger-soft);
    color: var(--danger);
}

.tutor-avatar svg {
    width: 14px;
    height: 14px;
}

.tutor-bubble {
    max-width: 82%;
    padding: 10px 13px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface-2);
    color: var(--ink-2);
    font-size: 13.5px;
    line-height: 1.75;
    word-break: break-word;
}

.tutor-msg.is-user .tutor-bubble {
    border-color: var(--brand);
    border-radius: 14px 14px 4px 14px;
    background: var(--brand);
    color: var(--surface);
}

.tutor-msg.is-error .tutor-bubble {
    border-color: var(--danger-line);
    background: var(--danger-soft);
    color: var(--danger);
}

.tutor-msg.is-loading .tutor-bubble {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
}

.tutor-msg.is-loading .spinner {
    width: 14px;
    height: 14px;
    border-width: 1.5px;
}

.tutor-bubble.is-streaming {
    white-space: pre-wrap;
}

.tutor-bubble.is-streaming::after {
    content: "";
    display: inline-block;
    width: 6px;
    height: 1em;
    margin-left: 2px;
    vertical-align: -2px;
    background: var(--brand);
    animation: tutor-caret 900ms steps(2, start) infinite;
}

@keyframes tutor-caret {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

.tutor-quick {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    padding: 8px 22px;
    flex: none;
}

.tutor-chip {
    padding: 5px 10px;
    border: 1px solid var(--line);
    border-radius: var(--r-full);
    background: var(--surface);
    color: var(--muted);
    font-family: var(--font-ui);
    font-size: 11.5px;
    cursor: pointer;
    transition: border-color var(--dur-2), color var(--dur-2), background var(--dur-2);
}

.tutor-chip:hover:not(:disabled) {
    border-color: var(--brand-line);
    background: var(--brand-soft);
    color: var(--brand-strong);
}

[data-theme="dark"] .tutor-chip:hover:not(:disabled) { color: var(--brand); }

.tutor-chip:disabled {
    opacity: 0.5;
    cursor: default;
}

.tutor-inputbar {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 10px 22px calc(14px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: var(--surface);
    flex: none;
}

.tutor-inputbar textarea {
    flex: 1;
    min-height: 42px;
    max-height: 120px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-2);
    color: var(--ink);
    font-family: var(--font-ui);
    font-size: 13.5px;
    line-height: 1.5;
    resize: none;
}

.tutor-inputbar textarea:focus {
    outline: none;
    border-color: var(--brand-line);
    box-shadow: 0 0 0 3px var(--ring);
}

.tutor-inputbar textarea:disabled {
    opacity: 0.65;
}

.tutor-send {
    flex: none;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 12px;
    background: var(--brand);
    color: var(--surface);
    cursor: pointer;
}

.tutor-send:disabled {
    opacity: 0.55;
    cursor: default;
}

.tutor-send svg {
    width: 18px;
    height: 18px;
}

@media (max-width: 640px) {
    .tutor-drawer {
        max-height: 90vh;
        border-radius: 20px 20px 0 0;
    }

    .tutor-head {
        padding: 10px 18px;
    }

    .tutor-title {
        font-size: 16px;
    }

    .tutor-context {
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
        padding: 10px 18px;
    }

    .tutor-thread {
        padding: 14px 18px 6px;
    }

    .tutor-bubble {
        max-width: 88%;
    }

    .tutor-quick {
        padding: 8px 18px;
    }

    .tutor-inputbar {
        padding: 10px 18px calc(12px + env(safe-area-inset-bottom));
    }
}

@media print {
    .sentence-ask-hint,
    .sentence-ask-fab,
    .tutor-root {
        display: none !important;
    }
}
