@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,700;1,9..144,300;1,9..144,400&family=Plus+Jakarta+Sans:wght@400;500;600&display=swap');

/* ================================================
   MINDESK — Design System
   ================================================ */

:root {
  --primary:       #FF6B35;
  --primary-dark:  #E55A24;
  --primary-light: #FF8C5A;
  --primary-bg:    rgba(255,107,53,0.08);

  --surface:       #FFFFFF;
  --bg:            #F5F3EE;
  --bg-2:          #EDE9E0;

  --text:          #1A1A2E;
  --text-2:        #6B7280;
  --text-3:        #9CA3AF;

  --border:        #E5E0D8;
  --border-2:      #D4CEC4;

  --shadow-xs: 0 1px 3px rgba(26,26,46,0.06);
  --shadow-sm: 0 2px 8px rgba(26,26,46,0.08), 0 1px 3px rgba(26,26,46,0.06);
  --shadow-md: 0 4px 16px rgba(26,26,46,0.1),  0 2px 6px rgba(26,26,46,0.06);
  --shadow-lg: 0 12px 40px rgba(26,26,46,0.14), 0 4px 12px rgba(26,26,46,0.08);
  --shadow-fab: 0 6px 24px rgba(255,107,53,0.45);

  --cat-lavoro:   #4A90E2;
  --cat-casa:     #27AE60;
  --cat-auto:     #E74C3C;
  --cat-famiglia: #9B59B6;
  --cat-budget:   #F39C12;

  --r-sm:   8px;
  --r-md:   12px;
  --r-lg:   16px;
  --r-xl:   20px;
  --r-2xl:  24px;
  --r-full: 9999px;

  --nav-h:    68px;
  --header-h: 56px;

  --font-display: 'Outfit', sans-serif;
  --font-body:    'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;

  --ease-out: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Dark vars — applied when system is dark (auto mode) OR explicit dark */

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --surface:  #1E2130;
    --bg:       #141624;
    --bg-2:     #1A1D2E;
    --text:     #F0EDE8;
    --text-2:   #9CA3AF;
    --text-3:   #6B7280;
    --border:   #2A2E42;
    --border-2: #333750;
    --shadow-xs: 0 1px 3px rgba(0,0,0,0.2);
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.25);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.3);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.4);
  }
}

/* Explicit dark — overrides system preference */

:root[data-theme="dark"] {
  --surface:  #1E2130;
  --bg:       #141624;
  --bg-2:     #1A1D2E;
  --text:     #F0EDE8;
  --text-2:   #9CA3AF;
  --text-3:   #6B7280;
  --border:   #2A2E42;
  --border-2: #333750;
  --shadow-xs: 0 1px 3px rgba(0,0,0,0.2);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.25);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.3);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.4);
}

/* Explicit light — already defined in :root, nothing to override */

/* ── Reset ─────────────────────────────────────── */

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

html {
  font-size: 16px;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button { cursor: pointer; border: none; background: none; font-family: inherit; }

input, textarea, select { font-family: inherit; }

a { text-decoration: none; color: inherit; }

img { max-width: 100%; }

::-webkit-scrollbar { width: 3px; height: 3px; }

::-webkit-scrollbar-track { background: transparent; }

::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ── Typography ─────────────────────────────────── */

h1,h2,h3,h4,h5,h6 { font-family: var(--font-display); font-weight: 700; line-height: 1.2; }

.text-primary { color: var(--primary); }

.text-2       { color: var(--text-2); font-size: 0.875rem; }

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

.font-display { font-family: var(--font-display); }

/* ── Animations ─────────────────────────────────── */

@keyframes fadeIn   { from { opacity: 0 } to { opacity: 1 } }

@keyframes slideUp  { from { transform: translateY(100%); opacity: 0 } to { transform: translateY(0); opacity: 1 } }

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

@keyframes scaleIn  { from { transform: scale(0.92); opacity: 0 } to { transform: scale(1); opacity: 1 } }

@keyframes pulse    { 0%,100% { transform: scale(1); opacity: 1 } 50% { transform: scale(1.08); opacity: 0.8 } }

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

@keyframes shimmer  {
  0%   { background-position: -400px 0 }
  100% { background-position:  400px 0 }
}

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

.animate-fadeIn  { animation: fadeIn  0.25s var(--ease-out) both }

.animate-slideUp { animation: slideUp 0.38s var(--ease-out) both }

.animate-scaleIn { animation: scaleIn 0.22s var(--ease-spring) both }

/* ── Layout ─────────────────────────────────────── */

.layout {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
}

.page-content {
  flex: 1;
  overflow-y: auto;
  padding-bottom: calc(var(--nav-h) + 16px);
}

/* ── Auth Pages ─────────────────────────────────── */

.auth-root {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 24px 20px;
}

.auth-top {
  text-align: center;
  margin-bottom: 32px;
  animation: slideDown 0.4s var(--ease-out) both;
}

.auth-logo-circle {
  width: 72px; height: 72px;
  background: var(--primary);
  border-radius: var(--r-xl);
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
  margin: 0 auto 16px;
  box-shadow: var(--shadow-fab);
}

.auth-logo-img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  margin: 0 auto 16px;
  display: block;
  border-radius: var(--r-xl);
}

.auth-top h1 {
  font-size: 2rem;
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.03em;
}

.auth-top p {
  color: var(--text-2);
  font-size: 0.95rem;
  margin-top: 4px;
}

.auth-card {
  background: var(--surface);
  border-radius: var(--r-2xl);
  padding: 28px 24px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
  animation: scaleIn 0.28s var(--ease-spring) 0.1s both;
}

.auth-card h2 {
  font-size: 1.4rem;
  margin-bottom: 6px;
}

.auth-card .subtitle {
  color: var(--text-2);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

.auth-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 0.9rem;
  color: var(--text-2);
}

.auth-footer a { color: var(--primary); font-weight: 600; }

.auth-forgot-link {
  display: block;
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
  margin: -4px 0 16px;
  text-align: right;
  font-family: inherit;
}

.auth-forgot-link:hover { text-decoration: underline; }

.auth-confirm-card { text-align: center; }

.auth-confirm-icon {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: rgba(255,107,53,0.1);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px;
}

.auth-confirm-sub {
  font-size: 0.95rem;
  color: var(--text-2);
  line-height: 1.6;
  margin: 8px 0 16px;
}

.auth-confirm-sub strong { color: var(--text-1); }

.auth-confirm-hint {
  font-size: 0.83rem;
  color: var(--text-2);
  line-height: 1.6;
  margin-bottom: 24px;
}

/* ── Form Elements ───────────────────────────────── */

.form-group { margin-bottom: 16px; }

.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 13px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  font-size: 0.95rem;
  color: var(--text);
  background: var(--bg);
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-bg);
  background: var(--surface);
}

.input-password-wrap {
  position: relative;
}

.input-password-wrap input {
  width: 100%;
  padding-right: 44px;
}

.input-password-eye {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  padding: 4px;
  display: flex;
  border-radius: 50%;
}

.input-password-eye:hover { color: var(--text-2); }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.form-error {
  display: flex; align-items: center; gap: 8px;
  background: rgba(231,76,60,0.08);
  border: 1px solid rgba(231,76,60,0.2);
  color: #E74C3C;
  padding: 10px 14px;
  border-radius: var(--r-md);
  font-size: 0.875rem;
  margin-bottom: 16px;
}

/* ── Buttons ─────────────────────────────────────── */

.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 20px;
  border-radius: var(--r-md);
  font-size: 0.95rem;
  font-weight: 600;
  transition: transform 0.12s, box-shadow 0.12s, opacity 0.12s;
  width: 100%;
}

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

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 16px rgba(255,107,53,0.35);
  margin-top: 8px;
}

.btn-primary:hover { background: var(--primary-dark); box-shadow: 0 6px 20px rgba(255,107,53,0.4); }

.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-ghost {
  background: var(--bg);
  color: var(--text-2);
  border: 1.5px solid var(--border);
}

.btn-ghost:hover { background: var(--bg-2); }

.btn-danger {
  background: rgba(231,76,60,0.08);
  color: #E74C3C;
  border: 1.5px solid rgba(231,76,60,0.2);
}

.btn-danger:hover { background: rgba(231,76,60,0.14); }

.btn-sm {
  padding: 8px 14px;
  font-size: 0.85rem;
  border-radius: var(--r-sm);
  width: auto;
}

.btn-icon {
  width: 38px; height: 38px;
  border-radius: var(--r-full);
  background: var(--bg);
  color: var(--text-2);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s;
}

.btn-icon:hover { background: var(--bg-2); color: var(--text); }

/* ── Bottom Nav ──────────────────────────────────── */

.bottom-nav {
  position: fixed;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 100%; max-width: 480px;
  height: var(--nav-h);
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 8px;
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 100;
  box-shadow: 0 -4px 20px rgba(26,26,46,0.06);
}

