/* ── Tamil Hebrew Bible Word Dictionary ── */

/* ─── Theme Variables ──────────────────────────────────────── */
:root {
  --bg: #F9F7F2;
  --bg2: #f0ede6;
  --bg3: #e8e4db;
  --text: #1a1a1a;
  --text2: #555;
  --text3: #888;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-light: #dbeafe;
  --border: #d6d0c8;
  --shadow: 0 2px 8px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.15);
  --radius: 10px;
  --radius-sm: 6px;
  --font-scale: 1;
  --font-family: 'Noto Serif Tamil', serif;
  --header-h: 56px;
  --tile-bg: #fff;
  --tile-border: #e0dbd2;
  --tile-hover: #f0f4ff;
  --modal-bg: #fff;
  --tag-bg: #eff6ff;
  --tag-text: #1d4ed8;
  --toast-bg: #1e293b;
  --toast-text: #f1f5f9;
  --toggle-bg: #e2e8f0;
  --toggle-active-bg: #2563eb;
  --toggle-active-text: #fff;
  --input-bg: #fff;
  --input-border: #cbd5e1;
  --dd-bg: #fff;
  --dd-hover: #f1f5f9;
}

:root[data-theme="dark"] {
  --bg: #0f172a;
  --bg2: #1e293b;
  --bg3: #334155;
  --text: #e2e8f0;
  --text2: #94a3b8;
  --text3: #64748b;
  --accent: #60a5fa;
  --accent-hover: #3b82f6;
  --accent-light: #1e3a5f;
  --border: #334155;
  --shadow: 0 2px 8px rgba(0,0,0,0.40);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.50);
  --tile-bg: #1e293b;
  --tile-border: #334155;
  --tile-hover: #1e3a5f;
  --modal-bg: #1e293b;
  --tag-bg: #1e3a5f;
  --tag-text: #93c5fd;
  --toast-bg: #f1f5f9;
  --toast-text: #1e293b;
  --toggle-bg: #334155;
  --toggle-active-bg: #3b82f6;
  --input-bg: #1e293b;
  --input-border: #475569;
  --dd-bg: #1e293b;
  --dd-hover: #334155;
}

:root[data-theme="sepia"] {
  --bg: #fdf6e3;
  --bg2: #f5ead0;
  --bg3: #ecdcb5;
  --text: #3d2b1f;
  --text2: #7a5c3c;
  --text3: #a88060;
  --accent: #8b5e3c;
  --accent-hover: #6d4a2f;
  --accent-light: #f5e6d0;
  --border: #d9c9a8;
  --shadow: 0 2px 8px rgba(100,60,20,0.12);
  --shadow-lg: 0 8px 32px rgba(100,60,20,0.18);
  --tile-bg: #fffdf5;
  --tile-border: #dcc89a;
  --tile-hover: #f5e6d0;
  --modal-bg: #fefcf0;
  --tag-bg: #f5e6d0;
  --tag-text: #8b5e3c;
  --toggle-bg: #e8d5b0;
  --toggle-active-bg: #8b5e3c;
  --input-bg: #fffdf5;
  --input-border: #c9b08a;
  --dd-bg: #fffdf5;
  --dd-hover: #f0e4c8;
}

/* ─── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: calc(16px * var(--font-scale)); scroll-behavior: smooth; }

body {
  font-family: var(--font-family);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background 0.2s, color 0.2s;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

button {
  cursor: pointer;
  font-family: var(--font-family);
  font-size: inherit;
  border: none;
  background: none;
  color: inherit;
}

/* ─── Header / App Bar ─────────────────────────────────────── */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 12px;
  box-shadow: var(--shadow);
}

.app-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
}
.app-title:hover { color: var(--accent); }

.ctrl-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  color: var(--text2);
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
  position: relative;
}
.ctrl-btn:hover { background: var(--bg3); color: var(--text); }
.ctrl-btn svg { width: 18px; height: 18px; flex-shrink: 0; }

.font-size-group { display: flex; gap: 2px; }
.font-lbl { font-weight: 600; font-size: 0.8rem; }

