/* ═══════════════════════════════════════════════════
   DESIGN TOKENS - Refined Elegant Windows 11 Fluent 
   ═══════════════════════════════════════════════════ */

:root {
  /* ── Colour ────────────────────────────────────── */
  --bg-base:        #f3f3f3;
  --bg-card:        rgba(255, 255, 255, 0.7);
  --bg-card-hover:  rgba(255, 255, 255, 0.95);
  --bg-input:       rgba(255, 255, 255, 0.7);
  --bg-input-focus: #ffffff;
  
  --text-primary:   #1b1b1b;
  --text-secondary: #5d5d5d;
  --text-tertiary:  #8b8b8b;
  
  --accent:         #0067c0;
  --accent-secondary: #0056a0;
  
  /* Extremely subtle, realistic lighting borders */
  --border-light:   rgba(255, 255, 255, 0.6);
  --border-dim:     rgba(0, 0, 0, 0.05);
  --border-input:   rgba(0, 0, 0, 0.06);
  --border-focus:   var(--accent);
  
  /* Shadows - Realistic WinUI 3 Elevation */
  --shadow-sm:      0 2px 4px rgba(0, 0, 0, 0.02), 0 0 2px rgba(0, 0, 0, 0.04);
  --shadow-card:    0 4px 16px rgba(0, 0, 0, 0.03), 0 1px 4px rgba(0, 0, 0, 0.04);
  --shadow-card-hover: 0 12px 32px rgba(0, 0, 0, 0.06), 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-input:   0 4px 12px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.03);
  
  --bg-error:       #fcf0f2;
  --text-error:     #c42b1c;
  --bg-settings:    rgba(255, 255, 255, 0.85);
  --bg-backdrop:    rgba(0, 0, 0, 0.2);
  
  /* Tag colours */
  --bg-tag:         rgba(0, 103, 192, 0.06);
  --bg-tag-hover:   rgba(0, 103, 192, 0.12);
  --text-tag:       #0056a0;
  --bg-meaning-num: var(--accent);
  --text-meaning-num: #ffffff;

  /* Ambient mesh colors (light mode) */
  --ambient-1:      #dae9f8;
  --ambient-2:      #eaddf8;
  --ambient-3:      #d9f2f0;

  /* ── Typography (Windows 11 Native) ────────────── */
  --font-display:   'Segoe UI Variable Display', 'Segoe UI', system-ui, sans-serif;
  --font-text:      'Segoe UI Variable Text', 'Segoe UI', system-ui, sans-serif;
  --fs-base:        14px;
  --fs-sm:          12px;
  --fs-lg:          15px;
  --fs-xl:          28px;

  /* ── Radius ────────────────────────────────────── */
  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-lg:  20px; /* Windows 11 rounded inputs */

  /* ── Motion (Fluent fast-in, gentle-out) ────── */
  --ease-fluent:  cubic-bezier(0.33, 0, 0.1, 1);
  --ease-in:      cubic-bezier(0, 0, 0, 1);
  --dur-fast:     150ms;
  --dur-normal:   250ms;
  --dur-slow:     400ms;
}

/* ── Dark theme ──────────────────────────────────── */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-base:        #202020;
    --bg-card:        rgba(255, 255, 255, 0.04);
    --bg-card-hover:  rgba(255, 255, 255, 0.07);
    --bg-input:       rgba(255, 255, 255, 0.05);
    --bg-input-focus: rgba(30, 30, 30, 0.95);
    
    --text-primary:   #ffffff;
    --text-secondary: #a0a0a0;
    --text-tertiary:  #707070;
    
    --accent:         #60cdff;
    --accent-secondary: #4eb0ff;
    
    --border-light:   rgba(255, 255, 255, 0.08); /* Reflection edge */
    --border-dim:     rgba(255, 255, 255, 0.03);
    --border-input:   rgba(255, 255, 255, 0.07);
    --border-focus:   var(--accent);
    
    --shadow-sm:      0 2px 4px rgba(0, 0, 0, 0.4), 0 0 2px rgba(0, 0, 0, 0.3);
    --shadow-card:    0 8px 16px rgba(0, 0, 0, 0.4), 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-card-hover: 0 16px 32px rgba(0, 0, 0, 0.5), 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-input:   0 8px 24px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.4);
    
    --bg-error:       rgba(255, 153, 164, 0.1);
    --text-error:     #ff99a4;
    --bg-settings:    rgba(32, 32, 32, 0.85);
    --bg-backdrop:    rgba(0, 0, 0, 0.5);
    
    --bg-tag:         rgba(96, 205, 255, 0.1);
    --bg-tag-hover:   rgba(96, 205, 255, 0.18);
    --text-tag:       #60cdff;

    /* Ambient mesh colors (dark mode) */
    --ambient-1:      #0e2a44;
    --ambient-2:      #2b124a;
    --ambient-3:      #112f36;
  }
}

