/* Dictionary page */

.dictionary-hero {
  padding-bottom: 0.5rem;
}

.dictionary-hero .section-tag {
  display: inline-block;
  margin-bottom: 0.35rem;
}

.dictionary-hero h1 {
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.35rem;
}

.dict-hero-sub {
  margin: 0;
  max-width: 34rem;
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.dict-body {
  padding-top: 0.75rem;
}

/* Toolbar card */
.dict-toolbar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem 1rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.25rem;
}

.dict-search-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: var(--cream);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.dict-search-wrap:focus-within {
  border-color: var(--navy);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(26, 35, 50, 0.08);
}

.dict-search-icon {
  flex-shrink: 0;
  color: var(--text-muted);
}

.dict-search {
  flex: 1;
  min-width: 0;
  border: 0;
  padding: 0;
  font: inherit;
  font-size: 1rem;
  background: transparent;
}

.dict-search::placeholder {
  color: var(--text-muted);
  opacity: 0.85;
}

.dict-search:focus {
  outline: none;
}

.dict-search-clear {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--navy-light);
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.dict-search-clear:hover {
  background: var(--border);
  color: var(--text);
}

.dict-toolbar-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--border);
}

.dict-stat-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: var(--navy-light);
  color: var(--navy);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.dict-progress-inline {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex: 1;
  min-width: 180px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

.dict-progress-inline .progress-bar {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: var(--cream-darker);
}

.dict-progress-inline #progress-percent {
  color: var(--red);
  min-width: 2.25rem;
  text-align: right;
}

.dict-quick {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.65rem;
  margin-top: 0.85rem;
}

.dict-quick-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.dict-quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.dict-quick-chip {
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}

.dict-quick-chip:hover {
  border-color: var(--navy-muted);
  background: var(--cream);
}

.dict-quick-chip:active {
  transform: scale(0.98);
}

.dict-quick-chip .learning-kr {
  font-weight: 700;
}

.dict-toolbar .tab-bar--dictionary {
  margin: 0.85rem 0 0;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}

.tab--dictionary {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
  font-size: 0.82rem;
}

.dict-results {
  margin-top: 0.25rem;
}

.dict-result-note {
  margin: 0 0 0.85rem;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-muted);
}

.dict-word-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

/* Compact dictionary cards */
.dictionary-page .dict-card {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.7rem 0.8rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-align: left;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.dictionary-page .dict-card:hover {
  border-color: var(--navy-light);
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
}

.dictionary-page .dict-card.learned {
  background: linear-gradient(180deg, var(--surface) 0%, rgba(199, 62, 58, 0.035) 100%);
  border-color: rgba(199, 62, 58, 0.2);
}

.dict-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.dict-card-main {
  flex: 1;
  min-width: 0;
}

.dict-card-kr {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.2;
  color: var(--navy);
}

.dict-card-kr--multi {
  font-size: 1rem;
  line-height: 1.3;
}

.dict-card-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2rem 0.35rem;
  margin: 0.25rem 0 0;
  font-size: 0.76rem;
  line-height: 1.35;
  color: var(--text-muted);
}

.dict-card-cat {
  flex-shrink: 0;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  background: var(--navy-light);
  color: var(--navy-muted);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.dict-card-dot {
  color: var(--border);
  font-weight: 700;
  user-select: none;
}

.dict-card-roman {
  color: var(--text-muted);
}

.dict-card-meaning {
  color: var(--text);
  font-weight: 600;
}

.dict-card-actions {
  display: flex;
  flex-shrink: 0;
  gap: 0.3rem;
}

.dict-card-btn {
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.dict-card-btn--play {
  width: 30px;
  height: 30px;
  color: var(--red);
}

.dict-card-btn--learn {
  width: 30px;
  height: 30px;
}

.dict-card-btn--play:hover {
  border-color: var(--red);
  background: var(--red-light);
}

.dict-card-btn--sm {
  width: 26px;
  height: 26px;
}

.dict-card-btn--learn.is-learned {
  border-color: var(--red);
  background: var(--red-light);
  color: var(--red);
}

.dict-card-btn--learn:not(.is-learned):hover {
  border-color: var(--navy-muted);
  color: var(--navy);
}

.dict-card-example {
  padding: 0.45rem 0.55rem;
  background: var(--cream);
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.dict-card-example-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.35rem;
}

.dict-card-example-kr {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--text);
}

.dict-card-example-en {
  margin: 0.2rem 0 0;
  font-size: 0.72rem;
  line-height: 1.35;
  color: var(--text-muted);
}

.dict-card-tip {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.4;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dict-card-tip-label {
  font-weight: 700;
  color: var(--navy-muted);
  margin-right: 0.2rem;
}

.dict-empty {
  padding: 2.5rem 1.5rem;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.dict-empty-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.dict-empty h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}

.dict-empty p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  max-width: 26rem;
  margin-inline: auto;
}

.dict-voice {
  padding-top: 0;
}

.dict-voice .voice-bar {
  justify-content: flex-start;
}

@media (max-width: 1100px) {
  .dict-word-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .dict-word-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .dict-toolbar {
    padding: 1rem;
    border-radius: var(--radius-sm);
  }

  .dict-search-wrap {
    padding: 0.75rem 0.9rem;
  }

  .dict-search {
    font-size: 16px;
  }

  .dict-toolbar-meta {
    flex-direction: column;
    align-items: stretch;
  }

  .dict-progress-inline {
    min-width: 0;
  }

  .tab-bar--dictionary {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 0.4rem;
    padding-bottom: 0.15rem;
  }

  .tab-bar--dictionary::-webkit-scrollbar {
    display: none;
  }

  .tab--dictionary {
    flex: 0 0 auto;
    min-height: 44px;
    padding: 0.55rem 0.85rem;
  }

  .dict-quick-chip,
  .dict-search-clear {
    min-height: 44px;
  }

  .dict-card-btn--play,
  .dict-card-btn--learn {
    width: 36px;
    height: 36px;
  }

  .dict-card-btn--sm {
    width: 32px;
    height: 32px;
  }
}
