:root {
  --primary: #2c3e50;
  --primary-hover: #34495e;
  --primary-focus: rgba(44, 62, 80, 0.15);
  --primary-inverse: #fff;
  --text-main: #1c2833;
  --text-secondary: #5d6d7e;
  --text-muted: #95a5a6;
  --accent: #936a53;
  --accent-light: rgba(147, 106, 83, 0.1);
  --background: #f8f9fa;
  --card-background: #fff;
  --border-subtle: #e6e9ed;
  --shadow-soft: 0 4px 12px rgba(0, 0, 0, 0.05);
  --transition-standard: all 0.3s ease;
  --transition-expand: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);

  /* POS Colors */
  --pos-noun-color: #1f618d; /* Darker Blue */
  --pos-adjective-color: #1e8449; /* Darker Green */
  --pos-verb-color: #008080; /* Moderate Teal */
  --pos-adverb-color: #6c3483; /* Darker Purple */
  --pos-preposition-color: #515a5a; /* Darker Grey */
  --pos-other-color: var(--text-main); /* Fallback */

  /* New POS Background Colors */
  --pos-noun-bg: rgba(31, 97, 141, 0.1); /* Light Blue */
  --pos-adjective-bg: rgba(30, 132, 73, 0.1); /* Light Green */
  --pos-verb-bg: rgba(0, 128, 128, 0.1); /* Light Teal */
  --pos-adverb-bg: rgba(108, 52, 131, 0.1); /* Light Purple */
  --pos-preposition-bg: rgba(81, 90, 90, 0.1); /* Light Grey */
  --pos-other-bg: rgba(28, 40, 51, 0.05); /* Very Light Grey/Fallback */
}
body {
  align-items: center;
  background-color: var(--background);
  color: var(--text-main);
  display: flex;
  font-family: Spectral, Georgia, serif;
  justify-content: center;
  line-height: 1.4;
  margin: 0;
  min-height: 100vh;
  padding: 0;
}
.app-container {
  background-color: var(--card-background);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  margin: 1.5rem auto;
  max-width: 600px;
  overflow: hidden;
  padding: 1.5rem;
  position: relative;
  transition: var(--transition-standard);
  width: 100%;
}
.app-title {
  display: inline-block;
  left: 50%;
  margin: 0 0 2rem;
  position: relative;
  text-align: center;
  transform: translateX(-50%);
}
.app-title:after {
  background-color: var(--border-subtle);
  bottom: -10px;
  content: "";
  height: 1px;
  left: 25%;
  position: absolute;
  width: 50%;
}
.search-area {
  margin-bottom: 0.75rem;
}
.search-area,
.search-container {
  position: relative;
  transition: var(--transition-expand);
}
.search-container {
  margin-bottom: 0.3rem;
}
#word {
  background-color: transparent;
  border: none;
  border-bottom: 1px solid var(--border-subtle);
  border-radius: 0;
  box-shadow: none;
  color: var(--text-main);
  font-family: Spectral, Georgia, serif;
  font-size: 1.1rem;
  font-weight: 400;
  outline: none;
  padding: 0.75rem 1rem;
  transition: var(--transition-standard);
  width: 100%;
}
#word::placeholder {
  color: var(--text-muted);
  font-style: italic;
  opacity: 0.7;
}
#word:focus {
  border-bottom-color: var(--accent);
  box-shadow: 0 2px 0 rgba(147, 106, 83, 0.2);
}
.auto-detect-info {
  color: var(--muted-color);
  display: block;
  font-style: italic;
  margin-top: 0.5rem;
  padding-left: 1.5rem;
  position: relative;
}
.auto-detect-info:before {
  content: "🔍";
  left: 0;
  position: absolute;
  top: 0;
}
.suggestions-embedded {
  background-color: var(--accent-focus);
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  margin-top: 0.5rem;
  max-height: 250px;
  overflow-y: auto;
  position: relative;
  transition: var(--transition-expand);
  width: 100%;
  z-index: 100;
}
.suggestions-embedded::-webkit-scrollbar {
  width: 6px;
}
.suggestions-embedded::-webkit-scrollbar-thumb {
  background-color: var(--text-muted);
  border-radius: 3px;
}
.suggestion-item {
  align-items: flex-start;
  border-bottom: 1px solid var(--muted-border-color);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  padding: 15px;
  transition: background-color 0.2s ease;
}
.suggestion-item.loading {
  background-color: var(--background);
  color: var(--text-secondary);
  cursor: default;
  font-style: italic;
  justify-content: center;
  padding: 1rem;
  text-align: center;
}
.suggestion-item:last-child {
  border-bottom: none;
}
.suggestion-item.selected,
.suggestion-item:hover {
  background-color: var(--accent-light);
}
.suggestion-item.selected {
  border-left: 3px solid var(--accent);
  padding-left: calc(1.5rem - 3px);
}
.suggestion-lang {
  background-color: var(--primary-focus);
  border-radius: 3px;
  color: var(--primary);
  display: flex;
  flex-shrink: 0;
  font-weight: 500;
  gap: 0.3rem;
  letter-spacing: 0.05em;
  margin-left: 8px;
  padding: 0.1rem 0.4rem;
  text-transform: none;
}
.definition-count,
.suggestion-lang {
  align-items: center;
  font-size: 0.65rem;
}
.definition-count {
  background-color: var(--accent);
  border-radius: 50%;
  color: #fff;
  display: inline-flex;
  font-weight: 700;
  height: 18px;
  justify-content: center;
  margin-left: 4px;
  width: 18px;
}
.suggestion-word {
  flex: 1;
  font-size: 1rem;
  font-weight: 500;
  min-width: 0;
  overflow: hidden;
  padding-right: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.suggestion-translation {
  color: var(--text-secondary);
  font-style: italic;
  font-weight: 400;
}
.suggestion-arrow {
  color: var(--text-muted);
  margin: 0 0.2rem;
}
.results-area {
  border-top: 1px solid var(--border-subtle);
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  position: relative;
}
.translation-container {
  display: block;
  margin-top: 0;
  max-height: 0;
  opacity: 0;
  overflow-y: hidden;
  transition: var(--transition-expand);
}
.translation-container.visible {
  margin-top: 0.5rem;
  max-height: none;
  opacity: 1;
}
.results-active .translation-container.visible {
  margin-top: 0.75rem;
}
.translation-card {
  background-color: #fff;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  margin-bottom: 1.5rem;
  opacity: 0;
  padding: 20px;
  transform: translateY(10px);
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
}
.translation-card.visible {
  opacity: 1;
  transform: translateY(0);
}
.translation-header {
  align-items: center;
  display: flex;
  gap: 1rem;
  margin-bottom: 0.6rem;
  flex-wrap: wrap;
}
.translation-header h2 {
  align-items: flex-start;
  color: var(--text-main);
  display: flex;
  flex-wrap: wrap;
  font-size: 1.5rem;
  font-weight: 600;
  gap: 0.5rem;
  justify-content: center;
  line-height: 1.3;
  margin: 0;
}
.translation-arrow {
  align-items: flex-start;
  align-self: flex-start;
  display: flex;
  height: 24px;
  margin-top: 0.23rem;
  position: relative;
  top: -3px;
}
.translation-card .success {
  background-color: rgba(39, 174, 96, 0.1);
  border-radius: 4px;
  color: #27ae60;
  font-style: italic;
  margin-bottom: 1rem;
  padding: 0.5rem;
}
#translationResult .error {
  background-color: var(--form-element-invalid-active-background-color);
  border-left: 4px solid var(--form-element-invalid-border-color);
  border-radius: var(--border-radius);
  color: var(--form-element-invalid-color);
  padding: 0.75rem;
}
#translationResult .not-found {
  background-color: hsla(0, 93%, 94%, 0.2);
  border-left: 4px solid var(--del-color);
  border-radius: var(--border-radius);
  color: var(--del-color);
  padding: 0.75rem;
}
#translationResult .note {
  background-color: var(--primary-focus);
  border-left: 4px solid var(--primary);
  border-radius: var(--border-radius);
  color: var(--primary);
  padding: 0.75rem;
}
#translationResult {
  font-size: 1.1rem;
}
#translationResult .arrow {
  color: var(--muted-color);
  display: inline-block;
  font-size: 1.4rem;
  margin: 0 15px;
  vertical-align: middle;
}
.results-article footer {
  border-top: 1px solid var(--muted-border-color);
  padding: 1rem;
}
.example-translations h5 {
  color: var(--h5-color);
  font-size: 1rem;
  margin-bottom: 0.5rem;
  margin-top: 0.5rem;
}
.dictionary-info,
.translation-count {
  color: var(--muted-color);
  font-size: 0.85rem;
  margin-bottom: 0;
  margin-top: 0.5rem;
}
#dictionarySource {
  color: var(--primary);
  font-weight: 600;
}
#translationCount {
  color: var(--form-element-valid-color);
  font-weight: 600;
}
.language-flag {
  align-items: center;
  border-radius: 2px;
  display: inline-flex;
  height: 18px;
  justify-content: center;
  margin-right: 5px;
  overflow: hidden;
  vertical-align: middle;
  width: 24px;
}
.flag-svg {
  display: block;
  height: auto;
  width: 100%;
}
.language-name {
  align-items: center;
  color: var(--text-secondary);
  display: inline-flex;
  font-size: 0.85rem;
}
.language-flags {
  margin-bottom: 0;
}
.language-flags,
.language-from,
.language-to {
  align-items: center;
  display: flex;
}
.suggestion-lang .language-flag {
  height: 15px !important;
  width: 20px !important;
}
.language-arrow {
  align-items: center;
  color: var(--text-secondary);
  display: inline-flex;
  font-size: 1rem;
  margin: 0 6px;
}
.translation-main .language-flag {
  height: 12px !important;
  width: 16px !important;
}
.translation-main {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
}
.original,
.translated {
  color: var(--text-main);
  font-size: 1.4rem;
  font-weight: 600;
}
.part-of-speech {
  background-color: #f1f5f9;
  border-radius: 3px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-style: italic;
  margin-left: 0.5rem;
  padding: 0.1rem 0.4rem;
}
.pronunciation {
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  font-family: var(--font-family);
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.linguistic-category {
  border-radius: 3px;
  color: var(--primary);
  display: inline-block;
  font-size: 0.8rem;
  font-style: italic;
  margin-right: 8px;
  padding: 2px 6px;
  text-transform: lowercase;
}
/* Add specific background colors based on POS class */
.linguistic-category.pos-noun { background-color: var(--pos-noun-bg); color: var(--pos-noun-color); }
.linguistic-category.pos-adjective { background-color: var(--pos-adjective-bg); color: var(--pos-adjective-color); }
.linguistic-category.pos-verb { background-color: var(--pos-verb-bg); color: var(--pos-verb-color); }
.linguistic-category.pos-adverb { background-color: var(--pos-adverb-bg); color: var(--pos-adverb-color); }
.linguistic-category.pos-preposition { background-color: var(--pos-preposition-bg); color: var(--pos-preposition-color); }
.linguistic-category.pos-auxiliary-verb { background-color: var(--pos-verb-bg); color: var(--pos-verb-color); }
.linguistic-category.pos-other,
.linguistic-category.pos-unknown,
.linguistic-category.pos- {
  background-color: var(--pos-other-bg);
  color: var(--pos-other-color);
}
.transcriptions-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.source-transcription,
.target-transcription {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.transcription-label {
  color: var(--text-main);
  font-weight: 500;
}
.transcription {
  font-style: italic;
  margin-right: 0.5rem;
}
.etymology,
.transcription {
  color: var(--text-secondary);
}
.etymology {
  border-top: 1px solid var(--border-subtle);
  font-size: 0.95rem;
  line-height: 1.3;
  margin: 1rem 0 0.5rem;
  padding: 0.5rem 0;
}
.etymology-item {
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 0.5rem;
}
.etymology-item:last-child {
  margin-bottom: 0;
}
.dictionary-details {
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
}
.dictionary-details h4 {
  border-bottom: 1px dashed var(--border-subtle);
  color: var(--accent);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
  margin: 0;
  padding: 0 0 0.2rem;
}
.antonyms-list,
.etymology-source,
.etymology-target,
.examples-list,
.synonyms-list {
  margin-top: 0.3rem;
}
.antonyms-section,
.etymology-section,
.examples-section,
.synonyms-section {
  margin-bottom: 1.2rem;
  margin-top: 1.2rem;
  padding: 0;
}
.antonyms-section {
  background-color: rgba(236, 240, 241, 0.5);
  border-radius: 4px;
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-subtle);
}
.dictionary-details > div:first-child {
  margin-top: 0;
}
.dictionary-details > div + div {
  margin-top: 1.5rem;
}
.etymology-label {
  color: var(--text-main);
  font-weight: 500;
  margin-right: 0.5rem;
}
.etymology-text {
  color: var(--text-secondary);
  font-style: italic;
}
.examples-list {
  list-style-type: none;
  margin: 0.3rem 0 0;
  padding: 0 0 0 1.5rem;
}
.examples-list li {
  border-bottom: 1px dotted var(--border-subtle);
  color: var(--text-secondary);
  font-style: italic;
  margin: 0;
  padding: 0.3rem 0;
}
.examples-list li:last-child {
  border-bottom: none;
}
.semantic-relations {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 1.5rem;
}
.semantic-relations > div:first-child {
  margin-top: 0;
}
.semantic-relations > div + div {
  margin-top: 0.75rem;
}
.antonyms-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.8rem;
  padding-left: 0;
  list-style: none;
  margin: 0.5rem 0 0;
}
.antonym {
  background-color: var(--card-background);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  color: var(--accent);
  cursor: pointer;
  display: inline-block;
  font-size: 0.85rem;
  padding: 0.25rem 0.6rem;
  text-decoration: none;
  transition: var(--transition-standard);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  white-space: nowrap;
}
.antonym:hover {
  background-color: var(--accent-light);
  border-color: var(--accent);
  color: var(--primary);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}
