:root {
  --ink: #07383e;
  --ink-soft: #567075;
  --teal: #087f83;
  --teal-dark: #064f54;
  --mint: #e6f3ef;
  --mint-deep: #cbe5de;
  --coral: #ed735c;
  --gold: #d79a31;
  --paper: #f7f6f0;
  --white: #fffefa;
  --line: #dce6e2;
  --shadow: 0 18px 55px rgba(22, 57, 55, .08);
  --radius: 24px;
  --serif: Georgia, "Times New Roman", "Noto Serif SC", serif;
  --sans: Inter, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--paper);
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 7% 16%, rgba(226, 192, 107, .12), transparent 21rem),
    radial-gradient(circle at 94% 35%, rgba(63, 157, 147, .12), transparent 24rem),
    var(--paper);
  font-family: var(--sans);
  line-height: 1.5;
}

button, input { font: inherit; }

button { color: inherit; }

.skip-link {
  position: fixed;
  z-index: 100;
  left: 1rem;
  top: -4rem;
  padding: .7rem 1rem;
  color: white;
  background: var(--teal-dark);
  border-radius: .7rem;
}

.skip-link:focus { top: 1rem; }

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 78px;
  padding: .75rem max(4vw, 1.2rem);
  background: rgba(247, 246, 240, .88);
  border-bottom: 1px solid rgba(7, 56, 62, .08);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  gap: .8rem;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
}

.brand strong {
  display: block;
  font-family: var(--serif);
  font-size: 1.45rem;
  line-height: 1;
}

.brand small {
  display: block;
  margin-top: .28rem;
  color: #708488;
  font-size: .56rem;
  font-weight: 800;
  letter-spacing: .17em;
}

.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  overflow: hidden;
  background: var(--teal-dark);
  border-radius: 50%;
}

.brand-mark::after {
  position: absolute;
  width: 15px;
  height: 15px;
  content: "";
  border: 2px solid #fff;
  border-radius: 50%;
}

.brand-mark i {
  position: absolute;
  width: 2px;
  height: 18px;
  background: #d1eee8;
  border-radius: 99px;
}

.brand-mark i:nth-child(1) { transform: translate(-10px, -7px) rotate(-24deg); }
.brand-mark i:nth-child(2) { transform: translate(10px, -7px) rotate(24deg); }
.brand-mark i:nth-child(3) { transform: translateY(10px); }

.topbar nav { display: flex; gap: .4rem; }

.text-button {
  padding: .55rem .8rem;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  border-radius: .7rem;
  cursor: pointer;
  text-decoration: none;
}

.text-button:hover, .text-button:focus-visible { background: var(--mint); color: var(--ink); }

main {
  width: min(1500px, 94vw);
  margin: 0 auto;
  padding-bottom: 5rem;
}

.hero {
  display: grid;
  grid-template-columns: minmax(320px, .85fr) minmax(440px, 1.15fr);
  gap: clamp(2rem, 6vw, 7rem);
  align-items: end;
  padding: clamp(3rem, 7vw, 7rem) clamp(.2rem, 3vw, 3rem) clamp(3rem, 5vw, 5rem);
}

.eyebrow {
  display: block;
  margin-bottom: .55rem;
  color: var(--teal);
  font-size: .68rem;
  font-weight: 850;
  letter-spacing: .18em;
}

.hero h1 {
  max-width: 13ch;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.8rem, 5.3vw, 5.5rem);
  font-weight: 500;
  letter-spacing: -.045em;
  line-height: 1.03;
}

.hero h1 em { color: var(--coral); font-style: normal; }

.hero-copy p {
  max-width: 35rem;
  margin: 1.5rem 0 0;
  color: var(--ink-soft);
  font-size: 1.05rem;
}

.search-shell {
  position: relative;
  padding: clamp(1.4rem, 3vw, 2.2rem);
  background: var(--white);
  border: 1px solid rgba(7, 56, 62, .1);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.search-shell > label {
  display: block;
  margin-bottom: .85rem;
  color: var(--ink);
  font-weight: 750;
}

.search-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: .7rem;
  align-items: center;
  min-height: 64px;
  padding: 0 1rem;
  background: #f1f6f3;
  border: 2px solid transparent;
  border-radius: 16px;
}

