:root {
  --ink: #141816;
  --ink-soft: #4b514c;
  --paper: #f3f2ec;
  --surface: #ffffff;
  --line: #d9dcd5;
  --line-strong: #b8bdb5;
  --acid: #c7f36b;
  --acid-dark: #18210b;
  --blue: #2867d8;
  --blue-soft: #e8f0ff;
  --orange: #c85b22;
  --orange-soft: #fff0e7;
  --violet: #7151c8;
  --violet-soft: #f0ebff;
  --green: #34755b;
  --green-soft: #e8f4ed;
  --gray-soft: #eef0ec;
  --shadow: 0 18px 55px rgba(30, 35, 30, 0.07);
  --radius: 14px;
  --font-sans: "SF Pro Text", "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-serif: "Iowan Old Style", "Songti SC", Georgia, "Times New Roman", serif;
}

[hidden] {
  display: none !important;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font-sans);
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
}

#method,
#workspace,
#practice,
#lexicon {
  scroll-margin-top: 84px;
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button:focus-visible,
textarea:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(40, 103, 216, 0.28);
  outline-offset: 3px;
}

.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;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  color: var(--surface);
  background: var(--ink);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.shell {
  width: min(1220px, calc(100% - 48px));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  background: rgba(243, 242, 236, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.nav-shell {
  width: min(1360px, calc(100% - 48px));
  height: 68px;
  margin-inline: auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  width: fit-content;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-decoration: none;
}

.brand-mark {
  width: 28px;
  height: 28px;
  padding: 6px;
  display: grid;
  gap: 3px;
  background: var(--ink);
  border-radius: 50%;
}

.brand-mark span {
  display: block;
  height: 2px;
  background: var(--acid);
  transform-origin: left center;
}

.brand-mark span:nth-child(2) {
  transform: scaleX(0.72);
}

.brand-mark span:nth-child(3) {
  transform: scaleX(0.46);
}

.nav-links {
  position: relative;
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-links a {
  padding: 25px 0 23px;
  color: var(--ink-soft);
  font-size: 15px;
  font-weight: 750;
  text-decoration: none;
  transition: color 180ms ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--ink);
}

.nav-indicator {
  position: absolute;
  bottom: -1px;
  left: 0;
  width: var(--nav-indicator-width, 0px);
  height: 3px;
  background: var(--ink);
  opacity: 0;
  transform: translate3d(var(--nav-indicator-x, 0px), 0, 0);
  transform-origin: left center;
  transition: width 280ms cubic-bezier(0.2, 0.8, 0.2, 1),
    transform 280ms cubic-bezier(0.2, 0.8, 0.2, 1),
    opacity 160ms ease;
  pointer-events: none;
}

.nav-links.is-ready .nav-indicator {
  opacity: 1;
}

.mobile-nav {
  display: none;
}

.header-exam-setting {
  position: relative;
  width: fit-content;
}

.study-streak {
  min-height: 44px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.12em;
  transition: color 180ms ease, background 180ms ease, border-color 180ms ease;
}

.countdown-copy b {
  color: var(--ink);
  font-weight: 850;
}

.header-now {
  justify-self: end;
  text-align: right;
}

.header-now time {
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: -0.01em;
}

.study-streak strong {
  color: var(--ink);
}

.study-streak i {
  padding-bottom: 1px;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line-strong);
  font-size: 8px;
  font-style: normal;
  letter-spacing: 0.02em;
}

.study-streak:hover,
.study-streak[aria-expanded="true"] {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line-strong);
}

.header-date-popover {
  position: absolute;
  z-index: 30;
  top: calc(100% + 8px);
  right: 0;
  width: 292px;
  padding: 16px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  box-shadow: 0 14px 34px rgba(19, 23, 20, 0.14);
}

.exam-setting-fields {
  display: grid;
  gap: 8px;
}

