:root {
  --ink: #17342d;
  --ink-deep: #102a24;
  --paper: #f3efe4;
  --paper-light: #faf8f1;
  --line: rgba(23, 52, 45, .18);
  --muted: #68766f;
  --accent: #b65e3c;
  --accent-soft: #e3b69e;
  --moss: #708a6f;
  --header-h: 76px;
  --serif: "Songti SC", "Noto Serif SC", STSong, SimSun, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; }
.skip-link { position: fixed; left: 12px; top: -60px; z-index: 1000; padding: 10px 14px; background: white; }
.skip-link:focus { top: 12px; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 28px;
  padding: 0 clamp(20px, 4vw, 64px);
  border-bottom: 1px solid var(--line);
  background: rgba(243, 239, 228, .9);
  backdrop-filter: blur(16px);
}
.brand { display: inline-flex; align-items: center; gap: 11px; width: max-content; text-decoration: none; }
.brand-mark {
  width: 38px; height: 38px; display: grid; place-items: center;
  border: 1px solid var(--ink); border-radius: 50%;
  font-family: var(--serif); font-size: 20px;
}
.brand b { display: block; font: 600 20px/1.05 var(--serif); letter-spacing: .14em; }
.brand small { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; letter-spacing: .16em; }
.desktop-nav { display: flex; height: 100%; }
.nav-link {
  position: relative; padding: 0 21px; border: 0; background: transparent;
  font-size: 13px; cursor: pointer;
}
.nav-link::after { content: ""; position: absolute; left: 21px; right: 21px; bottom: -1px; height: 2px; background: transparent; }
.nav-link.is-active::after { background: var(--accent); }
.install-button {
  justify-self: end; padding: 9px 15px; border: 1px solid var(--ink); border-radius: 99px;
  background: transparent; font-size: 12px; cursor: pointer;
}

