:root {
  --ink: #17212b;
  --ink-soft: #34414a;
  --paper: #f3ebdd;
  --paper-deep: #e9decc;
  --paper-light: #faf7f0;
  --white: #fffdf8;
  --line: rgba(23, 33, 43, .13);
  --line-strong: rgba(23, 33, 43, .22);
  --muted: #7b807c;
  --muted-dark: #5f6765;
  --accent: #b95d38;
  --accent-deep: #99452b;
  --green: #4f725c;
  --shadow: 0 18px 42px rgba(48, 39, 27, .10);
  --font: 'Noto Sans KR', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  --serif: 'Playfair Display', 'Times New Roman', Georgia, serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--paper); }
body { margin: 0; min-height: 100vh; color: var(--ink); font-family: var(--font); background: var(--paper); -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 3px solid rgba(185, 93, 56, .38); outline-offset: 3px; }
.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; }

.app-shell { min-height: 100vh; display: flex; }
.sidebar { width: 268px; min-height: 100vh; padding: 34px 24px 22px; display: flex; flex-direction: column; background: var(--ink); color: #f4eee2; position: sticky; top: 0; align-self: flex-start; }
.brand-lockup { display: flex; align-items: center; gap: 11px; margin: 0 9px 28px; }
.brand-mark { width: 36px; height: 36px; border-radius: 12px 12px 12px 3px; display: grid; place-items: center; color: var(--ink); background: var(--paper); font: 700 20px var(--serif); transform: rotate(-7deg); box-shadow: 4px 5px 0 rgba(185, 93, 56, .8); }
.brand-mark span { transform: rotate(7deg); }
.brand-name { font-size: 16px; font-weight: 800; letter-spacing: -.035em; }
.brand-caption { margin-top: 1px; color: #89939a; font: 10px var(--serif); letter-spacing: .11em; text-transform: uppercase; }
.offline-badge { align-self: flex-start; display: inline-flex; gap: 8px; align-items: center; padding: 8px 11px; margin: 0 8px 40px; color: #bec8c5; border: 1px solid rgba(243, 235, 221, .16); border-radius: 999px; font-size: 11px; letter-spacing: -.02em; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: #87ad8d; box-shadow: 0 0 0 3px rgba(135, 173, 141, .13); }
.main-nav { display: grid; gap: 8px; }
.nav-item { width: 100%; display: flex; align-items: center; gap: 13px; padding: 12px 12px; border: 0; border-radius: 10px; color: #9aa5a7; background: transparent; text-align: left; font-size: 13px; transition: background .2s, color .2s, transform .2s; }
.nav-item:hover { color: #f8f1e5; background: rgba(255,255,255,.07); }
.nav-item.is-active { color: var(--ink); background: var(--paper); box-shadow: 0 7px 18px rgba(0,0,0,.13); }
.nav-icon { width: 18px; color: currentColor; font-size: 23px; font-family: Georgia, serif; line-height: 1; text-align: center; }
.nav-shortcut, .nav-count { margin-left: auto; color: #778389; font-size: 11px; }
.nav-item.is-active .nav-shortcut { color: #777d7c; }
.nav-count.accent { color: #d78969; }
.nav-item[data-view="ielts"] .nav-icon { color: #d78969; font-size: 17px; }
.sidebar-rule { height: 1px; margin: 36px 8px 25px; background: rgba(243,235,221,.13); }
.sidebar-note { padding: 0 9px; }
.note-kicker { color: #879297; font-size: 9px; letter-spacing: .17em; font-weight: 800; }
.sidebar-note p { margin: 11px 0 9px; color: #dfd9cc; font-family: var(--serif); font-size: 15px; line-height: 1.65; letter-spacing: -.015em; }
.note-author { color: #7e898d; font-size: 10px; }
.sidebar-footer { display: flex; align-items: center; gap: 8px; margin: auto 9px 0; padding-top: 22px; color: #768288; font-size: 10px; }
.mini-book { font-size: 14px; color: #9b7765; }

.main-content { flex: 1; min-width: 0; }
.topbar { height: 76px; padding: 0 5.5%; display: flex; justify-content: flex-end; align-items: center; border-bottom: 1px solid var(--line); }
.topbar-meta { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 11px; }
.sync-icon { color: var(--green); font-size: 17px; line-height: 0; }
.topbar-divider { width: 1px; height: 13px; margin: 0 4px; background: var(--line-strong); }
.mobile-brand { display: none; }
.content-wrap { max-width: 1210px; padding: 63px 5.5% 76px; margin: 0 auto; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; margin-bottom: 33px; }
.eyebrow { margin: 0 0 13px; color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: .19em; }
h1 { margin: 0; font-size: clamp(27px, 3vw, 40px); font-weight: 700; letter-spacing: -.08em; line-height: 1.17; }
.heading-period { color: var(--accent); }
.heading-copy { margin: 11px 0 0; color: var(--muted-dark); font-size: 13px; letter-spacing: -.03em; }
.stats-cluster { display: flex; align-items: center; gap: 20px; padding-bottom: 5px; white-space: nowrap; }
.stat { display: flex; flex-direction: column; gap: 2px; text-align: right; }
.stat-value { font: 700 23px var(--serif); }
.stat-label { color: var(--muted); font-size: 10px; }
.stat-separator { width: 1px; height: 33px; background: var(--line-strong); }

.search-panel { position: relative; padding: 19px 22px 13px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,253,248,.6); box-shadow: 0 5px 0 rgba(23,33,43,.025); }
.search-panel-inner { display: flex; align-items: center; gap: 14px; }
.search-icon-large { color: var(--accent); font: 32px Georgia, serif; line-height: 1; transform: rotate(-15deg); }
.search-panel input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 14px; letter-spacing: -.035em; }
.search-panel input::placeholder { color: #959994; }
.clear-search { display: none; padding: 3px 9px; border: 0; color: var(--muted); background: transparent; font-size: 24px; line-height: 1; }
.clear-search.is-visible { display: block; }
kbd { padding: 4px 8px; color: #8b8e89; border: 1px solid var(--line); border-radius: 5px; background: var(--paper); font: 10px var(--font); }
.search-hint { padding: 12px 0 0 46px; color: #8c918c; font-size: 10px; }
.spark { color: var(--accent); font-size: 12px; }
.hint-separator { padding: 0 7px; color: #bab8af; }
.toolbar-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 43px 0 16px; }
.result-heading { display: flex; align-items: center; gap: 13px; color: var(--ink); font-size: 12px; font-weight: 800; letter-spacing: -.03em; }
.nav-item[data-view="ielts"].is-active { color: var(--ink); background: var(--paper); box-shadow: 0 7px 18px rgba(0,0,0,.13); }
.result-line { width: 34px; height: 1px; background: var(--accent); }
.toolbar-actions { display: flex; gap: 6px; }
.direction-switch { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,253,248,.48); }
.direction-button { padding: 5px 9px; border: 0; border-radius: 999px; color: var(--muted); background: transparent; font-size: 10px; font-weight: 700; }
.direction-button:hover { color: var(--ink); }
.direction-button.is-selected { color: var(--paper-light); background: var(--ink); }
.chip-button { padding: 6px 11px; border: 1px solid transparent; border-radius: 999px; color: var(--muted); background: transparent; font-size: 10px; }
.chip-button:hover { color: var(--ink); border-color: var(--line); }
.chip-button.is-selected { color: var(--ink); border-color: var(--line-strong); background: rgba(255,253,248,.56); font-weight: 700; }

.workspace { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(360px, .95fr); gap: 27px; align-items: start; }
.word-list { display: grid; gap: 9px; }
.word-card { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 19px 20px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,253,248,.42); transition: transform .18s, box-shadow .18s, border-color .18s, background .18s; }
.word-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: rgba(185,93,56,.25); background: rgba(255,253,248,.75); }
.word-card.is-selected { border-color: rgba(185,93,56,.58); background: var(--white); box-shadow: 6px 7px 0 rgba(185,93,56,.09); }
.word-card-main { min-width: 0; cursor: pointer; }
.word-topline { display: flex; align-items: center; gap: 9px; }
.word-name { font: 700 24px var(--serif); letter-spacing: -.04em; }
.word-pos { padding: 3px 7px; color: var(--accent-deep); border: 1px solid rgba(185,93,56,.25); border-radius: 4px; background: rgba(185,93,56,.06); font-size: 9px; font-weight: 700; }
.word-type { padding: 3px 7px; color: var(--green); border: 1px solid rgba(79,114,92,.24); border-radius: 4px; background: rgba(79,114,92,.07); font-size: 9px; font-weight: 700; }
.word-pronunciation { margin: 4px 0 10px; color: var(--muted); font: 12px Georgia, serif; }
.word-meaning { color: var(--ink-soft); font-size: 13px; font-weight: 600; letter-spacing: -.035em; }
.english-candidates { margin-top: 10px; }
.english-candidates-label { display: block; margin-bottom: 5px; color: var(--green); font-size: 9px; font-weight: 800; letter-spacing: .1em; }
.english-candidates-list { display: flex; flex-wrap: wrap; gap: 5px; }
.english-candidate { padding: 4px 7px; border: 1px solid rgba(79,114,92,.22); border-radius: 999px; color: var(--green); background: rgba(79,114,92,.07); font: 600 11px/1.1 var(--font); }
.meaning-more { margin-left: 4px; padding: 0; border: 0; background: transparent; color: var(--accent); font: inherit; font-size: 10px; font-weight: 800; white-space: nowrap; cursor: pointer; }
.meaning-more:hover { text-decoration: underline; }
.card-meaning-details { margin-top: 14px; padding-top: 12px; border-top: 1px dashed rgba(28,42,48,.22); }
.card-meaning-heading { margin-bottom: 8px; color: var(--accent-deep); font-size: 9px; font-weight: 800; letter-spacing: .12em; }
.card-meanings { display: grid; gap: 8px; padding: 0; margin: 0; list-style: none; }
.card-meanings li { display: flex; align-items: flex-start; gap: 8px; }
.card-meanings .meaning-number { background: rgba(198,121,88,.14); color: var(--accent-deep); }
.card-meanings .detail-meaning-text { color: var(--ink); font-size: 13px; }
.card-meanings .detail-meaning-example { color: var(--muted); font-size: 11px; }
.word-example { margin: 8px 0 0; overflow: hidden; color: var(--muted); font-size: 11px; line-height: 1.55; text-overflow: ellipsis; white-space: nowrap; }
.word-example em { color: var(--accent-deep); font-style: normal; font-weight: 700; }
.word-actions { display: flex; align-items: flex-start; gap: 7px; }
.icon-button { width: 30px; height: 30px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 7px; color: #a7a8a0; background: transparent; font: 22px Georgia, serif; transition: color .18s, background .18s; }
.icon-button:hover { color: var(--accent); background: rgba(185,93,56,.08); }
.icon-button.is-favorite { color: var(--accent); }
.level-pill { position: absolute; right: 20px; bottom: 17px; color: #999c95; font-size: 9px; }

.detail-card { position: sticky; top: 25px; min-height: 424px; padding: 31px 31px 25px; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--ink); color: var(--paper-light); box-shadow: 12px 13px 0 rgba(23,33,43,.08); }
.detail-card::before { content: ''; position: absolute; top: -58px; right: -30px; width: 180px; height: 180px; border: 1px solid rgba(243,235,221,.13); border-radius: 50%; }
.detail-card::after { content: ''; position: absolute; top: -21px; right: 10px; width: 100px; height: 100px; border: 1px solid rgba(185,93,56,.45); border-radius: 50%; }
.detail-empty { min-height: 360px; display: grid; place-content: center; position: relative; z-index: 1; text-align: center; color: #95a0a2; }
.detail-empty .empty-glyph { margin-bottom: 15px; color: #c67958; font: 45px var(--serif); }
.detail-empty p { margin: 0; font-size: 12px; line-height: 1.7; }
.detail-label { position: relative; z-index: 1; color: #adbbb8; font-size: 9px; font-weight: 800; letter-spacing: .16em; }
.detail-word-row { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.detail-word { font: 700 45px var(--serif); letter-spacing: -.06em; }
.detail-speak { width: 35px; height: 35px; display: grid; place-items: center; border: 1px solid rgba(243,235,221,.25); border-radius: 50%; color: #e6c5b5; background: transparent; font-size: 17px; }
.detail-speak:hover { color: var(--paper); border-color: var(--accent); background: rgba(185,93,56,.2); }
.detail-pronunciation { position: relative; z-index: 1; margin: 3px 0 18px; color: #b9c0bc; font: 13px Georgia, serif; }
.detail-card .english-candidates { position: relative; z-index: 1; margin: -4px 0 19px; }
.detail-card .english-candidates-label { color: #c67958; }
.detail-card .english-candidate { border-color: rgba(198,121,88,.38); color: #f1d2c3; background: rgba(185,93,56,.16); }
.detail-meaning-heading { position: relative; z-index: 1; margin: 0 0 8px; color: #c67958; font-size: 9px; font-weight: 800; letter-spacing: .15em; }
.detail-meanings { position: relative; z-index: 1; display: grid; gap: 7px; padding: 0; margin: 0; color: #f3ecdf; list-style: none; font-size: 15px; font-weight: 600; line-height: 1.45; letter-spacing: -.04em; }
.detail-meanings li { display: flex; align-items: flex-start; gap: 9px; }
.detail-meaning-content { min-width: 0; flex: 1; }
.detail-meaning-text { color: #f3ecdf; }
.detail-meaning-example { margin-top: 5px; color: #aeb8b3; font: 12px/1.5 var(--serif); }
.detail-meaning-example span { margin-right: 6px; color: #c67958; font: 800 9px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; }
.detail-meaning-example.is-missing { color: rgba(174,184,179,.65); font: 11px/1.5 var(--sans); }
.meaning-number { flex: 0 0 auto; width: 18px; height: 18px; display: grid; place-items: center; margin-top: 1px; border: 1px solid rgba(198,121,88,.5); border-radius: 50%; color: #e0a185; font: 10px Georgia, serif; }
.detail-rule { position: relative; z-index: 1; height: 1px; margin: 23px 0 19px; background: rgba(243,235,221,.17); }
.detail-example-label { position: relative; z-index: 1; color: #c67958; font-size: 9px; font-weight: 800; letter-spacing: .15em; }
.detail-example { position: relative; z-index: 1; margin: 9px 0 3px; color: #f3ecdf; font: 14px/1.55 var(--serif); }
.detail-example-ko { position: relative; z-index: 1; margin: 0; color: #aeb8b3; font-size: 11px; line-height: 1.6; }
.detail-footer { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; margin-top: 25px; }
.detail-tags { display: flex; gap: 5px; flex-wrap: wrap; }
.detail-tag { padding: 4px 7px; border-radius: 4px; color: #c4cfca; background: rgba(243,235,221,.1); font-size: 9px; }
.detail-favorite { display: flex; align-items: center; gap: 6px; padding: 8px 11px; border: 1px solid rgba(243,235,221,.22); border-radius: 7px; color: #e7c5b4; background: transparent; font-size: 10px; }
.detail-favorite:hover, .detail-favorite.is-favorite { border-color: rgba(185,93,56,.75); color: #fff2e8; background: rgba(185,93,56,.22); }

.empty-state { padding: 74px 20px; text-align: center; }
.empty-mark { color: var(--accent); font: 42px Georgia, serif; transform: rotate(-12deg); }
.empty-state h2 { margin: 12px 0 4px; font-size: 20px; }
.empty-state p { margin: 0; color: var(--muted); font-size: 12px; }
.text-button { margin-top: 17px; padding: 0; border: 0; color: var(--accent-deep); background: transparent; font-size: 12px; font-weight: 700; }
.toast { position: fixed; z-index: 10; right: 28px; bottom: 27px; padding: 12px 16px; border-radius: 8px; color: var(--paper-light); background: var(--ink); box-shadow: var(--shadow); font-size: 11px; opacity: 0; transform: translateY(10px); pointer-events: none; transition: opacity .22s, transform .22s; }
.toast.is-visible { opacity: 1; transform: translateY(0); }

@media (max-width: 980px) {
  .sidebar { width: 226px; padding-left: 17px; padding-right: 17px; }
  .content-wrap { padding-left: 4%; padding-right: 4%; }
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .detail-card { position: static; min-height: 0; }
  .detail-empty { min-height: 130px; }
}
@media (max-width: 680px) {
  .app-shell { display: block; }
  .sidebar { width: 100%; min-height: auto; height: auto; padding: 16px 16px 11px; position: static; }
  .brand-lockup { display: none; }
  .offline-badge, .sidebar-note, .sidebar-rule, .sidebar-footer { display: none; }
  .main-nav { display: flex; gap: 5px; }
  .nav-item { flex: 1; justify-content: center; gap: 6px; padding: 9px 7px; font-size: 11px; }
  .nav-icon { font-size: 18px; }
  .nav-shortcut { display: none; }
  .nav-count { margin-left: 2px; }
  .topbar { height: 56px; padding: 0 18px; justify-content: space-between; }
  .mobile-brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 14px; }
  .brand-mark.small { width: 27px; height: 27px; border-radius: 9px 9px 9px 2px; font-size: 15px; }
  .topbar-meta { font-size: 10px; }
  .topbar-meta .topbar-divider, .topbar-meta span:last-child { display: none; }
  .content-wrap { padding: 37px 18px 50px; }
  .page-heading { display: block; margin-bottom: 26px; }
  .eyebrow { font-size: 9px; }
  h1 { font-size: 29px; }
  .heading-copy { font-size: 12px; }
  .stats-cluster { margin-top: 20px; justify-content: flex-start; gap: 15px; }
  .stat { flex-direction: row; align-items: baseline; gap: 7px; }
  .stat-value { font-size: 19px; }
  .stat-separator { height: 20px; }
  .search-panel { padding: 15px 14px 12px; }
  .search-panel input { font-size: 12px; }
  .search-hint { padding-left: 38px; line-height: 1.5; }
  kbd { display: none; }
  .toolbar-row { align-items: flex-start; flex-direction: column; gap: 13px; margin-top: 32px; }
  .toolbar-actions { width: 100%; flex-wrap: wrap; }
  .direction-switch { width: 100%; }
  .direction-button { flex: 1; }
  .chip-button { flex: 1; padding: 7px 5px; }
  .word-card { padding: 16px 15px; }
  .word-name { font-size: 21px; }
  .word-example { max-width: 220px; }
  .level-pill { display: none; }
  .detail-card { padding: 26px 22px 21px; }
  .detail-word { font-size: 39px; }
  .toast { right: 18px; bottom: 18px; left: 18px; text-align: center; }
}
