:root {
  --paper: #f7f2e8;
  --paper-strong: #fffaf1;
  --surface: #ffffff;
  --surface-warm: #fbf0df;
  --ink: #201b16;
  --muted: #746b5d;
  --faint: #a79a88;
  --line: #ded0bd;
  --line-strong: #b99f7a;
  --wine: #7a2536;
  --wine-dark: #4b1420;
  --teal: #266d72;
  --olive: #63723e;
  --saffron: #c99825;
  --blue: #315e85;
  --shadow: 0 16px 36px rgba(63, 40, 24, 0.12);
  --page-top: #fffaf3;
  --page-bottom: #efe4d4;
  --grid-color: transparent;
  --panel-bg: rgba(255, 250, 241, 0.86);
  --panel-bg-solid: #fffdf8;
  --panel-bg-soft: #fffaf2;
  --header-bg: rgba(255, 250, 241, 0.92);
  --brand-bg: #ffffff;
  --button-bg: #fffaf4;
  --tag-bg: #fff6ee;
  --input-bg: #ffffff;
  --guide-stage: #f8eddd;
  --bottle-photo-opacity: 0.42;
  --bottle-photo-blend: multiply;
  --bottle-photo-filter: saturate(0.88) contrast(1.02);
  --bar-bg: #4b1420;
  --bar-ink: #f8e7d4;
  --font-sans: "Zen Kaku Gothic Antique", "Noto Sans JP", system-ui, sans-serif;
  --font-display: "Avenir Next", "Zen Kaku Gothic Antique", "Noto Sans JP", system-ui, sans-serif;
  --font-serif: "Noto Serif JP", "Yu Mincho", serif;
  --font-latin: "Inter", system-ui, sans-serif;
}

[data-theme="dark"] {
  color-scheme: dark;
  --paper: #111418;
  --paper-strong: #f6efe3;
  --surface: #15191f;
  --surface-warm: #1a1f26;
  --ink: #f4efe7;
  --muted: #c5c0b8;
  --faint: #8f98a5;
  --line: #333d48;
  --line-strong: #596675;
  --wine: #e77f96;
  --wine-dark: #8c2338;
  --teal: #72c7cf;
  --olive: #a9ba79;
  --saffron: #e2bd67;
  --blue: #8ebce8;
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.34);
  --page-top: #101318;
  --page-bottom: #0a0c10;
  --grid-color: transparent;
  --panel-bg: rgba(21, 25, 31, 0.92);
  --panel-bg-solid: #171c23;
  --panel-bg-soft: #1d232b;
  --header-bg: rgba(15, 18, 23, 0.9);
  --brand-bg: #141920;
  --button-bg: #1d232b;
  --tag-bg: #261c25;
  --input-bg: #11161d;
  --guide-stage: #202732;
  --bottle-photo-opacity: 0.28;
  --bottle-photo-blend: screen;
  --bottle-photo-filter: grayscale(0.15) sepia(0.18) saturate(0.85);
  --bar-bg: #551421;
  --bar-ink: #fff1df;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: linear-gradient(180deg, var(--page-top) 0, var(--paper) 420px, var(--page-bottom) 100%);
  font-family: var(--font-sans);
  line-height: 1.7;
  overflow-x: hidden;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

.preview-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 6px 16px;
  color: var(--bar-ink);
  background: var(--bar-bg);
  font-family: var(--font-latin);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.preview-bar > span:first-child {
  justify-self: start;
  min-width: 0;
}

.preview-note {
  justify-self: center;
}

.theme-controls {
  justify-self: end;
  display: flex;
  gap: 4px;
  min-width: 0;
}

.theme-toggle {
  white-space: nowrap;
  min-height: 28px;
  padding: 3px 10px;
  border: 1px solid rgba(248, 231, 212, 0.45);
  border-radius: 8px;
  color: var(--bar-ink);
  background: rgba(255, 255, 255, 0.08);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.16);
}

.theme-toggle.is-active {
  border-color: rgba(248, 231, 212, 0.78);
  background: rgba(255, 255, 255, 0.2);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 28px;
  border-bottom: 1px solid rgba(185, 159, 122, 0.5);
  background: var(--header-bg);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 2px solid var(--wine);
  color: var(--wine);
  background: var(--brand-bg);
  font-family: var(--font-latin);
  font-size: 13px;
  font-weight: 800;
}

.brand strong {
  display: block;
  font-family: var(--font-latin);
  font-size: 16px;
  line-height: 1.2;
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dictionary-header-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.top-nav a {
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  font-family: var(--font-latin);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.dictionary-login-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 31px;
  padding: 6px 10px;
  border: 1px solid color-mix(in srgb, var(--wine) 42%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--wine) 7%, var(--panel-bg-solid));
  color: var(--wine);
  font-family: var(--font-latin);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.top-nav a:hover,
.dictionary-login-link:hover {
  border-color: var(--line);
  color: var(--wine);
  background: var(--button-bg);
}

main {
  width: min(1480px, calc(100% - 32px));
  margin: 0 auto;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--wine);
  font-family: var(--font-latin);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(340px, 0.72fr);
  gap: 18px;
  align-items: stretch;
  padding: 42px 0 26px;
}