.nav-item {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 3px;
  padding: 8px 16px;
  border-radius: var(--r-md);
  color: var(--text-3);
  font-size: 0.7rem;
  font-weight: 500;
  transition: color 0.15s, background 0.15s;
  min-width: 60px;
}

.nav-item.active { color: var(--primary); }

.nav-item .nav-icon {
  width: 22px; height: 22px;
  transition: transform 0.2s var(--ease-spring);
}

.nav-item.active .nav-icon { transform: scale(1.15); }

/* ── FAB ─────────────────────────────────────────── */

.fab-container {
  position: fixed;
  bottom: calc(var(--nav-h) + 16px);
  right: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.fab-main {
  width: 58px; height: 58px;
  border-radius: var(--r-full);
  background: var(--primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-fab);
  transition: transform 0.25s var(--ease-spring), box-shadow 0.2s;
}

.fab-main.open { transform: rotate(45deg); }

.fab-main:hover { box-shadow: 0 8px 32px rgba(255,107,53,0.55); }

.fab-option {
  display: flex; align-items: center; gap: 10px;
  animation: fabPop 0.2s var(--ease-spring) both;
}

.fab-option-label {
  background: var(--surface);
  color: var(--text);
  padding: 6px 12px;
  border-radius: var(--r-full);
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  white-space: nowrap;
}

.fab-option-btn {
  width: 46px; height: 46px;
  border-radius: var(--r-full);
  background: var(--surface);
  color: var(--text);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-md);
  transition: transform 0.15s, background 0.15s;
}

.fab-option-btn:hover { background: var(--bg-2); transform: scale(1.06); }

/* ── Dashboard ───────────────────────────────────── */

.dash-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  padding: 20px 20px 28px;
  position: relative;
  overflow: hidden;
}

.dash-header-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
  position: relative; z-index: 1;
}

.dash-brand {
  display: flex;
  align-items: center;
}

.dash-brand-logo {
  height: 45px;
  width: auto;
  object-fit: contain;
  border-radius: 14px;
}

.dash-avatar {
  width: 38px; height: 38px;
  border-radius: var(--r-full);
  background: rgba(255,255,255,0.25);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  font-family: var(--font-display);
  border: 2px solid rgba(255,255,255,0.4);
}

.dash-greeting {
  position: relative; z-index: 1;
  color: rgba(255,255,255,0.9);
  font-size: 0.9rem;
  margin-bottom: 2px;
}

.dash-name {
  position: relative; z-index: 1;
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.dash-date-str {
  position: relative; z-index: 1;
  color: rgba(255,255,255,0.7);
  font-size: 0.82rem;
  margin-top: 4px;
  text-transform: capitalize;
}

/* Stats row */

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 0 16px;
  margin-top: -16px;
  position: relative; z-index: 10;
}

.stat-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 12px 8px;
  text-align: center;
  box-shadow: var(--shadow-md);
}

.stat-card .stat-icon { font-size: 1.3rem; margin-bottom: 4px; }

.stat-card .stat-num {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}

.stat-card .stat-label {
  font-size: 0.65rem;
  color: var(--text-3);
  margin-top: 3px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.stat-card.accent .stat-num { color: var(--primary); }

.stat-card.overdue .stat-num { color: #E74C3C; }

/* Section */

.section { padding: 20px 16px 0; }

.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  display: flex; align-items: center; gap: 6px;
}

.section-link {
  font-size: 0.82rem;
  color: var(--primary);
  font-weight: 600;
}

/* ── Smart Bar ───────────────────────────────────── */

.smart-bar-wrap { padding: 16px 16px 0; }

.smart-bar {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-xl);
  padding: 11px 14px;
  box-shadow: var(--shadow-xs);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.smart-bar:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-bg);
}

.smart-bar input {
  flex: 1;
  border: none;
  background: none;
  outline: none;
  font-size: 0.92rem;
  color: var(--text);
}

.smart-bar input::placeholder { color: var(--text-3); }

.smart-bar-submit {
  width: 32px; height: 32px;
  border-radius: var(--r-full);
  background: var(--primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: transform 0.15s, background 0.15s;
}

.smart-bar-submit:hover { background: var(--primary-dark); transform: scale(1.08); }

.smart-pills {
  display: flex; gap: 8px;
  padding: 10px 16px 0;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.smart-pills::-webkit-scrollbar { display: none; }

.pill {
  display: flex; align-items: center; gap: 5px;
  padding: 6px 12px;
  border-radius: var(--r-full);
  background: var(--surface);
  border: 1.5px solid var(--border);
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  color: var(--text-2);
  transition: all 0.15s;
  flex-shrink: 0;
}

.pill:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-bg);
}

/* ── Task Card ───────────────────────────────────── */

.task-list { display: flex; flex-direction: column; gap: 8px; }

.task-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 13px 14px;
  box-shadow: var(--shadow-xs);
  border: 1.5px solid transparent;
  transition: box-shadow 0.15s, border-color 0.15s, transform 0.15s;
  animation: fadeIn 0.2s var(--ease-out) both;
}

.task-card:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); }

.task-card.overdue { border-color: rgba(231,76,60,0.2); background: #FEF5F4; }

.task-card.completed {
  background: var(--surface);
}

.task-card.completed .task-card-body,
.task-card.completed .task-checkbox,
.task-card.completed .task-delete { opacity: 0.45; }

.task-checkbox {
  width: 22px; height: 22px;
  border-radius: 7px;
  border: 2px solid var(--border-2);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s var(--ease-spring);
  cursor: pointer;
}

.task-checkbox.checked {
  background: var(--primary);
  border-color: var(--primary);
}

.task-card-body { flex: 1; min-width: 0; }

.task-card-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.task-card.completed .task-card-title { text-decoration: line-through; color: var(--text-3); }

/* Completing animation — strikethrough on title + fadeout */

.task-card.completing {
  pointer-events: none;
}

.task-card.completing .task-card-title {
  position: relative;
  display: inline;
  background-image: linear-gradient(var(--text), var(--text));
  background-size: 0% 2px;
  background-position: left center;
  background-repeat: no-repeat;
  animation: titleStrike 0.4s 0.05s var(--ease-out) forwards;
}

@keyframes titleStrike {
  to { background-size: 100% 2px; color: var(--text-3); }
}

.task-card.completing .task-card-body {
  animation: taskFadeOut 0.3s 0.4s ease forwards;
}

.task-card.completing .task-checkbox {
  animation: checkPop 0.25s var(--ease-spring);
}

@keyframes checkPop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.3); }
  100% { transform: scale(1); }
}

@keyframes taskFadeOut {
  from { opacity: 1; }
  to   { opacity: 0.3; }
}

.task-card-meta {
  display: flex; align-items: center; gap: 6px;
  flex-wrap: wrap;
}

.task-cat-badge {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 8px;
  border-radius: var(--r-full);
  font-size: 0.72rem;
  font-weight: 600;
}

.task-due {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--r-full);
}

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

.task-delete {
  color: var(--text-3);
  padding: 6px;
  border-radius: var(--r-sm);
  transition: color 0.15s, background 0.15s;
  flex-shrink: 0;
}

.task-delete:hover { color: #E74C3C; background: rgba(231,76,60,0.08); }

/* ── Urgency List (Dashboard) ────────────────────── */

.urgency-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  background: var(--surface);
  border-radius: var(--r-md);
  border: 1.5px solid var(--border);
  transition: border-color 0.15s;
}

.urgency-item:hover { border-color: var(--border-2); }

.urgency-icon {
  width: 36px; height: 36px;
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.urgency-title { font-size: 0.88rem; font-weight: 600; color: var(--text); }

.urgency-subtitle { font-size: 0.75rem; color: var(--text-2); margin-top: 1px; }

.urgency-badge {
  margin-left: auto;
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: var(--r-full);
  font-size: 0.75rem;
  font-weight: 700;
}

/* ── Mini Calendar ───────────────────────────────── */

.mini-cal {
  background: var(--surface);
  border-radius: var(--r-xl);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.mini-cal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}

.mini-cal-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: capitalize;
}

.mini-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.cal-day-name {
  text-align: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 0;
}

.cal-day {
  aspect-ratio: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  font-size: 0.78rem;
  border-radius: var(--r-sm);
  cursor: default;
  gap: 2px;
  transition: background 0.15s;
  color: var(--text-2);
}

.cal-day.today {
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  border-radius: var(--r-full);
}

.cal-day.has-tasks .cal-dot {
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--primary);
}

.cal-day.today .cal-dot { background: rgba(255,255,255,0.7); }

.cal-day.empty { visibility: hidden; }

.cal-day.other-month { color: var(--text-3); opacity: 0.4; }

/* ── Scadenze Page ───────────────────────────────── */

.scadenza-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.scadenza-card {
  background: var(--surface);
  border-radius: var(--r-xl);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  border: 1.5px solid transparent;
  animation: fadeIn 0.25s var(--ease-out) both;
  transition: transform 0.15s, box-shadow 0.15s;
}

.scadenza-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.scadenza-card.urgency-red    { border-color: rgba(231,76,60,0.25);  }

