:root {
  color-scheme: light;
  --ink: #203027;
  --muted: #6d7b71;
  --muted-2: #8b978e;
  --line: #e4ebe4;
  --paper: #ffffff;
  --page: #f4f6f2;
  --green: #6b9679;
  --green-dark: #3f7054;
  --green-soft: #eaf2ec;
  --surface-soft: #f8faf7;
  --surface-tint: #f1f6f1;
  --shadow-card: 0 8px 26px rgba(35, 57, 43, .045);
  --shadow-shell: 0 24px 70px rgba(35, 57, 43, .09);
  --radius-lg: 20px;
  --radius-md: 14px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--page); scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background: radial-gradient(circle at 14% 0%, rgba(255,255,255,.92), transparent 32rem), var(--page);
  -webkit-font-smoothing: antialiased;
  line-height: 1.72;
}
body, button, input { font-family: inherit; }
a { color: var(--green-dark); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #2e5c42; }
button, input { font: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid rgba(82, 133, 98, .28); outline-offset: 3px; }

.skip-link {
  position: fixed; z-index: 1000; top: 12px; left: 12px; transform: translateY(-160%);
  padding: 10px 14px; border-radius: 10px; color: #fff; background: var(--green-dark); text-decoration: none;
}
.skip-link:focus { transform: translateY(0); }

main.seo-shell {
  --app-width: min(1480px, calc(100vw - 64px));
  width: var(--app-width);
  min-height: calc(100vh - 64px);
  margin: 32px auto;
  padding: 20px;
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  align-items: start;
  gap: 22px;
  border: 1px solid rgba(255,255,255,.86);
  border-radius: 26px;
  background: rgba(255,255,255,.78);
  box-shadow: var(--shadow-shell);
  backdrop-filter: blur(16px);
}

.seo-sidebar {
  position: sticky; top: 24px; z-index: 10;
  height: calc(100vh - 48px); min-height: 560px; max-height: 920px;
  padding: 22px 16px 16px;
  display: flex; flex-direction: column; gap: 22px;
  overflow: auto; scrollbar-width: none;
  border: 1px solid var(--line); border-radius: 20px;
  background: rgba(255,255,255,.96); box-shadow: var(--shadow-card);
}
.seo-sidebar::-webkit-scrollbar { display: none; }
.sidebar-brand { display: flex; align-items: center; gap: 11px; padding: 2px 6px 14px; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); }
.sidebar-logo { width: 42px; height: 42px; flex: 0 0 42px; display: grid; place-items: center; overflow: hidden; border-radius: 13px; background: var(--green-soft); }
.sidebar-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.sidebar-brand strong { display: block; color: var(--ink); font-size: 23px; line-height: 1.1; letter-spacing: .02em; }
.sidebar-brand small { display: block; margin-top: 4px; color: var(--muted-2); font-size: 11px; letter-spacing: .04em; }
.sidebar-nav { display: grid; gap: 5px; }
.sidebar-nav a {
  min-height: 43px; position: relative; display: flex; align-items: center; gap: 11px;
  padding: 0 12px; color: #65736a; border-radius: 11px; text-decoration: none;
  font-size: 13px; font-weight: 650; transition: background .18s ease, color .18s ease, transform .18s ease;
}
.sidebar-nav a:hover { color: var(--ink); background: #f4f7f3; }
.sidebar-nav a.active { color: var(--green-dark); background: var(--green-soft); }
.sidebar-nav a.active::before { content: ""; position: absolute; left: 0; top: 11px; bottom: 11px; width: 3px; border-radius: 4px; background: var(--green); }
.nav-symbol { width: 21px; height: 21px; display: inline-grid; place-items: center; flex: 0 0 21px; }
.nav-symbol svg { width: 19px; height: 19px; display: block; }
.nav-label { color: inherit; }
.sidebar-profile { margin-top: auto; display: grid; grid-template-columns: 32px minmax(0,1fr); align-items: center; gap: 9px; padding: 12px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-soft); }
.sidebar-avatar { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--green); font-size: 13px; font-weight: 800; }
.sidebar-profile strong, .sidebar-profile small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-profile strong { color: var(--ink); font-size: 12px; }
.sidebar-profile small { color: var(--muted-2); font-size: 10px; }

