*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #262b3b;
  --bg2: #1e2130;
  --bg3: #3c4252;
  --border: #505666;
  --text: #cfcfcf;
  --muted: #979eb0;
  --accent: #28a0b1;
  --accent2: #2aabb9;
  --phonetic: #7ab8d4;
  --radius: 8px;
  --lighaccent:
    color-mix(in srgb, var(--accent) 8%, var(--bg));
  --lighaccent2:
    color-mix(in srgb, var(--accent) 16%, var(--bg));
  --serif: 'Playfair Display', Georgia, serif;
  --mono: 'DM Mono', monospace;
  --sans: 'DM Sans', sans-serif;
  --shadow-ring: rgba(0, 0, 0, 0.05) 0px 0px 0px 1px;
  --shadow-md: rgba(0, 0, 0, 0.10) 0px 10px 15px -3px;
  --shadow-md-base: rgba(0, 0, 0, 0.10) 0px 4px 6px -4px;
  --shadow-flyout: var(--shadow-ring), var(--shadow-md), var(--shadow-md-base);
}

[data-theme="light"] {
  --bg: #fcfaf9;
  --bg2: #ffffff;
  --bg3: #ffffff;
  --bgdarker: #f3f1ed;
  --border: #e2e2e6;
  --text: #27251e;
  --muted: #6e6e80;
  --accent: #28a0b1;
  --accent2: #2aabb9;
  --phonetic: #5271e8;
  --lighaccent: color-mix(in srgb, var(--accent) 8%, var(--bg));
  --lighaccent2: color-mix(in srgb, var(--accent) 16%, var(--bg));
}

html,
body {
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Header ── */
header {
  border-bottom: 1px solid var(--border);
  padding: 20px 20px 20px 18px;
  display: flex;
  align-items: center;
  gap: 32px;
  position: sticky;
  top: 0;
  background: var(--bg2);
  z-index: 100;
  flex-direction: row;
  justify-content: space-between;
}

.logo {
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: 0.04em;
  color: var(--accent);
  white-space: nowrap;
  font-style: italic;
  min-width: 166px;
  display: flex;
  flex-direction: row;
  cursor: pointer;
  align-items: center;
  gap: 10px;
}

.logo span {
  color: var(--muted);
  font-size: 11px;
  font-family: var(--mono);
  font-style: normal;
  display: block;
  letter-spacing: 0.12em;
  margin-top: -4px;
}

.logo .icon {
  max-height: 40px;
}


.logo .icon svg {
  width: 30px;
  height: 40px;
}

.search-wrap {
  flex: 1;
  max-width: 520px;
  position: relative;
}

.search-wrap input {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  padding: 10px 44px 10px 16px;
  outline: none;
  transition: border-color .2s;
}

.search-wrap input::placeholder {
  color: var(--muted);
}

.search-wrap input:focus {
  border-color: var(--accent);
}

.search-wrap button {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 16px;
  padding: 4px;
}

.search-wrap button:hover {
  color: var(--accent2);
}

/* ── Layout ── */
.app {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ── Sidebar ── */
aside {
  width: 220px;
  min-width: 220px;
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 24px 0 24px 0;
}

.sidebar-title {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--muted);
  text-transform: uppercase;
  padding: 0 20px 12px;
}


.sidebar-home-btn {
  margin: 0 10px 4px;
  width: calc(100% - 20px);
  max-width: calc(100% - 20px);
}

/* ── Sidebar animations ── */
@keyframes sidebarIn {
  from {
    transform: translateX(-100%);
  }

  to {
    transform: translateX(0);
  }
}

@keyframes sidebarOut {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-100%);
  }
}