.hero-copy,
.hero-panel,
.desk-controls,
.desk-side .side-panel,
.term-card,
.path-card,
.guide-card,
.term-layout,
.term-nav a,
.empty-state {
  border: 1px solid rgba(185, 159, 122, 0.72);
  border-radius: 8px;
  background: var(--panel-bg);
  box-shadow: var(--shadow);
}

.hero-copy {
  position: relative;
  min-height: 310px;
  padding: 34px clamp(220px, 24vw, 304px) 34px 34px;
  overflow: hidden;
}

.hero-copy > :not(.hero-bottle-mark) {
  position: relative;
  z-index: 1;
}

.hero-bottle-mark {
  position: absolute;
  top: 6px;
  right: clamp(10px, 2.4vw, 28px);
  bottom: 4px;
  z-index: 0;
  width: clamp(190px, 24vw, 286px);
  overflow: hidden;
  pointer-events: none;
}

.hero-bottle-mark::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("./assets/hero-wine-bottle-dictionary-transparent.png") center 75% / auto 147% no-repeat;
  filter: var(--bottle-photo-filter);
  mix-blend-mode: var(--bottle-photo-blend);
  opacity: var(--bottle-photo-opacity);
  transform: rotate(7deg);
  transform-origin: center;
}

.hero h1 {
  max-width: 820px;
  margin: 0;
  font-family: var(--font-display);
  font-size: 52px;
  font-weight: 900;
  line-height: 1.22;
  overflow-wrap: anywhere;
}

.hero h1 span {
  color: var(--wine);
  white-space: nowrap;
}

.hero-lead {
  max-width: 660px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.9;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.primary-link,
.quiet-button,
.reset-button,
.text-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 9px 16px;
  border-radius: 8px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.primary-link {
  border: 1px solid var(--wine);
  color: var(--paper-strong);
  background: var(--wine);
}

.primary-link:hover {
  background: var(--wine-dark);
}

.quiet-button,
.reset-button {
  border: 1px solid var(--line-strong);
  background: var(--button-bg);
}

.quiet-button:hover,
.reset-button:hover {
  color: var(--wine);
  border-color: var(--wine);
}

.hero-panel {
  display: flex;
  flex-direction: column;
  min-height: 310px;
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(38, 109, 114, 0.09), var(--panel-bg)),
    var(--panel-bg);
}

.panel-kicker {
  color: var(--teal);
  font-family: var(--font-latin);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.spotlight-term {
  display: block;
  margin-top: 14px;
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 900;
  line-height: 1.35;
  text-decoration: none;
}

.spotlight-term:hover {
  color: var(--wine);
}

.hero-panel p {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.spotlight-guide {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: auto;
  padding-top: 20px;
  color: var(--guide-color);
  font-weight: 800;
}

.spotlight-guide img {
  width: 58px;
  height: 58px;
  object-fit: cover;
  object-position: top center;
  border: 2px solid var(--guide-color);
  border-radius: 50%;
  background: var(--brand-bg);
}

.desk {
  display: grid;
  grid-template-columns: 282px minmax(0, 1fr) 300px;
  gap: 18px;
  align-items: start;
  padding: 18px 0 46px;
}

.desk-controls,
.desk-side {
  position: sticky;
  top: 86px;
}

.desk-controls {
  padding: 18px;
}

.search-box label,
.filter-title {
  display: block;
  margin-bottom: 8px;
  color: var(--wine);
  font-size: 13px;
  font-weight: 800;
}

.search-box input {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--input-bg);
  color: var(--ink);
  outline: none;
}

.search-box input:focus {
  border-color: var(--wine);
  box-shadow: 0 0 0 3px rgba(122, 37, 54, 0.12);
}

.result-meta {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 10px;
  color: var(--muted);
  font-family: var(--font-latin);
}

.result-meta strong {
  color: var(--wine);
  font-size: 28px;
  line-height: 1;
}

.filter-block {
  margin-top: 20px;
}

.index-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.pill-list,
.guide-filter-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pill {
  min-height: 34px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-bg-solid);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.pill:hover:not(:disabled),
.pill.is-active {
  border-color: var(--wine);
  color: var(--paper-strong);
  background: var(--wine);
}

.pill:disabled {
  color: #c4b6a3;
  cursor: not-allowed;
}

.guide-filter {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-bg-solid);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.guide-filter img {
  width: 24px;
  height: 24px;
  object-fit: cover;
  object-position: top center;
  border-radius: 50%;
  background: var(--guide-stage);
}

.guide-filter:hover,
.guide-filter.is-active {
  color: var(--guide-color);
  border-color: var(--guide-color);
  background: var(--brand-bg);
}

.reset-button {
  width: 100%;
  margin-top: 22px;
}

.desk-main {
  min-width: 0;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin-bottom: 16px;
}

.section-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 900;
  line-height: 1.3;
}

.section-head > p {
  max-width: 460px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  text-align: right;
}

