/* ==========================================
   AMUnity â€” Global Stylesheet
   Pixel-art diary aesthetic
   ========================================== */

@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@400;600;700&family=Nunito:wght@300;400;500;600;700&display=swap');

/* â”€â”€ CSS Variables â”€â”€ */
:root {
  --bg:           #FFF9EF;
  --paper:        #F5EDD9;
  --paper-dark:   #EDE0C4;
  --paper-lined:  #E8D8B8;
  --ink:          #3D2B1F;
  --ink-mid:      #5C4033;
  --ink-light:    #8B6555;
  --rose:         #C97B84;
  --rose-dark:    #A85A63;
  --rose-light:   #E8A8AE;
  --rose-bg:      #FDF0F1;
  --amber:        #C9954A;
  --amber-dark:   #9E6F2C;
  --amber-light:  #E8C07A;
  --amber-bg:     #FDF6EC;
  --sage:         #6E9B72;
  --sage-light:   #A8C8AB;
  --sky:          #7AADCA;
  --lavender:     #9B84C9;
  --red-error:    #D94F4F;

  --font-diary: 'Caveat', cursive;
  --font-body:  'Nunito', sans-serif;

  --shadow-pixel: 4px 4px 0 var(--ink);
  --shadow-pixel-sm: 2px 2px 0 var(--ink);
  --shadow-pixel-lg: 6px 6px 0 var(--ink);
  --radius: 2px;
  --transition: 0.12s ease;
}

/* â”€â”€ Base Reset â”€â”€ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
  position: relative;
}

/* â”€â”€ Background image z opacity â€” wrzuÄ‡ swĂłj plik jako /images/bg.png â”€â”€ */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image: url('/images/bg.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.12;
  pointer-events: none;
}

/* Wszystkie elementy nad tĹ‚em */
body > * { position: relative; z-index: 1; }
#birdsCanvas { z-index: 0 !important; }

/* â”€â”€ Logo graficzne â”€â”€ */
.site-logo {
  height: 44px;
  width: auto;
  display: block;
}

.site-logo-nav {
  height: 36px;
  width: auto;
  display: block;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

::selection { background: var(--rose-light); color: var(--ink); }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--paper); }
::-webkit-scrollbar-thumb {
  background: var(--rose-light);
  border: 2px solid var(--paper);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: var(--rose); }

/* â”€â”€ Typography â”€â”€ */
.font-diary { font-family: var(--font-diary); }
.text-ink    { color: var(--ink); }
.text-rose   { color: var(--rose); }
.text-amber  { color: var(--amber); }

/* â”€â”€ Buttons â”€â”€ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 22px;
  font-family: var(--font-diary);
  font-size: 1.15rem;
  font-weight: 700;
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-pixel);
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  border-radius: var(--radius);
  white-space: nowrap;
  line-height: 1;
  position: relative;
}

.btn:hover  { transform: translate(2px, 2px); box-shadow: var(--shadow-pixel-sm); }
.btn:active { transform: translate(4px, 4px); box-shadow: none; }

.btn-rose   { background: var(--rose);   color: #fff; }
.btn-amber  { background: var(--amber);  color: #fff; }
.btn-sage   { background: var(--sage);   color: #fff; }
.btn-ghost  { background: transparent;   color: var(--ink); }
.btn-danger { background: var(--red-error); color: #fff; }

.btn-sm { padding: 6px 14px; font-size: 1rem; }
.btn-lg { padding: 14px 32px; font-size: 1.35rem; }
.btn-icon { padding: 8px; aspect-ratio: 1; }

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* â”€â”€ Pixel Cards â”€â”€ */
.card {
  background: var(--paper);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-pixel);
  border-radius: var(--radius);
  padding: 24px;
}

.card-sm { padding: 16px; }
.card-lg { padding: 36px; }

/* â”€â”€ Form Elements â”€â”€ */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 18px;
}

.field label {
  font-family: var(--font-diary);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink-mid);
}

.field-hint {
  font-size: 0.82rem;
  color: var(--ink-light);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
input[type="date"],
textarea,
select {
  width: 100%;
  padding: 10px 14px !important;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink);
  background: var(--bg);
  border: 2px solid var(--ink-light);
  border-radius: var(--radius);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--rose);
  box-shadow: 0 0 0 3px var(--rose-light);
}

input.error, textarea.error, select.error {
  border-color: var(--red-error);
  box-shadow: 0 0 0 2px rgba(217,79,79,0.25);
}

.field-error {
  font-size: 0.82rem;
  color: var(--red-error);
  display: none;
}

.field-error.visible { display: block; }

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--paper-dark);
  border: 2px solid var(--ink-light);
  border-radius: 24px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 2px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  border: 1px solid var(--ink-light);
  transition: transform 0.2s;
}
.toggle-switch input:checked + .toggle-slider {
  background: var(--rose);
  border-color: var(--rose-dark);
}
.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

/* Password strength bar */
.password-strength-bar {
  height: 4px;
  border-radius: 2px;
  background: var(--paper-dark);
  overflow: hidden;
  margin-top: 4px;
}
.password-strength-fill {
  height: 100%;
  width: 0%;
  border-radius: 2px;
  transition: width 0.3s, background 0.3s;
}
.strength-weak    .password-strength-fill { width: 25%; background: var(--red-error); }
.strength-fair    .password-strength-fill { width: 50%; background: var(--amber); }
.strength-good    .password-strength-fill { width: 75%; background: var(--sage); }
.strength-strong  .password-strength-fill { width: 100%; background: #4CAF50; }

/* â”€â”€ Navigation â”€â”€ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--paper);
  border-bottom: 2px solid var(--ink);
  padding: 0 20px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-logo {
  font-family: var(--font-diary);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.5px;
}

.navbar-logo span { color: var(--rose); }

/* â”€â”€ Navbar Tabs (animated) â”€â”€ */
.nav-tabs-wrap {
  flex: 1;
  display: flex;
  justify-content: center;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.nav-tabs-wrap::-webkit-scrollbar { display: none; }
.nav-tabs {
  display: flex;
  position: relative;
  gap: 4px;
  padding: 0 8px;
}
.nav-tab {
  padding: 8px 18px;
  font-family: var(--font-diary);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--ink-light);
  white-space: nowrap;
  transition: color 0.2s, opacity 0.2s;
  position: relative;
  z-index: 1;
  border-radius: 20px;
}
.nav-tab:hover { color: var(--ink); }
.nav-tab-active { color: var(--ink); font-weight: 700; }
.nav-tab-disabled {
  text-decoration: line-through;
  opacity: 0.45;
  cursor: not-allowed;
}
.nav-tab-disabled:hover { color: var(--ink-light); }
.nav-tab-indicator {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 100%;
  background: var(--rose-bg);
  border-radius: 20px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s;
  z-index: 0;
  opacity: 0;
  pointer-events: none;
}

.navbar-actions { display: flex; align-items: center; gap: 12px; }

.avatar-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow-pixel-sm);
  transition: box-shadow var(--transition), transform var(--transition);
  background: var(--rose-light);
}

.avatar-btn:hover { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--ink); }

.avatar-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-initials {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-diary);
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink);
}

/* Dropdown */
.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--paper);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-pixel);
  min-width: 180px;
  z-index: 200;
  display: none;
}

.dropdown-menu.open { display: block; }

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--ink);
  cursor: pointer;
  transition: background var(--transition);
}

.dropdown-item:hover { background: var(--paper-dark); }
.dropdown-item.danger { color: var(--red-error); }
.dropdown-divider   { border-top: 1px dashed var(--paper-dark); margin: 4px 0; }

/* Hides nav-duplicate links in dropdown on desktop (they're already in the navbar tabs) */
@media (min-width: 769px) {
  .dropdown-nav-links { display: none !important; }
}

/* â”€â”€ Toast Notifications â”€â”€ */
#toastContainer {
  position: fixed;
  bottom: 24px;
  right: 16px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: var(--paper);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-pixel);
  padding: 12px 18px 12px 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: 320px;
  pointer-events: all;
  transform: translateX(360px);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-size: 0.9rem;
  line-height: 1.4;
}

.toast.show { transform: translateX(0); }
.toast-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }
.toast-success .toast-icon { color: var(--sage); }
.toast-error   .toast-icon { color: var(--red-error); }
.toast-info    .toast-icon { color: var(--sky); }
.toast-warning .toast-icon { color: var(--amber); }

/* â”€â”€ Avatar Upload Preview â”€â”€ */
.avatar-upload-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.avatar-preview {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 3px solid var(--ink);
  box-shadow: var(--shadow-pixel);
  overflow: hidden;
  background: var(--rose-light);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform var(--transition);
}

.avatar-preview:hover { transform: translate(2px, 2px); box-shadow: var(--shadow-pixel-sm); }

.avatar-preview img { width: 100%; height: 100%; object-fit: cover; }

.avatar-preview-overlay {
  position: absolute;
  inset: 0;
  background: rgba(61,43,31,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  opacity: 0;
  transition: opacity 0.2s;
  color: white;
}

.avatar-preview:hover .avatar-preview-overlay { opacity: 1; }

/* â”€â”€ Diary Entry Cards (Dashboard) â”€â”€ */
.entry-card {
  background: var(--paper);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-pixel);
  display: grid;
  grid-template-columns: 8px 1fr;
  transition: transform var(--transition), box-shadow var(--transition);
  cursor: pointer;
  overflow: hidden;
  border-radius: var(--radius);
}

.entry-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-pixel-lg);
}

.entry-card-stripe {
  background: var(--rose-light);
}