/* ─── Theme Switch ─────────────────────────────────────────── */
.theme-switch { display: flex; gap: 2px; }
.theme-btn {
  width: 30px;
  height: 28px;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text3);
  transition: background 0.15s, color 0.15s;
}
.theme-btn:hover { background: var(--bg3); color: var(--text); }
.theme-btn.active { background: var(--accent); color: #fff; }

/* ─── Font Family Select ───────────────────────────────────── */
.font-family-select {
  height: 28px;
  padding: 0 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  font-size: 0.75rem;
  cursor: pointer;
}

/* ─── History Dropdown ─────────────────────────────────────── */
.history-wrap { position: relative; }
.history-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 240px;
  max-width: 320px;
  background: var(--dd-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  overflow: hidden;
}
.history-dropdown.open { display: block; }
.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text2);
}
.history-clear {
  font-size: 0.72rem;
  color: var(--accent);
  padding: 2px 6px;
  border-radius: 4px;
}
.history-clear:hover { background: var(--accent-light); }
.history-list { max-height: 240px; overflow-y: auto; }
.history-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 14px;
  font-size: 0.85rem;
  color: var(--text);
  border: none;
  background: none;
  cursor: pointer;
  transition: background 0.1s;
}
.history-item:hover { background: var(--dd-hover); }
.history-empty { padding: 10px 14px; font-size: 0.8rem; color: var(--text3); }

/* ─── Main Layout ──────────────────────────────────────────── */
.main-content {
  flex: 1;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

/* ─── Hero / Search Area ───────────────────────────────────── */
.hero {
  text-align: center;
  padding: 32px 0 24px;
}
.hero-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.hero-subtitle {
  font-size: 0.9rem;
  color: var(--text3);
  margin-bottom: 20px;
}

/* ─── Lang Toggle ──────────────────────────────────────────── */
.lang-toggle {
  display: inline-flex;
  background: var(--toggle-bg);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
  margin-bottom: 18px;
}
.lang-btn {
  padding: 6px 18px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text2);
  transition: background 0.15s, color 0.15s;
}
.lang-btn.active {
  background: var(--toggle-active-bg);
  color: var(--toggle-active-text);
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

/* ─── Search Input ─────────────────────────────────────────── */
.search-wrap {
  position: relative;
  max-width: 560px;
  margin: 0 auto;
}
.search-input {
  width: 100%;
  padding: 12px 48px 12px 16px;
  border-radius: var(--radius);
  border: 2px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text);
  font-size: 1rem;
  font-family: var(--font-family);
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}
.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}
.search-clear {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  display: none;
  align-items: center;
  justify-content: center;
  color: var(--text3);
  border-radius: 50%;
  font-size: 1.1rem;
  line-height: 1;
}
.search-clear.visible { display: flex; }
.search-clear:hover { background: var(--bg3); color: var(--text); }