.term-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.term-grid-compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.term-card {
  display: flex;
  flex-direction: column;
  min-height: 238px;
  overflow: hidden;
  background: var(--panel-bg-solid);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.term-card-compact {
  min-height: 152px;
}

.term-card-compact .term-card-main {
  padding: 16px 16px 8px;
}

.term-card-compact h3 {
  font-size: 21px;
}

.term-card-compact .term-card-footer {
  min-height: 34px;
  padding: 0 16px 14px;
}

.term-card:hover {
  transform: translateY(-2px);
  border-color: var(--guide-color);
  box-shadow: var(--shadow);
}

.term-card-main {
  flex: 1;
  padding: 20px 20px 12px;
  text-decoration: none;
}

.term-category {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 3px 8px;
  border: 1px solid rgba(122, 37, 54, 0.24);
  border-radius: 8px;
  color: var(--wine);
  background: var(--tag-bg);
  font-size: 12px;
  font-weight: 800;
}

.term-card h3 {
  margin: 13px 0 0;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 900;
  line-height: 1.35;
}

.term-reading {
  margin: 6px 0 0;
  color: var(--faint);
  font-size: 12px;
}

.term-definition {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.term-card-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 20px 16px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.guide-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--guide-color);
}

.desk-side {
  display: grid;
  gap: 12px;
}

.side-panel {
  padding: 18px;
}

.current-guide {
  overflow: hidden;
  border-left: 5px solid var(--guide-color);
}

.guide-portrait {
  height: 150px;
  margin: -18px -18px 16px;
  border-bottom: 1px solid rgba(185, 159, 122, 0.55);
  background: linear-gradient(180deg, color-mix(in srgb, var(--brand-bg) 72%, transparent), var(--panel-bg));
  overflow: hidden;
}

.guide-portrait img {
  display: block;
  width: 100%;
  height: 190px;
  object-fit: contain;
  object-position: center top;
  transform: translateY(4px);
}

.side-panel h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 900;
}

.side-panel p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.text-link {
  min-height: 36px;
  margin-top: 14px;
  padding: 7px 12px;
  border: 1px solid var(--guide-color, var(--wine));
  color: var(--guide-color, var(--wine));
  background: var(--button-bg);
  font-size: 13px;
}

.related-mini {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.related-mini a {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-bg-solid);
  text-decoration: none;
}

.related-mini a:hover {
  border-color: var(--wine);
}

.related-mini span {
  color: var(--faint);
  font-size: 12px;
}

.term-preview,
.index-search,
.paths,
.guides {
  padding: 34px 0 50px;
  border-top: 1px solid rgba(185, 159, 122, 0.75);
}

.term-preview {
  padding-top: 12px;
}

.term-preview-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 18px;
}

.term-preview-more span {
  color: var(--faint);
  font-family: var(--font-latin);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.index-search-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.index-panel {
  display: grid;
  gap: 18px;
  padding: 20px;
  border: 1px solid rgba(185, 159, 122, 0.72);
  border-radius: 8px;
  background: var(--panel-bg-solid);
  box-shadow: var(--shadow);
}

.index-panel-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.index-panel-head > span {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 2px solid var(--wine);
  color: var(--wine);
  background: var(--brand-bg);
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
}

.index-panel h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 23px;
  font-weight: 900;
  line-height: 1.35;
}

.index-panel p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.index-row-buttons,
.roman-row-buttons,
.roman-filter-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.index-jump {
  display: inline-grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 6px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--ink);
  background: var(--button-bg);
  cursor: pointer;
}

.index-jump:hover:not(:disabled) {
  border-color: var(--wine);
  color: var(--wine);
}

.index-jump:disabled {
  color: var(--faint);
  cursor: not-allowed;
  opacity: 0.52;
}

.index-jump strong {
  font-size: 16px;
  font-weight: 900;
}

.index-jump.roman strong {
  font-family: var(--font-latin);
  letter-spacing: 0.04em;
}

.index-jump small {
  color: var(--faint);
  font-family: var(--font-latin);
  font-size: 11px;
  font-weight: 800;
}

.path-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.path-card {
  display: grid;
  align-content: start;
  min-height: 226px;
  padding: 16px;
  border-top: 4px solid var(--path-color);
  background: var(--panel-bg-solid);
}

.path-top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.path-top span {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid color-mix(in srgb, var(--path-color) 42%, var(--line));
  border-radius: 50%;
  color: var(--path-color);
  background: color-mix(in srgb, var(--path-color) 8%, var(--panel-bg-solid));
  font-family: var(--font-latin);
  font-size: 11px;
  font-weight: 800;
}

.path-top strong {
  min-width: 0;
  color: var(--path-color);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.35;
}

.path-top em {
  color: var(--faint);
  font-family: var(--font-latin);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}

.path-card h3 {
  margin: 14px 0 0;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 900;
  line-height: 1.35;
}