.scadenza-card.urgency-orange { border-color: rgba(243,156,18,0.25); }

.scadenza-card.urgency-green  { border-color: rgba(39,174,96,0.15);  }

.scadenza-top {
  display: flex; align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.scadenza-left { display: flex; align-items: center; gap: 10px; }

.scadenza-cat-icon {
  width: 42px; height: 42px;
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.scadenza-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.scadenza-subtitle {
  font-size: 0.78rem;
  color: var(--text-2);
  margin-top: 2px;
}

.scadenza-countdown {
  text-align: right;
  flex-shrink: 0;
}

.countdown-num {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
}

.countdown-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-2);
}

.scadenza-progress-wrap {
  height: 6px;
  background: var(--bg);
  border-radius: var(--r-full);
  overflow: hidden;
  margin-top: 4px;
}

.scadenza-progress-bar {
  height: 100%;
  border-radius: var(--r-full);
  transition: width 0.6s var(--ease-out);
}

/* ── Filter Bar ──────────────────────────────────── */

.filter-bar {
  display: flex; gap: 8px;
  padding: 16px 16px 0;
  overflow-x: auto;
  scrollbar-width: none;
}

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

.filter-chip {
  display: flex; align-items: center; gap: 5px;
  padding: 7px 14px;
  border-radius: var(--r-full);
  background: var(--surface);
  border: 1.5px solid var(--border);
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  color: var(--text-2);
  transition: all 0.15s;
  flex-shrink: 0;
}

.filter-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.filter-chip:not(.active):hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* ── Quick Add Modal ─────────────────────────────── */

.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 300;
  display: flex; align-items: flex-end;
  animation: fadeIn 0.2s var(--ease-out);
  backdrop-filter: blur(2px);
}

.modal-sheet {
  width: 100%; max-width: 480px;
  margin: 0 auto;
  background: var(--surface);
  border-radius: var(--r-2xl) var(--r-2xl) 0 0;
  max-height: 95dvh;
  overflow-y: auto;
  animation: slideUp 0.35s var(--ease-out);
  padding-bottom: env(safe-area-inset-bottom);
}

.modal-handle {
  width: 40px; height: 4px;
  background: var(--border-2);
  border-radius: var(--r-full);
  margin: 12px auto 0;
}

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px 8px;
}

.modal-title { font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; }

.modal-body { padding: 8px 20px 20px; }

.modal-complete-btn {
  color: var(--text-3);
  transition: color 0.15s, background 0.15s;
}

.modal-complete-btn:hover {
  color: var(--primary);
  background: var(--primary-bg);
}

.modal-complete-btn.completed {
  color: #fff;
  background: var(--primary);
  border-radius: 50%;
}

/* Category pills in modal */

.cat-pills { display: flex; gap: 8px; flex-wrap: wrap; }

.cat-pill {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  border-radius: var(--r-full);
  border: 2px solid transparent;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s var(--ease-spring);
}

.cat-pill.active { border-color: currentColor; transform: scale(1.04); }

.cat-pill:not(.active):hover { transform: scale(1.02); }

/* Priority select */

.priority-row { display: flex; gap: 8px; }

.priority-opt {
  flex: 1;
  padding: 8px;
  border-radius: var(--r-md);
  border: 2px solid var(--border);
  font-size: 0.82rem;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  background: var(--bg);
  color: var(--text-2);
}

.priority-opt.active { border-color: currentColor; background: var(--surface); }

/* Recurring toggle */

.toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0; 
  margin: 4px 0;
}

.toggle-label { font-size: 0.9rem; font-weight: 600; color: var(--text); }

.toggle {
  width: 44px; height: 26px;
  border-radius: var(--r-full);
  background: var(--border-2);
  position: relative;
  transition: background 0.2s;
  cursor: pointer;
  flex-shrink: 0;
}

.toggle.on { background: var(--primary); }

.toggle::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  transition: transform 0.2s var(--ease-spring);
}

.toggle.on::after { transform: translateX(18px); }

.recurring-opts {
  display: flex; gap: 8px; align-items: center;
  margin-top: 10px;
}

.recurring-opts input[type="number"] { width: 70px; text-align: center; padding: 8px; }

.recurring-opts select { flex: 1; padding: 8px; }

/* Voice modal */

.voice-modal {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 40px 24px;
  text-align: center;
  min-height: 380px;
}

.voice-rings {
  position: relative;
  width: 120px; height: 120px;
  margin-bottom: 32px;
}

.voice-ring {
  position: absolute; inset: 0;
  border-radius: 50%;
  border: 3px solid var(--primary);
  opacity: 0;
  animation: voicePulse 2s ease-out infinite;
}

.voice-ring:nth-child(2) { animation-delay: 0.5s; }

.voice-ring:nth-child(3) { animation-delay: 1s; }

@keyframes voicePulse {
  0%   { transform: scale(0.6); opacity: 0.8; }
  100% { transform: scale(1.8); opacity: 0; }
}

.voice-mic-btn {
  position: absolute; inset: 0;
  margin: auto;
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-fab);
}

.voice-title { font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; margin-bottom: 8px; }

.voice-subtitle { color: var(--text-2); font-size: 0.9rem; }

.voice-transcript {
  background: var(--bg);
  border-radius: var(--r-lg);
  padding: 14px;
  margin-top: 16px;
  font-style: italic;
  color: var(--text-2);
  width: 100%;
  font-size: 0.9rem;
  line-height: 1.5;
  text-align: center;
}

/* Idle: big mic button */

.voice-start-btn {
  width: 88px; height: 88px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(255,107,43,0.4);
  transition: transform 0.15s, box-shadow 0.15s;
}

.voice-start-btn:hover { transform: scale(1.06); box-shadow: 0 8px 32px rgba(255,107,43,0.5); }

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

/* Hint text below description */

.voice-hint {
  margin-top: 12px;
  font-size: 0.8rem;
  color: var(--text-3);
  font-style: italic;
  background: var(--bg-2);
  border-radius: var(--r-lg);
  padding: 8px 14px;
}

/* Live transcript during recording */

.voice-live-text {
  min-height: 48px;
  max-width: 100%;
  text-align: center;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-1);
  line-height: 1.5;
  padding: 0 8px;
  word-break: break-word;
}

/* Done: result icon */

.voice-result-icon {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 1.6rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 4px;
}

/* Parsed field chips */

.voice-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 14px;
}

.voice-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--bg-2);
  border: 1.5px solid var(--border);
  border-radius: var(--r-full);
  padding: 5px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-1);
}

/* Processing spinner */

.voice-processing-spinner {
  width: 52px; height: 52px;
  border-radius: 50%;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  animation: spin 0.8s linear infinite;
}

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

/* Done action buttons */

.voice-done-actions {
  display: flex;
  gap: 8px;
  margin-top: 20px;
  width: 100%;
}

.voice-done-actions .btn { flex: 1; gap: 6px; }

/* Image modal */

.image-modal {
  padding: 24px;
  min-height: 380px;
  display: flex; flex-direction: column; gap: 16px;
}

.drop-zone {
  border: 2.5px dashed var(--border-2);
  border-radius: var(--r-xl);
  padding: 40px 24px;
  text-align: center;
  color: var(--text-2);
  transition: border-color 0.15s, background 0.15s;
  cursor: pointer;
}

.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--primary);
  background: var(--primary-bg);
  color: var(--primary);
}

.drop-icon { font-size: 2.5rem; margin-bottom: 10px; }

.drop-text { font-size: 0.9rem; font-weight: 600; margin-bottom: 4px; }

.drop-sub  { font-size: 0.78rem; color: var(--text-3); }

.img-upload-actions {
  display: flex;
  gap: 8px;
  width: 100%;
}

.img-upload-actions .btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.analyzing-steps { display: flex; flex-direction: column; gap: 10px; }

.step-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: var(--bg);
  border-radius: var(--r-md);
  font-size: 0.88rem;
  font-weight: 500;
}

.step-item.done { color: #27AE60; }

.step-item.loading { color: var(--text-2); }

.step-item.loading .step-icon { animation: spin 0.8s linear infinite; }

.step-icon { font-size: 1.1rem; }

.extracted-tasks { display: flex; flex-direction: column; gap: 8px; }

.extracted-task {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg);
  border-radius: var(--r-md);
  padding: 10px 12px;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all 0.15s;
}

.extracted-task.selected { border-color: var(--primary); background: var(--primary-bg); }

/* Image modal — new states */

.img-analyzing {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  text-align: center;
}

.img-preview-thumb {
  width: 100%;
  max-height: 160px;
  object-fit: cover;
  border-radius: var(--r-lg);
  border: 1.5px solid var(--border);
}

.img-summary {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: var(--bg-2);
  border-radius: var(--r-md);
  padding: 10px 14px;
  font-size: 0.84rem;
  color: var(--text-2);
  line-height: 1.5;
}

.img-select-hint {
  font-size: 0.82rem;
  color: var(--text-2);
  margin: 0;
}