/* ─── Suggestions Dropdown ─────────────────────────────────── */
.suggestions {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--dd-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  overflow: hidden;
  max-height: 420px;
  overflow-y: auto;
}
.suggestions.open { display: block; }
.suggest-section-label {
  padding: 8px 14px 6px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text3);
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1;
}
.suggest-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.1s;
  text-align: left;
}
.suggest-item:hover, .suggest-item.focused { background: var(--dd-hover); }
.suggest-main { flex: 1; min-width: 0; text-align: left; }
.suggest-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-start;
  text-align: left;
}
.suggest-word {
  font-size: 0.9rem;
  color: var(--text);
  font-weight: 600;
  text-align: left;
}
.suggest-inline-hebrew {
  font-size: 1.15rem;
  font-family: 'SBL Hebrew', 'Times New Roman', serif;
  direction: rtl;
  unicode-bidi: embed;
  color: var(--text);
  flex-shrink: 0;
}
.suggest-inline-greek {
  font-size: 1.15rem;
  font-family: 'Times New Roman', 'GFS Didot', serif;
  color: var(--text);
  flex-shrink: 0;
}
.suggest-side-meta {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--text3);
  white-space: nowrap;
  text-align: right;
}
.suggest-snippet {
  font-size: 0.78rem;
  color: var(--text2);
  margin-top: 5px;
  line-height: 1.5;
  text-align: left;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.suggest-count {
  display: inline-block;
  background: var(--tag-bg);
  color: var(--tag-text);
  padding: 2px 7px;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 600;
}
.suggest-count.hebrew-badge { background: var(--accent-light); color: var(--accent); }
.suggest-count.greek-badge { background: #dbeafe; color: #1d4ed8; }
:root[data-theme="dark"] .suggest-count.greek-badge { background: #1e3a5f; color: #93c5fd; }
.search-hit {
  background: #fde68a;
  color: #1a1a1a;
  padding: 0 1px;
  border-radius: 2px;
  font-weight: 600;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
:root[data-theme="dark"] .search-hit {
  background: #854d0e;
  color: #fef3c7;
}
:root[data-theme="sepia"] .search-hit {
  background: #f5d080;
  color: #3d2b1f;
}

/* ─── Browse Grid (default — no search) ───────────────────── */
.section-label {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text3);
  text-transform: uppercase;
  margin-bottom: 14px;
  margin-top: 28px;
}

.word-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.word-tile {
  background: var(--tile-bg);
  border: 1px solid var(--tile-border);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 0.9rem;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
  line-height: 1.4;
  min-height: 44px;
  display: flex;
  align-items: center;
}
.word-tile:hover {
  background: var(--tile-hover);
  border-color: var(--accent);
  box-shadow: var(--shadow);
  color: var(--accent);
}
.suggest-empty { padding: 12px 14px; color: var(--text3); font-size: 0.85rem; }

.hebrew-tile {
  font-size: 0.82rem;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
.greek-tile {
  font-size: 0.82rem;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
.tile-hebrew-text {
  font-size: 1.35rem;
  font-family: 'SBL Hebrew', 'Times New Roman', serif;
  direction: rtl;
  width: 100%;
  text-align: right;
  color: var(--text);
  line-height: 1.2;
}
.tile-greek-text {
  font-size: 1.35rem;
  font-family: 'Times New Roman', 'GFS Didot', serif;
  width: 100%;
  text-align: left;
  color: var(--text);
  line-height: 1.2;
}
.tile-strong { font-size: 0.72rem; color: var(--accent); font-weight: 700; display: block; }
.tile-def { font-size: 0.75rem; color: var(--text3); display: block; line-height: 1.35; }

.load-more-wrap { text-align: center; margin-top: 24px; }
.load-more-btn {
  padding: 10px 32px;
  border-radius: var(--radius);
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 600;
  transition: background 0.15s;
}
.load-more-btn:hover { background: var(--bg3); }
.load-more-btn:disabled { opacity: 0.5; cursor: default; }

/* ─── Results Table ────────────────────────────────────────── */
.results-section { margin-top: 8px; }

.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.results-table th {
  text-align: left;
  padding: 10px 12px;
  background: var(--bg2);
  border-bottom: 2px solid var(--border);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text2);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.results-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.results-table tr:hover td { background: var(--dd-hover); }
.col-word { font-weight: 600; color: var(--text); }
.col-count {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}
.col-preview { font-size: 0.8rem; color: var(--text3); max-width: 220px; }
.view-btn {
  padding: 5px 14px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  transition: background 0.15s;
  white-space: nowrap;
}
.view-btn:hover { background: var(--accent-hover); }

/* ─── Loading / Empty States ───────────────────────────────── */
.loading-state, .empty-state {
  padding: 48px 16px;
  text-align: center;
  color: var(--text3);
  font-size: 0.9rem;
}
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Modal ────────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 500;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--modal-bg);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 680px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
}
.modal-hebrew {
  font-size: 2rem;
  font-family: 'SBL Hebrew', 'Times New Roman', serif;
  direction: rtl;
  unicode-bidi: embed;
  color: var(--text);
  line-height: 1.2;
  flex-shrink: 0;
  min-width: 2.5rem;
  text-align: left;
  align-self: flex-start;
  padding-top: 2px;
}
.modal-hebrew.hidden { display: none; }
.modal-greek {
  font-size: 2rem;
  font-family: 'Times New Roman', 'GFS Didot', serif;
  color: var(--text);
  line-height: 1.2;
  flex-shrink: 0;
  min-width: 2.5rem;
  text-align: left;
  align-self: flex-start;
  padding-top: 2px;
}
.modal-greek.hidden { display: none; }
.modal-title-wrap { flex: 1; min-width: 0; text-align: left; }
.modal-word {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  word-break: break-word;
  text-align: left;
}
.modal-sub {
  font-size: 0.82rem;
  color: var(--text3);
  margin-top: 4px;
  text-align: left;
}
.modal-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.modal-open-page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg2);
  color: var(--text2);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.modal-open-page-btn:hover {
  background: var(--bg3);
  color: var(--text);
}

.modal-share-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg2);
  border: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--text2);
  flex-shrink: 0;
  transition: background 0.15s;
}
.modal-share-btn:hover { background: var(--bg3); color: var(--text); }
.modal-close-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg2);
  color: var(--text2);
  font-size: 1.1rem;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}