@media screen and (max-width: 600px) {
  .translation-main {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.3rem;
  }
  .arrow {
    display: none;
  }
  .original,
  .translated {
    font-size: 1.2rem;
  }
  .dictionary-details {
    gap: 1.5rem;
  }
  .antonym {
    font-size: 0.8rem;
    padding: 0.2rem 0.5rem;
  }
  .language-flags {
    align-items: center;
    flex-wrap: wrap;
  }
  .translation-header {
    flex-wrap: wrap;
  }
  .suggestions-embedded {
    max-height: 250px;
  }
  .suggestion-item {
    align-items: center;
    flex-direction: row;
    padding: 12px 10px;
  }
  .suggestion-lang {
    font-size: 0.6rem;
    justify-content: flex-end;
    margin-top: 0;
    width: auto;
  }
  .suggestion-word {
    max-width: 60%;
  }
  .language-name {
    font-size: 0.75rem;
  }
}
@media screen and (max-width: 400px) {
  .suggestion-item {
    padding: 10px 8px;
  }
  .suggestion-lang {
    font-size: 0.55rem;
    padding: 0.05rem 0.25rem;
  }
  .language-name {
    display: none;
  }
  .suggestion-word {
    max-width: 65%;
  }
}
.suggestions-embedded[style*="display: block"] {
  display: block !important;
}
#loadingIndicator {
  background-color: hsla(0, 0%, 100%, 0.8);
  display: none;
  height: 100%;
  left: 50%;
  padding: 2rem;
  position: absolute;
  text-align: center;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  z-index: 200;
}
.loading-spinner {
  animation: spin 1s ease-in-out infinite;
  border: 3px solid var(--accent-light);
  border-radius: 50%;
  border-top-color: var(--accent);
  display: inline-block;
  height: 40px;
  width: 40px;
}
@keyframes spin {
  to {
    transform: rotate(1turn);
  }
}
.all-translations {
  border-bottom: 1px dashed var(--border-subtle);
  border-top: 1px dashed var(--border-subtle);
  margin: 1rem 0;
  padding: 0.5rem 0;
}
.translation-variant {
  border-bottom: 1px dotted var(--border-subtle);
  padding: 0.5rem 0;
}
.translation-variant:last-child {
  border-bottom: none;
}
.translation-target {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.translation-target .language-tag {
  align-items: center;
  background-color: var(--primary-focus);
  border-radius: 3px;
  color: var(--primary);
  display: flex;
  font-size: 0.7rem;
  font-weight: 500;
  gap: 0.3rem;
  letter-spacing: 0.05em;
  padding: 0.1rem 0.4rem;
  text-transform: uppercase;
}
@media screen and (max-width: 600px) {
  .translation-card {
    margin-bottom: 1rem;
    padding: 15px;
  }
  .translation-header {
    flex-wrap: wrap;
  }
  .language-flags {
    margin-bottom: 0.5rem;
  }
  .language-from,
  .language-to {
    margin-bottom: 5px;
  }
}
@media screen and (max-width: 400px) {
  .translation-header h2 {
    font-size: 1.3rem;
  }
}
.compact-card .translation-header {
  margin-bottom: 0.4rem;
}
.compact-card .language-flags,
.compact-card .translation-header h2 {
  margin-bottom: 0;
}
@media screen and (max-width: 600px) {
  .compact-card .translation-header h2 {
    font-size: 1rem;
  }
}
h3 {
  color: var(--text-main);
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.5;
  margin: 1rem 0;
}
h1 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
  text-align: center;
  transition: var(--transition-standard);
}
.antonyms-container h3,
.definitions-container h3,
.examples-container h3,
.synonyms-container h3 {
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  margin: 0 0 0.75rem;
  padding-bottom: 0.4rem;
  text-transform: uppercase;
}
.logo-img {
  cursor: pointer;
  display: block;
  height: auto;
  margin: 0 auto 1.5rem;
  max-width: 440px;
  transition: var(--transition-standard);
  width: 100%;
  transform: translateZ(0);
}
.logo-img:hover {
  opacity: 0.9;
}
.input-active h1 {
  margin-bottom: 0;
  position: absolute;
  right: 1.5rem;
  text-align: right;
  top: 1.5rem;
  width: 120px;
  z-index: 2;
}
.input-active .logo-img {
  cursor: pointer;
  margin: 0 0 0 auto;
  max-width: 100%;
  display: block;
}
.input-active .search-container {
  margin-right: 120px;
}
@media screen and (max-width: 600px) {
  .input-active h1 {
    right: 1rem;
    top: 1rem;
    width: 100px;
  }
  .input-active .logo-img {
  }
  .input-active .search-container {
    margin-right: 100px;
  }
  .results-active .logo-img {
  }
  .results-active h1 {
    margin-bottom: 0.3rem;
  }
  .translation-container.visible {
    margin-top: 0.3rem;
  }
  .app-description.bottom-description {
    font-size: 0.75rem;
    padding: 0.3rem;
  }
}
@media screen and (max-width: 400px) {
  .input-active h1 {
    right: 0.75rem;
    top: 0.75rem;
    width: 90px;
  }
  .input-active .logo-img {
  }
  .input-active .search-container {
    margin-right: 90px;
  }
}
.app-container.results-active {
  margin-top: 1rem;
  padding-top: 1rem;
}
.results-active h1 {
  margin-top: 0;
}
.results-active .search-area,
.results-active h1 {
  margin-bottom: 0.5rem;
}
.results-active .app-description {
  display: none;
}
.results-active .app-footer {
  margin-top: 0.5rem;
}
.app-description {
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-style: italic;
  margin: 0.5rem 0 1rem;
  text-align: center;
  transition: var(--transition-standard);
}
.app-description.bottom-description {
  background-color: var(--background);
  border-top: 1px solid var(--border-subtle);
  bottom: 0;
  font-size: 0.85rem;
  left: 0;
  margin: 0;
  padding: 0.5rem;
  position: fixed;
  width: 100%;
  z-index: 10;
}
.results-active .logo-img {
  max-width: 100%;
  margin: 0 0 0 auto;
  display: block;
}
@media screen and (max-width: 600px) {
  .app-container {
    border-radius: 6px;
    margin: 1rem;
    padding: 1.5rem;
  }
  .results-active .app-container {
    margin: 0.75rem;
    padding: 1rem;
  }
  .results-active .logo-img {
  }
  .results-active h1 {
    margin-bottom: 0.3rem;
  }
  .translation-container.visible {
    margin-top: 0.3rem;
  }
  .app-description.bottom-description {
    font-size: 0.75rem;
    padding: 0.3rem;
  }
}
@media screen and (max-width: 400px) {
  .app-container {
    border-radius: 6px;
    margin: 0.5rem;
    padding: 1.25rem 1rem;
  }
  .results-active .app-container {
    margin: 0.5rem;
    padding: 0.75rem;
  }
  .app-description.bottom-description {
    display: none;
  }
  #word {
    padding: 0.75rem 1rem;
  }
  .suggestion-item {
    padding: 8px 10px;
  }
}
.compact-results .app-container {
  margin: 0.8rem auto;
  padding: 0.8rem 1.2rem;
}
.app-description.bottom-description.compact {
  font-size: 0.75rem;
  opacity: 0.8;
  padding: 0.3rem;
}
.translation-card.compact-card {
  margin-bottom: 0.7rem;
  padding: 10px;
}
.compact-card .translation-header h2 {
  font-size: 1.1rem;
  margin-bottom: 0.2rem;
}
.compact-card .language-flags {
  margin-bottom: 3px;
}
.compact-card .pronunciation {
  margin-bottom: 0.5rem;
}
.examples-container.collapsed {
  background-color: var(--background);
  border-radius: 4px;
  margin-top: 0.5rem;
  max-height: none;
  overflow-y: visible;
  padding: 0.3rem;
}
.examples-container.collapsed h3 {
  font-size: 0.8rem;
  margin: 0 0 0.3rem;
}
.examples-container.collapsed .examples-list {
  margin: 0;
}
.examples-container.collapsed .example {
  font-size: 0.8rem;
  line-height: 1.2;
  margin-bottom: 0.2rem;
}
.compact-card .antonyms-list,
.compact-card .definitions-list {
  gap: 0.3rem;
  margin-top: 0.1rem;
}
.compact-card .antonym,
.compact-card .definition {
  font-size: 0.8rem;
  margin: 0 0.15rem 0.15rem 0;
  padding: 0.15rem 0.4rem;
}
@media screen and (max-width: 600px) {
  .compact-results .app-container {
    margin: 0.6rem auto;
    padding: 0.7rem 1rem;
  }
  .compact-card .translation-header h2 {
    font-size: 1rem;
  }
}
@media screen and (max-width: 400px) {
  .compact-results .app-container {
    margin: 0.4rem auto;
    padding: 0.5rem 0.8rem;
  }
  .compact-card {
    margin-bottom: 0.5rem;
    padding: 8px;
  }
  .compact-card .translation-header h2 {
    font-size: 0.95rem;
  }
}
.compact-results ::-webkit-scrollbar {
  width: 4px;
}
.compact-results ::-webkit-scrollbar-thumb {
  background-color: var(--text-muted);
  border-radius: 2px;
}
.compact-results .translation-container.visible {
  margin-top: 0.2rem;
}
.compact-card .transcriptions-container {
  gap: 0.15rem;
}
.compact-card .transcription {
  font-size: 0.85rem;
  margin-right: 0.2rem;
}
.compact-card .dictionary-details {
  margin-top: 0.7rem;
  padding-top: 0.7rem;
}
.compact-card .dictionary-details > div + div {
  margin-top: 0.7rem;
}
.compact-card .definitions-container.no-title {
  margin-top: 0.4rem;
}
.compact-results .antonym,
.compact-results .definition,
.compact-results .examples-list li {
  margin-bottom: 0.15rem;
  padding-bottom: 0.15rem;
}
.compact-results .translation-card {
  margin-bottom: 0.5rem;
}
.compact-results h3 {
  font-size: 0.9rem;
  margin: 0.6rem 0 0.3rem;
}
.compact-results .antonyms-container,
.compact-results .definitions-container,
.compact-results .examples-container {
  margin-top: 0.6rem;
  padding-top: 0.4rem;
}
.compact-results .definition,
.compact-results .etymology-source,
.compact-results .etymology-target,
.compact-results .self-definition,
.compact-results li,
.compact-results p {
  line-height: 1.3;
}
.compact-results .suggestion-item {
  padding: 5px 8px;
}
.compact-results .suggestion-word {
  font-size: 0.9rem;
}
.compact-card .antonyms-container:last-child,
.compact-card .definitions-container:last-child,
.compact-card .etymology:last-child,
.compact-card .examples-container:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
}
.compact-results #word {
  padding: 0.5rem 0.8rem;
}
.clickable-word {
  border-bottom: 1px dashed transparent;
  cursor: pointer;
  display: block;
  font-weight: 500;
  padding-bottom: 1px;
  text-decoration: none;
  transition: var(--transition-standard);
}
.clickable-word:hover {
  background-color: rgba(26, 73, 113, 0.1);
  border-bottom-color: #1a4971;
  color: #0f2d46;
}
.word-container {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  margin: 0;
}
.source-word-container,
.target-word-container {
  position: relative;
}
.word-transcription {
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-style: italic;
  margin-top: 0.2rem;
  text-align: center;
}
.compact-card .word-transcription {
  font-size: 0.7rem;
  margin-top: 0.1rem;
}
@media screen and (max-width: 600px) {
  .word-transcription {
    font-size: 0.75rem;
  }
  .translation-header h2 {
    font-size: 1.3rem;
  }
}
@media screen and (max-width: 400px) {
  .word-transcription {
    font-size: 0.7rem;
  }
  .translation-header h2 {
    font-size: 1.1rem;
  }
}