/* ── Dialog animations ── */
@keyframes dlgIn {
  from {
    opacity: 0;
    transform: scale(0.94);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes dlgOut {
  from {
    opacity: 1;
    transform: scale(1);
  }

  to {
    opacity: 0;
    transform: scale(0.96);
  }
}

/* ── Categories modal ── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: background .22s ease;
}

.modal-backdrop.open {
  background: rgba(0, 0, 0, .55);
  pointer-events: all;
}

.modal-panel {
  background: var(--bg2);
  border: 0.5px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, .4);
  width: min(640px, 90vw);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.94);
  opacity: 0;
  pointer-events: none;
}

.modal-backdrop.open .modal-panel {
  animation: dlgIn 280ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
  pointer-events: all;
}

.modal-backdrop.closing .modal-panel {
  animation: dlgOut 200ms cubic-bezier(0.4, 0, 1, 1) forwards;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 0px 24px;
  flex-shrink: 0;
}

.modal-title {
  font-family: var(--serif);
  font-size: 22px;
  color: var(--text);
}

.modal-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: color .15s, background .15s;
}

.modal-close:hover {
  color: var(--text);
  background: var(--lighaccent);
}

.modal-sub {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: .08em;
  padding: 6px 24px 8px 24px;
  flex-shrink: 0;
}

.modal-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px 24px 24px;
  overflow-y: auto;
}

.modal-cat-chip {
  background: var(--lighaccent);
  border: 1px solid transparent;
  border-radius: 20px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 13px;
  padding: 7px 16px;
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}

.modal-cat-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--lighaccent2);
}

.topic-load-error {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  padding: 8px 0;
}

/* ── Word Classes flyout (reuses dict-flyout styles) ── */

.dict-flyout-wrap {
  cursor: pointer;
  width: 100%;
  display: block;
}

.dict-trigger {
  display: flex;
  align-items: center;
  width: 100%;
  margin: 0;
  max-width: 100%;
}

.dict-chevron {
  flex-shrink: 0;
  margin-left: auto;
  color: var(--muted);
  transition: transform .2s ease, color .15s;
}

.dict-flyout-wrap.open .dict-chevron {
  transform: rotate(90deg);
}

.dict-trigger:hover .dict-chevron,
.dict-trigger.active .dict-chevron {
  color: var(--accent);
}

.dict-flyout {
  position: fixed;
  width: 200px;
  background: var(--bg2);
  border: 0.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-flyout);
  z-index: 300;
  padding: 8px 0;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-6px);
}

@keyframes flyoutIn {
  from {
    opacity: 0;
    transform: translateX(-6px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes flyoutOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }

  to {
    opacity: 0;
    transform: translateX(-4px);
  }
}

#wclass-flyout.open {
  animation: flyoutIn 280ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
  pointer-events: auto;
}

#wclass-flyout.closing {
  animation: flyoutOut 200ms cubic-bezier(0.4, 0, 1, 1) forwards;
}

.dict-flyout-title {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 4px 14px 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

.dict-flyout-cat {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: var(--text);
  font-family: var(--sans);
  font-size: 13px;
  padding: 7px 14px;
  cursor: pointer;
  transition: background .15s, color .15s;
}

.dict-flyout-cat:hover {
  background: var(--lighaccent);
  color: var(--accent);
}

/* ── Sidebar buttons ── */
.sidebar-btn {
  display: flex;
  align-items: center;
  justify-content: left;
  gap: 9px;
  width: 100%;
  text-align: left;
  background-color: color-mix(in srgb, var(--accent) 0%, var(--bg));
  border: none;
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  padding: 8.75px 20px;
  cursor: pointer;
  margin: 0 10px;
  max-width: calc(100% - 20px);
  padding-right: 10px;
  padding-left: 10px;
  border-radius: 8px;
  transition: background-color .2s ease, color .15s ease;
  margin-bottom: 4px;
}

.sidebar-btn svg {
  flex-shrink: 0;
}

.sidebar-btn svg path {
  stroke-width: 1.25px;
}

.sidebar-btn:hover {
  color: var(--accent);
  background-color: var(--lighaccent);
}

.sidebar-btn:hover .cat-count {
  color: var(--accent);
  font-weight: 600;
}

.sidebar-btn.active {
  color: var(--accent);
  background-color: var(--lighaccent);
  font-weight: 400;
}

.sidebar-btn .cat-count {
  float: right;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.sidebar-btn.active .cat-count {
  color: var(--accent);
  font-weight: 600;
}

/* ── Main content ── */
main {
  flex: 1;
  overflow-y: auto;
  padding: 32px;
  display: flex;
  flex-direction: column;
}

/* ── Word grid (Layer 1 view) ── */
.word-grid-section {
  width: 100%;
}

.section-heading {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 4px;
}

.section-sub {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.08em;
  margin-bottom: 24px;
}

.word-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 32px;
}

.word-grid:empty {
  margin-bottom: 0px;
}

.word-chip {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 6px 14px;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
  transition: all .15s;
  font-family: var(--sans);
}

.word-chip:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--lighaccent);
}