.path-card p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.path-card ul {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.path-card a {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--tag-bg);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.path-card a:hover {
  border-color: var(--path-color);
  color: var(--path-color);
  background: var(--panel-bg-solid);
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.guide-card {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 18px;
  min-height: 202px;
  padding: 16px;
  border-left: 5px solid var(--guide-color);
  background: var(--panel-bg-solid);
}

.guide-card-image {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--guide-stage);
  overflow: hidden;
}

.guide-card-image img {
  width: 100%;
  height: 100%;
  min-height: 168px;
  object-fit: contain;
  object-position: center bottom;
}

.guide-card span {
  color: var(--guide-color);
  font-family: var(--font-latin);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.guide-card h3 {
  margin: 6px 0 0;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 900;
}

.guide-card p {
  margin: 8px 0 14px;
  color: var(--muted);
  font-size: 14px;
}

.guide-level {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.guide-level b {
  display: inline-grid;
  place-items: center;
  min-width: 50px;
  min-height: 34px;
  padding: 4px 9px;
  border: 1px solid color-mix(in srgb, var(--guide-color) 56%, var(--line));
  border-radius: 8px;
  color: var(--guide-color);
  background: color-mix(in srgb, var(--guide-color) 9%, var(--panel-bg-solid));
  font-family: var(--font-latin);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

.guide-level b.is-beginner {
  font-family: var(--font-sans);
  font-size: 18px;
}

.guide-level small,
.guide-level strong {
  display: block;
  line-height: 1.25;
}

.guide-level small {
  color: var(--faint);
  font-size: 11px;
  font-weight: 800;
}

.guide-level strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
}

.empty-state {
  min-height: 360px;
  display: grid;
  place-items: center;
  padding: 44px;
  text-align: center;
}

.empty-state img {
  width: 96px;
  opacity: 0.68;
}

.empty-state h2,
.empty-state h1 {
  margin: 8px 0 0;
  font-family: var(--font-display);
  font-weight: 900;
}

.empty-state p {
  max-width: 440px;
  margin: 8px auto 0;
  color: var(--muted);
}

.terms-page,
.term-page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 42px 0 82px;
}

.back-link {
  display: inline-flex;
  margin-bottom: 18px;
  color: var(--wine);
  font-weight: 800;
  text-decoration: none;
}

.back-link:hover {
  text-decoration: underline;
}

.term-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 22px;
  padding: 32px;
  background: var(--panel-bg-solid);
}

.term-layout-generated {
  grid-template-columns: 1fr;
}

.term-article {
  padding: 12px;
}

.term-article strong {
  color: var(--ink);
  font-weight: 800;
}

.term-article h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 50px;
  font-weight: 900;
  line-height: 1.14;
}

.large-reading {
  margin: 12px 0 0;
  color: var(--faint);
}

.term-definition-panel {
  margin: 32px 0 0;
  padding: 22px 26px 24px;
  border: 1px solid var(--line-strong);
  border-left: 6px solid var(--wine);
  border-radius: 8px;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--wine) 10%, transparent), transparent 62%),
    var(--panel-bg-soft);
}

.term-definition-panel span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 2px 9px;
  border-radius: 6px;
  color: var(--paper-strong);
  background: var(--wine);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

.term-lead {
  margin: 14px 0 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.78;
}

.term-lead p {
  margin: 0;
}

.term-lead p + p {
  margin-top: 0.9em;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-top: 26px;
}

.detail-grid section {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-bg-soft);
}

.detail-grid h2,
.related-section h2,
.term-section h2 {
  margin: 0;
  color: var(--wine);
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 900;
}

.copy-block {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.9;
}

.copy-block p {
  margin: 0;
}

.copy-block p + p {
  margin-top: 0.95em;
}

.term-section {
  margin-top: 22px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-bg-soft);
}

.term-section .copy-block {
  margin: 10px 0 0;
  color: var(--muted);
}

.term-comment-card {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  margin-top: 20px;
  padding: 0;
  border: 0;
  background: transparent;
}

.term-comment-guide {
  margin: 0;
  text-align: center;
}

.term-comment-guide img {
  display: block;
  width: 104px;
  height: 124px;
  object-fit: contain;
  object-position: center bottom;
}

.term-comment-guide figcaption {
  margin-top: 4px;
  color: var(--guide-color);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.2;
}

.term-comment-bubble {
  position: relative;
  display: flex;
  align-items: center;
  justify-self: start;
  width: fit-content;
  max-width: min(680px, 100%);
  min-height: 66px;
  margin-top: 12px;
  padding: 13px 18px;
  border: 1px solid color-mix(in srgb, var(--guide-color) 48%, var(--line));
  border-radius: 8px;
  background: var(--panel-bg-soft);
}

.term-comment-bubble::before {
  content: "";
  position: absolute;
  left: -15px;
  top: 16px;
  width: 0;
  height: 0;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  border-right: 15px solid color-mix(in srgb, var(--guide-color) 48%, var(--line));
}

.term-comment-bubble::after {
  content: "";
  position: absolute;
  left: -13px;
  top: 17px;
  width: 0;
  height: 0;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  border-right: 14px solid var(--panel-bg-soft);
}

.term-comment-card .copy-block {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.85;
}

.spec-table {
  width: 100%;
  margin-top: 12px;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 14px;
}

.spec-table tr + tr {
  border-top: 1px solid var(--line);
}