/* Add POS color styles */
.clickable-word.pos-noun {
  color: var(--pos-noun-color);
}
.clickable-word.pos-adjective {
  color: var(--pos-adjective-color);
}
.clickable-word.pos-verb {
  color: var(--pos-verb-color);
}
.clickable-word.pos-adverb {
  color: var(--pos-adverb-color);
}
.clickable-word.pos-preposition {
  color: var(--pos-preposition-color);
}
.clickable-word.pos-auxiliary-verb {
  color: var(--pos-verb-color);
}
.clickable-word.pos-other,
.clickable-word.pos-unknown,
.clickable-word.pos- {
  /* Handles empty or unknown category */
  color: var(--pos-other-color);
}

/* Multi-word search styles */
.multi-word-result {
    border-left: 2px solid var(--accent);
}

/* Highlight exact matches with a stronger visual indicator */
.multi-word-result.exact-match {
    border-left: 3px solid #27ae60;
    background-color: rgba(46, 204, 113, 0.05);
}

/* Phrase matches are the highest priority */
.multi-word-result.phrase-match {
    border-left: 4px solid #3498db;
    background-color: rgba(52, 152, 219, 0.1);
}

/* Exact phrase matches get the most prominent styling */
.multi-word-result.phrase-exact-match {
    border-left: 5px solid #9b59b6;
    background-color: rgba(155, 89, 182, 0.15);
}