.img-edit-btn {
  width: 28px; height: 28px;
  border-radius: var(--r-full);
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  padding: 0;
  transition: background 0.15s, color 0.15s;
}

.img-edit-btn:hover { background: var(--primary-bg); color: var(--primary); }

/* ── Profile Page ────────────────────────────────── */

.profile-page { padding: 20px 16px; }

.profile-hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: var(--r-xl);
  padding: 24px;
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 20px;
}

.profile-avatar-lg {
  width: 64px; height: 64px;
  border-radius: var(--r-full);
  background: rgba(255,255,255,0.25);
  border: 3px solid rgba(255,255,255,0.4);
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}

.profile-info-name { font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; color: #fff; }

.profile-info-sub  { font-size: 0.85rem; color: rgba(255,255,255,0.75); margin-top: 2px; }

.settings-card {
  background: var(--surface);
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  margin-bottom: 16px;
}

.settings-card-title {
  padding: 14px 16px 8px;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-2);
}

.settings-item {
  display: flex; align-items: center;
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
  gap: 12px;
}

.settings-item:hover { background: var(--bg); }

.settings-item-icon { font-size: 1.1rem; }

.settings-item-label { flex: 1; font-size: 0.9rem; font-weight: 500; }

.settings-item-arrow { color: var(--text-3); }

.settings-item-value { font-size: 0.82rem; color: var(--text-2); }

/* ── Language & Theme selectors ─────────────────────── */

.lang-selector,
.theme-selector {
  display: flex;
  gap: 6px;
  width: 100%;
}

.lang-opt,
.theme-opt {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 6px;
  border-radius: var(--r-md);
  font-size: 0.82rem;
  font-weight: 600;
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text-2);
  transition: all 0.15s var(--ease-out);
  cursor: pointer;
  white-space: nowrap;
}

.lang-opt.active,
.theme-opt.active {
  background: var(--primary-bg);
  border-color: var(--primary);
  color: var(--primary);
}

.lang-opt:not(.active):hover,
.theme-opt:not(.active):hover {
  background: var(--bg-2);
  color: var(--text);
}

/* ── Page Titles ─────────────────────────────────── */

.page-top {
  padding: 20px 16px 0;
}

.page-top h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.page-top p {
  color: var(--text-2);
  font-size: 0.88rem;
  margin-top: 4px;
}

/* ── Empty States ────────────────────────────────── */

.empty-state {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 48px 24px;
  text-align: center;
  color: var(--text-2);
  gap: 12px;
}

.empty-icon { font-size: 3rem; opacity: 0.5; }

.empty-title { font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; color: var(--text); }

.empty-sub { font-size: 0.88rem; max-width: 240px; }

/* ── Dividers ────────────────────────────────────── */

.divider { height: 1px; background: var(--border); margin: 8px 0; }

/* ── Misc ────────────────────────────────────────── */

.group-header {
  display: flex; align-items: center; gap: 8px;
  padding: 16px 0 8px;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-2);
}

.count-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px;
  border-radius: var(--r-full);
  background: var(--bg-2);
  color: var(--text-2);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0 6px;
}

/* ================================================
   DESKTOP RESPONSIVE LAYOUT
   ================================================ */

/* ── App Shell (root wrapper) ─────────────────────
   Mobile: column stack (content + bottom nav)
   Desktop: row flex (sidebar + main + right panel)
   ─────────────────────────────────────────────── */

.app-shell {
  display: flex;
  flex-direction: column;
  height: 100dvh;      /* fixed height — stops body-level scroll */
  overflow: hidden;
}

.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  min-height: 0;
  overflow: hidden;
}

/* Mobile: page-content is the single scroll container */

.app-shell .page-content {
  flex: 1;
  overflow-y: auto;
  padding-bottom: calc(var(--nav-h) + 16px);
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
  min-height: 0;       /* allow flex item to shrink below content size */
  display: flex;
  flex-direction: column;
}

/* Sidebar & right panel: hidden on mobile */

.sidebar    { display: none; }

.right-panel { display: none; }

/* ── Mobile inner-scroll layout ─────────────────────
   Pages that need a fixed header + scrollable body
   use .page-layout > .page-fixed + .page-scroll.
   On desktop these classes are plain divs (no effect).
   ─────────────────────────────────────────────── */

@media (max-width: 767px) {
  /* When page-content contains a page-layout child,
     disable its own scroll so only the inner list scrolls */
  .app-shell .page-content:has(> .page-layout) {
    overflow: hidden;
    padding-bottom: 0;
    display: flex;
    flex-direction: column;
  }
  .page-layout {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    min-height: 0;
  }
  .page-fixed { flex-shrink: 0; }
  .page-scroll {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    padding-bottom: calc(var(--nav-h) + 16px);
  }
  /* Profile: outer wrapper padding reset, children handle it */
  .profile-page.page-layout { padding: 0; }
  .profile-page .page-fixed { padding: 20px 16px 0; }
  .profile-page .page-scroll { padding: 12px 16px calc(var(--nav-h) + 16px); }
}

/* ── Desktop ≥768px ──────────────────────────────── */

@media (min-width: 768px) {
  /* Shell becomes a horizontal row */
  .app-shell {
    flex-direction: row;
    height: 100dvh;
    overflow: hidden;
  }

  /* Sidebar */
  .sidebar {
    display: flex;
    flex-direction: column;
    width: 232px;
    flex-shrink: 0;
    height: 100dvh;
    overflow-y: auto;
    background: var(--surface);
    border-right: 1px solid var(--border);
    position: sticky;
    top: 0;
  }

  /* Main area */
  .app-main {
    flex: 1;
    overflow: hidden;
    min-width: 0;
  }

  /* Page content: scrollable column, centered */
  .app-shell .page-content {
    max-width: 860px;
    margin: 0 auto;
    width: 100%;
    padding-bottom: 48px;
    overflow-y: auto;
    height: 100dvh;
    display: block;    /* reset the mobile flex-column */
    min-height: unset;
  }

  /* Hide mobile-only elements */
  .bottom-nav  { display: none !important; }
  .fab-container { display: none !important; }

  /* ── Dashboard header: rounded card instead of full-bleed ── */
  .dash-header {
    margin: 24px 24px 0;
    border-radius: var(--r-xl);
    overflow: hidden;
  }
  /* Brand + logout are in sidebar on desktop */
  .dash-header-row { display: none; }

  /* Adjust spacing for desktop content padding */
  .stats-row       { padding: 0 24px; }
  .smart-bar-wrap  { padding: 16px 24px 0; }
  .section         { padding: 20px 24px 0; }
  .filter-bar      { padding: 16px 24px 0; }
  .page-top        { padding: 28px 24px 0; }

  /* Wider page top title on desktop */
  .page-top h2 { font-size: 2rem; }
}

/* ── Wide desktop ≥1200px: show right panel ─────── */

@media (min-width: 1200px) {
  .right-panel {
    display: flex;
    flex-direction: column;
    width: 272px;
    flex-shrink: 0;
    height: 100dvh;
    overflow-y: auto;
    border-left: 1px solid var(--border);
    background: var(--bg);
    padding: 24px 16px 24px;
    gap: 14px;
  }
  /* Slightly narrower main content to balance */
  .app-shell .page-content { max-width: 780px; }
}

/* ── Sidebar internals ───────────────────────────── */

.sb-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 22px 16px 18px;
  border-bottom: 1px solid var(--border);
}

.sb-brand-icon {
  width: 55px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;  
  flex-shrink: 0;
}

.sb-brand-text {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text);
}

.sb-brand-text-white{
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: #fff;
  padding-left: 0.5rem;
}

.sb-nav {
  padding: 10px 10px 4px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.sb-nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  color: var(--text-2);
  font-size: 0.875rem;
  font-weight: 500;
  transition: background 0.13s, color 0.13s, border-color 0.13s;
  border-left: 3px solid transparent;
  text-decoration: none;
  position: relative;
}

.sb-nav-item:hover {
  background: var(--bg);
  color: var(--text);
}

.sb-nav-item.active {
  background: var(--primary-bg);
  color: var(--primary);
  font-weight: 600;
  border-left-color: var(--primary);
}

.sb-add-wrap {
  padding: 10px 12px 6px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.sb-add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  padding: 10px 14px;
  background: var(--primary);
  color: #fff;
  border-radius: var(--r-md);
  font-size: 0.875rem;
  font-weight: 700;
  box-shadow: 0 3px 10px rgba(255,107,53,0.28);
  transition: background 0.13s, box-shadow 0.13s, transform 0.12s;
}

.sb-add-btn:hover {
  background: var(--primary-dark);
  box-shadow: 0 5px 16px rgba(255,107,53,0.38);
  transform: translateY(-1px);
}

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

.sb-add-btn--secondary {
  background: var(--surface-2);
  color: var(--text-2);
  box-shadow: none;
  font-weight: 600;
  padding: 8px 14px;
  font-size: 0.8rem;
}

.sb-add-btn--secondary:hover {
  background: var(--bg);
  color: var(--text);
  box-shadow: none;
  transform: translateY(-1px);
}

