@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400;1,600&family=DM+Sans:wght@300;400;500;600&display=swap');

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

:root {
  --ink: #1a1208;
  --paper: #faf6ef;
  --cream: #f0e9dc;
  --cream-dark: #e8dece;
  --gold: #c8922a;
  --gold-light: #e8b84b;
  --gold-pale: #f5e8cc;
  --gold-dark: #a87919;
  --red: #c0392b;
  --muted: #8a7b6a;
  --border: #d6cabb;
  --border-light: #e8e0d5;
  --shadow-sm: 0 2px 8px rgba(26, 18, 8, 0.06);
  --shadow-md: 0 6px 20px rgba(26, 18, 8, 0.09);
  --shadow-lg: 0 16px 40px rgba(26, 18, 8, 0.12);
  --radius: 6px;
  --radius-sm: 3px;
}

html {
  scroll-behavior: smooth;
  background-color: var(--paper);
  overscroll-behavior: none;
}

html:has(body.dark-theme) {
  background-color: #1a1a1a;
}

body {
  font-family: 'DM Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji';
  background: var(--paper);
  color: var(--ink);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

/* HEADER */
header {
  padding: 1.2rem 3rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 246, 239, 0.92);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--border-light), var(--shadow-sm);
}

header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--gold) 30%, var(--gold-light) 60%, transparent 100%);
}

.logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--ink) 0%, var(--gold) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  text-decoration: none;
  transition: opacity 0.2s ease;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}

.logo:hover {
  opacity: 0.8;
}

.logo img {
  height: 42px;
  width: auto;
  display: none;
}

.header-right {
  display: flex;
  gap: 1.25rem;
  align-items: center;
}

/* BUTTONS */
.btn {
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji';
  font-size: 0.83rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.22s ease;
  letter-spacing: 0.4px;
  border: none;
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--muted);
}

.btn-primary {
  background: var(--ink);
  color: var(--paper);
  box-shadow: 0 2px 6px rgba(26, 18, 8, 0.25);
}

.btn-sm {
  padding: 0.32rem 0.85rem;
  font-size: 0.76rem;
}

.btn-danger {
  background: var(--red);
  color: white;
  box-shadow: 0 2px 6px rgba(192, 57, 43, 0.2);
}

/* Button hover — desktop-only. Mobile :hover sticks after tap and looks like
   the button is stuck white/loading. Gating prevents that. */
@media (hover: hover) and (pointer: fine) {
  .btn-outline:hover {
    border-color: var(--gold);
    color: var(--gold);
    background: var(--gold-pale);
  }
  .btn-primary:hover {
    background: var(--gold);
    box-shadow: 0 4px 12px rgba(200, 146, 42, 0.35);
    transform: translateY(-1px);
  }
  .btn-danger:hover {
    opacity: 0.88;
    transform: translateY(-1px);
  }
}

/* LANG SELECTOR */
.lang-selector-wrapper {
  position: relative;
}

.lang-icon-nav {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.25s;
  border: 1.5px solid var(--border);
  background: white;
  box-shadow: var(--shadow-sm);
  font-family: 'DM Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji';
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.3px;
  /* hide if it's an img */
  object-fit: cover;
}

/* If used as <img>, hide and use pseudo approach — but we style the wrapper */
img.lang-icon-nav {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  padding: 2px;
  gap: unset;
}

/* The clickable control is a <button> wrapping the <img.lang-icon-nav>. The
   button itself had no styling, so it rendered with raw user-agent chrome
   (grey box) and never picked up the theme. Reset it to a transparent,
   circular hit-target; the visible chrome comes from the inner image. */
.lang-icon-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 50%;
  line-height: 0;
  -webkit-tap-highlight-color: transparent;
}

.lang-icon-nav:hover {
  transform: scale(1.05);
  border-color: var(--gold);
  color: var(--gold);
  box-shadow: 0 4px 12px rgba(200, 146, 42, 0.25);
}

.current-lang-label {
  position: absolute;
  inset-inline-start: 45px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
  pointer-events: none;
}

/* Ensure wrapper expands to show label if needed, or we just absolute position it */
.lang-selector-wrapper {
  display: flex;
  align-items: center;
  position: relative;
  padding-right: 60px;
  /* Space for the label */
}

.language-menu-nav {
  position: absolute;
  top: calc(100% + 8px);
  /* Logical inset so the menu flips to the correct edge under dir="rtl"
     (Arabic) instead of running off the left side of the screen. */
  inset-inline-end: 0;
  width: 180px;
  max-width: calc(100vw - 24px);
  max-height: 280px;
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--border-light);
  overflow-y: auto;
  display: none;
  z-index: 1000;
}

.language-menu-nav.active {
  display: block;
  animation: popIn 0.2s ease;
}

.language-item {
  padding: 9px 14px;
  cursor: pointer;
  transition: all 0.15s;
  border-bottom: 1px solid var(--border-light);
  position: relative;
  font-size: 0.84rem;
  color: var(--ink);
}

.language-item:last-child {
  border-bottom: none;
}

.language-item:hover {
  background: var(--cream);
}

.language-item.selected {
  background: linear-gradient(135deg, #e8a020 0%, #d4751a 100%);
  color: white;
  font-weight: 600;
}

.language-item.selected::after {
  content: '';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  background: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><path d='M20 6L9 17l-5-5'/></svg>") no-repeat center / contain;
}

/* MAIN LAYOUT */
.app-container {
  display: grid;
  /* minmax(0,1fr) — track'in min boyutu içerik min-content'i değil 0 olsun;
     aksi halde sonuç kartlarındaki uzun/kırılamayan metin track'i şişirip
     sayfayı sağa taşırır (arama yazınca "ekran sağa genişliyor" bug'ı). */
  grid-template-columns: 380px minmax(0, 1fr);
  max-width: 1500px;
  margin: 0 auto;
  gap: 4rem;
  padding: 2.5rem 3rem 6rem;
  position: relative;
  z-index: 1;
}

/* SIDEBAR */
.sidebar-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 5.5rem;
  transition: box-shadow 0.3s;
}

.sidebar-card:hover {
  box-shadow: var(--shadow-md);
}

.sidebar-title {
  font-family: 'DM Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji';
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 1.2rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sidebar-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-light);
}

.country-search-wrap {
  position: relative;
  margin-bottom: 1.2rem;
}

.country-search-wrap input {
  width: 100%;
  padding: 0.62rem 0.85rem;
  font-family: 'DM Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji';
  font-size: 0.84rem;
  border: 1.5px solid var(--border);
  background: var(--paper);
  color: var(--ink);
  outline: none;
  border-radius: var(--radius-sm);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.country-search-wrap input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(200, 146, 42, 0.12);
  background: white;
}

.country-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
  max-height: 420px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 0.4rem;
}

.country-card {
  min-width: 0;
}

.country-grid::-webkit-scrollbar {
  width: 3px;
}

.country-grid::-webkit-scrollbar-track {
  background: transparent;
}

.country-grid::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 10px;
}

.country-card {
  background: var(--paper);
  border: 1.5px solid transparent;
  padding: 0.55rem 0.65rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  transition: all 0.18s ease;
  -webkit-user-select: none;
  user-select: none;
}

.country-card:hover {
  background: white;
  border-color: var(--border-light);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.country-card.active {
  background: var(--gold-pale);
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold), var(--shadow-sm);
}

.country-card .code {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  width: 22px;
  flex-shrink: 0;
}

.country-card.active .code {
  color: var(--gold);
}

.country-card .name {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  max-width: 100%;
}

/* MAIN CONTENT */
main {
  animation: fadeUp 0.55s 0.1s ease both;
  padding-top: 3rem;
}

.hero {
  margin-bottom: 2.8rem;
  position: relative;
}

.hero::before {
  content: '';
  position: absolute;
  left: -1.5rem;
  top: 0.3rem;
  height: 2.8rem;
  width: 2px;
  background: linear-gradient(to bottom, var(--gold), transparent);
  border-radius: 2px;
}

.hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.4rem, 4.5vw, 3.6rem);
  line-height: 1.1;
  margin-bottom: 0.9rem;
}

.hero h1 em {
  color: var(--gold);
  font-style: italic;
}

.hero p {
  color: var(--muted);
  font-size: 1rem;
  font-weight: 300;
  line-height: 1.6;
  max-width: 600px;
}

/* SEARCH */
.search-wrap {
  position: relative;
  margin-bottom: 2.5rem;
  animation: fadeUp 0.55s 0.15s ease both;
  /* Establish a stacking context so the dropdown layers above the
     countdown card / list-grid toggle that appear later in the document. */
  z-index: 100;
}

.search-wrap input {
  width: 100%;
  padding: 1.1rem 1.4rem;
  font-family: 'DM Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji';
  font-size: 1rem;
  border: 1.5px solid var(--border);
  background: white;
  color: var(--ink);
  outline: none;
  border-radius: var(--radius-sm);
  transition: border-color 0.22s, box-shadow 0.22s;
  box-shadow: var(--shadow-sm);
}

.search-wrap input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(200, 146, 42, 0.12), var(--shadow-md);
}

.search-wrap input::placeholder {
  color: var(--border);
}

/* Activity feed banner — tap to scroll to shared section */
.activity-feed-banner {
  margin: 0.5rem 0 0.75rem;
  padding: 0.75rem 1.85rem 0.75rem 0.9rem;
  background: linear-gradient(135deg, rgba(200, 146, 42, 0.12) 0%, rgba(200, 146, 42, 0.04) 100%);
  border: 1px solid rgba(200, 146, 42, 0.35);
  border-inline-start: 3px solid var(--gold);
  border-radius: 0.6rem;
  color: var(--ink);
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.4;
  position: relative;
  box-shadow: var(--shadow-sm);
  transition: border-color 150ms, box-shadow 150ms;
  animation: bannerFadeIn 0.45s ease both;
}
.activity-feed-banner::after {
  content: '›';
  position: absolute;
  inset-inline-end: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--gold);
  line-height: 1;
  transition: transform 150ms;
}
.activity-feed-banner:hover {
  border-color: var(--gold);
  box-shadow: var(--shadow-md);
}
.activity-feed-banner:hover::after {
  transform: translateY(-50%) translateX(3px);
}
[dir="rtl"] .activity-feed-banner:hover::after {
  transform: translateY(-50%) translateX(-3px);
}
body.dark-theme .activity-feed-banner {
  background: linear-gradient(135deg, rgba(200, 146, 42, 0.18) 0%, rgba(200, 146, 42, 0.06) 100%);
  color: #f5f1e8;
  border-color: rgba(200, 146, 42, 0.45);
}

/* Holiday pack — distinct from activity feed */
.holiday-pack-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.65rem;
  padding: 0.85rem 0.9rem;
  margin: 0.5rem 0 0.75rem;
  background: var(--paper);
  border: 1px solid var(--border);
  border-inline-start: 3px solid var(--gold);
  border-radius: 0.6rem;
  font-size: 0.88rem;
  line-height: 1.4;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  animation: bannerFadeIn 0.45s 0.05s ease both;
  position: relative;
  z-index: 1;
}
.holiday-pack-banner[hidden] {
  display: none !important;
}
.holiday-pack-text {
  flex: 1 1 100%;
  min-width: 0;
  margin: 0;
  font-weight: 500;
  line-height: 1.45;
  pointer-events: none;
}
.holiday-pack-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  width: 100%;
  position: relative;
  z-index: 5;
}
.holiday-pack-actions .btn {
  flex: 1 1 calc(50% - 0.25rem);
  min-height: 44px;
  touch-action: manipulation;
  pointer-events: auto;
}
body.dark-theme .holiday-pack-banner {
  background: linear-gradient(135deg, rgba(26, 111, 163, 0.15) 0%, rgba(200, 146, 42, 0.08) 100%);
  border-color: rgba(90, 160, 210, 0.4);
  color: #f5f1e8;
}

@keyframes bannerFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Search filters — date range + category toggle. Minimal layout; visual
   polish lives in the CSS pass done outside this file. */
.search-filters {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin: 0.5rem 0 0.75rem;
  padding: 0.7rem 0.85rem;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  font-size: 0.85rem;
  box-shadow: var(--shadow-sm);
}
.search-filter-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.65rem;
}
.search-filter-row-categories {
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
}
.search-filter-chips.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}
.search-filter-chips.is-disabled .filter-chip {
  pointer-events: none;
}
.search-filter-toggle-label {
  margin-bottom: 0.1rem;
}
.search-filter-label {
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
}
.search-filter-select {
  padding: 0.3rem 0.5rem;
  border: 1px solid var(--border, #ccc);
  border-radius: 0.4rem;
  background: var(--card-bg, #fff);
  color: var(--text);
  font-size: 0.85rem;
}
.search-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.filter-chip {
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, transform 120ms ease, box-shadow 120ms ease;
  -webkit-tap-highlight-color: transparent;
}
.filter-chip:hover {
  border-color: var(--gold);
  transform: scale(1.03);
}
.filter-chip:active {
  transform: scale(0.97);
}
.filter-chip.active {
  background: var(--gold);
  color: #fff;
  border-color: var(--gold);
  box-shadow: 0 2px 8px rgba(200, 146, 42, 0.28);
  transform: scale(1.02);
}
.filter-chip:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
body.dark-theme .filter-chip {
  color: #f5f1e8;
}
body.dark-theme .filter-chip.active {
  color: #1a1208;
}

/* Recent searches dropdown anchored to the search input */
.search-history {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  /* Deep shadow so it visually floats above the cards below */
  box-shadow: 0 10px 30px rgba(26, 18, 8, 0.18), 0 4px 10px rgba(26, 18, 8, 0.08);
  z-index: 1000;
  overflow: hidden;
  max-height: 320px;
  overflow-y: auto;
  animation: fadeUp 0.18s ease both;
}
.search-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.95rem;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
  background: linear-gradient(to bottom, var(--cream) 0%, transparent 100%);
  border-bottom: 1px solid var(--border-light);
}
.search-history-clear {
  background: none;
  border: none;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gold);
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 999px;
  transition: background 0.15s;
}
.search-history-clear:hover {
  background: rgba(200, 146, 42, 0.12);
  color: var(--ink);
}
.search-history-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  background: none;
  border: none;
  text-align: start;
  padding: 0.85rem 1rem;
  font-family: 'DM Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji';
  font-size: 0.95rem;
  color: var(--ink);
  cursor: pointer;
  border-bottom: 1px solid var(--border-light);
  transition: background 0.12s;
}
.search-history-row::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  opacity: 0.65;
  flex-shrink: 0;
}
.search-history-row:last-child { border-bottom: none; }
.search-history-row:hover,
.search-history-row:focus {
  background: var(--cream);
  outline: none;
}
body.dark-theme .search-history {
  background: #2a2a2a;
  border-color: #3a3a3a;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5), 0 4px 10px rgba(0,0,0,0.3);
}
body.dark-theme .search-history-header {
  background: linear-gradient(to bottom, #1f1f1f 0%, transparent 100%);
  border-color: #3a3a3a;
  color: #b5ad9b;
}
body.dark-theme .search-history-row {
  color: #f5f1e8;
  border-color: #3a3a3a;
}
body.dark-theme .search-history-row:hover,
body.dark-theme .search-history-row:focus { background: #333; }


/* RESULTS */
.results {
  animation: fadeUp 0.4s ease both;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.result-card {
  background: white;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 1.1rem 1.3rem;
  display: flex;
  align-items: center;
  gap: 1.1rem;
  flex-wrap: wrap;
  transition: all 0.22s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  /* Defensive: long unbroken strings (some translations / non-Latin scripts)
     would otherwise force horizontal scroll on the whole page. */
  max-width: 100%;
  box-sizing: border-box;
}

.date-number-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
}

.date-number-row input {
  text-align: center;
}

.result-card::before {
  content: '';
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--gold);
  transform: scaleY(0);
  transition: transform 0.22s ease;
  /* Logical radii: rounded on the trailing inline side regardless of dir */
  border-start-start-radius: 0;
  border-end-start-radius: 0;
  border-start-end-radius: 2px;
  border-end-end-radius: 2px;
}

.result-card:hover {
  border-color: var(--border);
  box-shadow: var(--shadow-md);
  transform: translateX(3px);
}
[dir="rtl"] .result-card:hover {
  transform: translateX(-3px);
}

.result-card:hover::before {
  transform: scaleY(1);
}

.date-badge {
  background: linear-gradient(145deg, var(--cream) 0%, var(--cream-dark) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.85rem;
  text-align: center;
  min-width: 62px;
  flex-shrink: 0;
  transition: all 0.2s;
}

.result-card:hover .date-badge {
  background: var(--gold-pale);
  border-color: var(--gold);
}

.date-badge .day {
  font-family: 'Playfair Display', serif;
  font-size: 1.65rem;
  font-weight: 700;
  line-height: 1;
  color: var(--gold);
}

.date-badge .month {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--muted);
  font-weight: 600;
  margin-top: 2px;
}

.result-info {
  flex: 1 1 200px;
  min-width: 0;
  max-width: 100%;
}

.result-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
  /* Long compound words (German, Russian, Japanese) must break inside the
     line instead of forcing the card wider than the screen. */
  word-break: break-word;
  overflow-wrap: anywhere;
}