.entry-card-stripe.mood-happy    { background: #FFD580; }
.entry-card-stripe.mood-sad      { background: var(--sky); }
.entry-card-stripe.mood-excited  { background: #FFB347; }
.entry-card-stripe.mood-anxious  { background: #C8A8E9; }
.entry-card-stripe.mood-grateful { background: var(--sage-light); }
.entry-card-stripe.mood-neutral  { background: var(--paper-dark); }

.entry-card-body {
  padding: 16px 18px;
}

.entry-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--ink-light);
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.entry-card-title {
  font-family: var(--font-diary);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
  margin-bottom: 6px;
}

.entry-card-preview {
  font-size: 0.9rem;
  color: var(--ink-mid);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.entry-card-tags {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  background: var(--amber-bg);
  border: 1px solid var(--amber-light);
  color: var(--amber-dark);
  padding: 2px 8px;
  font-size: 0.78rem;
  border-radius: 2px;
}

/* â”€â”€ Mood / Weather Badge â”€â”€ */
.mood-badge, .weather-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.82rem;
  padding: 2px 8px;
  border-radius: 2px;
  border: 1px solid transparent;
}

/* â”€â”€ Entry Editor â”€â”€ */
.editor-container {
  max-width: 760px;
  margin: 0 auto;
  padding: 24px 16px 100px;
}

.editor-title-input {
  font-family: var(--font-diary);
  font-size: 2.2rem;
  font-weight: 700;
  border: none;
  border-bottom: 2px solid var(--amber-light);
  background: transparent;
  width: 100%;
  color: var(--ink);
  padding: 8px 0;
  outline: none;
  transition: border-color var(--transition);
}

.editor-title-input:focus { border-bottom-color: var(--amber); }
.editor-title-input::placeholder { color: var(--ink-light); font-weight: 400; }

.editor-content {
  width: 100%;
  min-height: 55vh;
  padding: 24px;
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 28px;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--ink);
  box-shadow: inset 0 0 60px rgba(61,43,31,0.04);
  border-radius: var(--radius);
  outline: none;
  resize: vertical;
  background-image: repeating-linear-gradient(
    transparent,
    transparent 27px,
    rgba(201,149,74,0.18) 27px,
    rgba(201,149,74,0.18) 28px
  );
  background-position: 0 4px;
}

.editor-content:focus {
  border-color: var(--rose);
  box-shadow: inset 0 0 60px rgba(61,43,31,0.04), 0 0 0 3px var(--rose-light);
}

/* Editor Toolbar (mood/weather selectors) */
.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
  padding: 16px 20px;
  background: var(--paper-dark);
  border: 2px solid var(--ink);
  border-top: none;
}

.toolbar-group { display: flex; flex-direction: column; gap: 6px; }
.toolbar-label {
  font-family: var(--font-diary);
  font-size: 0.9rem;
  color: var(--ink-mid);
}

.selector-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.selector-btn {
  padding: 5px 10px;
  font-size: 1.2rem;
  background: var(--bg);
  border: 2px solid var(--paper-lined);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  line-height: 1;
}

.selector-btn:hover  { border-color: var(--ink); }
.selector-btn.active {
  background: var(--rose-light, #FDEBD0);
  border-color: var(--rose);
  box-shadow: 0 0 0 2px var(--rose);
  transform: scale(1.15);
}

/* FAB */
.fab {
  position: fixed;
  bottom: 24px;
  right: 20px;
  width: 56px;
  height: 56px;
  background: var(--rose);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-pixel);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.6rem;
  color: white;
  z-index: 50;
  transition: transform var(--transition), box-shadow var(--transition);
}

.fab:hover  { transform: translate(2px, 2px); box-shadow: var(--shadow-pixel-sm); }
.fab:active { transform: translate(4px, 4px); box-shadow: none; }

/* â”€â”€ Stats Cards â”€â”€ */
.stat-card {
  background: var(--paper);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-pixel-sm);
  padding: 16px 20px;
  text-align: center;
}

.stat-value {
  font-family: var(--font-diary);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--rose);
  line-height: 1;
}

.stat-label {
  font-size: 0.82rem;
  color: var(--ink-light);
  margin-top: 4px;
}

/* â”€â”€ Slot Indicator â”€â”€ */
.slots-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--paper);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-pixel-sm);
  padding: 8px 18px;
  font-family: var(--font-diary);
  font-size: 1.1rem;
  color: var(--ink);
}

.slots-badge .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.dot-available { background: var(--sage); }
.dot-full      { background: var(--red-error); }

/* â”€â”€ Bird Canvas â”€â”€ */
#birdsCanvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.6;
}

/* â”€â”€ Landing Page â”€â”€ */
.hero-section {
  min-height: calc(100vh - 60px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
  position: relative;
  z-index: 1;
}

.hero-title {
  font-family: var(--font-diary);
  font-size: clamp(4rem, 15vw, 9rem);
  font-weight: 700;
  color: var(--ink);
  line-height: 0.9;
  letter-spacing: -2px;
}

.hero-tagline {
  font-family: var(--font-diary);
  font-size: 1.2rem;
  color: var(--rose);
  margin-bottom: 4px;
  letter-spacing: 2px;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--ink-mid);
  max-width: 360px;
  margin: 16px auto 32px;
  line-height: 1.7;
}

/* Pixel heart/star decorations */
.pixel-deco {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--amber);
  box-shadow:
    8px 0 0 var(--amber),
    4px -4px 0 var(--amber),
    12px -4px 0 var(--amber),
    0px -8px 0 var(--amber),
    16px -8px 0 var(--amber);
  margin: 20px 8px;
}

/* Feature cards */
.feature-card {
  background: var(--paper);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-pixel);
  padding: 28px 24px;
  text-align: center;
}

.feature-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  display: block;
}

.feature-title {
  font-family: var(--font-diary);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
}

.feature-desc {
  font-size: 0.9rem;
  color: var(--ink-mid);
  line-height: 1.6;
}

/* â”€â”€ Auth Pages â”€â”€ */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  position: relative;
  z-index: 1;
}

.auth-card {
  background: var(--paper);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-pixel-lg);
  padding: 36px 32px;
  width: 100%;
  max-width: 480px;
}

.auth-title {
  font-family: var(--font-diary);
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
}

.auth-subtitle {
  color: var(--ink-light);
  font-size: 0.92rem;
  margin-bottom: 28px;
}

/* â”€â”€ Entry View â”€â”€ */
.entry-view-container {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 16px 80px;
}

.entry-view-title {
  font-family: var(--font-diary);
  font-size: 2.8rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--ink);
  margin-bottom: 12px;
}

.entry-view-content {
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--ink-mid);
  white-space: pre-wrap;
}

/* â”€â”€ Profile Page â”€â”€ */
.profile-avatar-wrap {
  position: relative;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  border: 3px solid var(--ink);
  box-shadow: var(--shadow-pixel);
  overflow: hidden;
  margin: 0 auto 12px;
  background: var(--rose-light);
}

.profile-avatar-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* â”€â”€ Dashboard Search â”€â”€ */
.search-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  background: var(--paper);
  border: 2px solid var(--ink);
  padding: 6px 12px;
}

.search-bar input {
  border: none;
  background: transparent;
  outline: none;
  flex: 1;
  font-size: 0.95rem;
}

/* â”€â”€ Loading Skeleton â”€â”€ */
.skeleton {
  background: linear-gradient(90deg, var(--paper-dark) 25%, var(--paper) 50%, var(--paper-dark) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 2px;
}

/* â”€â”€ Animations â”€â”€ */
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes float-gentle {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-8px); }
}

@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes bounce-soft {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-6px); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.animate-float  { animation: float-gentle 3s ease-in-out infinite; }
.animate-fadeup { animation: fade-in-up  0.4s ease both; }
.animate-bounce { animation: bounce-soft 2s ease-in-out infinite; }
.animate-spin   { animation: spin 0.8s linear infinite; }

/* â”€â”€ Author card hover animations â”€â”€ */
/* Base â€” smooth transition for all cards */
.author-card {
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.25s ease;
  cursor: default;
}

/* Martin â€” lekki przechyĹ‚ w lewo + ostrzejszy cieĹ„ (pixel shift) */
.author-card:nth-of-type(1):hover {
  transform: rotate(-2deg) translateY(-6px);
  box-shadow: 8px 10px 0 var(--ink);
}

/* Agnieszka â€” przechyĹ‚ w prawo + rĂłĹĽe glow */
.author-card:nth-of-type(2):hover {
  transform: rotate(2deg) translateY(-6px);
  box-shadow: 8px 10px 0 var(--rose);
}

/* Fifi â€” podskakuje prosto w gĂłrÄ™ (kotek skacze) */
.author-card:nth-of-type(3):hover {
  transform: translateY(-10px) scale(1.03);
  box-shadow: 6px 12px 0 var(--sage);
}

/* Corner tag w foto-ramce lekko siÄ™ powiÄ™ksza przy hover */
.author-card:hover .author-corner-tag {
  transform: scale(1.15);
}

/* Foto delikatnie rozjaĹ›nia */
.author-card:hover img {
  filter: brightness(1.06) saturate(1.1);
  transition: filter 0.3s ease;
}

/* â”€â”€ Empty State â”€â”€ */
.empty-state {
  text-align: center;
  padding: 64px 24px;
}

.empty-state-icon {
  font-size: 4rem;
  margin-bottom: 12px;
  opacity: 0.7;
}

.empty-state-title {
  font-family: var(--font-diary);
  font-size: 1.7rem;
  font-weight: 600;
  color: var(--ink-mid);
  margin-bottom: 8px;
}

.empty-state-text {
  color: var(--ink-light);
  font-size: 0.95rem;
}