.sb-add-btn--locked {
  opacity: 0.5;
  cursor: pointer;
}

.sb-add-btn--locked:hover {
  opacity: 0.75;
  background: var(--surface-2);
  transform: none;
}

.sb-plan-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 9px 14px;
  background: linear-gradient(135deg, rgba(245,158,11,0.15), rgba(239,68,68,0.15));
  border: 1.5px solid rgba(245,158,11,0.35);
  border-radius: var(--r-md);
  font-size: 0.8rem;
  font-weight: 700;
  color: #f59e0b;
}

.sb-premium-wrap {
  padding: 6px 12px 8px;
}

.sb-premium-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  padding: 10px 14px;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
  border-radius: var(--r-md);
  font-size: 0.875rem;
  font-weight: 700;
  box-shadow: 0 3px 10px rgba(239,68,68,0.28);
  transition: opacity 0.13s, box-shadow 0.13s, transform 0.12s;
}

.sb-premium-btn:hover {
  opacity: 0.9;
  box-shadow: 0 5px 16px rgba(239,68,68,0.38);
  transform: translateY(-1px);
}

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

.sb-user {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 12px;
  margin: 0 8px 12px;
  border-radius: var(--r-md);
  border-top: 1px solid var(--border);
  margin-top: 0;
  transition: background 0.13s;
}

.sb-user:hover { background: var(--bg); }

.sb-user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--primary-bg);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
  border: 1.5px solid var(--primary-light);
}

.sb-user-info { flex: 1; min-width: 0; }

.sb-user-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.sb-user-sub {
  font-size: 0.7rem;
  color: var(--text-3);
  margin-top: 1px;
}

.sb-logout-btn {
  color: var(--text-3);
  padding: 5px;
  border-radius: var(--r-sm);
  flex-shrink: 0;
  transition: color 0.13s, background 0.13s;
}

.sb-logout-btn:hover { color: #E74C3C; background: rgba(231,76,60,0.08); }

/* Separator line above user section */

.sb-user { border-top: 1px solid var(--border); padding-top: 12px; margin: 0 8px 12px; }

/* ── Premium Modal ───────────────────────────────── */

.premium-modal {
  max-width: 480px;
}

.prem-hero {
  text-align: center;
  padding: 8px 0 20px;
}

.prem-price {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 900;
  color: var(--text);
  line-height: 1;
}

.prem-price-dec {
  font-size: 1.8rem;
}

.prem-price-period {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-2);
  margin-left: 2px;
}

.prem-tagline {
  font-size: 0.875rem;
  color: var(--text-2);
  margin-top: 6px;
}

.prem-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}

.prem-col {
  border-radius: var(--r-lg);
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.prem-col--free {
  background: var(--surface-2);
}

.prem-col--pro {
  background: linear-gradient(145deg, rgba(245,158,11,0.12), rgba(239,68,68,0.12));
  border: 1.5px solid rgba(245,158,11,0.3);
}

.prem-col-header {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-2);
  display: flex;
  align-items: center;
  margin-bottom: 4px;
}

.prem-col--pro .prem-col-header {
  color: #f59e0b;
}

.prem-feat {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.8rem;
  color: var(--text-2);
}

.prem-feat--no {
  color: var(--text-3);
  text-decoration: line-through;
  opacity: 0.6;
}

.prem-feat-icon {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: rgba(39,174,96,0.15);
  color: #27AE60;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.prem-feat-icon--no {
  background: rgba(156,163,175,0.15);
  color: var(--text-3);
  font-size: 0.6rem;
}

.prem-col--pro .prem-feat {
  color: var(--text);
}

.prem-cta {
  width: 100%;
  padding: 13px;
  font-size: 0.95rem;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  box-shadow: 0 4px 14px rgba(239,68,68,0.35);
}

.prem-cta:hover:not(:disabled) {
  opacity: 0.92;
  box-shadow: 0 6px 20px rgba(239,68,68,0.45);
  transform: translateY(-1px);
}

.prem-cta:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.prem-error {
  background: rgba(231,76,60,0.1);
  color: #E74C3C;
  border-radius: var(--r-md);
  padding: 10px 14px;
  font-size: 0.85rem;
  margin-bottom: 12px;
}

.prem-fine {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-3);
  margin-top: 10px;
}

/* ── Right Panel internals ───────────────────────── */

.rp-card {
  background: var(--surface);
  border-radius: var(--r-xl);
  padding: 14px 16px;
  box-shadow: var(--shadow-xs);
}

.rp-card-title {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-3);
  margin-bottom: 12px;
}

.rp-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.rp-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 9px 6px;
  border-radius: var(--r-md);
  background: var(--bg);
  gap: 2px;
}

.rp-stat--accent { background: var(--primary-bg); }

.rp-stat--danger { background: rgba(231,76,60,0.07); }

.rp-stat--done   { background: rgba(39,174,96,0.07); }

.rp-stat-num {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1;
  color: var(--text);
}

.rp-stat--accent .rp-stat-num { color: var(--primary); }