.result-desc {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 300;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  max-width: 100%;
}

.result-tag {
  font-size: 0.7rem;
  padding: 0.22rem 0.65rem;
  border-radius: 20px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  flex-shrink: 0;
}

.days-until {
  display: inline-block;
  margin-top: 0.25rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.3px;
}
.days-until.soon {
  color: var(--gold);
}
.days-until.today {
  color: var(--red);
  font-weight: 700;
  animation: todayPulse 2s ease-in-out infinite;
}

@keyframes todayPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}
body.dark-theme .days-until {
  color: #999;
}
body.dark-theme .days-until.soon {
  color: var(--gold-light);
}
body.dark-theme .days-until.today {
  color: #ff8a8a;
}

.tag-resmi {
  background: #e8f4fd;
  color: #1a6fa3;
  border: 1px solid #c5dff0;
}

.tag-kisisel {
  background: #fde8f0;
  color: var(--red);
  border: 1px solid #f5b7c7;
}

.tag-personal {
  background: #fde8f0;
  color: var(--red);
  border: 1px solid #f5b7c7;
}

.personal-date-badge {
  background: #fde8f0;
  border-color: #f5b7c7;
}

.personal-date-badge .day {
  color: var(--red);
}

.no-result {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.no-result .big {
  font-size: 2.5rem;
  margin-bottom: 0.7rem;
  opacity: 0.5;
}

/* FAVORITE STAR BUTTON (on holiday cards + date info modal) */
.favorite-star-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 1.4rem;
  line-height: 1;
  padding: 0.2rem 0.4rem;
  border-radius: 50%;
  transition: color 0.18s, transform 0.18s;
  -webkit-tap-highlight-color: transparent;
}
/* Inline SVG icons (★/☆/✎ replacements) — keep them vertically centered with
   any adjacent text label instead of sitting on the baseline. */
.favorite-star-btn svg,
.date-info-fav-star svg,
.edit-btn svg { vertical-align: middle; display: inline-block; }
.favorite-star-btn:hover { color: var(--gold); transform: scale(1.1); }
.favorite-star-btn.is-fav {
  color: var(--gold);
  animation: favPop 0.35s ease;
}
.favorite-star-btn.is-fav:hover { color: var(--ink); }

