@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg: #000000;
  --surface: #0c0c0c;
  --surface2: #171717;
  --border: #232323;
  --border-strong: #3a3a3a;
  --ink: #f5f5f5;
  --muted: #9a9a9a;
  --faint: #666666;
  --accent-bg: #ffffff;
  --accent-text: #000000;
  --danger: #f87171;
  --ok: #34d399;
  --shadow: 0 1px 0 rgba(255,255,255,0.04) inset, 0 8px 24px rgba(0,0,0,0.35);
  --shadow-sm: 0 1px 0 rgba(255,255,255,0.03) inset, 0 4px 12px rgba(0,0,0,0.3);
  --ease: cubic-bezier(.2,.7,.3,1);
}

html { color-scheme: dark; scroll-behavior: smooth; }
* { box-sizing: border-box; }

html, body { overflow-x: hidden; width: 100%; }

body {
  margin: 0;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  background:
    radial-gradient(1200px 500px at 15% -10%, rgba(255,255,255,0.05), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(255,255,255,0.03), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.01em;
  accent-color: #ffffff;
}

a { color: inherit; text-decoration: none; }
::selection { background: rgba(255,255,255,0.18); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #383838; }

.wrap { max-width: 960px; margin: 0 auto; padding: 28px 20px calc(40px + env(safe-area-inset-bottom)); animation: fadeUp .5s var(--ease); }

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

/* Navigation */

.topnav {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border-bottom: 1px solid var(--border);
  padding: 15px 24px;
  position: sticky; top: 0;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  z-index: 20;
}
.topnav .brand { font-weight: 700; font-size: 17px; letter-spacing: -0.02em; display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.brand-logo { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; display: inline-block; box-shadow: 0 0 0 1px rgba(255,255,255,0.15); }
.topnav nav { display: flex; gap: 2px; background: var(--surface); border: 1px solid var(--border); padding: 3px; border-radius: 12px; overflow-x: auto; scrollbar-width: none; }
.topnav nav::-webkit-scrollbar { display: none; }
.topnav nav a { padding: 7px 14px; border-radius: 9px; font-size: 13.5px; font-weight: 500; color: var(--muted); white-space: nowrap; transition: color .15s var(--ease), background-color .15s var(--ease); }
.topnav nav a.active { background: var(--accent-bg); color: var(--accent-text); box-shadow: var(--shadow-sm); }
.topnav nav a:hover:not(.active) { color: var(--ink); background: rgba(255,255,255,0.05); }
.topnav .logout { flex-shrink: 0; display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 10px; color: var(--danger); background: rgba(248,113,113,0.08); border: 1px solid rgba(248,113,113,0.2); cursor: pointer; transition: all .15s var(--ease); }
.topnav .logout svg { width: 16px; height: 16px; }
.topnav .logout:hover { background: rgba(248,113,113,0.18); border-color: rgba(248,113,113,0.4); color: #ff9d9d; }

@media (max-width: 720px) {
  .topnav { padding: 12px 14px; }
  .topnav .brand { font-size: 15px; }
  .topnav nav a { padding: 7px 11px; font-size: 12.5px; }
}

@media (max-width: 420px) {
  .topnav .brand span.brand-text { display: none; }
}

/* Layout helpers */

.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.title { font-size: 23px; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 4px; }
.subtitle { color: var(--muted); font-size: 14px; margin: 0; }
.section-title { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; margin: 32px 0 14px; color: var(--ink); }

/* Cards */

.card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 18px; box-shadow: var(--shadow-sm); transition: border-color .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease); }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.trip-card { display: block; overflow: hidden; }
.trip-card:hover { border-color: var(--border-strong); transform: translateY(-2px); box-shadow: var(--shadow); }
.trip-card h3 { margin: 12px 0 4px; font-size: 15.5px; font-weight: 600; letter-spacing: -0.01em; }
.trip-card .dest { color: var(--muted); font-size: 13px; margin: 0 0 12px; }
.trip-card .meta { color: var(--faint); font-size: 12px; display: flex; flex-wrap: wrap; gap: 10px; }

/* Stats */

.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 600px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { position: relative; overflow: hidden; }
.stat .num { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.stat .label { color: var(--muted); font-size: 12.5px; margin-top: 2px; }

/* Badges */

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px; border-radius: 999px; font-size: 11px; font-weight: 600; letter-spacing: 0.01em; background: var(--surface2); color: var(--muted); border: 1px solid var(--border); }
.badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .7; }
.badge.ongoing { background: rgba(52,211,153,0.12); color: var(--ok); border-color: rgba(52,211,153,0.25); }
.badge.done { background: rgba(52,211,153,0.12); color: var(--ok); border-color: rgba(52,211,153,0.25); }

/* Buttons */

.btn { display: inline-flex; align-items: center; gap: 6px; padding: 10px 17px; border-radius: 10px; font-size: 14px; font-weight: 600; letter-spacing: -0.005em; border: 1px solid transparent; cursor: pointer; background: var(--accent-bg); color: var(--accent-text); box-shadow: 0 1px 2px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,255,255,0.02) inset; transition: transform .12s var(--ease), opacity .15s var(--ease), background-color .15s var(--ease); }
.btn:hover { opacity: 0.88; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.secondary { background: var(--surface2); color: var(--ink); border-color: var(--border); box-shadow: none; }
.btn.secondary:hover { background: #1d1d1d; opacity: 1; }
.btn.ghost { background: transparent; color: var(--muted); box-shadow: none; }
.btn.ghost:hover { color: var(--ink); opacity: 1; transform: none; }
.btn.danger { background: rgba(248,113,113,0.1); color: var(--danger); border-color: rgba(248,113,113,0.25); box-shadow: none; }
.btn.danger:hover { background: rgba(248,113,113,0.16); opacity: 1; }
.btn.small { padding: 7px 13px; font-size: 13px; }

/* Forms */

.field { margin-bottom: 17px; }
.field label { display: block; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin-bottom: 7px; }
.field input, .field select, .field textarea {
  width: 100%; background: var(--surface2); border: 1px solid var(--border); color: var(--ink);
  padding: 11px 13px; border-radius: 10px; font-size: 16px; font-family: inherit; color-scheme: dark;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease), background-color .15s var(--ease);
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--border-strong); background: #1a1a1a; box-shadow: 0 0 0 3px rgba(255,255,255,0.05); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } }
.error { color: var(--danger); font-size: 13px; margin-bottom: 14px; padding: 9px 12px; background: rgba(248,113,113,0.08); border: 1px solid rgba(248,113,113,0.2); border-radius: 9px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }

/* Star rating input */

.stars-input { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 3px; }
.stars-input input { display: none; }
.stars-input label { font-size: 24px; line-height: 1; color: var(--surface2); cursor: pointer; transition: color .1s var(--ease), transform .1s var(--ease); }
.stars-input label:hover { transform: scale(1.12); }
.stars-input input:checked ~ label, .stars-input label:hover, .stars-input label:hover ~ label { color: #ffd35c; }
.stars-display { color: #ffd35c; letter-spacing: 2px; font-size: 13px; }
.stars-display.empty { color: var(--faint); }

/* Activities */

.activity { display: flex; align-items: flex-start; gap: 12px; padding: 13px 15px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface); margin-bottom: 8px; transition: border-color .15s var(--ease), background-color .15s var(--ease); }
.activity:hover { border-color: var(--border-strong); background: #101010; }
.activity.late { border-color: rgba(248,113,113,0.3); background: rgba(248,113,113,0.04); }
.activity.late:hover { border-color: rgba(248,113,113,0.5); }
.activity .check { width: 21px; height: 21px; border-radius: 7px; border: 1.5px solid var(--border-strong); flex-shrink: 0; margin-top: 2px; display: flex; align-items: center; justify-content: center; background: transparent; cursor: pointer; transition: all .15s var(--ease); position: relative; }
.activity .check::before { content: ''; position: absolute; inset: -12px; }
.activity .check:hover { border-color: var(--ink); }
.activity .check.done { background: var(--ok); border-color: var(--ok); color: #04231a; font-weight: 700; font-size: 12px; }
.activity .body { flex: 1; min-width: 0; }
.activity h4 { margin: 0 0 5px; font-size: 14px; font-weight: 600; letter-spacing: -0.005em; }
.activity h4.done-text { text-decoration: line-through; color: var(--faint); font-weight: 500; }
.activity .meta { display: flex; flex-wrap: wrap; gap: 11px; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.activity .meta .date-tag { color: var(--ink); font-weight: 600; }
.activity .late-tag { color: #ff8a8a; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; font-size: 10.5px; }
.activity .comment { color: var(--muted); font-size: 13px; margin-top: 6px; line-height: 1.45; }
.activity .actions { display: flex; gap: 6px; flex-shrink: 0; }
.activity .actions a { color: var(--faint); font-size: 12px; font-weight: 500; padding: 4px 8px; border-radius: 7px; transition: all .15s var(--ease); }
.activity .actions a:hover { color: var(--ink); background: var(--surface2); }

.day-block { margin-bottom: 24px; }
.day-title { font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 10px; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.day-title::before { content: ''; width: 14px; height: 1px; background: var(--border-strong); }
.day-title span { color: var(--faint); font-weight: 500; text-transform: none; letter-spacing: 0; }

.empty-state { border: 1px dashed var(--border); border-radius: 16px; padding: 36px 24px; text-align: center; color: var(--muted); font-size: 14px; background: radial-gradient(400px 120px at 50% 0%, rgba(255,255,255,0.03), transparent); }

/* Calendar */

.cal-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-nav strong { font-size: 14px; font-weight: 600; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 14px; font-size: 11.5px; color: var(--muted); }
.cal-legend .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 5px; vertical-align: middle; }
.cal-legend .dot.range { background: #4f83ff; border-radius: 50%; }
.cal-legend .dot.today { background: #ffffff; }
.cal-legend .dot.upcoming { background: #565656; }
.cal-legend .dot.late { background: #ff8a8a; }
.cal-legend .dot.done { background: var(--ok); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 7px; }
.cal-dow { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--faint); text-align: center; padding-bottom: 6px; }
.cal-cell { position: relative; min-height: 96px; border: 1px solid var(--border); border-radius: 11px; padding: 7px; font-size: 11px; background: var(--surface); transition: border-color .15s var(--ease), background-color .15s var(--ease); }
.cal-cell:hover { border-color: var(--border-strong); }
.cal-cell.out { opacity: 0.25; }
.cal-cell.today { border-color: rgba(255,255,255,0.5); box-shadow: 0 0 0 1px rgba(255,255,255,0.08); }
.cal-cell .date-num { color: var(--faint); margin-bottom: 5px; font-weight: 600; }
.cal-cell.today .date-num { color: var(--ink); }
.cal-cell.in-range { background: rgba(79,131,255,0.06); border-color: rgba(79,131,255,0.25); }
.cal-cell.in-range .date-num { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; margin-bottom: 3px; border-radius: 50%; background: rgba(79,131,255,0.28); color: #cfdcff; }
.cal-cell.range-start .date-num, .cal-cell.range-end .date-num { background: #4f83ff; color: #ffffff; }
.cal-cell.today.in-range { border-color: rgba(255,255,255,0.6); box-shadow: 0 0 0 1px rgba(255,255,255,0.1); }
.cal-cell.today .date-num { background: rgba(255,255,255,0.16); border-radius: 50%; width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; }
.cal-pill { display: block; border-radius: 6px; padding: 3px 6px; margin-bottom: 3px; font-size: 10px; font-weight: 600; border: 1px solid transparent; transition: transform .12s var(--ease); white-space: normal; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cal-pill:hover { transform: scale(1.03); }
.cal-pill.is-today { background: var(--accent-bg); color: var(--accent-text); box-shadow: 0 0 0 1px rgba(255,255,255,0.15); }
.cal-pill.is-upcoming { background: var(--surface2); color: var(--ink); border-color: var(--border-strong); font-weight: 500; }
.cal-pill.is-late { background: rgba(248,113,113,0.16); color: #ff9d9d; border-color: rgba(248,113,113,0.35); }
.cal-pill.is-done { background: rgba(52,211,153,0.14); color: var(--ok); border-color: rgba(52,211,153,0.3); text-decoration: line-through; opacity: .85; }
.cal-add { position: absolute; right: 6px; bottom: 6px; width: 20px; height: 20px; border-radius: 50%; background: transparent; border: none; color: var(--faint); display: flex; align-items: center; justify-content: center; font-size: 14px; line-height: 1; opacity: 0; transform: scale(.85); transition: opacity .15s var(--ease), transform .15s var(--ease), background-color .15s var(--ease), color .15s var(--ease); }
.cal-cell:hover .cal-add { opacity: 1; transform: scale(1); }
.cal-add:hover { background: var(--surface2); color: var(--ink); }

/* Calendrier mobile (bande de jours + agenda, inspire de Teams) */

.cal-mobile { display: none; }

.cal-strip { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 10px; margin-bottom: 4px; scrollbar-width: none; }
.cal-strip::-webkit-scrollbar { display: none; }
.cal-strip-day { flex: 0 0 auto; width: 42px; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 0 9px; border-radius: 13px; color: var(--muted); background: var(--surface); border: 1px solid var(--border); transition: background-color .15s var(--ease), border-color .15s var(--ease); }
.cal-strip-day .dow { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.02em; color: var(--faint); }
.cal-strip-day .num { font-size: 15px; font-weight: 700; color: var(--ink); width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; border-radius: 50%; }
.cal-strip-day .strip-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--faint); box-shadow: 0 0 0 2px var(--surface); }
.cal-strip-day .strip-dot.is-today { background: #ffffff; }
.cal-strip-day .strip-dot.is-upcoming { background: #8a8a8a; }
.cal-strip-day .strip-dot.is-late { background: #ff8a8a; box-shadow: 0 0 0 2px var(--surface), 0 0 6px rgba(255,138,138,0.7); }
.cal-strip-day .strip-dot.is-done { background: var(--ok); }
.cal-strip-day.in-range { background: rgba(79,131,255,0.08); border-color: rgba(79,131,255,0.3); }
.cal-strip-day.today .num { background: #4f83ff; color: #ffffff; }
.cal-strip-day.today .strip-dot { box-shadow: 0 0 0 2px #4f83ff; }

.cal-agenda { display: flex; flex-direction: column; gap: 18px; padding-bottom: 70px; }
.agenda-day { scroll-margin-top: 80px; border-radius: 14px; transition: background-color .3s var(--ease); }
.agenda-day:target { background: rgba(255,255,255,0.03); }
.agenda-day-label { font-size: 13px; font-weight: 700; color: var(--ink); margin-bottom: 8px; display: flex; align-items: center; gap: 8px; text-transform: capitalize; }
.agenda-today-badge { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: #4f83ff; background: rgba(79,131,255,0.14); padding: 2px 8px; border-radius: 999px; }
.agenda-item { display: flex; align-items: stretch; gap: 10px; padding: 10px 12px 10px 0; margin-bottom: 6px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); overflow: hidden; }
.agenda-bar { width: 3px; flex-shrink: 0; border-radius: 0 3px 3px 0; background: var(--faint); }
.agenda-item.is-today .agenda-bar { background: #ffffff; }
.agenda-item.is-upcoming .agenda-bar { background: #565656; }
.agenda-item.is-late .agenda-bar { background: #ff8a8a; }
.agenda-item.is-done .agenda-bar { background: var(--ok); }
.agenda-time { flex-shrink: 0; width: 42px; font-size: 12px; font-weight: 600; color: var(--muted); padding-top: 1px; }
.agenda-body { min-width: 0; }
.agenda-title { font-size: 14px; font-weight: 600; color: var(--ink); }
.agenda-item.is-done .agenda-title { text-decoration: line-through; color: var(--faint); font-weight: 500; }
.agenda-sub { font-size: 12px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.cal-fab { position: fixed; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom)); width: 52px; height: 52px; border-radius: 50%; background: var(--accent-bg); color: var(--accent-text); display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 400; line-height: 1; box-shadow: 0 10px 24px rgba(0,0,0,0.5); z-index: 15; }

@media (max-width: 720px) {
  .cal-grid, .cal-legend { display: none; }
  .cal-mobile { display: block; }
}

/* Tabs */

.tabs { display: inline-flex; gap: 2px; background: var(--surface); border: 1px solid var(--border); border-radius: 13px; padding: 4px; margin-bottom: 20px; }
.tabs a { padding: 8px 18px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--muted); transition: all .15s var(--ease); }
.tabs a.active { background: var(--accent-bg); color: var(--accent-text); box-shadow: var(--shadow-sm); }
.tabs a:hover:not(.active) { color: var(--ink); }

/* Login */

.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: radial-gradient(900px 500px at 50% 0%, rgba(255,255,255,0.06), transparent 60%), var(--bg); }
.login-box { width: 100%; max-width: 370px; animation: fadeUp .5s var(--ease); }
.login-box .card { padding: 28px 26px; }
.login-logo { width: 92px; height: 92px; object-fit: cover; border-radius: 50%; display: block; margin: 0 auto 18px; box-shadow: 0 8px 20px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.15); }
.login-title { text-align: center; margin-bottom: 26px; }
.login-title h1 { margin: 0 0 5px; font-size: 21px; font-weight: 700; letter-spacing: -0.02em; }
.login-title p { margin: 0; color: var(--muted); font-size: 13px; }

/* Trip header */

.trip-header { margin-bottom: 22px; }
.trip-header .meta-row { display: flex; flex-wrap: wrap; gap: 18px; color: var(--muted); font-size: 14px; margin: 12px 0 18px; }
.trip-header .actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Selecteurs personnalises de date et d heure */

.dp-input, .tp-input { cursor: pointer; caret-color: transparent; background-repeat: no-repeat; background-position: right 13px center; background-size: 16px; padding-right: 40px !important; }
.dp-input { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a8a8a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='4'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E"); }
.tp-input { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a8a8a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpolyline points='12 7 12 12 15.5 14'/%3E%3C/svg%3E"); }
.dp-input.open, .tp-input.open { border-color: var(--border-strong); background-color: #1a1a1a; }
.dp-input::placeholder, .tp-input::placeholder { color: var(--faint); }

.picker-overlay { display: none; }

.dp-popup, .tp-popup { position: absolute; z-index: 60; margin-top: 6px; background: var(--surface2); border: 1px solid var(--border-strong); border-radius: 16px; box-shadow: var(--shadow); padding: 12px; width: 280px; animation: fadeUp .15s var(--ease); }
.dp-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.dp-nav strong { font-size: 13px; font-weight: 600; text-transform: capitalize; }
.dp-nav button { width: 26px; height: 26px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--ink); cursor: pointer; font-size: 13px; transition: background-color .15s var(--ease); }
.dp-nav button:hover { background: #222; }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.dp-dow { font-size: 10px; color: var(--faint); text-align: center; padding-bottom: 4px; font-weight: 600; }
.dp-cell { width: 100%; aspect-ratio: 1; border: none; border-radius: 8px; background: transparent; color: var(--ink); font-size: 12px; cursor: pointer; transition: background-color .12s var(--ease); }
.dp-cell:hover { background: var(--surface); }
.dp-cell.out { visibility: hidden; cursor: default; }
.dp-cell.today { box-shadow: inset 0 0 0 1px var(--border-strong); font-weight: 700; }
.dp-cell.selected { background: var(--accent-bg); color: var(--accent-text); font-weight: 700; }
.dp-today-btn { width: 100%; margin-top: 10px; padding: 8px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); font-size: 12px; font-weight: 600; cursor: pointer; }
.dp-today-btn:hover { color: var(--ink); background: #222; }

.tp-popup { width: 160px; max-height: 260px; overflow-y: auto; padding: 6px; }
.tp-item { padding: 12px 12px; border-radius: 9px; font-size: 14px; color: var(--ink); cursor: pointer; transition: background-color .12s var(--ease); }
.tp-item:hover { background: var(--surface); }
.tp-item.selected { background: var(--accent-bg); color: var(--accent-text); font-weight: 700; }
.tp-item.tp-clear { color: var(--faint); border-bottom: 1px solid var(--border); margin-bottom: 4px; border-radius: 9px 9px 0 0; }

@media (max-width: 560px) {
  body.picker-open { overflow: hidden; }
  .picker-overlay { display: block; position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 55; }
  .dp-popup, .tp-popup { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); margin-top: 0; z-index: 61; width: min(90vw, 320px); animation: fadeUpCenter .15s var(--ease); }
  .tp-popup { max-height: 60vh; }
}

@keyframes fadeUpCenter { from { opacity: 0; transform: translate(-50%, -46%); } to { opacity: 1; transform: translate(-50%, -50%); } }