.spec-table th,
.spec-table td {
  padding: 10px 0;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.spec-table th {
  width: 34%;
  padding-right: 16px;
  color: var(--muted);
  font-weight: 800;
  text-align: left;
}

.spec-table td {
  color: var(--ink);
}

.source-note {
  margin-left: 4px;
  color: var(--wine);
  font-size: 11px;
  font-weight: 800;
}

.term-sources {
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 12px;
}

.term-sources > span {
  color: var(--muted);
  font-weight: 800;
}

.term-sources ol {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
}

.term-sources li {
  display: inline-flex;
  gap: 4px;
  min-width: 0;
}

.term-sources a {
  color: var(--muted);
  text-decoration-color: var(--line-strong);
}

.term-sources a:hover {
  color: var(--wine);
}

.term-guide {
  align-self: start;
  padding: 18px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--guide-color);
  border-radius: 8px;
  background: var(--panel-bg-soft);
}

.term-guide img {
  display: block;
  width: 100%;
  height: 240px;
  object-fit: contain;
  object-position: center bottom;
}

.term-guide span {
  display: block;
  margin-top: 12px;
  color: var(--guide-color);
  font-family: var(--font-latin);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.term-guide h2 {
  margin: 4px 0 0;
  font-family: var(--font-display);
  font-size: 24px;
}

.term-guide p {
  margin: 10px 0 0;
  color: var(--muted);
}

.related-section {
  margin-top: 28px;
}

.related-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.related-list a {
  min-height: 38px;
  padding: 7px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--button-bg);
  text-decoration: none;
  font-weight: 800;
}

.related-list a:hover {
  color: var(--wine);
  border-color: var(--wine);
}

.term-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 18px;
}

.term-nav a {
  min-height: 82px;
  padding: 16px;
  text-decoration: none;
}

.term-nav a:last-child {
  text-align: right;
}

.term-nav span {
  display: block;
  color: var(--faint);
  font-size: 12px;
  font-weight: 800;
}

.site-footer {
  border-top: 1px solid var(--line-strong);
  padding: 26px 16px 42px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}

.site-footer p {
  margin: 4px 0;
}