.rp-stat--danger .rp-stat-num { color: #E74C3C; }

.rp-stat--done   .rp-stat-num { color: #27AE60; }

.rp-stat-label {
  font-size: 0.62rem;
  color: var(--text-3);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: center;
}

.rp-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.rp-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.rp-item:last-child { border-bottom: none; padding-bottom: 0; }

.rp-item:first-child { padding-top: 0; }

.rp-item-icon {
  width: 28px; height: 28px;
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.rp-item-body { flex: 1; min-width: 0; }

.rp-item-title {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.rp-item-due {
  font-size: 0.7rem;
  font-weight: 600;
  margin-top: 1px;
}

.rp-empty {
  font-size: 0.8rem;
  color: var(--text-3);
  text-align: center;
  padding: 8px 0;
}

/* ── Desktop page layout tweaks ──────────────────── */

@media (min-width: 768px) {
  /* Attività page: wider task cards */
  .task-card { border-radius: var(--r-xl); }

  /* Scadenze grid: 2 columns on wide enough screens */
  @media (min-width: 900px) {
    .scadenza-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 14px;
    }
    /* But group headers span full width */
    .scadenza-grid .group-header { grid-column: 1 / -1; }
  }

  /* Profile page */
  .profile-page { padding: 28px 24px; }
  .profile-hero { padding: 28px; }
}

/* ── App loading (initial Supabase session check) ─────────── */

.app-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100dvh;
  background: var(--bg);
}

.app-loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* ── Upgrade / plan badge ─────────────────────────────────── */

.plan-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.plan-badge.free { background: var(--surface-2); color: var(--text-3); }

.plan-badge.pro  { background: linear-gradient(135deg, #f59e0b, #ef4444); color: #fff; }

.upgrade-wall {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 32px 20px;
  text-align: center;
  border: 2px dashed var(--border);
  border-radius: var(--r-xl);
  color: var(--text-3);
}

.upgrade-wall .upgrade-icon { font-size: 2.5rem; }

.upgrade-wall p { font-size: 0.875rem; margin: 0; }

.upgrade-wall .btn { margin-top: 4px; }

/* ── QuickAdd: auto-fill tag ───────────────────────────────────── */

.auto-tag {
  display: inline-flex;
  align-items: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-bg);
  border-radius: var(--r-full);
  padding: 1px 6px;
  margin-left: 6px;
  letter-spacing: 0.03em;
  vertical-align: middle;
  animation: fadeIn 0.2s ease;
}

/* ── QuickAdd: date + time side by side ────────────────────────── */

.form-datetime { display: flex; gap: 6px; }

.form-datetime input[type="date"] { flex: 1; }

.time-input { width: 100px; padding: 9px 8px !important; font-size: 0.85rem !important; }

.time-input:disabled { opacity: 0.35; cursor: not-allowed; }

/* ── SmartNotes ────────────────────────────────────────────────── */

.sn-preview {
  min-height: 72px;
  padding: 9px 12px 6px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  cursor: text;
  font-size: 0.88rem;
  line-height: 1.5;
  transition: border-color 0.15s;
}

.sn-preview:hover { border-color: var(--border-2); }

.sn-item { display: flex; align-items: center; gap: 8px; padding: 3px 0; }

.sn-check { width: 15px !important; height: 15px; accent-color: var(--primary); flex-shrink: 0; cursor: pointer; }

.sn-label { font-size: 0.88rem; color: var(--text); }

.sn-done  { text-decoration: line-through; color: var(--text-3); }

.sn-text  { margin: 1px 0; color: var(--text); font-size: 0.88rem; }

.sn-hint  { display: block; font-size: 0.7rem; color: var(--text-3); margin-top: 4px; }

/* ── Sync toast ────────────────────────────────────────────────── */

.sync-toast {
  position: fixed;
  bottom: calc(var(--nav-h, 68px) + 12px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 9000;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px 6px 10px;
  background: var(--text);
  color: var(--surface);
  border-radius: var(--r-full);
  font-size: 0.78rem;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  animation: fadeIn 0.2s ease;
  pointer-events: none;
}

.sync-toast--done { background: #27AE60; }

.sync-toast__spinner {
  width: 12px; height: 12px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

.sync-toast__icon { font-size: 0.85rem; line-height: 1; }

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

/* ── PWA update banner ─────────────────────────────────────────── */

.update-banner {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 9999;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  font-size: 0.875rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.update-banner button {
  background: #fff;
  color: var(--primary);
  border: none;
  border-radius: var(--r-sm);
  padding: 5px 14px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

/* ── Back guard toast ──────────────────────────────────────────── */

.back-toast {
  position: fixed;
  bottom: calc(var(--nav-h) + 16px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 8000;
  background: rgba(0,0,0,0.8);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: var(--r-full);
  white-space: nowrap;
  animation: toastIn 0.25s var(--ease-spring);
  pointer-events: none;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(12px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ── PWA install prompt ────────────────────────────────────────── */

.install-prompt {
  position: fixed;
  bottom: calc(var(--nav-h) + 12px);
  left: 12px;
  right: 12px;
  z-index: 9000;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-xl);
  padding: 20px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  animation: installSlideUp 0.35s var(--ease-spring);
}

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

.install-prompt-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  display: flex;
}

.install-prompt-close:hover { color: var(--text); }

.install-prompt-icon {
  font-size: 2.2rem;
}

.install-prompt-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.install-prompt-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
}

.install-prompt-text {
  font-size: 0.84rem;
  color: var(--text-2);
  line-height: 1.5;
}

.install-prompt-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--r-full);
  padding: 12px 20px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.18s;
}

.install-prompt-btn:hover { background: var(--primary-dark); }

.install-prompt-dismiss {
  background: none;
  border: none;
  color: var(--text-3);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 4px 8px;
  font-family: inherit;
}

.install-prompt-dismiss:hover { color: var(--text-2); }

/* ── Confirm dialog ─────────────────────────────────────────────── */

.confirm-dialog {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 24px 20px 20px;
  width: min(320px, 90vw);
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.confirm-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-1);
}

.confirm-msg {
  font-size: 0.88rem;
  color: var(--text-2);
  line-height: 1.5;
  margin: 0;
}

.confirm-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 4px;
}

/* ── Calendar Page ───────────────────────────────── */

.cal-page {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

@media (max-width: 767px) {
  .cal-page.page-layout { min-height: 0; }
}

/* Header */

.cal-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  padding: 16px 16px 20px;
  position: relative;
  overflow: hidden;
}

.cal-header-inner {
  position: relative; z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

/* View toggle */

.cal-view-toggle {
  display: flex;
  background: rgba(255,255,255,0.15);
  border-radius: var(--r-full);
  padding: 3px;
  gap: 2px;
}

.cal-view-btn {
  padding: 5px 14px;
  border-radius: var(--r-full);
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(255,255,255,0.75);
  transition: background 0.15s, color 0.15s;
}

.cal-view-btn.active {
  background: rgba(255,255,255,0.95);
  color: var(--primary);
}

.cal-today-btn {
  padding: 6px 14px;
  border-radius: var(--r-full);
  font-size: 0.82rem;
  font-weight: 600;
  background: rgba(255,255,255,0.2);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.35);
  transition: background 0.15s;
}

.cal-today-btn:hover { background: rgba(255,255,255,0.3); }

/* Nav row */

.cal-nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cal-nav-btn {
  width: 34px; height: 34px;
  border-radius: var(--r-full);
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.9);
  background: rgba(255,255,255,0.15);
  transition: background 0.15s;
  flex-shrink: 0;
}

.cal-nav-btn:hover { background: rgba(255,255,255,0.25); }

.cal-period {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  text-transform: capitalize;
  letter-spacing: -0.02em;
}

/* Body */

.cal-body {
  flex: 1;
  padding: 0 8px 16px;
}

/* Day names row (month view) */

.cal-day-names-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  padding: 10px 0 4px;
}

.cal-col-name {
  text-align: center;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── Month grid ── */

.cal-month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.cal-cell {
  min-height: 76px;
  padding: 4px 3px 3px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  position: relative;
  transition: background 0.1s;
}

.cal-cell:nth-child(7n) { border-right: none; }

.cal-cell.today { background: var(--primary-bg); }

.cal-cell.drop-target {
  background: rgba(255,107,53,0.14);
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

.cal-cell-empty {
  min-height: 76px;
  background: var(--bg);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.cal-cell-empty:nth-child(7n) { border-right: none; }

.cal-day-num {
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-full);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-2);
  line-height: 1;
  margin-bottom: 3px;
}

.cal-day-num.today {
  background: var(--primary);
  color: #fff;
  font-weight: 700;
}

.cal-cell-tasks {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cal-overflow {
  font-size: 0.58rem;
  color: var(--text-3);
  font-weight: 700;
  padding-left: 2px;
}

/* ── Task chips ── */

.cal-task-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  border-left: 2px solid transparent;
  border-radius: 3px;
  cursor: grab;
  transition: opacity 0.15s, transform 0.1s;
  overflow: hidden;
  user-select: none;
}

.cal-task-chip:active { cursor: grabbing; }

.cal-task-chip:hover { opacity: 0.82; transform: translateX(1px); }

.cal-task-chip.dragging { opacity: 0.3; cursor: grabbing; }

.cal-chip-icon { font-size: 0.7rem; flex-shrink: 0; line-height: 1; }

.cal-chip-title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text);
}

.cal-task-chip.compact { padding: 1px 3px; }

.cal-task-chip.compact .cal-chip-title {
  white-space: normal;
  text-overflow: unset;
  overflow: visible;
  word-break: break-word;
}

.cal-task-chip:not(.compact) { padding: 4px 6px; }

@media (max-width: 767px) {
  .cal-task-chip.compact {
    flex-direction: column;
    align-items: center;
    gap: 1px;
    padding: 2px 2px;
    text-align: center;
  }
  .cal-task-chip.compact .cal-chip-title {
    font-size: 0.6rem;
    line-height: 1.2;
  }
}

/* ── Week view ── */

.cal-week-wrap {
  overflow-x: auto;
  padding: 4px 0 4px;
}

.cal-week-grid {
  display: flex;
  gap: 5px;
  min-width: 560px;
}

.cal-week-col {
  flex: 1;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  min-height: 220px;
  padding: 6px 4px;
  transition: background 0.1s, border-color 0.1s;
  box-shadow: var(--shadow-xs);
}

.cal-week-col.today {
  border-color: var(--primary);
  background: var(--primary-bg);
}

.cal-week-col.drop-target {
  background: rgba(255,107,53,0.12);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-bg);
}

.cal-week-day-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.cal-week-day-label.today .cal-week-day-name { color: var(--primary); }

.cal-week-day-name {
  font-size: 0.58rem;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cal-week-day-num {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-2);
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-full);
}

.cal-week-day-num.today { background: var(--primary); color: #fff; }

.cal-week-tasks { display: flex; flex-direction: column; gap: 4px; }

/* ── Schedule / Agenda view ────────────────────── */

.cal-sched {
  padding: 8px 0;
}

.cal-sched-empty {
  text-align: center;
  color: var(--text-3);
  padding: 48px 16px;
  font-size: 0.9rem;
}

.cal-sched-day {
  display: flex;
  gap: 12px;
  padding: 0 16px;
  min-height: 52px;
  border-bottom: 1px solid var(--border);
}

.cal-sched-day.past { opacity: 0.5; }

.cal-sched-day.today {
  background: var(--primary-bg);
  border-bottom-color: rgba(255,107,53,0.15);
}

.cal-sched-date {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 0;
  min-width: 90px;
  cursor: pointer;
  flex-shrink: 0;
}

.cal-sched-date-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  flex-shrink: 0;
}

.cal-sched-date-num.today {
  background: var(--primary);
  color: #fff;
}

.cal-sched-date-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 36px;
}

.cal-sched-date-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  text-transform: capitalize;
}

.cal-sched-day.today .cal-sched-date-label {
  color: var(--primary);
}

.cal-sched-tasks {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 0;
  min-width: 0;
}

.cal-sched-no-tasks {
  flex: 1;
  display: flex;
  align-items: center;
  color: var(--text-3);
  font-size: 0.82rem;
  cursor: pointer;
}

.cal-sched-task {
  display: flex;
  align-items: stretch;
  gap: 10px;
  background: var(--surface);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow 0.15s, transform 0.15s;
}

.cal-sched-task:hover {
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.cal-sched-task-bar {
  width: 4px;
  flex-shrink: 0;
  border-radius: 4px 0 0 4px;
}

.cal-sched-task-body {
  flex: 1;
  padding: 10px 12px 10px 0;
  min-width: 0;
}

.cal-sched-task-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cal-sched-task-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  font-size: 0.75rem;
  color: var(--text-2);
}

.cal-sched-pri {
  font-weight: 600;
  font-size: 0.7rem;
}

/* Desktop */

