:root {
  --background: #f8f5ed;
  --foreground: #342f28;
  --card: #fffdf8;
  --primary: #225b45;
  --primary-soft: #edf5ef;
  --secondary: #f0eadb;
  --muted: #f1eee6;
  --muted-foreground: #777066;
  --accent: #f2e7c8;
  --border: #e1ddd2;
  --amber: #806018;
  --amber-bg: #fff8df;
  --danger: #943c31;
  --shadow: 0 2px 12px rgba(52, 47, 40, .05);
  --radius: 12px;
  color: var(--foreground);
  background: var(--background);
  font-family: Pretendard, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
  font-size: 16px;
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body { margin: 0; background: var(--background); color: var(--foreground); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.home-shell { min-height: calc(100vh - 65px); overflow: hidden; background: #0b2119; color: #eef2e9; }
.home-hero { position: relative; isolation: isolate; width: min(1480px,100%); min-height: min(760px,calc(100vh - 65px)); margin: 0 auto; padding: clamp(65px,9vh,110px) clamp(22px,6vw,90px); display: grid; grid-template-columns: minmax(0,1.1fr) minmax(340px,.9fr); align-items: center; gap: 45px; }
.home-hero::before { content: ""; position: absolute; z-index: -2; inset: 0; background: radial-gradient(circle at 78% 42%, rgba(191,168,94,.2), transparent 25%), radial-gradient(circle at 68% 60%, rgba(80,133,91,.24), transparent 36%); }
.home-hero::after { content: ""; position: absolute; z-index: -1; inset: 0; opacity: .16; background-image: linear-gradient(rgba(255,255,255,.08) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.08) 1px,transparent 1px); background-size: 64px 64px; mask-image: linear-gradient(to right,transparent,black 55%,black); }
.hero-orbit { position: absolute; z-index: -1; width: min(53vw,720px); aspect-ratio: 1; right: -4%; top: 50%; transform: translateY(-50%); pointer-events: none; }
.hero-orbit i { position: absolute; inset: 5%; border: 1px solid rgba(214,195,130,.11); border-radius: 50%; }
.hero-orbit i:nth-child(2) { inset: 19%; border-style: dashed; transform: rotate(18deg); }
.hero-orbit i:nth-child(3) { inset: 34%; border-color: rgba(238,242,233,.12); }
.hero-copy { position: relative; z-index: 2; }
.hero-eyebrow { color: #cfb96f; font: 700 .7rem/1.4 ui-monospace,SFMono-Regular,Menlo,monospace; letter-spacing: .22em; }
.hero-copy h1 { margin: 22px 0 24px; font-size: clamp(3.4rem,7vw,7.1rem); font-weight: 650; line-height: .96; letter-spacing: -.07em; }
.hero-copy h1 em { color: #d6c382; font-family: Georgia,"Batang",serif; font-weight: 500; }
.hero-copy > p { max-width: 610px; margin: 0; color: rgba(238,242,233,.66); font-size: clamp(.95rem,1.4vw,1.08rem); line-height: 1.8; }
.unified-search { position: relative; width: min(720px,100%); margin-top: 37px; }
.unified-search > span { position: absolute; left: 20px; top: 50%; transform: translateY(-54%); color: rgba(238,242,233,.5); font-size: 1.6rem; }
.unified-search input { width: 100%; min-height: 66px; padding: 0 145px 0 57px; border: 1px solid rgba(255,255,255,.18); border-radius: 18px; color: white; background: rgba(255,255,255,.075); box-shadow: 0 18px 60px rgba(0,0,0,.2); backdrop-filter: blur(16px); }
.unified-search input::placeholder { color: rgba(238,242,233,.45); }
.unified-search input:focus { outline: 3px solid rgba(214,195,130,.2); border-color: rgba(214,195,130,.7); }
.unified-search button { position: absolute; top: 7px; right: 7px; height: 52px; padding: 0 20px; border: 0; border-radius: 13px; color: #10251d; background: #d6c382; font-weight: 800; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 17px; }
.hero-actions a { min-height: 34px; display: inline-flex; align-items: center; padding: 0 11px; border: 1px solid rgba(255,255,255,.13); border-radius: 999px; color: rgba(238,242,233,.7); background: transparent; text-decoration: none; font-size: .7rem; }
.hero-specimen { position: relative; aspect-ratio: 1; display: grid; place-items: center; }
.hero-specimen::before { content: ""; position: absolute; width: 65%; height: 75%; border-radius: 52% 48% 50% 48%; background: linear-gradient(145deg,rgba(196,175,104,.32),rgba(39,96,68,.15)); filter: blur(1px); transform: rotate(18deg); box-shadow: inset 0 0 80px rgba(255,255,255,.06),0 40px 100px rgba(0,0,0,.3); }
.specimen-ring { position: absolute; inset: 13%; border: 1px solid rgba(214,195,130,.25); border-radius: 50%; animation: orbit-spin 18s linear infinite; }
.ring-two { inset: 25%; border-style: dashed; animation-direction: reverse; animation-duration: 12s; }
.specimen-leaf { position: absolute; color: rgba(238,242,233,.16); font: 500 clamp(2rem,4vw,4rem) Georgia,serif; }
.leaf-one { left: 12%; top: 26%; transform: rotate(-22deg); }.leaf-two { right: 13%; bottom: 24%; transform: rotate(17deg); }
.hero-specimen > div { position: relative; z-index: 2; width: 44%; aspect-ratio: .76; display: grid; place-content: center; justify-items: center; border: 1px solid rgba(255,255,255,.18); border-radius: 48% 48% 10px 10px; background: rgba(6,24,17,.55); box-shadow: 0 25px 60px rgba(0,0,0,.34); backdrop-filter: blur(10px); }
.hero-specimen small,.hero-specimen > div span { color: rgba(238,242,233,.47); font: 600 .55rem/1.4 ui-monospace,monospace; letter-spacing: .15em; }
.hero-specimen strong { margin: 18px 0; color: #d6c382; font: 500 clamp(4rem,8vw,7rem)/1 Georgia,"Batang",serif; text-shadow: 0 0 45px rgba(214,195,130,.25); }
@keyframes orbit-spin { to { transform: rotate(360deg); } }
.unified-results { padding: 65px clamp(22px,6vw,90px) 80px; color: var(--foreground); background: var(--background); }
.unified-heading,.unified-grid,.home-index-strip { width: min(1300px,100%); margin-inline: auto; }
.unified-heading { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 22px; }
.unified-heading span { color: var(--primary); font: 700 .68rem ui-monospace,monospace; letter-spacing: .2em; }
.unified-heading h2 { margin: 7px 0 0; font-size: clamp(1.8rem,3vw,2.5rem); letter-spacing: -.04em; }
.unified-heading p { color: var(--muted-foreground); font-size: .8rem; }
.unified-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 18px; }
.unified-column { overflow: hidden; border: 1px solid var(--border); border-radius: 18px; background: var(--card); box-shadow: var(--shadow); }
.unified-column > header { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.unified-column > header > span { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; color: var(--primary); background: var(--primary-soft); font: 700 1.05rem Georgia,serif; }
.unified-column h3,.unified-column p { margin: 0; }.unified-column h3 { font-size: 1rem; }.unified-column p { margin-top: 3px; color: var(--muted-foreground); font-size: .7rem; }
.unified-column header a { color: var(--primary); font-size: .72rem; font-weight: 750; text-underline-offset: 3px; }
.unified-item { min-height: 78px; display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 13px 18px; border-bottom: 1px solid var(--border); text-decoration: none; }
.unified-item:last-child { border-bottom: 0; }.unified-item:hover { background: var(--primary-soft); }
.unified-item strong { display: block; font-size: .9rem; }.unified-item strong span { margin-left: 7px; color: var(--muted-foreground); font-family: Georgia,serif; font-weight: 500; }
.unified-item small { display: block; margin-top: 6px; color: var(--muted-foreground); font-size: .7rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.unified-item > span { color: var(--primary); font-size: 1.2rem; }
.unified-empty { min-height: 180px; display: grid; place-content: center; padding: 24px; color: var(--muted-foreground); text-align: center; font-size: .82rem; }
.home-index-strip { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); padding: 50px clamp(22px,6vw,90px) 70px; }
.home-index-strip div { padding: 0 25px; border-left: 1px solid rgba(255,255,255,.15); }.home-index-strip div:first-child { padding-left: 0; border-left: 0; }
.home-index-strip span { color: #cfb96f; font: 700 .68rem ui-monospace,monospace; }.home-index-strip strong { display: block; margin-top: 11px; font-size: 1.1rem; }.home-index-strip p { margin: 7px 0 0; color: rgba(238,242,233,.55); font-size: .75rem; line-height: 1.6; }

.home-search-hero { width: min(1300px,100%); margin: 0 auto; padding: clamp(44px,6vw,74px) clamp(22px,6vw,90px) 46px; display: grid; grid-template-columns: minmax(0,1.35fr) minmax(250px,.65fr); align-items: end; gap: clamp(28px,5vw,72px); }
.home-search-copy { min-width: 0; }
.home-search-copy h1 { max-width: 850px; margin: 18px 0; font-size: clamp(2.65rem,5.6vw,5rem); font-weight: 650; line-height: 1.02; letter-spacing: -.06em; }
.home-search-copy h1 em { color: #d6c382; font-family: Georgia,"Batang",serif; font-weight: 500; }
.home-search-copy > p { max-width: 720px; margin: 0; color: rgba(238,242,233,.7); font-size: 1rem; line-height: 1.8; }
.home-search-copy .unified-search { margin-top: 28px; }
.search-scope-tabs { width: fit-content; display: flex; gap: 5px; margin-top: 14px; padding: 4px; border: 1px solid rgba(255,255,255,.12); border-radius: 12px; background: rgba(255,255,255,.06); }
.search-scope { min-width: 74px; min-height: 36px; padding: 0 14px; border: 0; border-radius: 9px; color: rgba(238,242,233,.65); background: transparent; font-size: .78rem; font-weight: 750; }
.search-scope:hover { color: white; background: rgba(255,255,255,.07); }
.search-scope.active { color: #10251d; background: #d6c382; }
.search-scope:focus-visible { outline: 3px solid rgba(214,195,130,.25); outline-offset: 2px; }
.unified-search-hint { margin: 10px 2px 0 !important; color: rgba(238,242,233,.47) !important; font-size: .72rem !important; line-height: 1.5 !important; }
.home-search-index { display: grid; gap: 10px; }
.home-search-index > div { min-height: 112px; display: grid; grid-template-columns: 44px 1fr; grid-template-rows: auto auto; column-gap: 13px; align-content: center; padding: 18px; border: 1px solid rgba(255,255,255,.12); border-radius: 16px; background: rgba(255,255,255,.045); }
.home-search-index > div > span { grid-row: 1/3; width: 44px; height: 44px; display: grid; place-items: center; align-self: center; border: 1px solid rgba(214,195,130,.24); border-radius: 13px; color: #d6c382; font: 700 1rem Georgia,"Batang",serif; }
.home-search-index strong { align-self: end; font-size: .95rem; }
.home-search-index small { align-self: start; margin-top: 5px; color: rgba(238,242,233,.5); font-size: .69rem; line-height: 1.55; }
.unified-results { padding-top: 48px; }
.unified-grid.single { grid-template-columns: minmax(0,900px); }
.unified-column > header button { min-height: 34px; padding: 0 10px; border: 1px solid rgba(34,91,69,.18); border-radius: 9px; color: var(--primary); background: var(--primary-soft); font-size: .71rem; font-weight: 750; }
.unified-column > header button:hover { border-color: rgba(34,91,69,.35); background: #e4efe7; }
.unified-pagination { width: min(900px,100%); margin: 16px auto 0; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; padding: 8px; border: 1px solid var(--border); border-radius: 13px; background: var(--card); }
.unified-pagination button { min-height: 38px; border: 1px solid var(--border); border-radius: 9px; background: white; color: var(--foreground); font-size: .76rem; font-weight: 700; }
.unified-pagination button:disabled { cursor: default; opacity: .35; }
.unified-pagination span { min-width: 76px; color: var(--muted-foreground); text-align: center; font-size: .72rem; }
.app-header { position: sticky; top: 0; z-index: 30; border-bottom: 1px solid rgba(225,221,210,.9); background: rgba(255,253,248,.94); backdrop-filter: blur(14px); }
[hidden] { display: none !important; }
.header-inner { width: min(1480px, 100%); min-height: 64px; margin: 0 auto; padding: 10px clamp(18px, 3vw, 32px); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.account-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; margin-left: 4px; }
.account-login, .account-admin, .account-actions button { min-height: 36px; padding: 0 13px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--primary); border-radius: 9px; color: var(--primary); background: var(--card); text-decoration: none; font-size: .8rem; font-weight: 700; }
.account-admin { border-color: transparent; color: var(--muted-foreground); }
.account-actions form { margin: 0; }
.account-actions button { border-color: var(--border); cursor: pointer; }

.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; }
.brand-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; color: white; background: var(--primary); font: 700 1.05rem Georgia, "Batang", serif; box-shadow: var(--shadow); }
.brand strong { display: block; font-size: 1.05rem; letter-spacing: -.02em; }
.brand small { display: block; margin-top: 2px; color: var(--muted-foreground); font-size: .7rem; }
.primary-nav { display: flex; align-items: center; gap: 8px; }
.primary-nav > a { min-height: 36px; display: inline-flex; align-items: center; padding: 0 12px; border: 1px solid var(--border); border-radius: 9px; background: var(--card); color: var(--foreground); text-decoration: none; font-size: .82rem; font-weight: 650; }
.primary-nav > a:hover { background: var(--muted); }
.primary-nav > a.active { color: var(--primary); border-color: rgba(34,91,69,.28); background: var(--primary-soft); }
.primary-nav > a span { min-width: 20px; height: 20px; display: inline-grid; place-items: center; margin-left: 6px; padding: 0 5px; border-radius: 999px; background: var(--danger); color: white; font-size: .65rem; line-height: 1; }
.mobile-menu-toggle { display: none; }
.mobile-menu-layer { position: fixed; z-index: 70; inset: 0; }
.mobile-menu-backdrop { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; background: rgba(20,25,21,.46); backdrop-filter: blur(2px); }
.mobile-menu-panel { position: relative; width: min(86vw,340px); height: 100dvh; margin-left: auto; display: flex; flex-direction: column; overflow-y: auto; background: var(--card); box-shadow: -20px 0 55px rgba(31,27,22,.2); animation: mobile-menu-in .18s ease-out; }
.mobile-menu-head { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px 10px 18px; border-bottom: 1px solid var(--border); }
.mobile-menu-head > div { display: flex; align-items: center; gap: 10px; }
.mobile-menu-head strong { font-size: 1rem; }
.mobile-menu-head > button { width: 42px; height: 42px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 12px; color: var(--foreground); background: var(--muted); font-size: 1.65rem; line-height: 1; }
.mobile-menu-toggle:focus-visible, .mobile-menu-head > button:focus-visible, .mobile-nav > a:focus-visible, .mobile-menu-account > a:focus-visible, #mobile-admin-actions button:focus-visible { outline: 3px solid rgba(34,91,69,.2); outline-offset: 2px; }
.mobile-nav { display: grid; gap: 4px; padding: 18px 12px; }
.mobile-nav > span { padding: 12px 10px 5px; color: var(--muted-foreground); font-size: .68rem; font-weight: 800; letter-spacing: .08em; }
.mobile-nav > a { min-height: 50px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 0 13px; border-radius: 12px; color: var(--foreground); text-decoration: none; font-size: .91rem; font-weight: 720; }
.mobile-nav > a:hover { background: var(--muted); }
.mobile-nav > a.active { color: var(--primary); background: var(--primary-soft); }
.mobile-nav > a b { min-width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 9px; color: var(--muted-foreground); background: white; font: 750 .72rem/1 Georgia,"Batang",serif; }
.mobile-nav > a.active b { border-color: rgba(34,91,69,.2); color: var(--primary); background: rgba(255,255,255,.7); }
.mobile-nav > a#mobile-nav-fix-list b { min-width: 22px; height: 22px; border: 0; border-radius: 999px; color: white; background: var(--danger); font-family: inherit; font-size: .65rem; }
.mobile-menu-account { margin-top: auto; padding: 16px 18px calc(18px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); }
.mobile-menu-account > a { min-height: 44px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--primary); border-radius: 11px; color: var(--primary); text-decoration: none; font-size: .82rem; font-weight: 750; }
#mobile-admin-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
#mobile-admin-actions span { color: var(--muted-foreground); font-size: .76rem; font-weight: 700; }
#mobile-admin-actions button { min-height: 40px; padding: 0 12px; border: 1px solid var(--border); border-radius: 10px; color: var(--foreground); background: white; font-size: .76rem; font-weight: 750; }
body.mobile-menu-open { overflow: hidden; }
@keyframes mobile-menu-in { from { transform: translateX(18px); opacity: .4; } to { transform: translateX(0); opacity: 1; } }
.health { min-height: 34px; display: flex; align-items: center; gap: 7px; padding: 0 10px; color: var(--muted-foreground); font-size: .75rem; white-space: nowrap; }
.health i { width: 7px; height: 7px; border-radius: 50%; background: #d0a447; box-shadow: 0 0 0 3px rgba(208,164,71,.13); }
.health.up i { background: #35a26b; box-shadow: 0 0 0 3px rgba(53,162,107,.13); }
.health.down i { background: #d45d50; }

.page-shell { width: min(1480px, 100%); margin: 0 auto; padding: 28px clamp(18px, 3vw, 32px) 52px; }
.page-intro { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 28px; align-items: end; margin-bottom: 22px; }
.page-intro h1 { margin: 10px 0 6px; font-size: clamp(2rem, 4vw, 2.55rem); line-height: 1.15; letter-spacing: -.045em; }
.page-intro p { max-width: 760px; margin: 0; color: var(--muted-foreground); line-height: 1.7; }
.intro-badge { display: inline-flex; align-items: center; min-height: 28px; padding: 4px 10px; border-radius: 999px; color: #65501e; background: var(--accent); font-size: .76rem; font-weight: 700; }
.mini-stats { display: grid; grid-template-columns: repeat(3, minmax(100px,1fr)); gap: 8px; text-align: center; }
.mini-stats div { min-width: 105px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); box-shadow: var(--shadow); }
.mini-stats strong { display: block; color: var(--primary); font-size: 1.02rem; white-space: nowrap; }
.mini-stats span { display: block; margin-top: 3px; color: var(--muted-foreground); font-size: .7rem; }

.main-search { position: relative; width: min(800px, 100%); margin-bottom: 12px; }
.main-search > span { position: absolute; left: 17px; top: 50%; transform: translateY(-54%); color: var(--muted-foreground); font-size: 1.45rem; pointer-events: none; }
.main-search input { width: 100%; min-height: 53px; padding: 0 104px 0 50px; border: 1px solid var(--border); border-radius: 16px; background: var(--card); color: var(--foreground); font-size: .94rem; box-shadow: var(--shadow); }
.main-search input:focus { outline: 3px solid rgba(34,91,69,.13); border-color: rgba(34,91,69,.6); }
.main-search button { position: absolute; right: 7px; top: 7px; min-width: 76px; height: 39px; border: 0; border-radius: 11px; color: white; background: var(--primary); font-weight: 700; }
.main-search button:hover { background: #174b38; }
.filter-row { min-height: 34px; display: flex; flex-wrap: wrap; gap: 7px; align-items: center; margin-bottom: 18px; }
.filter-chip { min-height: 32px; padding: 0 13px; border: 1px solid var(--border); border-radius: 999px; background: var(--card); color: var(--muted-foreground); font-size: .78rem; font-weight: 650; }
.filter-chip.active { border-color: var(--primary); background: var(--primary); color: white; }
.text-button { min-height: 32px; padding: 0 9px; border: 0; background: transparent; color: var(--muted-foreground); font-size: .78rem; text-decoration: underline; text-underline-offset: 3px; }
.notice { max-width: 1020px; margin: -2px 0 16px; padding: 11px 14px; border: 1px solid #ead494; border-radius: 12px; background: var(--amber-bg); color: #634b17; font-size: .78rem; line-height: 1.6; }
.return-banner { margin: 0 0 16px; padding: 12px 14px; border: 1px solid rgba(34,91,69,.22); border-radius: 12px; background: var(--primary-soft); font-size: .86rem; }
.return-banner a { color: var(--primary); font-weight: 700; text-underline-offset: 3px; }

.explorer-grid { display: grid; grid-template-columns: 390px minmax(0,1fr); gap: 20px; align-items: start; }
.formula-layout { grid-template-columns: 360px minmax(0,1fr); }
.list-card, .detail-card, .section-card { border: 1px solid var(--border); border-radius: 16px; background: var(--card); box-shadow: var(--shadow); }
.list-card { position: sticky; top: 84px; overflow: hidden; }
.card-heading { min-height: 64px; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 15px; border-bottom: 1px solid var(--border); background: rgba(241,238,230,.36); }
.card-heading h2 { margin: 0; font-size: 1rem; letter-spacing: -.01em; }
.card-heading p { margin: 4px 0 0; color: var(--muted-foreground); font-size: .75rem; }
.card-heading > span { padding: 4px 8px; border: 1px solid var(--border); border-radius: 999px; color: var(--muted-foreground); background: var(--card); font-size: .68rem; white-space: nowrap; }
.record-list { max-height: 620px; overflow-y: auto; overscroll-behavior: contain; }
.record-button { width: 100%; display: flex; gap: 13px; align-items: center; padding: 14px 15px; border: 0; border-bottom: 1px solid var(--border); background: transparent; color: var(--foreground); text-align: left; }
.record-button:hover { background: rgba(241,238,230,.55); }
.record-button.active { background: rgba(242,231,200,.72); box-shadow: inset 3px 0 var(--primary); }
.record-symbol { width: 45px; height: 45px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid rgba(34,91,69,.12); border-radius: 12px; background: rgba(34,91,69,.08); color: var(--primary); font: 700 1rem Georgia, "Batang", serif; }
.record-copy { min-width: 0; flex: 1; }
.record-title-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.record-title-row strong { font-size: .92rem; }
.record-title-row b { color: var(--muted-foreground); font-size: 1rem; }
.record-subtitle, .record-meta { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted-foreground); }
.record-subtitle { margin-top: 3px; font-size: .77rem; }
.record-meta { margin-top: 7px; font-size: .7rem; }
.pagination { min-height: 48px; display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; padding: 8px; background: var(--card); }
.pagination button { min-height: 32px; border: 1px solid var(--border); border-radius: 9px; background: var(--card); color: var(--foreground); font-size: .75rem; font-weight: 650; }
.pagination button:disabled { cursor: default; opacity: .38; }
.pagination span { min-width: 64px; text-align: center; color: var(--muted-foreground); font-size: .72rem; }

.detail-card { min-width: 0; overflow: hidden; }
.detail-stack { min-width: 0; display: grid; gap: 16px; }
.empty-state { min-height: 430px; display: grid; place-content: center; justify-items: center; padding: 32px; text-align: center; color: var(--muted-foreground); }
.empty-state > span { width: 62px; height: 62px; display: grid; place-items: center; border: 1px solid rgba(34,91,69,.25); border-radius: 20px; color: var(--primary); background: var(--primary-soft); font: 700 1.65rem Georgia, "Batang", serif; }
.empty-state h2 { margin: 18px 0 5px; color: var(--foreground); font-size: 1.15rem; }
.empty-state p { max-width: 470px; margin: 0; line-height: 1.65; }
.loading-state, .error-state { min-height: 260px; display: grid; place-content: center; padding: 30px; text-align: center; color: var(--muted-foreground); }
.error-state { color: var(--danger); }
.detail-header { padding: 22px clamp(20px, 3vw, 28px); border-bottom: 1px solid var(--border); }
.detail-header-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; }
.detail-header h2 { margin: 5px 0 0; font-size: clamp(1.8rem, 3.5vw, 2.25rem); letter-spacing: -.04em; }
.detail-header h2 span { margin-left: 8px; color: var(--muted-foreground); font: 500 .58em Georgia, "Batang", serif; letter-spacing: 0; }
.latin { margin: 5px 0 0; color: var(--muted-foreground); font-family: Georgia, serif; font-size: .88rem; font-style: italic; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { display: inline-flex; min-height: 25px; align-items: center; padding: 3px 9px; border: 1px solid var(--border); border-radius: 999px; color: var(--muted-foreground); background: var(--card); font-size: .7rem; font-weight: 700; }
.badge.primary { border-color: var(--primary); background: var(--primary); color: white; }
.badge.standard { border-color: #99bce9; background: #edf5ff; color: #1f518e; }
.badge.danger { border-color: rgba(148,60,49,.35); background: #fff0ed; color: var(--danger); }
.badge.warning { border-color: #ead494; background: var(--amber-bg); color: #6d5114; }
.badge.review { border-color: #d2c2ec; background: #f6f1ff; color: #68459a; }
.connection-mark { display: inline-flex; align-items: center; gap: 6px; padding: 8px 10px; border-radius: 10px; color: #26734c; background: #edf9f1; font-size: .72rem; font-weight: 700; white-space: nowrap; }
.detail-header-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.fix-add-button, .fix-primary-button { min-height: 36px; padding: 0 12px; border: 1px solid #d6bd72; border-radius: 10px; background: var(--amber-bg); color: #6c5117; font-size: .74rem; font-weight: 800; white-space: nowrap; }
.fix-add-button:hover, .fix-primary-button:hover { background: #ffefbd; }
.source-box .fix-add-button { width: 100%; margin-top: 10px; }
.detail-tabs { display: flex; gap: 21px; min-height: 46px; padding: 0 clamp(20px, 3vw, 28px); overflow-x: auto; border-bottom: 1px solid var(--border); }
.detail-tab { position: relative; flex: 0 0 auto; border: 0; background: transparent; color: var(--muted-foreground); font-size: .82rem; font-weight: 650; }
.detail-tab.active { color: var(--foreground); }
.detail-tab.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--primary); }
.detail-body { padding: clamp(20px, 3vw, 28px); }
.overview-grid { display: grid; grid-template-columns: 1fr .92fr; gap: 28px; align-items: start; }
.content-column { display: grid; gap: 25px; }
.content-section h3, .section-card h3 { margin: 0 0 10px; font-size: .93rem; }
.section-label { display: block; margin-bottom: 11px; color: var(--muted-foreground); font-size: .7rem; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; }
.definition-grid { display: grid; grid-template-columns: 96px minmax(0,1fr); gap: 11px 15px; margin: 0; font-size: .85rem; line-height: 1.6; }
.definition-grid dt { color: var(--muted-foreground); }
.definition-grid dd { margin: 0; font-weight: 550; white-space: pre-line; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 5px 8px; border: 1px solid var(--border); border-radius: 999px; background: white; font-size: .75rem; }
.prose { margin: 0; color: #514b43; font-size: .88rem; line-height: 1.72; white-space: pre-line; }
.safety-overview, .safety-stack { display: grid; gap: 10px; }
.safety-review-notice { padding: 13px 15px; border: 1px solid #d2c2ec; border-radius: 12px; background: #f8f4ff; color: #583b80; }
.safety-review-notice strong { display: block; font-size: .82rem; }
.safety-review-notice p { margin: 5px 0 0; font-size: .75rem; line-height: 1.6; }
.safety-compact { padding: 13px 14px; border: 1px solid #ead494; border-radius: 12px; background: var(--amber-bg); }
.safety-compact.serious { border-color: rgba(148,60,49,.3); background: #fff4f1; }
.safety-compact .safety-kind { display: block; margin-bottom: 5px; color: var(--amber); font-size: .67rem; font-weight: 800; }
.safety-compact.serious .safety-kind { color: var(--danger); }
.safety-compact strong { display: block; font-size: .86rem; }
.safety-compact p { margin: 6px 0 0; color: #514b43; font-size: .77rem; line-height: 1.6; }
.safety-more { min-height: 36px; border: 1px solid rgba(34,91,69,.28); border-radius: 10px; background: var(--primary-soft); color: var(--primary); font-size: .76rem; font-weight: 750; }
.safety-stack { margin-top: 14px; }
.safety-card { padding: 18px; border: 1px solid #ead494; border-radius: 14px; background: #fffdf5; }
.safety-card.serious { border-color: rgba(148,60,49,.32); background: #fff8f6; box-shadow: inset 3px 0 var(--danger); }
.safety-card h3 { margin: 11px 0 7px; font-size: 1.03rem; }
.safety-summary { margin: 0 0 15px; color: #514b43; font-size: .86rem; line-height: 1.7; }
.safety-card .definition-grid { padding-top: 13px; border-top: 1px solid rgba(128,96,24,.16); }
.safety-references { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.safety-references h4 { margin: 0 0 9px; font-size: .8rem; }
.safety-reference { padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: white; }
.safety-reference + .safety-reference { margin-top: 7px; }
.safety-source-type { display: block; margin-bottom: 4px; color: #68459a; font-size: .65rem; font-weight: 800; }
.safety-reference a { color: var(--primary); font-size: .8rem; font-weight: 750; line-height: 1.45; text-underline-offset: 3px; }
.safety-reference small { display: block; margin-top: 5px; color: var(--muted-foreground); font-size: .67rem; line-height: 1.5; }
.safety-reference p { margin: 7px 0 0; color: #514b43; font-size: .74rem; line-height: 1.55; }
.safety-reference blockquote { margin: 8px 0 0; padding: 8px 10px; border-left: 3px solid #d2c2ec; background: #faf8ff; color: #5d5666; font: italic .71rem/1.55 Georgia, serif; }
.safety-editor-entry { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 10px 0 14px; padding: 10px 12px; border: 1px solid rgba(34,91,69,.22); border-radius: 11px; background: var(--primary-soft); }
.safety-editor-entry span { color: #4e655b; font-size: .73rem; line-height: 1.5; }
.safety-editor-entry button, .editor-add { min-height: 34px; flex: 0 0 auto; padding: 0 12px; border: 1px solid rgba(34,91,69,.35); border-radius: 9px; background: white; color: var(--primary); font-size: .74rem; font-weight: 750; }
.safety-editor-dialog { width: min(1180px, calc(100% - 24px)); height: min(92vh, 920px); padding: 0; overflow: hidden; border: 1px solid var(--border); border-radius: 17px; background: var(--card); color: var(--foreground); box-shadow: 0 30px 90px rgba(31,27,22,.35); }
.safety-editor-dialog::backdrop { background: rgba(24,22,19,.62); backdrop-filter: blur(3px); }
.safety-editor-head { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 12px 18px 12px 22px; border-bottom: 1px solid var(--border); }
.safety-editor-head strong { display: block; font-size: 1rem; }
.safety-editor-head small { display: block; margin-top: 4px; color: var(--muted-foreground); font-size: .7rem; }
.safety-editor-head button { width: 38px; height: 38px; border: 0; border-radius: 50%; background: var(--muted); color: var(--foreground); font-size: 1.45rem; }
.safety-editor-toolbar { min-height: 49px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 20px; border-bottom: 1px solid var(--border); background: rgba(241,238,230,.38); }
.editor-mode-tabs { display: flex; gap: 4px; padding: 3px; border-radius: 10px; background: var(--muted); }
.editor-mode-tabs button { min-height: 31px; padding: 0 13px; border: 0; border-radius: 7px; background: transparent; color: var(--muted-foreground); font-size: .74rem; font-weight: 700; }
.editor-mode-tabs button.active { background: white; color: var(--primary); box-shadow: var(--shadow); }
#safety-editor-state { max-width: 70%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted-foreground); font-size: .7rem; }
#safety-editor-state.valid { color: #26734c; font-weight: 750; }
#safety-editor-state.warning { color: #806018; }
#safety-editor-state.error { color: var(--danger); }
.safety-editor-scroll { height: calc(100% - 181px); overflow: auto; padding: 18px 20px 28px; overscroll-behavior: contain; }
.editor-section, .editor-item { margin-bottom: 13px; padding: 15px; border: 1px solid var(--border); border-radius: 12px; background: white; }
.editor-section h3, .editor-item h4 { margin: 0 0 12px; font-size: .83rem; }
.editor-item > summary { cursor: pointer; margin-right: 90px; font-size: .86rem; font-weight: 800; }
.editor-item { position: relative; }
.editor-item > .editor-remove { position: absolute; top: 10px; right: 12px; }
.editor-field-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px 12px; margin-top: 13px; }
.editor-field { min-width: 0; display: grid; gap: 5px; color: var(--muted-foreground); font-size: .68rem; font-weight: 700; }
.editor-field.wide { grid-column: 1/-1; }
.editor-field input, .editor-field select, .editor-field textarea, .editor-token-field input { width: 100%; min-height: 38px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: #fffefa; color: var(--foreground); font-size: .77rem; font-weight: 500; line-height: 1.5; }
.editor-field textarea { resize: vertical; }
.editor-field input:focus, .editor-field select:focus, .editor-field textarea:focus, .editor-token-field input:focus { outline: 3px solid rgba(34,91,69,.11); border-color: rgba(34,91,69,.55); }
.editor-field input[readonly] { background: var(--muted); color: var(--muted-foreground); }
.editor-reference { margin: 9px 0; padding: 13px; border: 1px solid #d8cdeb; border-radius: 10px; background: #fcfaff; }
.editor-reference-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.editor-reference-head strong { font-size: .77rem; }
.editor-remove { min-height: 29px; padding: 0 8px; border: 1px solid rgba(148,60,49,.25); border-radius: 7px; background: #fff7f5; color: var(--danger); font-size: .67rem; }
.editor-add { margin-top: 9px; }
.editor-add.item { width: 100%; min-height: 42px; border-style: dashed; background: var(--primary-soft); }
.editor-checkbox { display: inline-flex; align-items: center; gap: 7px; margin-top: 9px; color: var(--muted-foreground); font-size: .72rem; font-weight: 700; }
.json-help { margin-bottom: 12px; padding: 12px 14px; border: 1px solid #d2c2ec; border-radius: 10px; background: #f8f4ff; }
.json-help strong { font-size: .8rem; }
.json-help p { margin: 4px 0 0; color: #655a70; font-size: .72rem; line-height: 1.55; }
.json-help > div { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 8px; }
.json-help a { color: #68459a; font-size: .7rem; font-weight: 750; text-underline-offset: 3px; }
.json-help button { min-height: 29px; padding: 0 9px; border: 1px solid #d2c2ec; border-radius: 7px; background: white; color: #68459a; font-size: .68rem; font-weight: 750; }
.editor-json-field textarea { min-height: 56vh; font: 500 .74rem/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; tab-size: 2; }
.safety-editor-foot { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 18px; border-top: 1px solid var(--border); background: var(--card); }
.editor-session { color: var(--muted-foreground); font-size: .69rem; }
.editor-session strong { margin-left: 5px; color: var(--foreground); }
.editor-actions { display: flex; gap: 7px; }
.editor-actions button { min-height: 37px; padding: 0 13px; border: 1px solid var(--border); border-radius: 9px; background: white; color: var(--foreground); font-size: .73rem; font-weight: 750; }
.editor-actions button:last-child { border-color: var(--primary); background: var(--primary); color: white; }
.editor-actions button:disabled { cursor: default; opacity: .4; }
.info-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.info-block { padding: 13px; border: 1px solid var(--border); border-radius: 12px; background: var(--muted); }
.info-block small { display: block; margin-bottom: 5px; color: var(--muted-foreground); font-size: .68rem; }
.info-block p { margin: 0; font-size: .82rem; line-height: 1.6; white-space: pre-line; }

.gallery-tabs { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 5px; margin-bottom: 10px; padding: 5px; border-radius: 12px; background: var(--muted); }
.gallery-tabs button { min-height: 34px; border: 0; border-radius: 9px; background: transparent; color: var(--muted-foreground); font-size: .75rem; font-weight: 650; }
.gallery-tabs button.active { background: var(--card); color: var(--primary); box-shadow: var(--shadow); }
.photo-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.photo-tile { position: relative; aspect-ratio: 4/3; overflow: hidden; padding: 0; border: 1px solid var(--border); border-radius: 12px; background: var(--muted); }
.photo-tile img { width: 100%; height: 100%; display: block; object-fit: cover; transition: transform .2s ease; }
.photo-tile:hover img { transform: scale(1.025); }
.photo-tile span { position: absolute; inset: auto 0 0; padding: 30px 10px 9px; color: white; background: linear-gradient(transparent, rgba(0,0,0,.78)); font-size: .72rem; font-weight: 650; text-align: left; }
.photo-empty { min-height: 180px; display: grid; place-content: center; padding: 20px; border: 1px dashed var(--border); border-radius: 12px; background: rgba(241,238,230,.45); color: var(--muted-foreground); text-align: center; font-size: .82rem; }

.formula-links { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.formula-link { display: block; min-width: 0; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: white; color: var(--foreground); text-decoration: none; }
.formula-link:hover { border-color: rgba(34,91,69,.45); background: var(--primary-soft); }
.formula-link.standard { border-color: #bad0eb; background: #f4f8ff; }
.formula-link strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .84rem; }
.formula-link small { display: block; margin-top: 5px; color: var(--muted-foreground); font-size: .68rem; }
details.info-details { padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--muted); }
details.info-details + details.info-details { margin-top: 8px; }
details.info-details summary { cursor: pointer; font-size: .84rem; font-weight: 700; }
details.info-details p { color: #514b43; font-size: .82rem; line-height: 1.7; white-space: pre-line; }

.formula-head-card { padding: 22px clamp(20px,3vw,28px); }
.formula-head-grid { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; }
.formula-head-card h2 { margin: 9px 0 2px; font-size: clamp(1.8rem,3vw,2.2rem); letter-spacing: -.04em; }
.formula-head-card .hanja { color: var(--muted-foreground); font-family: Georgia, "Batang", serif; }
.source-box { min-width: 190px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--muted); text-align: right; }
.source-box small { display: block; color: var(--muted-foreground); font-size: .68rem; }
.source-box strong { display: block; margin-top: 5px; font-size: .82rem; }
.section-card { padding: 20px clamp(18px,3vw,24px); }
.section-card > header { display: flex; justify-content: space-between; gap: 15px; align-items: flex-start; margin-bottom: 14px; }
.section-card > header h3 { margin: 0; }
.section-card > header p { margin: 4px 0 0; color: var(--muted-foreground); font-size: .75rem; line-height: 1.5; }
.variant-select { width: 100%; min-height: 43px; margin: 2px 0 14px; padding: 0 38px 0 12px; border: 1px solid var(--border); border-radius: 10px; background: white; color: var(--foreground); }
.source-links { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin: -2px 0 13px; }
.source-link { display: inline-flex; min-height: 34px; align-items: center; padding: 0 10px; border: 1px solid rgba(34,91,69,.28); border-radius: 9px; background: var(--primary-soft); color: var(--primary); font-size: .72rem; font-weight: 750; text-decoration: none; }
.source-link:hover { border-color: rgba(34,91,69,.5); background: #e3eee7; }
.source-link-status { color: var(--muted-foreground); font-size: .68rem; }
.ingredient-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.ingredient-card { min-width: 0; padding: 11px 12px; border: 1px solid var(--border); border-radius: 11px; background: white; }
.ingredient-card.highlight { border-color: rgba(34,91,69,.55); background: var(--primary-soft); box-shadow: 0 0 0 1px rgba(34,91,69,.15); }
.ingredient-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.ingredient-heading > a, .ingredient-heading > strong { min-width: 0; }
.ingredient-card a, .ingredient-card strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--foreground); font-size: .82rem; font-weight: 750; text-decoration: none; }
.ingredient-card a:hover { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
.ingredient-card small { display: block; margin-top: 4px; overflow: hidden; color: var(--muted-foreground); font-size: .68rem; line-height: 1.45; }
.comparison-badge { flex: 0 0 auto; font-size: .7rem; font-weight: 800; white-space: nowrap; }
.comparison-badge.positive { color: #b7382e; }
.comparison-badge.negative { color: #2563a9; }
.comparison-badge.unknown { color: var(--muted-foreground); font-weight: 650; }
.variant-meta { margin-bottom: 13px; }

.photo-dialog { width: min(1000px, calc(100% - 28px)); max-height: 92vh; padding: 0; overflow: hidden; border: 1px solid rgba(255,255,255,.12); border-radius: 16px; background: #0d0e0d; color: white; box-shadow: 0 30px 90px rgba(0,0,0,.5); }
.photo-dialog::backdrop { background: rgba(12,13,12,.78); backdrop-filter: blur(3px); }
.photo-dialog-head { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 16px 12px 20px; border-bottom: 1px solid rgba(255,255,255,.1); }
.photo-dialog-head strong { display: block; font-size: .94rem; }
.photo-dialog-head small { display: block; margin-top: 3px; color: rgba(255,255,255,.55); font-size: .7rem; }
.photo-dialog-head button { width: 38px; height: 38px; border: 0; border-radius: 50%; background: rgba(255,255,255,.08); color: white; font-size: 1.5rem; }
.photo-stage { position: relative; min-height: min(60vh, 600px); display: grid; place-items: center; background: black; }
.photo-stage img { width: 100%; height: min(60vh, 600px); object-fit: contain; }
.photo-stage button { position: absolute; z-index: 2; top: 50%; width: 43px; height: 43px; transform: translateY(-50%); border: 0; border-radius: 50%; color: white; background: rgba(0,0,0,.58); font-size: 2rem; line-height: 1; }
.photo-stage button:first-child { left: 12px; }
.photo-stage button:last-child { right: 12px; }
.photo-dialog-foot { display: grid; grid-template-columns: minmax(0,1fr) auto auto; align-items: center; gap: 15px; padding: 14px 20px; border-top: 1px solid rgba(255,255,255,.1); }
.photo-dialog-foot p { margin: 0; color: rgba(255,255,255,.72); font-size: .78rem; line-height: 1.5; }
.photo-dialog-foot span { color: rgba(255,255,255,.48); font-size: .72rem; }
.photo-dialog-foot a { min-height: 34px; display: inline-flex; align-items: center; padding: 0 11px; border: 1px solid rgba(255,255,255,.2); border-radius: 8px; color: white; text-decoration: none; font-size: .72rem; font-weight: 700; }

.fix-list-intro { align-items: center; }
.fix-list-search { width: min(720px,100%); }
.fix-list-shell { overflow: hidden; border: 1px solid var(--border); border-radius: 16px; background: var(--card); box-shadow: var(--shadow); }
.fix-list-items { min-height: 230px; }
.fix-list-empty { min-height: 260px; display: grid; place-items: center; padding: 30px; color: var(--muted-foreground); text-align: center; }
.fix-item { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 13px; padding: 17px 18px; border-bottom: 1px solid var(--border); }
.fix-item:last-child { border-bottom: 0; }
.fix-item.done { background: rgba(241,238,230,.46); }
.fix-item.done .fix-item-copy > strong, .fix-item.done .fix-item-copy > p { color: var(--muted-foreground); text-decoration: line-through; text-decoration-color: rgba(119,112,102,.45); }
.fix-check { position: relative; width: 28px; height: 28px; margin-top: 2px; }
.fix-check input { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.fix-check span { width: 28px; height: 28px; display: grid; place-items: center; border: 2px solid #c9c1b2; border-radius: 9px; background: white; color: white; font-size: .8rem; font-weight: 900; }
.fix-check input:checked + span { border-color: var(--primary); background: var(--primary); }
.fix-check input:focus-visible + span { outline: 3px solid rgba(34,91,69,.18); }
.fix-item-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 6px; }
.fix-item-meta time { color: var(--muted-foreground); font-size: .68rem; }
.fix-item-copy > strong { display: block; font-size: .93rem; }
.fix-item-copy > p { margin: 7px 0 0; color: #514b43; font-size: .83rem; line-height: 1.65; white-space: pre-wrap; }
.fix-item-actions { display: flex; gap: 12px; margin-top: 10px; }
.fix-item-actions a, .fix-item-actions button { min-height: 30px; display: inline-flex; align-items: center; padding: 0; border: 0; background: transparent; color: var(--primary); font-size: .72rem; font-weight: 750; text-decoration: underline; text-underline-offset: 3px; }
.fix-dialog { width: min(620px,calc(100% - 24px)); padding: 0; border: 1px solid var(--border); border-radius: 17px; background: var(--card); color: var(--foreground); box-shadow: 0 30px 90px rgba(31,27,22,.35); }
.fix-dialog.fallback-open { position: fixed; z-index: 90; inset: 50% auto auto 50%; max-height: calc(100vh - 24px); margin: 0; transform: translate(-50%,-50%); overflow: auto; }
.fix-dialog::backdrop { background: rgba(24,22,19,.62); backdrop-filter: blur(3px); }
.fix-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 15px 17px 15px 21px; border-bottom: 1px solid var(--border); }
.fix-dialog-head strong { display: block; font-size: 1rem; }
.fix-dialog-head small { display: block; margin-top: 4px; color: var(--muted-foreground); font-size: .71rem; }
.fix-dialog-head button { width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--muted); color: var(--foreground); font-size: 1.35rem; }
.fix-dialog-body { padding: 20px; }
.fix-dialog-body label { display: block; margin-bottom: 7px; font-size: .8rem; font-weight: 750; }
.fix-dialog-body textarea { width: 100%; min-height: 150px; resize: vertical; padding: 12px; border: 1px solid var(--border); border-radius: 11px; background: #fffefa; color: var(--foreground); font-size: .88rem; line-height: 1.65; }
.fix-dialog-body textarea:focus { outline: 3px solid rgba(34,91,69,.11); border-color: rgba(34,91,69,.55); }
.fix-dialog-error { margin: 12px 0 0; padding: 10px 12px; border-radius: 9px; background: #fff0ed; color: var(--danger); font-size: .75rem; }
.fix-dialog-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--border); }
.fix-dialog-foot button { min-height: 38px; padding: 0 14px; border: 1px solid var(--border); border-radius: 9px; background: white; color: var(--foreground); font-size: .76rem; font-weight: 750; }
.fix-dialog-foot button:last-child { border-color: var(--primary); background: var(--primary); color: white; }
.fix-dialog-foot button:disabled { cursor: default; opacity: .45; }

@media (max-width: 1000px) {
  .unified-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .home-search-hero { grid-template-columns: 1fr; }
  .home-search-index { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .home-hero { grid-template-columns: 1fr; min-height: auto; }
  .hero-specimen { position: absolute; z-index: -1; width: min(560px,72vw); right: -24%; top: 17%; opacity: .22; }
  .page-intro { grid-template-columns: 1fr; }
  .mini-stats { width: min(520px,100%); }
  .explorer-grid, .formula-layout { grid-template-columns: 1fr; }
  .list-card { position: static; }
  .record-list { max-height: 430px; }
}
@media (max-width: 720px) {
  .home-search-hero { padding: 36px 16px 30px; gap: 24px; }
  .home-search-copy h1 { margin: 14px 0; font-size: clamp(2.45rem,12vw,4rem); }
  .home-search-copy > p { font-size: .9rem; }
  .home-search-copy .unified-search { margin-top: 22px; }
  .unified-search { width: 100%; }
  .unified-search input { min-height: 58px; padding: 0 88px 0 48px; border-radius: 15px; font-size: .9rem; }
  .unified-search > span { left: 16px; font-size: 1.35rem; }
  .unified-search button { top: 6px; right: 6px; height: 46px; padding: 0 15px; border-radius: 11px; }
  .search-scope-tabs { width: 100%; }
  .search-scope { flex: 1; min-width: 0; }
  .home-search-index { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .home-search-index > div { min-height: 92px; padding: 14px; grid-template-columns: 38px 1fr; }
  .home-search-index > div > span { width: 38px; height: 38px; }
  .unified-results { padding: 34px 12px 48px; }
  .unified-heading { align-items: flex-start; flex-direction: column; gap: 8px; margin-bottom: 16px; }
  .unified-heading p { margin: 0; }
  .unified-column > header { padding: 13px 14px; }
  .unified-item { min-height: 70px; padding: 12px 14px; }
  .home-hero { min-height: calc(100vh - 64px); padding-top: 65px; }
  .hero-copy h1 { font-size: clamp(3.15rem,15vw,5.8rem); }
  .hero-specimen { right: -38%; top: 20%; opacity: .16; }
  .hero-specimen > div { display: none; }
  .unified-grid { grid-template-columns: 1fr; }
  .home-index-strip { grid-template-columns: 1fr; gap: 24px; }
  .home-index-strip div { padding: 0 0 0 18px; }.home-index-strip div:first-child { padding-left: 18px; border-left: 1px solid rgba(255,255,255,.15); }
  .header-inner { min-height: 60px; padding: 8px 12px; align-items: center; flex-wrap: nowrap; gap: 8px; }
  .brand small { display: none; }
  .account-actions { order: 2; margin-left: auto; gap: 4px; }
  .account-actions #logout-form { display: none !important; }
  .account-login, .account-admin { min-height: 40px; padding-inline: 10px; font-size: .76rem; }
  .mobile-menu-toggle { order: 3; width: 44px; height: 44px; display: inline-grid; place-content: center; gap: 4px; padding: 0; border: 1px solid var(--border); border-radius: 12px; color: var(--foreground); background: var(--card); }
  .mobile-menu-toggle span { width: 18px; height: 2px; display: block; border-radius: 99px; background: currentColor; }
  .primary-nav { display: none; }
  .mobile-menu-layer { display: block; }
  .health { display: none; }
  .page-shell { padding-top: 21px; }
  .page-intro h1 { font-size: 1.9rem; }
  .mini-stats { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .mini-stats div { min-width: 0; padding-inline: 7px; }
  .mini-stats strong { font-size: .84rem; }
  .overview-grid { grid-template-columns: 1fr; }
  .ingredient-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .formula-head-grid { display: grid; }
  .source-box { text-align: left; }
  .detail-header-actions { justify-content: flex-start; }
  .safety-editor-entry, .safety-editor-foot { align-items: stretch; flex-direction: column; }
  .editor-token-field { min-width: 0; }
  .editor-actions { justify-content: stretch; }
  .editor-actions button { flex: 1; }
  .safety-editor-scroll { height: calc(100% - 232px); }
}
@media (max-width: 480px) {
  .brand small { display: none; }
  .brand-icon { width: 34px; height: 34px; }
  .mobile-menu-panel { width: min(92vw,330px); }
  .page-shell { padding-inline: 11px; }
  .page-intro { gap: 17px; }
  .page-intro p { font-size: .88rem; }
  .main-search input { padding-right: 90px; }
  .main-search button { min-width: 67px; }
  .detail-header-row { display: grid; }
  .info-grid, .formula-links { grid-template-columns: 1fr; }
  .ingredient-grid { grid-template-columns: 1fr; }
  .photo-dialog-foot { grid-template-columns: 1fr auto; }
  .photo-dialog-foot a { grid-column: 1/-1; justify-content: center; }
  .editor-field-grid { grid-template-columns: 1fr; }
  .editor-field.wide { grid-column: auto; }
  .safety-editor-head small { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-specimen * { animation-duration: .01ms !important; animation-delay: 0s !important; }
  .mobile-menu-panel { animation: none; }
}
/* Textbook supplements stay separate from official source values. */
.supplement-notice { padding: 16px; border: 1px solid #cbd5e1; border-radius: 12px; background: #f8fafc; margin-bottom: 18px; }
.supplement-notice p { margin: 8px 0 0; line-height: 1.7; }
.supplement-card { padding: 18px; border: 1px solid #e2e8f0; border-radius: 12px; margin-bottom: 16px; }
.supplement-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.supplement-heading h3 { margin: 0; }
.supplement-category { color: #64748b; }
.supplement-card dd { white-space: pre-wrap; overflow-wrap: anywhere; }
.supplement-warning { background: #fff7ed; color: #9a3412; }
.supplement-source { margin-top: 16px; font-size: 12px; color: #64748b; overflow-wrap: anywhere; }
.supplement-source p { margin: 6px 0; }
.supplement-notes { margin-top: 12px; line-height: 1.7; }
.supplement-notes summary { cursor: pointer; }

/* Public mode: the server diagnostics are privileged UI, never shown
   until the gateway has independently confirmed the admin session. */
#health:not([data-admin-visible="true"]),
#herb-status-badge:not([data-admin-visible="true"]) { display: none !important; }

/* About the dictionary */
.about-page { max-width: 1240px; }
.about-hero { padding: clamp(32px,6vw,75px); border: 1px solid rgba(34,91,69,.12); border-radius: 28px; background:
  radial-gradient(circle at 87% 16%,rgba(214,195,130,.25),transparent 32%),
  linear-gradient(125deg,#102f24,#20523f 68%,#2e674c); color: #f8f6ed; overflow: hidden; }
.about-kicker { font-size: .72rem; font-weight: 750; color: #d8c78e; letter-spacing: .2em; }
.about-hero h1 { max-width: 780px; margin: 18px 0 22px; font-size: clamp(2.2rem,5vw,4.1rem); line-height: 1.17; letter-spacing: -.055em; font-weight: 700; }
.about-hero p { max-width: 710px; margin: 0; color: rgba(248,246,237,.76); font-size: 1.02rem; line-height: 1.9; }
.about-hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 34px; }
.about-hero-actions a { display: inline-flex; justify-content: center; align-items: center; min-height: 42px; padding: 0 18px; color: #163d2b; text-decoration: none; font-weight: 750; font-size: .86rem; background: #dfce95; border-radius: 11px; }
.about-hero-actions a + a { color: #f8f6ed; background: transparent; border: 1px solid rgba(248,246,237,.42); }
.about-hero-actions a span { margin-left: 10px; }
.about-section { margin-top: clamp(40px,5vw,70px); }
.about-section-heading { display: flex; justify-content: space-between; align-items: end; flex-wrap: wrap; gap: 10px 24px; margin-bottom: 22px; }
.about-section-heading > span,.about-access > div > span { font-weight: 750; font-size: .77rem; color: var(--primary); letter-spacing: .065em; }
.about-section-heading h2,.about-access h2 { margin: 6px 0 0; font-size: clamp(1.5rem,2.5vw,2rem); letter-spacing: -.045em; }
.about-cards { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 15px; }
.about-card { padding: 27px; border: 1px solid var(--border); border-radius: 20px; background: var(--card); box-shadow: var(--shadow); }
.about-card > span { display: grid; width: 44px; height: 44px; place-items: center; border-radius: 13px; background: var(--primary-soft); color: var(--primary); font-size: 1.4rem; font-family: Georgia,"Batang",serif; }
.about-card h3 { font-size: 1.12rem; margin: 18px 0 10px; }
.about-card p,.about-notes p,.about-access p,.about-standard p,.about-flow p { margin: 0; color: var(--muted-foreground); font-size: .91rem; line-height: 1.86; }
.about-card small { display: block; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); color: #81796d; font-size: .72rem; line-height: 1.6; }
.about-standard { display: grid; grid-template-columns: 180px minmax(0,1fr); gap: clamp(24px,4vw,52px); align-items: center; padding: clamp(25px,4vw,42px); border: 1px solid rgba(34,91,69,.17); border-radius: 22px; background: var(--primary-soft); }
.about-standard-number { min-height: 150px; display: grid; align-content: center; justify-items: center; border-right: 1px solid rgba(34,91,69,.18); color: var(--primary); }
.about-standard-number strong { font-family: Georgia,"Batang",serif; font-size: clamp(4rem,8vw,6.5rem); line-height: .9; letter-spacing: -.06em; }
.about-standard-number span { margin-top: 13px; font-size: .75rem; font-weight: 750; }
.about-standard p + p { margin-top: 14px; }
.about-standard p strong { color: var(--foreground); }
.about-flow { border-top: 1px solid var(--border); }
.about-flow article { display: grid; grid-template-columns: 54px minmax(0,1fr); gap: 18px; padding: 23px 0; border-bottom: 1px solid var(--border); }
.about-flow article > span { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid rgba(34,91,69,.2); border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-size: .82rem; font-weight: 800; }
.about-flow h3 { margin: 1px 0 7px; font-size: 1.02rem; }
.about-notes { border-top: 1px solid var(--border); }
.about-notes article { display: grid; grid-template-columns: 240px 1fr; gap: 24px; padding: 24px 0; border-bottom: 1px solid var(--border); }
.about-notes h3 { margin: 0; font-size: 1.02rem; }
.about-access { display:flex; align-items:center; justify-content:space-between; gap: 28px; background: var(--primary-soft); border: 1px solid rgba(34,91,69,.17); border-radius: 22px; padding: clamp(24px,4vw,38px); margin-bottom: 50px; }
.about-access p { max-width: 720px; margin-top: 12px; }
.about-access > a { display: inline-flex; flex-shrink: 0; color: #fff; text-decoration: none; font-weight: 750; background: var(--primary); border-radius: 12px; padding: 15px 20px; }
@media(max-width:820px) {
  .about-cards { grid-template-columns: 1fr; }
  .about-standard { grid-template-columns: 1fr; }
  .about-standard-number { min-height: auto; padding-bottom: 24px; border-right: 0; border-bottom: 1px solid rgba(34,91,69,.18); }
  .about-flow article { grid-template-columns: 44px minmax(0,1fr); gap: 12px; }
  .about-notes article { grid-template-columns: 1fr; gap: 8px; }
  .about-access { flex-direction: column; align-items: flex-start; }
}


/* KHP catalog + compact formula/KHP groups */
.section-card.grouped-details { padding: 0; overflow: hidden; }
.grouped-summary { min-height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 15px clamp(18px,3vw,24px); cursor: pointer; list-style: none; background: var(--card); }
.grouped-summary::-webkit-details-marker { display: none; }
.grouped-summary > span { font-size: .94rem; font-weight: 800; letter-spacing: -.01em; }
.grouped-summary > small { color: var(--muted-foreground); font-size: .7rem; font-weight: 650; text-align: right; }
.grouped-summary::after { content: '＋'; flex: 0 0 auto; color: var(--primary); font-size: 1rem; font-weight: 800; }
.grouped-details[open] > .grouped-summary { border-bottom: 1px solid var(--border); }
.grouped-details[open] > .grouped-summary::after { content: '－'; }
.grouped-body { padding: 18px clamp(18px,3vw,24px) 22px; }
.grouped-stack { display: grid; }
.nested-record { border-top: 1px solid var(--border); background: var(--card); }
.nested-record:first-child { border-top: 0; }
.nested-record-summary { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px clamp(18px,3vw,24px); cursor: pointer; list-style: none; }
.nested-record-summary::-webkit-details-marker { display: none; }
.nested-record-summary > span { min-width: 0; }
.nested-record-summary strong { display: block; font-size: .86rem; }
.nested-record-summary small { display: block; margin-top: 4px; color: var(--muted-foreground); font-size: .68rem; }
.nested-record-summary::after { content: '›'; color: var(--muted-foreground); font-size: 1.1rem; transform: rotate(0deg); transition: transform .15s ease; }
.nested-record[open] > .nested-record-summary::after { transform: rotate(90deg); }
.nested-record-body { padding: 0 clamp(18px,3vw,24px) 20px; }
.khp-monograph-group { margin-top: 0; }
.khp-current-revision { margin: 4px 0 14px; }
.khp-section-body { display: grid; gap: 9px; padding-top: 10px; }
.khp-catalog-sections { display: grid; gap: 8px; }
.khp-entity-links { margin-top: 16px; }
.compact-related-list { padding: 8px 0; }
.related-khp-button { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px clamp(18px,3vw,24px); border: 0; border-top: 1px solid var(--border); background: transparent; color: var(--foreground); text-align: left; }
.related-khp-button:first-child { border-top: 0; }
.related-khp-button:hover { background: var(--muted); }
.related-khp-button strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .82rem; }
.related-khp-button small { flex: 0 0 auto; color: var(--muted-foreground); font-size: .68rem; }
#khp-detail > .formula-head-card > .prose { margin-top: 8px; }
@media (max-width: 640px) {
  .grouped-summary { align-items: flex-start; }
  .grouped-summary > small { display: none; }
  .related-khp-button { align-items: flex-start; flex-direction: column; gap: 4px; }
}


/* Pharmacopoeia comparison */
.comparison-notice { margin-bottom: 18px; padding: 16px 18px; border: 1px solid rgba(34,91,69,.18); border-radius: 14px; background: var(--primary-soft); }
.comparison-notice strong { display: block; color: var(--primary); font-size: .88rem; }
.comparison-notice p { margin: 7px 0 0; color: var(--muted-foreground); font-size: .78rem; line-height: 1.7; }
.comparison-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.comparison-card { min-width: 0; padding: 18px; border: 1px solid var(--border); border-radius: 15px; background: var(--card); box-shadow: 0 6px 20px rgba(35,42,35,.035); }
.comparison-card.current-khp { border-color: rgba(34,91,69,.27); background: linear-gradient(180deg,rgba(236,246,239,.78),var(--card)); }
.comparison-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.comparison-card-head small { color: var(--muted-foreground); font-size: .66rem; text-align: right; }
.comparison-source { display: inline-flex; align-items: center; min-height: 26px; padding: 0 9px; border-radius: 999px; background: var(--muted); color: var(--foreground); font-size: .68rem; font-weight: 800; }
.comparison-source.current { background: var(--primary); color: white; }
.comparison-card h3 { margin: 14px 0 3px; font-size: 1rem; }
.comparison-latin { margin: 0 0 12px; font-size: .76rem; overflow-wrap: anywhere; }
.comparison-card .definition-grid { margin-top: 12px; }
.comparison-card .definition-grid dd { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.65; }
.comparison-more { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.comparison-more summary { cursor: pointer; color: var(--primary); font-size: .73rem; font-weight: 750; }
.comparison-khp-summary { margin: 10px 0 15px; color: var(--muted-foreground); font-size: .78rem; line-height: 1.65; }
@media (max-width: 720px) {
  .comparison-grid { grid-template-columns: 1fr; }
  .comparison-card-head { align-items: flex-start; }
}