/* â”€â”€ Divider â”€â”€ */
.deco-divider {
  text-align: center;
  position: relative;
  margin: 16px 0;
  color: var(--amber);
  letter-spacing: 6px;
  font-size: 0.85rem;
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   Avatar Frames
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
.avatar-frame {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.avatar-frame img,
.avatar-frame .avatar-initials {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* Frame variants (apply --fc CSS var for custom color) */
.frame-classic { border: 3px solid var(--fc, var(--ink)); }
.frame-rose    { border: 3px solid var(--rose); outline: 3px solid var(--rose-light); outline-offset: 3px; }
.frame-pixel   { box-shadow: 0 0 0 4px var(--fc, var(--ink)), 0 0 0 7px var(--paper), 0 0 0 10px var(--fc, var(--ink)); }
.frame-circle  { border: 3px solid var(--fc, var(--ink)); border-radius: 50%; }
.frame-gold    { border: 3px solid #C9954A; box-shadow: 0 0 0 2px #E8C07A, 0 0 16px rgba(201,149,74,.35); }
.frame-doodle  { border: 3px dashed var(--fc, var(--ink)); border-radius: 4px; }
.frame-neon    { border: 2px solid var(--fc, var(--rose)); box-shadow: 0 0 8px var(--fc, var(--rose)), 0 0 20px var(--fc, var(--rose)); }
.frame-none    { border: none; }

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   Profile Page
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
.profile-bg-area {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-size: cover;
  background-position: center;
  border-radius: inherit;
}
.profile-card { position: relative; overflow: hidden; }
.profile-card > *:not(.profile-bg-area) { position: relative; z-index: 1; }

.profile-bg-sunset    { background: linear-gradient(140deg, #FDEBD0 0%, #F5C6CB 100%); }
.profile-bg-forest    { background: linear-gradient(140deg, #E8F5E9 0%, #C8E6C9 100%); }
.profile-bg-ocean     { background: linear-gradient(140deg, #E3F2FD 0%, #B3E5FC 100%); }
.profile-bg-night     { background: linear-gradient(140deg, #1a1a2e 0%, #16213e 100%); }
.profile-bg-rose      { background: linear-gradient(140deg, #FCE4EC 0%, #F8BBD0 100%); }
.profile-bg-parchment { background: linear-gradient(140deg, #FFF8E1 0%, #F5EDD9 100%); }

.profile-stats {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin: 16px 0;
}
.profile-stats > div {
  text-align: center;
  font-family: 'Caveat', cursive;
}
.stat-num {
  font-size: 2rem;
  font-weight: 700;
  color: var(--ink);
  display: block;
}
.stat-lbl {
  font-size: 0.85rem;
  color: var(--ink-light);
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   Settings Page
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
.settings-layout { max-width: 720px; margin: 0 auto; padding: 32px 16px 80px; }

.settings-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--paper-dark);
  margin-bottom: 28px;
  overflow-x: auto;
}
.tab-btn {
  font-family: 'Caveat', cursive;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink-mid);
  background: transparent;
  border: none;
  padding: 10px 20px;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: color .15s, border-color .15s;
  white-space: nowrap;
}
.tab-btn:hover { color: var(--rose); }
.tab-btn.active { color: var(--rose); border-bottom-color: var(--rose); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Frame selector */
.frame-selector { display: flex; flex-wrap: wrap; gap: 6px; }
.frame-option   { cursor: pointer; text-align: center; padding: 6px; }
.frame-option input[type="radio"] { display: none; }
.frame-preview-box {
  width: 60px; height: 60px;
  background: var(--rose-bg);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Caveat', cursive; font-size: 0.85rem;
  transition: transform .15s, box-shadow .15s;
  margin-bottom: 4px;
}
.frame-option input:checked ~ .frame-preview-box {
  transform: scale(1.12);
  box-shadow: 0 0 0 3px var(--rose);
}
.frame-option-label { font-size: 0.75rem; color: var(--ink-light); display: block; }

/* Background selector */
.bg-selector { display: flex; flex-wrap: wrap; gap: 10px; }
.bg-swatch {
  width: 80px; height: 52px;
  border: 2px solid var(--paper-dark);
  cursor: pointer;
  transition: border-color .15s, transform .15s;
  display: flex; align-items: flex-end;
  padding: 4px 6px;
  font-size: 0.7rem;
  font-family: 'Caveat', cursive;
  color: rgba(0,0,0,.55);
}
.bg-swatch:hover, .bg-swatch.selected { border-color: var(--rose); transform: scale(1.06); }
.bg-swatch-none { background: var(--paper); color: var(--ink-light); }
.bg-swatch-uploaded { padding: 0; background-size: cover !important; background-position: center !important; }

/* Animation selector */
.anim-selector { display: flex; flex-wrap: wrap; gap: 8px; }
.anim-option {
  display: flex; align-items: center; gap: 8px;
  border: 2px solid var(--paper-dark);
  padding: 8px 14px;
  cursor: pointer;
  font-family: 'Caveat', cursive;
  font-size: 1rem;
  transition: border-color .15s;
}
.anim-option:has(input:checked), .anim-option.selected { border-color: var(--rose); color: var(--rose); }
.anim-option input[type="radio"] { display: none; }

/* â”€â”€ Responsive â”€â”€ */
@media (max-width: 640px) {
  .auth-card           { padding: 28px 20px; }
  .editor-content      { min-height: 45vh; padding: 16px; }
  .editor-title-input  { font-size: 1.8rem; }
  .entry-view-title    { font-size: 2.2rem; }
  .hero-subtitle       { font-size: 1rem; }
  .editor-toolbar      { padding: 12px 14px; gap: 12px; }
}

@media (min-width: 1024px) {
  .entries-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   Utilities
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
.section-gap { margin-top: 20px; }

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   Dashboard â€” two-column layout
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
.dashboard-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 20px;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 16px 120px;
  align-items: start;
}

.dashboard-main { min-width: 0; }

.dashboard-sidebar {
  position: sticky;
  top: 76px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  /* On mobile sidebar goes below main */
}

@media (max-width: 860px) {
  .dashboard-layout {
    grid-template-columns: 1fr;
  }
  .dashboard-sidebar {
    position: static;
    order: 2;
  }
  .dashboard-main { order: 1; }
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   Friends Sidebar
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
.friends-card {
  background: var(--paper);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-pixel-sm);
  padding: 12px;
}

.friends-card-title {
  font-family: 'Caveat', cursive;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Search toggle button */
.sidebar-search-toggle {
  background: transparent;
  border: 1.5px solid var(--paper-dark);
  cursor: pointer;
  font-size: 0.82rem;
  padding: 2px 6px;
  line-height: 1.4;
  transition: border-color .1s;
}
.sidebar-search-toggle:hover { border-color: var(--rose); }

/* Friend search input in sidebar */
.sidebar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 2px solid var(--paper-dark);
  padding: 6px 10px;
  margin-bottom: 10px;
  transition: border-color .15s;
}
.sidebar-search:focus-within { border-color: var(--rose); }
.sidebar-search input {
  border: none;
  background: transparent;
  outline: none;
  flex: 1;
  font-size: 0.85rem;
  padding: 2px 6px;
  width: 100%;
}

/* Search results dropdown */
.friend-search-dropdown {
  background: var(--paper);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-pixel-sm);
  max-height: 220px;
  overflow-y: auto;
}

/* â”€â”€ Friend tiles grid â”€â”€ */
.friends-tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.friend-tile {
  background: var(--paper);
  border: 1.5px solid var(--paper-dark);
  padding: 8px 6px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  position: relative;
  transition: border-color .1s;
  min-width: 0;
}
.friend-tile:hover { border-color: var(--rose); }

.friend-tile-avatar {
  position: relative;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}
.friend-tile-avatar img,
.friend-tile-avatar .ft-initials {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--ink);
  overflow: hidden;
}
.ft-initials {
  background: var(--rose-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Caveat', cursive;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
}
.friend-tile-dot {
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--paper-dark);
  border: 2px solid var(--paper);
}
.friend-tile-dot.online { background: #4CAF50; }

.friend-tile-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink);
  text-align: center;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.2;
}
.friend-tile-sub {
  font-size: 0.68rem;
  color: var(--ink-light);
  text-align: center;
  line-height: 1.2;
}
.friend-tile-sub.is-online { color: #388E3C; font-weight: 600; }

.friend-tile-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}
.friend-tile-btn {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  background: var(--paper-dark);
  border: 1px solid var(--paper-lined);
  cursor: pointer;
  text-decoration: none;
  color: var(--ink);
  flex-shrink: 0;
  transition: background .1s, border-color .1s;
  border-radius: 2px;
}
.friend-tile-btn:hover { background: var(--rose-light); border-color: var(--rose); }
.friend-tile-unread {
  background: var(--rose);
  color: #fff;
  border-radius: 50%;
  min-width: 16px;
  height: 16px;
  font-size: 0.65rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  line-height: 1;
}

/* Pending request items (keep list style) */
.friend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  cursor: pointer;
  transition: background .1s;
  position: relative;
}
.friend-item:hover { background: var(--paper-dark); }

.friend-item-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--ink);
  flex-shrink: 0;
  background: var(--rose-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Caveat', cursive;
  font-size: 0.82rem;
  overflow: hidden;
}
.friend-item-avatar img { width: 100%; height: 100%; object-fit: cover; }

.friend-item-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.2;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.friend-item-sub {
  font-size: 0.72rem;
  color: var(--ink-light);
}

/* Online status dot (legacy list use) */
.online-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--paper-dark);
  border: 1.5px solid var(--ink);
  flex-shrink: 0;
}
.online-dot.is-online { background: #4CAF50; border-color: #388E3C; }

/* Friend action buttons in dropdown */
.friend-action-btn {
  font-size: 0.75rem;
  padding: 3px 7px;
  border: 1.5px solid var(--ink);
  background: var(--paper);
  cursor: pointer;
  font-family: 'Caveat', cursive;
  white-space: nowrap;
  transition: background .1s;
}
.friend-action-btn:hover  { background: var(--rose-light); }
.friend-action-btn.accept { border-color: var(--sage); color: var(--sage); }
.friend-action-btn.reject { border-color: var(--red-error); color: var(--red-error); }

/* Pending requests badge count */
.pending-badge {
  background: var(--rose);
  color: #fff;
  border-radius: 50%;
  min-width: 18px;
  height: 18px;
  font-size: 0.72rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  font-weight: 700;
  line-height: 1;
}

/* Mobile: sidebar as horizontal scrollable strip */
@media (max-width: 860px) {
  .dashboard-sidebar .friends-card:last-child {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .friends-tiles {
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 6px;
  }
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   Chat Widget (floating bottom-right)
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
/* Incoming message notification bubble */
.chat-notif {
  position: fixed;
  bottom: 80px;
  right: 24px;
  z-index: 600;
  background: var(--paper);
  border: 2px solid var(--ink);
  box-shadow: -3px 3px 0 var(--ink);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 260px;
  cursor: pointer;
  border-radius: 2px;
  animation: notifSlide .25s ease;
  pointer-events: all;
}
.chat-notif-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink-light);
  font-size: 0.8rem;
  padding: 2px;
  flex-shrink: 0;
  line-height: 1;
}
.chat-notif-close:hover { color: var(--ink); }
@keyframes notifSlide {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.chat-widget {
  position: fixed;
  bottom: 0;
  right: 80px;
  z-index: 500;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
}

.chat-window {
  width: 300px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-bottom: none;
  box-shadow: -4px -4px 0 var(--ink);
  border-radius: 2px 2px 0 0;
  display: flex;
  flex-direction: column;
  height: 380px;
  max-height: 420px;
  pointer-events: all;
  transition: max-height .2s ease;
}
.chat-window.minimized { max-height: 44px; }

.chat-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  background: var(--ink);
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
  user-select: none;
}
.chat-header-name {
  flex: 1;
  font-family: 'Caveat', cursive;
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-header-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #888;
  flex-shrink: 0;
}
.chat-header-dot.online { background: #4CAF50; }
.chat-header-close {
  font-size: 1.1rem;
  opacity: .7;
  margin-left: 4px;
  cursor: pointer;
  background: transparent;
  border: none;
  color: #fff;
  line-height: 1;
  padding: 2px 4px;
}
.chat-header-close:hover { opacity: 1; }
.chat-header-search-btn {
  font-size: 0.85rem;
  opacity: .7;
  cursor: pointer;
  background: transparent;
  border: none;
  color: #fff;
  padding: 2px 4px;
}
.chat-header-search-btn:hover { opacity: 1; }

.chat-header-mute-btn {
  font-size: 0.85rem;
  opacity: .7;
  cursor: pointer;
  background: transparent;
  border: none;
  color: #fff;
  padding: 2px 4px;
  line-height: 1;
}
.chat-header-mute-btn:hover { opacity: 1; }

.chat-search-bar {
  display: none;
  align-items: center;
  padding: 5px 10px;
  border-bottom: 1px solid var(--paper-dark);
  gap: 6px;
  flex-shrink: 0;
}
.chat-search-bar.visible { display: flex; }
.chat-search-bar input {
  flex: 1;
  border: 1px solid var(--paper-dark);
  background: var(--bg);
  padding: 4px 8px;
  font-size: 0.83rem;
  outline: none;
}
.chat-search-bar input:focus { border-color: var(--rose); }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-height: 200px;
}

/* Load older btn */
.chat-load-more {
  text-align: center;
  padding: 4px;
  font-size: 0.78rem;
  color: var(--ink-light);
  cursor: pointer;
}
.chat-load-more:hover { color: var(--rose); }

/* Message bubbles */
.chat-msg {
  display: flex;
  flex-direction: column;
  max-width: 82%;
}
.chat-msg.own  { align-self: flex-end; }
.chat-msg.other { align-self: flex-start; }

.chat-bubble {
  padding: 6px 10px;
  font-size: 0.87rem;
  line-height: 1.45;
  word-break: break-word;
}
.chat-msg.own   .chat-bubble { background: var(--rose-light);  border: 1.5px solid var(--rose); }
.chat-msg.other .chat-bubble { background: var(--paper-dark);  border: 1.5px solid var(--paper-lined); }

.chat-bubble img {
  max-width: 200px;
  max-height: 160px;
  object-fit: contain;
  cursor: pointer;
  border: 1px solid var(--paper-dark);
}
.chat-bubble img.chat-emote {
  border: none;
  cursor: default;
}

.chat-msg-time {
  font-size: 0.68rem;
  color: var(--ink-light);
  margin-top: 2px;
}
.chat-msg.own  .chat-msg-time { text-align: right; }

/* Read receipt ("WyĹ›wietlone o HH:MM") */
.chat-read-receipt {
  text-align: right;
  font-size: 0.7rem;
  color: var(--ink-light);
  font-style: italic;
  padding: 0 10px 8px;
}

/* Emote in message text */
.chat-emote {
  width: 22px;
  height: 22px;
  display: inline-block;
  vertical-align: middle;
  object-fit: contain;
}

/* Input area */
.chat-input-area {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 7px 8px;
  border-top: 2px solid var(--paper-dark);
  flex-shrink: 0;
}
.chat-text-input {
  flex: 1;
  border: 1.5px solid var(--paper-dark);
  background: var(--bg);
  padding: 5px 8px;
  font-size: 0.87rem;
  outline: none;
  font-family: 'Nunito', sans-serif;
  min-width: 0;
  /* contenteditable support */
  min-height: 32px;
  max-height: 80px;
  overflow-y: auto;
  line-height: 1.5;
  cursor: text;
  white-space: pre-wrap;
  word-break: break-word;
}
.chat-text-input:focus,
.chat-text-input:focus-within { border-color: var(--rose); }
/* Placeholder via data-placeholder attribute */
.chat-text-input[contenteditable]:empty::before {
  content: attr(data-placeholder);
  color: var(--ink-light);
  pointer-events: none;
  font-style: italic;
}
/* Inline emote image inside contenteditable */
.chat-emote-input {
  width: 22px;
  height: 22px;
  display: inline-block;
  vertical-align: middle;
  object-fit: contain;
  margin: 0 1px;
  pointer-events: none;
  user-select: none;
}

.chat-icon-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--paper-dark);
  background: var(--paper);
  cursor: pointer;
  font-size: 0.95rem;
  flex-shrink: 0;
  transition: border-color .1s, background .1s;
}
.chat-icon-btn:hover { border-color: var(--rose); background: var(--rose-bg); }

/* Emote picker panel */
.emote-picker {
  display: none;
  position: absolute;
  bottom: calc(100% + 4px);
  right: 8px;
  width: 280px;
  background: var(--paper);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-pixel-sm);
  z-index: 10;
  max-height: 200px;
  display: none;
  flex-direction: column;
}
.emote-picker.open { display: flex; }

.emote-tabs {
  display: flex;
  border-bottom: 1px solid var(--paper-dark);
  flex-shrink: 0;
}
.emote-tab-btn {
  flex: 1;
  padding: 5px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--ink-light);
  font-family: 'Caveat', cursive;
}
.emote-tab-btn.active { background: var(--paper-dark); color: var(--ink); }

.emote-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px;
  overflow-y: auto;
}
.emote-btn {
  width: 32px;
  height: 32px;
  font-size: 1.2rem;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .1s;
}
.emote-btn:hover { background: var(--paper-dark); border-color: var(--paper-lined); }
.emote-btn img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

/* File input hidden */
.chat-img-input { display: none; }

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   User Profile (other users)
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
.user-profile-layout {
  max-width: 640px;
  margin: 0 auto;
  padding: 32px 16px 80px;
}
.private-profile-box {
  text-align: center;
  padding: 48px 24px;
}
.private-profile-box .lock-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   Trips â€” List page (adventure map style)
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
.trips-layout {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 16px 80px;
}

/* â”€â”€ Adventure Map Canvas â”€â”€ */
.trips-map-canvas {
  position: relative;
  min-height: 300px;
  padding: 48px 0 32px;
  background:
    radial-gradient(ellipse at 20% 10%, rgba(210,180,140,0.18) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 60%, rgba(178,143,106,0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 90%, rgba(210,180,140,0.10) 0%, transparent 40%);
}
/* SVG route drawn by JS replaces old CSS line */
.trips-map-svg-route {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: visible;
}
.trips-map-svg-route path {
  fill: none;
  stroke: var(--ink-light);
  stroke-width: 2.5;
  stroke-dasharray: 10 8;
  stroke-linecap: round;
  opacity: 0.45;
  animation: drawRoute 2s ease forwards;
}
@keyframes drawRoute {
  from { stroke-dashoffset: 1000; }
  to   { stroke-dashoffset: 0; }
}

/* â”€â”€ Compass rose decoration â”€â”€ */
.trips-map-canvas .compass-rose {
  position: absolute;
  top: 12px;
  right: 24px;
  font-size: 2.2rem;
  opacity: 0.18;
  pointer-events: none;
  animation: compassSpin 40s linear infinite;
}
@keyframes compassSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* â”€â”€ Trip node (pin + card pair) â”€â”€ */
.trip-map-node {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 40px;
  z-index: 1;
  opacity: 0;
  animation: nodeAppear 0.5s ease forwards;
}
.trip-map-node:nth-child(1)  { animation-delay: 0s; }
.trip-map-node:nth-child(2)  { animation-delay: 0.12s; }
.trip-map-node:nth-child(3)  { animation-delay: 0.24s; }
.trip-map-node:nth-child(4)  { animation-delay: 0.36s; }
.trip-map-node:nth-child(5)  { animation-delay: 0.48s; }
.trip-map-node:nth-child(6)  { animation-delay: 0.60s; }
.trip-map-node:nth-child(7)  { animation-delay: 0.72s; }
.trip-map-node:nth-child(8)  { animation-delay: 0.84s; }
.trip-map-node:nth-child(9)  { animation-delay: 0.96s; }
.trip-map-node:nth-child(10) { animation-delay: 1.08s; }
@keyframes nodeAppear {
  from { opacity: 0; transform: translateY(16px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.trip-map-node:nth-child(even) {
  flex-direction: row-reverse;
}

/* â”€â”€ Pin marker (treasure map style) â”€â”€ */
.trip-map-pin {
  flex-shrink: 0;
  width: 54px;
  height: 54px;
  background: linear-gradient(145deg, var(--paper) 60%, var(--paper-dark));
  border: 3px solid var(--ink);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  box-shadow: var(--shadow-pixel), 0 0 0 4px var(--paper), 0 0 0 6px var(--ink-light);
  position: relative;
  z-index: 2;
  transition: transform 0.2s, box-shadow 0.2s;
}
.trip-map-node:hover .trip-map-pin {
  transform: scale(1.12) rotate(-5deg);
  box-shadow: var(--shadow-pixel), 0 0 0 4px var(--paper), 0 0 0 6px var(--rose);
}
.trip-map-pin::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 10px solid var(--ink);
}

/* â”€â”€ Card (parchment scroll style) â”€â”€ */
.trip-map-card {
  flex: 1;
  max-width: 400px;
  background: var(--paper);
  border: 2.5px solid var(--ink);
  border-radius: 6px;
  box-shadow: var(--shadow-pixel), inset 0 0 30px rgba(210,180,140,0.15);
  padding: 18px 20px 14px;
  text-decoration: none;
  color: inherit;
  display: block;
  position: relative;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  overflow: hidden;
}
.trip-map-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.08) 25%, transparent 25%),
    linear-gradient(225deg, rgba(255,255,255,0.06) 25%, transparent 25%);
  pointer-events: none;
}
.trip-map-card:hover {
  transform: translate(2px, 2px) rotate(-0.3deg);
  box-shadow: var(--shadow-pixel-sm);
  border-color: var(--rose);
}

/* Dashed connector line from pin to card */
.trip-map-card::before {
  content: '';
  position: absolute;
  top: 20px;
  width: 28px;
  height: 3px;
  background: repeating-linear-gradient(
    to right,
    var(--ink-light) 0, var(--ink-light) 5px,
    transparent 5px, transparent 10px
  );
  opacity: 0.55;
}
.trip-map-node:nth-child(odd) .trip-map-card::before {
  left: -28px;
}
.trip-map-node:nth-child(even) .trip-map-card::before {
  right: -28px; left: auto;
}

.trip-map-card-name {
  font-family: var(--font-diary);
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
  margin-bottom: 5px;
  position: relative;
  z-index: 1;
}
.trip-map-card-desc {
  font-size: 0.85rem;
  color: var(--ink-mid);
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  position: relative;
  z-index: 1;
}
.trip-map-card-meta {
  display: flex;
  gap: 10px;
  font-size: 0.78rem;
  color: var(--ink-light);
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

/* â”€â”€ Status accent colors on cards â”€â”€ */
.trip-map-card[data-status="planning"]  { border-left: 5px solid #e6b54a; }
.trip-map-card[data-status="confirmed"] { border-left: 5px solid #4aa854; }
.trip-map-card[data-status="completed"] { border-left: 5px solid var(--rose); }
.trip-map-card[data-status="cancelled"] { border-left: 5px solid #c0392b; }

/* â”€â”€ Milestone counter â”€â”€ */
.trips-milestone {
  text-align: center;
  padding: 16px 0 8px;
  font-family: var(--font-diary);
  font-size: 1.1rem;
  color: var(--ink-light);
  opacity: 0.7;
}
.trips-milestone strong {
  color: var(--rose);
  font-size: 1.3rem;
}

/* â”€â”€ Empty state â”€â”€ */
.trips-empty-adventure {
  text-align: center;
  padding: 80px 20px;
  color: var(--ink-light);
  font-family: var(--font-diary);
  font-size: 1.4rem;
  line-height: 1.6;
  background:
    radial-gradient(ellipse at 50% 50%, rgba(210,180,140,0.12) 0%, transparent 60%);
}
.trips-empty-adventure::before {
  content: '\1F9ED';
  display: block;
  font-size: 4rem;
  margin-bottom: 16px;
  animation: compassSpin 30s linear infinite;
}

/* trip-card-cover kept for planner page cover images */
.trip-card-cover {
  height: 120px;
  background-size: cover;
  background-position: center;
  border-bottom: 2px solid var(--ink);
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   Trips â€” Planner page
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
.trip-planner-layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 16px 80px;
}
.trip-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.trip-title {
  font-family: var(--font-diary);
  font-size: 2rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
}
.trip-status-badge {
  display: inline-block;
  font-size: 0.78rem;
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 600;
  color: #fff;
}
.trip-status-planning  { background: var(--amber); }
.trip-status-confirmed { background: var(--sage); }
.trip-status-completed { background: var(--sky); }
.trip-status-cancelled { background: var(--red-error); }

.trip-main {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 16px;
  align-items: start;
}
.trip-map-col { position: sticky; top: 76px; }
.trip-map {
  width: 100%;
  height: 450px;
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-pixel-sm);
  border-radius: var(--radius);
  z-index: 1;
}
.trip-sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: calc(100vh - 130px);
  overflow-y: auto;
}
.trip-panel { padding: 14px; }
.trip-panel-title {
  font-family: var(--font-diary);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
}
/* Destination list item */
.dest-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--paper-dark);
  border-radius: 4px;
  transition: background 0.15s;
}
.dest-item:hover { background: var(--paper); }
.trip-photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 6px;
}

/* Modal overlay */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   Mobile Responsiveness
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
@media (max-width: 768px) {
  /* Navbar */
  .navbar { padding: 0 12px; height: 52px; }
  .navbar-logo { font-size: 1.35rem; }
  .navbar-actions { gap: 8px; }
  .nav-tab { font-size: 1rem; padding: 6px 12px; }
  .nav-tabs { gap: 2px; }
  .avatar-btn { width: 32px; height: 32px; }

  /* Page wrappers */
  .settings-layout { padding: 16px 12px 80px; }
  .user-profile-layout { padding: 20px 12px 80px; }

  /* Tabs */
  .tab-btn { font-size: 0.95rem; padding: 8px 13px; }

  /* Entry cards */
  .entry-card { padding: 16px 14px; }

  /* Profile stats */
  .profile-stats { gap: 16px; }
  .stat-num { font-size: 1.5rem; }

  /* Settings selectors */
  .bg-swatch { width: 68px; height: 44px; }

  /* Chat widget â€” allow narrowing on smaller viewports */
  .chat-widget { right: 4px; }
  .chat-window { width: min(300px, calc(100vw - 8px)); }
  .chat-notif  { right: 8px; width: min(260px, calc(100vw - 16px)); }

  /* Toasts â€” full-width on mobile */
  #toastContainer { left: 12px; right: 12px; max-width: none; width: auto; }

  /* Trips */
  .trip-main { grid-template-columns: 1fr; }
  .trip-map-col { position: static; }
  .trip-map { height: 300px; }
  .trip-sidebar { max-height: none; }
  .trip-map-node,
  .trip-map-node:nth-child(even) { flex-direction: column; align-items: center; }
  .trip-map-card { max-width: 100%; }
  .trip-map-card::before { display: none; }
  .trips-map-svg-route { display: none; }
  .trips-map-canvas .compass-rose { display: none; }
}

@media (max-width: 480px) {
  /* Navbar */
  .navbar { height: 48px; padding: 0 10px; }
  .navbar-logo { font-size: 1.15rem; }
  .site-logo-nav { height: 26px !important; }
  .nav-tab { font-size: 0.9rem; padding: 5px 10px; }
  .nav-tabs-wrap { justify-content: flex-start; }

  /* Dashboard */
  .dashboard-layout { padding: 0 10px 80px; gap: 16px; }

  /* Settings */
  .settings-layout { padding: 12px 10px 80px; }

  /* Auth pages */
  .auth-card { padding: 24px 14px; }
  .auth-title { font-size: 1.9rem; }
  .hero-title  { font-size: clamp(1.8rem, 9vw, 2.8rem); }
  .hero-actions { flex-direction: column; align-items: stretch; gap: 10px; }
  .hero-actions .btn { justify-content: center; width: 100%; }

  /* Chat window full-width */
  .chat-widget { right: 0; padding: 0 6px; }
  .chat-window { width: calc(100vw - 12px); }

  /* FAB */
  .fab { right: 16px; bottom: 16px; }

  /* Section titles */
  .section-title { font-size: 1.25rem; }
}

  /* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
     Task Board â€” Adventure Aesthetic
     â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

  /* â”€â”€ Shell layout â”€â”€ */
  .task-shell {
    max-width: 1440px;
    margin: 0 auto;
    padding: 20px 20px 120px;
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 18px;
    align-items: start;
  }

  /* â”€â”€ Mobile sidebar overlay â”€â”€ */
  .task-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(61, 43, 31, 0.5);
    z-index: 299;
    opacity: 0;
    transition: opacity 0.25s;
    backdrop-filter: blur(2px);
  }

  .task-sidebar-overlay.visible {
    display: block;
    opacity: 1;
  }

  /* â”€â”€ Mobile open button â”€â”€ */
  .task-mob-toggle {
    display: none;
    position: fixed;
    bottom: 86px;
    left: 16px;
    z-index: 290;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--paper);
    border: 2px solid var(--ink);
    box-shadow: var(--shadow-pixel);
    cursor: pointer;
    font-size: 1.3rem;
    align-items: center;
    justify-content: center;
    transition: transform 0.12s, box-shadow 0.12s;
  }

  .task-mob-toggle:hover { transform: scale(1.08); box-shadow: var(--shadow-pixel-lg); }

  /* â”€â”€ Sidebar â”€â”€ */
  .task-sidebar {
    position: sticky;
    top: 74px;
    align-self: start;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: var(--paper);
    border: 2px solid var(--ink);
    box-shadow: var(--shadow-pixel);
    padding: 16px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    scrollbar-width: thin;
  }

  .task-sidebar-close {
    display: none;
    align-self: flex-end;
    font-family: var(--font-body);
    font-size: 0.82rem;
    color: var(--ink-light);
    background: none;
    border: 1px solid var(--paper-dark);
    border-radius: 20px;
    cursor: pointer;
    padding: 4px 12px;
    transition: color 0.1s, border-color 0.1s;
  }

  .task-sidebar-close:hover { color: var(--ink); border-color: var(--ink); }

  .task-sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }

  .task-sidebar-title {
    font-family: 'Caveat', cursive;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--ink);
  }

  .task-sidebar-section {
    border-top: 1px dashed var(--paper-dark);
    padding-top: 12px;
  }

  .task-sidebar-section h3 {
    font-family: 'Almendra', serif;
    font-size: 0.85rem;
    color: var(--ink-mid);
    margin-bottom: 8px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
  }

  .task-inline-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
  }

  .task-inline-row > * { flex: 1; min-width: 0; }

  .task-full-btn { width: 100%; }

  .task-invites-list,
  .task-pending-members,
  .task-status-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
  }

  .task-invite-item,
  .task-pending-row,
  .task-status-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border: 1px solid var(--paper-dark);
    background: rgba(255, 255, 255, 0.65);
    padding: 7px 8px;
  }

  .task-invite-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
  }

  .task-invite-main strong {
    font-size: 0.82rem;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .task-invite-main small {
    font-size: 0.72rem;
    color: var(--ink-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .task-invite-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
  }

  .task-member-row {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 4px 0;
  }

  .task-member-name {
    flex: 1;
    min-width: 0;
    font-size: 0.8rem;
    color: var(--ink-mid);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .task-members-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 4px;
  }

  .task-pending-title {
    margin-top: 8px;
    font-size: 0.75rem;
    color: var(--ink-light);
    text-transform: uppercase;
    letter-spacing: 0.4px;
  }

  .task-pending-row span {
    font-size: 0.78rem;
    color: var(--ink-mid);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .task-status-item span {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.8rem;
  }

  .task-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
  }

  .task-color-input {
    width: 44px !important;
    flex: 0 0 44px !important;
    padding: 3px !important;
    border: 1.5px solid var(--ink) !important;
    height: 36px !important;
    cursor: pointer;
    background: none;
  }

  .task-add-icon-btn {
    flex: 0 0 36px !important;
    width: 36px;
    height: 36px;
    padding: 0;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* â”€â”€ Project tiles â”€â”€ */
  .task-projects-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding-right: 2px;
  }

  .task-project-tile {
    position: relative;
    border: 2px solid var(--paper-dark);
    background: var(--bg);
    padding: 10px 12px 10px 15px;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    overflow: hidden;
    transition: border-color 0.12s, transform 0.12s, box-shadow 0.12s, background 0.12s;
  }

  .task-project-tile::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: var(--paper-dark);
    transition: background 0.12s;
  }

  .task-project-tile:hover {
    border-color: var(--rose);
    transform: translateX(2px);
    box-shadow: 2px 2px 0 var(--rose-light);
  }

  .task-project-tile:hover::before { background: var(--rose-light); }

  .task-project-tile.active {
    border-color: var(--rose);
    background: var(--rose-bg);
    box-shadow: 2px 2px 0 var(--rose);
  }

  .task-project-tile.active::before { background: var(--rose); }

  .task-project-title {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--ink);
    line-height: 1.25;
  }

  .task-project-meta {
    font-size: 0.75rem;
    color: var(--ink-light);
    margin-top: 2px;
  }

  .task-role-pill {
    align-self: flex-start;
    flex-shrink: 0;
    font-size: 0.67rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--ink-light);
    border: 1px solid var(--paper-dark);
    border-radius: 20px;
    padding: 2px 7px;
    background: rgba(255, 255, 255, 0.7);
    white-space: nowrap;
  }

  /* â”€â”€ Main area â”€â”€ */
  .task-main {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
  }

  /* â”€â”€ Hero section â”€â”€ */
  .task-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    padding: 24px 28px;
    position: relative;
    overflow: hidden;
    background:
      radial-gradient(circle at 8% 20%, rgba(255, 255, 255, 0.6), transparent 38%),
      radial-gradient(circle at 88% 75%, var(--task-accent-bg, #ecf3ff), transparent 45%),
      linear-gradient(135deg, var(--task-accent-bg, #ecf3ff) 0%, var(--paper) 65%);
    transition: background 0.4s;
  }

  .task-hero.task-hero--custom-bg {
    background:
      linear-gradient(135deg, rgba(255, 255, 255, 0.84) 0%, rgba(245, 237, 217, 0.78) 68%),
      radial-gradient(circle at 88% 75%, rgba(255, 255, 255, 0.24), transparent 45%),
      var(--task-project-bg-image) center / cover no-repeat;
  }

  .task-hero::after {
    content: '\2726';
    position: absolute;
    right: 20px;
    top: 12px;
    font-size: 4.5rem;
    color: var(--task-accent, var(--rose));
    opacity: 0.08;
    pointer-events: none;
    font-family: 'Caveat', cursive;
    line-height: 1;
  }

  .task-hero-content { flex: 1; min-width: 0; }

  .task-kicker {
    font-family: 'Caveat', cursive;
    font-size: 1.05rem;
    letter-spacing: 2px;
    color: var(--rose);
    margin-bottom: 4px;
  }

  .task-hero-title {
    font-family: 'Caveat', cursive;
    font-size: clamp(1.9rem, 3.5vw, 2.8rem);
    font-weight: 700;
    color: var(--ink);
    line-height: 1.05;
    margin-bottom: 6px;
  }

  .task-description {
    color: var(--ink-mid);
    font-size: 0.91rem;
    max-width: 580px;
    line-height: 1.5;
  }

  .task-controls-grid {
    flex-shrink: 0;
    min-width: 240px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .task-controls-grid .btn {
    width: 100%;
  }

  .task-control-label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.82rem;
    color: var(--ink-light);
    font-family: var(--font-body);
  }

  /* â”€â”€ Filters bar â”€â”€ */
  .task-filters {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    padding: 12px 14px;
  }

  /* â”€â”€ Board â”€â”€ */
  .task-board { min-height: 460px; }

  /* â”€â”€ Kanban layout â”€â”€ */
  .task-kanban {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
    align-items: start;
  }

  .task-column {
    background: rgba(255, 255, 255, 0.58);
    border: 2px solid var(--ink);
    box-shadow: var(--shadow-pixel-sm);
    padding: 12px 10px;
    min-height: 380px;
    transition: box-shadow 0.15s, transform 0.15s;
  }

  .task-column:hover {
    box-shadow: var(--shadow-pixel);
    transform: translateY(-1px);
  }

  .task-column-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px dashed var(--paper-dark);
    padding-bottom: 8px;
    margin-bottom: 12px;
  }

  .task-column-head h3 {
    font-family: 'Almendra', serif;
    font-size: 1.08rem;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 1;
  }

  .task-cards {
    display: flex;
    flex-direction: column;
    gap: 9px;
  }

  .task-cards.drag-over {
    outline: 2px dashed var(--rose);
    outline-offset: 2px;
    background: rgba(201, 123, 132, 0.08);
  }

  /* â”€â”€ Task card â”€â”€ */
  .task-card {
    background: var(--paper);
    border: 1.5px solid var(--ink);
    padding: 10px 10px 10px 14px;
    box-shadow: 2px 2px 0 var(--ink);
    position: relative;
    transition: transform 0.13s, box-shadow 0.13s;
    animation: taskCardIn 0.28s ease both;
    overflow: hidden;
  }

  .task-card.custom-color {
    background: var(--task-card-custom, var(--paper));
  }

  .task-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: var(--task-accent, var(--rose));
    border-radius: var(--radius) 0 0 var(--radius);
  }

  .task-card:hover {
    transform: translateY(-2px) translateX(-1px);
    box-shadow: 4px 4px 0 var(--ink);
  }

  .task-card.dragging {
    opacity: 0.55;
    transform: rotate(1deg);
  }

  .task-card.task-drop-before::after,
  .task-card.task-drop-after::after {
    content: '';
    position: absolute;
    left: 8px;
    right: 8px;
    height: 3px;
    background: linear-gradient(90deg, var(--rose), var(--amber));
    border-radius: 999px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.6);
    z-index: 4;
    pointer-events: none;
  }

  .task-card.task-drop-before::after {
    top: -3px;
  }

  .task-card.task-drop-after::after {
    bottom: -3px;
  }

  .task-card.important {
    border-color: var(--amber-dark);
    box-shadow: 2px 2px 0 var(--amber-dark);
  }

  .task-card.important::before { background: var(--amber); }

  .task-card.important:hover { box-shadow: 4px 4px 0 var(--amber-dark); }

  .task-card > header {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 8px;
    margin-bottom: 6px;
    align-items: stretch;
    cursor: pointer;
    user-select: none;
  }

  .task-card > header strong {
    font-size: 0.9rem;
    line-height: 1.3;
    color: var(--ink);
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .task-card-actions {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    align-self: flex-end;
  }

  .task-card-controls {
    display: inline-flex;
    align-items: center;
    gap: 4px;
  }

  .task-card-main {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    min-width: 0;
    flex: 1;
  }

  .task-card-actions--kanban {
    width: 100%;
    justify-content: space-between;
    align-items: flex-start;
    align-self: stretch;
  }

  /* ── Card summary / expand ── */
  .task-card-summary {
    display: flex;
    align-items: flex-start;
    gap: 4px;
    width: 100%;
    min-width: 0;
  }

  .task-card-summary strong {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .task-star {
    color: var(--amber);
    font-size: 0.95rem;
    line-height: 1.3;
    flex-shrink: 0;
  }

  .task-date-chip {
    font-size: 0.67rem;
    color: var(--ink-mid);
    background: var(--paper-dark);
    border-radius: 999px;
    padding: 1px 6px;
    white-space: nowrap;
    flex-shrink: 0;
    cursor: default;
    user-select: text;
  }

  .task-date-chip--kanban {
    margin-right: 0;
    align-self: flex-start;
  }

  .task-expand-btn {
    font-size: 0.72rem;
    color: var(--ink-light);
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    transition: transform 0.18s;
    flex-shrink: 0;
    padding: 2px 3px;
    user-select: none;
  }

  .task-card:not(.task-card--collapsed) .task-expand-btn {
    transform: rotate(180deg);
  }

  .task-card--collapsed .task-card-body {
    display: none;
  }

  .task-card--done {
    opacity: 0.55;
    transition: opacity 0.25s;
  }
  .task-card--done:hover {
    opacity: 0.8;
  }
  .task-card--done .task-card-summary strong {
    text-decoration: line-through;
    text-decoration-color: var(--ink-light);
  }
  .task-card--done .task-icon-btn,
  .task-card--done .task-expand-btn {
    pointer-events: auto;
  }

  .task-card > header {
    margin-bottom: 0;
  }

  .task-card:not(.task-card--collapsed) > header {
    margin-bottom: 6px;
  }

  .task-assignee-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid var(--paper-dark);
    object-fit: cover;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.62rem;
    background: #fff;
    color: var(--ink-light);
  }

  .task-assignee-avatar-fallback {
    font-weight: 700;
  }

  .task-card p {
    font-size: 0.84rem;
    color: var(--ink-mid);
    margin-bottom: 8px;
    white-space: pre-wrap;
    line-height: 1.4;
  }

  @keyframes taskCardIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  /* â”€â”€ Task card meta â”€â”€ */
  .task-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 5px;
  }

  .task-badge {
    font-size: 0.7rem;
    border: 1px solid var(--paper-dark);
    border-radius: 999px;
    background: #fff;
    padding: 2px 8px;
    white-space: nowrap;
  }

  .task-tag {
    font-size: 0.7rem;
    color: #fff;
    border-radius: 999px;
    padding: 2px 9px;
    white-space: nowrap;
  }

  .task-subtasks-wrap {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px dashed var(--paper-dark);
  }

  .task-subtasks-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--ink-light);
    margin-bottom: 5px;
  }

  .task-progress {
    width: 100%;
    height: 7px;
    border-radius: 999px;
    background: var(--paper-dark);
    overflow: hidden;
    margin-bottom: 7px;
  }

  .task-progress > span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--sage-light), var(--sage));
    transition: width 0.18s ease;
  }

  .task-subtasks-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .task-subtask-item {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--ink-mid);
    line-height: 1.3;
  }

  .task-subtask-item input {
    margin-top: 1px;
    flex-shrink: 0;
  }

  .task-subtask-item.done span {
    text-decoration: line-through;
    color: var(--ink-light);
  }

  .status-todo        { border-color: var(--amber);     color: var(--amber-dark); }
  .status-in_progress { border-color: var(--sky);       color: #1f546f; }
  .status-done        { border-color: var(--sage);      color: #2a5c2f; }

  .priority-high   { border-color: var(--red-error); color: var(--red-error); }
  .priority-medium { border-color: var(--amber);     color: var(--amber-dark); }
  .priority-low    { border-color: var(--ink-light); color: var(--ink-light); }

  .task-controls-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    margin-bottom: 5px;
  }

  .task-controls-row select {
    min-width: 0;
  }

  .task-important-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--ink-light);
    cursor: pointer;
  }

  .task-assignee {
    font-size: 0.74rem;
    color: var(--ink-light);
    margin-top: 5px;
    padding-top: 5px;
    border-top: 1px dashed var(--paper-dark);
  }

  .task-icon-btn {
    border: 1px solid var(--paper-dark);
    background: transparent;
    color: var(--ink-light);
    width: 22px;
    height: 22px;
    cursor: pointer;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: color 0.12s, border-color 0.12s;
  }

  .task-icon-btn:hover { color: var(--red-error); border-color: var(--red-error); }

  .task-load-more {
    width: 100%;
    margin-top: 8px;
    font-size: 0.78rem;
    justify-content: center;
  }

  /* â”€â”€ Timeline view â”€â”€ */
  .task-timeline {
    display: flex;
    flex-direction: column;
    gap: 20px;
  }

  .task-time-block {
    position: relative;
    border-left: 3px solid var(--rose);
    padding-left: 18px;
  }

  .task-time-block::before {
    content: '';
    position: absolute;
    left: -6px; top: 5px;
    width: 9px; height: 9px;
    border-radius: 50%;
    background: var(--rose);
    border: 2px solid var(--paper);
  }

  .task-time-label {
    font-family: 'Caveat', cursive;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 10px;
  }

  .task-time-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 10px;
  }

  /* â”€â”€ Matrix view â”€â”€ */
  .task-matrix {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }

  .task-matrix-cell {
    border: 2px solid var(--ink);
    background: rgba(255, 255, 255, 0.55);
    box-shadow: var(--shadow-pixel-sm);
    padding: 12px;
    min-height: 220px;
  }

  .task-matrix-cell h3 {
    font-family: 'Almendra', serif;
    font-size: 1.02rem;
    margin-bottom: 10px;
    color: var(--ink);
  }

  /* â”€â”€ Empty states â”€â”€ */
  .task-empty,
  .task-empty-small {
    border: 1.5px dashed var(--paper-dark);
    padding: 14px;
    color: var(--ink-light);
    text-align: center;
    background: rgba(255, 255, 255, 0.5);
    font-size: 0.88rem;
  }

  .task-empty { padding: 24px 18px; font-size: 1rem; }

  /* â”€â”€ Modals â”€â”€ */
  .task-modal-card {
    max-width: 520px;
    width: 100%;
    margin: auto;
    animation: fadeSlideUp 0.22s ease;
  }

  .task-modal-wide { max-width: 640px; }

  .task-modal-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 10px;
  }

  @keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  /* â”€â”€ FAB (mobile new-task) â”€â”€ */
  .task-fab {
    display: none;
    position: fixed;
    bottom: 22px;
    right: 18px;
    z-index: 290;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--rose);
    border: 2px solid var(--ink);
    box-shadow: var(--shadow-pixel);
    color: #fff;
    font-size: 1.7rem;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s, box-shadow 0.15s;
    line-height: 1;
  }

  .task-fab:hover {
    transform: scale(1.1) translateY(-2px);
    box-shadow: var(--shadow-pixel-lg);
  }

  /* â”€â”€ Theme accent variables â”€â”€ */
  .task-theme-mountain { --task-accent: #7AADCA; --task-accent-bg: #ecf3ff; }
  .task-theme-desert   { --task-accent: #C9954A; --task-accent-bg: #fff0d9; }
  .task-theme-forest   { --task-accent: #6E9B72; --task-accent-bg: #e6f4e8; }
  .task-theme-ocean    { --task-accent: #5fa8d3; --task-accent-bg: #e2f2fa; }
  .task-theme-city     { --task-accent: #9B84C9; --task-accent-bg: #eef0f7; }
  .task-theme-home     { --task-accent: #C97B84; --task-accent-bg: #fdf3e8; }
  .task-theme-custom   { --task-accent: #5C8A72; --task-accent-bg: #e8f0ea; }

  /* â”€â”€ Responsive: tablet (â‰¤1100px) â”€â”€ */
  @media (max-width: 1100px) {
    .task-shell { grid-template-columns: 260px 1fr; }
    .task-controls-grid { grid-template-columns: 1fr 1fr; }
  }

  /* â”€â”€ Responsive: mobile sidebar drawer (â‰¤900px) â”€â”€ */
  @media (max-width: 900px) {
    .task-shell {
      grid-template-columns: 1fr;
      padding: 14px 12px 110px;
    }

    /* Sidebar becomes a slide-out drawer */
    .task-sidebar {
      position: fixed;
      left: 0; top: 0; bottom: 0;
      width: min(320px, 86vw);
      z-index: 300;
      transform: translateX(-110%);
      transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
      max-height: 100dvh;
      border-radius: 0 4px 4px 0;
      border-left: none;
      padding-top: 12px;
    }

    .task-sidebar.open { transform: translateX(0); }

    .task-sidebar-overlay { display: none; }
    .task-sidebar-overlay.visible { display: block; }

    .task-sidebar-close { display: block; }
    .task-mob-toggle { display: flex; }
    .task-fab { display: flex; }

    .task-hero { flex-direction: column; padding: 18px 16px; }
    .task-controls-grid { width: 100%; grid-template-columns: repeat(2, 1fr); }
    .task-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  }

  /* â”€â”€ Responsive: small phone (â‰¤600px) â”€â”€ */
  @media (max-width: 600px) {
    .task-shell { padding: 8px 8px 100px; gap: 10px; }
    .task-hero-title { font-size: 1.9rem; }
    .task-controls-grid,
    .task-filters,
    .task-modal-grid,
    .task-controls-row,
    .task-matrix { grid-template-columns: 1fr; }
    .task-kanban { grid-template-columns: 1fr; }
    .task-modal-grid { margin-bottom: 8px; }
  }

/* ══════════════════════════════════════════════════════════════════
   Goals Page
══════════════════════════════════════════════════════════════════ */

/* ── Page layout ── */
.goals-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 16px 120px;
}

.goals-page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding-bottom: 20px;
  border-bottom: 2px dashed var(--paper-dark);
  margin-bottom: 24px;
}

.goals-page-subtitle {
  font-family: 'Caveat', cursive;
  font-size: 0.95rem;
  color: var(--rose);
  letter-spacing: 2px;
  margin-bottom: 4px;
}

.goals-page-title {
  font-family: 'Caveat', cursive;
  font-size: 3rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1;
}

.goals-page-desc {
  font-size: 0.9rem;
  color: var(--ink-light);
  margin-top: 4px;
}

/* ── View / layout toggles ── */
.goals-view-toggle {
  display: flex;
  background: var(--paper);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-pixel-sm);
}

.goals-view-btn {
  padding: 6px 14px;
  font-size: 0.82rem;
  font-family: 'Nunito', sans-serif;
  font-weight: 600;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--ink-light);
  transition: all 0.1s;
  border-right: 1px solid var(--paper-dark);
  white-space: nowrap;
}

.goals-view-btn:last-child { border-right: none; }
.goals-view-btn.active, .goals-view-btn:hover {
  background: var(--ink);
  color: var(--paper);
}

.goals-layout-toggle {
  display: flex;
  background: var(--paper);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-pixel-sm);
}

.goals-layout-btn {
  padding: 6px 12px;
  font-size: 1rem;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--ink-light);
  transition: all 0.1s;
  border-right: 1px solid var(--paper-dark);
}

.goals-layout-btn:last-child { border-right: none; }
.goals-layout-btn.active, .goals-layout-btn:hover {
  background: var(--ink);
  color: var(--paper);
}

/* ── Invites banner ── */
.goals-invites-banner {
  background: var(--amber-bg);
  border: 2px solid var(--amber);
  box-shadow: var(--shadow-pixel-sm);
  padding: 12px 16px;
  margin-bottom: 20px;
}

.goals-invites-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--amber-dark);
  margin-bottom: 8px;
}