.search-row:focus-within {
  background: white;
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(8, 127, 131, .1);
}

.search-icon { color: var(--teal); font-size: 2rem; transform: rotate(-20deg); }

.search-row input {
  width: 100%;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 1.1rem;
}

kbd {
  padding: .25rem .45rem;
  color: #758b8d;
  background: white;
  border: 1px solid #d9e1de;
  border-radius: .4rem;
  box-shadow: 0 2px 0 #d6dfdc;
  font-size: .7rem;
}

.search-note {
  margin: .8rem .2rem 0;
  color: #7a8d8d;
  font-size: .78rem;
}

.search-note span { color: var(--coral); }

.search-results {
  position: absolute;
  z-index: 30;
  top: calc(100% - 1.9rem);
  right: 1.4rem;
  left: 1.4rem;
  max-height: 320px;
  overflow: auto;
  padding: .5rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(7, 56, 62, .18);
}

.search-result {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .6rem;
  width: 100%;
  padding: .7rem .8rem;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: .7rem;
  cursor: pointer;
}

.search-result:hover, .search-result.active { background: var(--mint); }
.search-result strong { font-family: var(--serif); font-size: 1.05rem; }
.search-result small { display: block; color: var(--ink-soft); }
.search-result .result-exam { color: var(--teal); font-size: .7rem; font-weight: 750; }

.workspace {
  display: grid;
  grid-template-columns: minmax(280px, 350px) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

.word-column {
  position: sticky;
  top: 94px;
  display: grid;
  gap: 1.1rem;
}

.graph-column { display: grid; gap: 1.1rem; min-width: 0; }

.card {
  background: rgba(255, 254, 250, .95);
  border: 1px solid rgba(7, 56, 62, .1);
  border-radius: var(--radius);
  box-shadow: 0 12px 36px rgba(20, 53, 52, .045);
}

.word-card { padding: 1.5rem; overflow: hidden; }

.word-card::before {
  display: block;
  width: 64px;
  height: 5px;
  margin: -1.5rem 0 1.35rem;
  content: "";
  background: linear-gradient(90deg, var(--teal), var(--coral));
  border-radius: 0 0 99px 99px;
}

.word-card-top {
  display: flex;
  gap: 1rem;
  align-items: start;
  justify-content: space-between;
}

.word-card h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.6rem, 4.5vw, 4rem);
  font-weight: 500;
  letter-spacing: -.04em;
  line-height: 1;
  overflow-wrap: anywhere;
}

.word-meaning {
  min-height: 1.5rem;
  margin: .7rem 0 0;
  color: var(--ink-soft);
}

.sound-button {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  color: var(--teal-dark);
  background: var(--mint);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

.sound-button:hover { transform: scale(1.05); background: var(--mint-deep); }

.pronunciation {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem 1rem;
  margin-top: 1.2rem;
  color: #738a8d;
  font-size: .78rem;
}

.tag-row { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: 1rem; }

.tag {
  padding: .28rem .55rem;
  color: var(--teal-dark);
  background: var(--mint);
  border: 1px solid #cee5df;
  border-radius: 99px;
  font-size: .68rem;
  font-weight: 750;
}

.frequency {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: .65rem;
  align-items: center;
  margin-top: 1.35rem;
  color: #75878a;
  font-size: .72rem;
}

.frequency-track {
  height: 5px;
  overflow: hidden;
  background: #e2e8e5;
  border-radius: 99px;
}

.frequency-track i {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--teal), #5db3a7);
  border-radius: inherit;
  transition: width .45s ease;
}

.morpheme-card, .etymology-card, .evidence-card { padding: 1.25rem; }

.section-heading {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
}

.section-heading h2, .section-heading h3 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
}

.section-heading h3 { font-size: 1.35rem; }

.verification-pill {
  padding: .28rem .55rem;
  color: #47726d;
  background: #eff5f2;
  border-radius: 99px;
  font-size: .62rem;
}

.verification-pill[data-mode="historical"] {
  color: #855c17;
  background: #fff3d8;
}

