/* ── Frequency page styles ── */

.freq-header { margin: 1.5rem 0 1rem; }

.freq-banner {
  border-radius: 14px;
  padding: 1.5rem 2rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1rem;
}
.freq-banner-icon { font-size: 2.5rem; flex-shrink: 0; }
.freq-banner h1 { font-size: 1.6rem; margin-bottom: 0.2rem; }
.freq-meta { color: rgba(255,255,255,0.6); font-size: 0.88rem; }

.freq-controls {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.freq-controls input {
  flex: 1;
  min-width: 200px;
  padding: 0.55rem 0.9rem;
  font-size: 0.95rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--font);
  outline: none;
}
.freq-controls input:focus { border-color: var(--accent2); }
.freq-controls input::placeholder { color: var(--muted); }

.table-wrap {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  table-layout: fixed;
  font-size: 0.92rem;
}

thead tr { background: #0d1b35; }
thead th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  user-select: none;
  color: var(--muted);
  white-space: nowrap;
}
thead th:hover { color: var(--text); }
thead th:nth-child(1) { width: 52px; }
thead th:nth-child(2) { width: 130px; }
thead th:nth-child(3) { width: 120px; }
thead th:nth-child(4) { width: 95px; }
thead th:nth-child(5) { width: 180px; }
thead th:nth-child(6) { width: auto; }
thead th:nth-child(7) { width: 72px; }

.sort-icon { opacity: 0.4; font-size: 0.75rem; }

tbody tr { border-bottom: 1px solid var(--border); transition: background 0.1s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: rgba(255,255,255,0.04); }

td {
  padding: 0.6rem 1rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
td:first-child { color: var(--muted); font-size: 0.82rem; }

.word-cell { font-size: 1.15rem; font-weight: 500; }
.word-cell a { color: var(--text); text-decoration: none; border-bottom: 1px dashed rgba(255,255,255,0.2); }
.word-cell a:hover { color: var(--accent2); border-bottom-color: var(--accent2); }

.reading-cell { color: #aaa; font-size: 0.88rem; }

.pos-badge {
  display: inline-block;
  background: rgba(160, 196, 255, 0.12);
  color: var(--accent2);
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 0.78rem;
}

.meaning-cell { color: #bbb; font-size: 0.86rem; white-space: normal; line-height: 1.4; }
.example-cell { color: #888; font-size: 0.84rem; white-space: normal; line-height: 1.4; }

.count-cell { font-weight: 700; color: var(--accent); text-align: right; font-size: 0.9rem; }

.hidden { display: none; }

.result-count {
  color: var(--muted);
  font-size: 0.82rem;
  padding: 0.5rem 0;
  text-align: right;
}

@media (max-width: 640px) {
  .freq-banner { padding: 1rem; flex-direction: row; }
  .freq-banner h1 { font-size: 1.2rem; }
  thead th:nth-child(5),
  thead th:nth-child(6) { display: none; }
  td:nth-child(5),
  td:nth-child(6) { display: none; }
}

/* Tablet: sidebar collapses, rectangle ad shows as banner */
@media (max-width: 1024px) {
  .freq-controls { flex-direction: column; align-items: stretch; }
  .freq-controls input { min-width: 100%; }
}

/* Mobile: tighten table further */
@media (max-width: 480px) {
  thead th:nth-child(3),
  thead th:nth-child(4) { display: none; }
  td:nth-child(3),
  td:nth-child(4) { display: none; }
  .freq-banner-icon { font-size: 1.8rem; }
}