@media (min-width: 768px) {
  .cal-header { margin: 24px 24px 0; border-radius: var(--r-xl); overflow: hidden; }
  .cal-body { padding: 0 24px 24px; }
  .cal-cell { min-height: 100px; }
  .cal-week-grid { min-width: 0; }
  .cal-week-col { min-height: 300px; }
  .cal-task-chip.compact { padding: 2px 5px; }
  .cal-chip-icon { font-size: 0.75rem; }
}

/* ════════════════════════════════════════════════
   DateTimePicker
   ════════════════════════════════════════════════ */

/* Trigger */

.dtp-trigger-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dtp-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-2);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  padding: 10px 14px;
  font-size: 0.9rem;
  color: var(--text-2);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  flex: 1;
  min-width: 0;
  text-align: left;
}

.dtp-trigger:hover { border-color: var(--primary); }

.dtp-trigger.has-value { color: var(--text-1); }

.dtp-trigger-icon { flex-shrink: 0; color: var(--text-3); }

.dtp-trigger-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.dtp-trigger-time {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.82rem;
  color: var(--primary);
  font-weight: 600;
  flex-shrink: 0;
}

.dtp-trigger-clear {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--r-full);
  background: var(--bg-2);
  border: 1.5px solid var(--border);
  color: var(--text-2);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
}

.dtp-trigger-clear:hover { background: var(--danger-bg, #fef2f2); color: var(--danger, #e74c3c); }

/* Overlay */

.dtp-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 9000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

/* Bottom sheet */

.dtp-sheet {
  background: var(--bg);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: 8px 20px 32px;
  width: 100%;
  max-width: 480px;
  max-height: 92dvh;
  overflow-y: auto;
}

@media (min-width: 768px) {
  .dtp-overlay { align-items: center; }
  .dtp-sheet {
    border-radius: var(--r-xl);
    max-height: 85dvh;
    margin-bottom: 0;
  }
}

.dtp-handle {
  width: 40px; height: 4px;
  border-radius: 2px;
  background: var(--border);
  margin: 8px auto 18px;
}

/* Month navigation */

.dtp-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.dtp-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: var(--r-full);
  background: var(--bg-2);
  border: 1.5px solid var(--border);
  color: var(--text-1);
  cursor: pointer;
  transition: background 0.15s;
}

.dtp-nav-btn:hover { background: var(--primary-light, rgba(255,107,43,0.12)); }

.dtp-month-label {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-1);
  text-transform: capitalize;
}

/* Day names row */

.dtp-day-names {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-bottom: 4px;
}

.dtp-day-name {
  text-align: center;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-3);
  padding: 4px 0;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Calendar grid */

.dtp-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  margin-bottom: 18px;
}

.dtp-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-full);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--text-1);
  transition: background 0.12s, color 0.12s;
}

.dtp-day:hover:not(.empty):not(.disabled) { background: var(--primary-light, rgba(255,107,43,0.12)); }

.dtp-day.empty { pointer-events: none; }

.dtp-day.today { font-weight: 700; color: var(--primary); }

.dtp-day.selected {
  background: var(--primary) !important;
  color: #fff !important;
  font-weight: 700;
}

.dtp-day.disabled { opacity: 0.3; cursor: not-allowed; }

/* Time picker */

.dtp-time-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-2);
  border-radius: var(--r-lg);
  padding: 12px 14px;
  margin-bottom: 16px;
}

.dtp-time-icon { color: var(--text-3); flex-shrink: 0; }

.dtp-time-label { font-size: 0.88rem; font-weight: 600; color: var(--text-2); flex: 1; }

.dtp-time-selects { display: flex; align-items: center; gap: 4px; }

.dtp-sel {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  padding: 6px 8px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-1);
  cursor: pointer;
  min-width: 56px;
  text-align: center;
}

.dtp-sel:disabled { opacity: 0.4; cursor: not-allowed; }

.dtp-colon { font-weight: 700; color: var(--text-2); font-size: 1rem; }

.dtp-time-clear {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  border-radius: var(--r-full);
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-3);
  cursor: pointer;
  margin-left: 4px;
}

.dtp-time-clear:hover { color: var(--danger, #e74c3c); }

/* Confirm button */

.dtp-confirm { width: 100%; }

/* ════════════════════════════════════════════════
   Landing Page
   ════════════════════════════════════════════════ */

.lp-root {
  min-height: 100dvh;
  background: #FAF8F4;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  color: #1C1917;
  overflow-x: hidden;
}

/* Nav */

.lp-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 48px;
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 248, 244, 0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(0,0,0,0.07);
}

.lp-logo {
  font-family: 'Fraunces', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: #FF6B35;
  letter-spacing: -0.02em;
}

.lp-logo-img {
  height: 40px;
  width: auto;
  object-fit: contain;
}

.lp-nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lp-lang-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #78716C;
  background: transparent;
  border: 1.5px solid #E7E5E4;
  border-radius: 100px;
  padding: 7px 13px;
  cursor: pointer;
  transition: border-color 0.18s, color 0.18s;
  font-family: inherit;
  line-height: 1;
}

.lp-lang-btn:hover { border-color: #FF6B35; color: #FF6B35; }

.lp-nav-login {
  font-size: 0.88rem;
  font-weight: 600;
  color: #1C1917;
  text-decoration: none;
  padding: 9px 20px;
  border: 1.5px solid rgba(0,0,0,0.16);
  border-radius: 100px;
  transition: border-color 0.18s, color 0.18s;
}

.lp-nav-login:hover { border-color: #FF6B35; color: #FF6B35; }

/* Hero */

.lp-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 48px;
  padding: 88px 48px 104px;
  max-width: 1160px;
  margin: 0 auto;
  animation: lpUp 0.7s ease both;
}

.lp-eyebrow {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #FF6B35;
  margin-bottom: 22px;
}

.lp-headline {
  font-family: 'Fraunces', serif;
  font-size: clamp(3.2rem, 5.5vw, 5.2rem);
  font-weight: 300;
  line-height: 1.04;
  letter-spacing: -0.03em;
  color: #1C1917;
  margin: 0 0 28px;
}

.lp-headline em {
  font-style: italic;
  color: #FF6B35;
}

.lp-sub {
  font-size: 1.05rem;
  line-height: 1.75;
  color: #6B6357;
  max-width: 430px;
  margin: 0 0 40px;
}

.lp-ctas {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.lp-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #FF6B35;
  color: #fff;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 14px 28px;
  border-radius: 100px;
  text-decoration: none;
  transition: transform 0.18s, box-shadow 0.18s;
  box-shadow: 0 4px 22px rgba(255,107,43,0.35);
}

.lp-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(255,107,43,0.48);
}

.lp-btn-primary:hover .lp-arrow { transform: translateX(4px); }

.lp-arrow { display: inline-block; transition: transform 0.18s; }

.lp-btn-ghost {
  font-size: 0.88rem;
  font-weight: 500;
  color: #6B6357;
  text-decoration: none;
  transition: color 0.18s;
}

.lp-btn-ghost:hover { color: #1C1917; }

/* Hero visual */

.lp-hero-visual {
  position: relative;
  height: 420px;
}

.lp-orb {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 320px; height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,107,43,0.14) 0%, transparent 68%);
  animation: lpPulse 5s ease-in-out infinite;
}

@keyframes lpPulse {
  0%,100% { transform: translate(-50%,-50%) scale(1); opacity: 1; }
  50%      { transform: translate(-50%,-50%) scale(1.12); opacity: 0.65; }
}

.lp-mock {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border-radius: 16px;
  padding: 15px 20px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.1), 0 1px 4px rgba(0,0,0,0.06);
  white-space: nowrap;
}

.lp-mock-1 { top: 40px;  left: 10px;  animation: lpFloat 6s ease-in-out 0s infinite; }

.lp-mock-2 { top: 180px; right: 0;    animation: lpFloat 6s ease-in-out 2s infinite; }

.lp-mock-3 { bottom: 60px; left: 30px; animation: lpFloat 6s ease-in-out 4s infinite; }

@keyframes lpFloat {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-9px); }
}

.lp-mock-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