/* ═══════════════════════════════════════════════════
   RESET & BASE
   ═══════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

body {
  font-family: var(--font-text);
  color: var(--text-primary);
  background-color: var(--bg-base);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}

/* ── Refined Mica Background Mesh ── */
body::before {
  content: '';
  position: fixed;
  inset: -20%;
  z-index: -2;
  background-image: 
    radial-gradient(ellipse at 25% 25%, var(--ambient-1) 0%, transparent 45%),
    radial-gradient(ellipse at 75% 75%, var(--ambient-2) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, var(--ambient-3) 0%, transparent 40%);
  filter: blur(80px);
  opacity: 0.6;
  animation: ambient-drift 40s infinite linear alternate;
}
/* Subtle noise texture for true Mica realism */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  opacity: 0.02;
  mix-blend-mode: overlay;
  pointer-events: none;
}
@media (prefers-color-scheme: dark) {
  body::after { opacity: 0.04; }
}

@keyframes ambient-drift {
  0%   { transform: scale(1) translate(0, 0); }
  50%  { transform: scale(1.05) translate(3%, -2%); }
  100% { transform: scale(0.98) translate(-2%, 3%); }
}

/* ═══════════════════════════════════════════════════
   APP LAYOUT
   ═══════════════════════════════════════════════════ */

.app {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Header removed for FAB approach ── */

/* ═══════════════════════════════════════════════════
   SEARCH (Windows 11 Start Menu Style)
   ═══════════════════════════════════════════════════ */

.search-section {
  padding: 16px 0 32px;
}

.search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  border-radius: var(--radius-lg);
  background: var(--bg-input);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  
  /* Standard Win11 input borders - harder bottom edge */
  border: 1px solid var(--border-input);
  border-bottom: 1px solid rgba(0,0,0,0.12);
  
  box-shadow: var(--shadow-sm);
  transition: all var(--dur-normal) var(--ease-fluent);
  height: 48px;
}
@media (prefers-color-scheme: dark) {
  .search-wrapper {
    /* Dark mode relies on top border for lighting */
    border-top: 1px solid rgba(255,255,255,0.08);
    border-bottom: 1px solid rgba(255,255,255,0.04);
  }
}

.search-wrapper:hover {
  background: var(--bg-card-hover);
}
.search-wrapper:focus-within {
  background: var(--bg-input-focus);
  /* The classic Fluent focus ring - thick accent line at the bottom */
  border-bottom-color: var(--border-focus);
  box-shadow: 0 4px 16px rgba(0,0,0,0.06), inset 0 -2px 0 var(--border-focus);
}
@media (prefers-color-scheme: dark) {
  .search-wrapper:focus-within {
    box-shadow: 0 4px 16px rgba(0,0,0,0.4), inset 0 -2px 0 var(--border-focus);
  }
}

.search-icon {
  position: absolute;
  left: 16px;
  color: var(--text-secondary);
  width: 20px; height: 20px;
  pointer-events: none;
  transition: color var(--dur-fast) var(--ease-fluent);
}
.search-wrapper:focus-within .search-icon {
  color: var(--accent);
}

