/* =========================================================
   Carrousel Planner — v33 festival palette polish
   Aesthetic: Warm festival energy · clean mobile-first
   Fonts: Nunito (rounded, friendly) + system
   ========================================================= */

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

:root {
  --bg:          #f5efe8;
  --panel:       #ffffff;
  --panel-soft:  #fffbf5;
  --text:        #1e1a16;
  --text-mid:    #4a4440;
  --muted:       #8a7f77;
  --line:        #e6ddd4;
  --brand:       #e03040;
  --brand-dark:  #b01f2e;
  --brand-light: #fdeced;
  --green:       #1f9451;
  --green-bg:    #e8f8ef;
  --yellow:      #e8a800;
  --yellow-bg:   #fff8e0;
  --purple:      #5d3a8e;
  --purple-bg:   #f0eaf9;
  --blue:        #1a6fbf;
  --blue-bg:     #e8f2fc;
  --shadow-sm:   0 2px 8px rgba(30,20,10,.07);
  --shadow:      0 4px 20px rgba(30,20,10,.10);
  --shadow-lg:   0 12px 40px rgba(30,20,10,.16);
  --radius-sm:   10px;
  --radius:      16px;
  --radius-lg:   22px;
  --font:        'Nunito', system-ui, -apple-system, sans-serif;
  color-scheme: light;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 30% at 50% 0%, rgba(224,48,64,.08) 0%, transparent 70%);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}

button, input, select, textarea { font: inherit; }
button, select, input[type="checkbox"] { cursor: pointer; }
a { color: inherit; }

/* ── App shell ── */
.app-shell {
  width: min(1140px, 100%);
  margin: 0 auto;
  padding: 12px 12px 100px;
}