.goals-invite-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-top: 1px solid var(--amber-light);
}

.goals-invite-emoji { font-size: 1.2rem; margin-right: 6px; }
.goals-invite-name  { font-weight: 600; font-size: 0.9rem; }
.goals-invite-from  { font-size: 0.78rem; color: var(--ink-light); margin-left: 4px; }

/* ── Grid / List layouts ── */
.goals-grid {
  display: grid;
  gap: 16px;
}

.goals-layout-card {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.goals-layout-list {
  grid-template-columns: 1fr;
}

.goals-layout-masonry {
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  align-items: start;
}

.goals-layout-masonry .goals-card:nth-child(3n + 2) {
  margin-top: 14px;
}

.goals-layout-journey {
  grid-template-columns: 1fr;
  position: relative;
  padding-left: 22px;
}

.goals-layout-journey::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 4px;
  bottom: 4px;
  width: 3px;
  background: linear-gradient(to bottom, var(--rose-light), var(--sky));
}

.goals-layout-journey .goals-card {
  position: relative;
}

.goals-layout-journey .goals-card::before {
  content: '';
  position: absolute;
  left: -22px;
  top: 20px;
  width: 12px;
  height: 12px;
  border: 2px solid var(--theme-border, var(--ink));
  background: var(--paper);
  border-radius: 50%;
}