/* Apply a subtle indicator when hovering over exact matches */
.multi-word-result.exact-match:hover {
    background-color: rgba(46, 204, 113, 0.1);
}

/* Hover styles for phrase matches */
.multi-word-result.phrase-match:hover {
    background-color: rgba(52, 152, 219, 0.2);
}

.multi-word-result.phrase-exact-match:hover {
    background-color: rgba(155, 89, 182, 0.25);
}

/* Style for phrase match indicators */
.match-phrase {
    background-color: rgba(155, 89, 182, 0.2);
    border-radius: 3px;
    color: #8e44ad;
    display: inline-block;
    font-weight: 500;
    padding: 1px 4px;
}

/* Ensure multi-word search indicators are properly displayed on mobile */
@media screen and (max-width: 600px) {
    .multi-word-match-indicator {
        font-size: 0.65rem;
    }
}

.multi-word-match-indicator {
    color: var(--text-secondary);
    display: flex;
    flex-wrap: wrap;
    font-size: 0.7rem;
    font-style: italic;
    gap: 0.3rem;
    margin-top: 3px;
    opacity: 0.8;
    padding-top: 3px;
    align-items: center;
}

.multi-word-match-indicator::before {
    content: "";
    margin-right: 0;
}

/* Add a helper class that can be applied with JavaScript */
.match-exact, .match-begins, .match-search-begins, .match-contains {
    border-radius: 3px;
    display: inline-block;
    padding: 1px 3px;
}