.modal-close-btn:hover { background: var(--bg3); color: var(--text); }

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.modal-section { margin-bottom: 20px; }
.modal-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text3);
  margin-bottom: 8px;
}
.modal-content-text {
  font-size: 0.93rem;
  color: var(--text);
  line-height: 1.7;
}
.modal-count-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--tag-bg);
  color: var(--tag-text);
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.admin-badge {
  display: inline-block;
  background: #ede9fe;
  color: #5b21b6;
  border: 1px solid #ddd6fe;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 12px;
  margin-right: 8px;
}
:root[data-theme="dark"] .admin-badge {
  background: #312e81;
  color: #c4b5fd;
  border-color: #4338ca;
}

.verse-list { display: flex; flex-direction: column; gap: 10px; }
.verse-item {
  background: var(--bg2);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 10px 14px;
}
.verse-ref {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 4px;
}
.verse-text {
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.65;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
}
.modal-close-bottom {
  padding: 8px 24px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  transition: background 0.15s;
}
.modal-close-bottom:hover { background: var(--bg3); }

/* ─── Toast ─────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: var(--toast-bg);
  color: var(--toast-text);
  padding: 9px 20px;
  border-radius: 99px;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 9999;
  white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ─── Footer ─────────────────────────────────────────────────── */
.site-footer {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: 24px 16px 20px;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text3);
  margin-top: auto;
}
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 18px;
  margin-bottom: 10px;
}
.footer-nav a { color: var(--accent); }
.footer-nav a:hover { text-decoration: underline; }
.footer-copy { margin-bottom: 6px; }
.footer-copy a { color: var(--accent); }
.footer-contact {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 20px;
  font-size: 0.78rem;
}
.footer-contact a { color: var(--text3); }
.footer-contact a:hover { color: var(--accent); }

/* ─── Fullscreen ─────────────────────────────────────────────── */
:fullscreen .app-header { position: fixed; width: 100%; }
:fullscreen .main-content { padding-top: calc(var(--header-h) + 24px); }

/* ─── Utilities ──────────────────────────────────────────────── */
.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;
}

/* ─── Word page (standalone) ─────────────────────────────────── */
.word-page-body { min-height: 100vh; display: flex; flex-direction: column; }
.word-page-header { justify-content: flex-start; gap: 16px; }
.word-back-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
  white-space: nowrap;
}
.word-back-link:hover { text-decoration: underline; }
.word-page-main {
  flex: 1;
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 16px 40px;
}
.word-page-card {
  background: var(--modal-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.word-page-head {
  padding: 24px 24px 16px;
  border-bottom: 1px solid var(--border);
}
.word-page-title {
  font-size: 1.6rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.3;
  word-break: break-word;
}
.word-page-sub {
  margin: 6px 0 0;
  color: var(--text2);
  font-size: 0.95rem;
}
.word-page-content {
  padding: 20px 24px 28px;
}

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .word-grid { grid-template-columns: repeat(2, 1fr); }
  .app-title { display: none; }
  .hero-title { font-size: 1.25rem; }
  .results-table th:nth-child(3),
  .results-table td:nth-child(3) { display: none; }
  .modal { max-height: 95vh; }
}

@media (max-width: 420px) {
  .word-grid { grid-template-columns: repeat(2, 1fr); gap: 7px; }
  .lang-btn { padding: 5px 12px; font-size: 0.8rem; }
  .main-content { padding: 16px 10px 40px; }
}
