/* =============================================================================
   NAPLOPÓ v5 PWA – style.css
   Playfair Display + JetBrains Mono + Lora
   Meleg, intim, romantikus sötét · alapszín #DAA06D, rózsa, zöld akcentus
   ============================================================================= */


/* =============================================================================
   1. CSS VÁLTOZÓK & ALAP RESET
   ============================================================================= */

:root {
  /* Alap háttér és felszínek */
  --bg:           #090705;
  --surface-1:    rgba(18, 14, 11, 0.98);
  --surface-2:    rgba(24, 19, 15, 0.96);
  --surface-3:    rgba(32, 26, 20, 0.92);
  --glass:        rgba(255, 236, 216, 0.04);

  /* Shell (PWA keret, fejléc vonal) */
  --shell-line:   rgba(218, 160, 109, 0.1);

  /* Szöveg */
  --text-1:       #f6eee4;
  --text-2:       #b09a88;
  --text-3:       rgba(245, 237, 224, 0.25);
  --text-inv:     #080808;

  /* Akcentus – alap #DAA06D + rózsa */
  --amber:        #daa06d;
  --amber-light:  #ecc9a4;
  --amber-dim:    rgba(218, 160, 109, 0.15);
  --amber-glow:   rgba(218, 160, 109, 0.08);

  --rose:         #c45c7a;
  --rose-light:   #e07898;
  --rose-dim:     rgba(196, 92, 122, 0.15);
  --rose-glow:    rgba(196, 92, 122, 0.08);

  --sage:         #6b9e7a;
  --sage-light:   #8ec19e;
  --sage-dim:     rgba(107, 158, 122, 0.15);

  /* Hibaszín */
  --error:        #c44a4a;
  --error-dim:    rgba(196, 74, 74, 0.15);

  /* Szegélyek */
  --border:       rgba(245, 237, 224, 0.08);
  --border-mid:   rgba(245, 237, 224, 0.14);
  --border-hi:    rgba(245, 237, 224, 0.25);

  /* Heatmap */
  --cell-empty:     rgba(245, 237, 224, 0.04);
  --cell-meeting:   var(--sage);
  --cell-special:   var(--amber);

  /* Betűkészletek */
  --font-display: 'Playfair Display', Georgia, serif;
  --font-mono:    'JetBrains Mono', 'Courier New', monospace;
  --font-body:    'Lora', Georgia, serif;

  /* Easing */
  --ease-out:     cubic-bezier(0.16, 1, 0.3, 1);
  --ease-bounce:  cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth:  cubic-bezier(0.4, 0, 0.2, 1);

  /* Spacing */
  --sp-05: 0.25rem;
  --sp-1:  0.5rem;
  --sp-2:  1rem;
  --sp-3:  1.5rem;
  --sp-4:  2rem;
  --sp-5:  2.5rem;
  --sp-6:  3rem;
  --sp-8:  4rem;

  /* Cellák */
  --cell-size:   clamp(13px, 2vw, 18px);
  --cell-gap:    clamp(3px, 0.4vw, 4px);
  --cell-radius: 3px;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}

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

html {
  font-size:       16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing:  antialiased;
  -moz-osx-font-smoothing: grayscale;
  color-scheme:    dark;
}

body {
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 130% 85% at 50% -35%, rgba(218, 160, 109, 0.12), transparent 52%),
    radial-gradient(ellipse 90% 60% at 100% 105%, rgba(196, 92, 122, 0.06), transparent 48%),
    radial-gradient(ellipse 70% 50% at -5% 60%, rgba(107, 158, 122, 0.045), transparent 45%);
  background-attachment: fixed;
  color:            var(--text-1);
  font-family:      system-ui, -apple-system, 'Segoe UI', var(--font-body), Georgia, serif;
  font-weight:      400;
  line-height:      1.65;
  min-height:       100dvh;
  overflow-x:       hidden;
}

ul, ol { list-style: none; }

button {
  cursor:     pointer;
  border:     none;
  background: none;
  font:       inherit;
  color:      inherit;
  -webkit-tap-highlight-color: transparent;
}

textarea {
  font: inherit;
  resize: vertical;
}


/* =============================================================================
   2. GRAIN + AMBIENT BG
   ============================================================================= */

.grain-overlay {
  position:       fixed;
  inset:          0;
  z-index:        9999;
  pointer-events: none;
  opacity:        0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 180px;
}

.ambient-bg {
  position:       fixed;
  inset:          0;
  z-index:        0;
  pointer-events: none;
  overflow:       hidden;
}

.ambient-blob {
  position:      absolute;
  border-radius: 50%;
  filter:        blur(120px);
  opacity:       0.06;
  animation:     blobDrift 20s ease-in-out infinite;
}

.ambient-blob--1 {
  width:      600px;
  height:     600px;
  background: var(--amber);
  top:        -200px;
  left:       -100px;
  animation-delay: 0s;
}

.ambient-blob--2 {
  width:      500px;
  height:     500px;
  background: var(--rose);
  bottom:     -100px;
  right:      -100px;
  animation-delay: -7s;
}

.ambient-blob--3 {
  width:      400px;
  height:     400px;
  background: var(--sage);
  top:        50%;
  left:       50%;
  transform:  translate(-50%, -50%);
  animation-delay: -14s;
  opacity:    0.03;
}

@keyframes blobDrift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%       { transform: translate(40px, -30px) scale(1.05); }
  66%       { transform: translate(-20px, 20px) scale(0.97); }
}


/* =============================================================================
   3. SCROLLBAR
   ============================================================================= */

::-webkit-scrollbar         { width: 8px; height: 8px; }
::-webkit-scrollbar-track   { background: var(--bg); }
::-webkit-scrollbar-thumb   { background: rgba(245, 237, 224, 0.1); border-radius: 4px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: rgba(245, 237, 224, 0.2); }
* { scrollbar-width: thin; scrollbar-color: rgba(245,237,224,0.1) transparent; }


/* =============================================================================
   4. ANIMÁCIÓK
   ============================================================================= */

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-8px); }
  40%       { transform: translateX(8px); }
  60%       { transform: translateX(-5px); }
  80%       { transform: translateX(5px); }
}

@keyframes dotPop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.5); }
  100% { transform: scale(1); }
}

@keyframes cellIn {
  from { opacity: 0; transform: scale(0.4); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes cellInFuture {
  from { opacity: 0; transform: scale(0.4); }
  to   { opacity: 0.2; transform: scale(1); }
}

@keyframes specialCelebrate {
  0% {
    transform: scale(1);
    box-shadow: 0 0 10px rgba(218, 160, 109, 0.5);
  }
  40% {
    transform: scale(1.38);
    box-shadow:
      0 0 0 2px rgba(236, 201, 164, 0.55),
      0 0 18px rgba(218, 160, 109, 0.85),
      0 0 32px rgba(196, 92, 122, 0.35);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 10px rgba(218, 160, 109, 0.5);
  }
}

@keyframes specialSparkle {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.2) rotate(0deg);
  }
  35% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1) rotate(18deg);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -70%) scale(0.6) rotate(36deg);
  }
}

@keyframes tooltipPopIn {
  0% {
    opacity: 0;
    transform: perspective(420px) translate3d(0, 12px, 0) rotateX(-7deg) scale(0.94);
  }
  70% {
    opacity: 1;
    transform: perspective(420px) translate3d(0, -2px, 0) rotateX(1deg) scale(1.012);
  }
  100% {
    opacity: 1;
    transform: perspective(420px) translate3d(0, 0, 0) rotateX(0) scale(1);
  }
}

@keyframes tooltipSheen {
  from { transform: translateX(-130%) skewX(-18deg); opacity: 0; }
  35%  { opacity: .55; }
  to   { transform: translateX(220%) skewX(-18deg); opacity: 0; }
}