.search-input {
  width: 100%;
  height: 100%;
  padding: 0 48px 0 48px;
  font-family: var(--font-text);
  font-size: var(--fs-lg);
  color: var(--text-primary);
  background: transparent;
  border: none;
  outline: none;
}
.search-input::placeholder {
  color: var(--text-tertiary);
  font-family: var(--font-text);
}

.search-clear-btn {
  position: absolute;
  right: 12px;
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  width: 28px; height: 28px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-fluent);
}
.search-clear-btn:hover {
  background: rgba(128, 128, 128, 0.08);
  color: var(--text-primary);
}
.search-clear-btn.hidden {
  display: none;
}

.search-spinner {
  position: absolute;
  right: 48px;
  width: 18px; height: 18px;
  border: 2px solid var(--border-dim);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}
.search-spinner.hidden { display: none; }

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ═══════════════════════════════════════════════════
   DASHBOARD CARDS (Acrylic Material)
   ═══════════════════════════════════════════════════ */

.dashboard {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  padding-bottom: 32px;
}
.dashboard.hidden { display: none; }

.card {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(40px) saturate(140%);
  -webkit-backdrop-filter: blur(40px) saturate(140%);
  
  /* The "light border" inset for Win11 depth */
  border: 1px solid var(--border-dim);
  border-top: 1px solid var(--border-light);
  
  opacity: 0;
  transform: translateY(8px);
  transition: box-shadow  var(--dur-normal) var(--ease-fluent),
              background  var(--dur-normal) var(--ease-fluent),
              transform   var(--dur-normal) var(--ease-fluent),
              opacity     var(--dur-normal) var(--ease-fluent);
}

.card.visible {
  opacity: 1;
  transform: translateY(0);
}
.card:hover {
  background: var(--bg-card-hover);
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
}

.card--wide { grid-column: 1 / -1; }

.card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.card-flag {
  width: 24px;
  height: 16px;
  border-radius: 2px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  display: block;
  flex-shrink: 0;
}

.card-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 0.01em;
}

.card-body {
  font-size: var(--fs-base);
  color: var(--text-primary);
  line-height: 1.6;
}

/* ── Meanings ─────────────────────────────────── */

.meaning-block {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-dim);
}
.meaning-block:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.meaning-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--bg-meaning-num);
  color: var(--text-meaning-num);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  margin-right: 6px;
}

.meaning-text { display: inline; }
.meaning-text strong {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--text-primary);
}

/* Parenthetical context label shown AFTER the translation */
.meaning-context {
  font-size: var(--fs-sm);
  color: var(--text-tertiary);
  font-style: italic;
  margin-left: 4px;
}
.meaning-context::before { content: '('; }
.meaning-context::after  { content: ')'; }

/* ── Note card accent ──────────────────────────── */
#card-note {
  border-left: 3px solid var(--accent);
}
#card-note .card-title {
  color: var(--accent);
  background: none;
  -webkit-text-fill-color: var(--accent);
}
#card-note .card-icon {
  color: var(--accent);
}

/* ── Utility ── */
.hidden { display: none !important; }

/* ── Synonym Tags ────────────────────────────────── */

.synonym-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
}

.synonym-tag {
  background: var(--bg-tag);
  color: var(--text-tag);
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid transparent;
  transition: all var(--dur-fast) var(--ease-fluent);
  cursor: pointer;
}
.synonym-tag:hover {
  background: var(--bg-tag-hover);
  border-color: rgba(0, 103, 192, 0.2);
}