@media (max-width: 1180px) {
  main {
    width: min(calc(100% - 24px), 980px);
  }

  .hero {
    grid-template-columns: minmax(0, 1fr) 300px;
  }

  .desk {
    grid-template-columns: 250px minmax(0, 1fr);
  }

  .desk-side {
    position: static;
    grid-column: 1 / -1;
    grid-template-columns: 1fr 1fr;
  }

  .path-grid {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  }

  .term-grid-compact {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .preview-bar {
    grid-template-columns: 1fr auto;
    gap: 10px;
    font-size: 10px;
    padding: 6px 12px;
  }

  .preview-bar > span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .preview-note {
    display: none;
  }

  .site-header {
    position: static;
    align-items: flex-start;
    padding: 12px;
  }

  .brand small {
    display: none;
  }

  .top-nav {
    display: none;
  }

  .dictionary-header-actions {
    margin-left: auto;
  }

  main {
    width: min(calc(100% - 18px), 560px);
  }

  .hero {
    grid-template-columns: 1fr;
    padding-top: 18px;
  }

  .hero-copy {
    min-height: 300px;
    padding: 24px 132px 24px 24px;
  }

  .hero-bottle-mark {
    top: 16px;
    right: 6px;
    bottom: 16px;
    width: 132px;
  }

  .hero h1 {
    font-size: 34px;
  }

  .hero-lead {
    font-size: 15px;
  }

  .hero-panel {
    min-height: auto;
  }

  .desk {
    grid-template-columns: 1fr;
    padding-top: 8px;
  }

  .desk-controls,
  .desk-side {
    position: static;
  }

  .desk-side {
    grid-template-columns: 1fr;
  }

  .section-head {
    display: block;
    margin-bottom: 12px;
  }

  .section-head > p {
    margin-top: 8px;
    text-align: left;
  }

  .term-grid,
  .index-search-grid,
  .path-grid,
  .guide-grid,
  .detail-grid,
  .term-layout,
  .term-nav {
    grid-template-columns: 1fr;
  }

  .detail-grid section {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .term-grid-compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .guide-card {
    grid-template-columns: 112px minmax(0, 1fr);
  }

  .term-article h1 {
    font-size: 36px;
  }

  .term-definition-panel {
    padding: 16px 18px 18px;
  }

  .term-lead {
    font-size: 18px;
  }
}

@media (max-width: 520px) {
  .preview-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    font-size: 9px;
    width: 100%;
    max-width: 100%;
    padding: 6px 10px;
  }

  .preview-bar > span:first-child {
    max-width: none;
    font-size: 0;
  }

  .preview-bar > span:first-child::before {
    content: "OWD DESK";
    font-size: 9px;
    letter-spacing: 0.08em;
  }

  .site-header {
    gap: 12px;
    width: 100%;
    max-width: 100%;
  }

  .theme-toggle {
    min-width: 58px;
    min-height: 26px;
    padding: 3px 8px;
    font-size: 10px;
    letter-spacing: 0.02em;
  }

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

  .brand strong {
    font-size: 14px;
  }

  .dictionary-login-link {
    min-height: 29px;
    padding: 5px 9px;
    font-size: 11px;
  }

  main {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0 12px;
    overflow: hidden;
  }

  .hero,
  .desk {
    display: flex;
    flex-direction: column;
  }

  .hero,
  .hero-copy,
  .hero-panel,
  .desk,
  .desk-controls,
  .desk-main,
  .desk-side,
  .term-card,
  .index-panel,
  .path-card,
  .guide-card,
  .empty-state,
    .term-layout,
    .term-nav a {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .hero-lead,
  .hero-panel p,
  .term-definition,
  .side-panel p,
  .path-card p,
  .guide-card p,
  .term-lead {
    overflow-wrap: anywhere;
  }

  .hero-copy,
  .hero-panel,
  .desk-controls,
  .side-panel,
  .term-card-main,
  .index-panel,
  .path-card,
  .guide-card,
  .term-layout {
    padding: 16px;
  }

  .hero-copy {
    padding: 18px 124px 18px 18px;
  }

  .hero-bottle-mark {
    top: 18px;
    right: 6px;
    bottom: 18px;
    width: 112px;
  }

  .path-card {
    min-height: 0;
  }

  .hero h1 {
    font-size: 26px;
    line-break: anywhere;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .hero-actions > *,
  .primary-link,
  .quiet-button {
    width: 100%;
    min-width: 0;
    padding-right: 8px;
    padding-left: 8px;
    font-size: 13px;
  }

  .term-preview .section-head > p {
    display: none;
  }

  .index-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .index-grid .pill:first-child {
    grid-column: span 2;
  }

  .pill-list,
  .guide-filter-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pill,
  .guide-filter {
    width: 100%;
    justify-content: center;
  }

  .term-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .term-card,
  .term-card-compact {
    min-height: 132px;
  }

  .term-card-main,
  .term-card-compact .term-card-main {
    padding: 12px 10px 8px;
  }

  .term-category {
    min-height: 22px;
    padding: 2px 6px;
    font-size: 10px;
  }

  .term-card h3,
  .term-card-compact h3 {
    margin-top: 9px;
    font-size: 17px;
    line-height: 1.28;
  }

  .term-reading {
    font-size: 10px;
    line-height: 1.45;
  }

  .term-definition {
    display: none;
  }

  .term-card-footer,
  .term-card-compact .term-card-footer {
    min-height: auto;
    padding: 0 10px 10px;
    gap: 5px;
    font-size: 10px;
    line-height: 1.35;
  }

  .guide-dot {
    width: 7px;
    height: 7px;
    flex: 0 0 auto;
  }

  .term-preview-more {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }

  .term-comment-card {
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 12px;
  }

  .term-comment-guide img {
    width: 72px;
    height: 92px;
  }

  .term-comment-guide figcaption {
    font-size: 15px;
  }

  .term-comment-bubble {
    min-height: auto;
    margin-top: 8px;
    padding: 13px 14px;
  }

  .term-comment-bubble::before {
    top: 14px;
  }

  .term-comment-bubble::after {
    top: 15px;
  }

  .guide-card {
    grid-template-columns: 1fr;
  }

  .guide-card-image {
    height: 180px;
  }

  .term-guide img {
    height: 200px;
  }

  .spec-table tr {
    display: block;
    padding: 8px 0;
  }

  .spec-table th,
  .spec-table td {
    display: block;
    width: 100%;
    padding: 0;
  }

  .spec-table td {
    margin-top: 3px;
  }
}

/* Atlas redesign: retro reference book layout */
:root {
  --paper: #efe4d1;
  --paper-strong: #fbf4e8;
  --surface: #f8f0e2;
  --surface-warm: #eadbc4;
  --ink: #241b13;
  --muted: #665746;
  --faint: #8d7b66;
  --line: #c7ad87;
  --line-strong: #8f6f48;
  --wine: #6d1f2f;
  --wine-dark: #42111a;
  --teal: #1f5f66;
  --olive: #586331;
  --saffron: #9f761e;
  --blue: #2d4f71;
  --shadow: 0 18px 40px rgba(55, 34, 14, 0.13);
  --page-top: #f5ecdc;
  --page-bottom: #dfceb5;
  --panel-bg: rgba(251, 244, 232, 0.92);
  --panel-bg-solid: #fbf4e8;
  --panel-bg-soft: #f4ead8;
  --header-bg: rgba(239, 228, 209, 0.92);
  --brand-bg: #f8f0e2;
  --button-bg: #f5ead7;
  --tag-bg: #f1e2cc;
  --input-bg: #fbf4e8;
  --bar-bg: #25170f;
  --bar-ink: #efe4d1;
  --font-display: "Noto Serif JP", "Yu Mincho", "Hiragino Mincho ProN", serif;
  --font-serif: "Noto Serif JP", "Yu Mincho", "Hiragino Mincho ProN", serif;
}

[data-theme="dark"] {
  --paper: #0d1117;
  --paper-strong: #f2e6d2;
  --surface: #161b22;
  --surface-warm: #1f252e;
  --ink: #f0e7dc;
  --muted: #c5b8a5;
  --faint: #8b949e;
  --line: #30363d;
  --line-strong: #6e5a3d;
  --wine: #d26b7f;
  --wine-dark: #9f4254;
  --teal: #74c0c8;
  --olive: #a5b36a;
  --saffron: #d5a83c;
  --blue: #79a7d3;
  --shadow: 0 18px 46px rgba(0, 0, 0, 0.38);
  --page-top: #0d1117;
  --page-bottom: #010409;
  --panel-bg: rgba(22, 27, 34, 0.94);
  --panel-bg-solid: #161b22;
  --panel-bg-soft: #1f252e;
  --header-bg: rgba(13, 17, 23, 0.9);
  --brand-bg: #0d1117;
  --button-bg: #1f252e;
  --tag-bg: #251d22;
  --input-bg: #0d1117;
  --bar-bg: #010409;
  --bar-ink: #f0e7dc;
}

body {
  background:
    radial-gradient(circle at 18% 0, rgba(255, 252, 238, 0.58), transparent 31rem),
    linear-gradient(180deg, var(--page-top) 0, var(--paper) 34rem, var(--page-bottom) 100%);
  font-family: var(--font-serif);
}

[data-theme="dark"] body {
  background:
    radial-gradient(circle at 20% 0, rgba(83, 61, 38, 0.2), transparent 30rem),
    linear-gradient(180deg, var(--page-top) 0, var(--paper) 34rem, var(--page-bottom) 100%);
}

.preview-bar {
  border-bottom: 1px solid var(--line-strong);
}

.theme-toggle,
.top-nav a,
.primary-link,
.quiet-button,
.reset-button,
.text-link,
.pill,
.guide-filter,
.index-jump,
.path-card a,
.related-list a {
  border-radius: 3px;
}

.site-header {
  border-bottom: 1px solid var(--line-strong);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.22) inset;
}

.brand-mark {
  border: 1px double var(--line-strong);
  color: var(--ink);
  background: transparent;
  font-family: var(--font-serif);
}

.brand strong,
.section-head h2,
.hero h1,
.spotlight-term,
.term-card h3,
.index-panel h3,
.path-card h3,
.guide-card h3,
.term-article h1,
.term-lead {
  font-family: var(--font-serif);
}

.eyebrow {
  color: var(--line-strong);
  font-family: var(--font-latin);
}

.hero {
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.58fr);
  gap: 0;
  align-items: stretch;
  padding: 34px 0 28px;
  border-right: 1px solid var(--line-strong);
  border-left: 1px solid var(--line-strong);
}

.hero-copy,
.hero-panel,
.desk-controls,
.desk-side .side-panel,
.term-card,
.path-card,
.guide-card,
.term-layout,
.term-nav a,
.empty-state,
.index-panel,
.term-section,
.detail-grid section,
.term-definition-panel {
  border-color: var(--line-strong);
  border-radius: 0;
  box-shadow: none;
}

.hero-copy {
  min-height: 540px;
  padding: clamp(28px, 4vw, 54px);
  border-right: 0;
  background:
    linear-gradient(90deg, rgba(143, 111, 72, 0.08) 1px, transparent 1px) 0 0 / 26px 26px,
    linear-gradient(180deg, rgba(255, 255, 255, 0.22), transparent 42%),
    var(--panel-bg-solid);
}

.hero-copy::before {
  content: "OISY WINE DICTIONARY";
  display: block;
  width: fit-content;
  margin-bottom: 22px;
  padding: 6px 10px;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  color: var(--line-strong);
  font-family: var(--font-latin);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.hero h1 {
  max-width: 760px;
  font-size: clamp(42px, 5.4vw, 78px);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.12;
}

.hero h1 span {
  color: var(--wine);
}

.hero-lead {
  max-width: 620px;
  margin-top: 24px;
  color: var(--muted);
  font-size: 17px;
}

.hero-ledger {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 620px;
  margin: 32px 0 0;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
}

.hero-ledger div {
  padding: 14px 16px;
  border-right: 1px solid var(--line);
}

.hero-ledger div:last-child {
  border-right: 0;
}

.hero-ledger dt,
.hero-ledger dd {
  margin: 0;
}

.hero-ledger dt {
  color: var(--faint);
  font-family: var(--font-latin);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.hero-ledger dd {
  margin-top: 2px;
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.1;
}

.hero-actions {
  margin-top: 30px;
}

.primary-link {
  border-color: var(--wine);
  color: var(--paper-strong);
  background: var(--wine);
}

.quiet-button,
.reset-button,
.text-link {
  background: transparent;
}

.atlas-plate {
  min-height: 540px;
  padding: 18px;
  border-left: 1px solid var(--line-strong);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.2), transparent 34%),
    var(--surface-warm);
}

.atlas-plate figure {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  height: 100%;
  margin: 0;
  padding: 18px 18px 14px;
  border: 1px solid var(--line-strong);
  background: var(--paper-strong);
}

.atlas-plate img {
  display: block;
  width: 100%;
  min-height: 0;
  height: 100%;
  object-fit: contain;
  filter: saturate(0.92) contrast(1.02);
}

.atlas-plate figcaption {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.atlas-plate figcaption span,
.atlas-plate figcaption small {
  color: var(--faint);
  font-family: var(--font-latin);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.atlas-plate figcaption strong {
  color: var(--ink);
  font-size: 17px;
}

.atlas-plate figcaption small {
  grid-column: 2;
}

.plate-term {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--line-strong);
  background: var(--panel-bg-solid);
}

.plate-term .spotlight-term {
  margin-top: 6px;
  font-size: 28px;
}

.plate-term p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.plate-term > span {
  display: inline-block;
  margin-top: 10px;
  color: var(--guide-color);
  font-size: 12px;
  font-weight: 800;
}

.hero-panel:not(.atlas-plate) {
  min-height: auto;
}

.hero-bottle-mark,
.spotlight-guide {
  display: none;
}

.term-preview,
.index-search,
.paths,
.guides {
  border-top-color: var(--line-strong);
}

.section-head {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-strong);
}

.section-head h2 {
  font-weight: 700;
}

.term-grid {
  gap: 0;
  border-top: 1px solid var(--line-strong);
  border-left: 1px solid var(--line-strong);
}

.term-card {
  min-height: 224px;
  border-top: 0;
  border-left: 0;
  border-right: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.2), transparent 50%),
    var(--panel-bg-solid);
}