.verification-pill[data-mode="historical_components"] {
  color: #855c17;
  background: #fff3d8;
}

.verification-pill[data-mode="whole_word_base"],
.verification-pill[data-mode="abbreviation"] {
  color: #53646a;
  background: #eef2f2;
}

.verification-pill[data-mode="phrase_composition"] {
  color: #276d53;
  background: #e8f6ee;
}

.morpheme-summary {
  margin-top: 1rem;
  padding: .85rem .9rem;
  color: var(--teal-dark);
  background: linear-gradient(135deg, #e9f6f2, #fff8e9);
  border: 1px solid #d1e8df;
  border-radius: .85rem;
  font-size: .78rem;
  font-weight: 700;
  line-height: 1.65;
}

.morpheme-parts {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin: 1rem 0;
}

.morpheme-part {
  position: relative;
  padding: .55rem .7rem;
  color: var(--teal-dark);
  background: #edf7f4;
  border: 1px solid #cce5de;
  border-radius: .7rem;
  cursor: pointer;
  text-align: left;
}

.morpheme-part span,
.morpheme-part small {
  display: block;
}

.morpheme-part span {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 700;
}

.morpheme-part small {
  margin-top: .08rem;
  opacity: .68;
  font-size: .56rem;
}

.morpheme-part[data-ready="false"] {
  color: #8b7a60;
  background: #f7f1e7;
  border-color: #eadbc0;
}

.morpheme-part:hover, .morpheme-part.selected {
  color: white;
  background: var(--teal-dark);
  border-color: var(--teal-dark);
}

.morpheme-detail, .relation-detail {
  min-height: 90px;
  padding: .9rem;
  color: var(--ink-soft);
  background: #f4f7f4;
  border-radius: .9rem;
  font-size: .78rem;
}

.morpheme-detail strong, .relation-detail strong {
  color: var(--ink);
  font-size: .92rem;
}

.morpheme-detail-title {
  display: flex;
  gap: .5rem;
  align-items: center;
}

.morpheme-detail-title span {
  padding: .12rem .38rem;
  color: #47726d;
  background: #e5f2ee;
  border-radius: 99px;
  font-size: .58rem;
  font-weight: 700;
}

.morpheme-meaning {
  margin: .55rem 0;
  color: var(--ink);
  font-size: .88rem;
  font-weight: 650;
}

.morpheme-meaning small {
  display: block;
  margin-top: .16rem;
  color: var(--ink-soft);
  font-size: .68rem;
  font-weight: 500;
}

.morpheme-history,
.morpheme-family,
.morpheme-evidence {
  margin-top: .62rem;
}

.morpheme-history b,
.morpheme-family b,
.morpheme-evidence b {
  margin-right: .42rem;
  color: var(--ink);
  font-size: .68rem;
}

.morpheme-family span,
.morpheme-evidence span {
  display: inline-block;
  margin: .16rem .22rem .05rem 0;
  padding: .14rem .35rem;
  color: #557173;
  background: white;
  border: 1px solid #dbe7e2;
  border-radius: .38rem;
  font-size: .62rem;
}

.morpheme-reference {
  display: inline-block;
  margin-top: .72rem;
  color: var(--teal);
  font-size: .68rem;
  font-weight: 700;
  text-decoration: none;
}

.morpheme-reference:hover { text-decoration: underline; }

.etymology-card h4 {
  margin: 1rem 0 .75rem;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.06rem;
  line-height: 1.35;
}

.etymology-chain {
  display: flex;
  flex-wrap: wrap;
  gap: .42rem;
  align-items: stretch;
  margin-bottom: .8rem;
}

.etymology-stage {
  flex: 1 1 118px;
  min-width: 0;
  padding: .66rem .7rem;
  background: #f7f2e7;
  border: 1px solid #ead8b8;
  border-radius: .78rem;
}

.etymology-stage[data-kind="origin"] {
  background: #fff0d5;
  border-color: #e7bf79;
}

.etymology-stage[data-kind="english"] {
  background: #e9f5f1;
  border-color: #c6e3da;
}

.etymology-stage strong,
.etymology-stage small {
  display: block;
}

.etymology-stage strong {
  color: var(--ink);
  font-family: var(--serif);
  font-size: .9rem;
}

.etymology-stage small {
  margin-top: .18rem;
  color: #6c7876;
  font-size: .6rem;
  line-height: 1.4;
}

.etymology-arrow {
  align-self: center;
  color: var(--gold);
  font-weight: 900;
}

.etymology-path {
  margin: .7rem 0;
  padding: .72rem .78rem;
  color: #684d1e;
  background: #fff7e9;
  border-left: 3px solid var(--gold);
  border-radius: .3rem .7rem .7rem .3rem;
  font-size: .72rem;
  font-weight: 700;
  line-height: 1.65;
}

.etymology-explanation,
.etymology-note {
  margin-top: .75rem;
  padding: .78rem;
  color: var(--ink-soft);
  background: #f5f7f4;
  border-radius: .75rem;
  font-size: .7rem;
}

.etymology-note {
  background: #eef7f4;
  border: 1px solid #d3e9e2;
}

.etymology-explanation strong,
.etymology-note strong {
  color: var(--ink);
}

.etymology-explanation p,
.etymology-note p {
  margin: .35rem 0 0;
}

.etymology-sources {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin-top: .75rem;
}

.etymology-sources a {
  padding: .26rem .42rem;
  color: var(--teal);
  background: white;
  border: 1px solid #dbe7e2;
  border-radius: .4rem;
  font-size: .61rem;
  font-weight: 700;
  text-decoration: none;
}

.etymology-sources a:hover { text-decoration: underline; }

.morpheme-meta, .relation-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin-top: .7rem;
}