/* ── Skeleton ── */
.goals-skeleton {
  height: 180px;
  background: linear-gradient(90deg, var(--paper-dark) 25%, var(--paper) 50%, var(--paper-dark) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border: 2px solid var(--paper-dark);
}

/* ── Goal card ── */
@keyframes goalCardIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.goals-card {
  background: var(--theme-bg, var(--paper));
  border: 2px solid var(--theme-border, var(--ink));
  box-shadow: var(--shadow-pixel);
  padding: 16px;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
  opacity: 0;
}

.goals-card.goals-card-in {
  animation: goalCardIn 0.28s ease forwards;
}

.goals-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--theme-border, var(--ink));
}

.goals-card--completed {
  opacity: 0.68;
  filter: saturate(0.6);
}

.goals-card-header {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 10px;
}

.goals-card-emoji {
  font-size: 1.6rem;
  flex-shrink: 0;
  line-height: 1;
}

.goals-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.goals-card-actions {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}

.goals-card-action {
  background: none;
  border: none;
  cursor: pointer;
  padding: 3px 5px;
  font-size: 0.85rem;
  color: var(--ink-light);
  transition: color 0.1s;
}

.goals-card-action:hover { color: var(--ink); }

.goals-badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 2px;
  white-space: nowrap;
}

.goals-badge-done {
  background: #fff7e0;
  color: #9E6F2C;
}