/* Individual tag animation class - Retained per instruction for staggered lists */
.animate-tag {
  animation: pop-in 0.3s cubic-bezier(0.33, 0, 0.1, 1) both;
}
@keyframes pop-in {
  0% { transform: scale(0.9) translateY(4px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

/* ── Skeletons ───────────────────────────────────── */
.skeleton-line {
  height: 14px;
  border-radius: 4px;
  background: linear-gradient(90deg, 
    var(--border-dim) 25%, 
    rgba(128,128,128,0.1) 50%, 
    var(--border-dim) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  margin-bottom: 8px;
}
.skeleton-line:last-child { margin-bottom: 0; }
.skeleton-line.w-75  { width: 75%; }
.skeleton-line.w-60  { width: 60%; }
.skeleton-line.w-90  { width: 90%; }
.skeleton-line.w-50  { width: 50%; }

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ═══════════════════════════════════════════════════
   EMPTY STATE (Refined, Minimalist)
   ═══════════════════════════════════════════════════ */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 80px 0;
  transition: opacity var(--dur-normal) var(--ease-fluent);
}
.empty-state.hidden {
  opacity: 0;
  pointer-events: none;
  position: absolute;
}

.empty-state-icon-wrapper {
  width: 56px; height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.empty-icon {
  width: 24px; height: 24px;
  color: var(--accent);
}

.empty-text {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--text-secondary);
  font-weight: 600;
  background: linear-gradient(135deg, var(--text-primary), var(--text-tertiary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.01em;
}

/* ═══════════════════════════════════════════════════
   ERROR BANNER
   ═══════════════════════════════════════════════════ */

.error-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg-error);
  color: var(--text-error);
  border-radius: var(--radius-md);
  font-size: var(--fs-sm);
  margin-top: 16px;
  border: 1px solid rgba(196, 43, 28, 0.15);
}
.error-banner.hidden { display: none; }

/* ═══════════════════════════════════════════════════
   SETTINGS DRAWER
   ═══════════════════════════════════════════════════ */
.settings-backdrop {
  position: fixed;
  inset: 0;
  background: var(--bg-backdrop);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-normal) var(--ease-fluent);
  z-index: 90;
}
.settings-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.settings-drawer {
  position: fixed;
  top: 0; right: 0;
  width: 340px; max-width: 90vw;
  height: 100%;
  background: var(--bg-settings);
  backdrop-filter: blur(60px) saturate(160%);
  -webkit-backdrop-filter: blur(60px) saturate(160%);
  border-left: 1px solid var(--border-light);
  padding: 40px 32px; /* Fixed padding per request */
  z-index: 100;
  transform: translateX(100%);
  opacity: 0;
  transition: transform var(--dur-slow) var(--ease-fluent),
              opacity var(--dur-fast) var(--ease-fluent);
  display: flex;
  flex-direction: column;
  gap: 32px;
  box-shadow: -8px 0 24px rgba(0,0,0,0.05);
}
.settings-drawer.open {
  transform: translateX(0);
  opacity: 1;
}

.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.settings-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  color: var(--text-primary);
  background: linear-gradient(to right, var(--text-primary), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.settings-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.settings-label {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.api-key-row {
  display: flex;
  gap: 6px;
}

.settings-input, .settings-select {
  flex: 1;
  font-family: var(--font-text);
  font-size: var(--fs-base);
  padding: 8px 12px;
  border: 1px solid var(--border-input);
  border-bottom: 1px solid rgba(0,0,0,0.12);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-primary);
  outline: none;
  transition: all var(--dur-fast) var(--ease-fluent);
}
@media (prefers-color-scheme: dark) {
  .settings-input, .settings-select {
    border-top: 1px solid rgba(255,255,255,0.06);
    border-bottom: 1px solid rgba(255,255,255,0.04);
  }
}
.settings-input:focus, .settings-select:focus {
  border-bottom-color: var(--accent);
  background: var(--bg-input-focus);
  box-shadow: inset 0 -2px 0 var(--accent);
}
.settings-select { cursor: pointer; }

/* ── Floating Settings Button ── */
.settings-fab {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-card);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-card);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--dur-normal) var(--ease-fluent);
  z-index: 50;
}
@media (prefers-color-scheme: dark) {
  .settings-fab {
    background: rgba(255, 255, 255, 0.08);
  }
}
.settings-fab:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-hover);
}
.settings-fab:active {
  transform: translateY(0) scale(0.96);
}
.settings-fab svg {
  transition: transform var(--dur-normal) var(--ease-fluent);
}
.settings-fab:hover svg {
  transform: rotate(45deg);
}

/* ═══════════════════════════════════════════════════
   RESPONSIVE & ACCESSIBILITY
   ═══════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 600px) {
  .app { padding: 16px 16px; }
  .dashboard { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════
   TRANSLATION CARDS – enhanced content
   ═══════════════════════════════════════════════════ */