@keyframes favPop {
  0% { transform: scale(1); }
  45% { transform: scale(1.35); }
  100% { transform: scale(1); }
}
.favorite-star-lg { font-size: 1.8rem; }
body.dark-theme .favorite-star-btn { color: #b5ad9b; }
body.dark-theme .favorite-star-btn:hover { color: var(--gold); }

/* ── FAMILY / COUPLE SHARING (profile) ── */
.share-code-box {
  background: var(--cream);
  border: 1px solid var(--border-light);
  border-radius: 0.6rem;
  padding: 0.7rem 0.9rem;
  margin-top: 0.6rem;
  transition: border-color 180ms, background 180ms, box-shadow 180ms;
}
.share-code-box.copied {
  border-color: var(--gold);
  background: var(--gold-pale);
  box-shadow: 0 0 0 3px rgba(200, 146, 42, 0.12);
}
.share-code-box.copied .share-code-value::after {
  content: '';
  display: inline-block;
  width: 0.9em;
  height: 0.9em;
  margin-inline-start: 0.3em;
  vertical-align: middle;
  background: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c8922a' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><path d='M20 6L9 17l-5-5'/></svg>") no-repeat center / contain;
}
.share-code-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
  margin-bottom: 0.4rem;
}
.share-code-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.share-code-value {
  flex: 1;
  font-family: 'DM Sans', monospace;
  font-size: 0.85rem;
  color: var(--ink);
  word-break: break-all;
  background: var(--paper);
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  letter-spacing: 0.02em;
}
.share-code-hint {
  margin: 0.55rem 0 0;
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.4;
}
.follow-input-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.8rem;
}
.follow-input-row input {
  flex: 1;
  padding: 0.6rem 0.9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji';
  font-size: 0.9rem;
  background: var(--paper);
  color: var(--ink);
}
.following-list {
  margin-top: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.following-empty {
  font-size: 0.82rem;
  color: var(--muted);
  font-style: italic;
}
.following-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.85rem;
  background: var(--cream);
  border: 1px solid transparent;
  border-radius: 0.6rem;
  transition: border-color 150ms, background 150ms, box-shadow 150ms;
}
.following-row:hover {
  border-color: rgba(200, 146, 42, 0.45);
  box-shadow: var(--shadow-sm);
}
.following-row:focus-within {
  border-color: var(--gold);
}
.following-name {
  font-size: 0.9rem;
  color: var(--ink);
  font-weight: 500;
}
.following-remove {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: var(--muted);
  cursor: pointer;
  padding: 0 0.4rem;
  border-radius: 50%;
  line-height: 1;
}
.following-remove:hover { color: var(--red); background: rgba(255, 80, 80, 0.1); }
body.dark-theme .share-code-box { background: #1f1f1f; border-color: #3a3a3a; }
body.dark-theme .share-code-value { background: #2a2a2a; border-color: #3a3a3a; color: #f5f1e8; }
body.dark-theme .following-row { background: #1f1f1f; }
body.dark-theme .following-name { color: #f5f1e8; }
body.dark-theme .follow-input-row input { background: #333; border-color: #555; color: #f5f1e8; }

/* Shared dates card on index */
.shared-card {
  border-inline-start-color: var(--gold);
  border-color: #f5d795;
  border-inline-start-width: 3px;
}
.shared-owner-thumb {
  flex-shrink: 0;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--gold-pale), var(--cream-dark));
  border: 1.5px solid rgba(200, 146, 42, 0.45);
  color: var(--gold);
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
}
body.dark-theme .shared-card {
  border-color: #3a3a3a;
  border-inline-start-color: var(--gold);
}
body.dark-theme .shared-owner-thumb {
  background: #333;
  border-color: rgba(200, 146, 42, 0.5);
  color: var(--gold-light);
}

.turning-badge {
  display: inline-flex;
  align-items: center;
  margin-top: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gold-pale) 0%, rgba(200, 146, 42, 0.15) 100%);
  border: 1px solid rgba(200, 146, 42, 0.35);
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.2px;
  line-height: 1.3;
}
body.dark-theme .turning-badge {
  background: rgba(200, 146, 42, 0.15);
  border-color: rgba(200, 146, 42, 0.4);
  color: #f5e8cc;
}

/* ── SMART SUGGESTION BANNER ── */
.smart-suggestion-banner {
  background: linear-gradient(135deg, var(--paper) 0%, rgba(200, 146, 42, 0.08) 100%);
  border: 1px solid rgba(200, 146, 42, 0.4);
  border-inline-start: 3px solid var(--gold);
  border-radius: 0.6rem;
  padding: 1rem 1.15rem;
  margin: 0.6rem 0;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
  animation: bannerFadeIn 0.4s ease both;
}
.smart-suggestion-banner[hidden] { display: none !important; }
.smart-suggestion-text {
  flex: 1 1 200px;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}
.smart-suggestion-title {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
}
.smart-suggestion-desc {
  font-size: 0.82rem;
  color: var(--muted);
}
.smart-suggestion-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}
body.dark-theme .smart-suggestion-banner {
  background: linear-gradient(135deg, #2a2a2a 0%, rgba(200, 146, 42, 0.12) 100%);
}
body.dark-theme .smart-suggestion-title { color: #f5f1e8; }
body.dark-theme .smart-suggestion-desc { color: #b5ad9b; }

/* ── ON THIS DAY WIDGET (Wikipedia) ── */
.onthisday-widget {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  margin: 1rem 0 0.5rem;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.onthisday-widget[hidden] { display: none !important; }
.onthisday-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  width: 100%;
  padding: 0.85rem 1rem;
  margin: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  font: inherit;
  text-align: start;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}
.onthisday-header:hover {
  background: var(--cream);
}
.onthisday-label {
  font-family: 'Playfair Display', serif;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--ink);
}
.onthisday-chevron {
  flex-shrink: 0;
  width: 0.45rem;
  height: 0.45rem;
  border-inline-end: 2px solid var(--gold);
  border-bottom: 2px solid var(--gold);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
  margin-inline-end: 0.15rem;
}
.onthisday-widget:not(.onthisday-collapsed) .onthisday-chevron {
  transform: rotate(-135deg);
  margin-top: 0.2rem;
}
.onthisday-body {
  padding: 0 1rem 1rem;
}
.onthisday-collapsed .onthisday-body {
  display: none;
}
.onthisday-date {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.onthisday-events {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.onthisday-event {
  display: flex;
  gap: 0.7rem;
  padding: 0.5rem 0.7rem;
  border-radius: var(--radius-sm);
  background: var(--cream);
  transition: background 0.15s;
}
.onthisday-event:hover { background: var(--gold-pale, rgba(200, 146, 42, 0.1)); }
.onthisday-year {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  color: var(--gold);
  flex-shrink: 0;
  min-width: 3.5rem;
  font-size: 0.95rem;
}
.onthisday-text {
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--ink);
  word-break: break-word;
}
.onthisday-more {
  display: inline-block;
  margin-top: 0.7rem;
  font-size: 0.78rem;
  color: var(--gold);
  text-decoration: none;
  font-weight: 600;
}
.onthisday-more:hover { color: var(--ink); }
body.dark-theme .onthisday-widget { background: #2a2a2a; border-color: #3a3a3a; }
body.dark-theme .onthisday-label { color: #f5f1e8; }
body.dark-theme .onthisday-event { background: #1f1f1f; }
body.dark-theme .onthisday-event:hover { background: #333; }
body.dark-theme .onthisday-text { color: #f5f1e8; }

/* ── WISH SUGGESTION MODAL ── */
.wish-results {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin: 1rem 0;
  max-height: 50vh;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.wish-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.95rem 1.1rem;
  position: relative;
}
.wish-card-ai {
  border-color: var(--gold);
  background: linear-gradient(135deg, var(--paper) 0%, rgba(200, 146, 42, 0.06) 100%);
}
.wish-card-badge {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  background: var(--gold);
  color: #1a1409;
  padding: 2px 7px;
  border-radius: 999px;
}
.wish-card-text {
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--ink);
  margin-bottom: 0.65rem;
  word-break: break-word;
}
.wish-card-actions {
  display: flex;
  gap: 0.5rem;
}
.wish-card-btn {
  flex: 1;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.8rem;
  font-family: 'DM Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji';
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.15s;
}
.wish-card-btn-primary {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
body.dark-theme .wish-card { background: #2a2a2a; border-color: #3a3a3a; }
body.dark-theme .wish-card-text { color: #f5f1e8; }
body.dark-theme .wish-card-btn { color: #f5f1e8; border-color: #3a3a3a; }
@media (hover: hover) and (pointer: fine) {
  .wish-card-btn:hover { background: var(--cream); }
  .wish-card-btn-primary:hover { background: var(--gold); border-color: var(--gold); }
  body.dark-theme .wish-card-btn:hover { background: #333; }
}

/* Favorite button in date info action row */
.date-info-fav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}
.date-info-fav-btn .date-info-fav-star {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1;
  transition: color 0.18s;
}
.date-info-fav-btn.is-fav .date-info-fav-star { color: var(--gold); }
.date-info-fav-btn.is-fav {
  border-color: var(--gold);
  color: var(--gold);
}
body.dark-theme .date-info-fav-btn .date-info-fav-star { color: #b5ad9b; }
body.dark-theme .date-info-fav-btn.is-fav .date-info-fav-star { color: var(--gold); }

/* MY DATES SEARCH BAR */
.my-search-wrap {
  position: relative;
  margin: 0 0 1rem;
}
.my-search-wrap[hidden] { display: none; }
.my-search-input {
  width: 100%;
  padding-block: 0.7rem;
  padding-inline: 0.95rem 2.4rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji';
  font-size: 0.92rem;
  background: var(--paper);
  color: var(--ink);
  transition: border-color 0.18s, box-shadow 0.18s;
}
.my-search-input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(200, 146, 42, 0.15);
}
.my-search-clear {
  position: absolute;
  inset-inline-end: 0.4rem;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--muted);
  font-size: 1.3rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.my-search-clear[hidden] { display: none; }
.my-search-clear:hover { background: var(--cream); color: var(--ink); }
body.dark-theme .my-search-input { background: #2a2a2a; border-color: #3a3a3a; color: #f5f1e8; }
body.dark-theme .my-search-input::placeholder { color: #8a8275; }
body.dark-theme .my-search-clear:hover { background: #3a3a3a; color: #f5f1e8; }

/* COUNTDOWN CARD (next upcoming personal date) */
.countdown-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem 1.6rem;
  margin: 1.5rem 0 0.4rem;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.countdown-card:hover {
  transform: translateY(-1px);
  border-color: var(--gold);
  box-shadow: 0 4px 14px rgba(200, 146, 42, 0.12);
}
.countdown-card[hidden] { display: none !important; }

/* "Sıradaki tarih" kartında bir favori bayram varsa gold accent ile vurgula. */
.countdown-card.is-favorite {
  border-color: var(--gold);
  background: linear-gradient(135deg, var(--gold-pale) 0%, var(--paper) 65%);
}
.countdown-card.is-favorite::after {
  content: '';
  position: absolute;
  top: 12px;
  inset-inline-end: 14px;
  width: 1rem;
  height: 1rem;
  background: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23c8922a'><path d='M12 2.5l2.95 6.36 6.8.77-5.05 4.62 1.35 6.75L12 17.9l-6 3.1 1.35-6.75L2.3 9.63l6.8-.77z'/></svg>") no-repeat center / contain;
  opacity: 0.85;
  pointer-events: none;
}
body.dark-theme .countdown-card.is-favorite {
  border-color: var(--gold-light);
  background: linear-gradient(135deg, rgba(232, 184, 75, 0.18) 0%, #2a2a2a 65%);
}
body.dark-theme .countdown-card.is-favorite::after {
  color: var(--gold-light);
  opacity: 0.95;
}
.countdown-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: 0.55rem;
}
.countdown-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.2;
  margin-bottom: 0.3rem;
}
.countdown-date {
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 0.55rem;
}
.countdown-time {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--gold);
}
.countdown-time.today { color: #d9534f; }
.countdown-time.soon  { color: var(--gold); }
body.dark-theme .countdown-card { background: #2a2a2a; border-color: #3a3a3a; }
body.dark-theme .countdown-title { color: #f5f1e8; }
body.dark-theme .countdown-date { color: #b5ad9b; }

/* SECTION TITLE ACTIONS — list/grid toggle + add button */
.section-title-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: flex-end;
}
.my-view-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.2rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--cream);
}
.view-toggle-btn {
  background: transparent;
  border: none;
  border-radius: 999px;
  padding: 0.42rem 0.85rem;
  font-family: 'DM Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji';
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  min-height: 36px;
  -webkit-tap-highlight-color: transparent;
}
.view-toggle-btn[aria-pressed="true"] {
  background: var(--gold);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}
body.dark-theme .my-view-toggle {
  background: #252525;
  border-color: #3a3a3a;
}
body.dark-theme .view-toggle-btn { color: #b5ad9b; }
body.dark-theme .view-toggle-btn[aria-pressed="true"] {
  background: var(--gold);
  color: #1a1409;
}

/* MONTHLY GRID VIEW */
#my-dates-grid { padding: 0.4rem 0; }
.grid-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.8rem;
}
.grid-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 600;
}
.grid-nav-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--ink);
}
.grid-nav-btn:hover { background: var(--cream); }
body.dark-theme .grid-nav-btn { color: #f5f1e8; border-color: #3a3a3a; }
.grid-weekdays, .grid-cells {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.grid-weekday {
  text-align: center;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0.3rem 0;
}
.grid-cells { margin-top: 0.2rem; }
.grid-cell {
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  background: var(--paper);
  border: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.3rem;
  position: relative;
  font-size: 0.85rem;
}
.grid-cell-empty { background: transparent; border-color: transparent; }
.grid-cell-day { font-weight: 500; }
.grid-cell-today { background: var(--gold); color: #1a1409; border-color: var(--gold); }
.grid-cell-today .grid-cell-day { font-weight: 700; }
.grid-cell-has-event { border-color: var(--gold); }
.grid-cell-dot {
  position: absolute;
  bottom: 4px;
  font-size: 0.65rem;
  color: var(--gold);
  font-weight: 700;
}
.grid-cell-today.grid-cell-has-event .grid-cell-dot { color: #fff; }
body.dark-theme .grid-cell { background: #2a2a2a; border-color: #3a3a3a; }
/* `body.dark-theme .grid-cell` (specificity 0-2-1) outranks `.grid-cell-today`
   (0-1-0), so today's gold background was being overwritten by #2a2a2a and the
   cell read as near-black. Re-assert the gold accent at dark-theme specificity. */
body.dark-theme .grid-cell-today {
  background: var(--gold);
  border-color: var(--gold);
  color: #1a1409;
}

/* SECTION TITLE */
.section-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 1.2rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* MODAL */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(26, 18, 8, 0.5);
  z-index: 100;
  align-items: center;
  justify-content: center;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.overlay.open {
  display: flex;
  animation: overlayFade 0.22s ease-out;
}

.modal {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 0.8rem;
  padding: 2.2rem;
  width: min(440px, calc(100% - 1rem));
  animation: modalEnter 0.22s ease-out;
  position: relative;
  box-shadow: var(--shadow-lg);
  touch-action: pan-y;
  will-change: transform;
}

@keyframes overlayFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalEnter {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Update modals */
#update-required-modal .modal {
  border: 2px solid var(--gold);
  box-shadow: 0 0 0 4px rgba(200, 146, 42, 0.18), var(--shadow-lg);
  text-align: center;
}
#update-required-modal .modal h2 {
  color: var(--red);
  font-size: 1.55rem;
}
#update-required-modal .sub {
  font-size: 0.9rem;
}
#update-recommended-modal .modal {
  border-color: rgba(200, 146, 42, 0.35);
  background: linear-gradient(180deg, var(--paper) 0%, var(--cream) 100%);
}
body.dark-theme #update-recommended-modal .modal {
  background: linear-gradient(180deg, #2a2a2a 0%, #1f1f1f 100%);
}

.whats-new-version {
  opacity: 0.7;
  font-size: 0.82rem;
}
.whats-new-body {
  line-height: 1.55;
  max-height: 55vh;
  overflow-y: auto;
  margin: 0.5rem 0 1rem;
  -webkit-overflow-scrolling: touch;
}
.whats-new-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.whats-new-list li {
  position: relative;
  padding-inline-start: 1.15rem;
  font-size: 0.9rem;
  color: var(--ink);
}
.whats-new-list li::before {
  content: '';
  position: absolute;
  inset-inline-start: 0;
  top: 0.55em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
}
body.dark-theme .whats-new-list li { color: #f5f1e8; }

.modal-form-stack .field + .field {
  margin-top: 0.15rem;
}
.modal-form-stack .field label {
  margin-bottom: 0.45rem;
}

.report-bug-textarea-wrap {
  position: relative;
}
.report-bug-textarea-wrap textarea {
  min-height: 7.5rem;
  resize: vertical;
  line-height: 1.5;
  padding-bottom: 1.6rem;
}
.report-bug-char-count {
  position: absolute;
  inset-inline-end: 0.65rem;
  bottom: 0.5rem;
  font-size: 0.72rem;
  color: var(--muted);
  pointer-events: none;
}
.report-bug-char-count.is-near-limit {
  color: var(--gold);
  font-weight: 600;
}

/* Subtle swipe-down hint at the top of the modal */
.modal::after {
  content: '';
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 38px;
  height: 4px;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.12);
  pointer-events: none;
}
body.dark-theme .modal::after {
  background: rgba(255, 255, 255, 0.18);
}

.modal::before {
  content: '';
  position: absolute;
  top: 0;
  left: 2rem;
  right: 2rem;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.modal h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  margin-bottom: 0.35rem;
}

.modal .sub {
  color: var(--muted);
  font-size: 0.84rem;
  margin-bottom: 1.8rem;
  line-height: 1.5;
}

.field {
  margin-bottom: 1.1rem;
}

.field label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 0.72rem 0.9rem;
  border: 1.5px solid var(--border);
  background: white;
  font-family: 'DM Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji';
  font-size: 0.9rem;
  color: var(--ink);
  outline: none;
  border-radius: var(--radius-sm);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(200, 146, 42, 0.12);
}

.field input.error {
  border-color: var(--red) !important;
  box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.1);
}

.modal-actions {
  display: flex;
  gap: 0.65rem;
  justify-content: flex-end;
  padding-top: 1.1rem;
  border-top: 1px solid var(--border-light);
}

/* GOOGLE AUTH BUTTON */
.google-auth-btn {
  width: 100%;
  margin-top: 0.35rem;
  margin-bottom: 0.85rem;
  height: 46px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--ink);
  font-family: 'DM Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji';
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.1px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(26, 18, 8, 0.08);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.google-auth-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(26, 18, 8, 0.12);
  border-color: rgba(200, 146, 42, 0.55);
}

.google-auth-btn:active {
  transform: translateY(0px);
  box-shadow: 0 2px 8px rgba(26, 18, 8, 0.08);
}

.google-auth-icon {
  width: 18px;
  height: 18px;
  display: block;
}

.apple-auth-btn {
  width: 100%;
  margin-top: 0.35rem;
  margin-bottom: 0.85rem;
  height: 46px;
  border-radius: var(--radius-sm);
  border: 1.5px solid #000;
  background: #000;
  color: #fff;
  font-family: 'DM Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji';
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.1px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.apple-auth-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}

.apple-auth-btn:active {
  transform: translateY(0px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.apple-auth-icon {
  display: block;
  margin-top: -2px;
}

.reminder-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.reminder-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--ink);
  cursor: pointer;
  user-select: none;
}
.reminder-toggle input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--gold);
  cursor: pointer;
}
.reminder-detail {
  display: none;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.4rem;
  padding: 0.85rem 1rem;
  background: rgba(200, 146, 42, 0.06);
  border: 1px solid rgba(200, 146, 42, 0.18);
  border-radius: var(--radius-sm);
}
.reminder-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.reminder-row-label {
  font-size: 0.92rem;
  color: var(--ink);
  font-weight: 500;
}
.stepper {
  display: inline-flex;
  align-items: center;
  background: #fff;
  border: 1px solid var(--border-solid);
  border-radius: 999px;
  overflow: hidden;
}
.stepper-btn {
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  color: var(--ink);
  font-size: 1.5rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.stepper-btn:hover { background: var(--gold-pale); }
.stepper-btn:active { background: rgba(200, 146, 42, 0.2); }
.stepper-value {
  min-width: 44px;
  text-align: center;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
  padding: 0 0.4rem;
}
.time-picker-input {
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border-solid);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  font-size: 1rem;
  font-family: inherit;
  min-width: 130px;
}

/* iOS-style wheel picker */
.wheel-picker {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
  height: 220px;
  background: var(--paper);
  border: 1px solid var(--border-solid);
  border-radius: var(--radius-sm);
  overflow: hidden;
  user-select: none;
}
.wheel-picker-compact {
  height: 160px;
  width: 100%;
}
.wheel-picker-compact .wheel-items {
  padding-top: 58px;
  padding-bottom: 58px;
}
.wheel-picker-compact .wheel-selection-band {
  top: 58px;
}
.wheel-picker-compact::before,
.wheel-picker-compact::after { height: 50px; }
.wheel-col-sep {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--ink);
  padding: 0 0.2rem;
  z-index: 1;
}
.reminder-row-stack {
  flex-direction: column;
  align-items: stretch;
  gap: 0.4rem;
}
body.dark-theme .wheel-col-sep { color: #f5f5f5; }
.wheel-col {
  flex: 1;
  height: 100%;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  position: relative;
  z-index: 1;
}
.wheel-col::-webkit-scrollbar { display: none; }
.wheel-items {
  padding-top: 88px;
  padding-bottom: 88px;
}
.wheel-item {
  height: 44px;
  line-height: 44px;
  text-align: center;
  font-size: 1.05rem;
  color: var(--muted);
  scroll-snap-align: center;
  font-variant-numeric: tabular-nums;
  transition: color 0.15s, font-weight 0.15s, font-size 0.15s;
}
.wheel-item.selected {
  color: var(--ink);
  font-weight: 700;
  font-size: 1.2rem;
}
body.dark-theme .wheel-item.selected {
  color: #f5f5f5;
}
.wheel-selection-band {
  position: absolute;
  top: 88px;
  left: 0.5rem;
  right: 0.5rem;
  height: 44px;
  border-top: 1px solid rgba(200, 146, 42, 0.35);
  border-bottom: 1px solid rgba(200, 146, 42, 0.35);
  background: rgba(200, 146, 42, 0.06);
  pointer-events: none;
  z-index: 0;
}
/* Fade out items at top/bottom for the depth feel */
.wheel-picker::before,
.wheel-picker::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 70px;
  pointer-events: none;
  z-index: 2;
}
.wheel-picker::before {
  top: 0;
  background: linear-gradient(to bottom, var(--paper), rgba(250, 246, 239, 0));
}
.wheel-picker::after {
  bottom: 0;
  background: linear-gradient(to top, var(--paper), rgba(250, 246, 239, 0));
}
/* Center band item visually emphasized via siblings — bigger / bolder */
.wheel-col[data-wheel] {
  /* Highlight the item closest to center using :focus-within tricks not
     reliable cross-browser, so we use CSS scroll-snap + JS-set color */
}
body.dark-theme .wheel-picker {
  background: #252525;
  border-color: #444;
}
body.dark-theme .wheel-selection-band {
  border-color: rgba(232, 184, 75, 0.4);
  background: rgba(232, 184, 75, 0.1);
}
body.dark-theme .wheel-picker::before {
  background: linear-gradient(to bottom, #252525, rgba(37, 37, 37, 0));
}
body.dark-theme .wheel-picker::after {
  background: linear-gradient(to top, #252525, rgba(37, 37, 37, 0));
}
body.dark-theme .wheel-item { color: #888; }
body.dark-theme .reminder-toggle { color: #f5f5f5; }
body.dark-theme .reminder-row-label { color: #f5f5f5; }
body.dark-theme .reminder-detail {
  background: rgba(232, 184, 75, 0.08);
  border-color: rgba(232, 184, 75, 0.25);
}
body.dark-theme .stepper {
  background: #333;
  border-color: #555;
}
body.dark-theme .stepper-btn { color: #f5f5f5; }
body.dark-theme .stepper-btn:hover { background: #444; }
body.dark-theme .stepper-value { color: #f5f5f5; }
body.dark-theme .time-picker-input,
body.dark-theme .date-picker-input {
  background: #333;
  border-color: #555;
  color: #f5f5f5;
}

.legal-notice {
  margin-top: 1rem;
  font-size: 0.72rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
}
.legal-notice a {
  color: var(--gold);
  text-decoration: none;
}
.legal-notice a:hover {
  text-decoration: underline;
}
body.dark-theme .legal-notice {
  color: #999;
}

body.dark-theme .apple-auth-btn {
  background: #fff;
  color: #000;
  border-color: #fff;
}

.close-modal {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 0;
  line-height: 0;
  color: transparent;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  padding: 0;
  transition: background 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.close-modal::before,
.close-modal::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 2px;
  background: var(--muted);
  border-radius: 1px;
  transition: background 0.2s;
}

.close-modal::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.close-modal::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.close-modal:hover::before,
.close-modal:hover::after {
  background: var(--ink);
}

.close-modal:hover {
  background: var(--cream);
}

.close-modal:hover {
  color: var(--ink);
  background: var(--cream);
}

/* DATE INFO MODAL */
.date-info-modal {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 0.8rem;
  padding: 0;
  width: min(460px, calc(100% - 1rem));
  max-height: min(88vh, 640px);
  display: flex;
  flex-direction: column;
  animation: modalEnter 0.22s ease-out;
  position: relative;
  box-shadow: var(--shadow-lg);
  touch-action: pan-y;
  will-change: transform;
  overflow: hidden;
}
.date-info-modal .close-modal {
  z-index: 3;
}
.date-info-scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 2rem 1.35rem 0.75rem;
  overscroll-behavior: contain;
}

.date-info-modal::before {
  content: '';
  position: absolute;
  top: 0;
  left: 2rem;
  right: 2rem;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.date-info-modal h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem;
  margin-bottom: 0.65rem;
  color: var(--ink);
  padding-inline-end: 2rem;
}

.date-info-modal .date-display {
  background: var(--gold-pale);
  border: 1px solid rgba(200, 146, 42, 0.25);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  text-align: center;
  margin-bottom: 0.85rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--gold);
}

.date-info-modal .description {
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}

/* Additional info + information section visually merged into one card so
   the modal reads as a single information panel instead of two floating
   boxes. Top half = key/value rows, bottom half = paragraph text with a
   subtle internal divider. */
.date-info-modal .additional-info {
  background: var(--cream);
  border: 1px solid var(--border-light);
  border-bottom: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  padding: 1rem;
  margin-bottom: 0;
}
.date-info-modal .information-section {
  background: var(--cream);
  border: 1px solid var(--border-light);
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  padding: 1rem;
  margin-bottom: 0.85rem;
}
/* When only ONE of the two sections is rendered (e.g. only information,
   no type/countries/celebration), restore full radius + border so it's
   not orphaned with half-rounded corners. */
.date-info-modal .additional-info:last-of-type {
  border-bottom: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  margin-bottom: 0.85rem;
}
.date-info-modal .information-section:first-of-type {
  border-top: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
}
body.dark-theme .date-info-modal .information-section {
  border-top-color: rgba(255, 255, 255, 0.08);
}

.date-info-modal .info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.45rem;
  font-size: 0.84rem;
}

.date-info-modal .info-item:last-child {
  margin-bottom: 0;
}

.date-info-modal .info-label {
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  font-size: 0.68rem;
  letter-spacing: 0.7px;
}

.date-info-modal .info-value {
  color: var(--ink);
  word-break: break-word;
  overflow-wrap: anywhere;
  min-width: 0;
}

.date-info-modal .information-title {
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 0.5rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.7px;
}

.date-info-modal .information-text {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.date-info-modal .tags {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.date-info-modal .tag {
  font-size: 0.68rem;
  padding: 0.22rem 0.6rem;
  border-radius: 20px;
  background: var(--gold);
  color: white;
  font-weight: 600;
}

.date-info-modal .close-btn {
  background: var(--ink);
  color: var(--paper);
  border: none;
  padding: 0.7rem 1.2rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: 'DM Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji';
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.22s;
  width: 100%;
}

.date-info-modal .date-info-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  padding: 0.85rem 1rem calc(0.85rem + env(safe-area-inset-bottom));
  margin: 0;
  border-top: 1px solid var(--border-light);
  background: var(--paper);
  flex-shrink: 0;
}

.date-info-modal .date-info-actions .btn {
  min-height: 44px;
  font-size: 0.82rem;
  padding: 0.55rem 0.65rem;
}

.date-info-modal .date-info-fav-btn {
  grid-column: 1 / -1;
}

.date-info-modal .date-info-fav-btn.btn-primary {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--ink);
}

/* MY DATES */
#my-section {
  display: none;
  margin-top: 2.5rem;
  animation: fadeUp 0.45s ease both;
}

.my-card {
  background: white;
  border: 1px solid #f5b7c7;
  border-inline-start: 3px solid var(--red);
  border-radius: var(--radius-sm);
  padding: 0.95rem 1.2rem;
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  max-width: 100%;
  box-sizing: border-box;
  transition: all 0.2s;
}

/* Favorilenmis bayramlar artik My Dates listesinin basinda + altin
   accent ile gosterilir. renderMyDates icinde sort ve .is-favorite
   sinifi ekleniyor; favori bayram source: 'favorite-holiday' olarak
   personal date'e gomulu. */
.my-card.is-favorite {
  position: relative;
  border-inline-start-color: var(--gold);
  background: linear-gradient(90deg, var(--gold-pale) 0%, white 55%);
}
.my-card.is-favorite::after {
  content: '';
  position: absolute;
  top: 6px;
  inset-inline-end: 10px;
  width: 0.9rem;
  height: 0.9rem;
  background: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23c8922a'><path d='M12 2.5l2.95 6.36 6.8.77-5.05 4.62 1.35 6.75L12 17.9l-6 3.1 1.35-6.75L2.3 9.63l6.8-.77z'/></svg>") no-repeat center / contain;
  opacity: 0.85;
  pointer-events: none;
}
body.dark-theme .my-card.is-favorite {
  border-inline-start-color: var(--gold-light);
  background: linear-gradient(90deg, rgba(232, 184, 75, 0.18) 0%, #2d2d2d 60%);
}
body.dark-theme .my-card.is-favorite::after {
  color: var(--gold-light);
  opacity: 0.95;
}

@media (hover: hover) and (pointer: fine) {
  .my-card:hover {
    box-shadow: var(--shadow-sm);
    transform: translateX(2px);
  }
  [dir="rtl"] .my-card:hover {
    transform: translateX(-2px);
  }
}

.my-card .result-name {
  font-size: 0.98rem;
}

/* My Dates card action buttons — edit (✎) and delete (×).
   Sized to a 36px touch target (above iOS 44px hit area via padding) and
   colored so the delete is visually distinct as a destructive action. */
.my-card .del-btn,
.my-card .edit-btn {
  background: var(--cream);
  border: 1px solid var(--border);
  cursor: pointer;
  font-size: 1.25rem;
  padding: 0;
  width: 2.25rem;
  height: 2.25rem;
  min-width: 2.25rem;
  border-radius: 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition:
    color 150ms ease,
    background 150ms ease,
    border-color 150ms ease,
    transform 80ms ease;
}
.my-card .edit-btn {
  color: var(--ink, var(--text));
}
.my-card .edit-btn:hover {
  color: var(--gold);
  background: rgba(200, 146, 42, 0.1);
  border-color: var(--gold);
}
/* Delete = destructive — red even at rest so the affordance is unmistakable */
.my-card .del-btn {
  color: var(--red, #d33);
  border-color: rgba(211, 51, 51, 0.35);
}
.my-card .del-btn:hover {
  color: #fff;
  background: var(--red, #d33);
  border-color: var(--red, #d33);
}
.my-card .del-btn:active,
.my-card .edit-btn:active {
  transform: scale(0.92);
}

body.dark-theme .my-card .del-btn,
body.dark-theme .my-card .edit-btn {
  background: #2a2a2a;
  border-color: #444;
}
body.dark-theme .my-card .edit-btn:hover {
  background: rgba(200, 146, 42, 0.18);
  border-color: var(--gold);
}
body.dark-theme .my-card .del-btn {
  color: #ff6b6b;
  border-color: rgba(255, 107, 107, 0.4);
}
body.dark-theme .my-card .del-btn:hover {
  color: #fff;
  background: #c93030;
  border-color: #c93030;
}

/* TOAST */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(6rem);
  background: var(--ink);
  color: var(--paper);
  padding: 0.75rem 1.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.83rem;
  font-weight: 500;
  z-index: 200;
  transition: transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
  box-shadow: var(--shadow-lg);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

/* ANIMATIONS */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: scale(0.94) translateY(6px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* DIVIDER */
.divider {
  height: 1px;
  background: var(--border-light);
  margin: 2rem 0;
}

/* USER CHIP */
.user-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.83rem;
  color: var(--muted);
}

.user-chip strong {
  color: var(--ink);
  font-weight: 600;
}

.user-chip-link {
  text-decoration: none;
  padding: 4px 10px 4px 4px;
  border-radius: 99px;
  border: 1.5px solid var(--border);
  background: white;
  box-shadow: var(--shadow-sm);
  transition: all 0.22s ease;
}

.user-chip-link:hover {
  border-color: var(--gold);
  box-shadow: 0 4px 12px rgba(200, 146, 42, 0.18);
  transform: translateY(-1px);
}

.user-chip-link:hover strong {
  color: var(--gold);
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  box-shadow: 0 2px 6px rgba(200, 146, 42, 0.35);
  flex-shrink: 0;
}

.empty-my {
  padding: 1.8rem;
  border: 1.5px dashed var(--border);
  text-align: center;
  color: var(--muted);
  font-size: 0.86rem;
  border-radius: var(--radius-sm);
  transition: border-color 0.2s;
}

.empty-my:hover {
  border-color: var(--gold);
}


/* USER PROFILE MENU & DROPDOWN */
.user-profile-menu {
  position: relative;
  display: flex;
  align-items: center;
  cursor: pointer;
  z-index: 1010;
}

.user-profile-menu .user-chip {
  padding: 4px 8px;
  border-radius: var(--radius);
  transition: background 0.2s;
}

.user-profile-menu:hover .user-chip {
  background: var(--cream);
}

.dropdown-icon {
  font-size: 0.6rem;
  margin-left: 4px;
  color: var(--muted);
  transition: transform 0.2s;
  display: inline-block;
}

.user-profile-menu:hover .dropdown-icon {
  transform: rotate(180deg);
  color: var(--gold);
}

.dropdown-content {
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  width: 160px;
  background: white;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  display: none;
  list-style: none;
  z-index: 1011;
  overflow: hidden;
  animation: popIn 0.2s ease;
}

.user-profile-menu:hover .dropdown-content {
  display: block;
}

.dropdown-content li a {
  display: block;
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  color: var(--ink);
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.dropdown-content li a:hover {
  background: var(--cream);
  color: var(--gold);
}

.dropdown-content li:not(:last-child) {
  border-bottom: 1px solid var(--border-light);
}

/* ── PROFILE PAGE ── */
.profile-page {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 2rem;
  max-width: 960px;
  margin: 2.5rem auto 5rem;
  padding: 0 2rem;
  align-items: start;
}

/* Aside */
.profile-aside {
  position: sticky;
  top: 5.5rem;
}

.profile-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  animation: fadeUp 0.5s ease both;
}

.profile-card-bg {
  height: 80px;
  background: linear-gradient(135deg, var(--ink) 0%, #3a2b14 60%, var(--gold) 100%);
  position: relative;
}

.profile-card-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.08'/%3E%3C/svg%3E");
}

/* Avatar overlapping banner */
.profile-card .profile-avatar-wrap {
  position: relative;
  width: 88px;
  height: 88px;
  margin: -44px auto 0;
  z-index: 2;
}

.profile-card .avatar {
  width: 88px;
  height: 88px;
  font-size: 2rem;
  border: 4px solid white;
  box-shadow: 0 4px 14px rgba(26, 18, 8, 0.18);
}

.avatar-edit-btn {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 26px;
  height: 26px;
  background: var(--gold);
  border: 2px solid white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: white;
  transition: all 0.2s;
  box-shadow: 0 2px 6px rgba(200, 146, 42, 0.4);
}

.avatar-edit-btn:hover {
  background: var(--ink);
  transform: scale(1.1);
}

/* Identity */
.profile-identity {
  text-align: center;
  padding: 1rem 1.5rem 0;
}

.profile-display-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 0.25rem;
}

.profile-email-text {
  font-size: 0.78rem;
  color: var(--muted);
  word-break: break-all;
}

/* Scanning anim inside card */
.profile-card .scanning-anim {
  display: none;
  margin: 0.8rem 1.5rem 0;
  font-size: 0.78rem;
  text-align: center;
  color: var(--gold);
  font-weight: 500;
}

.scanning-anim::after {
  content: '';
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid var(--gold);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-left: 8px;
  vertical-align: middle;
}

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

/* Reusable button loading state — adds a small inline spinner before the
   button's text and disables interaction. Color picks up the button's
   currentColor so it works on light AND dark backgrounds. */
.btn.is-loading {
  pointer-events: none;
  opacity: 0.85;
}

/* Pull-to-refresh indicator — sits above the page, follows the finger
   down while pulling, then snaps back. Visible only while pulling or
   refreshing; never blocks input otherwise. */
.ptr-indicator {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translate(-50%, -100%);
  /* Sits above main content but BELOW modal overlays (.overlay z-index 100,
     .qvelly-select-menu 1000) so a stray PTR can never paint over an open
     modal even if the touch gate above accidentally fires. */
  z-index: 60;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  background: var(--paper);
  border: 1.5px solid var(--gold);
  box-shadow: 0 4px 12px rgba(26, 18, 8, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 180ms ease;
}
.ptr-indicator.is-active {
  opacity: 1;
}
.ptr-indicator.is-refreshing {
  opacity: 1;
  transform: translate(-50%, 0.6rem) !important;
  transition: transform 200ms ease, opacity 180ms ease;
}
.ptr-spinner {
  width: 1.1rem;
  height: 1.1rem;
  border: 2.5px solid var(--gold);
  border-top-color: transparent;
  border-radius: 50%;
}
.ptr-indicator.is-refreshing .ptr-spinner {
  animation: spin 0.8s linear infinite;
}
body.dark-theme .ptr-indicator {
  background: #2a2a2a;
  border-color: var(--gold);
}
@media (prefers-reduced-motion: reduce) {
  .ptr-indicator,
  .ptr-indicator.is-refreshing {
    transition: none;
  }
  .ptr-indicator.is-refreshing .ptr-spinner {
    animation: none;
  }
}
.btn.is-loading::before {
  content: '';
  display: inline-block;
  width: 0.85em;
  height: 0.85em;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-inline-end: 0.5rem;
  vertical-align: -0.12em;
}
@media (prefers-reduced-motion: reduce) {
  .btn.is-loading::before { animation: none; }
}

/* Meta row */
.profile-meta-row {
  display: flex;
  align-items: stretch;
  margin: 1.2rem 1.5rem 0;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  overflow: hidden;
}

.profile-meta-item {
  flex: 1;
  padding: 0.75rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  background: var(--paper);
}

.profile-meta-divider {
  width: 1px;
  background: var(--border-light);
}

.profile-meta-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  font-weight: 600;
}

.profile-meta-val {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ink);
}

/* Card footer */
.profile-card-footer {
  display: flex;
  gap: 0.6rem;
  padding: 1.2rem 1.5rem 1.5rem;
  margin-top: 1rem;
  border-top: 1px solid var(--border-light);
}

.profile-card-footer .btn {
  flex: 1;
  justify-content: center;
  text-align: center;
  /* Modernise: override btn-sm so the labels (e.g. "← Ana Sayfaya Dön") sit on
     ONE line at a comfortable size instead of wrapping in a cramped small pill. */
  white-space: nowrap;
  padding: 0.8rem 1.05rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 0.7rem;
  letter-spacing: 0.01em;
  gap: 0.4rem;
}

/* Main panels */
.profile-main {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.profile-section {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  animation: fadeUp 0.5s ease both;
  transition: box-shadow 0.25s;
}

.profile-section:hover {
  box-shadow: var(--shadow-md);
}

.profile-section:nth-child(2) {
  animation-delay: 0.07s;
}

.profile-section:nth-child(3) {
  animation-delay: 0.14s;
}

.section-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--muted);
  background: var(--paper);
}

.section-icon {
  font-size: 0.95rem;
  line-height: 1;
}

.section-body {
  padding: 1.5rem;
}

/* Name + save inline */
.field-row {
  display: flex;
  gap: 0.85rem;
  align-items: flex-end;
}

.field-group {
  flex: 1;
}

.field-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
  margin-bottom: 0.55rem;
}

/* iOS-style toggle switch */
.toggle-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.toggle-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 28px;
  background: var(--border);
  border-radius: 999px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.22s;
}
.toggle-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  inset-inline-start: 2px;
  width: 24px;
  height: 24px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0,0,0,0.18);
  transition: transform 0.22s;
}
.toggle-input:checked + .toggle-switch {
  background: var(--gold);
}
.toggle-input:checked + .toggle-switch::after {
  transform: translateX(18px);
}
/* RTL: knob anchored to inline-start ends up on the right; checked-state
   slide must reverse direction so it moves toward the visual end (left). */
[dir="rtl"] .toggle-input:checked + .toggle-switch::after {
  transform: translateX(-18px);
}
.toggle-input:focus-visible + .toggle-switch {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
.toggle-desc {
  flex: 1;
  min-width: 200px;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.4;
}
.toggle-row-stack {
  flex-direction: column;
  align-items: stretch;
  gap: 0.45rem;
}
.toggle-row-main {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.toggle-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
}
.toggle-desc-block {
  margin: 0;
  padding-inline-start: calc(46px + 0.75rem);
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.45;
}
.quiet-hours-times {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.65rem;
  margin-top: 0.65rem;
  padding: 0.65rem 0.75rem;
  background: var(--paper);
  border: 1px solid var(--border-light);
  border-radius: 0.5rem;
}
.quiet-hours-times[hidden] {
  display: none !important;
}
.calendar-silent-block {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-light);
}
body.dark-theme .quiet-hours-times {
  background: #2a2a2a;
  border-color: #3a3a3a;
}
body.dark-theme .calendar-silent-block {
  border-color: #3a3a3a;
}
body.dark-theme .toggle-title { color: #f5f1e8; }

.profile-settings-body {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.profile-settings-group {
  border: 1px solid var(--border-light);
  border-radius: 0.6rem;
  margin-top: 0.65rem;
  background: var(--cream);
  overflow: hidden;
}
/* NOTE: clipping of the open custom-select popover is handled in
   qvelly-select.js (unclipAncestors) which lifts overflow:hidden on ALL
   ancestors while a menu is open — more reliable than a :has() rule that only
   covered these two selectors and depended on :has() support. */
.profile-settings-summary {
  padding: 0.85rem 1rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.profile-settings-summary::-webkit-details-marker { display: none; }
.profile-settings-group[open] .profile-settings-summary {
  border-bottom: 1px solid var(--border-light);
  background: var(--paper);
}
.profile-settings-group-body {
  padding: 0.85rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
body.dark-theme .profile-settings-group {
  background: #252525;
  border-color: #3a3a3a;
}
body.dark-theme .profile-settings-summary { color: #f5f1e8; }
body.dark-theme .profile-settings-group[open] .profile-settings-summary {
  background: #2a2a2a;
  border-color: #3a3a3a;
}

body.dark-theme .search-filters {
  background: #2a2a2a;
  border-color: #3a3a3a;
}
body.dark-theme .search-filter-select {
  background: #333;
  border-color: #555;
  color: #f5f1e8;
}
body.dark-theme .search-wrap input {
  background: #2a2a2a;
  border-color: #3a3a3a;
  color: #f5f1e8;
}
body.dark-theme .holiday-pack-banner {
  background: #2a2a2a;
  border-color: #3a3a3a;
}
body.dark-theme .onthisday-header:hover { background: #333; }
body.dark-theme .date-info-modal .date-info-actions {
  background: #2a2a2a;
  border-color: #3a3a3a;
}
body.dark-theme .date-info-modal .date-display {
  background: rgba(200, 146, 42, 0.12);
  color: var(--gold-light);
}

body.dark-theme .toggle-switch::after { background: #f5f1e8; }

/* Offline banner — slides in at top, communicates cached-mode */
.offline-banner {
  position: sticky;
  top: 0;
  z-index: 1500;
  background: #e9b949;
  color: #2a1f0e;
  text-align: center;
  font-family: 'DM Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji';
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.45rem 0.9rem;
  letter-spacing: 0.2px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
  padding-top: calc(0.45rem + env(safe-area-inset-top, 0));
}
.offline-banner[hidden] { display: none !important; }
body.dark-theme .offline-banner {
  background: #c89530;
  color: #1a1409;
}

/* IMPORT CALENDAR MODAL */
.modal-tall { max-height: 85vh; display: flex; flex-direction: column; }
.import-cal-toolbar {
  display: flex;
  gap: 0.5rem;
  margin: 0.6rem 0 0.8rem;
}
.import-cal-list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  /* Prevent the scroll from leaking out to the page when we hit either end. */
  overscroll-behavior: contain;
  max-height: 50vh;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.3rem;
  background: var(--cream);
  /* Re-allow native vertical scrolling — .modal sets touch-action: pan-y on
     itself which restricts touch handling but we need free pan-y here. */
  touch-action: pan-y;
}
.import-cal-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 0.7rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.import-cal-row:hover { background: var(--paper); }
.import-cal-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--gold);
  flex-shrink: 0;
}
.import-cal-avatar {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--gold-pale);
  border: 1px solid rgba(200, 146, 42, 0.35);
  color: var(--gold);
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
}
body.dark-theme .import-cal-avatar {
  background: #333;
  color: var(--gold-light);
}
.import-cal-row-meta { flex: 1; min-width: 0; }
.import-cal-row-name {
  font-weight: 500;
  font-size: 0.92rem;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.import-cal-row-date {
  font-size: 0.78rem;
  color: var(--muted);
}
body.dark-theme .import-cal-list { background: #1f1f1f; border-color: #3a3a3a; }
body.dark-theme .import-cal-row:hover { background: #2a2a2a; }
body.dark-theme .import-cal-row-name { color: #f5f1e8; }

.profile-input {
  width: 100%;
  padding: 0.72rem 0.9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji';
  font-size: 0.9rem;
  color: var(--ink);
  background: var(--paper);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.profile-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(200, 146, 42, 0.1);
  background: white;
}

.save-btn {
  flex-shrink: 0;
  white-space: nowrap;
}

.mt-field {
  margin-top: 1.25rem;
}

/* Profile select */
.profile-select {
  width: 100%;
  padding: 0.72rem 0.9rem;
  background: var(--paper);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji';
  font-size: 0.9rem;
  color: var(--ink);
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
}

.profile-select:focus {
  border-color: var(--gold);
}

/* Theme toggle pill */
.theme-toggle {
  display: flex;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  width: fit-content;
}

.theme-option {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1.1rem;
  background: transparent;
  border: none;
  font-family: 'DM Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji';
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s;
}

.theme-option:first-child {
  border-right: 1.5px solid var(--border);
}

.theme-option:hover {
  background: var(--cream);
  color: var(--ink);
}

.theme-option.active {
  background: var(--ink);
  color: white;
}

/* Danger zone */
.danger-zone .section-label {
  color: var(--red);
}

.danger-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.danger-row + .danger-row {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}
body.dark-theme .danger-row + .danger-row {
  border-top-color: #444;
}

.danger-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.2rem;
}

.danger-desc {
  font-size: 0.8rem;
  color: var(--muted);
}

/* UTILITIES */
.text-right {
  text-align: right;
}

.mt-2 {
  margin-top: 2rem;
}

.pt-1-5 {
  padding-top: 1.5rem;
}

.no-underline {
  text-decoration: none;
}

.border-top {
  border-top: 1px solid var(--border-light);
}

/* DARK THEME SIMULATION */
body.dark-theme {
  background-color: #1a1a1a;
  color: #f5f5f5;
}

body.dark-theme::before {
  opacity: 0.3;
}

body.dark-theme .profile-card,
body.dark-theme .profile-section,
body.dark-theme .sidebar-card,
body.dark-theme .modal,
body.dark-theme .date-info-modal,
body.dark-theme .result-card,
body.dark-theme .my-card,
body.dark-theme .empty-my,
body.dark-theme .no-result {
  background-color: #2d2d2d;
  border-color: #444;
  color: #f5f5f5;
}

body.dark-theme .country-card,
body.dark-theme .lang-icon-nav,
body.dark-theme .language-menu-nav {
  background-color: #252525;
  border-color: #444;
  color: #f5f5f5;
}
/* The visible language control is the inner img; give it a dark circular
   backing + border in dark theme so it reads as a themed button, not a
   bright pill floating on the dark header. */
body.dark-theme img.lang-icon-nav {
  background-color: #252525;
  border: 1px solid #444;
  filter: brightness(0.92);
}

body.dark-theme .section-label,
body.dark-theme .profile-meta-item,
body.dark-theme .date-badge {
  background-color: #252525;
  border-color: #444;
}

body.dark-theme .profile-input,
body.dark-theme .profile-select,
body.dark-theme .recurrence-select,
body.dark-theme .field input,
body.dark-theme #search-input,
body.dark-theme #country-search-input {
  background-color: #333;
  border-color: #555;
  color: #f5f5f5;
}
/* Option items inside selects use the OS dropdown — give them dark
   backgrounds for browsers that respect the rule (most Chromium-based,
   plus Firefox / iOS Safari since recent versions). */
body.dark-theme .profile-select option,
body.dark-theme .recurrence-select option {
  background-color: #2a2a2a;
  color: #f5f5f5;
}
/* color-scheme tells the browser to render native UI in dark variant —
   this is what makes the dropdown popover use dark colours on most platforms. */
body.dark-theme .profile-select,
body.dark-theme .recurrence-select {
  color-scheme: dark;
}

body.dark-theme .date-badge {
  background: #252525;
}

body.dark-theme .result-card:hover .date-badge {
  background: #333;
  border-color: var(--gold);
}

body.dark-theme .personal-date-badge {
  border-color: #7f3a45;
}

body.dark-theme .profile-display-name,
body.dark-theme .danger-title,
body.dark-theme .profile-meta-val,
body.dark-theme .profile-meta-label,
body.dark-theme .result-name,
body.dark-theme .date-info-modal h3 {
  color: #f5f5f5;
}

body.dark-theme .date-info-modal .date-display {
  background: #2a2418;
  border-color: rgba(200, 146, 42, 0.4);
  color: var(--gold);
}

body.dark-theme .profile-email-text,
body.dark-theme .result-desc,
body.dark-theme .date-badge .month,
body.dark-theme .description,
body.dark-theme .current-lang-label,
body.dark-theme .language-item {
  color: #bbb;
}

body.dark-theme header {
  background-color: #222;
  border-color: #444;
}

body.dark-theme .logo {
  color: var(--gold);
}

body.dark-theme .user-chip strong {
  color: #fff;
}

body.dark-theme .user-chip-link {
  background: #333;
  border-color: #555;
}

body.dark-theme .theme-option.active {
  background: var(--gold);
}

body.dark-theme .tag-resmi {
  background: #17364a;
  color: #a9d8f5;
  border-color: #2e5f7d;
}

body.dark-theme .tag-personal,
body.dark-theme .tag-kisisel {
  background: #44242d;
  color: #ffb8c7;
  border-color: #7f3a45;
}

body.dark-theme .divider {
  background: #444;
}

body.dark-theme .country-card .name {
  color: #f5f5f5;
}

body.dark-theme .country-card .code {
  color: #999;
}

body.dark-theme .country-card.active .name,
body.dark-theme .country-card.active .code {
  color: var(--gold);
}

body.dark-theme .date-badge .day {
  color: var(--gold);
}

body.dark-theme .personal-date-badge .day {
  color: #ff8a9c;
}

body.dark-theme .country-card .name {
  color: #f5f5f5;
}
body.dark-theme .country-card.active .name {
  color: var(--gold);
}
body.dark-theme .country-card .code {
  color: #999;
}
body.dark-theme .country-card.active .code {
  color: var(--gold);
}

/* RESPONSIVE */
@media (max-width: 900px) {
  .app-container {
    /* minmax(0,1fr): tek sütun da içerik genişliğine ESNEMESİN — arama
       sonuçları render olunca sayfa sağa taşmasın (mobil bug). */
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
    padding: 1.5rem 1.5rem 4rem;
  }

  .sidebar-card {
    position: static;
  }

  header {
    padding: 1rem 1.5rem;
  }

  .search-wrap input {
    width: 100%;
  }
}

/* ── MOBILE / NATIVE APP TWEAKS ─────────────────────────────── */

/* Safe-area insets: notch / status bar / home indicator */
header {
  padding-top: calc(1.2rem + env(safe-area-inset-top));
  padding-left: calc(3rem + env(safe-area-inset-left));
  padding-right: calc(3rem + env(safe-area-inset-right));
}

.app-container {
  padding-bottom: calc(2rem + env(safe-area-inset-bottom));
}

/* Native build: status bar background blends with body */
html.is-native,
html.is-native body {
  background: var(--paper);
}

html.is-native body.dark-theme {
  background: #1a1a1a;
}

/* Remove the ugly tap-highlight on native mobile */
* {
  -webkit-tap-highlight-color: transparent;
}

/* ─── PHONE LAYOUT (≤700px): redesigned to feel like a native app ─── */
@media (max-width: 700px) {

  /* ── APP BAR HEADER ───────────────────────────────────────── */
  header {
    padding: calc(0.55rem + env(safe-area-inset-top)) 1rem 0.55rem;
    gap: 0.5rem;
    box-shadow: 0 1px 0 var(--border-light);
  }

  /* Slightly thinner gold accent line on mobile */
  header::before {
    height: 1.5px;
  }

  header .logo {
    font-size: 1.35rem;
    letter-spacing: -0.3px;
  }

  .header-right {
    gap: 0.4rem;
  }

  /* Auth buttons (Log In / Sign Up) in header — compact pill style */
  .header-right > .btn {
    min-height: 36px;
    padding: 0.45rem 0.85rem;
    font-size: 0.78rem;
    border-radius: 999px;
  }

  /* User chip (logged-in state) — truncate long names */
  .user-chip-link {
    max-width: 50vw;
    overflow: hidden;
  }

  .user-chip-link strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 30vw;
    font-size: 0.82rem;
  }

  /* Language pill: icon-only on phone, no inline label clutter */
  .lang-selector-wrapper {
    padding-right: 0;
  }

  .current-lang-label {
    display: none;
  }

  img.lang-icon-nav {
    width: 36px;
    height: 36px;
    border-width: 1px;
    box-shadow: var(--shadow-sm);
  }

  /* Language menu: FIXED to the viewport top-right (top-left under RTL) so a
     long profile name widening the profile pill can't push the menu off-screen
     / out of the safe area. Independent of the lang-wrapper's shifting position. */
  .language-menu-nav {
    position: fixed;
    top: calc(env(safe-area-inset-top) + 4rem);
    inset-inline-end: 12px;
    inset-inline-start: auto;
    width: 220px;
    max-width: calc(100vw - 24px);
    max-height: 60vh;
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(26, 18, 8, 0.18), 0 0 0 1px var(--border-light);
  }

  .language-item {
    padding: 12px 16px;
    font-size: 0.9rem;
  }

  /* ── MAIN CONTAINER: single-column, tight padding ─────────── */
  .app-container {
    padding: 0.75rem 1rem calc(2rem + env(safe-area-inset-bottom));
    gap: 1.25rem;
  }

  /* ── HERO: compact, editorial ────────────────────────────── */
  main {
    padding-top: 0.5rem;
  }

  .hero {
    margin-bottom: 1rem;
    padding-left: 0.65rem;
  }

  .hero::before {
    left: 0;
    top: 0.25rem;
    height: 2.2rem;
    width: 2px;
  }

  .hero h1 {
    font-size: 1.85rem;
    line-height: 1.1;
    margin-bottom: 0.5rem;
    letter-spacing: -0.3px;
  }

  .hero p {
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--muted);
  }

  /* ── COUNTRY PICKER: horizontal scrolling chip carousel ─── */
  .sidebar {
    /* Break out of the app-container padding so chips can scroll edge-to-edge */
    margin: 0 -1rem;
  }

  .sidebar-card {
    background: white;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    padding: 1rem 0;
    border-radius: var(--radius);
    position: static;
  }

  .sidebar-card:hover {
    box-shadow: var(--shadow-sm);
  }

  .sidebar-title {
    font-size: 0.66rem;
    margin: 0 1rem 0.55rem;
    letter-spacing: 1.4px;
  }

  /* Search bar görünür kalır, telefonda da arama yapılabilsin */
  .country-search-wrap {
    display: block;
    margin: 0 0 0.7rem;
    padding: 0 1rem;
  }

  .country-search-wrap input {
    width: 100%;
    padding: 0.7rem 0.9rem;
    font-size: 0.9rem;
    border-radius: var(--radius-sm);
  }

  /* Ülkeler: dikey scroll edilebilir 2-kolon grid */
  .country-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow-x: hidden;
    overflow-y: auto;
    max-height: 240px;
    padding: 0 1rem 0.5rem;
    gap: 0.45rem;
    -webkit-overflow-scrolling: touch;
    scroll-padding: 0;
  }

  .country-grid::-webkit-scrollbar {
    width: 3px;
  }

  .country-grid::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
  }

  .country-card {
    flex: unset;
    scroll-snap-align: unset;
    background: var(--paper);
    border: 1.5px solid transparent;
    padding: 0.55rem 0.65rem;
    border-radius: var(--radius-sm);
    gap: 0.4rem;
    box-shadow: none;
    min-height: 44px;
    min-width: 0;
  }

  .country-card:hover {
    transform: none;
  }

  .country-card:active {
    transform: scale(0.97);
  }

  .country-card.active {
    background: var(--gold-pale);
    border-color: var(--gold);
    box-shadow: 0 0 0 1px var(--gold);
  }

  .country-card .code {
    font-size: 0.62rem;
    width: 22px;
    color: var(--muted);
  }

  .country-card.active .code {
    color: var(--gold);
  }

  .country-card .name {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--ink);
  }

  .country-card.active .name {
    color: var(--ink);
  }

  /* ── SEARCH BAR: prominent, with icon ─────────────────────── */
  .search-wrap {
    margin-bottom: 1.5rem;
    position: relative;
  }

  .search-wrap::before {
    content: '';
    position: absolute;
    inset-inline-start: 1rem;
    top: 50%;
    width: 18px;
    height: 18px;
    transform: translateY(-50%);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%238a7b6a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
    pointer-events: none;
    z-index: 2;
  }

  .search-wrap input {
    padding-block: 0.95rem;
    padding-inline: 2.6rem 1rem;
    font-size: 16px; /* prevents iOS zoom */
    border-radius: 12px;
    border-width: 1px;
    background: white;
    box-shadow: var(--shadow-sm);
  }

  .search-wrap input:focus {
    box-shadow: 0 0 0 3px rgba(200, 146, 42, 0.15), var(--shadow-md);
  }

  /* ── RESULT / MY-DATE CARDS ──────────────────────────────── */
  #results-container {
    margin-bottom: 0.5rem;
  }

  .results {
    gap: 0.55rem;
  }

  .result-card,
  .my-card {
    padding: 0.85rem 0.95rem;
    gap: 0.85rem;
    border-radius: 14px;
    min-height: 64px;
  }

  .result-card {
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
  }

  .result-card:hover {
    transform: none;
  }

  .result-card:active {
    transform: scale(0.985);
    background: var(--cream);
  }

  .my-card {
    border-radius: 14px;
    border-inline-start-width: 3px;
  }

  .my-card:active {
    transform: scale(0.985);
  }

  .date-badge {
    min-width: 54px;
    padding: 0.5rem 0.4rem;
    border-radius: 10px;
  }

  .date-badge .day {
    font-size: 1.45rem;
  }

  .date-badge .month {
    font-size: 0.58rem;
    letter-spacing: 1.2px;
  }

  .result-name {
    font-size: 1rem;
    line-height: 1.25;
    margin-bottom: 0.15rem;
  }

  .result-desc {
    font-size: 0.78rem;
    line-height: 1.35;
  }

  .result-tag {
    font-size: 0.58rem;
    padding: 0.2rem 0.55rem;
    letter-spacing: 0.7px;
  }

  /* ── SECTION DIVIDER + TITLE ─────────────────────────────── */
  .divider {
    margin: 1.5rem 0 1.1rem;
  }

  .section-title {
    font-size: 1.15rem;
    padding-bottom: 0.85rem;
    margin-bottom: 1rem;
  }

  .section-title .btn-sm {
    padding: 0.5rem 0.95rem;
    font-size: 0.78rem;
    border-radius: 999px;
    min-height: 34px;
  }

  .empty-my {
    padding: 2rem 1.2rem;
    border-radius: 14px;
    font-size: 0.88rem;
  }

  /* ── BUTTONS: bigger tap targets ─────────────────────────── */
  .btn {
    min-height: 44px;
    padding: 0.7rem 1.3rem;
    font-size: 0.88rem;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .btn:active {
    transform: scale(0.97);
  }

  .btn-primary:hover {
    transform: none;
  }

  /* ── BOTTOM-SHEET MODALS ─────────────────────────────────── */
  .overlay {
    padding: 0;
    align-items: flex-end;
    background: rgba(26, 18, 8, 0.55);
  }

  .modal,
  .date-info-modal {
    width: 100%;
    max-height: 92vh;
    overflow-y: auto;
    padding: 1.4rem 1.25rem calc(1.25rem + env(safe-area-inset-bottom));
    border-radius: 20px 20px 0 0;
    border: none;
    border-top: 1px solid var(--border);
    animation: sheetUp 0.32s cubic-bezier(0.32, 0.72, 0, 1);
    -webkit-overflow-scrolling: touch;
  }

  /* Drag handle on top of every sheet */
  .modal::before,
  .date-info-modal::before {
    content: '';
    position: absolute;
    top: 0.55rem;
    left: 50%;
    transform: translateX(-50%);
    width: 38px;
    height: 4px;
    background: var(--border);
    border-radius: 999px;
    opacity: 0.7;
  }

  .modal {
    padding-top: 1.7rem;
  }

  .date-info-modal {
    padding-top: 0;
  }

  .date-info-scroll {
    padding-top: 1.7rem;
  }

  .close-modal {
    top: 0.95rem;
    right: 0.85rem;
    width: 36px;
    height: 36px;
  }

  .modal h2,
  .date-info-modal h3 {
    font-size: 1.3rem;
    margin-bottom: 0.4rem;
  }

  .modal .sub {
    font-size: 0.88rem;
    margin-bottom: 1.4rem;
  }

  /* Modal field tweaks */
  .field {
    margin-bottom: 1rem;
  }

  .field input,
  .field-row input,
  .profile-input,
  .profile-select {
    font-size: 16px; /* prevents iOS zoom */
    padding: 0.85rem 1rem;
    border-radius: 10px;
  }

  .date-number-row {
    gap: 0.6rem;
  }

  /* Sticky action bar feel inside sheet */
  .modal-actions {
    flex-direction: column-reverse;
    gap: 0.55rem;
    padding-top: 1rem;
    margin-top: 0.4rem;
  }

  .modal-actions .btn {
    width: 100%;
  }

  .google-auth-btn {
    height: 48px;
    border-radius: 10px;
  }

  .modal-toggle {
    margin-top: 1.1rem;
    font-size: 0.88rem;
  }

  /* Date info modal: refined sheet content */
  .date-info-modal .date-display {
    padding: 0.95rem 1rem;
    border-radius: 10px;
    font-size: 1rem;
  }

  .date-info-modal .additional-info,
  .date-info-modal .information-section {
    border-radius: 10px;
  }

  .date-info-modal .date-info-actions {
    grid-template-columns: 1fr;
  }

  /* ── TOAST: lifted above home indicator ──────────────────── */
  .toast {
    bottom: calc(1.5rem + env(safe-area-inset-bottom));
    left: 1rem;
    right: 1rem;
    transform: translateY(6rem);
    text-align: center;
    border-radius: 10px;
    font-size: 0.88rem;
    padding: 0.85rem 1rem;
  }

  .toast.show {
    transform: translateY(0);
  }
}

/* ─── EXTRA-SMALL PHONES (≤380px) ─── */
@media (max-width: 380px) {
  .hero h1 {
    font-size: 1.65rem;
  }

  .country-card .code {
    display: none;
  }

  .date-badge {
    min-width: 50px;
  }

  .date-badge .day {
    font-size: 1.3rem;
  }

  .result-name {
    font-size: 0.95rem;
  }
}

/* ─── PROFILE PAGE: mobile ─── */
@media (max-width: 720px) {
  .profile-page {
    grid-template-columns: 1fr;
    padding: 0 1rem;
    margin-top: 1.25rem;
    gap: 1rem;
  }

  .profile-aside {
    position: static;
  }

  .profile-card {
    border-radius: 16px;
  }

  .profile-section {
    border-radius: 16px;
  }

  .field-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.7rem;
  }

  .save-btn {
    width: 100%;
  }

  .danger-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.8rem;
  }

  .danger-row .btn {
    width: 100%;
  }

  .profile-card-footer .btn {
    min-height: 44px;
  }

  .theme-toggle {
    width: 100%;
  }

  .theme-option {
    flex: 1;
    justify-content: center;
    padding: 0.75rem 1rem;
    font-size: 0.88rem;
    min-height: 44px;
  }
}

/* Sheet-up animation for mobile bottom sheets */
@keyframes sheetUp {
  from {
    opacity: 0;
    transform: translateY(100%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── AUTH UI ADDITIONS ─────────────────────────────────────── */

.form-error {
  display: none;
  margin-top: 0.35rem;
  color: var(--red);
  font-size: 0.78rem;
  line-height: 1.3;
}

/* Auto-show when JS writes text — every caller would otherwise have to
   manually toggle display. Empty span stays hidden. */
.form-error:not(:empty) {
  display: block;
}

.modal-message {
  display: none;
  margin: 0.9rem 0 0.6rem;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  line-height: 1.4;
  border: 1px solid transparent;
}

.modal-message .modal-message-text {
  display: block;
}

.modal-message.state-loading {
  background: var(--cream);
  color: var(--muted);
  border-color: var(--border-light);
}

.modal-message.state-success {
  background: #e9f5e7;
  color: #2e6b2a;
  border-color: #c4e0bd;
}

.modal-message.state-error {
  background: #fdeceb;
  color: var(--red);
  border-color: #f3c8c4;
}

.forgot-row {
  display: flex;
  justify-content: flex-end;
  margin: -0.3rem 0 0.7rem;
}

.modal-link-inline {
  color: var(--gold);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 500;
}

.modal-link-inline:hover {
  text-decoration: underline;
}

.modal-toggle {
  margin-top: 0.9rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
}

.modal-toggle a {
  color: var(--gold);
  text-decoration: none;
  font-weight: 600;
  margin-left: 0.3rem;
}

.modal-toggle a:hover {
  text-decoration: underline;
}

.resend-btn {
  display: inline-block;
  margin-top: 0.55rem;
  padding: 0.4rem 0.75rem;
  background: transparent;
  border: 1px solid currentColor;
  border-radius: var(--radius-sm);
  color: inherit;
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
  transition: background 0.15s;
}

.resend-btn:hover:not(:disabled) {
  background: rgba(192, 57, 43, 0.08);
}

.resend-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

/* Profile settings — native-look controls (moved from inline styles) */
.settings-row-flex {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.65rem;
  margin-top: 0.6rem;
}
.settings-row-stack {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.55rem;
  margin-top: 0.6rem;
}
@media (min-width: 480px) {
  .settings-row-stack.settings-row-flex-wide {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
  }
}
.settings-inline-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink);
  flex-shrink: 0;
}
.settings-time-input,
.settings-date-input,
.settings-select {
  padding: 0.45rem 0.65rem;
  border-radius: 0.4rem;
  border: 1.5px solid var(--border);
  background: var(--paper);
  color: var(--ink);
  font-family: 'DM Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji';
  font-size: 0.88rem;
  min-height: 2.5rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.settings-select {
  flex: 1 1 10rem;
  min-width: 0;
  max-width: 100%;
}
.settings-time-input,
.settings-date-input {
  flex: 0 1 auto;
}
.settings-time-input:focus,
.settings-date-input:focus,
.settings-select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(200, 146, 42, 0.12);
}
body.dark-theme .settings-inline-label { color: #f5f1e8; }
body.dark-theme .settings-time-input,
body.dark-theme .settings-date-input,
body.dark-theme .settings-select {
  background: #333;
  border-color: #555;
  color: #f5f1e8;
}

.countdown-card:not([hidden]) {
  animation: fadeUp 0.55s ease both;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ─────────────────────────────────────────────────────────────────────────
   POLISH PHASE 1 — FOUNDATION (skeleton, focus ring, card hover, button feel)
   ───────────────────────────────────────────────────────────────────────── */

/* Skeleton loading — placeholder that shimmers while my-dates is fetched. */
.my-card-skeleton {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--paper, #fff);
  border: 1px solid var(--border, #e5e5e5);
  border-radius: 0.6rem;
  margin-bottom: 0.5rem;
  overflow: hidden;
  position: relative;
}
.my-card-skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(200, 146, 42, 0.08) 50%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: skeletonShimmer 1.4s ease-in-out infinite;
}
.my-card-skeleton-badge {
  width: 3rem;
  height: 3rem;
  border-radius: 0.6rem;
  background: var(--border, #e5e5e5);
  flex-shrink: 0;
}
.my-card-skeleton-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
}
.my-card-skeleton-line {
  height: 0.85rem;
  background: var(--border, #e5e5e5);
  border-radius: 0.25rem;
}
.my-card-skeleton-line.short { width: 40%; }
.my-card-skeleton-line.long  { width: 75%; }

body.dark-theme .my-card-skeleton {
  background: #2a2a2a;
  border-color: #3a3a3a;
}
body.dark-theme .my-card-skeleton-badge,
body.dark-theme .my-card-skeleton-line {
  background: #3a3a3a;
}
body.dark-theme .my-card-skeleton::after {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(200, 146, 42, 0.14) 50%,
    transparent 100%
  );
}

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

/* Global :focus-visible — keyboard navigation outline. */
button:focus-visible,
a:focus-visible,
[role="button"]:focus-visible,
.btn:focus-visible,
.language-item:focus-visible,
.country-card:focus-visible {
  outline: 2px solid var(--gold, #c8922a);
  outline-offset: 2px;
  border-radius: inherit;
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--gold, #c8922a);
  outline-offset: 0;
}

/* Card hover — only on devices with a pointer (desktop).
   Mobile taps trigger :hover persistently which feels wrong. */
@media (hover: hover) and (pointer: fine) {
  .my-card,
  .result-card {
    transition:
      border-color 150ms ease,
      box-shadow 150ms ease,
      transform 150ms ease;
  }
  .my-card:hover,
  .result-card:hover {
    border-color: rgba(200, 146, 42, 0.35);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
    transform: translateY(-1px);
  }
  body.dark-theme .my-card:hover,
  body.dark-theme .result-card:hover {
    border-color: rgba(200, 146, 42, 0.5);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
  }
}

/* Button active state — quick press feedback. Color flashes during the tap
   and snaps back on release; :active reliably clears when touch ends so
   nothing sticks. Works on mobile + desktop. */
.btn:active,
.btn-primary:active,
.btn-outline:active,
.btn-danger:active,
.btn-sm:active {
  transform: scale(0.97);
  transition: transform 80ms ease-out;
}
.btn-outline:active {
  background: var(--gold-pale);
  border-color: var(--gold);
  color: var(--gold);
}
.btn-primary:active {
  background: var(--gold);
}
.btn-danger:active {
  opacity: 0.85;
}
.wish-card-btn:active {
  background: var(--cream);
}
.wish-card-btn-primary:active {
  background: var(--gold);
  border-color: var(--gold);
}
body.dark-theme .wish-card-btn:active {
  background: #333;
}
@media (prefers-reduced-motion: reduce) {
  .btn:active { transform: none; }
}

/* Reusable pulse — opt-in via class. */
@keyframes qvellyPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.85; transform: scale(1.04); }
}

/* ─────────────────────────────────────────────────────────────────────────
   BATCH 3 — DARK-MODE PATCHES (audit-driven)
   Plugs the contrast / palette gaps the BATCH 3 dark-mode lens surfaced:
   primary CTA invisible, toast invisible, dropdown all-white, .field
   textarea/select all-white, badges/strips bleed pink, modal panels stay
   cream, toggle off-state stays cream, avatar white halo, placeholders
   missing override, mobile search SVG too-faint. Living block — keep new
   dark fixes in here so the override surface is easy to audit later.
   ───────────────────────────────────────────────────────────────────────── */
body.dark-theme .btn-primary {
  background: var(--gold);
  color: #1a1208;
  box-shadow: 0 2px 8px rgba(200, 146, 42, 0.32);
}
body.dark-theme .btn-primary:active {
  background: var(--gold-light);
}
body.dark-theme .toast {
  background: #f5f1e8;
  color: #1a1208;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}
body.dark-theme .dropdown-content {
  background: #2a2a2a;
  border-color: #3a3a3a;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
}
body.dark-theme .dropdown-content li a {
  color: #f5f1e8;
}
body.dark-theme .dropdown-content li a:hover {
  background: #333;
  color: var(--gold-light);
}
body.dark-theme .dropdown-content li:not(:last-child) {
  border-bottom-color: #3a3a3a;
}
body.dark-theme .field textarea,
body.dark-theme .field select {
  background-color: #333;
  border-color: #555;
  color: #f5f1e8;
  color-scheme: dark;
}
body.dark-theme .personal-date-badge {
  background: #44242d;
  border-color: #7f3a45;
}
body.dark-theme .my-card {
  /* Base uses border-inline-start — the override must use the matching
     logical property or it's a no-op in RTL (the strip resolves to
     border-right in RTL while border-left-color targets the wrong edge). */
  border-inline-start-color: #ff6b6b;
}
body.dark-theme .date-info-modal .additional-info,
body.dark-theme .date-info-modal .information-section {
  background: #252525;
  border-color: #3a3a3a;
}
body.dark-theme .date-info-modal .info-value {
  color: #f5f1e8;
}
body.dark-theme .date-info-modal .information-text,
body.dark-theme .date-info-modal .info-label {
  color: #b5ad9b;
}
body.dark-theme .modal-message.state-loading {
  background: #2a2a2a;
  color: #b5ad9b;
  border-color: #3a3a3a;
}
body.dark-theme .modal-message.state-success {
  background: #1b3320;
  color: #8ed79a;
  border-color: #2e5b39;
}
body.dark-theme .modal-message.state-error {
  background: #3a1f1c;
  color: #ff8a82;
  border-color: #6b302a;
}
body.dark-theme .toggle-switch {
  background: #4a4a4a;
}
body.dark-theme .profile-card .avatar,
body.dark-theme .avatar-edit-btn {
  border-color: #2d2d2d;
}
body.dark-theme .search-wrap input::placeholder {
  color: #8a8275;
}
body.dark-theme .search-wrap::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b5ad9b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
}

/* ─────────────────────────────────────────────────────────────────────────
   POLISH PHASE 2 — BANNERS (smart suggestion icon, onthisday accent, glow)
   Cursor already shipped most of the banner polish in this CSS file. These
   are the finishing touches that were still missing.
   ───────────────────────────────────────────────────────────────────────── */

/* Smart suggestion banner — leading SVG-free accent.
   Emoji removed per user request (kept emojis only on My Dates cards). */

/* OnThisDay widget — gold accent on the header so it stands out among the
   other cards in the home stream. Cursor added the events styling but
   not the header treatment. */
.onthisday-widget {
  border-inline-start: 3px solid transparent;
  transition: border-color 200ms ease;
}
.onthisday-widget:not(.onthisday-collapsed) {
  border-inline-start-color: var(--gold);
}
.onthisday-event {
  border-inline-start: 2px solid transparent;
  transition:
    background 150ms ease,
    border-color 150ms ease,
    padding-inline-start 150ms ease;
}
@media (hover: hover) and (pointer: fine) {
  .onthisday-event:hover {
    border-inline-start-color: var(--gold);
    padding-inline-start: 0.85rem;
  }
}

/* Activity feed banner — subtle glow lift on hover (desktop only).
   Mobile gets the existing border-color tint. */
@media (hover: hover) and (pointer: fine) {
  .activity-feed-banner:hover {
    box-shadow:
      0 4px 18px rgba(200, 146, 42, 0.18),
      0 0 0 1px rgba(200, 146, 42, 0.25);
  }
}

/* Holiday pack banner — small flag-ish stripe pattern on the left so it
   reads "country pack" instead of "another generic banner". Diagonal
   stripes via repeating gradient, CSS only. */
.holiday-pack-banner::before {
  content: '';
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: 4px;
  background: repeating-linear-gradient(
    45deg,
    var(--gold) 0,
    var(--gold) 4px,
    rgba(200, 146, 42, 0.5) 4px,
    rgba(200, 146, 42, 0.5) 8px
  );
  border-start-start-radius: 0.6rem;
  border-end-start-radius: 0.6rem;
  pointer-events: none;
}

/* ─────────────────────────────────────────────────────────────────────────
   POLISH PHASE 3 — CARDS & BADGES (turning shimmer, chip ring, search arrow)
   ───────────────────────────────────────────────────────────────────────── */

/* Turning badge — emoji prefix + subtle shimmer for premium feel.
   The default emoji is 🎂 (birthday); JS can swap to 💝 (anniversary)
   or 🎉 (generic) by adding modifier classes if desired. CSS-only path
   uses the default. */
.turning-badge::before {
  content: '';
  display: inline-block;
  width: 0.9em;
  height: 0.9em;
  margin-inline-end: 0.35rem;
  vertical-align: -0.1em;
  background: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23c8922a'><path d='M12 2.5l2.95 6.36 6.8.77-5.05 4.62 1.35 6.75L12 17.9l-6 3.1 1.35-6.75L2.3 9.63l6.8-.77z'/></svg>") no-repeat center / contain;
}

.turning-badge {
  position: relative;
  overflow: hidden;
}
.turning-badge::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 30%,
    rgba(255, 255, 255, 0.4) 50%,
    transparent 70%
  );
  background-size: 200% 100%;
  animation: turningShimmer 3.2s ease-in-out infinite;
  pointer-events: none;
  border-radius: inherit;
}
body.dark-theme .turning-badge::after {
  background: linear-gradient(
    105deg,
    transparent 30%,
    rgba(255, 255, 255, 0.12) 50%,
    transparent 70%
  );
  background-size: 200% 100%;
}
@keyframes turningShimmer {
  0%, 60%, 100% { background-position: 200% 0; }
  80%           { background-position: -200% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .turning-badge::after { animation: none; opacity: 0.5; }
}

/* Filter chip active state — gold glow ring on the outside.
   Cursor added box-shadow already; this layers an additional
   outline ring for accessibility + visual punch. */
.filter-chip.active {
  box-shadow:
    0 2px 8px rgba(200, 146, 42, 0.28),
    0 0 0 3px rgba(200, 146, 42, 0.18);
}

/* Search filter select — custom chevron arrow so the native OS arrow
   doesn't break the brand. Hide the native arrow with appearance:none,
   draw our own with a gradient triangle. */
.search-filter-select {
  appearance: none;
  -webkit-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--gold) 50%),
    linear-gradient(135deg, var(--gold) 50%, transparent 50%);
  background-position:
    calc(100% - 14px) 50%,
    calc(100% - 9px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  padding-inline-end: 1.85rem;
}
[dir="rtl"] .search-filter-select {
  background-position:
    14px 50%,
    9px 50%;
  padding-inline-end: 0.5rem;
  padding-inline-start: 1.85rem;
}

/* Shared card — "Shared" micro-label so it's instantly obvious this is
   someone else's date. Sits in the top-right corner of the card.
   Label is sourced from data-shared-label="..." which JS sets to the
   localized string in loadSharedDates(). No CSS fallback so non-English
   users never see hardcoded English text. */
.shared-card {
  position: relative;
}
.shared-card[data-shared-label]::after {
  content: attr(data-shared-label);
  position: absolute;
  top: 0.4rem;
  inset-inline-end: 0.5rem;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--gold);
  background: rgba(200, 146, 42, 0.12);
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  pointer-events: none;
}
body.dark-theme .shared-card[data-shared-label]::after {
  background: rgba(200, 146, 42, 0.22);
  color: var(--gold-light, #e8c474);
}

/* ─────────────────────────────────────────────────────────────────────────
   POLISH PHASE 4 — PROFILE MODALS (update urgency, share copy, following)
   ───────────────────────────────────────────────────────────────────────── */

/* Update required modal — slow pulsing gold border to subtly convey "this
   is mandatory, do it now". Cursor added the static box-shadow ring; this
   animates that ring. Disabled under reduced-motion. */
#update-required-modal .modal {
  animation: updateRequiredPulse 2.4s ease-in-out infinite;
}
@keyframes updateRequiredPulse {
  0%, 100% {
    box-shadow:
      0 0 0 4px rgba(200, 146, 42, 0.18),
      0 14px 40px rgba(0, 0, 0, 0.12);
  }
  50% {
    box-shadow:
      0 0 0 6px rgba(200, 146, 42, 0.32),
      0 18px 50px rgba(200, 146, 42, 0.18);
  }
}
@media (prefers-reduced-motion: reduce) {
  #update-required-modal .modal { animation: none; }
}

/* Update required modal — leading ⚠️ icon next to the title for instant
   "this is important" signaling. */
/* Update modal + share code emojis removed per user request — emojis only
   live on My Dates cards now. The pulsing border on the required-update
   modal is enough urgency signal on its own. */

/* Following row — avatar circle with the first letter of the friend's
   name. JS already sets data-initial on the row (or we fall back to a
   neutral circle). Lives before the name text. */
.following-row {
  position: relative;
}
.following-row .following-name {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}
.following-row .following-name::before {
  content: attr(data-initial);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--gold-pale, rgba(200,146,42,0.18)), rgba(200,146,42,0.06));
  border: 1.5px solid rgba(200, 146, 42, 0.4);
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  flex-shrink: 0;
}
/* If JS didn't set data-initial, hide the circle entirely (no empty bubble) */
.following-row .following-name:not([data-initial])::before { display: none; }

body.dark-theme .following-row .following-name::before {
  background: #333;
  border-color: rgba(200, 146, 42, 0.5);
  color: var(--gold-light, #e8c474);
}

/* Hover/active border-inline-start accent — affordance for "this row is
   tappable" even before the friend interacts with it. */
@media (hover: hover) and (pointer: fine) {
  .following-row {
    border-inline-start: 3px solid transparent;
    padding-inline-start: 0.55rem;
    transition:
      border-color 150ms ease,
      background 150ms ease,
      box-shadow 150ms ease;
  }
  .following-row:hover {
    border-inline-start-color: var(--gold);
    background: rgba(200, 146, 42, 0.06);
  }
}

/* Report bug — Send button disabled state (when textarea empty / over limit)
   gets clear visual treatment. Cursor added the form, this is the polish. */
#report-bug-send-btn[disabled],
#report-bug-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}
/* Match JS-applied class name (is-near-limit) — Cursor's earlier rule
   at the top of the file uses the same class but with a softer gold; this
   one bumps it to red + bold when the user is at >=90% of the cap. */
.report-bug-char-count.is-near-limit {
  color: var(--red);
  font-weight: 600;
}

/* Password / email change — input label hierarchy bump so the form
   feels structured rather than a wall of fields. */
#password-change-modal .field label,
#email-change-modal .field label {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: var(--muted);
  text-transform: uppercase;
}
body.dark-theme #password-change-modal .field label,
body.dark-theme #email-change-modal .field label {
  color: #b5ad9b;
}

/* ─────────────────────────────────────────────────────────────────────────
   POLISH PHASE 5 — CUSTOM SELECT (qvelly-select component)

   Replaces the OS-native <select> dropdown (Android wheel, iOS scroll
   picker, browser <select>) with a Qvelly-branded popover. The native
   <select> stays in the DOM (visually hidden) so existing .value /
   .onchange handlers continue to work unchanged.

   Usage:
     <select id="..." data-qvelly-select ...>
       <option value="..." data-key-option="...">Label</option>
     </select>

   The qvelly-select.js controller picks these up at boot, hides the
   native element, and renders the custom UI in place.
   ───────────────────────────────────────────────────────────────────────── */

/* Native <select> AND <input type="time"/"date"> visually hidden but still
   part of the form — we use its .value for getter/setter and dispatch change
   events on it. enhanceTime()/enhanceDate() add the class to an <input>, not a
   <select>, so the selector MUST cover both element types — otherwise the
   native OS time/date picker stays visible and tappable beside the custom UI. */
select.qvelly-select-native,
input.qvelly-select-native {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.qvelly-select {
  position: relative;
  display: inline-flex;
  width: 100%;
  font-family: inherit;
}

.qvelly-select-trigger {
  appearance: none;
  -webkit-appearance: none;
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  background: var(--paper, #fff);
  border: 1.5px solid var(--border, #ccc);
  border-radius: 0.4rem;
  color: var(--ink, var(--text));
  font: inherit;
  font-size: 0.88rem;
  line-height: 1.3;
  cursor: pointer;
  min-height: 2.5rem;
  text-align: start;
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease,
    background 150ms ease;
}
.qvelly-select-trigger:active {
  border-color: var(--gold);
  background: var(--gold-pale);
}
@media (hover: hover) and (pointer: fine) {
  .qvelly-select-trigger:hover {
    border-color: var(--gold);
  }
}
.qvelly-select-trigger:focus-visible {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(200, 146, 42, 0.18);
}
.qvelly-select.is-open .qvelly-select-trigger {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(200, 146, 42, 0.18);
  background: var(--gold-pale);
}

.qvelly-select-value {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qvelly-select-chevron {
  flex-shrink: 0;
  width: 0.5rem;
  height: 0.5rem;
  border-inline-end: 2px solid var(--gold);
  border-bottom: 2px solid var(--gold);
  transform: rotate(45deg);
  margin-top: -0.2rem;
  transition: transform 200ms ease;
}
.qvelly-select.is-open .qvelly-select-chevron {
  transform: rotate(-135deg);
  margin-top: 0.15rem;
}

.qvelly-select-menu {
  position: absolute;
  top: calc(100% + 6px);
  inset-inline-start: 0;
  inset-inline-end: 0;
  z-index: 1000;
  max-height: 60vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  /* Pure white (not cream --paper) so the popover reads as clearly floating
     ABOVE the cream settings cards instead of blending into them. The stronger,
     neutral drop-shadow reinforces the elevation. */
  background: #ffffff;
  border: 1.5px solid var(--gold);
  border-radius: 0.6rem;
  box-shadow: 0 16px 40px rgba(26, 18, 8, 0.28), 0 6px 14px rgba(26, 18, 8, 0.16);
  padding: 0.3rem 0;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}
.qvelly-select-menu[hidden] {
  display: none;
}
.qvelly-select.is-open .qvelly-select-menu {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
/* Flip above the trigger when there isn't room below (set by openMenu). */
.qvelly-select-menu.opens-up {
  top: auto;
  bottom: calc(100% + 6px);
  transform: translateY(6px);
}
.qvelly-select.is-open .qvelly-select-menu.opens-up {
  transform: translateY(0);
}

.qvelly-select-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.85rem;
  font-size: 0.88rem;
  line-height: 1.3;
  color: var(--ink, var(--text));
  cursor: pointer;
  transition: background 100ms ease;
  -webkit-tap-highlight-color: transparent;
}
.qvelly-select-option.is-active {
  background: var(--gold-pale);
}
@media (hover: hover) and (pointer: fine) {
  .qvelly-select-option:hover {
    background: var(--gold-pale);
  }
}
.qvelly-select-option:active {
  background: var(--gold-pale);
}
.qvelly-select-option.is-selected {
  font-weight: 600;
  background: var(--gold-pale);
  color: var(--gold-dark);
}
.qvelly-select-option:focus-visible {
  outline: none;
  background: rgba(200, 146, 42, 0.14);
}
.qvelly-select-check {
  flex-shrink: 0;
  color: var(--gold);
  font-weight: 700;
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 150ms ease, transform 150ms ease;
}
.qvelly-select-option.is-selected .qvelly-select-check {
  opacity: 1;
  transform: scale(1);
}

/* Dark mode */
body.dark-theme .qvelly-select-trigger {
  background: #2a2a2a;
  border-color: #3a3a3a;
  color: #f5f1e8;
}
body.dark-theme .qvelly-select.is-open .qvelly-select-trigger,
body.dark-theme .qvelly-select-trigger:active {
  background: rgba(200, 146, 42, 0.14);
  border-color: var(--gold);
}
body.dark-theme .qvelly-select-menu {
  background: #1f1f1f;
  border-color: var(--gold);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
}
body.dark-theme .qvelly-select-option {
  color: #f5f1e8;
}
body.dark-theme .qvelly-select-option.is-active {
  background: rgba(200, 146, 42, 0.18);
}
@media (hover: hover) and (pointer: fine) {
  body.dark-theme .qvelly-select-option:hover {
    background: rgba(200, 146, 42, 0.18);
  }
}
body.dark-theme .qvelly-select-option:active {
  background: rgba(200, 146, 42, 0.22);
}
body.dark-theme .qvelly-select-option.is-selected {
  background: rgba(200, 146, 42, 0.18);
  color: var(--gold-light, #e8c474);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .qvelly-select-trigger,
  .qvelly-select-menu,
  .qvelly-select-chevron,
  .qvelly-select-check {
    transition: none;
  }
}

/* HH:MM is universal clock notation — pin LTR even in RTL pages so the
   hour stays on the left and minute on the right (matches clock faces). */
.qvelly-time {
  direction: ltr;
  unicode-bidi: isolate;
}

/* ─────────────────────────────────────────────────────────────────────────
   POLISH PHASE 6 — CUSTOM TIME INPUT (HH:MM via two qvelly-selects)
   ───────────────────────────────────────────────────────────────────────── */

.qvelly-time {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: inherit;
}
.qvelly-time-col {
  flex: 0 0 auto;
  min-width: 4rem;
}
.qvelly-time-col .qvelly-select {
  min-width: 4rem;
}

/* Custom date input (day / month / year via three qvelly-selects) — mirrors
   the .qvelly-time layout. Used by Travel mode "Resume on". */
.qvelly-date {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: inherit;
  flex-wrap: wrap;
}
.qvelly-date-col {
  flex: 0 0 auto;
  min-width: 3.6rem;
}
.qvelly-date-col:nth-child(2) { min-width: 4.6rem; } /* month label is wider */
.qvelly-date-col:nth-child(3) { min-width: 5rem; }   /* 4-digit year */
.qvelly-date-col .qvelly-select {
  min-width: 100%;
}
.qvelly-date .qvelly-select-menu {
  max-height: 12.5rem; /* compact scroll list so it doesn't sprawl over rows */
}
.qvelly-date .qvelly-select-option,
.qvelly-time .qvelly-select-option {
  padding: 0.4rem 0.7rem; /* tighter than the 0.55rem default → shorter menu */
  justify-content: center; /* centered values read cleaner in the narrow cols */
}
.qvelly-date .qvelly-select-check { display: none; }
.qvelly-time-sep {
  color: var(--ink, var(--text));
  font-weight: 600;
  font-size: 1.1rem;
  line-height: 1;
  user-select: none;
  pointer-events: none;
}
body.dark-theme .qvelly-time-sep {
  color: #f5f1e8;
}

/* Time-picker dropdown body — scrolly column of HH or MM values, narrower
   than the language picker since they're 2-character entries */
.qvelly-time .qvelly-select-menu {
  max-height: 12.5rem;
}
.qvelly-time .qvelly-select-option {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum';
  justify-content: center;
}
.qvelly-time .qvelly-select-check { display: none; }

/* Reminder time input inside add/edit date modal — sizes the qvelly-time
   wrapper consistently with the other reminder row controls. */
.reminder-row .qvelly-time {
  margin-inline-start: auto;
}
/* Belt-and-suspenders: the native reminder <input type="time"> is hidden by
   the shared .qvelly-select-native rule above; this keeps it clipped even if
   the class is ever dropped from the markup. */
.reminder-time-input.qvelly-select-native {
  position: absolute; opacity: 0; pointer-events: none;
  width: 1px; height: 1px; margin: 0; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0);
}

/* ─────────────────────────────────────────────────────────────────────────
   POLISH PHASE 7 — DARK THEME CONSISTENCY + MISSED OVERRIDES
   ───────────────────────────────────────────────────────────────────────── */

/* Holiday pack stripe pattern dark variant — gold-on-gold contrast is fine
   in light mode but darken slightly for dark theme so it doesn't glow too
   bright against the panel. */
body.dark-theme .holiday-pack-banner::before {
  background: repeating-linear-gradient(
    45deg,
    var(--gold) 0,
    var(--gold) 4px,
    rgba(200, 146, 42, 0.35) 4px,
    rgba(200, 146, 42, 0.35) 8px
  );
}

/* Update required pulse — slightly stronger pulse in dark since the lower
   ambient brightness makes the static ring feel weaker. */
body.dark-theme #update-required-modal .modal {
  animation: updateRequiredPulseDark 2.4s ease-in-out infinite;
}
@keyframes updateRequiredPulseDark {
  0%, 100% {
    box-shadow:
      0 0 0 4px rgba(200, 146, 42, 0.28),
      0 14px 40px rgba(0, 0, 0, 0.5);
  }
  50% {
    box-shadow:
      0 0 0 7px rgba(200, 146, 42, 0.42),
      0 18px 50px rgba(200, 146, 42, 0.22);
  }
}
@media (prefers-reduced-motion: reduce) {
  body.dark-theme #update-required-modal .modal { animation: none; }
}

/* Activity feed banner glow — dark mode amber tint */
@media (hover: hover) and (pointer: fine) {
  body.dark-theme .activity-feed-banner:hover {
    box-shadow:
      0 4px 18px rgba(200, 146, 42, 0.28),
      0 0 0 1px rgba(200, 146, 42, 0.4);
  }
}

/* OnThisDay event accent — dark mode contrast bump */
body.dark-theme .onthisday-event {
  border-inline-start: 2px solid transparent;
}
@media (hover: hover) and (pointer: fine) {
  body.dark-theme .onthisday-event:hover {
    border-inline-start-color: var(--gold-light, #e8c474);
  }
}

/* Shared card "Shared" pill — dark variant already done, but ensure the
   ribbon doesn't get clipped by the my-card overflow. */
.shared-card {
  overflow: visible;
}

/* Following row avatar — slightly stronger gold in dark for legibility */
body.dark-theme .following-row .following-name::before {
  background: linear-gradient(145deg, #3a2f1a, #2a2218);
}

/* qvelly-select trigger — disabled state (when a select sets disabled
   attr, the custom trigger should reflect it). */
.qvelly-select-trigger[disabled],
.qvelly-select-trigger:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* qvelly-time gap between hour and minute should breathe more on tablet+ */
@media (min-width: 768px) {
  .qvelly-time { gap: 0.5rem; }
  .qvelly-time-col { min-width: 4.5rem; }
}

/* Time picker option list — narrower min-width so it doesn't span the row */
.qvelly-time .qvelly-select-menu {
  min-width: 4.5rem;
}

/* Smart suggestion banner — extra subtle inner gold tint on hover so users
   know it's interactive (cards on home stream all share that affordance). */
@media (hover: hover) and (pointer: fine) {
  .smart-suggestion-banner {
    transition: background 200ms ease, border-color 200ms ease;
  }
  .smart-suggestion-banner:hover {
    background: linear-gradient(135deg, rgba(200, 146, 42, 0.12) 0%, rgba(200, 146, 42, 0.06) 100%);
    border-color: rgba(200, 146, 42, 0.55);
  }
  body.dark-theme .smart-suggestion-banner:hover {
    background: linear-gradient(135deg, #2f2517 0%, rgba(200, 146, 42, 0.18) 100%);
  }
}

/* ─────────────────────────────────────────────────────────────────────────
   POLISH PHASE 8 — RTL + A11Y FINAL + EMPTY STATES + LOADING SPINNER
   ───────────────────────────────────────────────────────────────────────── */

/* ── A11y: visually-hidden helper (sr-only). Used by HTML to provide
   screen-reader-only labels without affecting layout. */
.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;
}

/* ── Loading spinner — branded, reusable. Add .qvelly-spinner to any
   element to make it spin (default: 1.5rem diameter, gold). */
.qvelly-spinner {
  display: inline-block;
  width: 1.5rem;
  height: 1.5rem;
  border: 2.5px solid rgba(200, 146, 42, 0.25);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: qvellySpin 0.8s linear infinite;
  vertical-align: middle;
}
.qvelly-spinner.qvelly-spinner-sm {
  width: 1rem;
  height: 1rem;
  border-width: 2px;
}
.qvelly-spinner.qvelly-spinner-lg {
  width: 2.5rem;
  height: 2.5rem;
  border-width: 3px;
}
@keyframes qvellySpin {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .qvelly-spinner { animation-duration: 3s; }
}

/* Inline spinner inside buttons (when a button is in working state) */
.btn .qvelly-spinner {
  width: 1rem;
  height: 1rem;
  border-width: 2px;
  margin-inline-end: 0.4rem;
  vertical-align: -2px;
  border-top-color: currentColor;
  border-color: rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
}
.btn.btn-outline .qvelly-spinner {
  border-color: rgba(200, 146, 42, 0.25);
  border-top-color: var(--gold);
}

/* ── Empty state — friendly placeholder when My Dates is empty. The
   existing .empty-my from Cursor's work. Enhance it with a centered
   illustration-area + CTA button styling. */
.empty-my {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--muted);
}
.empty-my::before {
  content: '';
  display: block;
  width: 2.5rem;
  height: 2.5rem;
  margin: 0 auto 0.7rem;
  background: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c8922a' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='4.5' width='18' height='16' rx='2'/><path d='M3 9.5h18M8 2.5v4M16 2.5v4'/></svg>") no-repeat center / contain;
  opacity: 0.45;
}
.empty-my small {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.82rem;
  opacity: 0.85;
}
.empty-my-cta {
  margin-top: 1.1rem;
  padding: 0.6rem 1.4rem;
  font-size: 0.86rem;
}

/* Same treatment for search "no results" — emoji removed per user request */
.no-result {
  text-align: center;
  padding: 1.5rem 1rem;
  color: var(--muted);
  font-size: 0.92rem;
}

/* Following empty state — emoji removed */

/* ── RTL final pass — any remaining left/right that needs logical pair ── */

/* Modal close button — was already RTL'd via inset-inline-end in earlier
   passes; double-check the swipe-to-dismiss inner doesn't push X off-screen */
[dir="rtl"] .close-modal {
  inset-inline-end: 0.75rem;
  inset-inline-start: auto;
}

/* qvelly-select RTL: chevron points to the start side natively, but the
   menu padding-end should mirror */
[dir="rtl"] .qvelly-select-option {
  text-align: right;
}

/* Search input clear / icon — if any, hint future polish */
[dir="rtl"] .search-history {
  text-align: right;
}

/* ── Focus-visible for qvelly-select option (keyboard) so it gets the
   ring same as the trigger does */
.qvelly-select-option:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: -2px;
  background: rgba(200, 146, 42, 0.18);
}

/* ── Toast aria-live polish: ensure the existing toast can be announced
   by screen readers when its class becomes .show */
.toast {
  /* keep existing positional styles, just ensure SR-friendly attributes
     on the element (role="status" + aria-live="polite" should be added
     in HTML if not yet). */
}

/* ── prefers-color-scheme follow — if user hasn't set theme manually but
   the OS prefers dark, gently apply the dark theme by default. Manual
   theme toggle still wins via body class. */
@media (prefers-color-scheme: dark) {
  html:not(.theme-locked) body:not(.dark-theme):not(.light-theme) {
    /* No-op stub — actual auto-flip lives in JS (theme detection).
       This media query reserved for any CSS-only fallback we add later. */
  }
}

/* ───────── CELEBRATE (DAY-OF) MODAL ──────────────────────────────────
   Magical day-of experience: opens when user taps the PN that fires
   on the event day. Combines AI wish + 1-tap send to WhatsApp/SMS/
   Copy/native Share. */
.celebrate-modal {
  max-width: 480px;
  padding: 1.5rem 1.4rem 1.2rem;
  text-align: center;
  background: linear-gradient(160deg, var(--gold-pale) 0%, var(--paper) 65%);
}
.celebrate-confetti {
  margin: 0.2rem 0 0.4rem;
  display: inline-flex;
  animation: celebrate-pop 600ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.celebrate-confetti svg {
  display: block;
}
@keyframes celebrate-pop {
  0% { transform: scale(0.6) rotate(-12deg); opacity: 0; }
  60% { transform: scale(1.15) rotate(8deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}
.celebrate-eyebrow {
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--gold-dark);
  margin-bottom: 0.35rem;
}
.celebrate-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.15;
  margin: 0 0 1.1rem;
}
.celebrate-recipient-field {
  text-align: start;
  margin-bottom: 0.8rem;
}
.celebrate-wish-wrap {
  position: relative;
  background: white;
  border: 1px solid var(--gold-pale);
  border-radius: var(--radius);
  padding: 1rem 2.4rem 1rem 1rem;
  margin-bottom: 1.1rem;
  text-align: start;
  min-height: 3.2rem;
}
.celebrate-wish {
  font-size: 0.98rem;
  line-height: 1.5;
  color: var(--ink);
  white-space: pre-wrap;
  word-wrap: break-word;
}
.celebrate-wish.is-loading {
  color: var(--muted);
  font-style: italic;
}
.celebrate-wish-refresh {
  position: absolute;
  top: 8px;
  inset-inline-end: 8px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--gold-pale);
  background: var(--paper);
  color: var(--gold-dark);
  font-size: 1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.4s, background 0.15s;
  line-height: 1;
}
.celebrate-wish-refresh:hover {
  background: var(--gold-pale);
}
.celebrate-wish-refresh.is-spinning {
  transform: rotate(360deg);
}
.celebrate-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-bottom: 0.8rem;
}
.celebrate-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 0.7rem;
  border: 1px solid var(--border);
  background: white;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.15s, border-color 0.15s;
  min-height: 48px;
}
.celebrate-btn:hover {
  border-color: var(--gold);
  box-shadow: 0 2px 8px rgba(200, 146, 42, 0.12);
}
.celebrate-btn:active {
  transform: translateY(1px);
}
.celebrate-btn svg {
  flex-shrink: 0;
}
.celebrate-foot {
  margin-top: 0.4rem;
}
.celebrate-foot .btn-ghost {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 0.85rem;
  text-decoration: underline;
  cursor: pointer;
  padding: 0.4rem 0.6rem;
}
.celebrate-foot .btn-ghost:hover {
  color: var(--ink);
}

/* Dark mode */
body.dark-theme .celebrate-modal {
  background: linear-gradient(160deg, rgba(232, 184, 75, 0.15) 0%, #2a2a2a 65%);
  color: #f5f1e8;
}
body.dark-theme .celebrate-eyebrow {
  color: var(--gold-light);
}
body.dark-theme .celebrate-title {
  color: #f5f1e8;
}
body.dark-theme .celebrate-wish-wrap {
  background: #2d2d2d;
  border-color: #444;
}
body.dark-theme .celebrate-wish {
  color: #f5f1e8;
}
body.dark-theme .celebrate-wish-refresh {
  background: #2a2a2a;
  border-color: #444;
  color: var(--gold-light);
}
body.dark-theme .celebrate-wish-refresh:hover {
  background: rgba(232, 184, 75, 0.18);
}
body.dark-theme .celebrate-btn {
  background: #2d2d2d;
  border-color: #444;
  color: #f5f1e8;
}
body.dark-theme .celebrate-btn:hover {
  border-color: var(--gold-light);
}
body.dark-theme .celebrate-foot .btn-ghost {
  color: #b5ad9b;
}
body.dark-theme .celebrate-foot .btn-ghost:hover {
  color: #f5f1e8;
}

/* Mobile: stack buttons full-width on very narrow screens */
@media (max-width: 360px) {
  .celebrate-grid {
    grid-template-columns: 1fr;
  }
}

/* ── VOICE INPUT (add-modal) ── */
.voice-input-btn {
  width: 100%;
  margin-bottom: 0.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-size: 0.95rem;
}
.voice-status {
  margin: -0.3rem 0 0.7rem;
  font-size: 0.85rem;
  padding: 0.5rem 0.7rem;
  border-radius: var(--radius-sm);
  text-align: center;
}
.voice-status.is-listening {
  background: rgba(200, 146, 42, 0.1);
  color: var(--gold-dark);
}
.voice-status.is-listening::before {
  content: '';
  display: inline-block;
  width: 1em;
  height: 1em;
  margin-inline-end: 0.35em;
  vertical-align: -0.15em;
  background: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a8770f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='9' y='2' width='6' height='12' rx='3'/><path d='M5 11a7 7 0 0 0 14 0M12 18v3'/></svg>") no-repeat center / contain;
}
.voice-status.is-thinking {
  background: rgba(200, 146, 42, 0.08);
  color: var(--muted);
  font-style: italic;
}
.voice-status.is-success {
  background: rgba(74, 144, 226, 0.08);
  color: #2c5e8e;
}
.voice-status.is-error {
  background: rgba(217, 83, 79, 0.08);
  color: #b03a35;
}
body.dark-theme .voice-status.is-listening { background: rgba(232, 184, 75, 0.15); color: var(--gold-light); }
body.dark-theme .voice-status.is-thinking { background: rgba(232, 184, 75, 0.08); color: #b5ad9b; }
body.dark-theme .voice-status.is-success { background: rgba(124, 179, 255, 0.12); color: #7cb3ff; }
body.dark-theme .voice-status.is-error { background: rgba(255, 140, 130, 0.12); color: #ff8c82; }

/* ── YEAR-IN-REVIEW STATS (profile.html) ──
   2×2 grid of metric cards under the Qvelly section. Shown only when
   the user has at least one personal date. Footnote teases the full
   YIR experience scheduled for December. */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}
.stat-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 0.9rem;
  text-align: center;
}
.stat-value {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1.1;
  margin-bottom: 0.15rem;
}
.stat-label {
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: lowercase;
  letter-spacing: 0.2px;
}
.stats-footnote {
  margin-top: 0.7rem;
  font-size: 0.78rem;
  color: var(--muted);
  font-style: italic;
  text-align: center;
}
body.dark-theme .stat-card {
  background: #2a2a2a;
  border-color: #444;
}
body.dark-theme .stat-value {
  color: var(--gold-light);
}
body.dark-theme .stat-label,
body.dark-theme .stats-footnote {
  color: #b5ad9b;
}

/* ── CELEBRATE GIFT IDEAS (collapsible) ── */
.celebrate-gifts {
  margin: 0 0 1rem;
  text-align: start;
  border: 1px solid var(--gold-pale);
  border-radius: var(--radius);
  background: white;
  overflow: hidden;
}
.celebrate-gifts-summary {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.8rem 1rem;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
  list-style: none;
  user-select: none;
}
.celebrate-gifts-summary::-webkit-details-marker { display: none; }
.celebrate-gifts-icon {
  font-size: 1.15rem;
  line-height: 1;
}
.celebrate-gifts-label {
  flex: 1;
}
.celebrate-gifts-chevron {
  color: var(--gold-dark);
  font-size: 1.1rem;
  transition: transform 0.2s;
}
.celebrate-gifts[open] .celebrate-gifts-chevron {
  transform: rotate(90deg);
}
.celebrate-gifts-body {
  padding: 0 1rem 0.9rem;
  border-top: 1px solid var(--gold-pale);
}
.celebrate-gifts-loading {
  padding: 1rem 0;
  font-size: 0.9rem;
  font-style: italic;
  color: var(--muted);
  text-align: center;
}
.celebrate-gifts-fail {
  padding: 0.9rem 0;
  font-size: 0.88rem;
  color: var(--muted);
  text-align: center;
}
.celebrate-gifts-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.6rem;
}
.celebrate-gift-card {
  display: block;
  width: 100%;
  text-align: start;
  padding: 0.7rem 0.9rem;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
  font-family: inherit;
}
.celebrate-gift-card:hover {
  border-color: var(--gold);
  box-shadow: 0 2px 8px rgba(200, 146, 42, 0.12);
}
.celebrate-gift-card:active {
  transform: translateY(1px);
}
.celebrate-gift-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
}
.celebrate-gift-hint {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 0.2rem;
  line-height: 1.3;
}

/* Dark mode */
body.dark-theme .celebrate-gifts {
  background: #2d2d2d;
  border-color: #444;
}
body.dark-theme .celebrate-gifts-summary {
  color: #f5f1e8;
}
body.dark-theme .celebrate-gifts-body {
  border-top-color: #444;
}
body.dark-theme .celebrate-gifts-chevron {
  color: var(--gold-light);
}
body.dark-theme .celebrate-gift-card {
  background: #2a2a2a;
  border-color: #444;
}
body.dark-theme .celebrate-gift-card:hover {
  border-color: var(--gold-light);
}
body.dark-theme .celebrate-gift-title {
  color: #f5f1e8;
}
body.dark-theme .celebrate-gift-hint {
  color: #b5ad9b;
}
body.dark-theme .celebrate-gifts-loading,
body.dark-theme .celebrate-gifts-fail {
  color: #b5ad9b;
}

/* RTL: rotate chevron the other way */
[dir="rtl"] .celebrate-gifts-chevron {
  transform: scaleX(-1);
}
[dir="rtl"] .celebrate-gifts[open] .celebrate-gifts-chevron {
  transform: scaleX(-1) rotate(90deg);
}