.word-chip.selected {
  color: var(--bg);
  background: var(--accent);
  border-color: var(--accent);
}

/* ── Word detail panel (Layer 2 + 3) ── */
.word-detail {
  width: 100%;
  border-top: 1px solid var(--border);
  padding-top: 32px;
  animation: fadeIn .25s ease;
}

.detail-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 40px;
}

.detail-col-right {
  border-left: 1px solid var(--border);
  padding-left: 40px;
}

@media (max-width: 960px) {
  .detail-cols {
    grid-template-columns: 1fr;
  }

  .detail-col-right {
    border-left: none;
    padding-left: 0;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.detail-word {
  font-family: var(--serif);
  font-size: 38px;
  font-weight: 400;
  line-height: 1.15;
  margin-bottom: 6px;
}

.detail-phonetic {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--phonetic);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.play-btn {
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--phonetic);
  cursor: pointer;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 12px;
  font-family: var(--mono);
  transition: all .15s;
}

.play-btn:hover {
  border-color: var(--phonetic);
  background: rgba(122, 184, 212, .08);
}

.pos-section {
  margin-bottom: 20px;
}

.pos-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.definition-item {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.def-num {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  min-width: 18px;
  padding-top: 3px;
}

.def-text {
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}

.def-example {
  color: var(--muted);
  font-size: 13px;
  font-style: italic;
  margin-top: 4px;
}

.def-example::before {
  content: '"';
}

.def-example::after {
  content: '"';
}

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}

/* Synonyms (Layer 3) */
.synonyms-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 10px;
}

.syn-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.syn-chip {
  background: var(--lighaccent);
  border: 1px solid var(--lighaccent2);
  border-radius: 4px;
  padding: 3px 10px;
  font-size: 13px;
  color: var(--accent);
  cursor: pointer;
  transition: all .15s;
}

.syn-chip:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* States */
.loading-state,
.empty-state,
.error-state {
  padding: 40px 0;
  text-align: center;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.05em;
}

.loading-state::before {
  content: '···';
  display: block;
  font-size: 24px;
  margin-bottom: 10px;
  animation: blink 1s infinite;
}

@keyframes blink {

  0%,
  100% {
    opacity: .2
  }

  50% {
    opacity: 1
  }
}


/* ── AI sentences (task 2) ── */
.ai-section {
  margin-top: 20px;
}

.ai-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  margin-bottom: 10px;
  flex-direction: column;
  gap: 10px;
}

.ai-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--accent);
  text-transform: uppercase;
}

.level-pills {
  display: flex;
  gap: 4px;
}

.level-pill {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  padding: 3px 10px;
  cursor: pointer;
  transition: all .15s;
}

.level-pill span {
  display: block;
  padding: 2px 10px 2px 10px;
}

.level-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.level-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
  font-weight: 500;
}

.ai-sentences {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ai-sentence {
  color: var(--muted);
  font-size: 13px;
  font-style: italic;
  padding: 8px 12px;
  border-left: 2px solid var(--accent);
  background: var(--bg2);
  border-radius: 0 4px 4px 0;
  line-height: 1.6;
  animation: fadeIn .3s ease;
}

.ai-loading {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.06em;
  animation: blink 1s infinite;
  padding: 8px 0;
}

.ai-error {
  font-family: var(--mono);
  font-size: 12px;
  color: #c05a5a;
  padding: 8px 0;
}

/* ── Translation banner (PT→EN) ── */
.translation-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 13px;
  background: var(--bg2);
  border-left: 3px solid var(--accent);
  padding: 8px 14px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.translation-banner .tr-original {
  color: var(--muted);
}

.translation-banner .tr-arrow {
  color: var(--accent);
}

.translation-banner .tr-result {
  color: var(--text);
  font-weight: 500;
}

.translation-banner .tr-tag {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-left: 2px;
}

/* ── Saved / bookmark (task 3) ── */
.bookmark-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--muted);
  font-size: 15px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .15s;
  flex-shrink: 0;
}

.bookmark-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.bookmark-btn.saved {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(201, 168, 76, .12);
}

.cat-badge {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10px;
  background: var(--accent);
  color: var(--bg);
  border-radius: 10px;
  padding: 1px 6px;
  font-weight: 500;
}