.view { display: none; min-height: calc(100vh - var(--header-h)); }
.view.is-active { display: block; animation: viewIn .36s ease both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.intro {
  position: relative;
  min-height: min(600px, calc(100svh - var(--header-h)));
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(360px, .95fr);
  align-items: center;
  padding: 54px clamp(24px, 8vw, 132px) 70px;
  overflow: hidden;
  background:
    radial-gradient(circle at 74% 25%, rgba(255,255,255,.48), transparent 30%),
    linear-gradient(120deg, #eee8d9 0 56%, #dbe0cf 56% 100%);
}
.intro-copy { position: relative; z-index: 1; max-width: 680px; animation: heroIn .7s cubic-bezier(.22,.8,.24,1) both; }
@keyframes heroIn { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
.eyebrow { margin: 0 0 22px; color: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: .2em; }
.intro h1, .utility-intro h1 {
  margin: 0; font: 500 clamp(58px, 7.4vw, 112px)/.98 var(--serif); letter-spacing: -.05em;
}
.intro-copy > p:last-child {
  max-width: 430px; margin: 30px 0 0; color: #4f625b; font-size: 15px; line-height: 1.9;
}
.botanical { position: relative; justify-self: center; width: min(34vw, 420px); min-width: 300px; }
.botanical svg { display: block; width: 100%; overflow: visible; filter: drop-shadow(0 30px 38px rgba(23,52,45,.09)); }
.botanical path { fill: none; stroke: var(--ink); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.botanical .leaf { fill: rgba(112,138,111,.15); }
.botanical circle { fill: var(--accent); stroke: none; }
.botanical span { position: absolute; right: 5%; bottom: 17%; font: 500 54px/1 var(--serif); }
.botanical small { position: absolute; right: 3%; bottom: 11%; color: var(--muted); font-size: 11px; letter-spacing: .12em; }

.search-zone {
  position: sticky; top: var(--header-h); z-index: 30;
  display: flex; align-items: center; gap: 18px;
  padding: 18px clamp(20px, 4vw, 64px);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background: rgba(250,248,241,.94); backdrop-filter: blur(16px);
}
.search-box { flex: 1; max-width: 670px; display: flex; align-items: center; gap: 12px; }
.search-box svg { width: 20px; fill: none; stroke: var(--ink); stroke-width: 1.7; }
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 16px; }
.search-box input::placeholder { color: #89958f; }
.search-box:focus-within { color: var(--accent); }
.search-box kbd { padding: 3px 7px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); background: var(--paper); font-size: 10px; white-space: nowrap; }
.suggestions { display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none; }
.suggestions::-webkit-scrollbar { display: none; }
.suggestions button { flex: 0 0 auto; padding: 8px 12px; border: 1px solid var(--line); border-radius: 99px; background: transparent; font-size: 11px; cursor: pointer; }
.suggestions button:hover { border-color: var(--accent); color: var(--accent); }

.library-layout { display: grid; grid-template-columns: 260px 1fr; min-height: 720px; }
.category-rail { padding: 46px 30px 60px clamp(24px, 4vw, 64px); border-right: 1px solid var(--line); }
.category-rail > p { margin: 0 0 21px; color: var(--muted); font-size: 10px; letter-spacing: .14em; }
.category-button {
  width: 100%; display: grid; grid-template-columns: 32px 1fr auto; align-items: center; gap: 8px;
  padding: 13px 0; border: 0; border-bottom: 1px solid transparent; background: transparent;
  text-align: left; font-size: 13px; cursor: pointer;
}
.category-button span { color: var(--muted); font: 500 10px/1 var(--serif); }
.category-button em { color: #94a09a; font-size: 10px; font-style: normal; }
.category-button.is-active { border-bottom-color: var(--ink); color: var(--accent); }
.favorite-filter { margin-top: 24px; border-top: 1px solid var(--line); }
.oil-library { min-width: 0; padding: 45px clamp(24px, 5vw, 74px) 90px; background: var(--paper-light); }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; padding-bottom: 22px; border-bottom: 1px solid var(--ink); }
.section-heading p { margin: 0 0 8px; color: var(--accent); font-size: 10px; font-weight: 700; letter-spacing: .15em; text-transform: uppercase; }
.section-heading h2 { margin: 0; font: 500 clamp(27px, 3vw, 42px)/1.1 var(--serif); }
.section-heading > span { color: var(--muted); font-size: 11px; white-space: nowrap; }
.oil-list { counter-reset: oils; }
.oil-row {
  counter-increment: oils; position: relative; display: grid;
  grid-template-columns: 38px minmax(150px, .8fr) minmax(170px, 1fr) minmax(210px, 1.2fr) 44px;
  align-items: center; gap: 20px; min-height: 112px;
  border-bottom: 1px solid var(--line); cursor: pointer;
  transition: padding .24s ease, background .24s ease;
}
.oil-row::before { content: counter(oils, decimal-leading-zero); color: #9aa39e; font: 10px/1 var(--serif); }
.oil-row:hover { padding-inline: 12px; background: rgba(219,224,207,.35); }
.oil-name b { display: block; font: 500 21px/1.2 var(--serif); }
.oil-name small { display: block; margin-top: 6px; color: var(--muted); font: italic 11px/1.3 Georgia, serif; }
.oil-aroma { color: #53645d; font-size: 12px; line-height: 1.7; }
.oil-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.oil-tags span { padding: 5px 8px; border-radius: 99px; background: #ebe7da; color: #53645d; font-size: 10px; }
.oil-tags .flag { color: #9e452c; background: #f0ddd3; }
.favorite-button { width: 38px; height: 38px; border: 0; border-radius: 50%; background: transparent; color: #819089; font-size: 18px; cursor: pointer; }
.favorite-button:hover, .favorite-button.is-favorite { color: var(--accent); background: #efe1d9; }
.oil-row-open { color: var(--muted); font: 16px/1 var(--serif); text-align: center; }
.empty-state { padding: 100px 20px; text-align: center; }
.empty-state span { color: var(--accent); font-size: 10px; letter-spacing: .16em; }
.empty-state h3 { margin: 14px 0 24px; font: 500 28px/1.2 var(--serif); }
.empty-state button { padding: 10px 16px; border: 1px solid var(--ink); background: transparent; cursor: pointer; }

.database-intro {
  display: grid; grid-template-columns: minmax(0,1.2fr) minmax(380px,.8fr); align-items: end; gap: 70px;
  min-height: 360px; padding: 72px clamp(24px, 6vw, 96px) 58px;
  color: white; background: var(--ink);
}
.database-intro h1 { margin: 0; font: 500 clamp(50px,6vw,86px)/1 var(--serif); letter-spacing: -.05em; }
.database-intro > div > p:last-child { max-width: 670px; margin: 24px 0 0; color: #b9c8c0; font-size: 14px; line-height: 1.85; }
.database-stats { display: grid; grid-template-columns: repeat(3,1fr); margin: 0; border-top: 1px solid rgba(255,255,255,.28); }
.database-stats div { padding: 20px 16px 0 0; }
.database-stats div + div { padding-left: 16px; border-left: 1px solid rgba(255,255,255,.18); }
.database-stats dt { color: #e0a387; font: 500 clamp(28px,3.2vw,46px)/1 var(--serif); }
.database-stats dd { margin: 8px 0 0; color: #aebeb6; font-size: 10px; }
.library-search-zone {
  position: sticky; top: var(--header-h); z-index: 30; display: flex; align-items: center; gap: 22px;
  padding: 17px clamp(20px, 4vw, 64px); border-bottom: 1px solid var(--line);
  background: rgba(250,248,241,.95); backdrop-filter: blur(16px);
}
.library-search { flex: 1; max-width: 720px; }
.library-quick-search { display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none; }
.library-quick-search::-webkit-scrollbar { display: none; }
.library-quick-search button { flex: 0 0 auto; padding: 7px 11px; border: 1px solid var(--line); border-radius: 99px; background: transparent; font-size: 10px; cursor: pointer; }
.library-quick-search button:hover { color: var(--accent); border-color: var(--accent); }
.archive-intro {
  position: relative; min-height: 530px; display: grid; grid-template-columns: minmax(0,1.1fr) minmax(330px,.9fr);
  align-items: center; padding: 60px clamp(24px,8vw,132px) 72px; overflow: hidden;
  background: radial-gradient(circle at 76% 28%,rgba(255,255,255,.52),transparent 28%), linear-gradient(125deg,#eee8d9 0 60%,#dbe0cf 60% 100%);
}
.archive-intro h1 { margin: 0; font: 500 clamp(58px,7.2vw,106px)/.98 var(--serif); letter-spacing: -.055em; }
.archive-intro .intro-copy > p:last-child { max-width: 490px; }
.archive-botanical { position: relative; justify-self: center; width: min(31vw,380px); min-width: 290px; opacity: .76; }
.archive-botanical svg { display: block; width: 100%; overflow: visible; }
.archive-botanical path { fill: none; stroke: var(--ink); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.archive-botanical .leaf { fill: rgba(112,138,111,.13); }
.library-domain-nav { display: grid; grid-template-columns: repeat(4,1fr); border-bottom: 1px solid var(--line); background: var(--paper); }
.library-domain {
  position: relative; display: grid; grid-template-columns: 34px 1fr auto; grid-template-rows: auto auto; gap: 5px 10px;
  min-height: 116px; padding: 26px clamp(16px,2.6vw,38px); border: 0; border-right: 1px solid var(--line);
  background: transparent; text-align: left; cursor: pointer; transition: background .2s ease;
}
.library-domain:last-child { border-right: 0; }
.library-domain > span { grid-row: 1 / 3; color: #98a29d; font: 500 10px/1 var(--serif); padding-top: 5px; }
.library-domain b { font: 500 22px/1.2 var(--serif); }
.library-domain small { color: var(--muted); font-size: 10px; }
.library-domain em { grid-column: 3; grid-row: 1 / 3; align-self: center; color: #9a6b58; font: 500 25px/1 var(--serif); font-style: normal; }
.library-domain::after { content: ""; position: absolute; left: 0; right: 100%; bottom: -1px; height: 3px; background: var(--accent); transition: right .25s ease; }
.library-domain:hover { background: rgba(219,224,207,.35); }
.library-domain.is-active::after { right: 0; }
.library-domain.is-active b { color: var(--accent); }
.archive-layout { display: grid; grid-template-columns: 250px minmax(0,1fr); min-height: 720px; }
.archive-sections { padding: 42px 28px 70px clamp(24px,4vw,64px); border-right: 1px solid var(--line); }
.archive-sections > p, .archive-personal > p { margin: 0 0 14px; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .15em; }
.archive-section {
  width: 100%; display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border: 0;
  border-bottom: 1px solid transparent; background: transparent; text-align: left; font-size: 12px; cursor: pointer;
}
.archive-section em { color: #98a39d; font-size: 9px; font-style: normal; }
.archive-section:hover, .archive-section.is-active { color: var(--accent); border-bottom-color: var(--ink); }
.archive-personal { margin-top: 38px; padding-top: 24px; border-top: 1px solid var(--line); }
.library-workspace { display: grid; grid-template-columns: 260px minmax(0,1fr); min-height: 760px; }
.library-filters { padding: 38px 28px 80px clamp(24px,4vw,64px); border-right: 1px solid var(--line); }
.filter-group { margin-bottom: 34px; }
.filter-group > p { margin: 0 0 12px; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .15em; }
.library-filter {
  width: 100%; display: flex; justify-content: space-between; gap: 10px; padding: 9px 0;
  border: 0; border-bottom: 1px solid transparent; background: transparent; text-align: left; font-size: 12px; cursor: pointer;
}
.library-filter em { color: #98a39d; font-size: 9px; font-style: normal; }
.library-filter:hover, .library-filter.is-active { color: var(--accent); border-bottom-color: var(--ink); }
.section-filter-group .library-filter { color: #65746d; font-size: 11px; }
.section-filter-group .library-filter.is-active { color: var(--accent); }
.library-results { min-width: 0; padding: 43px clamp(22px,5vw,72px) 100px; background: var(--paper-light); }
.library-heading { margin-bottom: 0; }
.library-row {
  display: grid; grid-template-columns: 92px minmax(180px,.7fr) minmax(280px,1.3fr) 70px 38px;
  gap: 22px; align-items: center; min-height: 118px; border-bottom: 1px solid var(--line); cursor: pointer;
  transition: padding .22s ease, background .22s ease;
}
.library-row:hover { padding-inline: 10px; background: rgba(219,224,207,.35); }
.library-type { color: var(--accent); font-size: 9px; font-weight: 700; letter-spacing: .08em; }
.library-title b { display: block; font: 500 20px/1.35 var(--serif); }
.library-title small { display: block; margin-top: 6px; color: var(--muted); font-size: 9px; }
.library-excerpt { margin: 0; color: #5a6962; font-size: 11px; line-height: 1.75; }
.library-meta { color: #8b9690; font-size: 9px; text-align: right; }
.library-row .favorite-button { font-size: 16px; }
.load-more { display: block; width: 100%; margin-top: 28px; padding: 13px; border: 1px solid var(--ink); background: transparent; cursor: pointer; }
.load-more[hidden] { display: none; }
.load-more:hover { color: white; background: var(--ink); }

.library-dialog {
  width: min(920px,100%); height: 100%; max-height: none; margin: 0 0 0 auto; padding: 0; border: 0;
  background: var(--paper-light); color: var(--ink);
}
.library-dialog::backdrop { background: rgba(12,31,26,.55); backdrop-filter: blur(4px); }
.library-dialog[open] { animation: dialogIn .36s cubic-bezier(.2,.7,.2,1) both; }
.library-dialog-shell { min-height: 100%; padding: 28px clamp(24px,7vw,88px) 90px; }
.library-detail-kicker { display: flex; gap: 10px; align-items: center; margin: 62px 0 18px; color: var(--accent); font-size: 10px; font-weight: 700; letter-spacing: .12em; }
.library-detail-kicker span + span::before { content: "·"; margin-right: 10px; color: var(--muted); }
.library-detail-title { margin: 0; font: 500 clamp(43px,7vw,76px)/1.04 var(--serif); letter-spacing: -.04em; }
.library-detail-summary { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 22px 0 30px; padding-bottom: 24px; border-bottom: 1px solid var(--ink); color: var(--muted); font-size: 10px; }
.risk-strip { display: flex; flex-wrap: wrap; gap: 7px; margin: 0 0 28px; }
.risk-strip span { padding: 6px 9px; border-radius: 99px; color: #8e432e; background: #f0ddd3; font-size: 10px; }
.personal-note-banner { margin-bottom: 34px; padding: 16px 18px; border-left: 3px solid var(--accent); background: #eee6db; color: #66574f; font-size: 11px; line-height: 1.75; }
.entry-quick-guide { margin: 36px 0 52px; border-block: 1px solid var(--ink); }
.entry-quick-guide > header { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; padding: 24px 0 18px; }
.entry-quick-guide > header p { margin: 0; color: var(--accent); font-size: 9px; font-weight: 700; letter-spacing: .14em; }
.entry-quick-guide > header h3 { margin: 0; font: 500 25px/1.2 var(--serif); }
.entry-facts { display: grid; grid-template-columns: repeat(4,1fr); border-top: 1px solid var(--line); }
.entry-facts div { min-width: 0; padding: 17px 15px 17px 0; }
.entry-facts div + div { padding-left: 15px; border-left: 1px solid var(--line); }
.entry-facts small { display: block; margin-bottom: 7px; color: var(--muted); font-size: 9px; }
.entry-facts b { display: block; overflow-wrap: anywhere; font: 500 12px/1.5 var(--serif); }
.entry-guide-grid { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); }
.entry-guide-grid section { padding: 24px 28px 24px 0; border-bottom: 1px solid var(--line); }
.entry-guide-grid section:nth-child(even) { padding-inline: 28px 0; border-left: 1px solid var(--line); }
.entry-guide-grid h4 { margin: 0 0 13px; color: var(--accent); font-size: 9px; letter-spacing: .12em; }
.entry-guide-grid p, .entry-guide-grid li { color: #4d6158; font-size: 12px; line-height: 1.75; }
.entry-guide-grid p { margin: 8px 0; }
.entry-guide-grid ul { margin: 0; padding-left: 18px; }
.entry-tags { display: flex; flex-wrap: wrap; gap: 7px; }
.entry-tags span { padding: 6px 9px; border-radius: 99px; background: #e9e5d8; font-size: 10px; }
.entry-guide-warning { display: grid; grid-template-columns: 110px 1fr; gap: 24px; padding: 20px 0; }
.entry-guide-warning b { color: #8e432e; font: 500 15px/1.3 var(--serif); }
.entry-guide-warning p, .carrier-guide-note { margin: 0; color: #674f45; font-size: 11px; line-height: 1.75; }
.carrier-facts { grid-template-columns: repeat(3,1fr); }
.carrier-guide-note { padding: 20px 0; border-top: 1px solid var(--line); }
.note-outline { margin: 48px 0 24px; padding-block: 18px; border-block: 1px solid var(--line); }
.note-outline > p { margin: 0 0 12px; color: var(--accent); font-size: 9px; font-weight: 700; letter-spacing: .14em; }
.note-outline > div { display: flex; flex-wrap: wrap; gap: 7px; }
.note-outline button { padding: 7px 10px; border: 1px solid var(--line); border-radius: 99px; background: transparent; font-size: 10px; cursor: pointer; }
.note-outline button:hover { color: white; border-color: var(--accent); background: var(--accent); }
.markdown-body { font-family: var(--sans); color: #3f554c; font-size: 14px; line-height: 1.9; overflow-wrap: anywhere; }
.markdown-body h2, .markdown-body h3, .markdown-body h4 { color: var(--ink); font-family: var(--serif); font-weight: 500; line-height: 1.35; }
.markdown-body h2 { margin: 46px 0 18px; padding-bottom: 10px; border-bottom: 1px solid var(--line); font-size: 29px; }
.markdown-body h3 { margin: 34px 0 14px; font-size: 22px; }
.markdown-body h4 { margin: 26px 0 10px; font-size: 17px; }
.markdown-body p { margin: 12px 0; }
.markdown-body ul, .markdown-body ol { padding-left: 23px; }
.markdown-body li { margin: 5px 0; }
.markdown-body blockquote { margin: 24px 0; padding: 15px 20px; border-left: 3px solid var(--moss); background: #eef0e7; }
.markdown-body blockquote p { margin: 0; }
.markdown-body a { color: var(--accent); text-underline-offset: 3px; }
.markdown-body .wiki-link { padding: 0; border: 0; border-bottom: 1px dashed var(--accent); background: transparent; color: var(--accent); cursor: pointer; }
.markdown-table-wrap { width: 100%; overflow-x: auto; margin: 22px 0; border-block: 1px solid var(--line); }
.markdown-body table { width: 100%; border-collapse: collapse; min-width: 560px; font-size: 11px; line-height: 1.65; }
.markdown-body th, .markdown-body td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.markdown-body th { color: var(--ink); background: #ece9de; }
.library-related { margin-top: 46px; padding-top: 26px; border-top: 1px solid var(--ink); }
.library-related h3 { margin: 0 0 16px; color: var(--accent); font-size: 10px; letter-spacing: .12em; }
.library-related-list { display: flex; flex-wrap: wrap; gap: 7px; }
.library-related-list button { padding: 7px 10px; border: 1px solid var(--line); border-radius: 99px; background: transparent; font-size: 10px; cursor: pointer; }
.library-related-list button:hover { color: white; background: var(--accent); border-color: var(--accent); }
.book-evidence-section { margin-top: 52px; }
.book-evidence-heading { display: flex; justify-content: space-between; align-items: end; gap: 30px; margin-bottom: 18px; }
.book-evidence-heading p { margin: 0 0 6px; color: var(--accent); font-size: 9px; font-weight: 700; letter-spacing: .14em; }
.book-evidence-heading h3 { margin: 0; color: var(--ink); font: 500 24px/1.2 var(--serif); letter-spacing: 0; }
.book-evidence-heading > span { max-width: 260px; color: var(--muted); font-size: 10px; line-height: 1.6; text-align: right; }
.book-evidence-warning { margin: 0 0 16px; padding: 11px 13px; border-left: 2px solid #b85c3b; background: #f0e3db; color: #744635; font-size: 10px; line-height: 1.65; }
.book-evidence-list { border-top: 1px solid var(--line); }
.book-evidence { display: grid; grid-template-columns: minmax(190px,.8fr) minmax(250px,1.2fr) auto; gap: 22px; align-items: start; padding: 20px 0; border-bottom: 1px solid var(--line); }
.book-evidence-meta b { display: block; font: 500 15px/1.45 var(--serif); }
.book-evidence-meta small { display: block; margin-top: 7px; color: var(--muted); font-size: 9px; line-height: 1.55; }
.book-evidence > p { margin: 0; color: #4d6158; font-size: 11px; line-height: 1.75; }
.book-evidence > button { padding: 6px 0 4px; border: 0; border-bottom: 1px solid var(--ink); background: transparent; font-size: 9px; white-space: nowrap; cursor: pointer; }
.book-evidence > button:hover { color: var(--accent); border-color: var(--accent); }
.topic-map-content { margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--ink); }
.topic-map-lead { display: flex; justify-content: space-between; gap: 24px; align-items: end; margin-bottom: 28px; }
.topic-map-lead p { max-width: 470px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.75; }
.topic-map-lead strong { color: var(--accent); font: 500 20px/1.3 var(--serif); text-align: right; }
.topic-map-content > h3 { margin: 0 0 14px; color: var(--accent); font-size: 10px; letter-spacing: .12em; }
.topic-passage-list { border-top: 1px solid var(--line); }
.topic-passage { display: grid; grid-template-columns: 74px minmax(0,1fr); gap: 18px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.topic-passage > span { color: var(--accent); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
.topic-passage p { margin: 0; color: #4d6158; font-size: 12px; line-height: 1.85; }
.structured-evidence { margin-top: 26px; }
.structured-evidence > h3 { margin: 0 0 14px; color: var(--accent); font-size: 10px; letter-spacing: .12em; }
.structured-overview { margin: 0 0 22px; color: var(--ink); font-size: 13px; line-height: 1.9; }
.structured-groups { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 0 28px; border-top: 1px solid var(--line); }
.structured-group { border-bottom: 1px solid var(--line); }
.structured-group > summary, .structured-sources > summary { display: flex; justify-content: space-between; gap: 16px; padding: 15px 0; color: var(--ink); cursor: pointer; list-style: none; }
.structured-group > summary::-webkit-details-marker, .structured-sources > summary::-webkit-details-marker { display: none; }
.structured-group > summary::after, .structured-sources > summary::after { content: '＋'; color: var(--accent); }
.structured-group[open] > summary::after, .structured-sources[open] > summary::after { content: '－'; }
.structured-group > summary b, .structured-sources > summary b { font: 600 16px/1.4 var(--serif); }
.structured-group > summary span, .structured-sources > summary span { color: var(--muted); font-size: 10px; }
.structured-group-body { padding: 0 0 16px; }
.structured-group .topic-passage { grid-template-columns: minmax(0,1fr); gap: 7px; padding: 13px 0; }
.structured-group .topic-passage small { color: var(--muted); font-size: 10px; }
.structured-sources { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.structured-sources-body { padding-bottom: 4px; }
.structured-sources ul { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.structured-sources li { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); color: var(--ink); font-size: 11px; }
.structured-sources li span { color: var(--muted); text-align: right; }
.structured-note { margin: 20px 0 0; color: var(--muted); font-size: 10px; line-height: 1.7; }
.book-evidence-details, .original-note-details { margin-top: 30px; border-top: 1px solid var(--line); }
.book-evidence-details > summary, .original-note-details > summary { display: flex; justify-content: space-between; gap: 18px; padding: 16px 0; color: var(--ink); cursor: pointer; list-style: none; }
.book-evidence-details > summary::-webkit-details-marker, .original-note-details > summary::-webkit-details-marker { display: none; }
.book-evidence-details > summary::after, .original-note-details > summary::after { content: '＋'; color: var(--accent); }
.book-evidence-details[open] > summary::after, .original-note-details[open] > summary::after { content: '－'; }
.book-evidence-details > summary b, .original-note-details > summary b { font: 500 18px/1.3 var(--serif); }
.book-evidence-details > summary span, .original-note-details > summary span { color: var(--muted); font-size: 10px; }
.book-evidence-details[open] > summary, .original-note-details[open] > summary { border-bottom: 1px solid var(--line); }
.book-evidence-content { margin-top: 0; padding-top: 24px; border-top: 0; }
.original-note-content { margin-top: 34px; padding-top: 26px; border-top: 1px solid var(--line); }
.original-note-content .topic-map-lead { margin-bottom: 20px; }
.library-detail-actions { display: flex; gap: 10px; margin-top: 34px; }
.library-detail-actions button { flex: 1; min-height: 46px; border: 1px solid var(--ink); background: transparent; cursor: pointer; }
.library-detail-actions .primary { color: white; background: var(--ink); }

.utility-intro { padding: 90px clamp(24px, 8vw, 132px) 72px; border-bottom: 1px solid var(--line); background: #e7e5d8; }
.utility-intro h1 { max-width: 900px; font-size: clamp(52px, 7vw, 98px); }
.utility-intro > p:last-child { max-width: 560px; margin: 25px 0 0; color: var(--muted); line-height: 1.8; }
.routine-index { padding: 20px clamp(24px, 8vw, 132px) 70px; background: var(--paper-light); }
.routine-row { display: grid; grid-template-columns: 100px minmax(180px,.7fr) minmax(250px,1.3fr) 36px; gap: 26px; align-items: center; padding: 30px 0; border-bottom: 1px solid var(--line); }
.routine-row > span { color: var(--accent); font: 11px/1 var(--serif); }
.routine-row h2 { margin: 0; font: 500 clamp(23px,2.6vw,38px)/1.15 var(--serif); }
.routine-row p { margin: 0; color: #566760; font-size: 13px; line-height: 1.8; }
.routine-row button { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%; background: transparent; cursor: pointer; transition: .2s ease; }
.routine-row button:hover { color: white; border-color: var(--accent); background: var(--accent); transform: rotate(45deg); }
.routine-detail { grid-column: 2 / -1; display: none; grid-template-columns: 1.2fr .8fr; gap: 40px; padding: 4px 0 10px; }
.routine-row.is-open .routine-detail { display: grid; animation: detailIn .3s ease both; }
@keyframes detailIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.routine-detail strong { display: block; margin-bottom: 9px; color: var(--accent); font-size: 11px; }
.routine-caution { padding-left: 20px; border-left: 2px solid var(--accent-soft); }
.routine-oils { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.routine-oils button { width: auto; height: auto; padding: 6px 9px; border-radius: 99px; font-size: 10px; }
.routine-oils button:hover { transform: none; }
.carrier-section { padding: 70px clamp(24px, 8vw, 132px) 110px; }
.section-note { max-width: 660px; margin: 22px 0 38px; color: var(--muted); line-height: 1.8; }
.carrier-row { display: grid; grid-template-columns: minmax(120px,.8fr) minmax(100px,.6fr) minmax(160px,1fr) minmax(260px,1.5fr); gap: 22px; padding: 20px 0; border-bottom: 1px solid var(--line); align-items: center; }
.carrier-row[data-library-entry] { cursor: pointer; transition: padding .2s ease, background .2s ease; }
.carrier-row[data-library-entry]:hover { padding-inline: 10px; background: rgba(219,224,207,.35); }
.carrier-row b { font: 500 17px/1.3 var(--serif); }
.carrier-row small { display: block; margin-top: 4px; color: var(--muted); font: italic 10px/1.3 Georgia, serif; }
.carrier-row span, .carrier-row p { margin: 0; color: #566760; font-size: 12px; line-height: 1.65; }

.calculator-layout { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(320px,.8fr); gap: 0; margin: 0 clamp(24px, 8vw, 132px); border-inline: 1px solid var(--line); }
.calculator { padding: 62px clamp(24px, 5vw, 70px); background: var(--paper-light); }
.calculator fieldset { margin: 0 0 48px; padding: 0; border: 0; }
.calculator legend { margin-bottom: 20px; font: 500 22px/1.2 var(--serif); }
.segmented { display: grid; grid-template-columns: repeat(4,1fr); border: 1px solid var(--line); }
.segmented label { position: relative; }
.segmented label + label { border-left: 1px solid var(--line); }
.segmented input, .concentration-list input { position: absolute; opacity: 0; }
.segmented span { display: grid; place-items: center; min-height: 54px; font-size: 13px; cursor: pointer; }
.segmented input:checked + span { color: white; background: var(--ink); }
.concentration-list label { position: relative; display: block; border-bottom: 1px solid var(--line); cursor: pointer; }
.concentration-list span { display: grid; grid-template-columns: 70px 1fr; align-items: center; gap: 20px; padding: 18px 12px; }
.concentration-list b { font: 500 22px/1 var(--serif); }
.concentration-list small { color: var(--muted); }
.concentration-list input:checked + span { padding-left: 20px; color: var(--accent); background: #efe6db; }
.calculator-result { display: flex; min-height: 500px; flex-direction: column; align-items: center; justify-content: center; padding: 60px 30px; background: var(--ink); color: white; text-align: center; }
.calculator-result > span { color: #c8d3cb; font-size: 11px; letter-spacing: .14em; }
.calculator-result strong { margin-top: 14px; color: #e7b197; font: 500 clamp(110px,15vw,190px)/.9 var(--serif); }
.calculator-result b { font: 500 20px/1 var(--serif); }
.calculator-result p { margin: 34px 0 9px; font-size: 13px; }
.calculator-result small { max-width: 260px; color: #aebeb5; font-size: 10px; line-height: 1.6; }
.calculator-notes { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; padding: 55px clamp(24px, 8vw, 132px) 100px; }
.calculator-notes p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.8; }
.calculator-notes b { color: var(--ink); }

.safety-intro { background: var(--ink); color: white; }
.safety-intro > p:last-child { color: #bcc9c2; }
.safety-rules { counter-reset: rules; display: grid; grid-template-columns: 1fr 1fr; padding: 50px clamp(24px, 8vw, 132px) 90px; background: var(--ink); color: white; }
.safety-rule { counter-increment: rules; display: grid; grid-template-columns: 52px 1fr; gap: 20px; padding: 35px 40px 35px 0; border-top: 1px solid rgba(255,255,255,.2); }
.safety-rule:nth-child(even) { padding-left: 40px; border-left: 1px solid rgba(255,255,255,.2); }
.safety-rule::before { content: counter(rules, decimal-leading-zero); color: #d99a7d; font: 12px/1 var(--serif); }
.safety-rule h2 { margin: 0 0 10px; font: 500 23px/1.2 var(--serif); }
.safety-rule p { margin: 0; color: #b8c5be; font-size: 12px; line-height: 1.8; }
.red-flags { display: grid; grid-template-columns: 160px 1.2fr .8fr; gap: 55px; padding: 80px clamp(24px, 8vw, 132px); background: #b85c3b; color: white; }
.red-flags > p { margin: 6px 0; font-size: 11px; letter-spacing: .1em; }
.red-flags h2 { margin: 0; font: 500 clamp(28px,3.4vw,48px)/1.25 var(--serif); }
.red-flags div { border-left: 1px solid rgba(255,255,255,.4); padding-left: 34px; }
.red-flags div p { margin: 0; font-size: 13px; line-height: 1.9; }
.sources { padding: 75px clamp(24px, 8vw, 132px) 120px; }
.sources h2 { font: 500 30px/1.2 var(--serif); }
.sources > p { max-width: 780px; color: var(--muted); font-size: 13px; line-height: 1.9; }
.source-links { display: flex; flex-wrap: wrap; gap: 12px; margin: 30px 0; }
.source-links a { padding-bottom: 4px; border-bottom: 1px solid var(--ink); font-size: 12px; text-decoration: none; }
.sources > small { display: block; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); line-height: 1.7; }

.mobile-nav { display: none; }
.oil-dialog { width: min(760px, 100%); height: 100%; max-height: none; margin: 0 0 0 auto; padding: 0; border: 0; background: var(--paper-light); color: var(--ink); }
.oil-dialog::backdrop { background: rgba(12,31,26,.55); backdrop-filter: blur(4px); }
.oil-dialog[open] { animation: dialogIn .36s cubic-bezier(.2,.7,.2,1) both; }
@keyframes dialogIn { from { opacity: 0; transform: translateX(60px); } to { opacity: 1; transform: none; } }
.dialog-shell { min-height: 100%; padding: 30px clamp(24px, 6vw, 74px) 80px; }
.dialog-close { position: sticky; top: 20px; z-index: 2; float: right; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 50%; background: rgba(250,248,241,.88); font-size: 26px; line-height: 1; cursor: pointer; backdrop-filter: blur(8px); }
.detail-category { display: inline-block; margin: 60px 0 18px; color: var(--accent); font-size: 10px; font-weight: 700; letter-spacing: .16em; }
.detail-title { margin: 0; font: 500 clamp(48px,8vw,82px)/.95 var(--serif); letter-spacing: -.05em; }
.detail-latin { margin: 12px 0 26px; color: var(--muted); font: italic 14px/1.4 Georgia, serif; }
.detail-profile { margin: 0 0 32px; color: #4f625b; font: 500 17px/1.9 var(--serif); }
.detail-facts { display: grid; grid-template-columns: repeat(3,1fr); border-block: 1px solid var(--line); }
.detail-facts div { padding: 18px 14px 18px 0; }
.detail-facts div + div { padding-left: 14px; border-left: 1px solid var(--line); }
.detail-facts small { display: block; margin-bottom: 6px; color: var(--muted); font-size: 9px; letter-spacing: .1em; }
.detail-facts b { font: 500 13px/1.4 var(--serif); }
.detail-block { padding: 32px 0; border-bottom: 1px solid var(--line); }
.detail-block h3 { margin: 0 0 17px; color: var(--accent); font-size: 10px; letter-spacing: .14em; }
.detail-block p, .detail-block li { color: #50625a; font-size: 13px; line-height: 1.85; }
.detail-block ul { margin: 0; padding-left: 19px; }
.detail-tag-list { display: flex; flex-wrap: wrap; gap: 7px; }
.detail-tag-list button, .detail-tag-list span { padding: 7px 10px; border: 0; border-radius: 99px; background: #e9e5d8; font-size: 11px; }
.detail-tag-list button { cursor: pointer; }
.detail-tag-list button:hover { color: white; background: var(--accent); }
.detail-warning { margin-top: 24px; padding: 22px; border-left: 3px solid var(--accent); background: #f0e3db; }
.detail-warning b { display: block; margin-bottom: 9px; font: 500 17px/1.2 var(--serif); }
.detail-warning p { margin: 0; color: #744635; font-size: 12px; line-height: 1.8; }
.oil-note-link button { padding: 8px 0 5px; border: 0; border-bottom: 1px solid var(--ink); background: transparent; font-size: 11px; cursor: pointer; }
.oil-note-link button:hover { color: var(--accent); border-color: var(--accent); }
.detail-actions { display: flex; gap: 10px; margin-top: 30px; }
.detail-actions button { flex: 1; min-height: 46px; border: 1px solid var(--ink); background: transparent; cursor: pointer; }
.detail-actions .primary { color: white; background: var(--ink); }
.toast { position: fixed; z-index: 100; left: 50%; bottom: -70px; transform: translateX(-50%); padding: 11px 16px; border-radius: 99px; background: var(--ink-deep); color: white; font-size: 12px; opacity: 0; transition: .25s ease; }
.toast.is-visible { bottom: 28px; opacity: 1; }

@media (max-width: 960px) {
  .topbar { grid-template-columns: 1fr auto; }
  .desktop-nav { display: none; }
  .intro { grid-template-columns: 1fr .7fr; padding-inline: 44px; }
  .intro h1 { font-size: clamp(56px, 9vw, 84px); }
  .botanical { width: 300px; min-width: 250px; transform: translateX(40px); }
  .archive-intro { grid-template-columns: 1fr .7fr; padding-inline: 44px; }
  .archive-intro h1 { font-size: clamp(56px,9vw,84px); }
  .archive-botanical { width: 290px; min-width: 240px; transform: translateX(35px); }
  .archive-layout { grid-template-columns: 200px 1fr; }
  .archive-sections { padding-left: 24px; }
  .library-domain { grid-template-columns: 25px 1fr auto; padding-inline: 18px; }
  .library-domain b { font-size: 19px; }
  .library-domain small { display: none; }
  .search-zone { align-items: flex-start; flex-direction: column; gap: 12px; }
  .search-box { width: 100%; max-width: none; }
  .library-layout { grid-template-columns: 200px 1fr; }
  .category-rail { padding-left: 24px; }
  .oil-row { grid-template-columns: 28px minmax(150px,.8fr) minmax(180px,1fr) 40px; }
  .oil-aroma { display: none; }
  .routine-row { grid-template-columns: 70px minmax(170px,.8fr) 1.2fr 36px; }
  .red-flags { grid-template-columns: 1fr 2fr; }
  .red-flags div { grid-column: 2; }
  .database-intro { grid-template-columns: 1fr; gap: 40px; }
  .library-workspace { grid-template-columns: 210px 1fr; }
  .library-filters { padding-left: 24px; }
  .library-row { grid-template-columns: 78px minmax(160px,.7fr) 1.2fr 38px; }
  .library-meta { display: none; }
}

@media (max-width: 680px) {
  :root { --header-h: 62px; }
  body { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  .topbar { height: var(--header-h); padding: 0 16px; }
  .brand-mark { width: 32px; height: 32px; font-size: 17px; }
  .brand b { font-size: 17px; }
  .brand small { display: none; }
  .install-button { padding: 7px 11px; font-size: 10px; }
  .intro {
    min-height: 440px; grid-template-columns: 1fr; padding: 42px 22px 38px;
    background: linear-gradient(152deg, #eee8d9 0 68%, #dbe0cf 68% 100%);
  }
  .eyebrow { margin-bottom: 15px; font-size: 9px; }
  .intro h1 { font-size: clamp(52px,18vw,76px); }
  .intro-copy > p:last-child { max-width: 310px; margin-top: 20px; font-size: 13px; line-height: 1.75; }
  .botanical { position: absolute; right: -85px; top: 90px; width: 260px; min-width: 0; opacity: .24; }
  .botanical span, .botanical small { display: none; }
  .archive-intro {
    min-height: 430px; grid-template-columns: 1fr; padding: 43px 20px 40px;
    background: linear-gradient(152deg,#eee8d9 0 69%,#dbe0cf 69% 100%);
  }
  .archive-intro h1 { font-size: clamp(50px,17vw,70px); }
  .archive-intro .intro-copy > p:last-child { max-width: 315px; margin-top: 20px; font-size: 13px; line-height: 1.75; }
  .archive-botanical { position: absolute; right: -78px; top: 84px; width: 250px; min-width: 0; opacity: .2; }
  .library-domain-nav { grid-template-columns: 1fr 1fr; }
  .library-domain { min-height: 88px; grid-template-columns: 24px 1fr auto; padding: 18px 15px; }
  .library-domain:nth-child(even) { border-right: 0; }
  .library-domain:nth-child(-n+4) { border-bottom: 1px solid var(--line); }
  .library-domain:last-child { grid-column: auto; border-right: 0; }
  .library-domain b { font-size: 18px; }
  .library-domain em { font-size: 21px; }
  .archive-layout { display: block; }
  .archive-sections { display: flex; align-items: center; gap: 18px; padding: 10px 16px; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
  .archive-sections::-webkit-scrollbar { display: none; }
  .archive-sections > p, .archive-personal > p { display: none; }
  .archive-sections > .archive-section, #librarySectionFilters .archive-section, .archive-personal .archive-section { width: auto; flex: 0 0 auto; }
  #librarySectionFilters, .archive-personal { display: flex; flex: 0 0 auto; gap: 18px; }
  .archive-personal { margin: 0; padding: 0 0 0 18px; border-top: 0; border-left: 1px solid var(--line); }
  .archive-section { padding: 7px 0; }
  .archive-section em { display: none; }
  .search-zone { top: var(--header-h); padding: 14px 16px 12px; }
  .search-box input { font-size: 14px; }
  .search-box kbd { display: none; }
  .suggestions { width: 100%; }
  .suggestions button { padding: 7px 11px; }
  .library-layout { display: block; }
  .category-rail { padding: 12px 16px; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
  .category-rail::-webkit-scrollbar { display: none; }
  .category-rail > p, .favorite-filter { display: none; }
  .category-rail > .category-button, #categoryButtons .category-button { display: inline-grid; width: auto; }
  #categoryButtons { display: inline-flex; width: max-content; }
  .category-button { grid-template-columns: auto auto; gap: 5px; margin-right: 18px; padding: 8px 0; border-bottom-width: 2px; }
  .category-button em { display: none; }
  .oil-library { padding: 30px 16px 54px; }
  .section-heading { align-items: start; }
  .section-heading h2 { font-size: 25px; }
  .oil-row { grid-template-columns: 24px 1fr 38px; gap: 12px; min-height: 92px; }
  .oil-aroma { display: none; }
  .oil-tags { grid-column: 2; margin-top: -20px; }
  .oil-tags span:nth-child(n+3) { display: none; }
  .favorite-button { grid-column: 3; grid-row: 1; }
  .oil-row-open { grid-column: 3; grid-row: 1; }
  .utility-intro { padding: 54px 20px 46px; }
  .utility-intro h1 { font-size: clamp(48px,15vw,66px); }
  .utility-intro > p:last-child { font-size: 13px; }
  .routine-index { padding: 5px 18px 50px; }
  .routine-row { grid-template-columns: 36px 1fr 36px; gap: 10px; padding: 24px 0; }
  .routine-row > p { grid-column: 2 / -1; }
  .routine-detail { grid-column: 2 / -1; grid-template-columns: 1fr; gap: 18px; }
  .routine-caution { padding-left: 14px; }
  .carrier-section { padding: 48px 18px 70px; }
  .carrier-row { grid-template-columns: 1fr 1fr; gap: 10px 16px; padding: 18px 0; }
  .carrier-row p { grid-column: 1 / -1; }
  .calculator-layout { display: block; margin: 0; border: 0; }
  .calculator { padding: 42px 18px; }
  .calculator fieldset { margin-bottom: 38px; }
  .segmented span { min-height: 48px; font-size: 12px; }
  .concentration-list span { grid-template-columns: 55px 1fr; }
  .calculator-result { min-height: 410px; }
  .calculator-result strong { font-size: 140px; }
  .calculator-notes { grid-template-columns: 1fr; gap: 22px; padding: 40px 20px 70px; }
  .safety-rules { grid-template-columns: 1fr; padding: 20px 20px 55px; }
  .safety-rule, .safety-rule:nth-child(even) { padding: 27px 0; border-left: 0; }
  .red-flags { display: block; padding: 55px 20px; }
  .red-flags h2 { margin: 18px 0 28px; }
  .red-flags div { padding: 24px 0 0; border-left: 0; border-top: 1px solid rgba(255,255,255,.4); }
  .sources { padding: 50px 20px 76px; }
  .source-links { flex-direction: column; align-items: flex-start; }
  .database-intro { min-height: 0; padding: 52px 20px 42px; }
  .database-intro h1 { font-size: 50px; }
  .database-intro > div > p:last-child { font-size: 12px; }
  .database-stats { gap: 0; }
  .database-stats div { padding-right: 8px; }
  .database-stats div + div { padding-left: 8px; }
  .database-stats dt { font-size: 27px; }
  .database-stats dd { font-size: 8px; }
  .library-search-zone { flex-direction: column; align-items: stretch; gap: 10px; padding: 13px 16px; }
  .library-search { width: 100%; }
  .library-quick-search { width: 100%; }
  .library-workspace { display: block; }
  .library-filters { display: flex; gap: 24px; padding: 10px 16px; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
  .library-filters::-webkit-scrollbar { display: none; }
  .filter-group { display: flex; flex: 0 0 auto; gap: 17px; margin: 0; }
  .filter-group > p, .section-filter-group, .filter-group:last-child { display: none; }
  #libraryTypeFilters { display: flex; gap: 17px; }
  .library-filter { width: auto; flex: 0 0 auto; padding: 7px 0; white-space: nowrap; }
  .library-filter em { display: none; }
  .library-results { padding: 28px 16px 60px; }
  .library-row { grid-template-columns: 68px 1fr 36px; gap: 10px; min-height: 106px; padding: 14px 0; }
  .library-row:hover { padding-inline: 0; }
  .library-title b { font-size: 18px; }
  .library-excerpt { grid-column: 2 / -1; font-size: 10px; margin-top: -8px; }
  .library-row .favorite-button { grid-column: 3; grid-row: 1; }
  .library-dialog { width: 100%; height: calc(100% - 30px); margin-top: 30px; border-radius: 18px 18px 0 0; }
  .library-dialog[open] { animation-name: dialogUp; }
  .library-dialog-shell { padding: 18px 18px 70px; }
  .library-detail-kicker { margin-top: 46px; }
  .library-detail-title { font-size: 44px; }
  .entry-quick-guide { margin-block: 28px 42px; }
  .entry-quick-guide > header { padding-block: 20px 15px; }
  .entry-facts, .carrier-facts { grid-template-columns: 1fr 1fr; }
  .entry-facts div:nth-child(3) { border-left: 0; }
  .entry-facts div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .carrier-facts div:last-child { grid-column: 1 / -1; }
  .entry-guide-grid { grid-template-columns: 1fr; }
  .entry-guide-grid section, .entry-guide-grid section:nth-child(even) { padding: 21px 0; border-left: 0; }
  .entry-guide-warning { grid-template-columns: 1fr; gap: 8px; }
  .book-evidence-heading { display: block; }
  .book-evidence-heading > span { display: block; margin-top: 10px; text-align: left; }
  .book-evidence { grid-template-columns: 1fr; gap: 10px; padding: 18px 0; }
  .book-evidence > button { justify-self: start; }
  .topic-map-lead { display: block; }
  .topic-map-lead strong { display: block; margin-top: 14px; text-align: left; }
  .topic-passage { grid-template-columns: 1fr; gap: 7px; }
  .structured-groups { grid-template-columns: 1fr; }
  .book-evidence-details > summary, .original-note-details > summary { display: block; }
  .book-evidence-details > summary span, .original-note-details > summary span { display: block; margin-top: 6px; }
  .markdown-body { font-size: 13px; line-height: 1.85; }
  .markdown-body h2 { font-size: 25px; }
  .markdown-body h3 { font-size: 20px; }
  .library-detail-actions { flex-direction: column; }
  .mobile-nav {
    position: fixed; z-index: 45; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5,1fr);
    min-height: calc(62px + env(safe-area-inset-bottom)); padding: 6px 4px env(safe-area-inset-bottom);
    border-top: 1px solid var(--line); background: rgba(250,248,241,.96); backdrop-filter: blur(18px);
  }
  .mobile-nav-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; background: transparent; color: var(--muted); font-size: 9px; }
  .mobile-nav-item span { display: grid; place-items: center; width: 24px; height: 24px; font: 600 18px/1 var(--serif); }
  .mobile-nav-item.is-active { color: var(--accent); }
  .oil-dialog { width: 100%; height: calc(100% - 30px); margin-top: 30px; border-radius: 18px 18px 0 0; }
  .oil-dialog[open] { animation-name: dialogUp; }
  @keyframes dialogUp { from { opacity: 0; transform: translateY(50px); } to { opacity: 1; transform: none; } }
  .dialog-shell { padding: 20px 20px 70px; }
  .dialog-close { top: 12px; }
  .detail-category { margin-top: 45px; }
  .detail-title { font-size: 52px; }
  .detail-profile { font-size: 15px; }
  .toast.is-visible { bottom: calc(78px + env(safe-area-inset-bottom)); }
}

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