.header-date-popover > span {
  display: block;
  margin-bottom: 10px;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.header-date-popover p {
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 650;
  line-height: 1.5;
}

.header-date-popover .clear-exam-date {
  margin-top: 10px;
}

.streak-dot {
  width: 8px;
  height: 8px;
  background: var(--acid);
  border: 2px solid var(--ink);
  border-radius: 50%;
}

.intro {
  padding: 40px 0 48px;
}

.intro-status {
  margin-bottom: 48px;
  padding: 0 0 18px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 30px;
  align-items: end;
  border-bottom: 1px solid var(--line-strong);
}

.exam-date-control > span {
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.exam-date-control {
  padding: 8px 10px;
  display: grid;
  gap: 3px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  cursor: pointer;
}

.exam-date-control input {
  width: 100%;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
  font: 750 12px var(--font-sans);
  cursor: pointer;
}

.exam-date-control:focus-within {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(40, 103, 216, 0.12);
}

.clear-exam-date {
  padding: 4px 0;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  font-size: 9px;
  font-weight: 750;
}

.clear-exam-date:hover {
  color: var(--ink);
  border-color: var(--ink);
}

.section-index,
.mini-label,
.auto-note {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(310px, 0.72fr);
  align-items: center;
  gap: 54px;
}

.intro-grid.method-is-collapsed {
  grid-template-columns: minmax(0, 1fr) auto;
}

.method-slot {
  min-width: 0;
}

.daily-motto {
  min-width: 0;
}

.intro h1 {
  max-width: 780px;
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(48px, 7vw, 88px);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: -0.045em;
}

.intro h1::after {
  display: inline-block;
  width: 0.22em;
  height: 0.22em;
  margin-left: 0.08em;
  content: "";
  background: var(--acid);
  border-radius: 50%;
}

.motto-caption {
  max-width: 650px;
  margin-top: 22px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
}

.motto-caption p {
  margin: 0;
  color: var(--ink-soft);
  font-family: var(--font-serif);
  font-size: 15px;
  font-style: italic;
  line-height: 1.55;
}

.motto-caption span {
  flex: 0 0 auto;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.07em;
}

.intro-copy {
  padding-bottom: 3px;
}

.intro-copy p {
  margin: 0 0 28px;
  color: var(--ink-soft);
  font-size: 17px;
  font-weight: 550;
  line-height: 1.78;
}

.method-chain {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  color: var(--ink);
  font-size: 12px;
  font-weight: 720;
}

.method-chain span {
  padding-bottom: 3px;
  border-bottom: 1px solid var(--line-strong);
}

.method-chain b {
  color: var(--blue);
}

.method-widget {
  position: relative;
  min-height: 220px;
  padding: 18px 19px;
  display: flex;
  flex-direction: column;
  color: #f8f9f5;
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 8px 8px 0 rgba(199, 243, 107, 0.72);
}

.method-collapse-button,
.method-restore-button {
  color: inherit;
  border: 1px solid rgba(255, 255, 255, 0.18);
  cursor: pointer;
}

.method-collapse-button {
  position: absolute;
  z-index: 2;
  top: 10px;
  left: 10px;
  width: 30px;
  height: 30px;
  padding: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 7px;
  opacity: 0.62;
  transition: opacity 160ms ease, background 160ms ease;
}

.method-collapse-button:hover,
.method-collapse-button:focus-visible {
  background: rgba(199, 243, 107, 0.12);
  opacity: 1;
}

.method-collapse-button svg,
.method-restore-button svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.method-restore-button {
  min-height: 44px;
  padding: 8px 11px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line-strong);
  border-radius: 9px;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.method-restore-button svg {
  width: 18px;
  height: 18px;
}

.method-restore-button:hover {
  background: var(--acid);
  border-color: var(--ink);
}

.method-widget-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}

.method-widget-heading > div > span {
  color: var(--acid);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.method-widget-heading > div {
  padding-left: 30px;
}

.method-widget h2 {
  margin: 4px 0 0;
  font-size: 19px;
  font-weight: 780;
  letter-spacing: -0.02em;
}

.method-widget .step-counter {
  color: #aeb5ae;
  font-size: 14px;
}

.method-widget .coach-progress {
  margin: 14px 0 15px;
}

.method-widget .step-content {
  min-height: 79px;
}

.method-widget .step-kicker {
  margin-bottom: 5px;
  font-size: 8px;
}

.method-widget .step-content h4 {
  margin-bottom: 6px;
  font-size: 19px;
  font-weight: 500;
}

.method-widget .step-content p {
  display: -webkit-box;
  overflow: hidden;
  color: #c6cbc5;
  font-size: 10px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.method-widget .coach-actions {
  margin-top: auto;
  gap: 7px;
}

.method-widget .square-button,
.method-widget .next-button {
  height: 32px;
  font-size: 10px;
}

.method-widget .square-button {
  width: 32px;
}

.method-widget .next-button {
  padding-inline: 11px;
}

.workspace {
  padding-bottom: 96px;
}

.input-panel,
.sentence-stage,
.structure-panel,
.coach-panel,
.translation-panel,
.vocabulary-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.input-panel {
  position: relative;
  padding: 28px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.input-panel::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  content: "";
  background: var(--acid);
}

.input-panel.is-dragging-image {
  outline: 3px solid color-mix(in srgb, var(--acid) 75%, white);
  outline-offset: 4px;
  box-shadow: 0 18px 45px rgba(20, 24, 22, 0.14);
}

.input-panel.is-dragging-image::after {
  position: absolute;
  z-index: 8;
  inset: 10px;
  display: grid;
  place-items: center;
  content: "松开以识别英文句子";
  color: var(--ink);
  background: color-mix(in srgb, var(--acid) 88%, white);
  border: 1px dashed var(--ink);
  border-radius: calc(var(--radius) - 5px);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.panel-heading,
.result-header,
.content-heading,
.stage-toolbar,
.input-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.panel-controls {
  display: flex;
  align-items: center;
  gap: 20px;
}

.mode-switch {
  padding: 3px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  background: var(--gray-soft);
  border: 1px solid var(--line);
  border-radius: 9px;
}

.mode-button {
  min-width: 96px;
  padding: 9px 12px;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 760;
  transition: color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.mode-button:hover {
  color: var(--ink);
}

.mode-button.is-active {
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 1px 5px rgba(20, 24, 22, 0.12);
}

.mode-button.is-active::before {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 6px;
  content: "";
  vertical-align: 1px;
  background: var(--acid);
  border: 1px solid var(--ink);
  border-radius: 50%;
}

.section-index,
.mini-label {
  color: var(--ink-soft);
}

.panel-heading h2,
.result-header h2,
.content-heading h3,
.insight-grid h3 {
  margin: 7px 0 0;
  font-size: 23px;
  font-weight: 750;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.example-picker {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 650;
}

.example-picker select {
  min-width: 180px;
  padding: 9px 32px 9px 11px;
  color: var(--ink);
  background: var(--gray-soft);
  border: 0;
  border-radius: 7px;
}

.image-input-tools {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.image-upload-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 13px 9px 10px;
  color: var(--ink);
  background: var(--gray-soft);
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.image-upload-button:hover {
  background: color-mix(in srgb, var(--acid) 24%, white);
  border-color: var(--ink);
  transform: translateY(-1px);
}

.image-upload-button:disabled {
  cursor: wait;
  opacity: 0.68;
  transform: none;
}

.image-upload-button svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.image-upload-button > span {
  display: grid;
  gap: 1px;
  text-align: left;
}

.image-upload-button strong {
  font-size: 12px;
  line-height: 1.2;
}

.image-upload-button small {
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 650;
}

.ocr-status {
  margin: 0;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 620;
}

.input-panel.is-recognizing .ocr-status {
  color: var(--blue);
}

textarea {
  width: 100%;
  min-height: 132px;
  margin-top: 14px;
  padding: 18px 0;
  resize: vertical;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-top: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  font-family: var(--font-serif);
  font-size: clamp(20px, 2.2vw, 29px);
  line-height: 1.5;
}

textarea::placeholder {
  color: #a6aaa5;
}

textarea:focus {
  outline: 0;
  border-bottom-color: var(--ink);
}

.input-footer {
  margin-top: 16px;
}

#character-count {
  color: var(--ink-soft);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.input-actions,
.coach-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.text-button,
.primary-button,
.square-button,
.next-button {
  border: 0;
}

.text-button {
  padding: 10px 14px;
  color: var(--ink-soft);
  background: transparent;
}

.text-button:hover {
  color: var(--ink);
}

.primary-button {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 13px 18px;
  color: var(--acid-dark);
  background: var(--acid);
  border: 1px solid var(--ink);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 760;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.primary-button:hover {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--ink);
}

.primary-button:disabled {
  cursor: wait;
  filter: grayscale(0.4);
  opacity: 0.72;
}

.error-message {
  margin: 14px 0 0;
  color: #a3362f;
  font-size: 13px;
}

.result-area {
  margin-top: 70px;
}

.result-area[data-loading="true"] {
  opacity: 0.58;
  pointer-events: none;
}

.result-header {
  margin-bottom: 19px;
  align-items: end;
}

.result-header h2 {
  font-family: var(--font-serif);
  font-size: 37px;
  font-weight: 400;
}

.result-stats {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  overflow: hidden;
}

.stat {
  min-width: 92px;
  padding: 9px 14px;
  border-right: 1px solid var(--line);
}

.stat:last-child {
  border-right: 0;
}

.stat span {
  display: block;
  margin-bottom: 3px;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 760;
  letter-spacing: 0.12em;
}

.stat strong {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 400;
}

.sentence-stage {
  padding: 28px;
}

.stage-toolbar {
  align-items: flex-start;
}

.toolbar-hint {
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 14px;
  color: var(--ink-soft);
  font-size: 10px;
}

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

.legend i {
  width: 7px;
  height: 7px;
  border-radius: 2px;
}

.legend-subject { background: var(--blue); }
.legend-predicate { background: var(--orange); }
.legend-object { background: var(--green); }
.legend-clause { background: var(--violet); }
.legend-modifier { background: #7b817b; }

.sentence-canvas {
  position: relative;
  isolation: isolate;
  min-height: 200px;
  padding: 42px 0 32px;
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  gap: 11px 7px;
}

.chunk {
  position: relative;
  z-index: 2;
  padding: 6px 7px 8px;
  color: var(--ink);
  background: var(--surface);
  border: 0;
  border-bottom: 3px solid var(--line-strong);
  border-radius: 4px 4px 0 0;
  font-family: var(--font-serif);
  font-size: clamp(19px, 2.25vw, 29px);
  line-height: 1.25;
  text-align: left;
  opacity: 0;
  transform: translateY(9px);
  animation: chunk-in 420ms cubic-bezier(0.2, 0.75, 0.2, 1) forwards;
  transition: opacity 220ms ease, background 180ms ease, transform 180ms ease;
}

.chunk:hover,
.chunk.is-selected {
  background: var(--gray-soft);
  transform: translateY(-2px);
}

.chunk.is-related-source {
  background: #eef3fb;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 207, 0.26);
}

.related-word {
  position: relative;
  z-index: 4;
  border-radius: 3px;
  transition: color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.related-word.is-related-word {
  color: #171810;
  background: #f5df58;
  box-shadow: 0 0 0 3px #f5df58;
  font-weight: 720;
}

.chunk.has-boundary {
  margin-right: clamp(15px, 1.6vw, 24px);
}

.chunk.has-boundary::after {
  content: "/";
  position: absolute;
  right: clamp(-22px, -1.45vw, -15px);
  bottom: 7px;
  color: #aaa99f;
  font-family: var(--font-sans);
  font-size: 0.72em;
  font-weight: 480;
  line-height: 1;
}

.relation-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.relation-underlay {
  fill: none;
  stroke: rgba(255, 255, 255, 0.96);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
  vector-effect: non-scaling-stroke;
  opacity: 0;
  transition: opacity 180ms ease;
}

.relation-path {
  fill: none;
  stroke: #8d928e;
  stroke-width: 1.35;
  stroke-linecap: round;
  opacity: 0.14;
  vector-effect: non-scaling-stroke;
  transition: stroke 180ms ease, stroke-width 180ms ease, opacity 180ms ease;
}

.relation-layer marker path {
  fill: context-stroke;
  stroke: rgba(255, 255, 255, 0.96);
  stroke-width: 0.7;
  paint-order: stroke fill;
}

.relation-path.is-active {
  stroke: var(--blue);
  stroke-width: 2.7;
  opacity: 1;
}

.sentence-canvas.has-relation-selection .relation-layer {
  z-index: 5;
}

.relation-underlay.is-active {
  opacity: 1;
}

.sentence-canvas.has-relation-selection .relation-path:not(.is-active),
.sentence-canvas.has-relation-selection .relation-underlay:not(.is-active) {
  opacity: 0;
}

.sentence-canvas.has-focus .relation-path:not(.is-focused):not(.is-active) {
  opacity: 0.12;
}

.sentence-canvas.has-focus.has-relation-selection .relation-path:not(.is-active),
.sentence-canvas.has-focus.has-relation-selection .relation-underlay:not(.is-active) {
  opacity: 0;
}

.chunk.kind-subject { border-color: var(--blue); }
.chunk.kind-predicate { border-color: var(--orange); }
.chunk.kind-object { border-color: var(--green); }
.chunk.kind-clause,
.chunk.kind-connector { border-color: var(--violet); }
.chunk.kind-modifier { border-color: #8c918c; }

.sentence-canvas.has-focus .chunk:not(.is-focused) {
  opacity: 0.2;
}

.sentence-canvas.has-focus .chunk.is-focused {
  background: #f4f6f2;
}

@keyframes chunk-in {
  to { opacity: 1; transform: translateY(0); }
}

.chunk-inspector {
  min-height: 72px;
  padding: 16px 18px;
  display: grid;
  grid-template-columns: minmax(100px, 0.22fr) 1fr auto;
  gap: 18px;
  align-items: start;
  background: var(--gray-soft);
  border-left: 3px solid var(--ink);
}

.inspector-type {
  font-size: 11px;
  font-weight: 780;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.chunk-inspector p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.65;
}

.inspector-action {
  padding: 7px 9px;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 720;
  white-space: nowrap;
}

.inspector-action:hover {
  background: var(--acid);
  border-color: var(--ink);
}

.analysis-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.structure-panel,
.coach-panel,
.translation-panel,
.vocabulary-panel {
  padding: 26px;
}

.auto-note {
  padding: 6px 8px;
  color: var(--ink-soft);
  background: var(--gray-soft);
  border-radius: 4px;
}

.tree {
  margin-top: 27px;
  overflow: hidden;
}

.tree-list,
.tree-list ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.tree-list ul {
  position: relative;
  margin-left: 22px;
  padding-left: 23px;
}

.tree-list ul::before {
  position: absolute;
  top: 0;
  bottom: 21px;
  left: 0;
  width: 1px;
  content: "";
  background: var(--line-strong);
  transform: scaleY(0);
  transform-origin: top;
  animation: grow-line 500ms ease forwards;
}

.tree-node {
  position: relative;
  margin: 8px 0;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: minmax(105px, 0.28fr) 1fr;
  gap: 12px;
  align-items: baseline;
  background: #fafbf8;
  border-left: 3px solid var(--line-strong);
  opacity: 0;
  animation: tree-in 420ms ease forwards;
}

.tree-list ul > li > .tree-node::before {
  position: absolute;
  top: 50%;
  left: -26px;
  width: 23px;
  height: 1px;
  content: "";
  background: var(--line-strong);
}

.tree-node.type-root { border-color: var(--ink); background: var(--gray-soft); }
.tree-node.type-main { border-color: var(--acid-dark); background: #f1f8e4; }
.tree-node.type-subject { border-color: var(--blue); }
.tree-node.type-predicate { border-color: var(--orange); }
.tree-node.type-object { border-color: var(--green); }
.tree-node.type-clause { border-color: var(--violet); }
.tree-node.type-modifier { border-color: #8c918c; }

.node-label {
  font-size: 11px;
  font-weight: 780;
  letter-spacing: 0.04em;
}

.node-text {
  color: var(--ink-soft);
  font-family: var(--font-serif);
  font-size: 14px;
  line-height: 1.45;
}

@keyframes tree-in {
  from { opacity: 0; transform: translateX(-7px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes grow-line {
  to { transform: scaleY(1); }
}

.coach-panel {
  display: flex;
  flex-direction: column;
  color: #f8f9f5;
  background: var(--ink);
  border-color: var(--ink);
}

.coach-panel .section-index,
.coach-panel .step-counter {
  color: #aeb5ae;
}

.coach-heading {
  align-items: start;
}

.step-counter {
  font-family: var(--font-serif);
  font-size: 17px;
}

.coach-progress {
  margin: 26px 0 34px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.progress-segment {
  height: 3px;
  background: #424842;
  border-radius: 4px;
  transition: background 220ms ease, transform 220ms ease;
}

.progress-segment.is-complete {
  background: var(--acid);
}

.progress-segment.is-current {
  background: var(--acid);
  transform: scaleY(2);
}

.step-content {
  min-height: 206px;
  animation: step-in 250ms ease;
}

.step-kicker {
  margin: 0 0 12px;
  color: var(--acid);
  font-size: 11px;
  font-weight: 760;
  letter-spacing: 0.12em;
}

.step-content h4 {
  margin: 0 0 17px;
  font-family: var(--font-serif);
  font-size: 29px;
  font-weight: 400;
  line-height: 1.2;
}

.step-content p {
  margin: 0;
  color: #c6cbc5;
  font-size: 14px;
  line-height: 1.75;
}

@keyframes step-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.coach-actions {
  margin-top: auto;
}

.square-button,
.next-button {
  height: 44px;
  color: #f8f9f5;
  background: #292e29;
  border: 1px solid #454b45;
  border-radius: 7px;
}

.square-button {
  width: 44px;
}

.square-button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.next-button {
  flex: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 15px;
  font-size: 13px;
  font-weight: 720;
}

.next-button:hover,
.square-button:hover:not(:disabled) {
  color: var(--acid-dark);
  background: var(--acid);
  border-color: var(--acid);
}

.insight-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 16px;
}

.translation-panel > p {
  margin: 12px 0 24px;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: clamp(20px, 1.8vw, 26px);
  font-weight: 650;
  line-height: 1.65;
}

.translation-meta {
  margin-top: 24px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 780;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.translation-meta span:last-child {
  font-weight: 650;
  letter-spacing: 0.04em;
}

.reading-guide {
  margin: 0 0 22px;
  padding: 14px 16px;
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 12px;
  background: var(--gray-soft);
  border-left: 3px solid var(--green);
}

.reading-guide span {
  color: var(--green);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.reading-guide p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.65;
}

.logic-summary {
  padding-top: 17px;
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 15px;
  border-top: 1px solid var(--line);
}

.logic-summary span {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 720;
}

.logic-summary strong {
  font-size: 13px;
  line-height: 1.5;
}

.language-notes {
  margin-top: 22px;
}

.language-note {
  padding: 18px;
  background: var(--orange-soft);
  border-left: 3px solid var(--orange);
}

.language-note-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 14px;
}

.language-note-heading span {
  color: var(--orange);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.language-note-heading strong {
  font-size: 14px;
}

.language-note p {
  margin: 10px 0 0;
  line-height: 1.6;
}

.language-original {
  color: var(--ink-soft);
  font-family: var(--font-serif);
  font-size: 13px;
  text-decoration: line-through;
  text-decoration-color: var(--orange);
}

.language-suggestion {
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
}

.language-suggestion-translation {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 650;
}

.language-explanation {
  color: var(--ink-soft);
  font-size: 12px;
}

#vocabulary-list {
  margin-top: 18px;
}

.useful-language-description {
  margin: 12px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.65;
}

.upgrade-card {
  padding: 17px 0;
  border-top: 1px solid var(--line);
  opacity: 0;
  transform: translateY(7px);
  animation: chunk-in 360ms ease forwards;
}

.upgrade-card.is-primary {
  grid-column: 1 / -1;
  padding: 22px 24px 24px;
  background: var(--orange-soft);
  border-top: 3px solid var(--orange);
  border-radius: 0 0 8px 8px;
}

.upgrade-changes {
  margin: -2px 0 13px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.upgrade-changes span {
  padding: 4px 7px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.upgrade-meta {
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  color: var(--orange);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.upgrade-original {
  margin: 0 0 6px;
  color: var(--ink-soft);
  font-family: var(--font-serif);
  font-size: 13px;
  line-height: 1.5;
  text-decoration: line-through;
  text-decoration-color: var(--orange);
}

.upgrade-card.is-primary .upgrade-original {
  font-size: 15px;
}

.upgrade-card.is-primary .upgrade-improved {
  font-size: clamp(23px, 2.2vw, 32px);
  line-height: 1.35;
}

.upgrade-improved {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: clamp(17px, 1.4vw, 21px);
  font-weight: 720;
  line-height: 1.45;
}

.upgrade-meaning {
  margin: 7px 0 0;
  color: var(--green);
  font-size: 12px;
  font-weight: 720;
}

.upgrade-note {
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.65;
}

.upgrade-example {
  margin-top: 11px;
  padding: 10px 12px;
  background: var(--gray-soft);
  border-left: 2px solid var(--blue);
}

.upgrade-example span {
  color: var(--blue);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.upgrade-example p {
  margin: 4px 0 0;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 12px;
  line-height: 1.55;
}

body[data-mode="expression"] .sentence-stage,
body[data-mode="expression"] .analysis-grid,
body[data-mode="expression"] .translation-panel,
body[data-mode="expression"] .structure-panel {
  display: none;
}

body[data-mode="expression"] .insight-grid {
  margin-top: 0;
  grid-template-columns: minmax(0, 1fr);
}

body[data-mode="expression"] .vocabulary-panel {
  padding: 32px;
}

body[data-mode="expression"] #vocabulary-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 28px;
}

body[data-mode="expression"] .upgrade-card {
  min-width: 0;
}

body[data-mode="expression"] .lexicon-panel {
  margin-top: 34px;
}

.vocab-item {
  padding: 13px 0;
  display: grid;
  grid-template-columns: minmax(110px, 0.7fr) 1fr;
  gap: 16px;
  border-top: 1px solid var(--line);
}

.vocab-item strong,
.vocab-term-button {
  font-family: var(--font-serif);
  font-size: 16px;
}

.vocab-term-button {
  width: fit-content;
  height: fit-content;
  padding: 0 0 3px;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--ink);
  text-align: left;
}

.vocab-term-button:hover {
  color: var(--blue);
  border-color: var(--blue);
}

.vocab-item p {
  margin: 2px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.5;
}

.empty-vocab {
  margin: 20px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.6;
}

.lexicon-panel {
  margin-top: 54px;
  scroll-margin-top: 92px;
}

.lexicon-heading {
  margin-bottom: 20px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
}

.lexicon-heading h2 {
  margin: 7px 0 0;
  font-family: var(--font-serif);
  font-size: 46px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.lexicon-heading > p {
  max-width: 410px;
  margin: 0 0 5px;
  color: var(--ink-soft);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.6;
  text-align: right;
}

.lexicon-grid {
  display: grid;
  grid-template-columns: minmax(245px, 0.58fr) minmax(0, 1.62fr);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.lookup-rail {
  padding: 32px;
  background: #edf0ea;
  border-right: 1px solid var(--line);
}

.dictionary-form > label,
.lookup-history-heading > span {
  display: block;
  margin-bottom: 10px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.search-control {
  display: grid;
  grid-template-columns: 1fr 43px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  overflow: hidden;
}

.search-control:focus-within {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(40, 103, 216, 0.14);
}

.search-control input {
  width: 100%;
  min-width: 0;
  padding: 14px 15px;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 17px;
  font-weight: 650;
}

.search-control button {
  color: var(--acid-dark);
  background: var(--acid);
  border: 0;
  border-left: 1px solid var(--line-strong);
  font-size: 18px;
}

.search-control button:hover {
  color: var(--surface);
  background: var(--ink);
}

.pronunciation-preference {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  color: var(--ink);
  cursor: pointer;
}

.pronunciation-preference-copy {
  display: grid;
  gap: 2px;
  text-align: right;
}

.pronunciation-preference strong {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.pronunciation-preference small {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 650;
}

.pronunciation-preference input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.pronunciation-preference i {
  width: 38px;
  height: 22px;
  padding: 3px;
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  background: #d7dbd3;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  transition: background-color 180ms ease, border-color 180ms ease;
}

.pronunciation-preference i b {
  width: 14px;
  height: 14px;
  display: block;
  background: var(--surface);
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(18, 23, 20, 0.22);
  transition: transform 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.pronunciation-preference input:checked + i {
  background: var(--acid);
  border-color: var(--acid-dark);
}

.pronunciation-preference input:checked + i b {
  transform: translateX(16px);
}

.pronunciation-preference input:focus-visible + i {
  outline: 3px solid rgba(40, 103, 216, 0.22);
  outline-offset: 2px;
}

.quick-terms {
  margin-top: 30px;
}

#lookup-history {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.lookup-history-heading {
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.lookup-history-heading > span {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.lookup-history-heading button {
  padding: 2px 0;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  font-size: 10px;
  font-weight: 700;
}

.lookup-history-heading button:hover:not(:disabled) {
  color: var(--ink);
  border-color: var(--ink);
}

.lookup-history-heading button:disabled {
  opacity: 0.35;
  cursor: default;
}

.history-empty {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.6;
}

.quick-term {
  padding: 8px 10px;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 600;
  text-align: left;
}

.quick-term:hover {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--ink);
}

.lookup-tip {
  margin-top: 34px;
  padding-top: 18px;
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 8px;
  border-top: 1px solid var(--line-strong);
}

.lookup-tip > span {
  color: var(--blue);
  font-family: var(--font-serif);
  font-size: 19px;
}

.lookup-tip p {
  margin: 2px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.6;
}

.dictionary-result {
  min-height: 440px;
  padding: 40px 44px;
  transition: opacity 180ms ease;
}

.dictionary-result.is-loading {
  opacity: 0.44;
}

.dictionary-empty {
  min-height: 500px;
  display: grid;
  place-content: center;
  text-align: center;
}

.dictionary-empty span {
  font-size: 10px;
  font-weight: 780;
  letter-spacing: 0.14em;
}

.dictionary-empty p {
  color: var(--ink-soft);
  font-family: var(--font-serif);
}

.entry-header {
  padding-bottom: 20px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
}

.entry-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.entry-tags span {
  padding: 4px 7px;
  color: var(--ink-soft);
  background: var(--gray-soft);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.entry-identity h3 {
  margin: 9px 0 5px;
  font-family: var(--font-serif);
  font-size: clamp(42px, 4.5vw, 60px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.035em;
}

.meaning-overview {
  padding: 19px 0 21px;
  display: grid;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}

.meaning-overview-label {
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.meaning-overview-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.meaning-overview-row {
  min-width: min(100%, 250px);
  padding: 11px 13px;
  display: flex;
  gap: 10px;
  align-items: center;
  background: #f3f5f0;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.meaning-overview-pos {
  min-width: 36px;
  padding: 3px 5px;
  color: var(--green);
  background: var(--surface);
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
  text-align: center;
}

.meaning-overview-row strong {
  font-size: clamp(15px, 1.2vw, 18px);
  font-weight: 800;
  line-height: 1.45;
}

.entry-details {
  border-bottom: 1px solid var(--line);
}

.entry-details-summary {
  padding: 17px 2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  list-style: none;
}

.entry-details-summary::-webkit-details-marker {
  display: none;
}

.entry-details-summary::after {
  color: var(--ink);
  content: "＋";
  font-size: 17px;
  font-weight: 500;
  transition: transform 180ms ease;
}

.entry-details[open] .entry-details-summary::after {
  transform: rotate(45deg);
}

.entry-details[open] .entry-details-summary {
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}

.entry-details-body {
  animation: details-in 220ms ease;
}

@keyframes details-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.reverse-source {
  margin: 12px 0 -4px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 750;
}

.phonetics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  color: var(--ink-soft);
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 600;
}

.audio-controls {
  display: flex;
  gap: 8px;
}

.entry-audio-panel {
  display: grid;
  justify-items: end;
  gap: 12px;
  flex: 0 0 auto;
}

.audio-button {
  min-width: 82px;
  padding: 11px 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  font-size: 13px;
  font-weight: 800;
}

.audio-button:hover,
.audio-button.is-playing {
  background: var(--acid);
  border-color: var(--ink);
}

.audio-symbol {
  font-size: 18px;
  transform: rotate(180deg);
}

.sense-list {
  padding: 14px 0;
}

.sense-row {
  padding: 20px 0;
  display: grid;
  grid-template-columns: 38px 88px 1fr;
  gap: 10px;
  align-items: baseline;
  border-bottom: 1px solid var(--line);
}

.sense-index,
.sense-pos {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 750;
}

.sense-definition strong {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.45;
}

.sense-context {
  margin: 5px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.55;
}

.reverse-lookup-button {
  margin-top: 9px;
  padding: 0 0 2px;
  color: var(--blue);
  background: transparent;
  border: 0;
  border-bottom: 1px solid currentColor;
  font-size: 11px;
  font-weight: 800;
}

.reverse-lookup-button:hover {
  color: var(--ink);
}

.dictionary-detail-grid.is-reverse {
  grid-template-columns: 1fr;
}

.sense-example-inline {
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--gray-soft);
  border-left: 2px solid var(--blue);
}

.sense-example-inline > span {
  color: var(--blue);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.sense-example-inline p {
  margin: 4px 0 0;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 650;
  line-height: 1.55;
}

.sense-example-inline small,
.sense-example-empty {
  display: block;
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.55;
}

.sense-example-empty {
  margin-bottom: 0;
}

.usage-note {
  margin: 6px 0 26px;
  padding: 15px 17px;
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 14px;
  background: #f1f8e4;
  border-left: 3px solid var(--acid-dark);
}

.usage-note span {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.usage-note p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.65;
}

.dictionary-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.dictionary-info-block h4,
.example-block h4 {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.dictionary-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.dictionary-pill {
  padding: 7px 9px;
  color: var(--ink-soft);
  background: var(--gray-soft);
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
}

.example-block {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.dictionary-example p {
  margin: 0 0 6px;
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.55;
}

.dictionary-example > span,
.dictionary-muted {
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
}

.suggestion-row {
  margin-top: 24px;
  padding-top: 17px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  border-top: 1px solid var(--line);
}

.suggestion-row > span {
  margin-right: 4px;
  color: var(--ink-soft);
  font-size: 10px;
}

.suggestion-row button {
  padding: 4px 0;
  color: var(--blue);
  background: transparent;
  border: 0;
  border-bottom: 1px solid currentColor;
  font-family: var(--font-serif);
  font-size: 12px;
}

.not-found-note {
  margin: 0 0 20px;
  padding: 10px 12px;
  color: #7b3e1f;
  background: var(--orange-soft);
  border-left: 3px solid var(--orange);
  font-size: 11px;
}

.dictionary-source {
  margin-top: 24px;
  padding-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px 14px;
  color: var(--ink-soft);
  border-top: 1px solid var(--line);
  font-size: 12px;
  font-weight: 650;
}

.dictionary-source a {
  color: var(--blue);
  text-underline-offset: 3px;
}

.dictionary-source strong {
  color: var(--ink);
}

.site-footer {
  padding: 24px 0 34px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 20px;
  color: var(--ink-soft);
  border-top: 1px solid var(--line);
  font-size: 10px;
  font-weight: 720;
  letter-spacing: 0.1em;
}

.creator-credit {
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 13px;
  font-style: italic;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.site-footer p {
  margin: 0;
}

.loading-line {
  padding: 70px;
  display: flex;
  justify-content: center;
  gap: 8px;
}

.loading-line span {
  width: 8px;
  height: 8px;
  background: var(--ink);
  border-radius: 50%;
  animation: loading 800ms ease-in-out infinite alternate;
}

.loading-line span:nth-child(2) { animation-delay: 140ms; }
.loading-line span:nth-child(3) { animation-delay: 280ms; }

@keyframes loading {
  to { transform: translateY(-8px); background: var(--acid); }
}

@media (max-width: 880px) {
  .analysis-grid,
  .insight-grid,
  .lexicon-grid {
    grid-template-columns: 1fr;
  }

  .lookup-rail {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .dictionary-detail-grid {
    grid-template-columns: 1fr 1fr;
  }

  .intro-grid {
    gap: 28px;
  }

  .intro-status {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .intro-copy {
    max-width: 600px;
  }

  .method-widget {
    max-width: 620px;
  }

  body[data-mode="expression"] #vocabulary-list {
    grid-template-columns: 1fr;
  }

  .coach-panel {
    min-height: 390px;
  }

  .step-content {
    min-height: 160px;
  }
}

@media (max-width: 620px) {
  body {
    padding-right: env(safe-area-inset-right);
    padding-bottom: calc(76px + env(safe-area-inset-bottom));
    padding-left: env(safe-area-inset-left);
  }

  #method,
  #workspace,
  #practice,
  #lexicon {
    scroll-margin-top: 14px;
  }

  .nav-links {
    display: none;
  }

  .shell,
  .nav-shell {
    width: min(100% - 28px, 1220px);
  }

  .site-header {
    position: static;
    padding-top: env(safe-area-inset-top);
  }

  html.iphone-preview .site-header {
    padding-top: 47px;
  }

  html.iphone-preview body {
    padding-bottom: 94px;
  }

  .nav-shell {
    height: 62px;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
  }

  .header-now {
    min-width: 0;
  }

  .header-now time {
    font-size: 14px;
    font-weight: 900;
  }

  .mobile-nav {
    position: fixed;
    z-index: 40;
    right: env(safe-area-inset-right);
    bottom: 0;
    left: env(safe-area-inset-left);
    min-height: 64px;
    padding: 6px 10px calc(6px + env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    background: rgba(243, 242, 236, 0.96);
    border-top: 1px solid var(--line-strong);
    box-shadow: 0 -10px 30px rgba(20, 24, 22, 0.08);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
  }

  html.iphone-preview .mobile-nav {
    padding-bottom: 18px;
  }

  .mobile-nav a {
    min-height: 50px;
    display: grid;
    place-content: center;
    gap: 2px;
    color: var(--ink-soft);
    border-radius: 9px;
    font-size: 11px;
    font-weight: 800;
    text-align: center;
    text-decoration: none;
  }

  .mobile-nav a span {
    color: #858b85;
    font-size: 8px;
    letter-spacing: 0.08em;
  }

  .mobile-nav a.active {
    color: var(--ink);
    background: var(--surface);
    box-shadow: 0 2px 10px rgba(20, 24, 22, 0.08);
  }

  .mobile-nav a.active span {
    color: var(--green);
  }

  .study-streak {
    width: 100%;
    min-height: 44px;
    justify-content: flex-start;
    padding-inline: 12px;
    font-size: 11px;
    letter-spacing: 0.02em;
    white-space: nowrap;
  }

  .study-streak i {
    margin-left: auto;
  }

  .countdown-copy strong {
    font-family: var(--font-serif);
    font-size: 19px;
    font-weight: 800;
  }

  .study-streak i {
    display: none;
  }

  .intro {
    padding: 28px 0 26px;
  }

  .intro-grid {
    grid-template-columns: 1fr;
  }

  .intro-status {
    margin-bottom: 26px;
    padding-bottom: 14px;
    gap: 10px;
  }

  .intro-status .header-exam-setting {
    width: 100%;
  }

  .exam-date-control input {
    width: 100%;
    min-height: 30px;
    font-size: 16px;
  }

  .header-date-popover {
    position: fixed;
    top: auto;
    right: 14px;
    bottom: calc(76px + env(safe-area-inset-bottom));
    left: 14px;
    width: auto;
    padding: 18px;
    border-radius: 14px;
    box-shadow: 0 18px 60px rgba(19, 23, 20, 0.24);
  }

  .motto-caption {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .intro h1 {
    font-size: clamp(39px, 12.5vw, 54px);
  }

  .motto-caption {
    margin-top: 14px;
  }

  .intro-grid {
    gap: 22px;
  }

  .intro-grid.method-is-collapsed {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .method-slot:has(.method-restore-button:not([hidden])) {
    justify-self: start;
  }

  .method-widget {
    min-height: 174px;
    padding: 14px;
    border-radius: 12px;
    box-shadow: 5px 5px 0 rgba(199, 243, 107, 0.72);
  }

  .method-collapse-button {
    top: 8px;
    left: 8px;
    width: 34px;
    height: 34px;
  }

  .method-widget-heading > div {
    padding-left: 30px;
  }

  .method-widget h2 {
    font-size: 17px;
  }

  .method-widget .coach-progress {
    margin: 10px 0 11px;
  }

  .method-widget .step-content {
    min-height: 59px;
  }

  .method-widget .step-content h4 {
    margin-bottom: 4px;
    font-size: 16px;
  }

  .method-widget .step-content p {
    font-size: 9px;
    line-height: 1.4;
  }

  .input-panel,
  .sentence-stage,
  .structure-panel,
  .coach-panel,
  .translation-panel,
  .vocabulary-panel {
    padding: 16px;
  }

  .panel-heading h2,
  .content-heading h3,
  .insight-grid h3 {
    font-size: 20px;
  }

  .panel-heading,
  .stage-toolbar,
  .result-header,
  .lexicon-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .panel-controls {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }

  .mode-switch,
  .mode-button {
    width: 100%;
  }

  .example-picker {
    width: 100%;
  }

  .example-picker select {
    flex: 1;
    min-width: 0;
    min-height: 44px;
    font-size: 16px;
  }

  .image-input-tools {
    align-items: flex-start;
    flex-direction: column;
    gap: 9px;
    margin-top: 16px;
    padding-top: 13px;
  }

  textarea {
    min-height: 122px;
    margin-top: 8px;
    padding: 12px 0;
    font-size: 17px;
    line-height: 1.45;
  }

  .input-footer {
    align-items: flex-end;
    flex-wrap: wrap;
  }

  .image-upload-button,
  .primary-button,
  .text-button {
    min-height: 44px;
  }

  .result-area {
    margin-top: 34px;
  }

  .result-header {
    margin-bottom: 13px;
    gap: 12px;
  }

  .result-header h2 {
    font-size: 30px;
  }

  .result-stats {
    width: 100%;
  }

  .stat {
    min-width: 0;
    padding: 7px 9px;
    flex: 1;
  }

  .stat strong {
    font-size: 17px;
  }

  .legend {
    justify-content: flex-start;
    gap: 6px 10px;
    font-size: 10px;
  }

  .stage-toolbar {
    gap: 10px;
  }

  .toolbar-hint {
    margin-top: 3px;
    font-size: 10px;
  }

  .sentence-canvas {
    min-height: 0;
    padding: 20px 0 16px;
    gap: 6px 3px;
  }

  .chunk {
    padding: 4px 5px 5px;
    border-bottom-width: 2px;
    font-size: 16.5px;
    line-height: 1.2;
  }

  .relation-layer {
    display: none;
  }

  .chunk.kind-modifier::before {
    content: "↳";
    margin-right: 5px;
    color: #777d78;
    font-family: var(--font-sans);
    font-size: 0.72em;
  }

  .chunk.has-boundary {
    margin-right: 11px;
  }

  .chunk.has-boundary::after {
    right: -10px;
    bottom: 5px;
  }

  .chunk-inspector,
  .tree-node,
  .logic-summary,
  .reading-guide,
  .vocab-item {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .chunk-inspector {
    min-height: 0;
    padding: 11px 12px;
  }

  .inspector-type {
    font-size: 9px;
  }

  .chunk-inspector p {
    font-size: 11px;
    line-height: 1.5;
  }

  .inspector-action {
    width: fit-content;
  }

  .lexicon-heading > p {
    text-align: left;
  }

  .dictionary-result {
    min-height: 0;
    padding: 25px 20px;
  }

  .analysis-grid,
  .insight-grid {
    gap: 10px;
    margin-top: 10px;
  }

  .translation-panel > p {
    margin: 9px 0 16px;
    font-size: 17px;
    line-height: 1.55;
  }

  .translation-meta {
    margin-top: 16px;
  }

  .tree {
    margin-top: 17px;
  }

  .tree-node {
    margin: 5px 0;
    padding: 8px 9px;
  }

  body[data-mode="expression"] .vocabulary-panel {
    padding: 16px;
  }

  body[data-mode="expression"] #vocabulary-list {
    margin-top: 12px;
    display: block;
  }

  .upgrade-card,
  .upgrade-card.is-primary {
    padding: 14px 0;
  }

  .upgrade-card.is-primary {
    padding-inline: 14px;
    border-top-width: 2px;
  }

  .upgrade-card.is-primary .upgrade-original {
    font-size: 12px;
  }

  .upgrade-card.is-primary .upgrade-improved,
  .upgrade-improved {
    font-size: 16px;
    line-height: 1.35;
  }

  .upgrade-note {
    font-size: 10px;
    line-height: 1.55;
  }

  .upgrade-example {
    margin-top: 8px;
    padding: 8px 10px;
  }

  .entry-identity {
    min-width: 0;
    max-width: 100%;
  }

  .entry-identity h3,
  .sense-definition,
  .dictionary-source {
    overflow-wrap: anywhere;
  }

  .entry-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .entry-audio-panel {
    width: 100%;
    justify-items: end;
  }

  .audio-controls {
    max-width: 100%;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .dictionary-detail-grid,
  .sense-row,
  .usage-note {
    grid-template-columns: 1fr;
  }

  .sense-row {
    gap: 5px;
  }

  .tree-list ul {
    margin-left: 8px;
    padding-left: 18px;
  }

  .tree-list ul > li > .tree-node::before {
    left: -20px;
    width: 17px;
  }

  .site-footer {
    flex-direction: column;
    padding-bottom: 28px;
  }
}

@media (max-width: 390px) {
  .brand {
    gap: 7px;
    font-size: 11px;
    letter-spacing: 0.12em;
  }

  .brand-mark {
    width: 26px;
    height: 26px;
  }

  .study-streak {
    font-size: 10px;
  }

  .streak-dot {
    width: 7px;
    height: 7px;
  }

  .intro h1 {
    font-size: clamp(38px, 12vw, 49px);
  }

  .result-stats {
    overflow-x: auto;
  }

  .stat {
    min-width: 92px;
  }
}

@media (pointer: coarse) {
  button,
  summary,
  select,
  .dictionary-pill,
  .suggestion-row button {
    min-height: 44px;
  }

  button,
  a,
  summary,
  label {
    -webkit-tap-highlight-color: rgba(199, 243, 107, 0.28);
  }

  .method-collapse-button {
    min-height: 34px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