.saved-empty {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  letter-spacing: .04em;
  padding: 24px 0 8px;
  text-align: center;
}

/* ── scrollbar ── */
::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

/* ── Theme picker ── */
.theme-picker {
  position: relative;
  flex-shrink: 0;
  margin-left: 0;
}

.theme-toggle {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .15s;
}

.theme-toggle:hover,
.theme-toggle.open {
  color: var(--accent);
}

.theme-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg2);
  border: 0.5px solid var(--border);
  border-radius: var(--radius);
  padding: 4px;
  min-width: 120px;
  z-index: 300;
  box-shadow: var(--shadow-flyout);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 200ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.theme-dropdown.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.theme-option {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 10px;
  background: none;
  border: none;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 13px;
  cursor: pointer;
  border-radius: 4px;
  text-align: left;
  transition: background .1s, color .1s;
}

.theme-option:hover {
  background: var(--bg3);
  color: var(--text);
}

.theme-option.active {
  color: var(--accent);
}

/* ── Mobile search button (hidden on desktop) ── */
.mobile-search-btn {
  display: none;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  transition: color .15s;
}

.mobile-search-btn:hover {
  color: var(--accent);
}

/* ── Mobile search overlay ── */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}

.search-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.search-overlay-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .15s;
}

.search-overlay-close:hover {
  color: var(--text);
}

.search-overlay-inner {
  width: 100%;
  max-width: 480px;
  padding: 0 24px;
}

.search-overlay-wrap {
  max-width: 100%;
}

/* ── Hamburger (mobile only) ── */
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  flex-direction: column;
  gap: 5.5px;
  flex-shrink: 0;
}

.hamburger span {
  display: block;
  width: 20px;
  height: 1.44px;
  background: var(--accent);
  border-radius: 2.88px;
  transition: transform .2s, opacity .2s;
}

.hamburger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger.open span:nth-child(2) {
  opacity: 0;
}

.hamburger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .5);
  z-index: 149;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms cubic-bezier(0.4, 0, 1, 1);
}

/* ── Sidebar header (logo + close) ── */
.sidebar-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 24px 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

@media (max-width: 768px) {
  header {
    gap: 20px;
  }

  .hamburger {
    display: flex;
    order: -1;
  }

  .search-wrap:not(.search-overlay-wrap) {
    display: none;
  }

  .mobile-search-btn {
    display: flex;
    margin-left: auto;
  }

  .theme-picker {
    position: relative;
    flex-shrink: 0;
    margin-left: 0;
  }

  main {
    padding: 20px;
    gap: 20px;
  }

  .word-detail {
    padding-top: 20px;
  }

  .sidebar-header {
    display: flex;
    padding-top: 20px;
    margin-bottom: 24px;
    background: var(--bg2);
    justify-content: flex-start;
    gap: 20px;
  }

  aside {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: min(280px, 100vw);
    z-index: 150;
    background: var(--bg);
    transform: translateX(-100%);
  }

  aside.open {
    animation: sidebarIn 380ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
    padding-top: 0;
  }

  aside.closing {
    animation: sidebarOut 300ms cubic-bezier(0.4, 0, 1, 1) forwards;
    padding-top: 0;
  }

  .sidebar-overlay.open {
    opacity: 1;
    pointer-events: auto;
    transition: opacity 380ms cubic-bezier(0.16, 1, 0.3, 1);
  }
}

/* ── Word Types — static editorial cards ────────────────────────────────────
   Used by: Pronouns, Prepositions, Conjunctions, Interjections
   Appended to app.css — do not rename class prefixes.
   ─────────────────────────────────────────────────────────────────────────── */

.wt-static-wrap {
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding-bottom: 16px;
}

.wt-static-group {
  border-top: 1px solid var(--border);
  padding-top: 20px;
}

.wt-static-group:first-child {
  border-top: none;
  padding-top: 0;
}

.wt-static-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.wt-static-item {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 6px;
  transition: background .12s;
}

.wt-static-item:hover {
  background: var(--lighaccent);
}

.wt-static-word {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 400;
  color: var(--accent);
  white-space: nowrap;
}

.wt-static-note {
  font-size: 14px;
  color: var(--text);
  line-height: 1.6;
}

@media (max-width: 560px) {
  .wt-static-item {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .wt-static-word {
    font-size: 15px;
  }
}