.lp-mock-title { font-weight: 600; font-size: 0.87rem; color: #1C1917; }

.lp-mock-sub   { font-size: 0.74rem; color: #9CA3AF; margin-top: 2px; }

.lp-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 100px;
  margin-left: 4px;
}

.lp-badge-urgent { background: #FEF2F2; color: #EF4444; }

.lp-badge-done   { background: #F0FDF4; color: #16A34A; }

.lp-badge-work   { background: #EFF6FF; color: #3B82F6; }

/* Features */

.lp-features {
  padding: 80px 48px;
  max-width: 1160px;
  margin: 0 auto;
}

.lp-features-header {
  text-align: center;
  margin-bottom: 52px;
}

.lp-pill {
  display: inline-block;
  background: rgba(255,107,43,0.1);
  color: #FF6B35;
  font-size: 0.77rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  padding: 6px 14px;
  border-radius: 100px;
  margin-bottom: 18px;
}

.lp-section-title {
  font-family: 'Fraunces', serif;
  font-size: clamp(1.9rem, 3.5vw, 2.8rem);
  font-weight: 300;
  letter-spacing: -0.025em;
  color: #1C1917;
  margin: 0;
}

.lp-section-title em { font-style: italic; color: #FF6B35; }

.lp-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

@media (min-width: 960px) {
  .lp-cards { grid-template-columns: repeat(4, 1fr); }
}

.lp-card {
  background: #fff;
  border-radius: 20px;
  padding: 28px 24px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.05);
  border: 1px solid rgba(0,0,0,0.04);
  transition: transform 0.2s, box-shadow 0.2s;
  animation: lpUp 0.6s ease calc(var(--card-i, 0) * 0.08s) both;
}

.lp-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 32px rgba(0,0,0,0.1);
}

.lp-card-icon  { font-size: 2rem; margin-bottom: 16px; }

.lp-card-title { font-weight: 700; font-size: 0.95rem; color: #1C1917; margin-bottom: 10px; line-height: 1.35; }

.lp-card-text  { font-size: 0.85rem; line-height: 1.7; color: #6B6357; }

/* AI Pro section */

.lp-ai {
  background: #1C1917;
  padding: 96px 48px;
}

.lp-ai-inner {
  max-width: 1080px;
  margin: 0 auto;
}

.lp-ai-header {
  text-align: center;
  margin-bottom: 64px;
}

.lp-pill-dark {
  background: rgba(255,107,53,0.18);
  color: #FF6B35;
  border: 1px solid rgba(255,107,53,0.3);
}

.lp-ai-title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  color: #F5F0EB;
  line-height: 1.2;
  letter-spacing: -0.03em;
  margin: 16px 0 20px;
}

.lp-ai-title em {
  font-style: italic;
  color: #FF6B35;
}

.lp-ai-sub {
  font-size: 1rem;
  color: #A8A29E;
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.7;
}

.lp-ai-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.lp-ai-card {
  background: #28211D;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 20px;
  padding: 32px;
}

.lp-ai-card-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #FF6B35;
  background: rgba(255,107,53,0.12);
  border: 1px solid rgba(255,107,53,0.2);
  border-radius: 100px;
  padding: 5px 12px;
  margin-bottom: 20px;
}

.lp-ai-card-title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: #F5F0EB;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
  line-height: 1.3;
}

.lp-ai-card-text {
  font-size: 0.85rem;
  color: #A8A29E;
  line-height: 1.7;
  margin-bottom: 28px;
}

.lp-ai-demo {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lp-ai-demo-bubble {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px 12px 12px 2px;
  padding: 10px 14px;
  font-size: 0.82rem;
  color: #D6D0CA;
  font-style: italic;
}

.lp-ai-demo-doc {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 0.82rem;
  color: #D6D0CA;
}

.lp-ai-demo-doc-icon { font-size: 1.5rem; }

.lp-ai-demo-arrow {
  text-align: center;
  font-size: 1.1rem;
  color: #FF6B35;
  opacity: 0.7;
}

.lp-ai-demo-result {
  background: rgba(255,107,53,0.07);
  border: 1px solid rgba(255,107,53,0.2);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.lp-ai-demo-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  color: #D6D0CA;
}

.lp-ai-demo-label {
  min-width: 64px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #78716C;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Pro plan AI rows */

.lp-plan-row-ai {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 6px 0;
  font-size: 0.88rem;
  color: #1C1917;
  border-top: 1px dashed rgba(255,107,53,0.2);
  margin-top: 4px;
  padding-top: 10px;
}

.lp-plan-row-ai .lp-plan-check { color: #FF6B35; flex-shrink: 0; margin-top: 1px; }

.lp-plan-row-ai > span { display: flex; flex-direction: column; gap: 2px; }

.lp-plan-row-hint {
  font-size: 0.75rem;
  color: #78716C;
  font-weight: 400;
}

/* Pricing */

.lp-pricing {
  padding: 80px 48px;
  max-width: 880px;
  margin: 0 auto;
}

.lp-plans {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

.lp-plan {
  background: #fff;
  border-radius: 24px;
  padding: 36px 32px;
  border: 1.5px solid rgba(0,0,0,0.07);
  box-shadow: 0 2px 12px rgba(0,0,0,0.05);
  position: relative;
}

.lp-plan-pro {
  border-color: #FF6B35;
  box-shadow: 0 8px 40px rgba(255,107,43,0.18);
  transform: scale(1.02);
}

.lp-plan-badge {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: #FF6B35;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 5px 16px;
  border-radius: 100px;
  white-space: nowrap;
}

.lp-plan-name {
  font-family: 'Fraunces', serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: #1C1917;
  margin-bottom: 16px;
}

.lp-plan-pro .lp-plan-name { color: #FF6B35; }

.lp-plan-price {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 12px;
}

.lp-plan-amount {
  font-family: 'Fraunces', serif;
  font-size: 2.8rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #1C1917;
  line-height: 1;
}

.lp-plan-period {
  font-size: 0.85rem;
  color: #9CA3AF;
  font-weight: 500;
}

.lp-plan-desc {
  font-size: 0.88rem;
  color: #6B6357;
  line-height: 1.6;
  margin: 0 0 24px;
  min-height: 42px;
}

.lp-plan-features {
  list-style: none;
  padding: 0;
  margin: 0 0 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lp-plan-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  font-weight: 500;
}

.lp-plan-row-ok  { color: #1C1917; }

.lp-plan-row-no  { color: #C4BDB5; }

.lp-plan-check {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: rgba(255,107,43,0.12);
  color: #FF6B35;
  font-size: 0.72rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.lp-plan-cross {
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: #D1CBC3;
  font-size: 1rem;
}

.lp-plan-cta {
  display: block;
  text-align: center;
  font-weight: 700;
  font-size: 0.92rem;
  padding: 13px 20px;
  border-radius: 100px;
  text-decoration: none;
  transition: transform 0.18s, box-shadow 0.18s;
}

.lp-plan-cta-free {
  background: var(--bg-2, #EDE9E0);
  color: #1C1917;
}

.lp-plan-cta-free:hover { transform: translateY(-1px); }

.lp-plan-cta-pro {
  background: #FF6B35;
  color: #fff;
  box-shadow: 0 4px 18px rgba(255,107,43,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.lp-plan-cta-pro:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(255,107,43,0.48);
}

.lp-plan-fine {
  font-size: 0.76rem;
  color: #9CA3AF;
  text-align: center;
  margin: 12px 0 0;
  line-height: 1.5;
}

@media (max-width: 767px) {
  .lp-pricing { padding: 48px 20px; }
  .lp-plans { grid-template-columns: 1fr; }
  .lp-plan-pro { transform: none; }
}

/* Bottom CTA */

.lp-bottom-cta {
  background: linear-gradient(160deg, #FFF7F3 0%, #FEF0E8 60%, #FAF8F4 100%);
  border-top: 1px solid rgba(255,107,43,0.12);
  padding: 96px 48px;
  text-align: center;
}

.lp-bottom-inner { max-width: 520px; margin: 0 auto; }

.lp-bottom-title {
  font-family: 'Fraunces', serif;
  font-size: clamp(2.4rem, 4.5vw, 4rem);
  font-weight: 300;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: #1C1917;
  margin: 0 0 20px;
}

.lp-bottom-title em { font-style: italic; color: #FF6B35; }

.lp-bottom-sub {
  font-size: 1rem;
  color: #6B6357;
  margin: 0 0 36px;
}

.lp-btn-lg { padding: 17px 38px; font-size: 1rem; }

/* Footer */

.lp-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 48px;
  border-top: 1px solid rgba(0,0,0,0.07);
  background: #FAF8F4;
}

.lp-footer-logo {
  font-family: 'Fraunces', serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: #FF6B35;
}

.lp-footer-logo-img {
  height: 32px;
  width: auto;
  object-fit: contain;
}

.lp-footer-links { display: flex; gap: 24px; }

.lp-footer-links a { font-size: 0.84rem; color: #6B6357; text-decoration: none; transition: color 0.15s; }

.lp-footer-links a:hover { color: #1C1917; }

.lp-footer-copy { font-size: 0.8rem; color: #9CA3AF; }

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

/* Mobile */

@media (max-width: 767px) {
  .lp-nav     { padding: 16px 20px; }
  .lp-hero    { grid-template-columns: 1fr; padding: 48px 20px 64px; gap: 48px; }
  .lp-hero-visual { height: 270px; }
  .lp-mock-1  { top: 10px; left: 0; }
  .lp-mock-2  { top: 110px; right: 0; }
  .lp-mock-3  { bottom: 10px; left: 10px; }
  .lp-features { padding: 48px 20px; }
  .lp-cards   { grid-template-columns: 1fr; }
  .lp-ai      { padding: 56px 20px; }
  .lp-ai-cards { grid-template-columns: 1fr; }
  .lp-bottom-cta { padding: 56px 20px; }
  .lp-footer  { flex-direction: column; gap: 16px; text-align: center; padding: 24px 20px; }
}