.match-exact {
    background-color: rgba(76, 175, 80, 0.15);
    color: #2e7d32;
    border-radius: 3px;
    padding: 2px 6px;
}

.match-stemmed {
    background-color: rgba(76, 175, 80, 0.1);
    color: #2e7d32;
    border-radius: 3px;
    border: 1px dashed #2e7d32;
    padding: 2px 6px;
}

.match-begins {
    background-color: rgba(33, 150, 243, 0.15);
    color: #1565c0;
    border-radius: 3px;
    padding: 2px 6px;
}

.match-search-begins {
    background-color: rgba(155, 89, 182, 0.2);
    color: #8e44ad;
    border-radius: 3px;
    padding: 2px 6px;
}

.match-contains {
    background-color: rgba(230, 126, 34, 0.2);
    color: #d35400;
}

/* Word group separators for multi-word search results */
.word-group-separator {
    border-top: 1px dashed var(--border-subtle);
    height: 1px;
    margin: 1rem 0;
    width: 100%;
}

/* Styling for stemmed matches */
.stemmed-match {
    background-color: rgba(236, 236, 191, 0.3);
    border: 1px dashed #c5c56b;
    font-style: italic;
}

.multi-word-match-indicator .stemmed-match {
    padding: 2px 6px;
    border-radius: 3px;
}