.morpheme-meta span, .relation-meta span {
  padding: .18rem .4rem;
  color: #597173;
  background: white;
  border: 1px solid #dbe7e2;
  border-radius: .4rem;
  font-size: .64rem;
}

.graph-card { overflow: hidden; }

.graph-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.3rem 1.5rem .9rem;
}

.graph-header h2 { margin: 0; font-family: var(--serif); font-weight: 500; }

.graph-actions { display: flex; gap: .45rem; }

.graph-actions button {
  padding: .45rem .65rem;
  color: var(--ink-soft);
  background: #f2f5f3;
  border: 1px solid var(--line);
  border-radius: .6rem;
  cursor: pointer;
  font-size: .72rem;
}

.sense-section, .layer-section {
  padding: .8rem 1.5rem;
  border-top: 1px solid #e8eeeb;
}

.filter-title {
  display: block;
  margin-bottom: .55rem;
  color: #738587;
  font-size: .67rem;
  font-weight: 750;
  letter-spacing: .06em;
}

.sense-tabs, .layer-filters {
  display: flex;
  flex-wrap: wrap;
  gap: .42rem;
}

.sense-tab, .layer-filter {
  padding: .45rem .7rem;
  color: var(--ink-soft);
  background: white;
  border: 1px solid #dbe5e1;
  border-radius: 99px;
  cursor: pointer;
  font-size: .72rem;
  transition: .2s ease;
}

.sense-tab:hover, .sense-tab[aria-selected="true"] {
  color: white;
  background: var(--teal-dark);
  border-color: var(--teal-dark);
}

.layer-filter {
  --layer-color: var(--teal);
  display: inline-flex;
  gap: .4rem;
  align-items: center;
}

.layer-filter::before {
  width: .5rem;
  height: .5rem;
  content: "";
  background: var(--layer-color);
  border-radius: 50%;
}

.layer-filter.active {
  color: var(--ink);
  background: color-mix(in srgb, var(--layer-color) 11%, white);
  border-color: color-mix(in srgb, var(--layer-color) 35%, white);
}

.layer-filter:not(.active) { opacity: .45; }

.structure-legend {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  margin-top: .65rem;
  padding: .55rem .65rem;
  color: #647779;
  background: #f7f8f5;
  border-radius: .65rem;
  font-size: .62rem;
}

.structure-legend[hidden] { display: none; }

.structure-legend span {
  display: inline-flex;
  gap: .28rem;
  align-items: center;
}