.goals-card-title {
  font-family: 'Caveat', cursive;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
  word-break: break-word;
}

.goals-card-desc {
  font-size: 0.82rem;
  color: var(--ink-light);
  line-height: 1.4;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.goals-card-date {
  font-size: 0.78rem;
  color: var(--ink-light);
  margin-bottom: 8px;
}

/* ── In list layout ── */
.goals-layout-list .goals-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 16px;
}
.goals-layout-list .goals-card-header { margin-bottom: 0; flex-direction: column; align-items: center; gap: 4px; }
.goals-layout-list .goals-card-title  { margin-bottom: 0; }
.goals-layout-list .goals-card-desc   { display: none; }
.goals-layout-list .goals-progress    { grid-column: span 3; }

/* ── Progress bar ── */
.goals-progress { margin-top: 10px; }

.goals-progress-bar {
  height: 8px;
  background: var(--paper-dark);
  border: 1px solid var(--paper-lined);
  overflow: hidden;
  border-radius: 1px;
}

.goals-progress-bar-fill {
  height: 100%;
  width: 0%;
  transition: width 0.7s cubic-bezier(.4,0,.2,1);
  border-radius: 1px;
}

/* ── Empty state ── */
.goals-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--ink-light);
  gap: 8px;
}

.goals-empty-icon { font-size: 4rem; }
.goals-empty-title { font-family: 'Caveat', cursive; font-size: 1.8rem; font-weight: 700; color: var(--ink); }
.goals-empty-sub   { font-size: 0.9rem; margin-bottom: 12px; }