/* Ensure multi-word match indicators are properly displayed on mobile */
@media screen and (max-width: 600px) {
    .multi-word-match-indicator {
        font-size: 0.65rem;
    }
}

.antonyms-section,
.synonyms-section {
  background-color: rgba(236, 240, 241, 0.5);
  border-radius: 4px;
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-subtle);
}

.antonyms-list,
.synonyms-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.8rem;
  padding-left: 0;
  list-style: none;
  margin: 0.5rem 0 0;
}

.antonym,
.synonym {
  background-color: var(--card-background);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  color: var(--accent);
  cursor: pointer;
  display: inline-block;
  font-size: 0.85rem;
  padding: 0.25rem 0.6rem;
  text-decoration: none;
  transition: var(--transition-standard);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  white-space: nowrap;
}

.antonym:hover,
.synonym:hover {
  background-color: var(--accent-light);
  border-color: var(--accent);
  color: var(--primary);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

@media screen and (max-width: 600px) {
  .antonym,
  .synonym {
    font-size: 0.8rem;
    padding: 0.2rem 0.5rem;
  }
}

.antonyms-container h3,
.synonyms-container h3 {
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
  padding-bottom: 0.4rem;
  text-transform: uppercase;
}

.definition-details .antonyms-container,
.definition-details .synonyms-container {
  margin-top: 1rem;
  padding: 0.75rem;
  background-color: transparent;
  border: none;
  box-shadow: none;
}

.definition-details h3 {
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  margin: 0 0 0.75rem;
  padding-bottom: 0.4rem;
  text-transform: uppercase;
}

.compact-card .antonyms-list,
.compact-card .synonyms-list {
  gap: 0.3rem 0.5rem;
  margin-top: 0.4rem;
}

.compact-card .antonym,
.compact-card .synonym {
  font-size: 0.75rem;
  padding: 0.15rem 0.4rem;
}

.compact-results .antonym,
.compact-results .synonym {
  font-size: 0.75rem;
  padding: 0.15rem 0.4rem;
  margin-bottom: 0;
}

.compact-results .antonyms-container,
.compact-results .synonyms-container {
  background-color: transparent;
  border: none;
  margin-top: 0.5rem;
  padding: 0.5rem 0;
}

.compact-results h3 {
  font-size: 0.8rem;
  margin-bottom: 0.5rem;
  padding-bottom: 0.3rem;
}

.compact-results .antonyms-container,
.compact-results .synonyms-container {
  h3 {
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
  }
}

.compact-card .antonyms-container:last-child,
.compact-card .synonyms-container:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
}