.seo-workspace { grid-column: 2; min-width: 0; display: grid; align-content: start; gap: 16px; }
.breadcrumb { display: flex; flex-wrap: wrap; gap: 7px; padding: 0 4px; margin: 0; list-style: none; color: var(--muted-2); font-size: 12px; }
.breadcrumb li:not(:last-child)::after { content: "/"; margin-left: 7px; color: #b2bcb4; }
.breadcrumb a { color: var(--muted); font-weight: 550; text-decoration: none; }
.hero, .seo-workspace > section, .phrase-detail > section, .cta {
  min-width: 0; border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--paper); box-shadow: var(--shadow-card);
}
.hero { position: relative; isolation: isolate; overflow: hidden; padding: clamp(26px, 4vw, 46px); background: linear-gradient(125deg, #fff 0%, #f8fbf7 58%, #edf4ed 100%); }
.hero::after { content: ""; position: absolute; z-index: -1; right: -70px; bottom: -145px; width: 340px; aspect-ratio: 1; border-radius: 50%; border: 1px solid rgba(96,145,109,.12); box-shadow: 0 0 0 34px rgba(96,145,109,.035), 0 0 0 72px rgba(96,145,109,.025); }
.hero > * { position: relative; z-index: 1; }
.hero > span { display: inline-flex; align-items: center; min-height: 29px; padding: 0 10px; border-radius: 999px; color: var(--green-dark); background: var(--green-soft); font-size: 12px; font-weight: 750; }
h1, h2, h3 { color: var(--ink); line-height: 1.28; letter-spacing: -.025em; }
h1 { max-width: 900px; margin: 16px 0 13px; font-size: clamp(30px, 3.8vw, 52px); font-weight: 760; }
h2 { margin: 0 0 15px; font-size: 21px; font-weight: 720; }
h3 { margin: 0 0 7px; font-size: 16px; font-weight: 700; }
p, li, small { color: var(--muted); }
p { margin: 0 0 12px; }
p:last-child { margin-bottom: 0; }
.lead { max-width: 780px; margin: 0; color: #5e7064; font-size: 16px; font-weight: 500; }
.translation { margin: 0 0 12px; color: var(--green-dark); font-size: clamp(21px, 2.5vw, 30px); font-weight: 750; }
.keyword-line { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; }
.keyword-line a, .keyword-line span { display: inline-flex; align-items: center; min-height: 30px; padding: 0 10px; color: #65756a; border: 1px solid #e4ebe3; border-radius: 999px; background: rgba(255,255,255,.78); text-decoration: none; font-size: 12px; font-weight: 550; }
.seo-workspace > section, .phrase-detail > section { padding: clamp(19px, 2.3vw, 26px); }
.phrase-detail { display: grid; gap: 16px; min-width: 0; }

.grid, .topic-links, .pattern-list, .mistake-list, .practice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px,1fr)); gap: 12px; padding: 0; margin: 0; list-style: none; }
.grid li, .phrase-list li, .faq-list article, .topic-links a, .pattern-list article, .mistake-list article, .practice-grid article {
  min-width: 0; padding: 15px 16px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-soft);
}
.grid strong, .phrase-list strong, .topic-links strong, .faq-list h3, .step-list strong, .dialogue-box strong { color: var(--ink); }
.topic-links a { display: grid; gap: 5px; text-decoration: none; transition: border-color .18s ease, transform .18s ease, background .18s ease; }
.topic-links a:hover { transform: translateY(-2px); border-color: #cbdccc; background: #f4f8f3; }
.topic-links small { line-height: 1.55; }
.phrase-list, .faq-list, .step-list { display: grid; gap: 9px; padding: 0; margin: 0; list-style: none; }
.phrase-list li { display: grid; gap: 4px; padding: 13px 15px; }
.phrase-list strong { display: block; color: var(--ink); font-size: 14px; }
.phrase-list span { display: block; color: var(--muted); font-size: 12px; }
.step-list li { display: grid; grid-template-columns: 30px minmax(0,1fr); gap: 5px 11px; align-items: start; padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-soft); }
.step-list em { grid-row: span 2; width: 28px; height: 28px; display: grid; place-items: center; color: #fff; border-radius: 9px; background: var(--green); font-style: normal; font-size: 12px; font-weight: 800; }
.step-list strong { font-size: 14px; }
.step-list span { font-size: 13px; }
.dialogue-box { display: grid; gap: 8px; }
.dialogue-box p { display: grid; grid-template-columns: minmax(88px, auto) minmax(0,1fr); gap: 12px; margin: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); }
.dialogue-box strong { font-size: 12px; }
.dialogue-box span { color: var(--muted); font-size: 13px; }
.pattern-list p, .mistake-list p, .practice-grid p { margin: 0; font-size: 13px; }
.faq-list h3 { font-size: 14px; }
.faq-list p { margin: 0; font-size: 13px; }
.audio-practice audio { width: 100%; max-width: 520px; margin-top: 12px; accent-color: var(--green-dark); }
.cta { padding: 20px 22px; background: var(--green-soft); }
.cta a { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 0 18px; border-radius: 11px; color: #fff; background: var(--green-dark); font-size: 13px; font-weight: 700; text-decoration: none; box-shadow: 0 8px 18px rgba(63,112,84,.15); }
.cta a:hover { background: #315d43; }
.search-answer { border-left: 3px solid var(--green); background: linear-gradient(135deg,#fff 0%,var(--green-soft) 100%); }
.search-answer dl { display: grid; gap: 10px; margin: 16px 0 0; }
.search-answer dl div { padding: 12px 14px; border: 1px solid rgba(89,139,101,.16); border-radius: 11px; background: rgba(255,255,255,.76); }
.search-answer dt { margin-bottom: 4px; color: var(--green-dark); font-weight: 750; }
.search-answer dd { margin: 0; color: var(--ink); }

/* Phrase library enhancements */
.phrase-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-top: 18px; }
.phrase-tool-button { min-height: 39px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 13px; border: 1px solid #dce7dc; border-radius: 11px; color: #42664d; background: #fff; font-size: 12px; font-weight: 700; cursor: pointer; transition: background .18s ease, border-color .18s ease, transform .18s ease; }
.phrase-tool-button:hover { transform: translateY(-1px); border-color: #b9cfbb; background: #f3f8f2; }
.phrase-tool-button.primary { color: #fff; border-color: var(--green-dark); background: var(--green-dark); }
.phrase-tool-button.is-saved { color: #fff; border-color: #6b9679; background: #6b9679; }
.phrase-filter { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; }
.phrase-filter input { width: min(100%, 420px); min-height: 42px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: #fff; font-size: 13px; }
.phrase-filter output { flex: 0 0 auto; color: var(--muted-2); font-size: 12px; }
.phrase-empty { padding: 18px; color: var(--muted); border: 1px dashed #d5e0d5; border-radius: 12px; text-align: center; }
.phrase-toast { position: fixed; z-index: 1100; left: 50%; bottom: 26px; transform: translate(-50%, 16px); opacity: 0; pointer-events: none; padding: 10px 15px; border-radius: 999px; color: #fff; background: #263d2d; box-shadow: 0 10px 30px rgba(0,0,0,.16); font-size: 12px; transition: opacity .2s ease, transform .2s ease; }
.phrase-toast.show { opacity: 1; transform: translate(-50%, 0); }
.phrase-display-modal { position: fixed; z-index: 1050; inset: 0; display: none; align-items: center; justify-content: center; padding: 20px; background: rgba(20,34,25,.58); backdrop-filter: blur(5px); }
.phrase-display-modal.open { display: flex; }
.phrase-display-card { position: relative; width: min(760px,100%); padding: clamp(28px,5vw,56px); border-radius: 24px; background: #fff; box-shadow: 0 28px 90px rgba(0,0,0,.22); text-align: center; }
.phrase-display-card .modal-label { color: var(--green-dark); font-size: 12px; font-weight: 750; letter-spacing: .08em; }
.phrase-display-card .modal-english { margin: 20px 0 16px; color: var(--ink); font-size: clamp(28px,5vw,48px); font-weight: 760; line-height: 1.25; }
.phrase-display-card .modal-chinese { color: var(--green-dark); font-size: clamp(18px,3vw,24px); }
.phrase-modal-close { position: absolute; top: 14px; right: 14px; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%; color: var(--ink); background: #fff; cursor: pointer; font-size: 20px; }

/* Library landing page */
.library-shell { width: min(1200px, calc(100vw - 48px)); margin: 34px auto; }
.library-topbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 0 22px; }
.library-brand { display: flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; }
.library-brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; color: var(--green-dark); background: var(--green-soft); font-weight: 850; }
.library-brand strong { display: block; font-size: 20px; line-height: 1.2; }
.library-brand small { display: block; color: var(--muted-2); font-size: 11px; }
.library-toplinks { display: flex; flex-wrap: wrap; gap: 18px; }
.library-toplinks a { color: var(--muted); font-size: 13px; font-weight: 650; text-decoration: none; }
.library-hero { padding: clamp(28px,5vw,58px); border: 1px solid var(--line); border-radius: 26px; background: linear-gradient(120deg,#fff 0%,#f7faf6 58%,#eaf2eb 100%); box-shadow: var(--shadow-card); }
.library-kicker { color: var(--green-dark); font-size: 12px; font-weight: 800; letter-spacing: .09em; }
.library-hero h1 { max-width: 760px; margin: 12px 0 14px; font-size: clamp(34px,5vw,58px); }
.library-hero p { max-width: 700px; font-size: 15px; }
.library-stats { display: flex; flex-wrap: wrap; gap: 24px; margin-top: 24px; }
.library-stats strong { display: block; color: var(--ink); font-size: 22px; line-height: 1.2; }
.library-stats span { color: var(--muted-2); font-size: 11px; }
.library-section { margin-top: 26px; padding: 24px; border: 1px solid var(--line); border-radius: 20px; background: #fff; box-shadow: var(--shadow-card); }
.library-section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 17px; }
.library-section-head h2 { margin: 0; }
.library-section-head p { margin: 0; font-size: 12px; }
.library-topic-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.library-topic-card { display: flex; flex-direction: column; min-height: 160px; padding: 18px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface-soft); text-decoration: none; transition: transform .18s ease,border-color .18s ease,background .18s ease; }
.library-topic-card:hover { transform: translateY(-2px); border-color: #c4d7c6; background: #f3f8f3; }
.library-topic-icon { width: 34px; height: 34px; display: grid; place-items: center; margin-bottom: 15px; border-radius: 11px; color: var(--green-dark); background: var(--green-soft); font-size: 16px; }
.library-topic-card strong { color: var(--ink); font-size: 15px; }
.library-topic-card span { margin-top: 5px; color: var(--muted); font-size: 12px; }
.library-topic-card small { margin-top: auto; padding-top: 13px; color: var(--green-dark); font-size: 11px; font-weight: 750; }
.library-search { display: flex; gap: 10px; margin-top: 14px; }
.library-search input { flex: 1; min-width: 0; min-height: 50px; padding: 0 16px; border: 1px solid #dce6dc; border-radius: 13px; color: var(--ink); background: #fff; font-size: 14px; }
.library-search button { min-width: 104px; border: 0; border-radius: 13px; color: #fff; background: var(--green-dark); font-size: 13px; font-weight: 750; cursor: pointer; }
.library-search-results { display: grid; gap: 8px; margin-top: 14px; }
.library-result { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 12px; color: inherit; background: var(--surface-soft); text-decoration: none; }
.library-result strong { display: block; color: var(--ink); font-size: 13px; }
.library-result span { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.library-result small { flex: 0 0 auto; color: var(--green-dark); font-size: 11px; }
.library-footer { display: flex; justify-content: space-between; gap: 14px; padding: 24px 4px; color: var(--muted-2); font-size: 11px; }

@media (max-width: 1080px) {
  main.seo-shell { --app-width: calc(100vw - 32px); grid-template-columns: 208px minmax(0,1fr); gap: 16px; padding: 14px; margin: 16px auto; }
  .seo-sidebar { padding: 18px 12px 13px; }
  .sidebar-nav a { padding: 0 9px; font-size: 12px; }
}
@media (max-width: 820px) {
  main.seo-shell { display: block; width: 100%; min-height: 100vh; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; backdrop-filter: none; }
  .seo-sidebar { position: sticky; top: 0; width: 100%; height: auto; min-height: 0; max-height: none; padding: 10px 16px; flex-direction: row; align-items: center; gap: 18px; border-width: 0 0 1px; border-radius: 0; background: rgba(255,255,255,.96); box-shadow: 0 4px 18px rgba(35,57,43,.05); }
  .sidebar-brand { flex: 0 0 auto; gap: 8px; padding: 0; border: 0; }
  .sidebar-logo { width: 36px; height: 36px; flex-basis: 36px; border-radius: 10px; }
  .sidebar-brand strong { font-size: 18px; }
  .sidebar-brand small { display: none; }
  .sidebar-nav { display: flex; flex: 1 1 auto; gap: 4px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
  .sidebar-nav::-webkit-scrollbar { display: none; }
  .sidebar-nav a { flex: 0 0 auto; min-height: 34px; padding: 0 11px; border-radius: 9px; font-size: 12px; white-space: nowrap; }
  .sidebar-nav a::before, .nav-symbol, .sidebar-profile { display: none; }
  .seo-workspace { width: 100%; padding: 18px 20px 34px; }
}
@media (max-width: 560px) {
  .seo-sidebar { gap: 10px; padding: 9px 12px; }
  .sidebar-brand strong { font-size: 16px; }
  .sidebar-logo { width: 32px; height: 32px; flex-basis: 32px; }
  .sidebar-nav a { min-height: 32px; padding: 0 9px; font-size: 11px; }
  .seo-workspace { padding: 13px 12px 28px; gap: 12px; }
  .hero { padding: 22px 19px; border-radius: 17px; }
  .hero::after { width: 200px; right: -90px; bottom: -110px; }
  h1 { margin: 13px 0 10px; font-size: clamp(28px, 8.5vw, 38px); }
  h2 { font-size: 18px; }
  h3 { font-size: 15px; }
  .lead { font-size: 14px; }
  .seo-workspace > section, .phrase-detail > section { padding: 18px 16px; border-radius: 16px; }
  .grid, .topic-links, .pattern-list, .mistake-list, .practice-grid { grid-template-columns: 1fr; }
  .dialogue-box p { grid-template-columns: 1fr; gap: 4px; }
  .phrase-tools { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .phrase-tool-button { width: 100%; padding: 0 8px; }
  .phrase-filter { align-items: stretch; flex-direction: column; gap: 6px; }
  .phrase-filter input { width: 100%; }
  .library-shell { width: calc(100% - 24px); margin: 12px auto; }
  .library-topbar { padding: 8px 2px 15px; }
  .library-toplinks { gap: 10px; }
  .library-toplinks a { font-size: 11px; }
  .library-hero { padding: 25px 20px; border-radius: 19px; }
  .library-hero h1 { font-size: 34px; }
  .library-hero p { font-size: 13px; }
  .library-section { margin-top: 14px; padding: 17px 15px; border-radius: 17px; }
  .library-topic-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .library-topic-card { min-height: 148px; padding: 13px; }
  .library-topic-card strong { font-size: 13px; }
  .library-topic-card span { font-size: 11px; }
  .library-search { flex-direction: column; }
  .library-search button { min-height: 44px; }
  .library-result { align-items: flex-start; flex-direction: column; gap: 6px; }
  .library-footer { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

.audio-fallback-note { margin: 8px 0 0; color: var(--muted-2); font-size: 12px; }

/* 2.0.1: keep the library navigation usable on narrow screens. */
.library-toplinks a[aria-current="page"]{color:var(--green-dark);font-weight:800}
.library-toplinks a:focus-visible{outline:3px solid #78b99b;outline-offset:3px;border-radius:5px}
@media(max-width:560px){
  .library-topbar{align-items:flex-start;flex-wrap:wrap}
  .library-toplinks{width:100%;flex-wrap:nowrap;overflow-x:auto;white-space:nowrap;gap:14px;padding:2px 0 9px;scrollbar-width:none}
  .library-toplinks::-webkit-scrollbar{display:none}
  .library-toplinks a{flex:0 0 auto}
}


/* =========================================================
   TravelSay 2.0.2 — library and phrase detail visual pass
   ========================================================= */
.library-shell{width:min(1200px,calc(100vw - 56px));margin:26px auto 40px}
.library-topbar{position:sticky;top:0;z-index:40;display:flex;align-items:center;gap:26px;padding:12px 18px;margin:0 0 18px;border:1px solid rgba(223,231,223,.9);border-radius:16px;background:rgba(255,255,255,.92);backdrop-filter:blur(16px);box-shadow:0 8px 24px rgba(35,57,43,.045)}
.library-brand{flex:0 0 auto;gap:10px}
.library-brand-logo{width:40px;height:40px;display:block;object-fit:contain}
.library-brand strong{font-size:19px;letter-spacing:-.04em}
.library-brand small{margin-top:3px;font-size:10px;letter-spacing:.02em}
.library-toplinks{min-width:0;display:flex;flex:1;flex-wrap:nowrap;align-items:center;justify-content:flex-end;gap:clamp(10px,1.1vw,16px);overflow-x:auto;scrollbar-width:none}
.library-toplinks::-webkit-scrollbar{display:none}
.library-toplinks a{flex:0 0 auto;display:inline-flex;align-items:center;min-height:40px;padding:0 2px;font-size:12px;white-space:nowrap;position:relative}
.library-toplinks a[aria-current="page"]{color:#28785f;font-weight:800}
.library-toplinks a[aria-current="page"]:after{position:absolute;right:0;bottom:2px;left:0;height:2px;border-radius:2px;background:#28785f;content:""}
.library-hero{padding:clamp(34px,5vw,62px);border-radius:24px;background:linear-gradient(125deg,#fffefa 0%,#f7faf6 60%,#eaf2eb 100%);box-shadow:0 16px 42px rgba(35,57,43,.055)}
.library-hero h1{font-size:clamp(36px,4.3vw,54px);line-height:1.2;letter-spacing:-.055em}
.library-hero p{font-size:14px;line-height:1.9;color:#65756b}
.library-stats{gap:34px}
.library-stats>div{min-width:90px;padding-left:16px;border-left:2px solid #dce9de}
.library-stats strong{font-size:24px;color:#1d3529}
.library-section{margin-top:20px;padding:26px;border-radius:18px;border-color:#e2eae2;box-shadow:0 8px 26px rgba(35,57,43,.035)}
.library-section-head{margin-bottom:18px}
.library-section-head h2{font-size:21px;letter-spacing:-.035em}
.library-section-head p{color:#758278;font-size:12px}
.library-search{gap:9px}
.library-search input{min-height:52px;border-radius:12px;border-color:#dce6dd}
.library-search input:focus{outline:0;border-color:#7eae8b;box-shadow:0 0 0 3px rgba(70,132,88,.12)}
.library-search button{min-width:112px;min-height:52px;border-radius:999px;background:#28785f;box-shadow:0 7px 16px rgba(40,120,95,.13)}
.library-topic-grid{gap:14px}
.library-topic-card{min-height:178px;padding:20px;border-radius:16px;background:#fbfcf9;transition:transform .18s ease,border-color .18s ease,box-shadow .18s ease}
.library-topic-card:hover{transform:translateY(-2px);border-color:#b8cdbb;background:#fff;box-shadow:0 12px 26px rgba(35,57,43,.06)}
.library-topic-icon{width:38px;height:38px;border-radius:12px;background:#edf4ee}
.library-result{min-height:68px;border-radius:13px;background:#fbfcfa}
.library-result:hover{border-color:#c2d6c5;background:#f4f8f3}
.library-footer{margin-top:22px;border-top:1px solid #e3eae3}
.seo-sidebar{border-radius:18px;background:rgba(255,255,255,.97);box-shadow:0 12px 34px rgba(35,57,43,.055)}
.sidebar-brand strong{font-size:21px;letter-spacing:-.045em}
.sidebar-brand small{font-size:10px}
.sidebar-nav a{min-height:44px;border-radius:10px}
.sidebar-nav a.active{background:#edf4ee;color:#28785f}
.sidebar-nav a.active:before{background:#28785f}
.seo-workspace{gap:18px}
.breadcrumb{font-size:11px}
.phrase-detail>.hero{padding:clamp(28px,4vw,48px);border-radius:22px;background:linear-gradient(125deg,#fffefa 0%,#f7faf6 62%,#eaf2eb 100%)}
.phrase-detail>.hero h1{font-size:clamp(30px,3.3vw,44px);line-height:1.22;letter-spacing:-.045em}
.phrase-detail>.hero .translation{font-size:18px;color:#3e6550}
.phrase-detail>section{padding:24px;border-radius:17px}
.phrase-tools{gap:8px}
.phrase-tool-button{min-height:42px;border-radius:999px;padding:0 15px}
.phrase-tool-button.primary{background:#28785f;border-color:#28785f}
@media(max-width:980px){
  .library-topbar{align-items:flex-start;flex-direction:column;gap:10px;padding:12px 14px}
  .library-toplinks{width:100%;justify-content:flex-start;gap:16px;padding-bottom:4px}
}
@media(max-width:560px){
  .library-shell{width:calc(100% - 24px);margin:12px auto 24px}
  .library-topbar{position:relative;padding:10px 12px;border-radius:13px}
  .library-toplinks{gap:14px}
  .library-toplinks a{min-height:40px;font-size:11px}
  .library-brand-logo{width:36px;height:36px}
  .library-hero{padding:28px 20px;border-radius:19px}
  .library-hero h1{font-size:clamp(30px,8vw,36px)}
  .library-stats{gap:18px}
  .library-stats>div{min-width:76px;padding-left:10px}
  .library-section{padding:18px 15px;border-radius:16px}
  .library-topic-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
  .library-topic-card{min-height:154px;padding:14px}
  .phrase-detail>.hero{padding:26px 20px}
  .phrase-detail>.hero h1{font-size:28px;overflow-wrap:anywhere}
  .phrase-detail>section{padding:18px 16px}
}
@media(prefers-reduced-motion:reduce){
  .library-topic-card,.library-result{transition:none!important}
}

/* Shared 2.0.2 design tokens */
:root{
  --ink:#1c2d3d;
  --muted:#68786f;
  --muted-2:#87948a;
  --line:#dfe7df;
  --paper:#fffdf9;
  --page:#f3f6f2;
  --green:#6e9e7d;
  --green-dark:#28785f;
  --green-soft:#edf4ee;
  --surface-soft:#f8faf7;
  --surface-tint:#eff5ef;
  --shadow-card:0 8px 26px rgba(35,57,43,.04);
  --shadow-shell:0 24px 70px rgba(35,57,43,.08);
}

.library-brand>span{display:grid;gap:3px;min-width:max-content}
.library-brand strong,.library-brand small{white-space:nowrap}
.sidebar-brand>span{min-width:0}
.sidebar-brand strong,.sidebar-brand small{white-space:nowrap}