/* ══════════════════════════════════════════════════════════════════
   Goals Modal (Create / Edit)
══════════════════════════════════════════════════════════════════ */
.goals-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(61,43,31,0.45);
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.goals-modal {
  background: var(--paper);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-pixel-lg);
  padding: 24px;
  width: 100%;
  max-width: 520px;
  max-height: 88vh;
  overflow-y: auto;
  position: relative;
}

.goals-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--ink-light);
  line-height: 1;
  padding: 4px;
}

.goals-modal-close:hover { color: var(--ink); }

.goals-modal-heading {
  font-family: 'Caveat', cursive;
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 16px;
}

.goals-field-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-light);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 5px;
}

.goals-input {
  width: 100%;
  padding: 8px 12px;
  border: 2px solid var(--paper-dark);
  background: white;
  font-family: 'Nunito', sans-serif;
  font-size: 0.9rem;
  color: var(--ink);
  outline: none;
  transition: border-color 0.1s;
  border-radius: 2px;
}

.goals-input:focus { border-color: var(--ink); }

.goals-textarea {
  resize: vertical;
  min-height: 72px;
}

/* ── Theme picker ── */
.goals-theme-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.goals-theme-btn {
  padding: 5px 11px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 2px solid var(--paper-dark);
  background: var(--paper);
  cursor: pointer;
  transition: all 0.12s;
  color: var(--ink);
  border-radius: 2px;
}

