:root {
  --bg: #0c0f14;
  --bg-elevated: #141a22;
  --border: rgba(255, 255, 255, 0.08);
  --text: #eef2f7;
  --text-muted: #9aa8b8;
  --accent: #6ee7b7;
  --accent-soft: rgba(110, 231, 183, 0.14);
  --danger: #f87171;
  --radius: 16px;
  --shadow: 0 24px 48px rgba(0, 0, 0, 0.35);
  --page-max: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; font-family: "DM Sans", system-ui, sans-serif; color: var(--text); background: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(110, 231, 183, 0.12), transparent), var(--bg); }
.vocab-app.page { max-width: var(--page-max); margin: 0 auto; padding: 1.5rem 1.5rem 3rem; }
.top-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.top-bar-actions { display: flex; align-items: center; gap: 0.5rem; }
.back-portfolio { color: var(--text-muted); text-decoration: none; font-size: 0.875rem; }
.back-portfolio:hover { color: var(--text); }
.site-hero { display: flex; gap: 1.25rem; align-items: center; margin-bottom: 1.5rem; }
.site-hero-icon { width: 72px; height: 72px; border-radius: 18px; box-shadow: var(--shadow); }
.site-hero h1 { margin: 0 0 0.25rem; font-size: clamp(1.75rem, 4vw, 2.25rem); }
.site-hero-lead { margin: 0; color: var(--text-muted); max-width: 36rem; }
.site-nav { display: flex; gap: 0.5rem; margin-bottom: 1.25rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
.nav-tab { padding: 0.55rem 1rem; border-radius: 999px; border: 1px solid var(--border); background: rgba(255,255,255,0.03); color: var(--text-muted); font: inherit; cursor: pointer; }
.nav-tab[aria-selected="true"] { color: var(--text); border-color: rgba(110,231,183,0.45); background: var(--accent-soft); }
.app-panel { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: calc(var(--radius) + 4px); padding: 1.25rem 1.5rem; box-shadow: var(--shadow); }
.lang-bar { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-bottom: 1rem; }
.lang-field { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.85rem; color: var(--text-muted); }
.lang-field select { padding: 0.55rem 0.65rem; border-radius: 10px; border: 1px solid var(--border); background: rgba(255,255,255,0.04); color: var(--text); font: inherit; }
.empty-card, .muted-card { padding: 1.25rem; border: 1px dashed var(--border); border-radius: var(--radius); text-align: center; color: var(--text-muted); margin-bottom: 1rem; }
.photo-stage { position: relative; margin-bottom: 0.75rem; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: #000; display: flex; justify-content: center; align-items: center; }
.photo-frame { position: relative; display: inline-block; line-height: 0; max-width: 100%; }
.photo-bg { display: block; max-width: 100%; max-height: 420px; width: auto; height: auto; }
.photo-overlay { position: absolute; inset: 0; pointer-events: none; }
.word-hotspot { position: absolute; border: 1px solid rgba(110,231,183,0.45); background: rgba(110,231,183,0.18); color: transparent; font-size: 0; cursor: pointer; border-radius: 4px; padding: 0; pointer-events: auto; min-width: 10px; min-height: 14px; touch-action: manipulation; }
.word-hotspot--active { background: rgba(110,231,183,0.35); border-color: var(--accent); }
.photo-loading { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,0.45); color: #fff; font-weight: 600; }
.card { background: rgba(255,255,255,0.03); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem; margin-top: 1rem; }
.lookup-word { margin: 0; font-size: 1.4rem; font-weight: 700; }
.lookup-ipa { color: var(--accent); margin: 0.2rem 0; }
.lookup-pos { color: var(--text-muted); margin: 0; font-size: 0.85rem; }
.lookup-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.75rem; margin-bottom: 0.75rem; }
.chip-row { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1rem; }
.chip { padding: 0.4rem 0.75rem; border-radius: 999px; border: 1px solid var(--border); background: rgba(255,255,255,0.03); color: var(--text-muted); font: inherit; cursor: pointer; }
.chip[aria-pressed="true"] { color: var(--text); border-color: rgba(110,231,183,0.45); background: var(--accent-soft); }
.entry-list { list-style: none; margin: 0; padding: 0; }
.entry-row { width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 0.25rem 0.75rem; text-align: left; padding: 0.85rem 0.65rem; border: none; border-bottom: 1px solid var(--border); background: transparent; color: var(--text); font: inherit; cursor: pointer; }
.entry-row:hover { background: rgba(255,255,255,0.03); }
.entry-word { font-weight: 600; }
.entry-meta { grid-column: 1; color: var(--text-muted); font-size: 0.82rem; }
.entry-badges { grid-row: 1 / span 2; align-self: center; color: var(--accent); }
.btn, .icon-btn { font: inherit; cursor: pointer; border-radius: 10px; border: 1px solid var(--border); }
.btn { padding: 0.55rem 0.9rem; font-weight: 600; }
.btn-primary { background: var(--accent-soft); border-color: rgba(110,231,183,0.45); color: var(--text); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-secondary { background: rgba(255,255,255,0.05); color: var(--text-muted); }
.btn-danger { background: rgba(248,113,113,0.12); border-color: rgba(248,113,113,0.35); color: #fecaca; }
.btn-sm { padding: 0.35rem 0.55rem; font-size: 0.85rem; }
.file-btn { display: inline-flex; align-items: center; justify-content: center; margin-top: 0.75rem; }
.icon-btn { width: 2.25rem; height: 2.25rem; background: rgba(255,255,255,0.04); color: var(--text-muted); }
.error-banner { color: #fecaca; background: rgba(248,113,113,0.12); border: 1px solid rgba(248,113,113,0.35); padding: 0.65rem 0.85rem; border-radius: 10px; }
.muted-note { color: var(--text-muted); font-size: 0.85rem; margin: 0 0 0.75rem; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.55); display: grid; place-items: center; padding: 1rem; z-index: 30; }
.modal { width: min(520px, 100%); max-height: 90vh; overflow: auto; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem; box-shadow: var(--shadow); }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; }
.modal-head h2 { margin: 0; font-size: 1.2rem; }
.detail-photo { width: 100%; border-radius: 12px; margin-bottom: 0.75rem; }
.field { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 1rem; }
.field input { padding: 0.55rem 0.65rem; border-radius: 10px; border: 1px solid var(--border); background: rgba(255,255,255,0.04); color: var(--text); font: inherit; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.toast { position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%); background: #111827; border: 1px solid var(--border); padding: 0.65rem 1rem; border-radius: 999px; z-index: 40; }
.site-footer { margin-top: 1.5rem; color: var(--text-muted); font-size: 0.875rem; }
.site-footer a { color: inherit; }