.term-card:hover {
  transform: none;
  border-color: var(--line-strong);
  background: var(--paper-strong);
}

[data-theme="dark"] .term-card:hover {
  background: #1f252e;
}

.term-category {
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 0 0 4px;
  color: var(--line-strong);
  background: transparent;
  font-family: var(--font-latin);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.term-card h3 {
  font-size: 25px;
  font-weight: 700;
}

.term-reading {
  color: var(--line-strong);
  font-family: var(--font-serif);
}

.term-definition {
  color: var(--muted);
}

.index-search-grid,
.guide-grid {
  gap: 0;
  border-top: 1px solid var(--line-strong);
  border-left: 1px solid var(--line-strong);
}

.index-panel,
.guide-card {
  border-top: 0;
  border-left: 0;
  border-right: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
}

.index-panel-head > span {
  border: 1px solid var(--line-strong);
  color: var(--wine);
  background: transparent;
  font-family: var(--font-serif);
}

.desk {
  gap: 0;
  padding-top: 24px;
}

.desk-controls {
  border-right: 0;
  background: var(--panel-bg-solid);
}

.desk-main {
  border-right: 1px solid var(--line-strong);
  border-left: 1px solid var(--line-strong);
  padding: 0 18px;
  background: color-mix(in srgb, var(--panel-bg-solid) 58%, transparent);
}

.desk-side .side-panel {
  background: var(--panel-bg-solid);
}

.search-box input {
  border-radius: 0;
  font-family: var(--font-serif);
}

.path-grid {
  gap: 0;
  border-top: 1px solid var(--line-strong);
  border-left: 1px solid var(--line-strong);
}

.path-card {
  border-top: 0;
  border-left: 0;
  border-right: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
}

.path-top span,
.guide-level b {
  border-radius: 0;
}

.term-layout {
  padding: clamp(22px, 4vw, 48px);
  background:
    linear-gradient(90deg, rgba(143, 111, 72, 0.08) 1px, transparent 1px) 0 0 / 28px 28px,
    var(--panel-bg-solid);
}

.term-article {
  max-width: 940px;
  margin: 0 auto;
}

.term-article h1 {
  font-weight: 700;
}

.term-definition-panel {
  background: var(--panel-bg-soft);
}

.detail-grid section,
.term-section {
  background: color-mix(in srgb, var(--panel-bg-soft) 86%, transparent);
}

.term-comment-bubble,
.related-mini a {
  border-radius: 0;
}

.site-footer {
  border-top-color: var(--line-strong);
  background: color-mix(in srgb, var(--panel-bg-solid) 52%, transparent);
}

@media (max-width: 1180px) {
  .hero {
    grid-template-columns: minmax(0, 1fr) 340px;
  }

  .hero-copy,
  .atlas-plate {
    min-height: 500px;
  }
}

@media (max-width: 820px) {
  .hero {
    grid-template-columns: 1fr;
    border: 1px solid var(--line-strong);
  }

  .hero-copy {
    min-height: auto;
    padding: 28px 22px;
    border-right: 1px solid var(--line-strong);
    border-bottom: 1px solid var(--line-strong);
  }

  .atlas-plate {
    min-height: 560px;
    border-left: 0;
  }

  .hero-ledger {
    grid-template-columns: 1fr;
  }

  .hero-ledger div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .hero-ledger div:last-child {
    border-bottom: 0;
  }

  .desk-main {
    border: 1px solid var(--line-strong);
    padding: 16px;
  }
}

@media (max-width: 520px) {
  .hero h1 {
    font-size: 36px;
  }

  .atlas-plate {
    min-height: 480px;
    padding: 12px;
  }

  .atlas-plate figure {
    padding: 12px;
  }

  .plate-term .spotlight-term {
    font-size: 23px;
  }

  .term-grid {
    display: block;
    border-right: 1px solid var(--line-strong);
  }
}