.goals-theme-btn.active {
  background: var(--theme-clr, var(--rose));
  border-color: var(--theme-clr, var(--rose));
  color: white;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.2);
}

.goals-theme-btn:hover:not(.active) {
  border-color: var(--theme-clr, var(--ink));
}

/* ── Emoji button ── */
.goals-emoji-btn {
  width: 52px;
  height: 52px;
  border: 2px solid var(--paper-dark);
  background: white;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.1s;
  border-radius: 2px;
}

.goals-emoji-btn:hover { border-color: var(--ink); }

.goals-emoji-picker {
  position: absolute;
  background: var(--paper);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-pixel);
  padding: 8px;
  z-index: 1200;
}

.goals-emoji-picker-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
}

.goals-emoji-option {
  width: 32px;
  height: 32px;
  background: none;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
  transition: background 0.1s;
}

.goals-emoji-option:hover { background: var(--paper-dark); }

/* ── Toggle row ── */
.goals-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--paper-dark);
  cursor: pointer;
}

/* ══════════════════════════════════════════════════════════════════
   Goal Detail Modal
══════════════════════════════════════════════════════════════════ */
.goals-detail-modal {
  background: var(--paper);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-pixel-lg);
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.gd-header {
  position: sticky;
  top: 0;
  padding: 20px 24px 16px;
  z-index: 2;
}

.gd-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--ink-light);
  padding: 4px;
}

.gd-close:hover { color: var(--ink); }

.gd-header-inner {
  display: flex;
  align-items: center;
  gap: 14px;
}

.gd-emoji {
  font-size: 2.5rem;
  flex-shrink: 0;
  line-height: 1;
}

.gd-title {
  font-family: 'Caveat', cursive;
  font-size: 2rem;
  font-weight: 700;
  color: var(--ink);
  word-break: break-word;
}

.gd-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
  align-items: center;
}

.gd-body {
  padding: 16px 24px 24px;
  flex: 1;
}

.gd-section { margin-bottom: 20px; }

.gd-section-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ink-light);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 8px;
}

.gd-progress-bar {
  height: 12px;
  border-radius: 2px;
}

.gd-progress-fill {
  transition: width 0.8s cubic-bezier(.4,0,.2,1);
}

.gd-desc {
  font-size: 0.9rem;
  color: var(--ink-mid);
  line-height: 1.6;
}

/* ── Steps list ── */
.gd-steps-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gd-step-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--paper-dark);
  transition: opacity 0.2s;
}

.gd-step-done { opacity: 0.55; }
.gd-step-done .gd-step-text { text-decoration: line-through; }

.gd-step-toggle {
  width: 22px;
  height: 22px;
  border: 2px solid var(--paper-dark);
  background: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
  transition: all 0.12s;
  border-radius: 2px;
}

.gd-step-text {
  flex: 1;
  font-size: 0.9rem;
  color: var(--ink);
}

.gd-step-delete {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink-light);
  font-size: 0.75rem;
  padding: 2px 4px;
  opacity: 0;
  transition: opacity 0.1s;
}

.gd-step-row:hover .gd-step-delete { opacity: 1; }
.gd-step-delete:hover { color: var(--red-error); }

.gd-add-step-form {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  align-items: center;
}

.goals-add-step-row-btn {
  background: none;
  border: none;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  padding: 2px 4px;
  font-family: 'Nunito', sans-serif;
}

/* ── Members list ── */
.gd-members-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gd-member-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--paper-dark);
  font-size: 0.88rem;
}

.gd-member-remove {
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 4px;
  font-size: 0.75rem;
}

.gd-invite-form {
  position: relative;
  margin-top: 8px;
}

.gd-invite-result:hover { background: var(--paper-dark); }

/* ── Detail actions ── */
.gd-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 16px;
  border-top: 2px dashed var(--paper-dark);
}

/* ── Confirm modal for destructive actions ── */
.goals-confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(61, 43, 31, 0.45);
  z-index: 1300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.goals-confirm-box {
  width: 100%;
  max-width: 420px;
  background: var(--paper);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-pixel-lg);
  padding: 16px;
}

.goals-confirm-title {
  font-family: 'Caveat', cursive;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
}

.goals-confirm-message {
  font-size: 0.9rem;
  color: var(--ink-mid);
  margin-bottom: 14px;
  line-height: 1.45;
}

.goals-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ══════════════════════════════════════════════════════════════════
   Dashboard 3-column layout
══════════════════════════════════════════════════════════════════ */
.dashboard-layout-3col {
  grid-template-columns: 240px 1fr 220px;
  max-width: 1360px;
}

.dashboard-right-col {
  position: sticky;
  top: 76px;
  height: fit-content;
}

@media (max-width: 1100px) {
  .dashboard-layout-3col {
    grid-template-columns: 240px 1fr;
  }
  .dashboard-right-col {
    grid-column: 1 / -1;
    position: static;
  }
}

@media (max-width: 860px) {
  .dashboard-layout-3col {
    grid-template-columns: 1fr;
  }
  .dashboard-right-col {
    order: 3;
    position: static;
  }
}

/* ══════════════════════════════════════════════════════════════════
   Daily Tasks Widget
══════════════════════════════════════════════════════════════════ */
.daily-tasks-widget {
  background: var(--paper);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-pixel-sm);
  overflow: hidden;
}

.dtw-header {
  padding: 10px 12px 8px;
  border-bottom: 2px dashed var(--paper-dark);
  background: linear-gradient(135deg, #FFF4ED 0%, #FDE8D8 100%);
}

.dtw-title {
  font-family: 'Caveat', cursive;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--ink);
  display: block;
}

.dtw-date {
  font-size: 0.72rem;
  color: var(--ink-light);
  display: block;
  margin-top: 1px;
  text-transform: capitalize;
}

.dtw-list {
  padding: 6px 12px;
  max-height: 340px;
  overflow-y: auto;
}

.dtw-empty {
  text-align: center;
  font-size: 0.8rem;
  color: var(--ink-light);
  padding: 16px 0;
}

.dtw-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px dashed var(--paper-dark);
  transition: opacity 0.2s;
}

.dtw-item-done { opacity: 0.5; }
.dtw-item-done .dtw-text { text-decoration: line-through; }

.dtw-check {
  width: 20px;
  height: 20px;
  border: 2px solid var(--paper-dark);
  background: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
  transition: all 0.12s;
  border-radius: 2px;
  color: var(--sage);
}

.dtw-check-done {
  background: var(--sage);
  border-color: var(--sage);
  color: white;
}

.dtw-check:hover:not(.dtw-check-done) { border-color: var(--sage); color: var(--sage); }

.dtw-text {
  flex: 1;
  font-size: 0.82rem;
  color: var(--ink);
  word-break: break-word;
  min-width: 0;
}

.dtw-del {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink-light);
  font-size: 0.7rem;
  padding: 2px 3px;
  opacity: 0;
  transition: opacity 0.1s;
  flex-shrink: 0;
}

.dtw-item:hover .dtw-del { opacity: 1; }
.dtw-del:hover { color: var(--red-error); }

.dtw-input-row {
  display: flex;
  gap: 6px;
  padding: 8px 12px 4px;
  border-top: 1px solid var(--paper-dark);
}

.dtw-input {
  flex: 1;
  padding: 5px 8px;
  border: 2px solid var(--paper-dark);
  background: white;
  font-family: 'Nunito', sans-serif;
  font-size: 0.82rem;
  color: var(--ink);
  outline: none;
  transition: border-color 0.1s;
  border-radius: 2px;
  min-width: 0;
}

.dtw-input:focus { border-color: var(--ink); }

.dtw-add-btn {
  width: 28px;
  height: 28px;
  background: var(--rose);
  border: 2px solid var(--rose-dark);
  color: white;
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.1s;
  flex-shrink: 0;
  border-radius: 2px;
}

.dtw-add-btn:hover { background: var(--rose-dark); transform: translate(-1px,-1px); box-shadow: 2px 2px 0 var(--rose-dark); }

.dtw-clear-btn {
  background: none;
  border: none;
  font-size: 0.72rem;
  color: var(--ink-light);
  cursor: pointer;
  padding: 0 12px 8px;
  font-family: 'Nunito', sans-serif;
  transition: color 0.1s;
}

.dtw-clear-btn:hover { color: var(--red-error); }