/* The main translated word — larger and prominent */
.translation-word {
  display: inline;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.5;
}

/* IPA phonetic string */
.ipa {
  display: block;
  font-size: 14px;
  color: var(--text-secondary);
  font-style: italic;
  margin-top: 4px;
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}

/* Part-of-speech badge row */
.pos-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.pos-badge {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: var(--bg-tag);
  border: 1px solid rgba(0,0,0,0.04);
  border-radius: 4px;
  padding: 1px 7px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Context label after translation text (replaces the old bold-meaning pattern) */
.meaning-context {
  display: inline;
  font-size: 14px;
  color: var(--text-secondary);
  font-style: italic;
  margin-left: 5px;
}
.meaning-context::before { content: '('; }
.meaning-context::after  { content: ')'; }

/* ═══════════════════════════════════════════════════
   FORMALITY CHIP
   ═══════════════════════════════════════════════════ */

.formality-row {
  margin-bottom: 10px;
}

.formality-chip {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 20px;
  letter-spacing: 0.03em;
  border: 1px solid transparent;
}

.formality-formal {
  background: rgba(0, 103, 192, 0.08);
  color: var(--accent);
  border-color: rgba(0, 103, 192, 0.15);
}
.formality-neutral {
  background: rgba(128, 128, 128, 0.08);
  color: var(--text-secondary);
  border-color: rgba(128, 128, 128, 0.15);
}
.formality-informal {
  background: rgba(240, 140, 0, 0.08);
  color: #b86200;
  border-color: rgba(240, 140, 0, 0.2);
}
.formality-colloquial {
  background: rgba(196, 43, 28, 0.08);
  color: #c42b1c;
  border-color: rgba(196, 43, 28, 0.15);
}
@media (prefers-color-scheme: dark) {
  .formality-informal  { color: #ffb347; }
  .formality-colloquial { color: #ff7b72; }
}

/* ═══════════════════════════════════════════════════
   NOTE CARD ACCENT
   ═══════════════════════════════════════════════════ */

#card-note {
  border-left: 3px solid var(--accent);
}
#card-note .card-title {
  background: none;
  -webkit-text-fill-color: var(--accent);
  color: var(--accent);
}
#card-note .card-icon { color: var(--accent); }

/* ═══════════════════════════════════════════════════
   COPY BUTTON
   ═══════════════════════════════════════════════════ */

.card-copy-btn {
  margin-left: auto;
  flex-shrink: 0;
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease-fluent),
              color   var(--dur-fast) var(--ease-fluent),
              background var(--dur-fast) var(--ease-fluent);
}
.card:hover .card-copy-btn,
.card-copy-btn.copied { opacity: 1; }
.card-copy-btn:hover  { background: var(--bg-tag); color: var(--accent); }
.card-copy-btn.copied { color: #2e7d52; }

/* ═══════════════════════════════════════════════════
   SEARCH HISTORY
   ═══════════════════════════════════════════════════ */

.search-history {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 0 20px;
  min-height: 0;
}

.history-chip {
  appearance: none;
  border: 1px solid var(--border-input);
  background: var(--bg-input);
  color: var(--text-secondary);
  font-family: var(--font-text);
  font-size: var(--fs-sm);
  padding: 3px 11px;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-fluent);
  white-space: nowrap;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.history-chip:hover {
  background: var(--bg-tag);
  border-color: rgba(0, 103, 192, 0.2);
  color: var(--accent);
}

.history-clear {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  font-family: var(--font-text);
  font-size: var(--fs-sm);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease-fluent);
  align-self: center;
}
.history-clear:hover { color: var(--text-error); }

/* ═══════════════════════════════════════════════════
   SKELETON WIDTHS (additions)
   ═══════════════════════════════════════════════════ */

.skeleton-line.w-100 { width: 100%; }
.skeleton-line.w-80  { width: 80%; }

/* ═══════════════════════════════════════════════════
   UTILITY
   ═══════════════════════════════════════════════════ */

.hidden { display: none !important; }
