:root {
  --ink: #162019;
  --muted: #68726b;
  --line: #dfe4dc;
  --paper: #f6f7f3;
  --card: #ffffff;
  --green: #176b4b;
  --green-dark: #0d4d36;
  --green-pale: #e6f3ec;
  --amber: #bf6e26;
  --amber-pale: #fff0df;
  --shadow: 0 18px 50px rgba(31, 47, 38, 0.08);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--paper); }
body {
  margin: 0;
  color: var(--ink);
  background: radial-gradient(circle at 80% -10%, rgba(173, 211, 189, 0.28), transparent 34rem), var(--paper);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  min-height: 100vh;
}
button, select, input { font: inherit; }
button { color: inherit; }
button:focus-visible, select:focus-visible, label:focus-within { outline: 3px solid rgba(23, 107, 75, 0.22); outline-offset: 2px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 244px minmax(0, 1fr); }
.sidebar {
  position: sticky; top: 0; height: 100vh; padding: 28px 20px 20px;
  background: rgba(248, 249, 245, 0.88); backdrop-filter: blur(18px);
  border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 30px;
}
.brand { color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 11px; padding: 0 7px; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; background: var(--green); color: #fff; border-radius: 12px 12px 12px 4px; font-size: 13px; font-weight: 800; letter-spacing: -.03em; box-shadow: 0 8px 20px rgba(23,107,75,.22); }
.brand strong, .brand small, .profile-chip strong, .profile-chip small { display: block; }
.brand strong { font-size: 16px; letter-spacing: -.02em; }
.brand small { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .11em; margin-top: 2px; }

.nav-list { display: grid; gap: 7px; }
.nav-item { border: 0; background: transparent; width: 100%; padding: 12px 13px; border-radius: 12px; text-align: left; color: #566159; cursor: pointer; display: flex; align-items: center; gap: 11px; font-size: 14px; }
.nav-item span { font-size: 17px; width: 20px; text-align: center; }
.nav-item:hover { background: #eef1eb; }
.nav-item.active { background: var(--green-pale); color: var(--green-dark); font-weight: 700; }

.usage-card { margin-top: auto; padding: 17px; border: 1px solid #d7e3d9; border-radius: 17px; background: linear-gradient(145deg,#fbfdf9,#eef5ee); }
.usage-row { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }
.usage-row strong { color: var(--ink); font-size: 12px; }
.progress-track { height: 6px; background: #dce5dd; border-radius: 999px; margin: 11px 0 12px; overflow: hidden; }
.progress-track span { display: block; width: 100%; height: 100%; border-radius: inherit; background: var(--green); transition: width .4s ease; }
.usage-card p { margin: 0 0 10px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.text-button { padding: 0; border: 0; color: var(--green); background: transparent; font-weight: 700; font-size: 11px; cursor: pointer; }

.profile-chip { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 9px; padding: 8px 7px; }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: #252f29; color: #fff; font-size: 12px; }
.profile-chip strong { font-size: 12px; }
.profile-chip small { color: var(--muted); font-size: 10px; margin-top: 2px; }
.profile-chip button { border: 0; background: transparent; color: var(--muted); cursor: pointer; }

.main-content { width: 100%; max-width: 1540px; margin: 0 auto; padding: 31px 40px 42px; }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 25px; }
.eyebrow { margin: 0 0 6px; color: var(--green); font-size: 9px; font-weight: 800; letter-spacing: .18em; }
.topbar h1 { margin: 0; font-family: Georgia, "Noto Serif SC", serif; font-size: clamp(25px,3vw,38px); font-weight: 500; letter-spacing: -.04em; }
.topbar-actions { display: flex; gap: 9px; }
.quiet-button, .icon-button { border: 1px solid var(--line); background: rgba(255,255,255,.72); height: 37px; border-radius: 11px; cursor: pointer; }
.quiet-button { padding: 0 16px; font-size: 12px; }
.icon-button { width: 37px; }

.setup-bar { display: grid; grid-template-columns: 1.15fr .65fr .65fr .8fr; align-items: stretch; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 15px; overflow: hidden; margin-bottom: 18px; box-shadow: 0 10px 28px rgba(26,44,34,.04); }
.select-field, .context-upload { min-width: 0; padding: 10px 15px; background: rgba(255,255,255,.91); }
.select-field span, .context-upload small { display: block; color: var(--muted); font-size: 9px; margin-bottom: 2px; }
.select-field select { width: 100%; border: 0; padding: 0 24px 0 0; background: transparent; color: var(--ink); font-size: 12px; font-weight: 650; cursor: pointer; }
.context-upload { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.context-upload:hover { background: var(--green-pale); }
.context-upload input { display: none; }
.context-upload strong { display: block; font-size: 11px; }
.context-upload small { margin: 2px 0 0; }
.upload-icon { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--green-pale); color: var(--green); font-weight: 700; }

.workspace-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, .72fr); gap: 18px; min-height: 630px; }
.transcript-card, .insight-panel { background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); overflow: hidden; }
.transcript-card { display: grid; grid-template-rows: auto 1fr auto; min-height: 630px; }
.card-header { padding: 17px 21px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #edf0eb; }
.header-tools { display:flex; align-items:center; gap:8px; }
.live-state { display: flex; align-items: center; gap: 9px; font-size: 11px; font-weight: 700; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #a6afa8; box-shadow: 0 0 0 4px #edf0ed; }
.status-dot.live { background: #e34c47; box-shadow: 0 0 0 4px #fde6e5; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(227,76,71,0); } }
.latency-chip { padding: 5px 9px; border-radius: 99px; background: #f0f2ef; color: var(--muted); font-size: 9px; }
.confusion-log-button { min-height:27px; padding:0 9px; border:1px solid #e2d1b9; border-radius:9px; background:#fff8ef; color:#7e522b; font-size:8px; font-weight:700; cursor:pointer; }
.confusion-log-button:hover { background:#ffecd4; }
.confusion-log-button strong { display:inline-grid; min-width:16px; height:16px; padding:0 4px; place-items:center; border-radius:99px; background:#bd6e28; color:#fff; font-size:8px; }

.empty-state { align-self: center; max-width: 430px; margin: 0 auto; padding: 40px; text-align: center; }
.empty-state h2 { margin: 18px 0 8px; font: 500 25px/1.25 Georgia, "Noto Serif SC", serif; }
.empty-state p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.75; }
.privacy-note { display: inline-flex; align-items: center; gap: 6px; margin-top: 17px; padding: 7px 10px; background: #f2f4f1; border-radius: 8px; color: var(--muted); font-size: 9px; }
.sound-orbit { height: 72px; display: flex; justify-content: center; align-items: center; gap: 7px; }
.sound-orbit span { width: 6px; height: 20px; border-radius: 99px; background: var(--green); opacity: .65; }
.sound-orbit span:nth-child(2), .sound-orbit span:nth-child(4) { height: 43px; opacity: .9; }
.sound-orbit span:nth-child(3) { height: 66px; background: var(--amber); }

.transcript-stream { padding: 8px 22px 24px; overflow: auto; max-height: 510px; display: none; }
.transcript-stream.visible { display: block; }
.transcript-entry { padding: 20px 0; border-bottom: 1px solid #edf0eb; animation: entry .42s ease both; }
.entry-confusion-marker { margin-top:10px; padding:5px 8px; border:1px solid #e3cfb5; border-radius:7px; background:#fff8ef; color:#8a5728; font-size:8px; font-weight:750; cursor:pointer; }
.entry-confusion-marker:hover { background:#ffecd5; }
@keyframes entry { from { opacity: 0; transform: translateY(9px); } }
.entry-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; color: #8b948e; font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.speaker-tag { color: var(--green); font-weight: 800; }
.original-text { margin: 0 0 8px; color: #3a443e; font-size: 13px; line-height: 1.8; word-spacing: .04em; }
.word-token {
  display: inline;
  margin: 0;
  padding: 1px 2px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: inherit;
  cursor: pointer;
  transition: color .16s ease, background .16s ease, box-shadow .16s ease;
}
.word-token:hover {
  color: var(--green-dark);
  background: #eef4ef;
  box-shadow: 0 0 0 1px #d4e4d8;
}
body[data-highlight="all"] .word-token:not(.paired-term) { color:#405148; background:#f3f6f3; border-bottom:1px dotted #9aaba0; }
body[data-highlight="smart"] .word-token.key-word:not(.paired-term), body[data-highlight="smart"] .word-token.user-difficult:not(.paired-term), body[data-highlight="academic"] .word-token.key-word:not(.paired-term) { color:#385948; background:#edf5ef; border-bottom:1px solid #a5c4af; font-weight:650; }
body[data-highlight="smart"] .word-token.auto-difficult:not(.paired-term):not(.user-difficult) { color:#4e4a86; background:#f0effb; border-bottom:1px solid #aaa5d0; font-weight:650; }
body[data-highlight="academic"] .word-token:not(.key-word):not(.paired-term) { cursor:pointer; }
body[data-highlight="off"] .word-token, body[data-highlight="off"] .word-token.paired-term { color:inherit; background:transparent; border-bottom:0; box-shadow:none; font-weight:inherit; }
.word-token.ai-lookup-word:hover { border-bottom: 1px dotted #78a28a; }
.paired-term {
  --pair-bg: #eef4ef;
  --pair-ink: #23543d;
  --pair-line: #77a98d;
}
.pair-violet { --pair-bg: #f0ebff; --pair-ink: #594594; --pair-line: #a28bd7; }
.pair-amber { --pair-bg: #fff0df; --pair-ink: #8a4a18; --pair-line: #df9b57; }
.pair-blue { --pair-bg: #e8f2ff; --pair-ink: #245e96; --pair-line: #76a9d8; }
.pair-green { --pair-bg: #e5f5ec; --pair-ink: #176143; --pair-line: #68a987; }
.word-token.paired-term {
  color: var(--pair-ink);
  background: var(--pair-bg);
  border-bottom: 1.5px solid var(--pair-line);
  border-radius: 3px 3px 1px 1px;
  font-weight: 700;
}
.word-token.selected {
  color: #7e451b;
  background: var(--amber-pale);
  box-shadow: 0 0 0 1px #edc28e;
}
.translated-text { margin: 0; font: 500 17px/1.7 Georgia, "Noto Serif SC", serif; color: var(--ink); }
.term-link { padding: 1px 3px; border: 0; border-radius: 3px 3px 1px 1px; cursor: pointer; font-family: inherit; font-size: inherit; }
.term-link.paired-term { color: var(--pair-ink); background: var(--pair-bg); border-bottom: 1.5px solid var(--pair-line); }
.term-link:hover { filter: saturate(1.2) brightness(.97); }

.expression-token {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 0 2px;
  padding: 2px 5px;
  border: 0;
  border-bottom: 1.5px dashed #5d77a8;
  border-radius: 5px 5px 2px 2px;
  background: #eef3ff;
  color: #304f85;
  font: inherit;
  line-height: 1.45;
  cursor: default;
  font-weight: 700;
}
.expression-token:hover { background: #dfe9ff; color: #213f72; }
.expression-badge { padding: 2px 4px; border: 0; border-radius: 4px; background: #5b72a1; color: #fff; font: 700 7px/1.2 sans-serif; letter-spacing: .04em; white-space: nowrap; }
.expression-open { cursor: pointer; }
.expression-open:hover { background: #405987; }
.expression-phrase { min-width: 0; }
.expression-translation-link { padding: 1px 4px; border: 0; border-bottom: 1.5px dashed #5d77a8; border-radius: 4px; background: #eef3ff; color: #304f85; font: inherit; cursor: pointer; }

.concept-prompt {
  margin-top: 14px;
  padding: 12px 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid #d5e3d8;
  border-radius: 12px;
  background: linear-gradient(120deg,#f2f8f3,#fbfcfa);
  transition: background .2s ease, border-color .2s ease;
}
.concept-prompt.resolved { background: #f7f9f6; border-color: #e2e7e1; }
.concept-prompt-copy { display: flex; align-items: center; gap: 9px; min-width: 0; }
.concept-prompt-copy strong { display: block; color: var(--green-dark); font-size: 10px; }
.concept-prompt-copy p { margin: 3px 0 0; color: #5f6c63; font-size: 9px; }
.concept-spark { flex: 0 0 auto; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; background: var(--green-pale); color: var(--green); }
.concept-actions { display: flex; align-items: center; justify-content: flex-end; gap: 5px; flex-wrap: wrap; }
.concept-actions button { min-height: 29px; padding: 0 9px; border: 1px solid #cfdbd1; border-radius: 8px; background: #fff; color: #4a5b50; font-size: 8px; font-weight: 700; cursor: pointer; }
.concept-actions button:first-child { border-color: var(--green); background: var(--green); color: #fff; }
.concept-actions button:hover { transform: translateY(-1px); }
.concept-resolved { color: var(--green); font-size: 9px; font-weight: 750; }

.listening-bar { position:relative; min-height: 76px; padding: 12px 17px; display: grid; grid-template-columns: 1fr auto auto auto auto; align-items: center; gap: 12px; border-top: 1px solid #e8ece7; background: #fafbf8; }
.meter { height: 35px; display: flex; align-items: center; gap: 4px; }
.meter i { display: block; width: 3px; height: 7px; border-radius: 4px; background: #aeb6b0; transition: height .18s ease; }
.meter.active i { animation: meter 1s ease-in-out infinite alternate; background: var(--green); }
.meter.active i:nth-child(2n) { animation-delay: -.35s; }
.meter.active i:nth-child(3n) { animation-delay: -.65s; }
@keyframes meter { to { height: 30px; } }
.session-clock { min-width: 46px; text-align: right; }
.session-clock span, .session-clock small { display: block; }
.session-clock span { font-variant-numeric: tabular-nums; font-size: 13px; font-weight: 750; }
.session-clock small { color: var(--muted); font-size: 8px; margin-top: 2px; }
.primary-action { min-height: 43px; padding: 0 17px; border: 0; border-radius: 12px; background: var(--green); color: #fff; cursor: pointer; font-size: 12px; font-weight: 750; box-shadow: 0 9px 20px rgba(23,107,75,.18); }
.primary-action:hover { background: var(--green-dark); }
.primary-action.active { background: #262d29; }
.primary-action:disabled { cursor: wait; opacity: .72; }
.primary-action.full { width: 100%; margin-top: 8px; }
.demo-session-action { min-height: 43px; padding-inline: 14px; white-space: nowrap; }
.realtime-session-action { white-space: nowrap; }
.mic-symbol { font-size: 8px; margin-right: 7px; }
.confusion-button { min-height:39px; padding:0 13px; border:1px solid #ddc9ad; border-radius:11px; background:#fff8ef; color:#855426; font-size:10px; font-weight:750; cursor:pointer; }
.confusion-button:hover { background:#ffedd6; }
.confusion-button span { margin-right:5px; font-size:13px; }
.session-toast { position:absolute; right:17px; bottom:67px; z-index:5; max-width:340px; padding:9px 12px; border-radius:10px; background:#1f2b24; color:#fff; font-size:9px; line-height:1.5; box-shadow:0 10px 30px rgba(20,30,24,.2); opacity:0; transform:translateY(5px); pointer-events:none; transition:.2s ease; }
.session-toast.visible { opacity:1; transform:translateY(0); }

.live-transcript-entry.is-partial { opacity: .72; }
.live-speaker { color: #075fce; background: #eaf3ff; }
.live-placeholder { color: var(--muted); }
.live-original,
.live-translation { display: grid; grid-template-columns: 28px minmax(0,1fr); align-items: start; column-gap: 10px; }
.caption-language { display: inline-grid; place-items: center; min-width: 28px; height: 20px; margin-top: 2px; border: 1px solid #d8e0dc; border-radius: 6px; background: #f7faf8; color: #4d6257; font: 800 9px/1 system-ui,sans-serif; letter-spacing: .04em; }
.live-original .caption-language { border-color: #cfe1f8; background: #eef6ff; color: #075fce; }
.live-translation .caption-language { border-color: #cde4d8; background: #eff8f3; color: var(--green); }
.live-original-text,
.live-translation-text { min-width: 0; }
.live-translation { color: #243b31; font-size: 15px; line-height: 1.8; font-style: normal; }
.live-transcript-entry.is-partial .live-translation { color: #496b5c; }
.demo-status.realtime-ready { border-color: #cfe1f8; background: #f3f8ff; }

.insight-panel { display: flex; flex-direction: column; }
.panel-tabs { display: grid; grid-template-columns: repeat(3,1fr); border-bottom: 1px solid var(--line); }
.panel-tab { position: relative; height: 54px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 11px; }
.panel-tab.active { color: var(--ink); font-weight: 750; }
.panel-tab.active::after { content:""; position:absolute; left:24%; right:24%; bottom:-1px; height:2px; background:var(--green); }
.panel-content { display: none; padding: 24px; }
.panel-content.active { display: block; }
.panel-placeholder { padding: 70px 10px; text-align: center; }
.panel-placeholder > span { display: grid; place-items: center; width: 48px; height: 48px; margin: 0 auto 17px; border-radius: 15px; background: var(--green-pale); color: var(--green); font: 600 16px Georgia,serif; }
.panel-placeholder h3 { margin: 0 0 8px; font: 500 18px Georgia,"Noto Serif SC",serif; }
.panel-placeholder p { margin:0; color:var(--muted); font-size:11px; line-height:1.7; }
.term-category { margin: 0 0 10px; color: var(--green); font-size: 8px; letter-spacing: .17em; font-weight: 850; }
.term-title-row { display: flex; align-items: flex-start; gap: 10px; justify-content: space-between; }
.term-title-row h2 { margin:0; font:500 24px/1.15 Georgia,serif; letter-spacing:-.025em; }
.save-term { width: 32px; height: 32px; border-radius: 9px; border:1px solid var(--line); background:#fff; cursor:pointer; font-size:18px; }
.save-term.saved { background:var(--green-pale); color:var(--green); }
.pronunciation { margin: 7px 0 25px; color: #8a938d; font-size: 9px; }
.definition-block, .context-block, .example-block { padding: 15px 0; border-top: 1px solid var(--line); }
.definition-block span, .context-block span, .example-block span, .context-summary small, .context-item span { color:var(--muted); font-size:8px; text-transform:uppercase; letter-spacing:.1em; }
.definition-block p, .context-block p, .example-block p { margin:7px 0 0; font-size:11px; line-height:1.72; }
.definition-block p { font:500 14px/1.65 Georgia,"Noto Serif SC",serif; }
.example-block #term-example-en { color: var(--ink); font-weight: 650; }
.example-translation { color: var(--muted); }
.ask-button { width:100%; margin-top:18px; min-height:39px; border:1px solid #cfd9d1; border-radius:10px; background:#f7faf7; color:var(--green); font-size:10px; font-weight:750; cursor:pointer; }
.term-actions { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-top:18px; }
.term-actions .ask-button { margin-top:0; }
.teacher-question-button { min-height:39px; border:0; border-radius:10px; background:var(--green); color:#fff; font-size:10px; font-weight:750; cursor:pointer; }
.teacher-question-button span { margin-right:5px; }
.context-summary { display:flex; align-items:center; gap:12px; padding-bottom:22px; }
.course-monogram { width:46px; height:46px; border-radius:13px; background:var(--green); color:#fff; display:grid; place-items:center; font-weight:800; }
.context-summary h3 { margin:4px 0 0; font:500 16px Georgia,serif; }
.context-item { display:flex; justify-content:space-between; gap:15px; padding:15px 0; border-top:1px solid var(--line); }
.context-item strong { text-align:right; font-size:10px; max-width:160px; }
.context-tip { margin:18px 0 0; padding:13px; background:var(--green-pale); color:#4c6354; border-radius:10px; font-size:10px; line-height:1.6; }
.glossary-preview { margin-top:14px; padding:14px; border:1px solid #d8e4da; border-radius:12px; background:#fbfdfb; }
.glossary-heading { display:flex; justify-content:space-between; gap:10px; align-items:center; }
.glossary-heading span { color:var(--green); font-size:9px; font-weight:800; }
.glossary-heading strong { font-size:9px; }
.glossary-chips { display:flex; flex-wrap:wrap; gap:5px; margin:11px 0 8px; }
.glossary-chips span { padding:5px 7px; border-radius:7px; background:var(--green-pale); color:var(--green-dark); font-size:8px; }
.glossary-preview > p { margin:0; color:var(--muted); font-size:8px; line-height:1.5; }
.course-glossary { margin-top:16px; padding-top:16px; border-top:1px solid var(--line); }
.course-glossary-heading { display:flex; align-items:flex-end; justify-content:space-between; gap:12px; }
.course-glossary-heading small { color:#6e8a79; font-size:7px; font-weight:850; letter-spacing:.14em; }
.course-glossary-heading h4 { margin:4px 0 0; font:500 15px/1.2 Georgia,"Noto Serif SC",serif; }
.course-glossary-heading > strong { padding:4px 7px; border-radius:99px; background:#edf5ef; color:var(--green); font-size:8px; }
.glossary-form { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-top:13px; }
.glossary-form label { display:grid; gap:5px; min-width:0; }
.glossary-form label:nth-child(3) { grid-column:1/-1; }
.glossary-form label span { color:var(--muted); font-size:8px; }
.glossary-form input, .glossary-form select { width:100%; min-width:0; min-height:36px; padding:7px 9px; border:1px solid #dce5de; border-radius:9px; background:#fff; color:var(--ink); font:inherit; font-size:9px; outline:none; }
.glossary-form input:focus, .glossary-form select:focus { border-color:#8fbaa0; box-shadow:0 0 0 3px #e9f3ec; }
.glossary-form button { grid-column:1/-1; min-height:37px; border:0; border-radius:9px; background:var(--green); color:#fff; font-size:9px; font-weight:750; cursor:pointer; }
.custom-glossary-list { display:grid; gap:6px; margin-top:10px; }
.custom-glossary-list > p { margin:0; padding:9px; border-radius:8px; background:#f5f7f4; color:var(--muted); font-size:8px; text-align:center; }
.custom-glossary-item { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:8px; align-items:center; padding:8px 9px; border:1px solid #e1e7e2; border-radius:9px; background:#fbfcfb; }
.custom-glossary-item div { min-width:0; }
.custom-glossary-item strong, .custom-glossary-item span { display:block; overflow-wrap:anywhere; }
.custom-glossary-item strong { color:#31463a; font-size:9px; }
.custom-glossary-item span { margin-top:3px; color:var(--muted); font-size:8px; }
.custom-glossary-item button { width:28px; height:28px; border:0; border-radius:8px; background:#f1f3f0; color:#7b887f; cursor:pointer; }
.custom-glossary-item button:hover { background:#feecea; color:#9b4038; }
.analysis-state { display:inline-flex; align-items:center; gap:5px; margin-top:9px; padding:4px 7px; border-radius:7px; background:#f1f6ff; color:#416994; font-size:8px; font-weight:700; }
.analysis-state::before { content:"✦"; }
.analysis-state.analysis-pending { color:#6c7781; background:#f2f4f5; }
.analysis-state.analysis-error { color:#8a6540; background:#fff6ea; }
.expression-placeholder-mark { background:#eef3ff !important; color:#3f5c91 !important; }
.expression-category { color:#3f5c91; }
.expression-detail .definition-block p { color:#263e68; }
.expression-action { border-color:#cdd8eb; background:#f4f7fd; color:#3f5c91; }

.secondary-view { background:#fff; border:1px solid var(--line); border-radius:18px; padding:28px; box-shadow:var(--shadow); min-height:630px; }
.section-heading { display:flex; justify-content:space-between; align-items:flex-end; padding-bottom:22px; border-bottom:1px solid var(--line); }
.section-heading h2 { margin:0; font:500 28px Georgia,"Noto Serif SC",serif; }
.section-heading > span { color:var(--muted); font-size:10px; }
.saved-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:13px; padding-top:20px; }
.saved-card { padding:18px; border:1px solid var(--line); border-radius:13px; }
.saved-card small { color:var(--green); font-size:8px; }
.saved-card h3 { margin:8px 0; font:500 17px Georgia,serif; }
.saved-card p { margin:0; color:var(--muted); font-size:10px; line-height:1.6; }
.saved-card .saved-example { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); color: #435047; }
.secondary-empty { grid-column:1/-1; padding:100px 20px; text-align:center; color:var(--muted); font-size:11px; }
.expression-book-intro { margin-top:18px; padding:13px 15px; display:flex; align-items:center; gap:11px; border-radius:12px; background:#f2f5fb; color:#53617b; }
.expression-book-intro span { font:500 28px/1 Georgia,serif; color:#49628f; }
.expression-book-intro p { margin:0; font-size:10px; line-height:1.6; }
.expression-saved-card { border-top:3px solid #7288b2; }
.expression-saved-card small { color:#49628f; }
.review-hero { margin-top:20px; padding:22px 24px; display:flex; align-items:center; justify-content:space-between; gap:20px; border-radius:15px; background:linear-gradient(125deg,#e7f3ea,#f7faf5); border:1px solid #d8e7da; }
.review-kicker { color:var(--green); font-size:8px; font-weight:850; letter-spacing:.13em; }
.review-hero h3 { margin:7px 0 5px; font:500 21px/1.25 Georgia,"Noto Serif SC",serif; }
.review-hero p { margin:0; color:var(--muted); font-size:9px; }
.notes-layout { display:grid; grid-template-columns:repeat(2,1fr); gap:14px; padding-top:20px; }
.notes-layout article { padding:20px; background:#f7f8f5; border-radius:13px; }
.notes-layout small { color:var(--green); font-size:8px; text-transform:uppercase; letter-spacing:.12em; }
.notes-layout h3 { font:500 18px/1.3 Georgia,serif; }
.notes-layout p, .notes-layout li { color:#58635b; font-size:11px; line-height:1.7; }
.notes-layout ul { padding-left:18px; }
.confusion-review ul { list-style:none; padding:0; margin:13px 0 0; }
.confusion-review li { display:flex; gap:9px; align-items:flex-start; padding:7px 0; border-top:1px solid #e6eae4; }
.confusion-review li strong { flex:0 0 auto; color:var(--amber); font-size:9px; }
.confusion-review li span { line-height:1.45; }
.confusion-review.attention { animation:review-attention 1.1s ease; }
@keyframes review-attention { 0%,100% { box-shadow:none; } 35% { box-shadow:0 0 0 4px rgba(191,110,38,.2); background:#fff8ee; } }
.review-quiz { margin-top:16px; padding:26px; border:1px solid #dce4dc; border-radius:15px; background:#fff; box-shadow:0 12px 30px rgba(30,46,36,.05); }
.quiz-progress { display:flex; align-items:center; gap:14px; color:var(--muted); font-size:9px; }
.quiz-progress > div { flex:1; height:5px; overflow:hidden; border-radius:99px; background:#e9ede8; }
.quiz-progress i { display:block; height:100%; width:0; border-radius:inherit; background:var(--green); transition:width .25s ease; }
.quiz-type { margin:24px 0 7px; color:var(--green); font-size:8px; font-weight:850; letter-spacing:.13em; text-transform:uppercase; }
.review-quiz h3 { margin:0 0 18px; font:500 21px/1.35 Georgia,"Noto Serif SC",serif; }
.quiz-options { display:grid; gap:8px; }
.quiz-options button { min-height:43px; padding:9px 13px; border:1px solid var(--line); border-radius:10px; background:#fafbf9; text-align:left; font-size:10px; cursor:pointer; }
.quiz-options button:hover:not(:disabled) { border-color:var(--green); background:var(--green-pale); }
.quiz-options button.correct { border-color:#6eaf88; background:#e6f5eb; color:#155b39; }
.quiz-options button.incorrect { border-color:#d99991; background:#fff0ee; color:#8b3730; }
.quiz-feedback { min-height:18px; margin:14px 0 0; color:#526159; font-size:10px; line-height:1.6; }
.quiz-next { margin-top:8px; }
.quiz-complete { padding:20px; border-radius:11px; background:var(--green-pale); color:var(--green-dark); font-size:11px; text-align:center; }

.modal { width:min(440px,calc(100vw - 30px)); padding:30px; border:0; border-radius:20px; box-shadow:0 30px 90px rgba(11,23,16,.22); }
.modal::backdrop { background:rgba(16,26,20,.5); backdrop-filter:blur(4px); }
.modal-close { position:absolute; right:15px; top:14px; width:30px; height:30px; border:0; border-radius:50%; background:#f1f3ef; cursor:pointer; font-size:20px; }
.modal h2 { margin:0 0 8px; font:500 28px/1.2 Georgia,"Noto Serif SC",serif; }
.modal-lead { color:var(--muted); font-size:11px; line-height:1.6; }
.price-card { margin-top:20px; padding:20px; border-radius:15px; background:#f3f7f2; border:1px solid #dce8dd; }
.price-card > div { display:flex; justify-content:space-between; align-items:center; }
.price-card strong { font:500 24px Georgia,serif; }
.price-card strong small { font:400 10px sans-serif; color:var(--muted); }
.price-card ul { padding-left:18px; color:#4f5d54; font-size:11px; line-height:1.9; }
.modal-footnote { text-align:center; color:var(--muted); font-size:9px; line-height:1.5; }
.feedback-options { display:grid; gap:8px; margin:20px 0; }
.feedback-options button { min-height:42px; border:1px solid var(--line); border-radius:10px; background:#fff; text-align:left; padding:0 14px; cursor:pointer; }
.feedback-options button:hover, .feedback-options button.selected { border-color:var(--green); background:var(--green-pale); color:var(--green-dark); }
.question-modal { width:min(700px,calc(100vw - 30px)); }
.question-context { margin:17px 0 12px; padding:11px 13px; display:flex; justify-content:space-between; gap:15px; border-radius:10px; background:#f1f5f0; }
.question-context span { color:var(--muted); font-size:9px; }
.question-context strong { font-size:10px; }
.question-presets { display:flex; gap:6px; flex-wrap:wrap; }
.question-presets button { padding:7px 9px; border:1px solid var(--line); border-radius:8px; background:#fff; color:#59665e; font-size:9px; cursor:pointer; }
.question-presets button.selected { border-color:var(--green); background:var(--green-pale); color:var(--green-dark); font-weight:750; }
.question-input { display:block; margin:14px 0; }
.question-input span { display:block; margin-bottom:6px; color:var(--muted); font-size:8px; }
.question-input textarea { width:100%; resize:vertical; padding:11px 12px; border:1px solid var(--line); border-radius:10px; color:var(--ink); background:#fbfcfa; font:11px/1.6 inherit; }
.question-results { display:grid; grid-template-columns:1fr 1fr; gap:9px; margin-top:17px; }
.question-results article { padding:13px; border:1px solid var(--line); border-radius:11px; background:#fafbf9; }
.question-results article:nth-child(3) { grid-column:1/-1; }
.question-results article > span { color:var(--green); font-size:8px; font-weight:800; }
.question-results article p { min-height:35px; margin:8px 0 11px; font-size:10px; line-height:1.6; }
.question-results article div { display:flex; gap:6px; }
.question-results article button { padding:5px 8px; border:1px solid #d4ddd5; border-radius:7px; background:#fff; color:#536158; font-size:8px; cursor:pointer; }
.question-translation { grid-column:1/-1; margin:0; padding:10px 12px; border-radius:9px; background:#f2f5fb; color:#53617b; font-size:9px; }

@media (max-width: 980px) {
  .app-shell { grid-template-columns:76px minmax(0,1fr); }
  .sidebar { padding:24px 12px; align-items:center; }
  .brand > span:last-child, .usage-card, .profile-chip > :not(.avatar) { display:none; }
  .nav-item { justify-content:center; padding:12px; font-size:0; }
  .nav-item span { font-size:18px; }
  .profile-chip { display:block; }
  .main-content { padding:28px 24px; }
  .workspace-grid { grid-template-columns:1fr; }
  .insight-panel { min-height:420px; }
  .saved-grid, .notes-layout { grid-template-columns:1fr 1fr; }
}

@media (max-width: 680px) {
  .app-shell { display:block; }
  .sidebar { position:fixed; z-index:20; left:0; right:0; top:auto; bottom:0; width:auto; height:68px; padding:8px 14px; flex-direction:row; justify-content:space-between; border-right:0; border-top:1px solid var(--line); }
  .brand, .usage-card, .profile-chip { display:none; }
  .nav-list { width:100%; display:grid; grid-template-columns:repeat(4,1fr); gap:5px; }
  .nav-item { justify-content:center; font-size:0; padding:8px; }
  .nav-item span { font-size:20px; }
  .main-content { padding:20px 14px 90px; }
  .topbar h1 { font-size:26px; }
  .topbar-actions { display:none; }
  .setup-bar, .workspace-grid, .saved-grid, .notes-layout { grid-template-columns:1fr; }
  .transcript-card { min-height:560px; }
  .listening-bar { grid-template-columns:1fr auto; }
  .meter { display:none; }
  .primary-action { grid-column:1/-1; grid-row:1; }
  .confusion-button { grid-column:1; grid-row:2; }
  .session-clock { grid-row:2; grid-column:2; }
  .secondary-view { padding:20px; }
  .concept-prompt { align-items:flex-start; flex-direction:column; }
  .concept-actions { justify-content:flex-start; }
  .panel-tab { font-size:10px; }
  .header-tools .latency-chip { display:none; }
  .confusion-log-button { padding:0 7px; }
  .review-hero { align-items:flex-start; flex-direction:column; }
  .notes-layout, .question-results { grid-template-columns:1fr; }
  .question-results article:nth-child(3), .question-translation { grid-column:auto; }
}

/* Minimal editorial theme · v8 */
:root {
  --ink: #1b1e1b;
  --muted: #747a75;
  --line: #e8e9e4;
  --paper: #f8f8f5;
  --card: #ffffff;
  --green: #255f49;
  --green-dark: #174533;
  --green-pale: #eef3ef;
  --amber: #a9642d;
  --amber-pale: #fbf2e8;
  --shadow: 0 1px 2px rgba(24, 31, 26, .03);
}

html { background: var(--paper); }
body {
  background: var(--paper);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: -.006em;
}
button, select, textarea { letter-spacing: inherit; }

.app-shell { grid-template-columns: 218px minmax(0, 1fr); }
.sidebar {
  padding: 38px 20px 26px;
  gap: 38px;
  background: rgba(248, 248, 245, .96);
  backdrop-filter: blur(20px);
  border-right-color: #e5e6e1;
}
.brand { gap: 12px; padding: 0 9px; }
.brand-mark {
  width: 34px;
  height: 34px;
  border: 1px solid #cad4cc;
  border-radius: 10px 10px 10px 3px;
  background: transparent;
  color: var(--green-dark);
  box-shadow: none;
  font-size: 10px;
  letter-spacing: .05em;
}
.brand strong { font-size: 14px; font-weight: 700; letter-spacing: -.01em; }
.brand small { margin-top: 3px; color: #909590; font-size: 7px; letter-spacing: .13em; }
.nav-list { gap: 4px; }
.nav-item {
  padding: 11px 12px;
  border-radius: 9px;
  color: #6d736e;
  font-size: 12px;
  transition: background .16s ease, color .16s ease;
}
.nav-item span { color: #929793; font-size: 14px; }
.nav-item:hover { background: #f0f1ed; color: #343a35; }
.nav-item.active { background: #ecefea; color: #244d3b; font-weight: 650; }
.nav-item.active span { color: var(--green); }
.usage-card {
  padding: 19px 8px 0;
  border: 0;
  border-top: 1px solid #e3e5df;
  border-radius: 0;
  background: transparent;
}
.usage-card p { margin-bottom: 12px; font-size: 9px; line-height: 1.6; }
.progress-track { height: 3px; margin: 12px 0 14px; background: #e3e6e1; }
.text-button { font-size: 9px; font-weight: 650; }
.profile-chip { padding: 2px 8px; }
.avatar { width: 31px; height: 31px; background: #303632; font-size: 10px; }
.profile-chip strong { font-size: 10px; }
.profile-chip small { font-size: 8px; }

.main-content { max-width: 1480px; padding: 48px 56px 68px; }
.topbar { align-items: center; margin-bottom: 32px; }
.eyebrow { margin-bottom: 8px; color: #718077; font-size: 8px; letter-spacing: .2em; }
.topbar h1 { font-size: clamp(29px, 3vw, 41px); font-weight: 400; line-height: 1.12; letter-spacing: -.045em; }
.topbar-actions { gap: 4px; }
.quiet-button, .icon-button {
  height: 34px;
  border-color: transparent;
  border-radius: 9px;
  background: transparent;
  color: #707671;
}
.quiet-button:hover, .icon-button:hover { background: #eeefeb; color: var(--ink); }

.setup-bar {
  grid-template-columns: 1.15fr .66fr .68fr .84fr;
  align-items: stretch;
  gap: 9px;
  margin-bottom: 22px;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.select-field, .context-upload {
  padding: 12px 15px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, .82);
}
.select-field span, .context-upload small { color: #8b918c; font-size: 8px; }
.select-field select { font-size: 10px; font-weight: 600; }
.context-upload { gap: 9px; }
.context-upload:hover { border-color: #ccd7cf; background: #fff; }
.context-upload strong { font-size: 10px; font-weight: 650; }
.upload-icon { width: 24px; height: 24px; border-radius: 7px; background: #f0f3ef; }

.workspace-grid { grid-template-columns: minmax(0, 1.72fr) minmax(300px, .7fr); gap: 24px; min-height: 680px; }
.transcript-card, .insight-panel {
  border-color: #e7e8e3;
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.transcript-card { min-height: 680px; }
.card-header { padding: 20px 26px; border-bottom-color: #eff0ec; }
.live-state { font-size: 9px; font-weight: 650; }
.status-dot { width: 7px; height: 7px; box-shadow: 0 0 0 3px #eff1ee; }
.latency-chip { padding: 5px 8px; background: #f4f5f2; color: #858b86; font-size: 8px; }
.confusion-log-button { min-height: 28px; border-color: #eadfce; border-radius: 8px; background: #fcf8f2; color: #835a35; font-size: 8px; }
.confusion-log-button strong { background: #a96936; }

.empty-state { max-width: 440px; padding: 74px 46px; }
.empty-state h2 { margin-top: 24px; font-size: 26px; font-weight: 400; letter-spacing: -.025em; }
.empty-state p { color: #777e78; font-size: 11px; line-height: 1.9; }
.privacy-note { margin-top: 22px; padding: 7px 10px; background: transparent; border: 1px solid #eaebe7; color: #898f8a; }
.sound-orbit { gap: 8px; }
.sound-orbit span { width: 4px; background: #6f8e7d; }
.sound-orbit span:nth-child(3) { background: #a9774e; }

.transcript-stream { max-height: 555px; padding: 8px 30px 32px; }
.transcript-entry { padding: 28px 2px; border-bottom-color: #eff0ec; }
.entry-meta { margin-bottom: 12px; color: #a0a59f; font-size: 8px; }
.speaker-tag { color: #547463; }
.original-text { margin-bottom: 10px; color: #465048; font-size: 14px; line-height: 1.95; }
.translated-text { font-size: 19px; font-weight: 400; line-height: 1.9; letter-spacing: .005em; }
.word-token.paired-term, .term-link.paired-term { font-weight: 650; }
.expression-token { padding: 2px 5px; background: #f1f3f7; color: #455a7b; border-bottom-color: #8c9ab1; }
.expression-badge { background: #70809a; }
.concept-prompt {
  margin-top: 18px;
  padding: 14px 15px;
  border-color: #e4e8e3;
  border-radius: 11px;
  background: #fafbf9;
}
.concept-spark { background: #eef2ee; }
.concept-actions button { border-color: #e1e5e1; background: #fff; }
.concept-actions button:first-child { border-color: #305e4b; background: #305e4b; }
.entry-confusion-marker { border-color: #e8ded0; background: #fcf8f2; }

.listening-bar { min-height: 88px; padding: 16px 22px; gap: 13px; border-top-color: #eceeea; background: #fff; }
.primary-action { min-height: 42px; border-radius: 10px; background: #245a45; box-shadow: none; font-size: 10px; }
.primary-action:hover { background: #174534; }
.confusion-button { min-height: 40px; border-color: #e8ddce; border-radius: 10px; background: #fcf8f2; color: #805831; }
.session-clock span { font-size: 12px; font-weight: 650; }

.panel-tabs { border-bottom-color: #eceeea; }
.panel-tab { height: 59px; color: #858b86; font-size: 9px; }
.panel-tab.active { font-weight: 650; }
.panel-tab.active::after { left: 28%; right: 28%; height: 1px; }
.panel-content { padding: 30px; }
.panel-placeholder { padding: 90px 12px; }
.panel-placeholder > span { width: 45px; height: 45px; border-radius: 13px; background: #f0f3ef; }
.panel-placeholder h3 { font-size: 18px; font-weight: 400; }
.panel-placeholder p { color: #7d847e; line-height: 1.8; }
.term-category { color: #63796c; letter-spacing: .18em; }
.term-title-row h2 { font-size: 26px; font-weight: 400; }
.save-term { border-color: #e6e8e4; border-radius: 9px; }
.pronunciation { margin-bottom: 29px; }
.definition-block, .context-block, .example-block { padding: 18px 0; border-top-color: #eceeea; }
.definition-block p { font-size: 14px; font-weight: 400; line-height: 1.75; }
.context-block p, .example-block p { line-height: 1.8; }
.term-actions { gap: 9px; margin-top: 22px; }
.ask-button { min-height: 41px; border-color: #dee4df; background: #fbfcfa; }
.teacher-question-button { min-height: 41px; background: #285b47; }
.context-item { padding: 18px 0; border-top-color: #eceeea; }
.context-tip, .glossary-preview { background: #f5f7f4; }

.secondary-view { min-height: 680px; padding: 38px; border-color: #e7e8e3; border-radius: 16px; box-shadow: var(--shadow); }
.section-heading { padding-bottom: 28px; border-bottom-color: #eceeea; }
.section-heading h2 { font-size: 30px; font-weight: 400; }
.saved-grid { gap: 15px; padding-top: 26px; }
.saved-card { padding: 21px; border-color: #e9eae6; border-radius: 12px; }
.review-hero { margin-top: 26px; padding: 28px 30px; border-color: #e4e9e4; border-radius: 13px; background: #f6f8f5; }
.review-hero h3 { font-size: 23px; font-weight: 400; }
.notes-layout { gap: 16px; padding-top: 24px; }
.notes-layout article { padding: 23px; border: 1px solid #eceeea; border-radius: 12px; background: #fbfcfa; }
.review-quiz { padding: 30px; border-color: #e7e9e5; border-radius: 13px; box-shadow: none; }
.quiz-options button { border-color: #e7e9e5; background: #fbfcfa; }

.modal { border: 1px solid #e7e9e5; border-radius: 16px; box-shadow: 0 24px 70px rgba(21, 27, 23, .14); }
.modal::backdrop { background: rgba(26, 30, 27, .34); backdrop-filter: blur(7px); }
.modal-close { background: #f4f5f2; }
.modal h2 { font-weight: 400; letter-spacing: -.025em; }
.question-context, .question-results article { background: #fafbf9; }
.question-input textarea { border-color: #e5e7e3; background: #fbfcfa; }

@media (max-width: 1180px) {
  .main-content { padding: 42px 34px 58px; }
  .workspace-grid { grid-template-columns: minmax(0, 1.45fr) minmax(285px, .75fr); gap: 18px; }
  .setup-bar { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 980px) {
  .app-shell { grid-template-columns: 72px minmax(0, 1fr); }
  .sidebar { padding: 30px 11px; }
  .main-content { padding: 38px 28px 56px; }
  .workspace-grid { grid-template-columns: 1fr; }
  .insight-panel { min-height: 460px; }
}

@media (max-width: 680px) {
  body { background: #f8f8f5; }
  .sidebar { height: 66px; padding: 8px 12px; background: rgba(250,250,248,.96); }
  .main-content { padding: 25px 14px 88px; }
  .topbar { margin-bottom: 25px; }
  .topbar h1 { font-size: 28px; }
  .setup-bar { grid-template-columns: 1fr; gap: 7px; }
  .select-field, .context-upload { padding: 11px 13px; }
  .workspace-grid { gap: 14px; }
  .transcript-card { min-height: 590px; }
  .card-header { padding: 16px 17px; }
  .transcript-stream { padding: 6px 18px 25px; }
  .transcript-entry { padding: 23px 0; }
  .translated-text { font-size: 18px; }
  .concept-prompt { align-items: stretch; }
  .concept-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .listening-bar { padding: 14px 16px; }
  .panel-content { padding: 24px; }
  .secondary-view { min-height: 590px; padding: 24px 19px; }
  .review-hero { padding: 23px; }
  .review-quiz { padding: 23px 18px; }
}

/* Structural minimal layout · v9 */
@media (min-width: 981px) {
  .app-shell { display: block; min-height: 100vh; }
  .sidebar {
    position: sticky;
    top: 0;
    z-index: 40;
    width: 100%;
    height: 72px;
    padding: 0 44px;
    flex-direction: row;
    align-items: center;
    gap: 34px;
    border-right: 0;
    border-bottom: 1px solid #e7e8e3;
    background: rgba(250, 250, 247, .92);
  }
  .brand { min-width: 172px; padding: 0; }
  .brand-mark { width: 31px; height: 31px; border-radius: 9px 9px 9px 3px; }
  .brand small { display: none; }
  .nav-list { display: flex; align-items: center; gap: 2px; }
  .nav-item { width: auto; padding: 10px 13px; font-size: 10px; white-space: nowrap; }
  .nav-item span { display: none; }
  .usage-card {
    margin: 0 0 0 auto;
    padding: 0 17px;
    border: 0;
    border-left: 1px solid #e2e4df;
  }
  .usage-row { align-items: center; gap: 8px; font-size: 8px; }
  .usage-row strong { font-size: 9px; }
  .usage-card .progress-track, .usage-card p, .usage-card .text-button { display: none; }
  .profile-chip { display: grid; min-width: 118px; padding: 0; }
  .profile-chip button { display: none; }
  .avatar { width: 29px; height: 29px; }

  .main-content { max-width: 1420px; padding: 70px 56px 84px; }
  .topbar { align-items: flex-end; margin-bottom: 50px; }
  .topbar h1 { max-width: 780px; font-size: clamp(44px, 5vw, 64px); line-height: 1.03; letter-spacing: -.055em; }
  .topbar .eyebrow { margin-bottom: 14px; }
  .topbar-actions { padding-bottom: 4px; }

  .setup-bar {
    grid-template-columns: 1.35fr .68fr .72fr .92fr;
    gap: 26px;
    margin-bottom: 22px;
    padding: 0 5px;
  }
  .select-field, .context-upload {
    padding: 10px 0 12px;
    border: 0;
    border-bottom: 1px solid #dfe2dc;
    border-radius: 0;
    background: transparent;
  }
  .select-field:focus-within, .context-upload:hover { border-bottom-color: #5d7769; background: transparent; }
  .upload-icon { margin-left: 1px; background: #eef1ed; }

  .workspace-grid {
    grid-template-columns: minmax(0, 1fr) 350px;
    gap: 0;
    min-height: 720px;
    overflow: hidden;
    border: 1px solid #e4e6e1;
    border-radius: 20px;
    background: #fff;
  }
  .transcript-card, .insight-panel {
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .transcript-card { min-height: 720px; }
  .insight-panel { border-left: 1px solid #e8eae5; }
  .card-header { min-height: 67px; padding: 19px 28px; }
  .transcript-stream { max-height: 585px; padding: 12px 34px 36px; }
  .transcript-entry { padding: 31px 2px; }
  .original-text { max-width: 850px; font-size: 14px; }
  .translated-text { max-width: 900px; font-size: 20px; }
  .listening-bar { min-height: 91px; padding: 17px 26px; }
  .panel-content { padding: 33px 30px; }

  .secondary-view {
    min-height: 720px;
    border-radius: 20px;
    box-shadow: none;
  }
}

@media (min-width: 1250px) {
  .main-content { padding-left: 70px; padding-right: 70px; }
  .workspace-grid { grid-template-columns: minmax(0, 1fr) 380px; }
}

/* Shared responsive behavior · v10 */
[hidden] { display: none !important; }
html { scrollbar-gutter: stable; }
.main-content, .workspace-grid > *, .topbar > div, .term-title-row h2 { min-width: 0; }
.insight-panel, .saved-card, .context-upload strong, .question-context strong { overflow-wrap: anywhere; }
.transcript-card { display: flex; flex-direction: column; }
.empty-state { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.listening-bar { margin-top: auto; flex-shrink: 0; }
.transcript-stream { min-height: 0; flex: 1; overscroll-behavior: contain; overflow-anchor: none; }
.follow-transcript { align-self: center; margin: 6px 12px 10px; padding: 10px 16px; min-height: 40px; border: 1px solid #d4dfd6; border-radius: 99px; background: #f1f6f2; color: var(--green-dark); font-size: 12px; cursor: pointer; }
.modal { max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow-y: auto; overscroll-behavior: contain; padding-top: 48px; }
.modal-close, .save-term { min-width: 44px; min-height: 44px; }
body.lookup-open { position: fixed; width: 100%; overflow: hidden; }
.lookup-dialog { position: fixed; inset: 16px 16px 16px auto; margin: 0; width: 420px; max-width: calc(100% - 32px); height: calc(100vh - 32px); height: calc(100dvh - 32px); max-height: none; padding: 0; border: 1px solid var(--line); border-radius: 20px; background: white; color: var(--ink); box-shadow: 0 20px 80px #15251c30; overflow: hidden; }
.lookup-dialog[open] { display: flex; flex-direction: column; animation: lookup-in .18s ease-out; }
.lookup-dialog::backdrop { background: #19251d45; backdrop-filter: blur(2px); }
.lookup-header { flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.lookup-header h2 { margin: 0; font-size: 16px; font-weight: 650; }
.lookup-header p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.lookup-close { width: 44px; height: 44px; flex-shrink: 0; border: 0; border-radius: 50%; background: #f1f4ef; color: var(--green-dark); font-size: 26px; cursor: pointer; }
.lookup-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.lookup-dialog .insight-panel { min-height: 0; border: 0; border-radius: 0; box-shadow: none; overflow: visible; }
.lookup-dialog .panel-tabs { position: sticky; top: 0; z-index: 1; background: #fff; }
.lookup-dialog .panel-tab { min-height: 48px; height: 48px; font-size: 12px; }
.lookup-dialog .panel-content { padding: 24px; }
.lookup-dialog .term-category, .lookup-dialog .pronunciation { font-size: 11px; }
.lookup-dialog .definition-block > span, .lookup-dialog .context-block > span, .lookup-dialog .example-block > span { font-size: 11px; }
.lookup-dialog .definition-block p { font-size: 16px; }
.lookup-dialog .context-block p, .lookup-dialog .example-block p { font-size: 14px; }
.lookup-dialog .term-actions button, .lookup-dialog .expression-action { min-height: 44px; font-size: 12px; }
.lookup-footer { flex-shrink: 0; padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: white; }
.lookup-footer button { width: 100%; min-height: 44px; border: 1px solid #d8e3da; border-radius: 10px; background: var(--green-pale); color: var(--green-dark); font-size: 13px; font-weight: 600; cursor: pointer; }
@keyframes lookup-in { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: translateX(0); } }
@media (min-width: 981px) {
  .transcript-card { height: 720px; }
  .workspace-grid > .insight-panel { max-height: 720px; overflow-y: auto; }
}
@media (min-width: 981px) and (max-width: 1180px) {
  .sidebar { gap: 16px; padding-inline: 24px; }
  .brand { min-width: 148px; }
  .profile-chip { display: none; }
  .nav-item { padding-inline: 9px; }
}
@media (max-width: 980px) {
  .nav-item { font-size: 0; }
  .nav-item span { flex-shrink: 0; }
  .transcript-card { min-height: 0; height: 620px; }
  .workspace-grid { min-height: 0; }
  .workspace-grid > .insight-panel { min-height: 0; }
  .panel-placeholder { padding: 32px 12px; }
}
@media (max-width: 680px) {
  .sidebar { height: calc(68px + env(safe-area-inset-bottom)); padding: 6px max(8px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); gap: 0; }
  .nav-list { gap: 2px; }
  .nav-item { flex-direction: column; gap: 4px; padding: 6px 2px; min-height: 50px; font-size: 10px; line-height: 1.2; white-space: nowrap; text-align: center; }
  .nav-item span { font-size: 18px; line-height: 20px; }
  .main-content { padding: 24px max(14px, env(safe-area-inset-right)) calc(92px + env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left)); }
  .topbar { gap: 10px; }
  .topbar-actions { display: flex; flex-shrink: 0; }
  .topbar-actions .quiet-button { display: none; }
  .topbar h1 { font-size: clamp(24px, 6.8vw, 28px); line-height: 1.25; }
  .icon-button { width: 44px; height: 44px; }
  .select-field select { min-height: 28px; font-size: 16px; text-overflow: ellipsis; }
  .context-upload strong { font-size: 13px; }
  .select-field span, .context-upload small { font-size: 11px; }
  .transcript-card { height: clamp(440px, 70svh, 620px); }
  .transcript-stream { max-height: none; }
  .empty-state { padding: 30px 20px; }
  .empty-state h2 { font-size: 24px; }
  .empty-state p { font-size: 13px; }
  .card-header { gap: 8px; flex-wrap: wrap; }
  .confusion-log-button { min-height: 36px; font-size: 10px; }
  .listening-bar { grid-template-columns: minmax(0,1fr) auto; gap: 10px; }
  .listening-bar .primary-action { grid-column: 1 / -1; min-height: 44px; font-size: 13px; }
  .demo-session-action { min-height: 44px; font-size: 12px; }
  .confusion-button { min-height: 44px; }
  .context-upload, .primary-action, .question-presets button, .feedback-options button { min-width: 0; }
  .question-input textarea { font-size: 16px; }
  .section-heading { flex-wrap: wrap; gap: 12px; }
  .term-title-row h2 { overflow-wrap: anywhere; }
  .lookup-dialog { inset: auto 0 0; width: 100%; max-width: 100%; height: 80vh; height: 80dvh; max-height: calc(100dvh - env(safe-area-inset-top) - 12px); border-radius: 22px 22px 0 0; }
  .lookup-dialog[open] { animation: sheet-in .18s ease-out; }
  .lookup-dialog .panel-content { padding: 22px 20px; }
  .modal { padding: 52px 20px calc(24px + env(safe-area-inset-bottom)); }
}
@keyframes sheet-in { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
/* Word families · v13 */
.word-family { margin: 16px 0 20px; border: 1px solid #dce6da; border-radius: 12px; background: #f7faf4; overflow: hidden; }
.word-family > summary { position: relative; min-height: 64px; padding: 14px 42px 14px 15px; cursor: pointer; list-style: none; }
.word-family > summary::-webkit-details-marker { display: none; }
.word-family > summary::after { content: '＋'; position: absolute; right: 14px; top: 18px; color: var(--green); font-size: 18px; }
.word-family[open] > summary::after { content: '−'; }
.word-family > summary:focus-visible { outline: 3px solid #9fbda7; outline-offset: -3px; border-radius: 10px; }
.family-summary-title { display: block; color: var(--green-dark); font-size: 14px; font-weight: 650; }
.family-summary-title small { font-size: 10px; font-weight: 400; color: #738372; margin-left: 5px; }
.family-preview { display: block; color: #788473; font-size: 11px; line-height: 1.7; margin-top: 5px; overflow-wrap: anywhere; }
.family-content { padding: 0 14px 14px; }
.family-group { padding-top: 12px; border-top: 1px solid #dfe7da; }
.family-group + .family-group { margin-top: 18px; }
.family-base { margin: 0 0 15px; color: #77816f; font-size: 11px; line-height: 1.7; }
.family-base strong { color: #405b44; font-size: 13px; }
.family-section { margin: 12px 0; }
.family-section h4 { margin: 0 0 7px; color: #6b7c60; font-size: 11px; font-weight: 650; }
.family-word.pronunciation-tools { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 6px 8px; margin: 0; padding: 11px 0; border-bottom: 1px solid #e5ebdf; }
.family-word-copy { min-width: 0; overflow-wrap: anywhere; }
.family-word-copy > strong { font-size: 15px; color: #263f2c; font-weight: 650; }
.family-pos { display: block; margin-top: 4px; color: #788171; font-size: 10px; line-height: 1.5; }
.family-word-copy p { margin: 5px 0 0; color: #53644b; font-size: 12px; line-height: 1.7; }
.family-speak { min-width: 66px; padding-inline: 9px; white-space: nowrap; }
.family-word .pronunciation-feedback { grid-column: 1 / -1; margin-top: 0; }
.family-word .pronunciation-feedback:empty { display: none; }
.family-tip { padding: 10px 11px; margin: 12px 0 4px; border-left: 2px solid #b4c7a4; border-radius: 0 7px 7px 0; background: #eef3e6; color: #5e6f50; font-size: 12px; line-height: 1.8; }
.family-footnote { margin: 14px 0 0; font-size: 10px; line-height: 1.7; color: #87917e; }
.family-empty { margin: 16px 0; padding: 14px; border: 1px dashed #e1e5dc; border-radius: 10px; color: #7b8476; }
.family-empty strong { font-size: 12px; font-weight: 500; }
.family-empty p { margin: 8px 0 0; font-size: 11px; line-height: 1.7; }
/* Word pronunciation · v12 */
.pronunciation-tools { margin: 14px 0; }
.phonetic-row { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.phonetic-label { padding: 3px 6px; border-radius: 5px; background: #f0f4ed; font-size: 11px; color: #667b6c; }
.phonetic-ipa { min-width: 0; overflow-wrap: anywhere; font-family: "Segoe UI", "Arial", "Lucida Sans Unicode", sans-serif; font-size: 18px; line-height: 1.6; color: #4a5f50; letter-spacing: .02em; }
.pronunciation-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.pronounce-button { min-height: 44px; padding: 9px 14px; border: 1px solid #cfded2; border-radius: 9px; background: #f7faf5; color: var(--green-dark); font-size: 12px; cursor: pointer; }
.pronounce-button:hover { background: #eaf2e8; }
.pronounce-button[aria-pressed="true"] { background: var(--green-dark); border-color: var(--green-dark); color: white; }
.pronounce-button:disabled { opacity: .55; cursor: not-allowed; }
.pronunciation-feedback { display: block; margin-top: 9px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.word-meta { margin: 10px 0 22px; font-size: 12px; color: var(--muted); }
.saved-pronunciation { padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.saved-pronunciation .phonetic-ipa { font-size: 16px; }
/* Classroom question notebook · v11 */
.questions-intro { margin: 22px 0; font-size: 14px; line-height: 1.8; color: #667269; }
.question-stats { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; margin-bottom: 22px; }
.question-stats > div { padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: #fafbf8; }
.question-stats strong { display: block; margin-bottom: 6px; font-size: 28px; font-weight: 500; color: var(--green-dark); }
.question-stats span { color: var(--muted); font-size: 12px; }
.question-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.question-filters button, .questions-empty button, .review-questions-link { min-height: 44px; padding: 9px 15px; border: 1px solid var(--line); border-radius: 9px; background: white; color: #637267; cursor: pointer; font-size: 12px; }
.question-filters button[aria-pressed="true"] { background: var(--green-pale); border-color: #b4c9b9; color: var(--green-dark); font-weight: 650; }
.questions-storage-note { margin: 16px 0 24px; font-size: 12px; line-height: 1.8; color: var(--muted); }
.question-records { display: grid; gap: 18px; }
.question-record { padding: 24px; border: 1px solid var(--line); border-radius: 14px; background: white; min-width: 0; overflow-wrap: anywhere; }
.record-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; color: #7b857e; font-size: 12px; }
.record-time { color: #895b30; font-weight: 650; }
.record-status { margin-left: auto; padding: 6px 10px; border-radius: 99px; font-size: 11px; background: #fbf1e5; color: #8a5b2b; }
.status-followup { background: #edf1fa; color: #48658e; }
.status-understood { background: var(--green-pale); color: var(--green-dark); }
.question-record h3 { margin: 18px 0 8px; font-size: 20px; font-weight: 550; line-height: 1.5; }
.record-date { margin: 0 0 18px; font-size: 11px; color: var(--muted); }
.record-context { padding: 18px; margin: 18px 0; border-left: 3px solid #c2d3c4; background: #f6f8f4; border-radius: 0 10px 10px 0; }
.record-context > span, .record-note > span { display: block; margin-bottom: 8px; color: #6b7c6f; font-size: 12px; font-weight: 600; }
.record-context p { margin: 0 0 18px; line-height: 1.8; font-size: 14px; }
.record-context p:last-child { margin-bottom: 0; }
.record-note { display: block; margin-top: 20px; }
.record-note textarea { width: 100%; min-height: 96px; padding: 12px 14px; border: 1px solid #dce3da; border-radius: 10px; resize: vertical; font-family: inherit; font-size: 14px; line-height: 1.7; background: #fdfefb; color: var(--ink); }
.record-note textarea:focus-visible, .question-filters button:focus-visible { outline: 3px solid #b8d5c5; outline-offset: 2px; }
.record-footer { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: 15px; }
.record-footer label > span { display: block; margin-bottom: 6px; font-size: 12px; color: #6b7c6f; }
.record-footer select { min-height: 44px; padding: 8px 32px 8px 12px; border: 1px solid #dce3da; border-radius: 9px; font-size: 14px; background: white; }
.record-save-status, .record-legacy { color: var(--muted); font-size: 12px; line-height: 1.7; }
.record-legacy { padding: 16px; background: #faf7f1; border-radius: 10px; }
.questions-empty { padding: 48px 20px; text-align: center; background: #fafbf8; border: 1px dashed #dce3da; border-radius: 14px; }
.questions-empty > span { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; color: var(--green-dark); background: var(--green-pale); font-size: 22px; }
.questions-empty h3 { font-size: 18px; font-weight: 500; }
.questions-empty p { max-width: 420px; margin: 0 auto 20px; color: var(--muted); line-height: 1.8; font-size: 13px; }
.review-questions-link { margin-top: 12px; background: #f2f6f0; }
#questions-heading, .workspace-grid { scroll-margin-top: 90px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (max-width: 680px) {
  .nav-list { grid-template-columns: repeat(5,minmax(0,1fr)); }
  .nav-item { font-size: 9px; }
  .question-stats { gap: 7px; }
  .question-stats > div { padding: 14px 10px; }
  .question-stats strong { font-size: 25px; }
  .question-stats span { font-size: 10px; }
  .question-record { padding: 18px 14px; }
  .record-meta { font-size: 11px; gap: 8px; }
  .record-status { margin-left: 0; }
  .question-record h3 { font-size: 18px; }
  .record-context { padding: 14px; }
  .record-note textarea, .record-footer select { font-size: 16px; }
  .question-filters { gap: 6px; }
  .question-filters button { flex: 1; padding: 9px 7px; white-space: nowrap; }
  .questions-view .section-heading .quiet-button { padding-inline: 0; min-height: 44px; }
  #questions-heading, .workspace-grid { scroll-margin-top: 16px; }
}
/* Expression lookup, accents and progress · v14 */
.expression-word-source .word-token { border-bottom: 1px dotted #96aa9b; }
.expression-word-source .word-token:hover { background: #edf5ed; }
.expression-detail .term-title-row .word-token, .expression-saved-card h3 .word-token { font: inherit; }
.expression-word-tip, .word-origin { margin: 12px 0 18px; padding: 12px; border: 1px solid #dde6da; border-radius: 10px; background: #f5f8f1; color: #66775d; font-size: 12px; line-height: 1.8; }
.word-origin p { margin: 0 0 8px; }
.word-origin button { min-height: 44px; border: 0; border-radius: 7px; background: #e8efe2; color: var(--green-dark); padding: 8px 12px; cursor: pointer; font-size: 12px; }
.accent-option + .accent-option { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.accent-option .phonetic-row { margin-bottom: 8px; }
.learning-intro { margin: 24px 0; color: #73816f; font-size: 14px; line-height: 1.8; }
.study-stats { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.study-stats article { min-width: 0; padding: 22px; border: 1px solid var(--line); border-radius: 12px; background: #fafbf7; }
.study-stats article span { display: block; margin-bottom: 12px; font-size: 12px; color: #77846f; }
.study-stats strong { font-size: 24px; font-weight: 500; color: var(--green-dark); overflow-wrap: anywhere; }
.study-counting-note { margin: 18px 0 26px; color: var(--muted); font-size: 12px; line-height: 1.8; }
.study-columns { display: grid; grid-template-columns: minmax(0,1.3fr) minmax(0,1fr); gap: 18px; }
.study-section, .progress-backup { min-width: 0; padding: 24px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.study-section h3, .progress-backup h3 { margin: 0 0 18px; font-size: 18px; font-weight: 550; }
.study-week { list-style: none; margin: 0; padding: 8px 0 0; display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 7px; }
.study-week li { min-width: 0; text-align: center; }
.study-week li > span { display: block; min-height: 32px; color: #71816a; font-size: 10px; overflow-wrap: anywhere; }
.study-week li > div { display: flex; align-items: end; justify-content: center; height: 100px; border-bottom: 1px solid var(--line); }
.study-week i { display: block; width: 65%; max-width: 26px; background: #759681; border-radius: 5px 5px 0 0; }
.study-week small { display: block; margin-top: 10px; font-size: 10px; color: var(--muted); }
.study-sessions { padding-left: 18px; margin: 18px 0 0; color: #78826f; font-size: 12px; line-height: 2; }
#study-quiz { font-size: 13px; color: var(--green-dark); }
.progress-backup { margin-top: 24px; }
.progress-backup p { color: var(--muted); line-height: 1.8; font-size: 13px; }
.backup-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0; }
.backup-actions button, .import-progress-label, .import-preview button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 16px; border: 1px solid #cfddce; border-radius: 9px; background: #f3f8ef; color: var(--green-dark); font-size: 13px; cursor: pointer; }
.import-progress-label { position: relative; overflow: hidden; }
.import-progress-label input { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }
.import-progress-label:focus-within { outline: 3px solid #b2d0bb; outline-offset: 2px; }
.import-preview { padding: 20px; margin-top: 16px; border: 1px solid #d5e3d0; border-radius: 12px; background: #f7faf3; }
.import-preview > div { display: flex; flex-wrap: wrap; gap: 10px; }
#progress-message { min-height: 22px; color: var(--green-dark); }
@media (max-width: 980px) { .study-columns { grid-template-columns: 1fr; } }
@media (max-width: 680px) {
  .sidebar { height: calc(112px + env(safe-area-inset-bottom)); }
  .nav-list { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 2px 4px; }
  .nav-item { min-height: 46px; padding: 4px 2px; font-size: 10px; }
  .main-content { padding-bottom: calc(136px + env(safe-area-inset-bottom)); }
  .study-stats { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
  .study-stats article { padding: 16px 12px; }
  .study-stats strong { font-size: 21px; }
  .study-section, .progress-backup { padding: 20px 14px; }
  .study-week { gap: 4px; }
  .study-week li > span { font-size: 9px; }
  .backup-actions > *, .import-preview button { flex: 1; }
  .learning-view .section-heading .quiet-button { min-height: 44px; padding: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