/* ── Topbar ── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  margin: -12px -12px 14px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid var(--line);
}
.topbar.compact-nav {
  box-shadow: 0 1px 0 var(--line), 0 4px 24px rgba(30,20,10,.08);
  padding-top: env(safe-area-inset-top, 0px);
}
.topbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
}
.logo h1 { font-size: 1.2rem; line-height: 1.1; margin: 0; color: var(--brand); font-weight: 900; letter-spacing: -.02em; }
.logo p { margin: 2px 0 0; color: var(--muted); font-size: .82rem; }
.date-picker { display: flex; gap: 8px; align-items: center; }
.date-picker label { font-size: .78rem; color: var(--muted); }
.date-picker select { min-width: 128px; }

/* Tab navigation */
.nav {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  padding: 6px 10px 8px;
}
.nav button {
  border: none;
  background: transparent;
  color: var(--muted);
  border-radius: var(--radius-sm);
  padding: 7px 4px;
  min-height: 40px;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: -.01em;
  position: relative;
  transition: color .15s ease, background .15s ease;
}
.nav button::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 22px;
  height: 3px;
  background: var(--brand);
  border-radius: 99px;
  transition: transform .18s cubic-bezier(.34,1.56,.64,1);
}
.nav button.active {
  color: var(--brand);
  background: var(--brand-light);
}
.nav button.active::after {
  transform: translateX(-50%) scaleX(1);
}
.nav button:not(.active):hover { color: var(--text); background: #f5f0ea; }

/* ── Buttons & Pills ── */
.pill, .btn {
  border: 1.5px solid var(--line);
  background: var(--panel);
  color: var(--text-mid);
  border-radius: 999px;
  padding: 9px 14px;
  min-height: 42px;
  font-weight: 700;
  font-size: .9rem;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: background .13s ease, border-color .13s ease, transform .1s ease, box-shadow .13s ease;
  box-shadow: var(--shadow-sm);
}
.btn:hover:not(:disabled) { border-color: #ccc2b8; box-shadow: var(--shadow); }
.btn:active:not(:disabled) { transform: translateY(1px); box-shadow: none; }

.pill.active, .btn.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: 0 4px 14px rgba(224,48,64,.35);
}
.btn.primary:hover:not(:disabled) {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
}
.btn.danger { border-color: #f5bfc4; color: var(--brand-dark); background: var(--brand-light); }
.btn.soft { background: var(--panel-soft); border-color: var(--line); }
.btn.small { padding: 6px 11px; min-height: 34px; font-size: .84rem; }
.btn.full { width: 100%; }

button:disabled, .btn:disabled, select:disabled, input:disabled {
  opacity: .45;
  cursor: not-allowed;
}

/* ── Day Strip ── */
.day-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 0 0 14px;
}
.day-strip button {
  border: 1.5px solid var(--line);
  background: var(--panel);
  border-radius: var(--radius);
  padding: 10px 4px;
  text-align: center;
  font-weight: 700;
  color: var(--text-mid);
  transition: background .13s ease, border-color .13s ease, transform .1s ease;
  box-shadow: var(--shadow-sm);
}
.day-strip button strong { font-size: .95rem; display: block; line-height: 1.2; }
.day-strip button small { display: block; opacity: .7; font-size: .78rem; margin-top: 2px; }
.day-strip button.active {
  background: var(--purple);
  color: #fff;
  border-color: var(--purple);
  box-shadow: 0 4px 14px rgba(93,58,142,.3);
}
.day-strip button.today-date:not(.active) {
  border-color: var(--brand);
  background: var(--brand-light);
  color: var(--text);
  box-shadow: 0 0 0 3px rgba(224,48,64,.12);
}
.day-strip button:active { transform: scale(.97); }

/* ── Panels & Cards ── */
.hero {
  background: linear-gradient(135deg, #fff 0%, #fff5f0 60%, #fff 100%);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow);
  margin-bottom: 0;
}
.hero h2 { margin: 0 0 6px; font-size: 1.3rem; font-weight: 900; }
.hero p { margin: 0; color: var(--muted); }

.grid { display: grid; gap: 10px; }
.grid.two { grid-template-columns: 1fr; }

.panel, .card {
  background: var(--panel);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}
.panel h2, .panel h3, .card h3 { margin-top: 0; }
.muted { color: var(--muted); }
.warning {
  background: var(--yellow-bg);
  border: 1.5px solid #f0dc93;
  color: #5c4410;
  border-radius: var(--radius);
  padding: 12px 14px;
  font-weight: 600;
}
.empty { padding: 24px 18px; color: var(--muted); text-align: center; font-size: .95rem; }

/* ── Cards ── */
.card {
  display: grid;
  gap: 10px;
  cursor: default;
}
.card-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.card h3 { margin: 0; font-size: 1.05rem; font-weight: 800; line-height: 1.25; }
.card.clickable, .clickable-row {
  cursor: pointer;
  transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease;
}
.card.clickable:hover, .card.clickable:focus-visible, .clickable-row:hover {
  border-color: #d4c4b0;
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.card.clickable:focus-visible, .clickable-row:focus-visible {
  outline: 3px solid rgba(224,48,64,.25);
  outline-offset: 2px;
}
.address { color: var(--muted); font-size: .88rem; margin-top: 1px; }
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 2px;
}
.tap-hint { color: var(--muted); font-size: .78rem; margin-top: -2px; }

/* ── Chips ── */
.chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #f0ebe4;
  color: var(--text-mid);
  font-size: .8rem;
  font-weight: 700;
  border: 1px solid transparent;
}
.chip.green  { background: var(--green-bg);  color: #1a6b3a; border-color: #b8e8cc; }
.chip.red    { background: var(--brand-light); color: var(--brand-dark); border-color: #f5bfc4; }
.chip.gold   { background: var(--yellow-bg); color: #7a5700; border-color: #f0dc93; }
.chip.purple { background: var(--purple-bg); color: var(--purple); border-color: #d0bcf0; }

.card.visited {
  opacity: .65;
  background: #f7f4ef;
  border-color: #ddd6cc;
}
.card.visited h3 { text-decoration: line-through; text-decoration-thickness: 2px; }
.card.unplanned, .manage-row.unplanned { opacity: .6; background: #faf8f5; }
.muted-chip { background: #ede8e1; color: #726a62; }

/* ── Visit notes & highlights ── */
.visit-note-preview {
  background: var(--blue-bg);
  border-left: 4px solid #7ab6e8;
  padding: 8px 11px;
  border-radius: var(--radius-sm);
  color: #1a4a70;
  font-size: .9rem;
}
.note-highlight {
  background: var(--yellow-bg);
  border-left: 4px solid var(--yellow);
  padding: 8px 11px;
  border-radius: var(--radius-sm);
}
.event-summary {
  background: var(--blue-bg);
  border-left: 4px solid #7ab6e8;
  padding: 8px 11px;
  border-radius: var(--radius-sm);
  color: #1a4a70;
  font-size: .9rem;
}

/* ── Score badge ── */
.score {
  min-width: 52px;
  text-align: center;
  border-radius: var(--radius-sm);
  background: var(--purple-bg);
  color: var(--purple);
  padding: 5px 8px;
  font-weight: 900;
  font-size: 1rem;
  border: 1px solid #d0bcf0;
  flex-shrink: 0;
}

/* ── Toolbar ── */
.toolbar {
  display: grid;
  gap: 8px;
  margin-bottom: 0;
}
.toolbar input[type="search"],
select,
input[type="time"],
input[type="number"],
input[type="text"],
textarea {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: #fff;
  color: var(--text);
  transition: border-color .13s ease, box-shadow .13s ease;
}
.toolbar input[type="search"]:focus,
select:focus,
input[type="time"]:focus,
input[type="number"]:focus,
input[type="text"]:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(224,48,64,.12);
  outline: none;
}
textarea { min-height: 80px; resize: vertical; }
.check-row { display: flex; align-items: center; gap: 9px; }

/* ── Plan rows ── */
.plan-row {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 10px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
}
.plan-time { color: var(--brand-dark); font-weight: 900; font-size: .92rem; line-height: 1.35; }
.plan-time.empty { color: transparent; }
.plan-row.visited {
  opacity: .65;
  background: #f7f4ef;
  border-radius: var(--radius);
  padding-left: 10px;
  padding-right: 10px;
}
.plan-row.visited h3 { text-decoration: line-through; text-decoration-thickness: 2px; }
.reason-list { margin: 5px 0 0; padding-left: 18px; color: var(--muted); font-size: .88rem; }
.reason-list li { margin: 2px 0; }
.backup-row { background: #faf8f5; border-radius: var(--radius); padding-left: 10px; padding-right: 10px; }

/* ── Location bar ── */
.location-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
}
.location-bar > div:first-child {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.location-bar .muted { font-size: .86rem; overflow-wrap: anywhere; }
.location-actions { display: flex; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }

/* ── Manage rows ── */
.manage-list { display: grid; gap: 8px; }
.manage-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  align-items: center;
  background: var(--panel);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
  gap: 10px 12px;
}
.manage-main { min-width: 0; }
.manage-main strong { display: block; overflow-wrap: anywhere; font-weight: 800; }
.compact-field {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  white-space: nowrap;
  font-size: .88rem;
}
.compact-field input[type="number"] {
  flex: 0 0 58px;
  width: 58px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1.5px solid var(--line);
}
.manage-row .btn { justify-self: start; }

/* ── Settings ── */
.settings-grid, .settings-stack { display: grid; gap: 12px; }
.setting-row {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.setting-row:first-child { border-top: 0; }
.availability-row, .session-row, .event-row, .note-row {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
}
.session-row { grid-template-columns: 1fr 82px 82px; align-items: center; }
.note-row { grid-template-columns: 1fr auto auto; align-items: center; }
.event-row { grid-template-columns: 1fr 82px 82px auto; align-items: start; }

/* Settings accordion */
.settings-details, .admin-details, .password-panel {
  border: 1.5px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--panel);
}
.settings-details > summary,
.admin-details > summary,
.password-panel > summary {
  cursor: pointer;
  list-style: none;
  font-weight: 800;
  color: var(--text);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  transition: background .13s ease;
}
.settings-details > summary::-webkit-details-marker,
.admin-details > summary::-webkit-details-marker,
.password-panel > summary::-webkit-details-marker { display: none; }
.settings-details > summary::after,
.admin-details > summary::after,
.password-panel > summary::after {
  content: "▾";
  color: var(--muted);
  font-size: .9rem;
  transition: transform .18s ease;
  flex-shrink: 0;
}
.settings-details:not([open]) > summary::after,
.admin-details:not([open]) > summary::after,
.password-panel:not([open]) > summary::after { transform: rotate(-90deg); }
.settings-details[open] > summary,
.admin-details[open] > summary {
  border-bottom: 1px solid var(--line);
  background: #fffdf9;
}
.settings-details > summary:hover,
.admin-details > summary:hover { background: #faf8f4; }
.settings-detail-body { padding: 14px 16px 16px; }
.settings-detail-body > p:first-child,
.admin-details > p:first-of-type { margin-top: 0; }
.settings-details hr { border: 0; border-top: 1px solid var(--line); margin: 12px 0; }
.settings-details { padding: 0; }

.admin-details {
  border-top: 0;
  padding-top: 0;
  background: #fffdf8;
}
.admin-details > :not(summary) { margin-left: 14px; margin-right: 14px; }
.admin-details > :last-child { margin-bottom: 14px; }
.admin-details .chips { margin-top: 10px; }
.account-panel > .admin-details:first-of-type { margin-top: 8px; }

/* ── Village detail page ── */
.village-page { gap: 12px; }
.detail-hero,
.detail-section {
  border: 1.5px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  padding: 14px;
}
.detail-hero {
  display: grid;
  gap: 12px;
  background: linear-gradient(135deg, #fff 0%, #fffbf0 100%);
}
.detail-section h3 { margin: 0 0 10px; font-weight: 800; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.status-card, .schedule-row, .special-detail, .plain-note {
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  background: #fff;
}
.status-card { display: grid; gap: 3px; margin-bottom: 8px; }
.status-card.open { border-color: #a8dfc0; background: var(--green-bg); }
.status-card.closed { background: #faf8f5; }
.schedule-list { display: grid; gap: 8px; }
.schedule-row { display: flex; justify-content: space-between; gap: 10px; }
.special-detail { display: grid; gap: 4px; margin-bottom: 8px; }

/* ── Star ratings ── */
.quick-ratings {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.rating-block {
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,.8);
  padding: 12px;
}
.rating-title { font-weight: 800; margin-bottom: 4px; font-size: .95rem; }
.tiny { font-size: .8rem; }
.compact-stars { margin-bottom: 0; }
.field-label { display: block; color: var(--muted); font-size: .84rem; margin: 8px 0 4px; font-weight: 600; }
.star-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-bottom: 8px; }
.star-btn {
  border: 1.5px solid var(--line);
  background: #fff;
  border-radius: var(--radius-sm);
  min-width: 44px;
  min-height: 42px;
  font-size: 1.3rem;
  line-height: 1;
  color: #c8b86e;
  transition: background .12s ease, border-color .12s ease, transform .1s ease;
}
.star-btn.active {
  background: var(--yellow-bg);
  border-color: #e8c840;
  color: #8a6e00;
}
.star-btn:active { transform: scale(.93); }
.save-status { min-height: 1.2em; }
.visited-detail { opacity: .92; }

/* ── Dialog ── */
.editor-dialog {
  width: min(720px, calc(100vw - 16px));
  border: 0;
  border-radius: var(--radius-lg);
  padding: 0;
  box-shadow: var(--shadow-lg);
}
.editor-dialog::backdrop { background: rgba(20, 14, 28, .6); backdrop-filter: blur(4px); }
.dialog-shell { margin: 0; }
.dialog-head {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 14px 16px;
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}
.dialog-head h2 { margin: 0; font-size: 1.15rem; font-weight: 900; }
.dialog-body {
  padding: 16px;
  display: grid;
  gap: 14px;
  max-height: min(80vh, 900px);
  overflow: auto;
}
.dialog-actions {
  position: sticky;
  bottom: 0;
  background: #fff;
  border-top: 1px solid var(--line);
  padding: 12px 16px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.form-grid { display: grid; gap: 10px; }
.form-grid.two { grid-template-columns: 1fr 1fr; }
.field label { display: block; font-size: .82rem; color: var(--muted); margin: 0 0 4px; font-weight: 700; }
fieldset {
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin: 0;
}
legend { padding: 0 6px; color: var(--purple); font-weight: 900; }

/* ── Page head ── */
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(255,255,255,.9);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  margin-bottom: 0;
  box-shadow: var(--shadow-sm);
}
.page-head h2 { margin: 0; font-size: 1.15rem; font-weight: 900; line-height: 1.2; }
.page-head p { margin: 3px 0 0; color: var(--muted); font-size: .88rem; }
.page-head-extra {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
}

/* ── Summary days ── */
.summary-days { display: grid; gap: 8px; }
.summary-day {
  display: grid;
  gap: 3px;
  text-align: left;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 11px 13px;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: background .13s ease, border-color .13s ease;
}
.summary-day.active {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(224,48,64,.12);
  background: var(--brand-light);
}
.summary-day.today-date:not(.active) {
  border-color: var(--brand);
  background: var(--brand-light);
}
.summary-day span { color: var(--brand-dark); font-weight: 900; }
.summary-day small { color: var(--muted); overflow-wrap: anywhere; font-size: .82rem; }
.summary-day strong { font-weight: 800; }

/* ── Account / sync ── */
.account-panel { display: grid; gap: 12px; }
.account-panel h3, .account-panel h4 { margin: 0; }
.account-form { display: grid; gap: 8px; }
.account-actions { margin-top: 4px; }
.sync-check { padding-top: 2px; color: var(--muted); }
.admin-panel { border-top: 1px solid var(--line); padding-top: 12px; display: grid; gap: 10px; }
.user-table { display: grid; gap: 8px; }
.user-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 8px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 11px 13px;
  background: #fff;
}
.user-row > div:first-child { min-width: 0; overflow-wrap: anywhere; }
.user-main { min-width: 0; overflow-wrap: anywhere; }
.sync-details {
  display: grid;
  gap: 5px;
  padding: 10px 12px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--muted);
  font-size: .88rem;
}
.sync-details strong { color: var(--text); }

/* ── Visit history ── */
.visit-history { display: grid; gap: 10px; }
.history-row {
  display: grid;
  gap: 8px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 11px 13px;
  background: #fff;
}
.history-row.current-year {
  border-color: rgba(224,48,64,.3);
  background: #fff8f8;
}
.history-note { margin-top: 5px; overflow-wrap: anywhere; }

/* ── Admin / data panels ── */
.admin-year-grid {
  display: grid;
  gap: 10px;
  padding: 10px 12px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}
.backup-path { overflow-wrap: anywhere; }
.user-controls {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) 100px auto minmax(130px, 1fr) auto;
  align-items: center;
  gap: 8px;
}
.check-row.compact { padding: 0; white-space: nowrap; }
.year-controls { display: flex; flex-wrap: wrap; gap: .6rem; align-items: end; margin-top: .75rem; }
.year-controls select, .year-controls input[type="number"] { min-width: 8rem; }
.year-list { display: grid; gap: .5rem; margin-top: .9rem; }
.year-list-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: .7rem;
  align-items: center;
  padding: .65rem .75rem;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}
.admin-year-tools { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.year-panel .chips, .year-panel .year-controls, .admin-year-tools .year-controls { margin-top: .75rem; }
.admin-panel + .admin-panel { margin-top: 4px; }

/* ── Data boundary / import / carry-forward ── */
.data-boundary-panel .boundary-grid,
.data-boundary-panel .audit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.data-boundary-panel .boundary-grid > div,
.data-boundary-panel .audit-grid > div {
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: #fffaf4;
}
.data-boundary-panel .boundary-grid strong,
.data-boundary-panel .audit-grid strong { display: block; margin-bottom: 4px; }
.data-boundary-panel .boundary-grid span,
.data-boundary-panel .audit-grid span { color: var(--muted); }
.data-audit { margin-top: 12px; }
.data-audit summary { cursor: pointer; font-weight: 800; }
.official-editor-panel { background: #fffdf8; }
.admin-official-editor-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.admin-official-editor-controls .grow { flex: 1 1 260px; }
.admin-official-editor-controls select { width: 100%; min-width: 220px; }
.selected-official-summary { overflow-wrap: anywhere; }
.dialog-actions.split-actions { justify-content: flex-end; gap: 8px; }
.dialog-action-spacer { flex: 1 1 auto; }
.dialog-body input[readonly] { background: #f5f0e8; color: var(--muted); }
.official-import-panel { background: #fffdf8; }
.import-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.import-summary-grid > div { border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; background: #fffaf4; }
.import-summary-grid strong, .import-summary-grid span { display: block; }
.import-summary-grid span { color: var(--muted); margin-top: 4px; }
.import-diff { margin-top: 12px; border: 1.5px solid var(--line); border-radius: var(--radius); padding: 10px 12px; background: #fff; }
.import-diff summary { cursor: pointer; font-weight: 800; }
.diff-section { margin-top: 12px; }
.diff-section > strong { display: block; margin-bottom: 6px; }
.pill-list { display: flex; flex-wrap: wrap; gap: 6px; }
.mini-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  background: #f5efe6;
  font-size: .84rem;
}
.muted-pill { color: var(--muted); background: #ede8e0; }
.change-row {
  display: grid;
  grid-template-columns: minmax(150px, .9fr) minmax(180px, 1.4fr);
  gap: 8px;
  border-top: 1px solid var(--line);
  padding: 7px 0;
}
.change-row:first-of-type { border-top: 0; }
.change-row span { color: var(--muted); }
.carry-options {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}
.carry-preview { margin-top: 12px; }
.prior-reminder { background: #fffdf8; }
.prior-visit-note { display: grid; gap: 5px; }
.carry-forward-panel .year-controls { margin-top: .75rem; }

/* ── Title links ── */
.title-link {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 0;
  min-height: 0;
  border-radius: 4px;
  box-shadow: none;
  text-align: left;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.title-link:hover, .title-link:focus-visible {
  color: var(--brand-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
  outline: none;
}
.title-link:focus-visible {
  box-shadow: 0 0 0 3px rgba(224,48,64,.22);
}

/* ── Footer ── */
.footer-note { color: var(--muted); font-size: .82rem; text-align: center; margin-top: 20px; }

/* ── Overflow helpers ── */
.card, .panel, .detail-section, .detail-hero,
.status-card, .schedule-row, .special-detail,
.plain-note, .warning, .location-bar,
.manage-row, .summary-day, .year-list-row, .user-row {
  overflow-wrap: anywhere;
}
.card-actions a.btn { text-decoration: none; }
.panel > h2:first-child, .panel > h3:first-child, .panel > h4:first-child { margin-bottom: 10px; }
.panel p.muted:last-child, .detail-section p.muted:last-child { margin-bottom: 0; }

/* ── Spacing helpers: top-level children ── */
.app-shell > .day-strip,
.app-shell > .hero,
.app-shell > .panel,
.app-shell > .grid,
.app-shell > .toolbar,
.app-shell > .manage-list,
.app-shell > .warning,
.app-shell > .page-head,
.app-shell > .location-bar { margin-bottom: 10px; }

.app-shell > *:last-child { margin-bottom: 0; }
.hero { margin-bottom: 0; }
.warning { margin-top: 0; }

/* ── Transitions ── */
.day-strip button, .summary-day, .nav button, .btn, .pill {
  transition: background-color .13s ease, border-color .13s ease, box-shadow .13s ease, transform .1s ease;
}
.day-strip button:active, .nav button:active, .btn:active, .summary-day:active {
  transform: scale(.97);
}

/* =========================================================
   DESKTOP (760px+)
   ========================================================= */
@media (min-width: 760px) {
  .app-shell { padding: 20px 20px 50px; }
  .topbar { margin: 0 0 16px; border-radius: 0; }
  .nav { grid-template-columns: repeat(6, 1fr); }
  .grid.two { grid-template-columns: 1fr 1fr; }
  .toolbar { grid-template-columns: 2fr 1fr 1fr auto auto; align-items: center; }
  .manage-row {
    grid-template-columns: minmax(260px, 1fr) minmax(62px, auto) minmax(62px, auto) minmax(76px, auto) minmax(104px, auto) minmax(130px, auto);
    column-gap: 14px;
  }
  .day-strip { grid-template-columns: repeat(6, 1fr); }
  .setting-row { grid-template-columns: 220px 1fr; align-items: center; }
  .availability-row { grid-template-columns: 1fr 120px 120px; align-items: center; }
  .summary-days { grid-template-columns: repeat(3, 1fr); }
  .history-row { grid-template-columns: minmax(150px, .8fr) 1.4fr; align-items: start; }
  .admin-year-grid { grid-template-columns: 1fr 1fr 1fr; }
  .user-row { grid-template-columns: minmax(180px, .9fr) minmax(420px, 1.6fr); }
  .sync-details { grid-template-columns: 1fr 1fr; }
  .account-form { grid-template-columns: minmax(180px, 1fr) minmax(160px, 1fr) auto auto auto; align-items: center; }
  .account-form.admin-create { grid-template-columns: minmax(180px, 1fr) minmax(150px, 1fr) minmax(150px, 1fr) 110px auto auto; }
  .carry-options { grid-template-columns: 1fr 1fr; }
  .year-list-row { grid-template-columns: auto 1fr auto; }
  .change-row { grid-template-columns: minmax(150px, .9fr) minmax(180px, 1.4fr); }
}

/* =========================================================
   MOBILE ENHANCEMENTS (≤640px) — primary usage context
   ========================================================= */
@media (max-width: 640px) {
  .app-shell { padding-left: 10px; padding-right: 10px; padding-bottom: 90px; }
  .topbar { margin-left: -10px; margin-right: -10px; }
  .nav { padding: 5px 8px 7px; gap: 3px; }
  .nav button { font-size: .73rem; padding: 7px 3px; min-height: 38px; }

  .page-head { align-items: flex-start; flex-direction: column; }
  .page-head-extra, .page-head-extra .chips { justify-content: flex-start; }

  /* Full-width action buttons on mobile */
  .card-actions, .detail-actions, .account-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .card-actions .btn, .detail-actions .btn, .account-actions .btn { width: 100%; }
  .card-actions .btn.full, .detail-actions .btn.full { grid-column: 1 / -1; }

  .plan-row { grid-template-columns: 58px 1fr; gap: 8px; }
  .plan-time { font-size: .86rem; }

  .schedule-row { display: grid; grid-template-columns: 1fr; gap: 3px; }
  .session-row, .event-row, .note-row { grid-template-columns: 1fr; }
  .user-row { grid-template-columns: 1fr; align-items: start; }
  .user-controls { grid-template-columns: 1fr; width: 100%; }
  .admin-official-editor-controls { display: grid; grid-template-columns: 1fr; }
  .admin-official-editor-controls .btn,
  .dialog-actions.split-actions .btn { width: 100%; }
  .dialog-actions.split-actions { align-items: stretch; }
  .dialog-action-spacer { display: none; }

  .location-bar { align-items: stretch; flex-direction: column; }
  .location-actions { justify-content: stretch; }
  .location-actions .btn { flex: 1 1 auto; }

  /* Larger tap targets on mobile */
  .btn { min-height: 44px; }
  .star-btn { min-width: 46px; min-height: 44px; }
  .day-strip button { min-height: 58px; }
}

@media (max-width: 390px) {
  .nav { grid-template-columns: repeat(3, 1fr); }
  .day-strip { grid-template-columns: repeat(2, 1fr); }
  .card-actions, .detail-actions, .account-actions { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .change-row { grid-template-columns: 1fr; }
}

/* =========================================================
   v31 compact mobile polish
   Keeps the v29 visual style, but removes intermediate snap states.
   ========================================================= */

.nav {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 4px;
  padding: 5px 8px 7px;
}
.nav button {
  min-width: 0;
  min-height: 34px;
  padding: 6px 3px;
  font-size: clamp(.68rem, 1.8vw, .8rem);
  line-height: 1.1;
}

.day-strip {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 4px;
  margin-bottom: 10px;
}
.day-strip button {
  min-width: 0;
  min-height: 44px;
  padding: 7px 2px;
  border-radius: 12px;
}
.day-strip button strong { font-size: clamp(.68rem, 2.2vw, .86rem); }
.day-strip button small { font-size: clamp(.58rem, 1.8vw, .72rem); white-space: nowrap; }

.location-bar {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
}
.location-status {
  display: flex;
  align-items: baseline;
  gap: 7px;
  min-width: 0;
}
.location-status strong { white-space: nowrap; }
.location-bar .muted {
  font-size: .82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  overflow-wrap: normal;
}
.location-actions {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 5px;
}
.location-actions .btn {
  min-height: 32px;
  padding: 5px 9px;
  width: auto;
}

.today-stack { display: grid; gap: 10px; }
.panel, .card { padding: 13px; }
.card { gap: 8px; }
.card h3 { font-size: 1rem; }
.address { font-size: .84rem; }
.chips { gap: 4px; margin-top: 4px; }
.chip { padding: 3px 7px; font-size: .76rem; }
.event-summary { padding: 7px 9px; font-size: .84rem; }
.availability-dots { gap: 3px; }
.availability-dot { width: 10px; height: 10px; }
.score { min-width: 38px; padding: 8px 6px; font-size: .88rem; }

.card-actions, .detail-actions, .account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}
.card-actions .btn,
.detail-actions .btn,
.account-actions .btn {
  width: auto;
  flex: 1 1 calc(50% - 5px);
  min-width: max-content;
  min-height: 34px;
  padding: 5px 9px;
  font-size: .82rem;
}
.card-actions .btn.full,
.detail-actions .btn.full { flex-basis: 100%; }

@media (min-width: 760px) {
  .topbar { margin: 0 0 14px; }
  .today-stack { gap: 12px; }
  .card-actions .btn,
  .detail-actions .btn,
  .account-actions .btn {
    flex: 0 0 auto;
  }
}

@media (max-width: 640px) {
  .app-shell { padding-left: 10px; padding-right: 10px; }
  .topbar { margin-left: -10px; margin-right: -10px; }
  .topbar.compact-nav { padding-top: env(safe-area-inset-top, 0px); }
  .nav { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .nav button { min-height: 32px; padding: 5px 2px; }
  .day-strip { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .day-strip button { min-height: 42px; padding: 6px 1px; }
  .panel { border-radius: 16px; }
  .card { border-radius: 15px; padding: 11px; gap: 7px; }
  .panel h2 { font-size: 1rem; margin-bottom: 8px; }
  .location-bar { flex-direction: row; align-items: center; }
  .location-actions { justify-content: flex-end; }
  .location-actions .btn { flex: 0 0 auto; }
  .card-actions, .detail-actions, .account-actions {
    display: flex;
    grid-template-columns: none;
  }
  .card-actions .btn,
  .detail-actions .btn,
  .account-actions .btn {
    width: auto;
    flex: 1 1 calc(50% - 5px);
  }
  .btn { min-height: 34px; }
  .star-btn { min-width: 40px; min-height: 38px; }
}

@media (max-width: 390px) {
  .nav { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .day-strip { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .card-actions, .detail-actions, .account-actions {
    display: flex;
    grid-template-columns: none;
  }
}
.availability-dots {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: -1px;
}
.availability-dot {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 999px;
  border: 1.5px solid #222;
  background: transparent;
}
.availability-dot.open {
  background: var(--green);
  border-color: var(--green);
}
.availability-dot.selected {
  box-shadow: 0 0 0 3px rgba(224,48,64,.16);
}
.availability-dot.today:not(.selected) {
  box-shadow: 0 0 0 2px rgba(46,148,80,.18);
}

/* v32: keep village-card action buttons compact on mobile and desktop. */
.card-actions .btn {
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
  min-height: 32px;
  padding: 5px 9px;
}

@media (max-width: 640px) {
  .card-actions {
    gap: 5px;
  }
  .card-actions .btn {
    flex: 0 0 auto;
    width: auto;
    min-height: 32px;
    padding: 5px 9px;
    font-size: .8rem;
  }
}

/* =========================================================
   v33 festival palette polish
   Inspired by the official Carrousel red, soft poster pinks,
   clean white cards, and green availability dots.
   ========================================================= */

:root {
  --bg:          #fff6f8;
  --panel:       #ffffff;
  --panel-soft:  #fff4f6;
  --text:        #141114;
  --text-mid:    #3f373b;
  --muted:       #74686d;
  --line:        #f0dce2;
  --brand:       #ed1c2e;
  --brand-dark:  #b80d1c;
  --brand-light: #fff0f3;
  --green:       #2f963f;
  --green-bg:    #eaf8ed;
  --yellow:      #f1b51c;
  --yellow-bg:   #fff7dc;
  --purple:      #d92f78;
  --purple-bg:   #fff0f7;
  --blue:        #1777b7;
  --blue-bg:     #edf7ff;
  --shadow-sm:   0 4px 14px rgba(72, 18, 28, .055);
  --shadow:      0 10px 28px rgba(72, 18, 28, .09);
  --shadow-lg:   0 22px 60px rgba(72, 18, 28, .18);
}

html {
  background: #fff6f8;
}

body {
  background:
    radial-gradient(circle at 17% -8%, rgba(237, 28, 46, .16), transparent 33rem),
    radial-gradient(circle at 88% 4%, rgba(217, 47, 120, .13), transparent 27rem),
    linear-gradient(180deg, #ffe5ec 0%, #fff9fa 23rem, #fff 72%);
  color: var(--text);
}

body::before {
  content: '';
  position: fixed;
  inset: 0 0 auto 0;
  height: 170px;
  pointer-events: none;
  background:
    linear-gradient(115deg, transparent 0 58%, rgba(255,255,255,.35) 58% 60%, transparent 60%),
    radial-gradient(circle at 72% 42%, rgba(255,255,255,.65) 0 2px, transparent 3px),
    radial-gradient(circle at 79% 35%, rgba(255,255,255,.55) 0 2px, transparent 3px),
    radial-gradient(circle at 86% 30%, rgba(255,255,255,.45) 0 2px, transparent 3px);
  opacity: .7;
  z-index: -1;
}

.topbar {
  background: rgba(255, 244, 247, .92);
  border-bottom-color: rgba(237, 28, 46, .13);
}

.topbar.compact-nav {
  box-shadow: 0 1px 0 rgba(237, 28, 46, .10), 0 10px 28px rgba(72, 18, 28, .08);
}

.nav {
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(237, 28, 46, .11);
  border-radius: 999px;
  margin: 6px 10px 8px;
  padding: 4px;
  box-shadow: 0 6px 22px rgba(72, 18, 28, .06);
}

.nav button {
  border-radius: 999px;
  color: #61565b;
  letter-spacing: .005em;
}

.nav button.active {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 5px 15px rgba(237, 28, 46, .26);
}

.nav button::after { display: none; }
.nav button:not(.active):hover { background: var(--brand-light); color: var(--brand-dark); }

.day-strip {
  background: rgba(255,255,255,.83);
  border: 1.5px solid rgba(237, 28, 46, .12);
  border-radius: 20px;
  padding: 5px;
  box-shadow: var(--shadow-sm);
}

.day-strip button {
  border: 0;
  background: transparent;
  border-radius: 15px;
  box-shadow: none;
  color: #171315;
}

.day-strip button + button { box-shadow: inset 1px 0 0 rgba(64, 37, 45, .12); }
.day-strip button.active + button,
.day-strip button.active { box-shadow: none; }

.day-strip button.active {
  background: linear-gradient(180deg, #f52638 0%, var(--brand) 100%);
  color: #fff;
  box-shadow: 0 8px 18px rgba(237, 28, 46, .26);
}

.day-strip button.today-date:not(.active) {
  border: 0;
  background: var(--brand-light);
  color: var(--brand-dark);
  box-shadow: inset 0 0 0 1.5px rgba(237, 28, 46, .28);
}

.location-bar.panel {
  background: rgba(255,255,255,.78);
  border-color: rgba(237, 28, 46, .12);
  box-shadow: var(--shadow-sm);
}

.location-status strong::before {
  content: '⌖';
  color: var(--brand);
  margin-right: 6px;
  font-weight: 900;
}

.panel, .card, .detail-hero, .detail-section, .page-head,
.settings-details, .admin-details, .password-panel {
  border-color: rgba(237, 28, 46, .10);
  background: rgba(255,255,255,.94);
  box-shadow: var(--shadow-sm);
}

.panel {
  box-shadow: 0 7px 22px rgba(72, 18, 28, .055);
}

.panel h2,
.detail-section h3,
.page-head h2 {
  color: #121012;
  letter-spacing: .01em;
}

.today-stack > .panel h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: #d92f78;
  text-transform: uppercase;
  letter-spacing: .055em;
  font-size: .95rem;
}

.today-stack > .panel:first-child h2::before {
  content: '★';
  color: #d92f78;
  font-size: 1.05rem;
}

.today-stack > .panel:nth-child(2) h2::before {
  content: '●';
  color: #d92f78;
  font-size: .9rem;
}

.card {
  border-color: rgba(237, 28, 46, .09);
  box-shadow: 0 7px 22px rgba(72, 18, 28, .075);
}

.card:hover {
  border-color: rgba(237, 28, 46, .18);
}

.card.visited {
  opacity: .78;
  background: linear-gradient(180deg, #fff 0%, #f7fbf7 100%);
  border-color: rgba(47, 150, 63, .24);
}

.card.visited h3 { text-decoration-color: rgba(47, 150, 63, .65); }

.title-link {
  color: #0f0d0f;
  font-weight: 900;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
}

.title-link:hover, .title-link:focus-visible {
  color: var(--brand-dark);
}

.chip {
  background: #fff2f4;
  color: #3d3438;
  border-color: rgba(237, 28, 46, .08);
}

.chip.green  { background: var(--green-bg);  color: #1e6630; border-color: #bee5c5; }
.chip.red    { background: var(--brand-light); color: var(--brand-dark); border-color: #ffc4cc; }
.chip.gold   { background: var(--yellow-bg); color: #735400; border-color: #f3dfa2; }
.chip.purple { background: var(--purple-bg); color: #b11f61; border-color: #ffd0e5; }

.score {
  background: var(--brand-light);
  color: var(--brand-dark);
  border-color: rgba(237, 28, 46, .22);
}

.btn, .pill {
  border-color: rgba(68, 41, 48, .15);
  background: #fff;
  box-shadow: 0 3px 12px rgba(72,18,28,.045);
}

.pill.active, .btn.primary {
  background: linear-gradient(180deg, #f52b3d 0%, var(--brand) 100%);
  border-color: var(--brand);
  box-shadow: 0 7px 18px rgba(237, 28, 46, .26);
}

.btn.soft {
  background: #fff7f8;
  border-color: rgba(237, 28, 46, .13);
}

.btn.danger {
  background: var(--brand-light);
  border-color: #ffc4cc;
  color: var(--brand-dark);
}

.availability-dot {
  border-color: #191719;
  background: #fff;
}

.availability-dot.open {
  background: var(--green);
  border-color: var(--green);
  box-shadow: inset 0 -1px 0 rgba(0,0,0,.12);
}

.availability-dot.selected {
  box-shadow: 0 0 0 3px rgba(237, 28, 46, .17);
}

.event-summary, .visit-note-preview {
  background: #f2f9ff;
  border-left-color: #75b8e8;
}

.note-highlight, .warning {
  background: #fff9df;
  border-color: #f3dfa2;
}

.detail-hero {
  background:
    radial-gradient(circle at 100% 0%, rgba(237,28,46,.08), transparent 35%),
    linear-gradient(135deg, #fff 0%, #fff5f7 100%);
}

.footer-note { color: #8a777e; }

@media (max-width: 640px) {
  body {
    background:
      radial-gradient(circle at 18% -6%, rgba(237, 28, 46, .14), transparent 18rem),
      radial-gradient(circle at 98% 3%, rgba(217, 47, 120, .12), transparent 17rem),
      linear-gradient(180deg, #ffe8ee 0%, #fff9fa 18rem, #fff 70%);
  }
  .nav {
    margin: 5px 8px 7px;
    padding: 3px;
  }
  .nav button.active {
    box-shadow: 0 4px 12px rgba(237, 28, 46, .22);
  }
  .day-strip {
    border-radius: 16px;
    padding: 4px;
  }
  .day-strip button {
    border-radius: 12px;
  }
  .today-stack > .panel h2 {
    font-size: .86rem;
    letter-spacing: .045em;
  }
  .card {
    box-shadow: 0 5px 16px rgba(72,18,28,.065);
  }
}


/* =========================================================
   v34 compact card/date/manage polish
   ========================================================= */

/* Top navigation: remove the extra offset pill/background and keep the buttons themselves clean. */
.nav {
  background: transparent;
  border: 0;
  box-shadow: none;
  border-radius: 0;
  margin: 6px 4px 8px;
  padding: 0;
  gap: 5px;
}
.nav button {
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(237, 28, 46, .12);
  box-shadow: 0 2px 8px rgba(72,18,28,.045);
}
.nav button.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: 0 5px 14px rgba(237, 28, 46, .24);
}
.nav button:not(.active):hover {
  background: #fff;
  border-color: rgba(237, 28, 46, .24);
  color: var(--brand-dark);
}

/* Date selector: use six separate rounded tiles instead of fake divider edges. */
.day-strip {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  gap: 6px;
}
.day-strip button,
.day-strip button + button {
  border: 1.5px solid rgba(237, 28, 46, .12);
  background: rgba(255,255,255,.86);
  border-radius: 14px;
  box-shadow: 0 3px 12px rgba(72,18,28,.055);
}
.day-strip button.active {
  border-color: var(--brand);
  background: linear-gradient(180deg, #f52638 0%, var(--brand) 100%);
  color: #fff;
  box-shadow: 0 7px 16px rgba(237, 28, 46, .24);
}
.day-strip button.today-date:not(.active) {
  border-color: rgba(237, 28, 46, .28);
  background: #fff3f5;
  color: var(--brand-dark);
  box-shadow: 0 3px 12px rgba(72,18,28,.055), inset 0 0 0 1px rgba(237, 28, 46, .08);
}

/* Manage rows: prevent checkbox labels from being squeezed into two-line text
   and avoid the awkward mostly-empty right side at intermediate widths. */
.manage-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
}
.manage-main {
  flex: 1 1 260px;
  min-width: min(100%, 220px);
}
.manage-row .check-row,
.manage-row .compact-field,
.manage-row .btn {
  flex: 0 0 auto;
}
.manage-row .check-row,
.compact-field {
  white-space: nowrap;
}
.manage-row .btn {
  justify-self: auto;
}

@media (max-width: 760px) {
  .manage-row {
    gap: 7px 9px;
  }
  .manage-main {
    flex-basis: 100%;
  }
}

@media (max-width: 640px) {
  .nav { margin: 5px 4px 7px; gap: 4px; }
  .nav button {
    min-height: 32px;
    padding: 5px 2px;
    font-size: clamp(.62rem, 2.7vw, .74rem);
  }
  .day-strip { gap: 4px; }
  .day-strip button {
    min-height: 40px;
    padding: 5px 1px;
  }
  .day-strip button strong { font-size: clamp(.62rem, 2.6vw, .78rem); }
  .day-strip button small { font-size: clamp(.54rem, 2.2vw, .66rem); }
}