.structure-legend i {
  width: .62rem;
  height: .62rem;
  background: #8a61c5;
  border-radius: 50%;
}

.structure-legend i[data-kind="prefix"] { background: #ed735c; border-radius: .2rem; }
.structure-legend i[data-kind="root"] { background: #8a61c5; }
.structure-legend i[data-kind="suffix"] { background: #4775d1; border-radius: .2rem; }
.structure-legend i[data-kind="whole"] {
  background: #3f8f82;
  border: 1px dashed #cfe9e2;
}
.structure-legend i[data-kind="phrase"] {
  background: #37906b;
  border-radius: .2rem;
}
.structure-legend i[data-kind="historical"] {
  background: #d79a31;
  border-radius: 0;
  transform: rotate(45deg);
}
.structure-legend i[data-kind="origin"] {
  background: #b8751d;
  border: 2px solid #ffe1b5;
}

.sense-definition {
  min-height: 1.35rem;
  margin: .65rem 0 0;
  color: #6c7f81;
  font-size: .78rem;
}

.graph-stage {
  position: relative;
  min-height: 680px;
  overflow: hidden;
  background:
    radial-gradient(circle at center, rgba(209, 237, 229, .55), transparent 37%),
    linear-gradient(rgba(7, 79, 84, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(7, 79, 84, .035) 1px, transparent 1px),
    #fbfcf8;
  background-size: auto, 38px 38px, 38px 38px, auto;
  border-top: 1px solid #e6ece9;
}

#graph {
  position: absolute;
  inset: 0;
  min-height: 680px;
}

.graph-tooltip {
  position: absolute;
  z-index: 8;
  width: max-content;
  max-width: min(260px, calc(100% - 24px));
  padding: .72rem .8rem;
  color: #f8fffd;
  background: rgba(5, 65, 69, .96);
  border: 1px solid rgba(203, 235, 227, .42);
  border-radius: .78rem;
  box-shadow: 0 14px 35px rgba(4, 51, 54, .2);
  pointer-events: none;
  transform-origin: top left;
  backdrop-filter: blur(10px);
}

.graph-tooltip[hidden] { display: none; }

.graph-tooltip strong,
.graph-tooltip span,
.graph-tooltip small {
  display: block;
}

.graph-tooltip strong {
  font-family: var(--serif);
  font-size: 1.03rem;
  line-height: 1.2;
}

.graph-tooltip span {
  margin-top: .3rem;
  color: #d9f1eb;
  font-size: .72rem;
  line-height: 1.55;
}

.graph-tooltip small {
  margin-top: .32rem;
  color: #9bc9c1;
  font-size: .58rem;
  letter-spacing: .035em;
}

.graph-loading {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  gap: .7rem;
  place-content: center;
  color: var(--ink-soft);
  background: rgba(251, 252, 248, .87);
  text-align: center;
}

.graph-loading[hidden] { display: none; }

.graph-loading span {
  width: 34px;
  height: 34px;
  margin: 0 auto;
  border: 3px solid #d6e8e3;
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.graph-hint {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  z-index: 3;
  padding: .45rem .65rem;
  color: #77898b;
  background: rgba(255, 255, 255, .8);
  border: 1px solid #e1e8e5;
  border-radius: .65rem;
  backdrop-filter: blur(8px);
  font-size: .66rem;
  pointer-events: none;
}

.path-card { padding: 1.4rem; }

.path-count {
  padding: .3rem .55rem;
  color: var(--teal);
  background: var(--mint);
  border-radius: 99px;
  font-size: .68rem;
}

.learning-path {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .75rem;
  margin-top: 1rem;
}

.learning-path::before {
  position: absolute;
  top: 24px;
  right: 8%;
  left: 8%;
  height: 1px;
  content: "";
  background: #cfe2dc;
}

.path-step {
  position: relative;
  z-index: 1;
  padding: .8rem;
  background: #f8faf7;
  border: 1px solid #dde7e3;
  border-radius: .9rem;
  cursor: pointer;
}

.path-step:hover { border-color: var(--teal); transform: translateY(-2px); }

.path-step .step-number {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-bottom: .6rem;
  color: white;
  background: var(--teal);
  border: 4px solid var(--white);
  border-radius: 50%;
  box-shadow: 0 0 0 1px #b9d6cf;
  font-size: .65rem;
}

.path-step strong { display: block; font-family: var(--serif); font-size: 1.05rem; }
.path-step small { color: var(--ink-soft); }
.path-step em { display: block; margin-top: .5rem; color: var(--teal); font-size: .64rem; font-style: normal; }

.path-empty {
  grid-column: 1 / -1;
  padding: 1rem;
  color: var(--ink-soft);
  background: #f4f7f4;
  border-radius: .8rem;
  text-align: center;
}

.method-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-top: 1.2rem;
  overflow: hidden;
  background: #cdded9;
  border: 1px solid #cdded9;
  border-radius: var(--radius);
}

.method-strip div { padding: 1.4rem; background: var(--teal-dark); color: white; }
.method-strip strong { display: block; margin-bottom: .3rem; font-family: var(--serif); font-size: 1.15rem; font-weight: 500; }
.method-strip span { color: #bcd5d1; font-size: .75rem; }

dialog {
  width: min(760px, 92vw);
  max-height: 86vh;
  color: var(--ink);
  background: var(--white);
  border: 0;
  border-radius: var(--radius);
  box-shadow: 0 25px 90px rgba(4, 35, 39, .27);
}

dialog::backdrop { background: rgba(5, 36, 40, .58); backdrop-filter: blur(4px); }
dialog form { padding: .8rem; }
dialog header { display: flex; justify-content: space-between; align-items: start; }
dialog h2 { margin: 0; font-family: var(--serif); font-weight: 500; }
dialog header button { width: 36px; height: 36px; border: 0; border-radius: 50%; background: #edf2ef; cursor: pointer; font-size: 1.4rem; }
dialog > form > p { color: var(--ink-soft); }
.source-list { display: grid; gap: .55rem; max-height: 50vh; overflow: auto; }
.source-item { padding: .8rem; background: #f3f7f4; border-radius: .8rem; }
.source-item strong { display: block; }
.source-item span { color: var(--ink-soft); font-size: .72rem; }
dialog footer { display: flex; justify-content: flex-end; margin-top: 1rem; }
.primary-button { padding: .65rem 1rem; color: white; background: var(--teal-dark); border: 0; border-radius: .7rem; cursor: pointer; }

.toast {
  position: fixed;
  z-index: 60;
  right: 1rem;
  bottom: 1rem;
  max-width: 340px;
  padding: .75rem 1rem;
  color: white;
  background: var(--teal-dark);
  border-radius: .8rem;
  box-shadow: 0 12px 35px rgba(4, 35, 39, .25);
  opacity: 0;
  transform: translateY(1rem);
  pointer-events: none;
  transition: .25s ease;
}

.toast.show { opacity: 1; transform: none; }

@media (max-width: 1050px) {
  .hero { grid-template-columns: 1fr; align-items: start; }
  .hero h1 { max-width: 16ch; }
  .workspace { grid-template-columns: 1fr; }
  .word-column { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .word-card { grid-row: span 2; }
  .graph-stage, #graph { min-height: 620px; }
}

@media (max-width: 720px) {
  .topbar { min-height: 66px; }
  .topbar #random-word { display: none; }
  .brand-mark { width: 40px; height: 40px; }
  .brand strong { font-size: 1.2rem; }
  main { width: min(94vw, 100%); }
  .hero { padding-top: 2.4rem; gap: 2rem; }
  .hero h1 { font-size: clamp(2.45rem, 12vw, 4rem); }
  .search-shell { padding: 1rem; }
  .word-column { grid-template-columns: 1fr; }
  .word-card { grid-row: auto; }
  .graph-header, .sense-section, .layer-section { padding-right: 1rem; padding-left: 1rem; }
  .graph-stage, #graph { min-height: 560px; }
  .graph-hint { right: .5rem; bottom: .5rem; left: .5rem; text-align: center; }
  .learning-path { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .learning-path::before { display: none; }
  .method-strip { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
