[hidden] { display: none !important; }
.text-shell { width: min(1120px, calc(100% - 40px)); margin: 28px auto; }
.text-header { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.text-header h1 { font-size: 1.8rem; line-height: 1.3; margin-top: 6px; }
.text-brand { color: var(--accent-strong); font-weight: 750; text-decoration: none; }
.mode-links { display: flex; flex-wrap: wrap; gap: 24px; margin: 24px 0; border-bottom: 1px solid var(--line); }
.mode-links a { color: var(--muted); padding: 12px 0; text-decoration: none; border-bottom: 3px solid transparent; font-weight: 700; }
.mode-links a[aria-current] { color: var(--blue); border-bottom-color: var(--blue); }
.text-workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px 36px; align-items: start; }
.text-editor { grid-column: 1; grid-row: 1; }
.text-reader { grid-column: 2; grid-row: 1 / span 2; min-width: 0; border-left: 1px solid var(--line); padding-left: 28px; }
.text-translation { grid-column: 1; grid-row: 2; border-top: 1px solid var(--line); padding-top: 24px; }
.text-shell label { font-weight: 650; display: block; margin-bottom: 7px; font-size: .94rem; }
.text-shell textarea, .text-shell select { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid #adbcb2; border-radius: 6px; width: 100%; min-width: 0; }
.text-shell textarea { display: block; line-height: 1.65; padding: 12px; min-height: 155px; resize: vertical; overflow-wrap: anywhere; }
.text-shell textarea[readonly] { background: #edf1f6; }
.text-shell select { min-height: 44px; padding: 8px; text-overflow: ellipsis; }
.text-shell textarea:focus-visible, .text-shell select:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.field-heading, .translation-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 36px; margin-bottom: 6px; }
.field-heading label, .translation-heading label { margin: 0; }
.field-heading output { color: var(--muted); font-size: .82rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.translation-heading select { width: 150px; }
.text-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.text-actions button { padding: 9px 14px; }
.reader-toolbar { display: grid; grid-template-columns: 44px 44px minmax(0, 1fr); align-items: center; gap: 10px; min-height: 48px; margin-bottom: 18px; }
.reader-toolbar p { margin: 0; font-size: .9rem; color: var(--blue); line-height: 1.4; }
.speech-icon { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; flex-shrink: 0; }
.speech-icon img { display: block; }
#readText { background: #cde6db; border-color: var(--accent); }
.voice-field { margin-bottom: 12px; }
.text-shell .check-label { display: flex; align-items: flex-start; gap: 9px; font-weight: 450; line-height: 1.5; }
.check-label input { width: 18px; height: 18px; flex-shrink: 0; margin: 2px 0 0; accent-color: var(--accent); }
.field-note { color: var(--muted); font-size: .86rem; line-height: 1.55; margin: 10px 0; min-height: 1.4em; }
.field-note:empty { display: none; }
.speech-settings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 18px 0; }
.speech-settings > div { min-width: 0; }
#speechRate { width: 100%; height: 30px; margin: 0; accent-color: var(--accent); }
.sentence-list { list-style: none; padding: 0; margin: 10px 0 0; max-height: 440px; overflow-y: auto; border-top: 1px solid var(--line); }
.sentence-list:empty { border: 0; }
.sentence-list li { display: grid; grid-template-columns: 20px minmax(0, 1fr) 32px 44px; gap: 8px; align-items: start; border-bottom: 1px solid var(--line); border-left: 3px solid transparent; padding: 12px 4px; }
.sentence-list li.in-range { border-left-color: #84bfa6; }
.sentence-list li.is-reading { background: #e4edf8; border-left-color: var(--blue); }
.sentence-list p { margin: 0; line-height: 1.65; overflow-wrap: anywhere; }
.sentence-number { color: var(--muted); font-size: .8rem; padding-top: 5px; }
.sentence-marker { font-size: .76rem; font-weight: 750; color: var(--accent-strong); padding-top: 5px; }
.link-command { border: 0; padding: 0; color: var(--blue); background: none; text-decoration: underline; text-align: left; min-height: 32px; }
.text-privacy { margin: 28px 0 0; padding: 20px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; line-height: 1.65; }
.text-privacy summary { cursor: pointer; }
.text-privacy p { max-width: 820px; }
.text-privacy a { color: var(--blue); }
.lesson-jump { display: block; margin-top: 12px; color: var(--blue); line-height: 1.5; }
.lesson-library { margin-top: 32px; border-top: 1px solid var(--line); padding-top: 28px; }
.lesson-library h2 { font-size: 1.4rem; line-height: 1.4; margin: 0 0 12px; }
.lesson-library > p { max-width: 780px; color: var(--muted); line-height: 1.7; }
.lesson-index { display: flex; gap: 10px 24px; flex-wrap: wrap; padding: 0 0 16px; border-bottom: 1px solid var(--line); }
.lesson-library a { color: var(--blue); }
.lesson-library article { padding: 26px 0; border-bottom: 1px solid var(--line); max-width: 820px; scroll-margin-top: 24px; }
.lesson-library h3 { font-size: 1.15rem; line-height: 1.5; margin: 0 0 12px; }
.lesson-library p, .lesson-library li { line-height: 1.75; overflow-wrap: anywhere; }
.lesson-library blockquote { margin: 16px 0; padding: 8px 16px; border-left: 3px solid var(--accent); font-size: 1.05rem; line-height: 1.8; }
.lesson-library button { padding: 9px 14px; margin: 8px 0; }
.lesson-library details { margin-top: 16px; }
.lesson-library summary { cursor: pointer; color: var(--blue); font-weight: 650; }
#externalDialog { width: min(460px, calc(100% - 32px)); padding: 24px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); }
#externalDialog::backdrop { background: rgba(0,0,0,.35); }
#externalDialog h2 { font-size: 1.2rem; margin-top: 0; }
#externalDialog p { line-height: 1.6; }
.confirm-link { display: inline-flex; padding: 10px 14px; min-height: 44px; align-items: center; color: white; background: var(--accent); border-radius: 6px; text-decoration: none; }
@media (max-width: 760px) {
  .text-shell { width: calc(100% - 24px); margin-top: 18px; }
  .text-header { flex-direction: column; align-items: stretch; gap: 14px; }
  .text-header h1 { font-size: 1.5rem; }
  .text-workspace { display: flex; flex-direction: column; gap: 24px; }
  .text-workspace > section { width: 100%; }
  .text-reader { padding: 22px 0 0; border-left: 0; border-top: 1px solid var(--line); }
  .text-editor textarea { min-height: 138px; }
  .speech-settings { gap: 12px; }
  .sentence-list li { gap: 5px; grid-template-columns: 18px minmax(0,1fr) 30px 44px; }
}