@keyframes tooltipBadgePop {
  from { opacity: 0; transform: translateY(4px) scale(.9); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes badgeHeartBeat {
  0%, 100% { transform: scale(1); }
  45% { transform: scale(1.16); }
  70% { transform: scale(.98); }
}

@keyframes tooltipShift {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(0, -2px, 0) scale(1.02); }
  100% { transform: translate3d(0, 0, 0) scale(1); }
}

@keyframes tooltipContentIn {
  from {
    opacity: 0;
    transform: translate3d(0, 4px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes cellMarkerPop {
  0%   { transform: scale(1); }
  60%  { transform: scale(1.2); }
  100% { transform: scale(1.08); }
}

@keyframes cellMarkerPopDiamond {
  0%   { transform: rotate(45deg) scale(1); }
  60%  { transform: rotate(45deg) scale(1.2); }
  100% { transform: rotate(45deg) scale(1.08); }
}

@keyframes overlayOut {
  to { opacity: 0; pointer-events: none; }
}

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

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 20px rgba(218, 160, 109, 0.15); }
  50%       { box-shadow: 0 0 35px rgba(218, 160, 109, 0.3); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(24px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-24px); }
  to   { opacity: 1; transform: translateX(0); }
}


/* =============================================================================
   5. PIN OVERLAY
   ============================================================================= */

.pin-overlay {
  position:        fixed;
  inset:           0;
  z-index:         1000;
  display:         flex;
  align-items:     center;
  justify-content: center;
  padding:         var(--sp-2);
  background:
    radial-gradient(ellipse 100% 75% at 50% 35%, rgba(32, 26, 18, 0.55), transparent 58%),
    radial-gradient(ellipse at 40% 38%, rgba(24, 18, 14, 0.96), rgba(5, 5, 4, 1));
  animation:       fadeIn 0.5s var(--ease-out) both;
}

.pin-overlay--exit {
  animation: overlayOut 0.5s var(--ease-smooth) forwards;
}

.pin-overlay[hidden],
.pin-overlay--hidden {
  display:            none !important;
  visibility:         hidden !important;
  pointer-events:     none !important;
  animation:          none !important;
  -webkit-animation:  none !important;
}

.pin-card {
  position:      relative;
  width:         100%;
  max-width:     360px;
  padding:       var(--sp-5) var(--sp-4);
  background:    linear-gradient(168deg, rgba(26, 22, 18, 0.99) 0%, rgba(11, 9, 8, 0.99) 62%);
  border:        1px solid rgba(245, 237, 224, 0.09);
  border-radius: var(--radius-xl);
  box-shadow:
    0 0 0 1px rgba(218, 160, 109, 0.1),
    inset 0 1px 0 rgba(255, 245, 235, 0.04),
    0 46px 110px rgba(0, 0, 0, 0.72),
    0 0 90px rgba(218, 160, 109, 0.06);
}

/* 4 sarokdísz */
.corner {
  position:     absolute;
  width:        14px;
  height:       14px;
  border-color: var(--border-mid);
  border-style: solid;
  pointer-events: none;
}
.corner--tl { top: 10px; left: 10px;   border-width: 1px 0 0 1px; }
.corner--tr { top: 10px; right: 10px;  border-width: 1px 1px 0 0; }
.corner--bl { bottom: 10px; left: 10px;  border-width: 0 0 1px 1px; }
.corner--br { bottom: 10px; right: 10px; border-width: 0 1px 1px 0; }

.pin-card__ornament {
  display:      flex;
  justify-content: center;
  margin-bottom: var(--sp-3);
  color:        var(--amber);
}

.pin-card__ornament svg {
  width: 80px;
  opacity: 0.6;
}

.pin-card__header {
  text-align:    center;
  margin-bottom: var(--sp-4);
}

.pin-card__eyebrow {
  font-family:    var(--font-mono);
  font-size:      0.6rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color:          var(--amber);
  opacity:        0.7;
  margin-bottom:  var(--sp-1);
}

.pin-card__title {
  font-family: var(--font-display);
  font-size:   clamp(2rem, 6vw, 2.8rem);
  font-style:  italic;
  font-weight: 500;
  color:       var(--text-1);
  margin-bottom: 0.4rem;
  letter-spacing: -0.01em;
}

.pin-card__subtitle {
  font-size: 0.82rem;
  color:     var(--text-2);
  font-style: italic;
}

.pin-dots {
  display:         flex;
  justify-content: center;
  gap:             var(--sp-3);
  margin-bottom:   var(--sp-2);
}

.pin-dot {
  width:         12px;
  height:        12px;
  border-radius: 50%;
  border:        1.5px solid var(--border-mid);
  background:    transparent;
  transition:
    background   0.15s var(--ease-smooth),
    border-color 0.15s,
    transform    0.2s  var(--ease-bounce);
}

.pin-dot--filled {
  background:   var(--amber);
  border-color: var(--amber);
  box-shadow:   0 0 12px rgba(218, 160, 109, 0.5);
  animation:    dotPop 0.2s var(--ease-bounce);
}

.pin-dot--error {
  background:   var(--error);
  border-color: var(--error);
  box-shadow:   0 0 12px rgba(196, 74, 74, 0.5);
}

.notify-pin-error {
  margin:        0 auto var(--sp-1);
  padding:       var(--sp-1) var(--sp-2);
  max-width:     16rem;
  text-align:    center;
  font-family:   var(--font-body);
  font-size:     0.8rem;
  line-height:   1.4;
  color:         #e89292;
  letter-spacing: 0.02em;
  border-radius: var(--radius-md);
  border:        1px solid rgba(196, 74, 74, 0.38);
  background:    linear-gradient(
    135deg,
    rgba(196, 74, 74, 0.16) 0%,
    rgba(18, 14, 12, 0.82) 55%
  );
  box-shadow:
    0 4px 22px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  min-height:    0;
  opacity:       0;
  transform:     translateY(-4px) scale(0.98);
  transition:
    opacity 0.22s var(--ease-out),
    transform 0.24s var(--ease-bounce),
    min-height 0.2s ease;
  pointer-events: none;
}

.notify-pin-error:not(:empty) {
  min-height: 1.35em;
}

.notify-pin-error--visible {
  opacity:   1;
  transform: translateY(0) scale(1);
}

.pin-card--shake {
  animation: shake 0.4s var(--ease-smooth);
}

.pin-keypad {
  display:               grid;
  grid-template-columns: repeat(3, 1fr);
  gap:                   0.5rem;
  margin-top:            var(--sp-2);
}

.pin-key {
  aspect-ratio:  1;
  border-radius: var(--radius-md);
  font-family:   var(--font-mono);
  font-size:     clamp(1rem, 3vw, 1.2rem);
  font-weight:   500;
  background:    rgba(245, 237, 224, 0.04);
  border:        1px solid var(--border);
  color:         var(--text-1);
  transition:
    background  0.15s,
    transform   0.1s  var(--ease-bounce),
    box-shadow  0.15s;
  user-select: none;
}

.pin-key:hover {
  background: rgba(245, 237, 224, 0.08);
  border-color: var(--border-mid);
}

.pin-key:active {
  transform:  scale(0.91);
  background: var(--amber-dim);
  border-color: rgba(218, 160, 109, 0.3);
}

.pin-key--empty   { pointer-events: none; background: transparent; border: none; }
.pin-key--action  { font-size: 1.1rem; color: var(--text-2); }
.pin-key--action:hover { color: var(--error); background: var(--error-dim); }


/* =============================================================================
   6. APP WRAPPER
   ============================================================================= */

.app {
  position:       relative;
  z-index:        1;
  min-height:     100dvh;
  display:        flex;
  flex-direction: column;
  animation:      appReveal 0.6s var(--ease-out) both;
}

.app[hidden] { display: none !important; }


/* =============================================================================
   7. HEADER
   ============================================================================= */

.site-header {
  position:        sticky;
  top:             0;
  z-index:         100;
  background:      linear-gradient(180deg, rgba(15, 12, 10, 0.94) 0%, rgba(7, 7, 6, 0.89) 100%);
  backdrop-filter: blur(22px) saturate(1.35);
  -webkit-backdrop-filter: blur(22px) saturate(1.35);
  border-bottom:   1px solid var(--shell-line);
  box-shadow:      0 1px 0 rgba(255, 245, 235, 0.03);
}

.site-header__inner {
  max-width:       1200px;
  margin-inline:   auto;
  padding:         var(--sp-2) var(--sp-3);
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  gap:             var(--sp-2);
  flex-wrap:       wrap;
}

.site-header__title {
  font-family: var(--font-display);
  font-size:   clamp(1.2rem, 3vw, 1.6rem);
  font-style:  italic;
  font-weight: 500;
  color:       var(--text-1);
  letter-spacing: -0.01em;
}

.site-header__tagline {
  font-family:    var(--font-mono);
  font-size:      0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color:          var(--text-2);
  margin-top:     0.1rem;
  opacity:        0.7;
}

.site-header__right {
  display:     flex;
  align-items: center;
  gap:         var(--sp-2);
  flex-wrap:   wrap;
}


/* =============================================================================
   8. SINCE BADGE – utolsó találkozás
   ============================================================================= */

.since-badge {
  position:      relative;
  display:       flex;
  align-items:   center;
  gap:           0.62rem;
  padding:       0.38rem 0.78rem 0.4rem 0.42rem;
  background:    radial-gradient(circle at 9% 50%, rgba(232, 138, 168, .18), transparent 30%), linear-gradient(135deg, rgba(35, 23, 27, .88), rgba(22, 18, 16, .78));
  border:        1px solid rgba(232, 138, 168, 0.3);
  border-radius: 999px;
  overflow:      hidden;
  max-width:     16rem;
  isolation:     isolate;
  box-shadow:    inset 0 1px 0 rgba(255,255,255,.055), 0 8px 24px rgba(0,0,0,.14);
  transition:    transform .25s var(--ease-out), border-color .25s, background .25s, box-shadow .25s;
}

.since-badge::after { content: ''; position: absolute; inset: 1px; z-index: -1; border-radius: inherit; background: linear-gradient(100deg, transparent 25%, rgba(255,255,255,.07) 46%, transparent 62%); opacity: .65; }
.since-badge:hover { transform: translateY(-1px); border-color: rgba(232,138,168,.52); box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 12px 30px rgba(0,0,0,.22); }

.since-badge__accent {
  position:      absolute;
  left:          .42rem;
  top:           50%;
  width:         30px;
  height:        30px;
  transform:     translateY(-50%);
  border-radius: 50%;
  border:        1px solid rgba(232, 138, 168, .32);
  background:    rgba(232, 138, 168, .08);
  opacity:       1;
}

.since-badge__icon {
  flex-shrink:   0;
  position:      relative;
  z-index:       1;
  width:         30px;
  text-align:    center;
  font-size:     0.78rem;
  color:         #ffd1df;
  line-height:   1;
  opacity:       0.9;
}

.since-badge__text {
  display:        flex;
  flex-direction: column;
  gap:            0.02rem;
  min-width:      0;
}

.since-badge__eyebrow { font-family: var(--font-mono); font-size: .48rem; line-height: 1.1; letter-spacing: .14em; text-transform: uppercase; color: rgba(245,237,224,.46); }

.since-badge__line {
  font-family:    var(--font-body);
  font-size:      clamp(0.74rem, 1.8vw, 0.86rem);
  font-weight:    550;
  color:          var(--text-1);
  line-height:    1.25;
  letter-spacing: -0.01em;
}

.since-badge__sub {
  font-family:    var(--font-mono);
  font-size:      0.58rem;
  letter-spacing: 0.12em;
  color:          #f0b8cc;
}

.since-badge--empty {
  background: rgba(245, 237, 224, 0.03);
  border-color: var(--border);
}

.since-badge--empty .since-badge__accent {
  background: var(--border-mid);
}

.since-badge--empty .since-badge__icon {
  opacity: 0.35;
  color: var(--text-3);
}

.since-badge--empty .since-badge__line {
  color: var(--text-2);
  font-style: italic;
  font-weight: 400;
  font-size: 0.72rem;
}

.since-badge--today {
  border-color: rgba(232, 138, 168, 0.45);
  box-shadow:   0 0 20px rgba(232, 138, 168, 0.12);
}

.since-badge--today .since-badge__line {
  color: #ffd4e4;
}

.since-badge--today .since-badge__icon { animation: badgeHeartBeat 1.8s ease-in-out infinite; }

@media (prefers-reduced-motion: reduce) {
  .since-badge--today .since-badge__icon { animation: none; }
  .since-badge:hover { transform: none; }
}

.since-badge--recent .since-badge__line em,
.since-badge--warm .since-badge__line em,
.since-badge--long .since-badge__line em {
  font-style: normal;
  display: inline-block;
  min-width: 1.3em;
  margin-right: .04em;
  font-family: var(--font-display);
  font-size: 1.3em;
  font-weight: 600;
  color: #ffc0d6;
  font-variant-numeric: tabular-nums;
}

.since-badge--warm {
  border-color: rgba(218, 160, 109, 0.28);
}

.since-badge--warm .since-badge__accent {
  background: linear-gradient(180deg, #daa06d, rgba(218, 160, 109, 0.4));
}

.since-badge--long {
  border-color: rgba(245, 237, 224, 0.12);
  background: rgba(245, 237, 224, 0.025);
}

.since-badge--long .since-badge__accent {
  opacity: 0.5;
}

.since-badge--long .since-badge__line {
  color: var(--text-2);
}


/* =============================================================================
   8b. VIEW TOGGLE
   ============================================================================= */

.view-toggle {
  display:       flex;
  background:    rgba(245, 237, 224, 0.04);
  border:        1px solid var(--border);
  border-radius: 100px;
  padding:       3px;
  gap:           2px;
}

.view-toggle__btn {
  display:     flex;
  align-items: center;
  gap:         0.35rem;
  padding:     0.28rem 0.6rem;
  border-radius: 100px;
  font-family: var(--font-mono);
  font-size:   0.65rem;
  letter-spacing: 0.06em;
  color:       var(--text-2);
  transition:  all 0.2s var(--ease-smooth);
}

.view-toggle__btn:hover { color: var(--text-1); }

.view-toggle__btn--active {
  background:  rgba(218, 160, 109, 0.18);
  border:      1px solid rgba(218, 160, 109, 0.3);
  color:       var(--amber-light);
}

.view-toggle__btn svg { flex-shrink: 0; }


/* =============================================================================
   9. VIEW PANELS
   ============================================================================= */

.view-panel { display: block; }
.view-panel[hidden] { display: none !important; }

.view-panel--active { animation: fadeUp 0.4s var(--ease-out) both; }


/* =============================================================================
   10. LEGEND
   ============================================================================= */

.legend {
  max-width:     1200px;
  margin-inline: auto;
  padding:       var(--sp-3) var(--sp-3) 0;
  display:       flex;
  align-items:   center;
  flex-wrap:     wrap;
  gap:           var(--sp-2);
  justify-content: space-between;
}

.legend__items {
  display:     flex;
  flex-wrap:   wrap;
  gap:         var(--sp-2);
  align-items: center;
}

.legend__item {
  display:     flex;
  align-items: center;
  gap:         0.4rem;
}

.legend__swatch {
  display:       block;
  width:         12px;
  height:        12px;
  border-radius: var(--cell-radius);
  flex-shrink:   0;
}

.legend__swatch--empty   { background: var(--cell-empty); border: 1px solid var(--border-mid); }
.legend__swatch--meeting { background: var(--cell-meeting); box-shadow: 0 0 6px rgba(107,158,122,0.5); }
.legend__swatch--special { background: var(--cell-special); box-shadow: 0 0 6px rgba(218,160,109,0.5); }
.legend__swatch--idle {
  background: var(--cell-empty);
  border: 1px solid rgba(226, 92, 101, 0.52);
  position: relative;
}
.legend__swatch--idle::after { content: '×'; position: absolute; inset: -4px 0 0; text-align: center; color: rgba(226, 92, 101, 0.55); font-size: 15px; line-height: 12px; }

.legend__mark {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 4px;
  position: relative;
  border: 1px solid var(--border-mid);
  background: var(--cell-empty);
}

.legend__mark--note::after {
  content: '';
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  right: 1px;
  bottom: 1px;
  background: var(--rose-light);
  border: 1px solid rgba(8, 8, 8, 0.9);
}

.legend__mark--description::after {
  content: '';
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 1px;
  left: 1px;
  top: 1px;
  background: #8ec8ff;
  transform: rotate(45deg);
  border: 1px solid rgba(8, 8, 8, 0.9);
}

.legend__mark--location::after {
  content: '';
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  right: 1px;
  top: 1px;
  background: var(--sage-light);
  box-shadow: 0 0 0 1px rgba(8, 8, 8, 0.9), 0 0 4px rgba(142, 193, 158, 0.7);
}

.legend__swatch--duo-yes {
  background-color: var(--cell-empty);
  background-image: linear-gradient(#e88aa8, #e88aa8);
  background-repeat: no-repeat;
  background-size: 3px 100%;
  background-position: left top;
  border: 1px solid var(--border-mid);
  box-shadow: 0 0 6px rgba(232, 138, 168, 0.25);
}

.legend__swatch--duo-no {
  background-color: var(--cell-empty);
  background-image: linear-gradient(rgba(245, 237, 224, 0.34), rgba(245, 237, 224, 0.34));
  background-repeat: no-repeat;
  background-size: 3px 100%;
  background-position: left top;
  border: 1px solid var(--border-mid);
  box-shadow: 0 0 6px rgba(245, 237, 224, 0.08);
}

.legend__text {
  font-family: var(--font-mono);
  font-size:   0.7rem;
  color:       var(--text-2);
  letter-spacing: 0.03em;
}

.legend__footnote {
  flex:           1 1 100%;
  margin:         0.35rem 0 0;
  font-family:    var(--font-mono);
  font-size:      0.62rem;
  line-height:    1.45;
  color:          var(--text-3);
  letter-spacing: 0.02em;
}

.legend__footnote-mark {
  color:       var(--rose-light);
  font-weight: 700;
  margin-right: 0.15rem;
}

.legend__hint {
  font-family:  var(--font-mono);
  font-size:    0.65rem;
  color:        var(--text-3);
  font-style:   italic;
  letter-spacing: 0.02em;
}


/* =============================================================================
   11. ÉV NAV
   ============================================================================= */

.year-nav {
  max-width:     1200px;
  margin-inline: auto;
  padding:       var(--sp-3) var(--sp-3) var(--sp-1);
  display:       flex;
  align-items:   center;
  gap:           var(--sp-2);
}

.year-display {
  font-family:    var(--font-display);
  font-style:     italic;
  font-size:      clamp(1.1rem, 2.5vw, 1.4rem);
  color:          var(--text-1);
  letter-spacing: 0.02em;
  min-width:      4.5ch;
  text-align:     center;
}

.year-btn {
  width:         34px;
  height:        34px;
  display:       flex;
  align-items:   center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background:    var(--glass);
  border:        1px solid var(--border);
  color:         var(--text-2);
  font-size:     1rem;
  transition:
    background  0.15s,
    color       0.15s,
    transform   0.1s  var(--ease-bounce);
}

.year-btn:hover  { background: rgba(245,237,224,0.08); color: var(--text-1); border-color: var(--border-mid); }
.year-btn:active { transform: scale(0.88); }
.year-idle-btn { margin-left: .15rem; display: inline-flex; align-items: center; gap: .35rem; min-height: 30px; padding: 0 .55rem; border: 1px solid rgba(225, 98, 108, .36); border-radius: var(--radius-sm); color: rgba(255, 163, 170, .9); background: rgba(160, 48, 57, .08); font: .63rem var(--font-mono); cursor: pointer; }
.year-idle-btn:hover { background: rgba(160, 48, 57, .16); border-color: rgba(225, 98, 108, .58); }


/* =============================================================================
   12. HEATMAP
   ============================================================================= */

.heatmap-section {
  max-width:      min(100%, 1320px);
  margin-inline:  auto;
  padding:        var(--sp-1) var(--sp-3) var(--sp-3);
  container-type: inline-size;
  container-name: heatmap;
}

.heatmap-inner {
  width:                100%;
  --heatmap-month-band: calc(1.2rem + 8px);
  --heatmap-week-cols:  28;
  --heatmap-sidebar:    2.1rem;
  --heatmap-dividers-space: 140px;
  --cell-gap:           clamp(2.5px, 0.38cqi, 4px);
  --cell-size: clamp(
    9px,
    (100cqi - var(--heatmap-sidebar) - var(--heatmap-dividers-space) - var(--heatmap-week-cols) * var(--cell-gap))
      / var(--heatmap-week-cols),
    21px
  );
}

.heatmap-rows {
  display:        flex;
  flex-direction: column;
  gap:            var(--sp-4);
  width:          100%;
}

.heatmap-semester__inner {
  display:         flex;
  align-items:     flex-start;
  justify-content: center;
  width:           100%;
}

.heatmap-grid-wrap {
  display:         flex;
  flex:            0 1 auto;
  min-width:       0;
  flex-direction:  row;
  align-items:     flex-end;
  justify-content: flex-start;
  gap:             0;
}

.heatmap-band {
  display:         flex;
  flex:            0 0 auto;
  align-items:     flex-start;
}

.heatmap-weekdays--band {
  display: none !important;
}

.heatmap-weekdays {
  display:            grid;
  grid-template-rows: repeat(7, var(--cell-size));
  gap:                var(--cell-gap);
  flex-shrink:        0;
  width:              var(--heatmap-sidebar);
  margin-top:         var(--heatmap-month-band);
  margin-right:       8px;
}

.heatmap-weekdays span {
  font-family:   var(--font-mono);
  font-size:     clamp(0.54rem, 0.95cqi, 0.66rem);
  font-weight:   600;
  color:         var(--text-2);
  line-height:   var(--cell-size);
  text-align:    right;
  padding-right: 1px;
  opacity:       0.78;
  white-space:   nowrap;
}

.heatmap-grid {
  display:         flex;
  flex-direction:  row;
  flex-wrap:       nowrap;
  flex:            0 0 auto;
  min-width:       0;
  align-items:     flex-end;
  justify-content: flex-start;
  gap:             0;
}

.heatmap-month-block {
  display:       flex;
  flex-direction: column;
  align-items:   flex-start;
  flex-shrink:   0;
}

.heatmap-month-block--divider {
  margin-left:   14px;
  padding-left:  12px;
  border-left:   2px solid rgba(245, 237, 224, 0.14);
}

.heatmap-month-block__title {
  font-family:    var(--font-mono);
  font-size:      clamp(0.55rem, 1.05cqi, 0.66rem);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color:          var(--text-2);
  opacity:        0.82;
  font-weight:    600;
  margin-bottom:  8px;
  align-self:     stretch;
  text-align:     center;
  white-space:    nowrap;
}

.heatmap-month-block__weeks {
  display: flex;
  flex-direction: row;
  gap:     var(--cell-gap);
}

.heatmap-week {
  display:               grid;
  grid-template-rows:    repeat(7, var(--cell-size));
  grid-template-columns: var(--cell-size);
  gap:                   var(--cell-gap);
}

.heatmap-grid--instant .heatmap-cell {
  animation: none;
}

.heatmap-cell {
  width:         var(--cell-size);
  height:        var(--cell-size);
  border-radius: var(--cell-radius);
  background-color: var(--cell-empty);
  background-image: linear-gradient(var(--duo-strip-color), var(--duo-strip-color));
  background-repeat: no-repeat;
  background-position: left top;
  background-size: var(--duo-strip-width) 100%;
  border:        1px solid rgba(245, 237, 224, 0.04);
  cursor:        default;
  animation:     cellIn 0.35s var(--ease-out) both;
  --duo-strip-width: 0px;
  --duo-strip-color: transparent;
  transition:
    background-color 0.18s ease,
    background-size  0.2s var(--ease-out),
    transform        0.18s var(--ease-out),
    box-shadow       0.2s var(--ease-out),
    border-color     0.18s ease,
    outline-color    0.18s ease;
  position: relative;
  transform-origin: center;
  backface-visibility: hidden;
  will-change: transform, filter;
}

.heatmap-cell--hot {
  z-index: 12;
}

.heatmap-cell[role="button"] {
  cursor: pointer;
}

.heatmap-cell--future {
  opacity: 0.2;
  cursor: default;
  animation: cellInFuture 0.35s var(--ease-out) both;
  background-color: var(--cell-empty);
  background-image: none;
  --duo-strip-width: 0;
  --duo-strip-color: transparent;
  border-color: rgba(245, 237, 224, 0.02);
  box-shadow: none;
}

.heatmap-grid--instant .heatmap-cell--future {
  opacity: 0.2;
}

.heatmap-cell--future.heatmap-cell--meeting,
.heatmap-cell--future.heatmap-cell--special {
  background-color: var(--cell-empty);
  border-color: rgba(245, 237, 224, 0.02);
  box-shadow: none;
}

.heatmap-cell--idle {
  background-color: var(--cell-empty) !important;
  background-image: linear-gradient(45deg, transparent 47%, rgba(226, 92, 101, 0.42) 48%, rgba(226, 92, 101, 0.42) 52%, transparent 53%), linear-gradient(-45deg, transparent 47%, rgba(226, 92, 101, 0.42) 48%, rgba(226, 92, 101, 0.42) 52%, transparent 53%) !important;
  border: 1px solid rgba(226, 92, 101, 0.52) !important;
  box-shadow: none !important;
}

.heatmap-cell--future.heatmap-cell--idle { opacity: 0.62; }

.heatmap-cell--future.heatmap-cell--has-note::after,
.heatmap-cell--future.heatmap-cell--has-description::before {
  display: none;
}

.heatmap-cell--future.heatmap-cell--has-location,
.heatmap-cell--future.heatmap-cell--meeting.heatmap-cell--has-location,
.heatmap-cell--future.heatmap-cell--special.heatmap-cell--has-location {
  box-shadow: none;
}

@media (hover: hover) and (pointer: fine) {
  .heatmap-cell--hot,
  .heatmap-cell[role="button"]:hover:not(.heatmap-cell--future) {
    transform:    scale(1.32);
    z-index:      12;
    border-color: var(--border-hi);
    filter:       brightness(1.14) saturate(1.08);
  }

  .heatmap-cell--meeting.heatmap-cell--hot,
  .heatmap-cell--meeting:hover:not(.heatmap-cell--future) {
    box-shadow:
      0 0 0 1px rgba(142, 193, 158, 0.45),
      0 0 12px rgba(107, 158, 122, 0.58),
      0 0 22px rgba(107, 158, 122, 0.28);
  }

  .heatmap-cell--special.heatmap-cell--hot,
  .heatmap-cell--special:hover:not(.heatmap-cell--future) {
    box-shadow:
      0 0 0 1px rgba(236, 201, 164, 0.48),
      0 0 14px rgba(218, 160, 109, 0.62),
      0 0 24px rgba(218, 160, 109, 0.28);
  }

  .heatmap-cell--hot.heatmap-cell--duo-yes,
  .heatmap-cell--duo-yes:hover:not(.heatmap-cell--future) {
    --duo-strip-width: 4px;
    --duo-strip-color: #ffb8d0;
  }

  .heatmap-cell--hot.heatmap-cell--duo-no,
  .heatmap-cell--duo-no:hover:not(.heatmap-cell--future) {
    --duo-strip-width: 4px;
    --duo-strip-color: rgba(245, 237, 224, 0.44);
  }

  .heatmap-cell--future:hover {
    transform: none;
  }
}

.heatmap-cell--meeting {
  background-color: var(--cell-meeting);
  border-color: rgba(107, 158, 122, 0.6);
  box-shadow:   0 0 7px rgba(107, 158, 122, 0.4);
}

.heatmap-cell--special {
  background-color: var(--cell-special);
  border-color: rgba(218, 160, 109, 0.6);
  box-shadow:   0 0 10px rgba(218, 160, 109, 0.5);
}

.heatmap-cell--special-celebrate {
  z-index: 24;
  animation: specialCelebrate 0.85s var(--ease-out) both;
}

.heatmap-cell__sparkle {
  position:       absolute;
  top:            50%;
  left:           50%;
  transform:      translate(-50%, -50%);
  font-size:      0.55rem;
  line-height:    1;
  color:          rgba(255, 236, 216, 0.95);
  text-shadow:    0 0 8px rgba(218, 160, 109, 0.9);
  pointer-events: none;
  z-index:        2;
}

.heatmap-cell__sparkle--motion {
  animation: specialSparkle 0.85s var(--ease-out) both;
}

@media (prefers-reduced-motion: reduce) {
  .heatmap-cell--special-celebrate {
    animation: none;
    box-shadow:
      0 0 0 2px rgba(236, 201, 164, 0.5),
      0 0 14px rgba(218, 160, 109, 0.65);
  }
}

.heatmap-cell--today {
  outline:        2px solid rgba(245, 237, 224, 0.55);
  outline-offset: 1px;
}

@container heatmap (max-width: 900px) {
  .heatmap-inner {
    --heatmap-dividers-space: 60px;
  }

  .heatmap-month-block--divider {
    margin-left:  6px;
    padding-left: 4px;
  }
}

@container heatmap (max-width: 560px) {
  .heatmap-inner {
    --heatmap-dividers-space: 40px;
  }

  .heatmap-month-block--divider {
    margin-left:        4px;
    padding-left:       3px;
    border-left-width:  1px;
  }
}

.heatmap-cell--pad {
  visibility:      hidden;
  pointer-events:  none;
  background:      transparent !important;
  border-color:    transparent !important;
  animation:       none !important;
  box-shadow:      none !important;
}

.heatmap-cell[role="button"]:focus-visible {
  outline:        2px solid rgba(245, 237, 224, 0.72);
  outline-offset: 3px;
  z-index:        5;
}

.heatmap-cell--future:focus-visible {
  outline: none;
}

.heatmap-cell--has-note::after {
  content:       '';
  position:      absolute;
  bottom:        1px;
  right:         1px;
  width:         6px;
  height:        6px;
  border-radius: 50%;
  background:    #ff98bc;
  border:        1px solid rgba(8, 8, 8, 0.9);
  box-shadow:    0 0 0 1px rgba(255, 245, 235, 0.45);
  z-index:       2;
  opacity:       0.88;
  transition:    box-shadow 0.18s ease, opacity 0.18s ease;
}

.heatmap-cell--has-description::before {
  content: '';
  position: absolute;
  top: 1px;
  left: 1px;
  width: 6px;
  height: 6px;
  border-radius: 1px;
  background: #8ec8ff;
  transform: rotate(45deg);
  border: 1px solid rgba(8, 8, 8, 0.9);
  box-shadow: 0 0 0 1px rgba(255, 245, 235, 0.45);
  z-index: 2;
  opacity: 0.88;
  transition: box-shadow 0.18s ease, opacity 0.18s ease;
}

.heatmap-cell--has-location {
  box-shadow: inset 0 0 0 1.5px rgba(142, 193, 158, 0.7), 0 0 8px rgba(107, 158, 122, 0.35);
}

.heatmap-cell--meeting.heatmap-cell--has-location {
  box-shadow: inset 0 0 0 1.5px rgba(220, 255, 230, 0.55), 0 0 9px rgba(107, 158, 122, 0.55);
}

.heatmap-cell--special.heatmap-cell--has-location {
  box-shadow: inset 0 0 0 1.5px rgba(255, 230, 180, 0.7), 0 0 11px rgba(218, 160, 109, 0.55);
}

.heatmap-cell--duo-yes {
  --duo-strip-width: 3px;
  --duo-strip-color: #e88aa8;
}

.heatmap-cell--duo-no {
  --duo-strip-width: 3px;
  --duo-strip-color: rgba(245, 237, 224, 0.34);
}

.heatmap-cell--future.heatmap-cell--duo-yes,
.heatmap-cell--future.heatmap-cell--duo-no {
  --duo-strip-width: 0;
  --duo-strip-color: transparent;
}

@media (hover: hover) and (pointer: fine) {
  .heatmap-cell--has-note.heatmap-cell--hot::after,
  .heatmap-cell--has-note:hover::after,
  .heatmap-cell--has-note:focus-visible::after {
    opacity: 1;
    animation: cellMarkerPop 0.22s var(--ease-out) both;
    box-shadow:
      0 0 0 1px rgba(255, 245, 235, 0.65),
      0 0 7px rgba(232, 138, 168, 0.55);
  }

  .heatmap-cell--has-description.heatmap-cell--hot::before,
  .heatmap-cell--has-description:hover::before,
  .heatmap-cell--has-description:focus-visible::before {
    opacity: 1;
    animation: cellMarkerPopDiamond 0.22s var(--ease-out) both;
    box-shadow:
      0 0 0 1px rgba(255, 245, 235, 0.65),
      0 0 7px rgba(142, 200, 255, 0.5);
  }

  .heatmap-cell--has-location.heatmap-cell--hot,
  .heatmap-cell--has-location:hover,
  .heatmap-cell--has-location:focus-visible {
    box-shadow:
      inset 0 0 0 2px rgba(165, 218, 182, 0.72),
      0 0 11px rgba(107, 158, 122, 0.42),
      0 0 18px rgba(107, 158, 122, 0.2);
  }

  .heatmap-cell--meeting.heatmap-cell--has-location.heatmap-cell--hot,
  .heatmap-cell--meeting.heatmap-cell--has-location:hover,
  .heatmap-cell--meeting.heatmap-cell--has-location:focus-visible {
    box-shadow:
      inset 0 0 0 2px rgba(225, 255, 234, 0.68),
      0 0 12px rgba(107, 158, 122, 0.55),
      0 0 20px rgba(107, 158, 122, 0.26);
  }

  .heatmap-cell--special.heatmap-cell--has-location.heatmap-cell--hot,
  .heatmap-cell--special.heatmap-cell--has-location:hover,
  .heatmap-cell--special.heatmap-cell--has-location:focus-visible {
    box-shadow:
      inset 0 0 0 2px rgba(255, 236, 194, 0.78),
      0 0 14px rgba(218, 160, 109, 0.62),
      0 0 22px rgba(218, 160, 109, 0.28);
  }
}


/* =============================================================================
   13. RICH TOOLTIP
   ============================================================================= */

.rich-tooltip {
  position:       fixed;
  z-index:        800;
  max-width:      260px;
  padding:        12px 14px;
  background:
    radial-gradient(130% 100% at 0% 0%, rgba(218, 160, 109, 0.11), transparent 56%),
    linear-gradient(165deg, rgba(26, 20, 16, 0.96), rgba(14, 11, 9, 0.96));
  border:         1px solid rgba(245, 237, 224, 0.18);
  border-radius:  12px;
  box-shadow:
    0 16px 44px rgba(0,0,0,0.58),
    inset 0 1px 0 rgba(255, 244, 230, 0.08);
  backdrop-filter: blur(4px);
  pointer-events: none;
  opacity:        0;
  transform:      translate3d(0, 8px, 0) scale(0.96);
  transform-origin: center bottom;
  transition:     opacity 0.14s ease-out, transform 0.14s ease-out;
  contain:        layout style paint;
  overflow:       hidden;
}

.rich-tooltip::after {
  content: '';
  position: absolute;
  inset: 0 auto 0 -35%;
  width: 28%;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255, 244, 230, .13), transparent);
}

.rich-tooltip[hidden] { display: none !important; }

.rich-tooltip--visible {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
  animation: tooltipPopIn 0.32s var(--ease-out) both;
}

.rich-tooltip--visible::after { animation: tooltipSheen .72s .08s var(--ease-out) both; }

.rich-tooltip--shift {
  animation: tooltipShift 0.2s var(--ease-out) both;
}

.rich-tooltip--visible .rich-tooltip__date,
.rich-tooltip--visible .rich-tooltip__badges,
.rich-tooltip--visible .rich-tooltip__line,
.rich-tooltip--visible .rich-tooltip__locations {
  animation: tooltipContentIn 0.22s var(--ease-out) both;
}

.rich-tooltip--visible .rich-tooltip__companions {
  animation: tooltipContentIn 0.22s var(--ease-out) both;
  animation-delay: .085s;
}

.rich-tooltip--visible .rich-tooltip__badges       { animation-delay: 0.025s; }
.rich-tooltip--visible .rich-tooltip__line         { animation-delay: 0.04s; }
.rich-tooltip--visible .rich-tooltip__line + .rich-tooltip__line { animation-delay: 0.055s; }
.rich-tooltip--visible .rich-tooltip__locations   { animation-delay: 0.07s; }
.rich-tooltip--visible .rich-tooltip__badge { animation: tooltipBadgePop .24s var(--ease-out) both; }
.rich-tooltip--visible .rich-tooltip__badge:nth-child(2) { animation-delay: .045s; }
.rich-tooltip--visible .rich-tooltip__badge:nth-child(3) { animation-delay: .08s; }

@media (prefers-reduced-motion: reduce) {
  .heatmap-cell {
    transition: background-color 0.12s ease, border-color 0.12s ease;
  }

  .rich-tooltip,
  .rich-tooltip--visible,
  .rich-tooltip--shift,
  .rich-tooltip--visible .rich-tooltip__date,
  .rich-tooltip--visible .rich-tooltip__badges,
  .rich-tooltip--visible .rich-tooltip__line,
  .rich-tooltip--visible .rich-tooltip__locations,
  .rich-tooltip--visible .rich-tooltip__companions,
  .rich-tooltip--visible .rich-tooltip__badge {
    animation: none !important;
    transform: none;
    transition: opacity 0.12s ease;
  }

  .rich-tooltip--visible { transform: none; }
  .rich-tooltip::after { display: none; }
}

@media (prefers-reduced-motion: reduce) and (hover: hover) and (pointer: fine) {
  .heatmap-cell--hot,
  .heatmap-cell:hover { transform: none; }
}

.rich-tooltip__date {
  font-family:    var(--font-mono);
  font-size:      0.62rem;
  color:          var(--text-2);
  letter-spacing: 0.08em;
  margin-bottom:  7px;
}

.rich-tooltip__badges {
  display:        flex;
  flex-wrap:      wrap;
  gap:            5px;
  margin-bottom:  3px;
}

.rich-tooltip__badge {
  display:        inline-flex;
  align-items:    center;
  gap:            4px;
  padding:        2px 8px;
  border-radius:  999px;
  border:         1px solid var(--border);
  font-family:    var(--font-mono);
  font-size:      0.62rem;
  letter-spacing: 0.02em;
  line-height:    1.3;
  white-space:    nowrap;
}

.rich-tooltip__badge--meeting {
  color:      var(--sage-light);
  border-color: rgba(142, 193, 158, 0.45);
  background: rgba(107, 158, 122, 0.13);
}

.rich-tooltip__badge--special {
  color:      var(--amber-light);
  border-color: rgba(218, 160, 109, 0.48);
  background: rgba(218, 160, 109, 0.14);
}

.rich-tooltip__badge--duo-yes {
  color:      #ffc6dc;
  border-color: rgba(232, 138, 168, 0.48);
  background: rgba(196, 92, 122, 0.18);
}

.rich-tooltip__badge--duo-no {
  color:      rgba(245, 237, 224, 0.72);
  border-color: rgba(245, 237, 224, 0.22);
  background: rgba(245, 237, 224, 0.06);
}

.rich-tooltip__badge--idle {
  color: #ffafb6;
  border-color: rgba(238, 76, 91, 0.5);
  background: rgba(180, 42, 55, 0.18);
}

.rich-tooltip__line {
  display:       grid;
  gap:           2px;
  margin-top:    6px;
  padding:       6px 8px;
  border-radius: 8px;
  border:        1px solid rgba(245, 237, 224, 0.12);
  background:    rgba(255, 236, 216, 0.03);
}

.rich-tooltip__line--note {
  border-color: rgba(232, 138, 168, 0.32);
  background: rgba(196, 92, 122, 0.1);
}

.rich-tooltip__line--description {
  border-color: rgba(142, 200, 255, 0.34);
  background: rgba(142, 200, 255, 0.08);
}

.rich-tooltip__label {
  font-family: var(--font-mono);
  font-size: 0.56rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-2);
  opacity: 0.9;
}

.rich-tooltip__value {
  font-size: 0.74rem;
  color: var(--text-1);
  line-height: 1.4;
  white-space: pre-line;
}

.rich-tooltip__locations {
  display:        flex;
  flex-wrap:      wrap;
  gap:            4px;
  margin-top:     8px;
  padding-top:    7px;
  border-top:     1px solid var(--border);
}

.rich-tooltip__location {
  display:        inline-flex;
  align-items:    center;
  gap:            3px;
  padding:        3px 8px;
  border-radius:  100px;
  background:     var(--sage-dim);
  border:         1px solid rgba(107, 158, 122, 0.3);
  color:          var(--sage-light);
  font-family:    var(--font-mono);
  font-size:      0.62rem;
  letter-spacing: 0.02em;
  white-space:    nowrap;
}

.rich-tooltip__location::before {
  content: '📍';
  font-size: 0.55rem;
  opacity: 0.85;
}

.rich-tooltip__companions {
  display:     flex;
  flex-wrap:   wrap;
  gap:         4px;
  align-items: center;
  margin-top:  8px;
  padding-top: 7px;
  border-top:  1px solid var(--border);
}

.rich-tooltip__companions-label {
  font-family:    var(--font-mono);
  font-size:      0.58rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color:          var(--text-3);
  margin-right:   2px;
}

.rich-tooltip__companion {
  display:        inline-flex;
  align-items:    center;
  padding:        3px 8px;
  border-radius:  100px;
  background:     rgba(232, 138, 168, 0.12);
  border:         1px solid rgba(232, 138, 168, 0.3);
  color:          #f0b8cc;
  font-family:    var(--font-mono);
  font-size:      0.62rem;
  letter-spacing: 0.02em;
  white-space:    nowrap;
}


/* =============================================================================
   14. STATS
   ============================================================================= */

.stats-section {
  max-width:     1200px;
  margin-inline: auto;
  padding:       var(--sp-3) var(--sp-3) var(--sp-4);
  margin-top:    var(--sp-2);
}

.stats-section__head {
  margin-bottom: var(--sp-2);
}

.stats-dashboard,
.monthly-section,
.diary-section,
.timeline-section {
  content-visibility:        auto;
  contain-intrinsic-size:    auto 420px;
}

.settings-section {
  content-visibility: visible;
}

.stats-dashboard {
  display:        flex;
  flex-direction: column;
  gap:            var(--sp-2);
}

/* —— Hero + beágyazott szalag —— */
.stats-hero {
  position:       relative;
  overflow:       hidden;
  padding:        var(--sp-3);
  border-radius:  var(--radius-lg);
  border:         1px solid rgba(218, 160, 109, 0.22);
  background:
    radial-gradient(ellipse 90% 60% at 100% 0%, rgba(196, 92, 122, 0.1), transparent 50%),
    radial-gradient(ellipse 70% 50% at 0% 100%, rgba(107, 158, 122, 0.08), transparent 45%),
    linear-gradient(145deg, rgba(32, 26, 20, 0.95), rgba(18, 14, 11, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(245, 237, 224, 0.06),
    0 8px 28px rgba(0, 0, 0, 0.28);
}

.stats-hero__glow {
  position:       absolute;
  inset:          auto -15% -35% -15%;
  height:         55%;
  background:     radial-gradient(ellipse at 50% 100%, rgba(218, 160, 109, 0.14), transparent 68%);
  pointer-events: none;
}

.stats-hero__main {
  display:         flex;
  flex-direction:  column;
  align-items:     flex-start;
  gap:             var(--sp-2);
  margin-bottom:   var(--sp-2);
}

.stats-hero__primary {
  width: 100%;
}

.stats-hero__eyebrow {
  font-family:    var(--font-mono);
  font-size:      0.56rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color:          var(--amber);
  opacity:        0.75;
  margin-bottom:  0.35rem;
}

.stats-hero__value {
  font-family:    var(--font-display);
  font-size:      clamp(2.6rem, 10vw, 3.6rem);
  font-weight:    500;
  line-height:    0.95;
  letter-spacing: -0.03em;
  color:          var(--text-1);
}

.stats-hero__label {
  font-family: var(--font-body);
  font-style:  italic;
  font-size:   clamp(0.88rem, 2.2vw, 1rem);
  color:       var(--text-2);
  margin-top:  0.2rem;
}

.stats-hero__year-line {
  display:       inline-flex;
  align-items:   baseline;
  flex-wrap:     wrap;
  gap:           0.3rem 0.45rem;
  padding:       0.38rem 0.75rem;
  border-radius: 100px;
  background:    rgba(107, 158, 122, 0.12);
  border:        1px solid rgba(107, 158, 122, 0.28);
  flex-shrink:   0;
}

.stats-hero__year-num {
  font-family: var(--font-mono);
  font-size:   1rem;
  font-weight: 700;
  color:       var(--sage-light);
}

.stats-hero__year-text {
  font-family:    var(--font-mono);
  font-size:      0.64rem;
  color:          var(--text-2);
  letter-spacing: 0.02em;
}

.stats-hero__year-text span {
  color:       var(--amber-light);
  font-weight: 500;
}

.stats-hero__year-duo {
  display:       inline-flex;
  align-items:   baseline;
  flex-wrap:     wrap;
  gap:           0.25rem 0.4rem;
  margin-top:    0.35rem;
  padding:       0.32rem 0.7rem;
  border-radius: 100px;
  background:    rgba(196, 92, 122, 0.1);
  border:        1px solid rgba(196, 92, 122, 0.28);
}

.stats-hero__year-duo-num {
  font-family: var(--font-mono);
  font-size:   0.95rem;
  font-weight: 700;
  color:       #e8a0b8;
}

.stats-hero__year-duo-text {
  font-family:    var(--font-mono);
  font-size:      0.6rem;
  color:          var(--text-2);
  letter-spacing: 0.02em;
}

/* Szalag: különleges + streak + kettes – kitölti a szélességet */
.stats-ribbon {
  display:               grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap:                   1px;
  border-radius:         var(--radius-sm);
  overflow:              hidden;
  border:                1px solid var(--border);
  background:            var(--border);
}

.stats-ribbon__cell {
  display:         flex;
  align-items:     center;
  justify-content: center;
  gap:             0.45rem;
  padding:         0.65rem 0.55rem;
  background:      var(--surface-2);
  min-width:       0;
}

.stats-ribbon__icon {
  flex-shrink:     0;
  display:         flex;
  align-items:     center;
  justify-content: center;
  width:           1.65rem;
  height:          1.65rem;
  border-radius:   50%;
  font-size:       0.8rem;
  border:          1px solid var(--border-mid);
  background:      var(--glass);
}

.stats-ribbon__cell--special .stats-ribbon__icon {
  border-color: rgba(218, 160, 109, 0.35);
  background:   var(--amber-dim);
}

.stats-ribbon__cell--streak .stats-ribbon__icon {
  border-color: rgba(196, 92, 122, 0.35);
  background:   var(--rose-dim);
}

.stats-ribbon__cell--duo .stats-ribbon__icon {
  border-color: rgba(220, 120, 150, 0.4);
  background:   rgba(196, 92, 122, 0.12);
}

.stats-ribbon__cell--duo-streak .stats-ribbon__icon {
  border-color: rgba(232, 160, 184, 0.45);
  background:   rgba(196, 92, 122, 0.16);
}

.stats-ribbon__value {
  font-family: var(--font-mono);
  font-size:   clamp(1.25rem, 4vw, 1.55rem);
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
}

.stats-ribbon__cell--special .stats-ribbon__value { color: var(--amber-light); }
.stats-ribbon__cell--streak  .stats-ribbon__value { color: var(--rose-light); }
.stats-ribbon__cell--duo          .stats-ribbon__value { color: #e8a0b8; }
.stats-ribbon__cell--duo-streak   .stats-ribbon__value { color: #f0b8cc; }

.stats-ribbon__label {
  font-family:    var(--font-mono);
  font-size:      0.58rem;
  letter-spacing: 0.03em;
  color:          var(--text-2);
  line-height:    1.25;
  text-align:     left;
  flex:           1;
  min-width:      0;
}

@media (min-width: 520px) {
  .stats-hero__main {
    flex-direction:  row;
    align-items:     flex-end;
    justify-content: space-between;
    gap:             var(--sp-3);
  }

  .stats-hero__primary {
    width: auto;
    flex:  1;
    min-width: 0;
  }

  .stats-ribbon__cell {
    padding: 0.7rem 0.85rem;
    gap:     0.55rem;
  }
}

@media (min-width: 720px) {
  .stats-hero {
    padding: var(--sp-3) var(--sp-4);
  }

  .stats-ribbon__label {
    font-size: 0.6rem;
  }
}

@media (hover: hover) and (pointer: fine) {
  .stats-ribbon__cell {
    transition: background 0.2s ease;
  }

  .stats-ribbon__cell--special:hover { background: rgba(218, 160, 109, 0.08); }
  .stats-ribbon__cell--streak:hover  { background: rgba(196, 92, 122, 0.08); }
  .stats-ribbon__cell--duo:hover          { background: rgba(196, 92, 122, 0.1); }
  .stats-ribbon__cell--duo-streak:hover   { background: rgba(196, 92, 122, 0.12); }
}

@media (min-width: 640px) {
  .stats-ribbon {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* —— Insight kártyák —— */
.stats-insight {
  padding:        var(--sp-2) var(--sp-3);
  border-radius:  var(--radius-md);
  border:         1px solid var(--border);
  background:     var(--glass);
  display:        flex;
  flex-direction: column;
  gap:            0.45rem;
}

.stats-insight__row {
  display:         flex;
  align-items:     baseline;
  justify-content: space-between;
  gap:             var(--sp-2);
  min-width:       0;
}

.stats-insight__head {
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  gap:             var(--sp-2);
  flex-wrap:       wrap;
}

.stats-insight__eyebrow {
  font-family:    var(--font-mono);
  font-size:      0.56rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color:          var(--amber);
  opacity:        0.8;
  flex-shrink:    0;
}

.stats-insight__delta {
  font-family:    var(--font-mono);
  font-size:      0.58rem;
  letter-spacing: 0.03em;
  padding:        0.22rem 0.55rem;
  border-radius:  100px;
  border:         1px solid var(--border);
  background:     rgba(255, 236, 216, 0.03);
  color:          var(--text-2);
  white-space:    nowrap;
  flex-shrink:    0;
}

.stats-insight__delta--up {
  color:        var(--sage-light);
  border-color: rgba(107, 158, 122, 0.35);
  background:   var(--sage-dim);
}

.stats-insight__delta--down {
  color:        var(--rose-light);
  border-color: rgba(196, 92, 122, 0.35);
  background:   var(--rose-dim);
}

.stats-insight__delta--flat {
  color:   var(--text-3);
  opacity: 0.9;
}

.stats-insight__value {
  font-family:   var(--font-display);
  font-style:    italic;
  font-weight:   500;
  font-size:     clamp(0.95rem, 2.8vw, 1.2rem);
  color:         var(--text-1);
  line-height:   1.2;
  text-align:    right;
  flex:          1;
  min-width:     0;
  overflow:      hidden;
  text-overflow: ellipsis;
  white-space:   nowrap;
}

.stats-insight__value--place { color: var(--sage-light); }
.stats-insight__value--month { color: var(--amber-light); }

.stats-insight__meta {
  font-family:    var(--font-mono);
  font-size:      0.58rem;
  color:          var(--text-3);
  letter-spacing: 0.02em;
  line-height:    1.35;
}

.stats-insight--compare {
  border-color: rgba(218, 160, 109, 0.15);
  background:
    linear-gradient(180deg, rgba(218, 160, 109, 0.04), transparent 35%),
    var(--glass);
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3) var(--sp-3);
}

.stats-compare {
  display:        flex;
  flex-direction: column;
  gap:            0.65rem;
}

.stats-compare__row {
  display:               grid;
  grid-template-columns: 3.25rem 1fr;
  align-items:           center;
  gap:                   var(--sp-2);
}

.stats-compare__meta {
  display:        flex;
  flex-direction: column;
  gap:            0.05rem;
}

.stats-compare__year {
  font-family:    var(--font-mono);
  font-size:      0.58rem;
  letter-spacing: 0.06em;
  color:          var(--amber-light);
  font-weight:    500;
}

.stats-compare__year--muted { color: var(--text-2); }

.stats-compare__num {
  font-family: var(--font-mono);
  font-size:   0.95rem;
  font-weight: 700;
  color:       var(--sage-light);
  line-height: 1;
}

.stats-compare__num--muted {
  color:   var(--text-2);
  opacity: 0.9;
}

.stats-compare__track {
  height:        5px;
  border-radius: 100px;
  background:    rgba(245, 237, 224, 0.06);
  border:        1px solid var(--border);
  overflow:      hidden;
}

.stats-compare__fill {
  height:        100%;
  border-radius: inherit;
  width:         0%;
  transition:    width 0.65s var(--ease-out);
  min-width:     2px;
}

.stats-compare__fill--cur {
  background: linear-gradient(90deg, var(--sage), var(--sage-light));
  box-shadow: 0 0 10px rgba(107, 158, 122, 0.4);
}

.stats-compare__fill--prev {
  background: linear-gradient(90deg, rgba(176, 154, 136, 0.5), var(--text-2));
  opacity:    0.85;
}

.stats-insights-duo {
  display:               grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap:                   var(--sp-2);
}

.stats-insight--place {
  border-color: rgba(107, 158, 122, 0.2);
}

.stats-insight--month {
  border-color: rgba(218, 160, 109, 0.18);
}

@media (min-width: 900px) {
  .stats-dashboard {
    display:               grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap:                   var(--sp-2);
  }

  .stats-hero {
    grid-column: 1 / -1;
  }

  .stats-insight--compare {
    grid-column: 1;
  }

  .stats-insights-duo {
    grid-column:       2;
    grid-template-rows: 1fr 1fr;
    grid-template-columns: 1fr;
    align-content:     stretch;
  }

  .stats-insight--place,
  .stats-insight--month {
    display:         flex;
    flex-direction:  column;
    justify-content: center;
  }
}


/* =============================================================================
   15. SECTION HEADER (általános)
   ============================================================================= */

.section-header {
  margin-bottom: var(--sp-3);
}

.section-eyebrow {
  font-family:    var(--font-mono);
  font-size:      0.6rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color:          var(--amber);
  opacity:        0.7;
  margin-bottom:  0.3rem;
}

.section-title {
  font-family: var(--font-display);
  font-style:  italic;
  font-size:   clamp(1.3rem, 3vw, 1.8rem);
  font-weight: 500;
  color:       var(--text-1);
  letter-spacing: -0.01em;
}


/* =============================================================================
   16. HAVI BONTÁS
   ============================================================================= */

.monthly-section {
  max-width:     1200px;
  margin-inline: auto;
  padding:       var(--sp-2) var(--sp-3) var(--sp-4);
}

.monthly-grid {
  display:               grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap:                   var(--sp-3);
}

.month-card {
  padding:       var(--sp-2) var(--sp-2);
  background:    var(--glass);
  border:        1px solid var(--border);
  border-radius: var(--radius-md);
  transition:
    background  0.2s,
    transform   0.2s var(--ease-bounce),
    border-color 0.2s;
  animation:    fadeUp 0.4s var(--ease-out) both;
  cursor:       default;
}

.month-card:hover {
  background:   rgba(245, 237, 224, 0.04);
  transform:    translateY(-2px);
  border-color: var(--border-mid);
}

.month-card__name {
  font-family:    var(--font-mono);
  font-size:      0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color:          var(--text-2);
  margin-bottom:  0.5rem;
}

.month-card__bar-track {
  height:        4px;
  background:    var(--border);
  border-radius: 2px;
  margin-bottom: 0.6rem;
  overflow:      hidden;
}

.month-card__bar-fill {
  height:        100%;
  border-radius: 2px;
  background:    var(--sage);
  transition:    width 0.6s var(--ease-out);
  transform-origin: left;
}

.month-card__bar-fill--has-special {
  background: linear-gradient(90deg, var(--sage), var(--amber));
}

.month-card__counts {
  display:     flex;
  gap:         var(--sp-1);
  align-items: baseline;
}

.month-card__total {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size:   1.3rem;
  color:       var(--text-1);
  line-height: 1;
}

.month-card__detail {
  font-family: var(--font-mono);
  font-size:   0.65rem;
  color:       var(--text-2);
}

.month-card__special {
  font-family: var(--font-mono);
  font-size:   0.65rem;
  color:       var(--amber);
  margin-left: auto;
}

.month-card__duo {
  font-family: var(--font-mono);
  font-size:   0.65rem;
  color:       #e8a0b8;
}

.month-card__counts:has(.month-card__special) .month-card__duo {
  margin-left: 0;
}

.month-card__counts:not(:has(.month-card__special)) .month-card__duo {
  margin-left: auto;
}

.month-card--empty {
  opacity: 0.35;
}


/* =============================================================================
   17. NAPLÓ / LISTA NÉZET
   ============================================================================= */

.diary-section {
  max-width:     900px;
  margin-inline: auto;
  padding:       var(--sp-4) var(--sp-3);
}

.diary-section__hint {
  font-size:   0.75rem;
  color:       var(--text-2);
  font-style:  italic;
  margin-top:  0.35rem;
  line-height: 1.45;
}

.diary-filter {
  display:       flex;
  gap:           0.5rem;
  flex-wrap:     wrap;
  margin-bottom: var(--sp-3);
}

.diary-filter__btn {
  padding:       0.3rem 0.9rem;
  border-radius: 100px;
  font-family:   var(--font-mono);
  font-size:     0.68rem;
  letter-spacing: 0.04em;
  background:    var(--glass);
  border:        1px solid var(--border);
  color:         var(--text-2);
  transition:    all 0.15s;
}

.diary-filter__btn:hover { border-color: var(--border-mid); color: var(--text-1); }

.diary-filter__btn--active {
  background:   var(--amber-dim);
  border-color: rgba(218, 160, 109, 0.3);
  color:        var(--amber-light);
}

.diary-list {
  display:        flex;
  flex-direction: column;
  gap:            var(--sp-2);
}

.diary-entry {
  display:       grid;
  grid-template-columns: 80px 1fr;
  gap:           var(--sp-2);
  width:         100%;
  margin:        0;
  padding:       var(--sp-2) var(--sp-3);
  text-align:    left;
  font:          inherit;
  color:         inherit;
  cursor:        pointer;
  background:    var(--glass);
  border:        1px solid var(--border);
  border-radius: var(--radius-md);
  transition:    all 0.2s var(--ease-smooth);
  animation:     fadeUp 0.35s var(--ease-out) both;
}

.diary-entry:hover {
  background:   rgba(245, 237, 224, 0.04);
  border-color: var(--border-mid);
}

.diary-entry:focus-visible {
  outline:        2px solid rgba(218, 160, 109, 0.55);
  outline-offset: 2px;
}

.diary-entry--special {
  border-color: rgba(218, 160, 109, 0.25);
  background:   var(--amber-glow);
}

.diary-entry__date-block {
  display:        flex;
  flex-direction: column;
  align-items:    center;
  justify-content: center;
  border-right:   1px solid var(--border);
  padding-right:  var(--sp-2);
}

.diary-entry__day {
  font-family:  var(--font-display);
  font-style:   italic;
  font-size:    2rem;
  font-weight:  500;
  color:        var(--text-1);
  line-height:  1;
}

.diary-entry__month {
  font-family:    var(--font-mono);
  font-size:      0.58rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color:          var(--text-2);
  margin-top:     2px;
}

.diary-entry__year {
  font-family: var(--font-mono);
  font-size:   0.55rem;
  color:       var(--text-3);
}

.diary-entry__body {
  display:        flex;
  flex-direction: column;
  justify-content: center;
  gap:            0.3rem;
}

.diary-entry__type {
  display:     flex;
  align-items: center;
  gap:         0.4rem;
  font-family: var(--font-mono);
  font-size:   0.7rem;
  letter-spacing: 0.05em;
}

.diary-entry__type-dot {
  width:         7px;
  height:        7px;
  border-radius: 50%;
  flex-shrink:   0;
}

.diary-entry__type-dot--meeting { background: var(--sage); }
.diary-entry__type-dot--special { background: var(--amber); box-shadow: 0 0 6px rgba(218,160,109,0.5); }

.diary-entry__type-label--meeting { color: var(--sage-light); }
.diary-entry__type-label--special { color: var(--amber-light); }

.diary-entry__duo-chip {
  display:       inline-block;
  margin-left:   0.5rem;
  padding:       0.12rem 0.45rem;
  border-radius: 999px;
  font-family:   var(--font-mono);
  font-size:     0.62rem;
  letter-spacing: 0.04em;
  vertical-align: middle;
}

.diary-entry__duo-chip--yes {
  color:            #ffc8dc;
  background:       rgba(232, 138, 168, 0.18);
  border:           1px solid rgba(232, 138, 168, 0.35);
}

.diary-entry__duo-chip--no {
  color:      var(--text-3);
  background: rgba(245, 237, 224, 0.06);
  border:     1px solid var(--border-mid);
}

.diary-entry__note {
  font-style:  italic;
  font-size:   0.85rem;
  color:       var(--text-2);
  line-height: 1.5;
}

.diary-entry__description {
  font-size: 0.83rem;
  color: var(--text-2);
  line-height: 1.6;
  border-left: 2px solid rgba(218, 160, 109, 0.25);
  padding-left: 0.65rem;
  margin-top: 0.1rem;
  white-space: pre-line;
}

.diary-entry__locations {
  display:     flex;
  flex-wrap:   wrap;
  gap:         0.32rem;
  align-items: center;
  margin-top:  0.18rem;
}

.diary-entry__locations-label {
  font-family:    var(--font-mono);
  font-size:      0.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color:          var(--text-2);
  opacity:        0.75;
  margin-right:   0.15rem;
}

.diary-entry__location-chip {
  display:        inline-flex;
  align-items:    center;
  gap:            0.28rem;
  padding:        0.18rem 0.6rem;
  border-radius:  100px;
  background:     var(--sage-dim);
  border:         1px solid rgba(107, 158, 122, 0.32);
  color:          var(--sage-light);
  font-family:    var(--font-mono);
  font-size:      0.66rem;
  letter-spacing: 0.02em;
}

.diary-entry__location-chip::before {
  content: '📍';
  font-size: 0.6rem;
  opacity: 0.85;
}

.diary-entry__companions {
  display:     flex;
  flex-wrap:   wrap;
  gap:         0.32rem;
  align-items: center;
  margin-top:  0.18rem;
}

.diary-entry__companions-label {
  font-family:    var(--font-mono);
  font-size:      0.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color:          var(--text-2);
  opacity:        0.75;
  margin-right:   0.15rem;
}

.diary-entry__companion-chip {
  display:        inline-flex;
  align-items:    center;
  padding:        0.18rem 0.6rem;
  border-radius:  100px;
  background:     rgba(232, 138, 168, 0.12);
  border:         1px solid rgba(232, 138, 168, 0.32);
  color:          #f0b8cc;
  font-family:    var(--font-mono);
  font-size:      0.66rem;
  letter-spacing: 0.02em;
}

.diary-empty {
  text-align:  center;
  padding:     var(--sp-8) var(--sp-3);
  color:       var(--text-2);
}

.diary-empty__icon {
  font-size:     2.5rem;
  margin-bottom: var(--sp-2);
  opacity:       0.4;
}

.diary-empty__text {
  font-family: var(--font-display);
  font-style:  italic;
  font-size:   1.1rem;
  color:       var(--text-3);
}


/* =============================================================================
   17b. IDŐVONAL NÉZET (tl)
   ============================================================================= */

.timeline-section.tl {
  max-width:     min(100%, 1100px);
  margin-inline: auto;
  padding:       var(--sp-3) var(--sp-3) var(--sp-5);
}

.tl__lede {
  font-size:   0.78rem;
  color:       var(--text-2);
  font-style:  italic;
  margin-top:  0.4rem;
  line-height: 1.5;
}

.year-nav--timeline {
  margin: var(--sp-2) 0;
}

/* —— Év összefoglaló —— */
.tl__stats {
  margin-bottom: var(--sp-3);
}

.tl-year {
  padding:       var(--sp-2) var(--sp-3);
  border-radius: var(--radius-lg);
  border:        1px solid var(--border);
  background:
    linear-gradient(135deg, rgba(218, 160, 109, 0.06), transparent 55%),
    var(--surface-2);
}

.tl-year__nums {
  display:   flex;
  flex-wrap: wrap;
  gap:       var(--sp-2) var(--sp-4);
  margin-bottom: var(--sp-2);
}

.tl-stat {
  display:        flex;
  flex-direction: column;
  gap:            0.1rem;
}

.tl-stat__n {
  font-family: var(--font-display);
  font-size:   1.35rem;
  font-weight: 500;
  line-height: 1;
  color:       var(--text-1);
}

.tl-stat__l {
  font-family:    var(--font-mono);
  font-size:      0.58rem;
  letter-spacing: 0.06em;
  color:          var(--text-2);
}

.tl-stat--muted .tl-stat__n {
  color: var(--text-2);
  font-size: 1.1rem;
}

.tl-year__bar {
  display:               grid;
  grid-template-columns: repeat(12, 1fr);
  gap:                   3px;
}

.tl-year__seg {
  font-family:    var(--font-mono);
  font-size:      0.48rem;
  letter-spacing: 0.02em;
  text-align:     center;
  padding:        0.35rem 0 0.2rem;
  border-radius:  var(--radius-sm);
  color:          var(--text-3);
  background:     rgba(245, 237, 224, 0.03);
  border:         1px solid transparent;
  transition:     background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.tl-year__seg--on {
  color:      var(--sage-light);
  background: var(--sage-dim);
  border-color: rgba(107, 158, 122, 0.25);
}

.tl-year__seg--now {
  color:        var(--amber-light);
  border-color: rgba(218, 160, 109, 0.45);
  box-shadow:   inset 0 0 12px rgba(218, 160, 109, 0.12);
}

.tl-year__filter-note {
  margin-top:  0.65rem;
  font-family: var(--font-mono);
  font-size:   0.58rem;
  color:       var(--amber);
  opacity:     0.85;
}

/* —— Toolbar —— */
.tl__toolbar {
  display:         flex;
  flex-wrap:       wrap;
  align-items:     center;
  justify-content: space-between;
  gap:             var(--sp-2);
  margin-bottom:   var(--sp-3);
}

.tl__modes {
  display:       flex;
  background:    rgba(245, 237, 224, 0.04);
  border:        1px solid var(--border);
  border-radius: var(--radius-md);
  padding:       3px;
  gap:           2px;
}

.tl__mode {
  padding:        0.35rem 0.85rem;
  border-radius:  calc(var(--radius-md) - 3px);
  font-family:    var(--font-mono);
  font-size:      0.62rem;
  letter-spacing: 0.06em;
  color:          var(--text-2);
  transition:     background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.tl__mode:hover {
  color: var(--text-1);
}

.tl__mode--active {
  background: linear-gradient(180deg, rgba(218, 160, 109, 0.22), rgba(218, 160, 109, 0.1));
  color:      var(--amber-light);
  box-shadow: 0 1px 0 rgba(218, 160, 109, 0.2);
}

.tl__panel[hidden] {
  display: none !important;
}

/* —— Hónapos folyam (vízszintes) —— */
.tl-river {
  overflow-x:                 auto;
  overflow-y:                 hidden;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type:           x proximity;
  padding:                    var(--sp-2);
  border-radius:              var(--radius-lg);
  border:                     1px solid var(--border);
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(218, 160, 109, 0.07), transparent),
    rgba(10, 8, 6, 0.6);
  scrollbar-width: thin;
  scrollbar-color: rgba(218, 160, 109, 0.35) transparent;
}

.tl-river:focus-visible {
  outline:        2px solid rgba(218, 160, 109, 0.5);
  outline-offset: 2px;
}

.tl-river__grid {
  display:     flex;
  gap:         6px;
  min-height:  12rem;
  align-items: stretch;
}

.tl-col {
  flex:         0 0 min(7.5rem, 22vw);
  min-width:    5.75rem;
  display:      flex;
  flex-direction: column;
  scroll-snap-align: start;
  border-radius: var(--radius-md);
  border:        1px solid var(--border);
  background:    rgba(245, 237, 224, 0.02);
  transition:    border-color 0.2s ease, background 0.2s ease;
}

.tl-col--has {
  background: rgba(245, 237, 224, 0.035);
  border-color: var(--border-mid);
}

.tl-col--now {
  border-color: rgba(218, 160, 109, 0.45);
  background:   linear-gradient(180deg, rgba(218, 160, 109, 0.1), rgba(218, 160, 109, 0.02));
  box-shadow:   0 0 24px rgba(218, 160, 109, 0.08);
}

.tl-col__head {
  display:         flex;
  align-items:     baseline;
  justify-content: space-between;
  gap:             0.25rem;
  padding:         0.55rem 0.5rem 0.45rem;
  border-bottom:     1px solid var(--border);
}

.tl-col--has .tl-col__head {
  border-bottom-color: rgba(107, 158, 122, 0.2);
}

.tl-col__name {
  font-family:    var(--font-mono);
  font-size:      0.55rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color:          var(--text-2);
  line-height:    1.2;
}

.tl-col--has .tl-col__name {
  color: var(--text-1);
}

.tl-col--now .tl-col__name {
  color: var(--amber-light);
}

.tl-col__count {
  font-family: var(--font-display);
  font-size:   0.85rem;
  color:       var(--sage-light);
  line-height: 1;
}

.tl-col__count--zero {
  font-family: var(--font-mono);
  font-size:   0.7rem;
  color:       var(--text-3);
  opacity:     0.5;
}

.tl-col__list {
  list-style: none;
  display:    flex;
  flex-direction: column;
  gap:        0.35rem;
  padding:    0.4rem 0.35rem 0.5rem;
  flex:       1;
}

.tl-col__void {
  flex: 1;
  min-height: 2rem;
}

.tl-chip-wrap {
  animation: fadeUp 0.35s var(--ease-out) both;
}

.tl-chip {
  display:       grid;
  grid-template-columns: 1.65rem minmax(0, 1fr);
  gap:           0.35rem;
  width:         100%;
  padding:       0.4rem 0.35rem;
  text-align:    left;
  font:          inherit;
  color:         inherit;
  cursor:        pointer;
  border-radius: var(--radius-sm);
  border:        1px solid transparent;
  background:    transparent;
  transition:    background 0.2s ease, border-color 0.2s ease, transform 0.2s var(--ease-out);
}

.tl-chip:hover {
  background:   rgba(245, 237, 224, 0.05);
  border-color: var(--border-mid);
}

.tl-chip:focus-visible {
  outline:        2px solid rgba(218, 160, 109, 0.55);
  outline-offset: 1px;
}

.tl-chip--special {
  border-left: 2px solid rgba(218, 160, 109, 0.65);
  background:  var(--amber-glow);
}

.tl-chip--duo {
  border-left: 2px solid rgba(196, 92, 122, 0.55);
  background:  var(--rose-glow);
}

.tl-chip--group {
  opacity: 0.92;
}

.tl-chip__day {
  font-family: var(--font-display);
  font-size:   1.1rem;
  line-height: 1;
  color:       var(--text-1);
  align-self:  start;
  padding-top: 0.1rem;
}

.tl-chip__body {
  display:        flex;
  flex-direction: column;
  gap:            0.2rem;
  min-width:      0;
}

.tl-badges {
  display: flex;
  gap:     0.2rem;
  flex-wrap: wrap;
}

.tl-badge {
  font-size:   0.55rem;
  line-height: 1;
  opacity:     0.9;
}

.tl-badge--special { color: var(--amber-light); }
.tl-badge--duo     { color: var(--rose-light); }

.tl-chip__prev {
  font-size:   0.62rem;
  line-height: 1.35;
  color:       var(--text-2);
  font-style:  italic;
  display:     -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow:    hidden;
}

.tl-chip__loc {
  font-family: var(--font-mono);
  font-size:   0.5rem;
  color:       var(--text-3);
  white-space: nowrap;
  overflow:    hidden;
  text-overflow: ellipsis;
}

/* —— Napló feed (függőleges) —— */
.tl-journal {
  position: relative;
  padding-left: 0.25rem;
}

.tl-journal__inner {
  position: relative;
  padding-left: 3.25rem;
}

.tl-journal__inner::before {
  content:    '';
  position:   absolute;
  left:       1.15rem;
  top:        0.5rem;
  bottom:     0.5rem;
  width:      2px;
  border-radius: 1px;
  background: linear-gradient(
    180deg,
    rgba(107, 158, 122, 0.5),
    rgba(218, 160, 109, 0.45) 45%,
    rgba(196, 92, 122, 0.35)
  );
  opacity:    0.65;
}

.tl-chapter + .tl-chapter {
  margin-top: var(--sp-5);
}

.tl-chapter__title {
  display:         flex;
  align-items:     baseline;
  gap:             0.5rem;
  margin:          0 0 var(--sp-2);
  padding-left:    0.15rem;
}

.tl-chapter__month {
  font-family:    var(--font-display);
  font-size:      1.15rem;
  font-weight:    500;
  color:          var(--amber-light);
  letter-spacing: 0.02em;
}

.tl-chapter__n {
  font-family:    var(--font-mono);
  font-size:      0.58rem;
  padding:        0.12rem 0.45rem;
  border-radius:  100px;
  border:         1px solid rgba(218, 160, 109, 0.35);
  color:          var(--amber);
  background:     var(--amber-dim);
}

.tl-chapter__list {
  display:        flex;
  flex-direction: column;
  gap:            var(--sp-2);
}

.tl-story {
  position:  relative;
  display:   grid;
  grid-template-columns: 2.5rem minmax(0, 1fr);
  gap:       var(--sp-2);
  animation: fadeUp 0.4s var(--ease-out) both;
}

.tl-story::before {
  content:       '';
  position:      absolute;
  left:          -2.1rem;
  top:           1.35rem;
  width:         0.55rem;
  height:        0.55rem;
  border-radius: 50%;
  background:    var(--sage-light);
  border:        2px solid rgba(107, 158, 122, 0.6);
  box-shadow:    0 0 10px rgba(107, 158, 122, 0.4);
  z-index:       1;
}

.tl-story--special::before {
  background:   var(--amber-light);
  border-color: rgba(218, 160, 109, 0.7);
  box-shadow:   0 0 12px rgba(218, 160, 109, 0.45);
}

.tl-story--duo::before {
  background:   #f0a8c4;
  border-color: rgba(196, 92, 122, 0.75);
  box-shadow:   0 0 12px rgba(196, 92, 122, 0.45);
}

.tl-story__when {
  display:        flex;
  flex-direction: column;
  align-items:    flex-end;
  padding-top:    0.65rem;
  text-align:     right;
}

.tl-story__day {
  font-family: var(--font-display);
  font-size:   1.75rem;
  line-height: 1;
  color:       var(--text-1);
}

.tl-story__wd {
  font-family:    var(--font-mono);
  font-size:      0.52rem;
  letter-spacing: 0.04em;
  color:          var(--text-3);
  margin-top:     0.2rem;
}

.tl-story__card {
  display:        block;
  width:          100%;
  padding:        var(--sp-2) var(--sp-3);
  text-align:     left;
  font:           inherit;
  color:          inherit;
  cursor:         pointer;
  border-radius:  var(--radius-md);
  border:         1px solid var(--border);
  background:     var(--glass);
  transition:     border-color 0.2s ease, background 0.2s ease, transform 0.2s var(--ease-out);
}

.tl-story__card:hover {
  border-color: var(--border-mid);
  background:   rgba(245, 237, 224, 0.05);
}

.tl-story__card:focus-visible {
  outline:        2px solid rgba(218, 160, 109, 0.55);
  outline-offset: 2px;
}

.tl-story--special .tl-story__card {
  border-color: rgba(218, 160, 109, 0.32);
  background:   linear-gradient(135deg, var(--amber-glow), transparent);
}

.tl-story--duo .tl-story__card {
  border-color: rgba(196, 92, 122, 0.35);
  background:   linear-gradient(135deg, var(--rose-glow), transparent);
}

.tl-story__head {
  display:         flex;
  flex-wrap:       wrap;
  align-items:     center;
  justify-content: space-between;
  gap:             0.35rem 0.75rem;
  margin-bottom:   0.5rem;
}

.tl-story__type {
  font-family:    var(--font-mono);
  font-size:      0.62rem;
  letter-spacing: 0.06em;
  color:          var(--sage-light);
}

.tl-story--special .tl-story__type { color: var(--amber-light); }
.tl-story--duo .tl-story__type     { color: var(--rose-light); }

.tl-story__meta {
  font-family: var(--font-mono);
  font-size:   0.62rem;
  color:       var(--text-2);
  margin:      0 0 0.4rem;
}

.tl-story__quote {
  font-size:   0.82rem;
  line-height: 1.55;
  color:       var(--text-2);
  margin:      0;
  font-style:  italic;
}

.tl-story--special .tl-story__quote { font-style: normal; }

/* —— Üres állapot —— */
.tl-empty {
  text-align:    center;
  padding:       var(--sp-6) var(--sp-3);
  border-radius: var(--radius-lg);
  border:        1px dashed var(--border-mid);
  background:    var(--glass);
}

.tl-empty__year {
  display:        block;
  font-family:    var(--font-mono);
  font-size:      0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color:          var(--amber);
  margin-bottom:  0.75rem;
}

.tl-empty__title {
  font-family: var(--font-display);
  font-size:   1.25rem;
  color:       var(--text-1);
  margin-bottom: 0.35rem;
}

.tl-empty__text {
  font-size:  0.8rem;
  color:      var(--text-3);
  font-style: italic;
}

@media (hover: hover) and (pointer: fine) {
  .tl-chip:hover {
    transform: translateY(-1px);
  }

  .tl-story__card:hover {
    transform: translateX(4px);
  }
}

@media (max-width: 480px) {
  .timeline-section.tl {
    padding-inline: clamp(14px, 4.2vw, 22px);
  }

  .tl-year__nums {
    gap: var(--sp-2) var(--sp-3);
  }

  .tl-stat__n {
    font-size: 1.15rem;
  }

  .tl-col {
    flex-basis: min(6.5rem, 28vw);
  }

  .tl-journal__inner {
    padding-left: 2.75rem;
  }

  .tl-story {
    grid-template-columns: 2rem minmax(0, 1fr);
  }

  .tl-story__day {
    font-size: 1.45rem;
  }
}


/* =============================================================================
   18. CONTEXT MENU
   ============================================================================= */

.context-menu {
  position:      fixed;
  z-index:       500;
  min-width:     200px;
  background:    var(--surface-1);
  border:        1px solid var(--border-mid);
  border-radius: var(--radius-md);
  padding:       0.4rem;
  box-shadow:    0 20px 50px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,245,235,0.03);
  animation:     fadeIn 0.15s var(--ease-out) both;
}

.context-menu[hidden] { display: none; }

.context-menu__header {
  padding:        0.4rem 0.7rem 0.6rem;
  font-family:    var(--font-mono);
  font-size:      0.65rem;
  letter-spacing: 0.08em;
  color:          var(--amber);
  opacity:        0.75;
  border-bottom:  1px solid var(--border);
  margin-bottom:  0.3rem;
}

.context-menu__item {
  display:       flex;
  align-items:   center;
  gap:           0.6rem;
  width:         100%;
  padding:       0.48rem 0.7rem;
  border-radius: var(--radius-sm);
  font-family:   var(--font-mono);
  font-size:     0.78rem;
  color:         var(--text-1);
  text-align:    left;
  transition:    background 0.1s;
  letter-spacing: 0.02em;
}

.context-menu__item:hover { background: rgba(245,237,224,0.06); }

.context-menu__item--danger { color: var(--error); }
.context-menu__item--danger:hover { background: var(--error-dim); }
.context-menu__item--idle { color: #ff9aa3; }
.context-menu__item--idle:hover { background: rgba(180, 42, 55, 0.16); }

.context-menu__dot {
  display:       block;
  width:         8px;
  height:        8px;
  border-radius: 50%;
  flex-shrink:   0;
}

.context-menu__dot--meeting { background: var(--sage); }
.context-menu__dot--special { background: var(--amber); }

.context-menu__icon {
  font-size:  0.9rem;
  width:      14px;
  text-align: center;
  color:      var(--text-2);
}

.context-menu__separator {
  border:     none;
  border-top: 1px solid var(--border);
  margin:     0.3rem 0;
}

/* —— Üresjárat / távollét —— */
.idle-modal[hidden] { display: none; }
.idle-modal { position: fixed; inset: 0; z-index: 600; display: grid; place-items: center; padding: 20px; }
.idle-modal__backdrop { position: absolute; inset: 0; background: rgba(5, 3, 4, 0.72); backdrop-filter: blur(4px); }
.idle-modal__panel { position: relative; width: min(100%, 440px); max-height: min(86dvh, 680px); overflow: auto; padding: 1.4rem; border: 1px solid rgba(238, 76, 91, 0.42); border-radius: var(--radius-lg); background: linear-gradient(150deg, #241316, #120d0e); box-shadow: 0 24px 70px rgba(0,0,0,.65), 0 0 28px rgba(185, 38, 53, .15); }
.idle-modal__eyebrow, .idle-modal__saved-title { margin: 0 0 .35rem; font-family: var(--font-mono); font-size: .61rem; letter-spacing: .15em; text-transform: uppercase; color: #ff9aa3; }
.idle-modal__title { margin: 0; font-family: var(--font-display); font-size: 1.35rem; font-weight: 500; }
.idle-modal__hint { margin: .5rem 0 1.1rem; color: var(--text-2); font-size: .86rem; line-height: 1.45; }
.idle-modal__dates { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.idle-modal__date-trigger { display: grid; gap: .35rem; padding: .55rem .6rem; color: var(--text-2); text-align: left; font-size: .69rem; background: rgba(255,255,255,.035); border: 1px solid var(--border-mid); border-radius: var(--radius-sm); cursor: pointer; }
.idle-modal__date-trigger strong { color: var(--text-1); font: .78rem var(--font-body); }
.idle-modal__date-trigger--active { border-color: rgba(225, 98, 108, .72); box-shadow: 0 0 0 2px rgba(225, 98, 108, .1); }
.idle-picker { margin: .75rem 0 1rem; padding: .65rem; border: 1px solid rgba(245,237,224,.1); border-radius: var(--radius-sm); background: rgba(255,255,255,.025); }
.idle-picker__nav { display: grid; grid-template-columns: 28px 1fr 28px; align-items: center; text-align: center; margin-bottom: .45rem; }
.idle-picker__nav button { width: 28px; height: 26px; border: 0; border-radius: 4px; color: var(--text-2); background: transparent; cursor: pointer; }
.idle-picker__nav button:hover { color: #ffafb6; background: rgba(225,98,108,.12); }
.idle-picker__nav strong { font: .7rem var(--font-mono); color: var(--text-1); }
.idle-picker__weekdays, .idle-picker__days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; text-align: center; }
.idle-picker__weekdays { margin-bottom: 3px; color: var(--text-3); font: .55rem var(--font-mono); }
.idle-picker__days > span { min-height: 27px; }
.idle-picker__day { min-height: 27px; border: 1px solid transparent; border-radius: 4px; color: var(--text-2); background: transparent; font: .66rem var(--font-mono); cursor: pointer; }
.idle-picker__day:hover { border-color: rgba(225,98,108,.45); color: #ffd6d9; }
.idle-picker__day--within { background: rgba(225,98,108,.1); color: #ffd6d9; }
.idle-picker__day--selected { border-color: rgba(225,98,108,.72); background: rgba(225,98,108,.22); color: #fff1f2; }
.idle-modal__field { display: grid; gap: .35rem; margin-bottom: .85rem; color: var(--text-2); font-size: .72rem; }
.idle-modal__field span { opacity: .65; }
.idle-modal__field input { width: 100%; min-width: 0; padding: .6rem .65rem; color: var(--text-1); font: inherit; color-scheme: dark; background: rgba(255,255,255,.045); border: 1px solid var(--border-mid); border-radius: var(--radius-sm); outline: none; }
.idle-modal__field input:focus { border-color: #df5260; box-shadow: 0 0 0 3px rgba(223,82,96,.14); }
.idle-modal__error { margin: -.35rem 0 .8rem; color: #ff9aa3; font-size: .75rem; line-height: 1.4; }
.idle-modal__saved { display: grid; gap: .4rem; margin-top: .2rem; }
.idle-modal__range { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .45rem .55rem; font-size: .75rem; color: var(--text-2); background: rgba(180,42,55,.1); border-left: 2px solid rgba(238,76,91,.65); }
.idle-modal__range button { border: 0; background: transparent; color: #ff9aa3; cursor: pointer; font-size: 1.15rem; line-height: 1; }
.idle-modal__actions { display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1.15rem; }
.idle-modal__btn { padding: .58rem .75rem; border-radius: var(--radius-sm); border: 1px solid var(--border-mid); color: var(--text-1); background: rgba(255,255,255,.04); font: 600 .7rem var(--font-mono); cursor: pointer; }
.idle-modal__btn--save { border-color: rgba(238,76,91,.7); background: rgba(180,42,55,.25); color: #ffd7da; }
@media (max-width: 520px) { .idle-modal { align-items: end; padding: 0; } .idle-modal__panel { width: 100%; border-radius: var(--radius-lg) var(--radius-lg) 0 0; } }


/* =============================================================================
   19. NOTE MODAL
   ============================================================================= */

.note-modal {
  position:        fixed;
  inset:           0;
  z-index:         600;
  display:         flex;
  align-items:     center;
  justify-content: center;
  padding:         var(--sp-2);
  animation:       fadeIn 0.2s var(--ease-out) both;
}

.note-modal[hidden] { display: none !important; }

.note-modal__backdrop {
  position:   absolute;
  inset:      0;
  background: rgba(8, 8, 8, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.note-modal__panel {
  position:      relative;
  z-index:       1;
  width:         100%;
  max-width:     480px;
  padding:       var(--sp-4);
  background:    var(--surface-1);
  border:        1px solid var(--border-mid);
  border-radius: var(--radius-xl);
  box-shadow:    0 40px 100px rgba(0,0,0,0.7);
  animation:     fadeUp 0.25s var(--ease-out) both;
}

.note-modal__header {
  margin-bottom: var(--sp-3);
}

.note-modal__eyebrow {
  font-family:    var(--font-mono);
  font-size:      0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color:          var(--amber);
  opacity:        0.7;
  margin-bottom:  0.3rem;
}

.note-modal__title {
  font-family:  var(--font-display);
  font-style:   italic;
  font-size:    1.6rem;
  font-weight:  500;
  color:        var(--text-1);
}

.note-modal__date {
  font-family:    var(--font-mono);
  font-size:      0.68rem;
  letter-spacing: 0.08em;
  color:          var(--text-2);
  margin-top:     0.3rem;
}

.note-modal__textarea {
  width:         100%;
  background:    rgba(245,237,224,0.03);
  border:        1px solid var(--border);
  border-radius: var(--radius-md);
  color:         var(--text-1);
  padding:       var(--sp-2);
  font-family:   var(--font-body);
  font-style:    italic;
  font-size:     0.9rem;
  line-height:   1.7;
  outline:       none;
  transition:    border-color 0.15s;
  min-height:    120px;
}

.note-modal__textarea:focus {
  border-color: rgba(218, 160, 109, 0.4);
  box-shadow:   0 0 0 3px rgba(218, 160, 109, 0.08);
}

.note-modal__textarea::placeholder { color: var(--text-3); }

.note-modal__char-count {
  font-family:  var(--font-mono);
  font-size:    0.65rem;
  color:        var(--text-3);
  text-align:   right;
  margin-top:   0.4rem;
  margin-bottom: var(--sp-3);
}

.note-modal__actions {
  display:         flex;
  justify-content: flex-end;
  gap:             var(--sp-1);
}

.note-modal__btn {
  padding:       0.55rem 1.4rem;
  border-radius: var(--radius-sm);
  font-family:   var(--font-mono);
  font-size:     0.78rem;
  font-weight:   500;
  letter-spacing: 0.05em;
  border:        1px solid transparent;
  transition:    all 0.15s;
}

.note-modal__btn:active { transform: scale(0.95); }

.note-modal__btn--cancel {
  background:  var(--glass);
  border-color: var(--border);
  color:       var(--text-2);
}

.note-modal__btn--cancel:hover {
  background:  rgba(245,237,224,0.06);
  color:       var(--text-1);
}

.note-modal__btn--save {
  background:   var(--amber-dim);
  border-color: rgba(218, 160, 109, 0.35);
  color:        var(--amber-light);
}

.note-modal__btn--save:hover {
  background: rgba(218, 160, 109, 0.22);
  box-shadow: 0 0 20px rgba(218, 160, 109, 0.12);
}

/* =============================================================================
   19a. DUO MODAL
   ============================================================================= */

.duo-modal {
  position:        fixed;
  inset:           0;
  z-index:         900;
  display:         flex;
  align-items:     center;
  justify-content: center;
  padding:         var(--sp-3);
}

.duo-modal[hidden] { display: none !important; }

.duo-modal__backdrop {
  position:        absolute;
  inset:           0;
  background:      rgba(4, 3, 2, 0.72);
  backdrop-filter: blur(4px);
}

.duo-modal__panel {
  position:      relative;
  width:         min(100%, 22rem);
  padding:       var(--sp-4);
  background:    var(--surface-1);
  border:        1px solid var(--border-mid);
  border-radius: var(--radius-lg);
  box-shadow:    var(--shadow-lg);
  z-index:       1;
}

.duo-modal__header { margin-bottom: var(--sp-3); }

.duo-modal__eyebrow {
  font-family:    var(--font-mono);
  font-size:      0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color:          var(--text-3);
  margin:         0 0 0.25rem;
}

.duo-modal__title {
  font-family: var(--font-display);
  font-size:   1.35rem;
  font-weight: 500;
  margin:      0;
  color:       var(--text-1);
}

.duo-modal__date {
  font-family: var(--font-mono);
  font-size:   0.75rem;
  color:       var(--text-2);
  margin:      0.35rem 0 0;
}

.duo-modal__hint {
  font-family: var(--font-mono);
  font-size:   0.65rem;
  line-height: 1.45;
  color:       var(--text-3);
  margin:      0 0 var(--sp-3);
}

.duo-modal__hint-mark {
  color:       #ffb8d0;
  font-weight: 700;
}

.duo-picker {
  display:        flex;
  flex-direction: column;
  gap:            var(--sp-2);
}

.duo-picker__opt {
  display:       flex;
  align-items:   center;
  gap:           0.5rem;
  width:         100%;
  padding:       0.65rem 0.85rem;
  border:        1px solid var(--border-mid);
  border-radius: var(--radius-md);
  background:    rgba(245, 237, 224, 0.03);
  color:         var(--text-2);
  font-family:   var(--font-body);
  font-size:     0.9rem;
  text-align:    left;
  cursor:        pointer;
  transition:    background 0.15s, border-color 0.15s, color 0.15s;
}

.duo-picker__opt:hover {
  background:   rgba(245, 237, 224, 0.07);
  border-color: var(--border-light);
  color:        var(--text-1);
}

.duo-picker__opt--active {
  background:   rgba(232, 138, 168, 0.12);
  border-color: rgba(232, 138, 168, 0.45);
  color:        #ffc8dc;
}

.duo-picker__opt[data-duo="no"].duo-picker__opt--active {
  background:   rgba(245, 237, 224, 0.08);
  border-color: var(--border-light);
  color:        var(--text-1);
}

.duo-picker__icon {
  font-size:   1rem;
  line-height: 1;
}

.duo-picker__label { flex: 1; }

.duo-modal__others {
  display:               grid;
  grid-template-rows:    0fr;
  opacity:               0;
  margin-top:            0;
  transition:
    grid-template-rows 0.32s var(--ease-out),
    opacity            0.24s var(--ease-out),
    margin-top         0.32s var(--ease-out);
  overflow:              hidden;
}

.duo-modal__others:not([hidden]) {
  display: grid;
}

.duo-modal__others--visible {
  grid-template-rows: 1fr;
  opacity:            1;
  margin-top:         var(--sp-3);
}

.duo-modal__others-inner {
  min-height: 0;
  overflow:   hidden;
}

.duo-modal__others-label {
  display:        block;
  font-family:    var(--font-mono);
  font-size:      0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color:          var(--text-3);
  margin:         0 0 0.45rem;
}

.duo-modal__others-chips {
  display:       flex;
  flex-wrap:     wrap;
  gap:           0.4rem;
  min-height:    1.75rem;
  padding:       0.5rem 0.6rem;
  background:    rgba(245, 237, 224, 0.025);
  border:        1px dashed rgba(232, 138, 168, 0.28);
  border-radius: var(--radius-md);
  align-content: flex-start;
  margin-bottom: 0.55rem;
}

.duo-modal__others-chips:empty::before {
  content:     'Még nincs megadva – írd be alább.';
  font-family: var(--font-body);
  font-style:  italic;
  font-size:   0.76rem;
  color:       var(--text-3);
}

.duo-modal__others-chip {
  display:        inline-flex;
  align-items:    center;
  gap:            0.35rem;
  padding:        0.28rem 0.35rem 0.28rem 0.65rem;
  background:     rgba(232, 138, 168, 0.12);
  border:         1px solid rgba(232, 138, 168, 0.35);
  color:          #f0b8cc;
  border-radius:  100px;
  font-family:    var(--font-mono);
  font-size:      0.72rem;
  animation:      fadeIn 0.18s var(--ease-out) both;
}

.duo-modal__others-chip__remove {
  width:           18px;
  height:          18px;
  display:         inline-flex;
  align-items:     center;
  justify-content: center;
  border-radius:   50%;
  background:      rgba(8, 8, 8, 0.35);
  color:           inherit;
  font-size:       0.85rem;
  line-height:     1;
  transition:      background 0.12s, transform 0.1s var(--ease-bounce);
}

.duo-modal__others-chip__remove:hover {
  background: var(--error-dim);
  color:      var(--error);
}

.duo-modal__others-input {
  width:         100%;
  background:    rgba(245, 237, 224, 0.04);
  border:        1px solid var(--border);
  border-radius: var(--radius-md);
  color:         var(--text-1);
  padding:       0.62rem 0.85rem;
  font-family:   var(--font-body);
  font-size:     0.9rem;
  outline:       none;
  transition:    border-color 0.15s, box-shadow 0.15s;
}

.duo-modal__others-input::placeholder { color: var(--text-3); font-style: italic; }

.duo-modal__others-input:focus {
  border-color: rgba(232, 138, 168, 0.45);
  box-shadow:   0 0 0 3px rgba(232, 138, 168, 0.1);
}

.duo-modal__others-hint {
  font-family:    var(--font-mono);
  font-size:      0.58rem;
  letter-spacing: 0.04em;
  color:          var(--text-3);
  font-style:     italic;
  line-height:    1.5;
  margin:         0.45rem 0 0;
}

.duo-modal__others-hint kbd {
  display:        inline-block;
  padding:        0.05rem 0.3rem;
  border-radius:  3px;
  background:     rgba(245, 237, 224, 0.06);
  border:         1px solid var(--border-mid);
  font-family:    inherit;
  font-size:      0.9em;
}

.duo-modal__actions {
  display:         flex;
  justify-content: flex-end;
  gap:             var(--sp-2);
  margin-top:      var(--sp-3);
}

.duo-modal__btn {
  padding:        0.5rem 1rem;
  border-radius:  var(--radius-md);
  font-family:    var(--font-mono);
  font-size:      0.72rem;
  letter-spacing: 0.06em;
  cursor:         pointer;
  border:         1px solid transparent;
  transition:     transform 0.12s, background 0.15s;
}

.duo-modal__btn:active { transform: scale(0.96); }

.duo-modal__btn--cancel {
  background:   transparent;
  border-color: var(--border-mid);
  color:        var(--text-2);
}

.duo-modal__btn--cancel:hover {
  background: rgba(245, 237, 224, 0.06);
  color:      var(--text-1);
}

.duo-modal__btn--save {
  background:   #e88aa8;
  color:        var(--bg-deep);
  border-color: #e88aa8;
}

.duo-modal__btn--save:hover {
  background:   #ffb8d0;
  border-color: #ffb8d0;
}

/* =============================================================================
   19b. DESCRIPTION MODAL
   ============================================================================= */

.description-modal {
  position: fixed;
  inset: 0;
  z-index: 610;
  display: grid;
  place-items: center;
  padding: 1rem;
  animation: fadeIn 0.2s var(--ease-out) both;
}

.description-modal[hidden] { display: none !important; }

.description-modal__backdrop {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 30%, rgba(24, 20, 14, 0.78), rgba(7, 7, 7, 0.92));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.description-modal__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 720px;
  max-height: min(88vh, 860px);
  padding: var(--sp-4);
  background: var(--surface-1);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-xl);
  box-shadow: 0 40px 100px rgba(0,0,0,0.72);
  animation: fadeUp 0.25s var(--ease-out) both;
  display: grid;
  grid-template-rows: auto auto minmax(250px, 1fr) auto;
  gap: 0.45rem;
  overflow: hidden;
}

.description-modal__header {
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.6rem;
}

.description-modal__header-main { min-width: 0; }
.description-modal__header-actions {
  display: flex;
  align-items: flex-start;
  gap: 0.42rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.description-modal__eyebrow {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--amber-light);
  opacity: 0.7;
  margin-bottom: 0.18rem;
}

.description-modal__title {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.6rem;
  font-weight: 500;
  color: var(--text-1);
  line-height: 1.1;
}

.description-modal__date {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.07em;
  color: var(--text-2);
  margin-top: 0.26rem;
}

.description-modal__status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.description-modal__status,
.description-modal__save-hint {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.06em;
  color: var(--text-3);
}

.description-modal--editing .description-modal__status {
  color: var(--amber-light);
}

.description-modal__editor-shell {
  background: rgba(245,237,224,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.5rem;
  overflow: hidden;
}

.description-modal__textarea {
  width: 100%;
  min-height: 0;
  height: 100%;
  max-height: 55vh;
  background: rgba(245,237,224,0.01);
  border: 1px solid rgba(245, 237, 224, 0.08);
  border-radius: var(--radius-sm);
  color: var(--text-1);
  padding: 0.85rem 0.95rem;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.85;
  letter-spacing: 0.01em;
  text-align: left;
  font-style: normal;
  tab-size: 2;
  outline: none;
  resize: none;
  overflow: auto;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.description-modal__textarea:focus {
  border-color: rgba(218, 160, 109, 0.4);
  box-shadow: 0 0 0 3px rgba(218, 160, 109, 0.08);
}

.description-modal__textarea[readonly] {
  color: var(--text-2);
  background: rgba(245, 237, 224, 0.02);
  border-color: rgba(245, 237, 224, 0.06);
}

.description-modal__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
  flex-wrap: wrap;
}

.description-modal__char-count {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-3);
}

.description-modal__actions {
  display: flex;
  margin-left: auto;
  gap: var(--sp-1);
}

.description-modal__btn {
  padding: 0.5rem 0.95rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  border: 1px solid var(--border);
  transition: all 0.14s var(--ease-smooth);
}

.description-modal__btn:active { transform: scale(0.95); }

.description-modal__btn--accent {
  background: rgba(218, 160, 109, 0.12);
  color: var(--amber-light);
  border-color: rgba(218, 160, 109, 0.35);
}

.description-modal__btn--accent:hover {
  background: rgba(218, 160, 109, 0.2);
}

.description-modal__btn--cancel {
  background: rgba(245, 237, 224, 0.03);
  color: var(--text-2);
}

.description-modal__btn--cancel:hover {
  background: rgba(245, 237, 224, 0.09);
  color: var(--text-1);
}

.description-modal__btn--save {
  background: var(--amber-dim);
  border-color: rgba(218, 160, 109, 0.35);
  color: var(--amber-light);
}

.description-modal__btn--save:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.description-modal__btn--save:not(:disabled):hover {
  background: rgba(218, 160, 109, 0.22);
  box-shadow: 0 0 20px rgba(218, 160, 109, 0.12);
}

@media (max-width: 700px) {
  .description-modal {
    padding: 0.35rem;
  }

  .description-modal__panel {
    max-height: 92vh;
    border-radius: 12px;
    padding: 0.75rem;
    grid-template-rows: auto auto minmax(170px, 1fr) auto;
  }

  .description-modal__header {
    flex-direction: column;
    gap: 0.55rem;
  }

  .description-modal__header-actions {
    justify-content: flex-start;
  }

  .description-modal__status-row {
    gap: 0.35rem;
  }

  .description-modal__textarea {
    max-height: 52vh;
    font-size: 0.9rem;
  }

  .description-modal__footer {
    align-items: stretch;
    flex-direction: column;
  }

  .description-modal__actions {
    width: 100%;
    margin-left: 0;
  }

  .description-modal__actions .description-modal__btn {
    flex: 1;
  }
}


/* =============================================================================
   19c. LOCATIONS MODAL
   ============================================================================= */

.locations-modal {
  position:        fixed;
  inset:           0;
  z-index:         620;
  display:         flex;
  align-items:     center;
  justify-content: center;
  padding:         var(--sp-2);
  animation:       fadeIn 0.2s var(--ease-out) both;
}

.locations-modal[hidden] { display: none !important; }

.locations-modal__backdrop {
  position:        absolute;
  inset:           0;
  background:      radial-gradient(circle at 50% 30%, rgba(20, 24, 18, 0.78), rgba(7, 7, 7, 0.92));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.locations-modal__panel {
  position:      relative;
  z-index:       1;
  width:         100%;
  max-width:     520px;
  max-height:    min(86vh, 720px);
  padding:       var(--sp-4);
  background:    var(--surface-1);
  border:        1px solid var(--border-mid);
  border-radius: var(--radius-xl);
  box-shadow:    0 40px 100px rgba(0,0,0,0.7), 0 0 60px rgba(107, 158, 122, 0.05);
  animation:     fadeUp 0.25s var(--ease-out) both;
  display:       flex;
  flex-direction: column;
  gap:           var(--sp-2);
  overflow:      hidden;
}

.locations-modal__header {
  margin-bottom: var(--sp-1);
}

.locations-modal__eyebrow {
  font-family:    var(--font-mono);
  font-size:      0.6rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color:          var(--sage-light);
  opacity:        0.75;
  margin-bottom:  0.3rem;
}

.locations-modal__title {
  font-family: var(--font-display);
  font-style:  italic;
  font-size:   1.6rem;
  font-weight: 500;
  color:       var(--text-1);
  letter-spacing: -0.01em;
}

.locations-modal__date {
  font-family:    var(--font-mono);
  font-size:      0.68rem;
  letter-spacing: 0.08em;
  color:          var(--text-2);
  margin-top:     0.3rem;
}

.locations-modal__chips {
  display:       flex;
  flex-wrap:     wrap;
  gap:           0.4rem;
  min-height:    2rem;
  padding:       0.55rem 0.65rem;
  background:    rgba(245, 237, 224, 0.025);
  border:        1px dashed var(--border-mid);
  border-radius: var(--radius-md);
  align-content: flex-start;
}

.locations-modal__chips:empty::before {
  content:     'Még nincs hozzáadott helyszín – kezdj el írni alább.';
  font-family: var(--font-body);
  font-style:  italic;
  font-size:   0.78rem;
  color:       var(--text-3);
  padding:     0.1rem 0.2rem;
}

.locations-chip {
  display:        inline-flex;
  align-items:    center;
  gap:            0.4rem;
  padding:        0.32rem 0.4rem 0.32rem 0.75rem;
  background:     var(--sage-dim);
  border:         1px solid rgba(107, 158, 122, 0.35);
  color:          var(--sage-light);
  border-radius:  100px;
  font-family:    var(--font-mono);
  font-size:      0.74rem;
  letter-spacing: 0.02em;
  animation:      fadeIn 0.18s var(--ease-out) both;
}

.locations-chip::before {
  content: '📍';
  font-size: 0.65rem;
  opacity: 0.85;
  margin-right: -0.15rem;
}

.locations-chip__remove {
  width:           18px;
  height:          18px;
  display:         inline-flex;
  align-items:     center;
  justify-content: center;
  border-radius:   50%;
  background:      rgba(8, 8, 8, 0.35);
  color:           inherit;
  font-size:       0.85rem;
  line-height:     1;
  transition:      background 0.12s, transform 0.1s var(--ease-bounce);
}

.locations-chip__remove:hover {
  background: var(--error-dim);
  color:      var(--error);
}

.locations-chip__remove:active {
  transform: scale(0.85);
}

.locations-modal__input {
  width:         100%;
  background:    rgba(245, 237, 224, 0.04);
  border:        1px solid var(--border);
  border-radius: var(--radius-md);
  color:         var(--text-1);
  padding:       0.7rem 0.95rem;
  font-family:   var(--font-body);
  font-size:     0.95rem;
  outline:       none;
  transition:    border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.locations-modal__input::placeholder { color: var(--text-3); font-style: italic; }

.locations-modal__input:focus {
  border-color: rgba(107, 158, 122, 0.45);
  background:   rgba(245, 237, 224, 0.05);
  box-shadow:   0 0 0 3px rgba(107, 158, 122, 0.1);
}

.locations-modal__hint {
  font-family:  var(--font-mono);
  font-size:    0.6rem;
  letter-spacing: 0.04em;
  color:        var(--text-3);
  font-style:   italic;
  line-height:  1.6;
}

.locations-modal__hint kbd {
  display:        inline-block;
  padding:        0.05rem 0.35rem;
  margin:         0 0.05rem;
  background:     rgba(245, 237, 224, 0.05);
  border:         1px solid var(--border);
  border-bottom-width: 2px;
  border-radius:  4px;
  font-family:    var(--font-mono);
  font-size:      0.62rem;
  font-style:     normal;
  color:          var(--text-2);
}

.locations-modal__actions {
  display:         flex;
  justify-content: flex-end;
  gap:             var(--sp-1);
  margin-top:      var(--sp-1);
}

.locations-modal__btn {
  padding:        0.55rem 1.4rem;
  border-radius:  var(--radius-sm);
  font-family:    var(--font-mono);
  font-size:      0.78rem;
  font-weight:    500;
  letter-spacing: 0.05em;
  border:         1px solid transparent;
  transition:     all 0.15s;
}

.locations-modal__btn:active { transform: scale(0.95); }

.locations-modal__btn--cancel {
  background:   var(--glass);
  border-color: var(--border);
  color:        var(--text-2);
}

.locations-modal__btn--cancel:hover {
  background: rgba(245, 237, 224, 0.06);
  color:      var(--text-1);
}

.locations-modal__btn--save {
  background:   var(--sage-dim);
  border-color: rgba(107, 158, 122, 0.35);
  color:        var(--sage-light);
}

.locations-modal__btn--save:hover {
  background: rgba(107, 158, 122, 0.22);
  box-shadow: 0 0 20px rgba(107, 158, 122, 0.12);
}

@media (max-width: 600px) {
  .locations-modal { padding: 0.5rem; }
  .locations-modal__panel {
    padding: var(--sp-3);
    max-height: 92vh;
    border-radius: 14px;
  }
  .locations-modal__title { font-size: 1.4rem; }
  .locations-modal__actions .locations-modal__btn { flex: 1; }
}


/* =============================================================================
   20. EXPORT / IMPORT
   ============================================================================= */

.io-section,
.settings-panel__block.io-section {
  max-width:     1200px;
  margin-inline: auto;
  padding:       var(--sp-2) var(--sp-3) var(--sp-6);
  border-top:    1px solid var(--border);
  margin-top:    var(--sp-2);
}

.settings-panel__block.io-section {
  max-width:  none;
  margin-top: 0;
  padding:    0;
  border-top: none;
}

.io-header { margin-bottom: var(--sp-2); }

.io-eyebrow {
  font-family:    var(--font-mono);
  font-size:      0.6rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color:          var(--amber);
  opacity:        0.6;
  margin-bottom:  0.3rem;
}

.io-title {
  font-family: var(--font-display);
  font-style:  italic;
  font-size:   clamp(1rem, 2.5vw, 1.3rem);
  font-weight: 500;
  color:       var(--text-1);
  margin-bottom: 0.3rem;
}

.io-desc {
  font-size:  0.78rem;
  color:      var(--text-2);
  font-style: italic;
}

.io-buttons {
  display:       flex;
  gap:           var(--sp-2);
  flex-wrap:     wrap;
  margin-bottom: var(--sp-1);
  margin-top:    var(--sp-2);
}

.io-btn {
  display:     flex;
  align-items: center;
  gap:         0.5rem;
  padding:     0.55rem 1.3rem;
  border-radius: var(--radius-sm);
  font-family:   var(--font-mono);
  font-size:     0.78rem;
  font-weight:   500;
  letter-spacing: 0.05em;
  border:        1px solid transparent;
  transition:    all 0.15s;
}

.io-btn:active { transform: scale(0.95); }

.io-btn__icon { font-size: 1rem; line-height: 1; }

.io-btn--export {
  background:   var(--sage-dim);
  border-color: rgba(107,158,122,0.3);
  color:        var(--sage-light);
}

.io-btn--export:hover {
  background: rgba(107,158,122,0.22);
  box-shadow: 0 0 20px rgba(107,158,122,0.1);
}

.io-btn--import {
  background:  rgba(245,237,224,0.05);
  border-color: var(--border-mid);
  color:       var(--text-2);
}

.io-btn--import:hover {
  background:  rgba(245,237,224,0.08);
  color:       var(--text-1);
}

.io-btn--sync {
  background:   var(--amber-dim);
  border-color: rgba(218, 160, 109, 0.35);
  color:        var(--amber-light);
}

.io-btn--sync:hover {
  background: rgba(218, 160, 109, 0.2);
  box-shadow: 0 0 20px rgba(218, 160, 109, 0.1);
}

.io-btn--sync:disabled {
  opacity:    0.55;
  cursor:     not-allowed;
  transform:  none;
}

.io-btn--sync.is-syncing .io-btn__icon {
  display:         inline-block;
  animation:       spin 0.75s linear infinite;
}

.io-note {
  font-size:  0.7rem;
  color:      var(--text-3);
  font-style: italic;
}


/* =============================================================================
   21. NOTIFY – toast, visszavonás, szinkron (közös vizuális nyelv)
   ============================================================================= */

.notify {
  box-sizing: border-box;
}

.notify__glyph {
  flex-shrink:     0;
  width:           2rem;
  height:          2rem;
  border-radius:   50%;
  display:         inline-flex;
  align-items:     center;
  justify-content: center;
  font-family:     var(--font-mono);
  font-weight:     700;
  font-size:       0.88rem;
  line-height:     1;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 6px 14px rgba(0, 0, 0, 0.35);
}

.notify__text {
  margin:         0;
  font-family:    var(--font-body);
  font-size:      0.86rem;
  line-height:    1.45;
  letter-spacing: 0.01em;
  color:          var(--text-1);
  font-weight:    500;
}

.notify__text--compact {
  flex:        1;
  min-width:   0;
  font-family: var(--font-mono);
  font-size:   0.72rem;
  color:       var(--text-2);
  font-weight: 500;
  letter-spacing: 0.035em;
}

.notify__btn {
  flex-shrink:   0;
  margin:        0;
  cursor:        pointer;
  border:        1px solid var(--border-mid);
  border-radius: 999px;
  font-family:   var(--font-mono);
  font-size:     0.65rem;
  font-weight:   600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding:       0.45rem 0.95rem;
  transition:
    background    0.2s var(--ease-smooth),
    border-color  0.2s,
    color         0.2s,
    box-shadow    0.2s;
}

.notify__btn--amber {
  border-color: rgba(235, 201, 160, 0.42);
  background:   linear-gradient(165deg, rgba(218, 160, 109, 0.32) 0%, rgba(218, 160, 109, 0.12) 100%);
  color:        var(--amber-light);
  box-shadow:   inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.notify__btn--amber:hover {
  background:   rgba(218, 160, 109, 0.38);
  border-color: rgba(235, 201, 160, 0.55);
  color:        #ffd8a8;
}

.notify__btn--amber:focus-visible {
  outline:        2px solid var(--amber-light);
  outline-offset: 3px;
}

/* —— Központi toast —— */

.notify--toast {
  position:       fixed;
  left:           50%;
  bottom:         max(1.25rem, env(safe-area-inset-bottom, 0px));
  z-index:        10100;
  display:        flex;
  align-items:    center;
  gap:            0.75rem;
  max-width:      min(22rem, calc(100vw - 1.5rem));
  padding:        0.75rem 1.1rem 0.75rem 0.85rem;
  border-radius:  var(--radius-lg);
  border:         1px solid var(--notify-toast-border, rgba(245, 237, 224, 0.12));
  background:     var(--notify-toast-bg, rgba(16, 13, 11, 0.88));
  box-shadow:
    0 24px 48px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 245, 235, 0.06);
  backdrop-filter: blur(22px) saturate(165%);
  -webkit-backdrop-filter: blur(22px) saturate(165%);
  opacity:        0;
  visibility:     hidden;
  transform:      translateX(-50%) translateY(18px) scale(0.96);
  transition:
    opacity      0.32s var(--ease-out),
    transform    0.38s var(--ease-bounce),
    visibility   0.32s;
  pointer-events: none;
  user-select:    none;
}

.notify--toast.notify--visible {
  opacity:    1;
  visibility: visible;
  transform:  translateX(-50%) translateY(0) scale(1);
}

.notify--toast.notify--success {
  --notify-toast-border: rgba(107, 158, 122, 0.28);
  --notify-toast-bg: linear-gradient(
    145deg,
    rgba(107, 158, 122, 0.14) 0%,
    rgba(14, 12, 10, 0.9) 46%,
    rgba(14, 12, 10, 0.92) 100%
  );
}

.notify--toast.notify--success .notify__glyph {
  background:   var(--sage-dim);
  color:        var(--sage-light);
  border:       1px solid rgba(107, 158, 122, 0.45);
}

.notify--toast.notify--error {
  --notify-toast-border: rgba(196, 74, 74, 0.35);
  --notify-toast-bg: linear-gradient(
    145deg,
    rgba(196, 74, 74, 0.16) 0%,
    rgba(18, 12, 12, 0.92) 50%,
    rgba(14, 12, 10, 0.94) 100%
  );
}

.notify--toast.notify--error .notify__glyph {
  background:   var(--error-dim);
  color:        #f0a0a0;
  border:       1px solid rgba(196, 74, 74, 0.45);
}


/* =============================================================================
   22. FOOTER
   ============================================================================= */

.site-footer {
  margin-top:  auto;
  border-top:  1px solid var(--border);
  padding:     var(--sp-3);
}

.site-footer__inner {
  max-width:       1200px;
  margin-inline:   auto;
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  padding-inline:  var(--sp-3);
}

.site-footer__text {
  font-family:    var(--font-display);
  font-style:     italic;
  font-size:      0.85rem;
  color:          var(--text-3);
  letter-spacing: 0.02em;
}

.site-footer__version {
  font-family:    var(--font-mono);
  font-size:      0.6rem;
  letter-spacing: 0.12em;
  color:          var(--text-3);
  text-transform: uppercase;
}


/* =============================================================================
   23. RESZPONZÍV
   ============================================================================= */

@media (min-width: 600px) {
  .pin-card { padding: var(--sp-6) var(--sp-5); }
  .pin-key  { aspect-ratio: 1.15; }
}

@media (min-width: 900px) {
  .site-header__inner,
  .legend,
  .year-nav,
  .heatmap-section,
  .stats-section,
  .monthly-section { padding-inline: var(--sp-4); }
}

@media (min-width: 1200px) {
  .site-header__inner,
  .legend,
  .year-nav,
  .heatmap-section,
  .stats-section,
  .monthly-section { padding-inline: var(--sp-6); }
}

/* Mobil / keskeny képernyő – csak layout, térközök, élhető tap / thumb zóna (≥769px változatlan) */

@media (max-width: 768px) {
  body {
    padding-inline: calc(var(--sp-1) + env(safe-area-inset-left, 0px))
      calc(var(--sp-1) + env(safe-area-inset-right, 0px));
  }

  .site-header__inner {
    flex-direction: column;
    align-items:    stretch;
    gap:            var(--sp-2);
    padding-top:    calc(var(--sp-2) + env(safe-area-inset-top, 0px));
    padding-inline: clamp(14px, 4.2vw, 22px);
  }

  .site-header__brand {
    text-align: left;
    min-width:  0;
  }

  .site-header__title {
    font-size: clamp(1.35rem, 5.2vw, 1.55rem);
  }

  .site-header__tagline {
    font-size: 0.56rem;
  }

  .site-header__right {
    display:               grid;
    grid-template-columns: 1fr auto;
    align-items:           center;
    gap:                   var(--sp-2);
    width:                 100%;
    min-width:             0;
  }

  .since-badge {
    min-width: 0;
    max-width: 100%;
    flex:      1 1 auto;
    padding:   0.45rem 0.75rem 0.45rem 0.6rem;
  }

  .since-badge__line {
    font-size: 0.74rem;
  }

  .view-toggle {
    flex-shrink: 0;
    padding:     2px;
    gap:         3px;
  }

  .legend {
    flex-direction: column;
    align-items:    stretch;
    gap:            var(--sp-2);
    padding-inline: clamp(14px, 4.2vw, 22px);
  }

  .legend__items {
    display:               grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap:            var(--sp-3);
    row-gap:               var(--sp-2);
    align-items:           start;
  }

  .legend__item {
    min-width: 0;
    gap:       0.45rem;
  }

  .legend__hint {
    width:         100%;
    margin-top:    2px;
    padding-top:   var(--sp-2);
    border-top:    1px solid var(--border);
    font-size:     0.68rem;
    line-height:   1.45;
    color:         rgba(245, 237, 224, 0.32);
  }

  .year-nav {
    justify-content: center;
    padding-inline:  clamp(14px, 4.2vw, 22px);
    padding-top:     var(--sp-2);
  }

  .heatmap-section {
    padding-inline: clamp(10px, 3.2vw, 18px);
    padding-block:  var(--sp-2) var(--sp-3);
    overflow-x:     clip;
  }

  .heatmap-inner {
    padding-inline: 0;
    --heatmap-week-cols:      16;
    --heatmap-dividers-space: 24px;
    --heatmap-sidebar:        1.75rem;
    --cell-size: clamp(
      9px,
      (100cqi - var(--heatmap-sidebar) - var(--heatmap-dividers-space) - var(--heatmap-week-cols) * var(--cell-gap))
        / var(--heatmap-week-cols),
      15px
    );
  }

  .heatmap-rows {
    gap: var(--sp-3);
  }

  .heatmap-semester__inner {
    flex-direction: column;
    align-items:    stretch;
  }

  .heatmap-weekdays--lead {
    display: none;
  }

  .heatmap-band {
    display:     flex;
    width:       100%;
    align-items: flex-start;
  }

  .heatmap-weekdays--band {
    display:      grid !important;
    margin-right: 6px;
    flex-shrink:  0;
  }

  .heatmap-semester__inner {
    justify-content: stretch;
  }

  .heatmap-grid-wrap {
    flex:           1 1 auto;
    flex-direction: column;
    align-items:    stretch;
    gap:            var(--sp-2);
    width:          100%;
  }

  .heatmap-grid {
    justify-content: flex-start;
    min-width:       0;
  }

  .heatmap-month-block--divider {
    margin-left:  5px;
    padding-left: 4px;
  }

  .heatmap-cell {
    touch-action: manipulation;
  }

  @media (hover: none) {
    .heatmap-cell:hover {
      transform: none;
    }
  }

  .stats-section {
    padding-inline: clamp(14px, 4.2vw, 22px);
    padding-bottom: var(--sp-4);
  }

  .stats-hero {
    padding: var(--sp-3) var(--sp-2);
  }

  .stats-insights-duo {
    grid-template-columns: 1fr;
  }

  @media (hover: none) {
    .stats-ribbon__cell:hover {
      background: var(--surface-2);
    }
  }

  .monthly-section {
    padding-inline: clamp(14px, 4.2vw, 22px);
  }

  .monthly-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap:                   var(--sp-2);
  }

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

  .diary-section {
    padding-inline: clamp(14px, 4.2vw, 22px);
    padding-top:    var(--sp-3);
  }

  .diary-filter {
    flex-wrap:     nowrap;
    overflow-x:    auto;
    gap:           0.5rem;
    margin-inline: calc(-1 * clamp(14px, 4.2vw, 22px));
    padding-inline: clamp(14px, 4.2vw, 22px) clamp(14px, 4.2vw, 22px);
    padding-bottom: 8px;
    margin-bottom:  var(--sp-2);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
  }

  .diary-filter::-webkit-scrollbar {
    display: none;
  }

  .diary-filter__btn {
    flex-shrink: 0;
    min-height:  36px;
    padding:     0.35rem 0.92rem;
  }

  .diary-entry {
    grid-template-columns: 1fr;
    gap:                   var(--sp-2);
    padding:               var(--sp-2);
  }

  .diary-entry__date-block {
    flex-direction: row;
    flex-wrap:      wrap;
    align-items:    baseline;
    justify-content: flex-start;
    gap:            0.55rem 0.85rem;
    border-right:   none;
    border-bottom:  1px solid var(--border);
    padding-right:  0;
    padding-bottom: var(--sp-2);
    margin-bottom:  2px;
  }

  .diary-entry__day {
    font-size: 1.72rem;
  }

  .diary-entry:hover {
    transform: none;
  }

  .settings-section {
    padding-inline: clamp(14px, 4.2vw, 22px);
  }

  .settings-section {
    padding-bottom: calc(var(--sp-5) + env(safe-area-inset-bottom, 0px));
  }

  .settings-panel__block.io-section {
    padding-bottom: 0;
  }

  .io-buttons {
    flex-direction: column;
    align-items:    stretch;
  }

  .io-btn {
    width:           100%;
    justify-content: center;
    min-height:      46px;
  }

  .site-footer__inner {
    flex-direction: column;
    align-items:    flex-start;
    gap:            var(--sp-1);
    padding-inline: clamp(14px, 4.2vw, 22px);
    padding-bottom: calc(var(--sp-1) + env(safe-area-inset-bottom, 0px));
  }

  /* Kontextmenü – alsó lap (inline left/top felülírása) */
  .context-menu {
    left:                   0 !important;
    right:                  0 !important;
    top:                    auto !important;
    bottom:                 0 !important;
    width:                  100%;
    min-width:              0;
    max-width:              none;
    margin:                 0;
    border-radius:          var(--radius-xl) var(--radius-xl) 0 0;
    padding:                var(--sp-2) var(--sp-2) calc(var(--sp-3) + env(safe-area-inset-bottom, 0px));
    box-shadow:             0 -12px 40px rgba(0, 0, 0, 0.65);
    max-height:             min(70dvh, 520px);
    overflow-y:             auto;
  }

  .context-menu__item {
    padding:       0.62rem 0.85rem;
    min-height:    46px;
    font-size:     0.82rem;
  }

  .context-menu__header {
    padding:       0.5rem 0.85rem 0.75rem;
    font-size:     0.7rem;
  }

  /* Jegyzet modal – alul feljövő panel */
  .note-modal {
    align-items: flex-end;
    padding:     0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .note-modal__panel {
    width:                          100%;
    max-width:                      none;
    border-radius:                  var(--radius-xl) var(--radius-xl) 0 0;
    padding-inline:                 var(--sp-3);
    padding-bottom:                 calc(var(--sp-4) + env(safe-area-inset-bottom, 0px));
    max-height:                     min(86dvh, 560px);
    overflow-y:                     auto;
  }

  .note-modal__textarea {
    min-height:    144px;
  }

  .duo-modal {
    align-items: flex-end;
    padding:     0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .duo-modal__panel {
    width:          100%;
    max-width:      none;
    border-radius:  var(--radius-xl) var(--radius-xl) 0 0;
    padding-inline: var(--sp-3);
    padding-bottom: calc(var(--sp-4) + env(safe-area-inset-bottom, 0px));
  }

  /* PIN képernyő – biztonságos margók */
  .pin-overlay {
    padding: calc(var(--sp-2) + env(safe-area-inset-top, 0px)) var(--sp-2)
      calc(var(--sp-4) + env(safe-area-inset-bottom, 0px));
  }

  .pin-card {
    max-width:       min(380px, 100%);
    width:           100%;
    margin-inline:   auto;
    padding-inline:  clamp(1rem, 4vw, var(--sp-4));
    padding-block:   clamp(1rem, 3.5vw, var(--sp-5));
  }

  .pin-keypad {
    gap: 0.62rem;
  }

  .rich-tooltip {
    max-width: min(18.5rem, calc(100vw - 28px));
  }
}

@media (max-width: 480px) {
  .view-toggle__btn span:last-child { display: none; }
  .site-header__right {
    gap:                   var(--sp-1);
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .monthly-grid {
    grid-template-columns: 1fr;
  }

  .legend__items {
    grid-template-columns: 1fr;
  }
}


/* =============================================================================
   24. PREFERS-REDUCED-MOTION
   ============================================================================= */

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

  .ambient-blob { animation: none !important; }
}


/* =============================================================================
   25. SYNC INDIKÁTOR – felhő szinkron állapot
   ============================================================================= */

.sync-indicator {
  position: fixed;
  bottom: 72px;
  right: 16px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap:           4px;
  padding:       7px 12px 7px 8px;
  border-radius: var(--radius-lg);
  font-family:   var(--font-mono);
  font-size:     0.68rem;
  letter-spacing: 0.036em;
  backdrop-filter: blur(22px) saturate(165%);
  -webkit-backdrop-filter: blur(22px) saturate(165%);
  border:        1px solid rgba(245, 237, 224, 0.12);
  background:    rgba(14, 12, 10, 0.82);
  color:         var(--text-2);
  box-shadow:
    0 20px 42px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 245, 235, 0.05);
  transition:
    opacity       0.32s var(--ease-out),
    transform     0.32s var(--ease-out),
    background    0.32s,
    border-color  0.32s,
    color         0.32s;
  z-index:       10110;
  max-width:     min(260px, calc(100vw - 2rem));
  user-select:   none;
  pointer-events: none;
}

.sync-indicator__status-wrap {
  overflow:    hidden;
  max-height:  2rem;
}

.sync-indicator__main {
  display:     flex;
  align-items: center;
  gap:         8px;
  min-width:   0;
}

.sync-indicator__saved {
  font-size:      0.58rem;
  letter-spacing: 0.04em;
  color:          rgba(245, 237, 224, 0.42);
  padding-left:   2px;
  white-space:    nowrap;
  overflow:       hidden;
  text-overflow:  ellipsis;
}

.sync-indicator--synced {
  background: linear-gradient(
    145deg,
    rgba(107, 158, 122, 0.16) 0%,
    rgba(14, 12, 10, 0.88) 55%
  );
  border-color: rgba(107, 158, 122, 0.32);
  color: var(--sage-light);
  opacity: 1;
  transform: translateY(0);
  animation: sync-box-compact 2.6s var(--ease-out) forwards 1.35s;
}

.sync-indicator--synced .sync-indicator__status-wrap {
  animation: sync-status-collapse 2.6s var(--ease-out) forwards 1.35s;
}

.sync-indicator--synced .sync-indicator__saved {
  color: rgba(142, 193, 158, 0.72);
}

@media (prefers-reduced-motion: reduce) {
  .sync-indicator--synced {
    animation: none;
    gap: 0;
    padding: 5px 10px 5px 8px;
  }
  .sync-indicator--synced .sync-indicator__status-wrap {
    animation: none;
    max-height: 0;
    opacity: 0;
  }
}

.sync-indicator--syncing {
  background: linear-gradient(
    145deg,
    rgba(218, 160, 109, 0.18) 0%,
    rgba(14, 12, 10, 0.9) 50%
  );
  border-color: rgba(218, 160, 109, 0.35);
  color: var(--amber-light);
  opacity: 1;
  transform: translateY(0);
}

.sync-indicator--offline {
  background: rgba(12, 10, 9, 0.75);
  border-color: rgba(245, 237, 224, 0.08);
  color: rgba(245, 237, 224, 0.38);
  opacity: 1;
}

.sync-indicator--offline .sync-indicator__icon {
  opacity: 0.42;
}

.sync-indicator--error {
  background: linear-gradient(
    145deg,
    rgba(196, 74, 74, 0.22) 0%,
    rgba(16, 10, 10, 0.9) 50%
  );
  border-color: rgba(196, 74, 74, 0.42);
  color: #ea9a9a;
  opacity: 1;
  transform: translateY(0);
}

.sync-indicator__icon {
  flex-shrink:     0;
  font-size:       0.75rem;
  display:         inline-flex;
  align-items:     center;
  justify-content: center;
  width:           1.56rem;
  height:          1.56rem;
  border-radius:   50%;
  background:      rgba(0, 0, 0, 0.18);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 2px 7px rgba(0, 0, 0, 0.3);
}

.sync-indicator--synced .sync-indicator__icon {
  background:   var(--sage-dim);
  color:        var(--sage-light);
  border:       1px solid rgba(107, 158, 122, 0.35);
}

.sync-indicator--syncing .sync-indicator__icon {
  background:   var(--amber-dim);
  color:        var(--amber-light);
  border:       1px solid rgba(218, 160, 109, 0.35);
  animation:    spin 1.2s linear infinite;
}

.sync-indicator--error .sync-indicator__icon {
  background:   var(--error-dim);
  border:       1px solid rgba(196, 74, 74, 0.4);
}

.sync-indicator__text {
  min-width: 0;
}

/* —— Üres év —— */
.heatmap-empty-year {
  position:       relative;
  margin:         var(--sp-2) 0 var(--sp-3);
  padding:        var(--sp-3) var(--sp-3) var(--sp-4);
  border-radius:  var(--radius-lg);
  border:         1px dashed rgba(218, 160, 109, 0.28);
  background:
    radial-gradient(ellipse 80% 70% at 50% 0%, rgba(196, 92, 122, 0.08), transparent 55%),
    rgba(18, 14, 11, 0.72);
  text-align:     center;
}

.heatmap-empty-year[hidden] {
  display: none !important;
}

.heatmap-empty-year__eyebrow {
  font-family:    var(--font-mono);
  font-size:      0.56rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color:          var(--rose-light);
  opacity:        0.75;
  margin-bottom:  0.5rem;
}

.heatmap-empty-year__title {
  font-family:    var(--font-display);
  font-size:      clamp(1.2rem, 4vw, 1.55rem);
  font-weight:      500;
  color:          var(--text-1);
  margin-bottom:  0.65rem;
}

.heatmap-empty-year__text {
  font-family:  var(--font-body);
  font-style:   italic;
  font-size:    0.92rem;
  color:        var(--text-2);
  max-width:    34rem;
  margin:       0 auto var(--sp-2);
  line-height:  1.55;
}

.heatmap-empty-year__cta {
  font-family:    var(--font-mono);
  font-size:      0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding:        0.65rem 1.25rem;
  border-radius:  var(--radius-md);
  border:         1px solid rgba(218, 160, 109, 0.45);
  background:     linear-gradient(145deg, rgba(218, 160, 109, 0.22), rgba(218, 160, 109, 0.08));
  color:          var(--amber-light);
  cursor:         pointer;
  transition:     transform 0.2s var(--ease-out), border-color 0.2s, background 0.2s;
}

.heatmap-empty-year__cta:hover {
  border-color: rgba(218, 160, 109, 0.65);
  background:   linear-gradient(145deg, rgba(218, 160, 109, 0.32), rgba(218, 160, 109, 0.12));
}

.heatmap-empty-year__cta:active {
  transform: scale(0.97);
}

.heatmap-section--muted {
  opacity: 0.42;
  filter:  saturate(0.65);
  pointer-events: none;
  user-select: none;
}

.heatmap-cell--focus-pulse {
  animation: heatmap-focus-pulse 1.1s var(--ease-out) 2;
  outline:   2px solid var(--amber-light);
  outline-offset: 2px;
  z-index:   2;
}

@keyframes heatmap-focus-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(218, 160, 109, 0); }
  50%      { box-shadow: 0 0 0 6px rgba(218, 160, 109, 0.35); }
}

/* —— Beállítások panel —— */
.settings-section {
  max-width:     1200px;
  margin-inline: auto;
  padding:       var(--sp-2) var(--sp-3) var(--sp-4);
  border-top:    1px solid var(--border);
  margin-top:    var(--sp-2);
}

@keyframes settingsPanelReveal {
  from {
    opacity:   0;
    transform: translateY(-10px);
  }
  to {
    opacity:   1;
    transform: translateY(0);
  }
}

.settings-panel__toggle {
  display:          flex;
  align-items:      center;
  gap:              var(--sp-2);
  width:            100%;
  padding:          var(--sp-2) var(--sp-3);
  border-radius:    var(--radius-lg);
  border:           1px solid var(--border);
  background:       var(--glass);
  color:            inherit;
  font:             inherit;
  text-align:       left;
  cursor:           pointer;
  transition:
    border-color 0.28s ease,
    background 0.28s ease,
    box-shadow 0.4s var(--ease-out),
    transform 0.35s var(--ease-out);
}

.settings-panel__toggle:hover {
  border-color: var(--border-mid);
  background:   rgba(245, 237, 224, 0.03);
}

.settings-panel__toggle--open {
  border-color: rgba(218, 160, 109, 0.35);
  background:   rgba(218, 160, 109, 0.06);
  box-shadow:
    0 4px 28px rgba(218, 160, 109, 0.1),
    inset 0 1px 0 rgba(245, 237, 224, 0.06);
}

.settings-panel__toggle-main {
  display:        flex;
  flex-direction: column;
  gap:            0.15rem;
  flex:           1;
  min-width:      0;
}

.settings-panel__eyebrow {
  font-family:    var(--font-mono);
  font-size:      0.58rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color:          var(--amber);
  opacity:        0.65;
}

.settings-panel__title {
  font-family: var(--font-display);
  font-style:  italic;
  font-size:   clamp(1rem, 2.5vw, 1.25rem);
  font-weight: 500;
  color:       var(--text-1);
}

.settings-panel__toggle-meta {
  font-family: var(--font-mono);
  font-size:   0.62rem;
  color:       var(--text-2);
  flex-shrink: 0;
  max-width:   42%;
  text-align:  right;
}

.settings-panel__chevron {
  flex-shrink: 0;
  width:         0.45rem;
  height:        0.45rem;
  border-right:  1.5px solid var(--text-2);
  border-bottom: 1.5px solid var(--text-2);
  transform:     rotate(45deg);
  transition:
    transform 0.42s var(--ease-out),
    margin-top 0.35s var(--ease-out),
    border-color 0.28s ease;
  margin-top:    -0.15rem;
}

.settings-panel__toggle--open .settings-panel__chevron {
  transform:    rotate(-135deg);
  margin-top:   0.2rem;
  border-color: var(--amber);
}

.settings-panel__body {
  max-height:     0;
  overflow:       hidden;
  margin-top:     0;
  opacity:        0;
  pointer-events: none;
  visibility:     hidden;
  transition:
    max-height 0.55s var(--ease-out),
    opacity 0.35s var(--ease-out),
    margin-top 0.45s var(--ease-out),
    visibility 0s linear 0.55s;
}

.settings-panel__body--open {
  max-height:     4000px;
  margin-top:     var(--sp-2);
  opacity:        1;
  pointer-events: auto;
  visibility:     visible;
  transition:
    max-height 0.55s var(--ease-out),
    opacity 0.35s var(--ease-out),
    margin-top 0.45s var(--ease-out),
    visibility 0s;
}

.settings-panel__body-inner {
  padding-top: 1px;
}

.settings-panel__block {
  padding-bottom: var(--sp-3);
}

.settings-panel__body--open .settings-panel__block--in {
  animation: settingsPanelReveal 0.42s var(--ease-out) both;
}

.settings-panel__body--open .settings-panel__block--in:nth-child(2) {
  animation-delay: 0.07s;
}

@media (prefers-reduced-motion: reduce) {
  .settings-panel__body {
    transition: max-height 0.01s, opacity 0.01s, margin-top 0.01s, visibility 0s;
  }

  .settings-panel__body--open .settings-panel__block--in {
    animation: none;
  }

  .settings-panel__toggle,
  .settings-panel__chevron {
    transition: border-color 0.15s, background 0.15s;
  }
}

.settings-panel__block + .settings-panel__block {
  border-top:  1px solid var(--border);
  padding-top: var(--sp-3);
  margin-top:  var(--sp-1);
}

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

@keyframes sync-status-collapse {
  0%, 52% {
    max-height: 2rem;
    opacity:    1;
    transform:  translateY(0);
  }
  100% {
    max-height: 0;
    opacity:    0;
    transform:  translateY(6px);
  }
}

@keyframes sync-box-compact {
  0%, 52% {
    gap:     4px;
    padding: 7px 12px 7px 8px;
  }
  100% {
    gap:     0;
    padding: 5px 10px 5px 8px;
  }
}

/* —— Bal alsó „visszavonás” sáv (notify család) —— */

.notify--undo {
  position:       fixed;
  bottom:         72px;
  left:           16px;
  z-index:        10120;
  display:        flex;
  align-items:    center;
  gap:            0.62rem;
  max-width:      min(340px, calc(100vw - 1.75rem));
  padding:        8px 10px 8px 9px;
  border-radius:  var(--radius-lg);
  pointer-events: auto;
  border:         1px solid rgba(218, 160, 109, 0.32);
  background: linear-gradient(
    150deg,
    rgba(218, 160, 109, 0.2) 0%,
    rgba(14, 12, 10, 0.9) 48%,
    rgba(14, 11, 9, 0.94) 100%
  );
  box-shadow:
    0 20px 42px rgba(0, 0, 0, 0.52),
    0 0 0 1px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 245, 235, 0.06);
  backdrop-filter: blur(22px) saturate(165%);
  -webkit-backdrop-filter: blur(22px) saturate(165%);
  opacity:        0;
  visibility:     hidden;
  transform:      translateY(16px);
  transition:
    opacity       0.3s var(--ease-out),
    transform     0.34s var(--ease-out),
    visibility    0.3s;
}

.notify--undo.notify--visible {
  opacity:    1;
  visibility: visible;
  transform:  translateY(0);
}

.notify--undo .notify__glyph {
  width:         1.75rem;
  height:        1.75rem;
  font-size:     0.8rem;
  background:    var(--amber-dim);
  border:        1px solid rgba(218, 160, 109, 0.45);
  color:         var(--amber-light);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 4px 14px rgba(0, 0, 0, 0.4);
}

@media (max-width: 480px) {
  .sync-indicator {
    bottom: max(52px, env(safe-area-inset-bottom, 0px));
    right: 12px;
    font-size: 0.62rem;
    padding: 6px 11px 6px 7px;
  }

  .notify--undo {
    bottom: max(52px, env(safe-area-inset-bottom, 0px));
    left:    12px;
    padding: 7px 8px 7px 8px;
    gap:     8px;
  }

  .notify--undo .notify__btn {
    padding: 0.4rem 0.82rem;
  }

  .notify--toast {
    bottom: max(1rem, env(safe-area-inset-bottom, 0px));
  }
}


/* =============================================================================
   26. MOBILE LAYOUT SAFEGUARDS
   The application has several independently rendered views and dialogs.  Keep
   their intrinsic content inside the available inline size instead of relying
   on the page-level overflow rule to hide a layout defect.
   ============================================================================= */

html {
  overflow-x: clip;
}

img,
picture,
video,
canvas,
svg,
iframe {
  max-width: 100%;
}

img,
video {
  height: auto;
}

@media (max-width: 768px) {
  .app,
  .main-content,
  .view-panel,
  .timeline-section,
  .diary-section,
  .settings-section,
  .site-footer,
  .site-header {
    min-width: 0;
    max-width: 100%;
  }

  /* A very long user-created label must wrap within its card or chip. */
  .diary-entry__body,
  .diary-entry__note,
  .diary-entry__description,
  .diary-entry__location-chip,
  .diary-entry__companion-chip,
  .locations-chip,
  .duo-modal__others-chip,
  .idle-modal__range,
  .notify__text {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .year-nav {
    flex-wrap: wrap;
    gap: 0.65rem;
  }

  .year-idle-btn {
    margin-left: 0;
  }

  .tl__toolbar {
    align-items: stretch;
  }

  .tl__toolbar > * {
    min-width: 0;
  }

  .tl__filters {
    width: 100%;
  }

  .tl__modes {
    align-self: flex-start;
  }

  .tl-river {
    overscroll-behavior-x: contain;
  }

  .settings-panel__toggle {
    align-items: flex-start;
    padding: var(--sp-2);
  }

  .settings-panel__toggle-meta {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .description-modal__panel,
  .locations-modal__panel,
  .note-modal__panel,
  .duo-modal__panel,
  .idle-modal__panel {
    max-width: 100%;
  }

  .description-modal__header-actions,
  .description-modal__actions,
  .locations-modal__actions,
  .note-modal__actions,
  .duo-modal__actions,
  .idle-modal__actions {
    min-width: 0;
    flex-wrap: wrap;
  }
}

@media (max-width: 480px) {
  .site-header__right {
    grid-template-columns: 1fr;
  }

  .view-toggle {
    justify-self: start;
  }

  .year-nav {
    justify-content: flex-start;
  }

  .year-idle-btn {
    flex-basis: 100%;
    justify-content: center;
    min-height: 38px;
  }

  .tl__modes {
    width: 100%;
  }

  .tl__mode {
    flex: 1 1 0;
    padding-inline: 0.5rem;
  }

  .tl-year {
    padding-inline: var(--sp-2);
  }

  .tl-year__bar {
    gap: 2px;
  }

  .tl-year__seg {
    font-size: 0.42rem;
  }

  .idle-modal__dates {
    grid-template-columns: 1fr;
  }

  .idle-modal__actions,
  .note-modal__actions,
  .duo-modal__actions,
  .locations-modal__actions {
    justify-content: stretch;
  }

  .idle-modal__btn,
  .note-modal__btn,
  .duo-modal__btn,
  .locations-modal__btn {
    flex: 1 1 0;
    min-height: 42px;
  }
}
