/* Warm cream calendar theme: visual skin for the dashboard calendar only, no layout changes. */
.dash-calendar-card{
  --cal-surface:#fbf7f0;--cal-surface-2:#f6efe4;--cal-tile:#f8f3eb;--cal-tile-hover:#f3ebdf;
  --cal-ink:#3b3127;--cal-muted:#8f8272;--cal-faded:#cdbfae;--cal-line:#ece2d4;
  --cal-accent:#93622f;--cal-accent-strong:#7a4e22;--cal-accent-soft:#f3e5d0;--cal-gold:#cfa266;
  --cal-red:#b4433f;--cal-red-soft:#f8e8e3;--cal-green:#2f855a;--cal-green-track:#dfe9df;--cal-habit:#8a63a8;--cal-habit-track:#ebe2ee;
  --cal-raise:4px 5px 11px #e4d9c9,-4px -4px 10px #fffdf9;--cal-raise-hover:6px 8px 16px #ddd0bd,-4px -4px 11px #fffdf9;
  --cal-press:inset 3px 3px 7px #e6dccd,inset -3px -3px 7px #fffdf9;
  --cal-number-glass:linear-gradient(145deg,rgba(255,255,255,.84),rgba(255,255,255,.32));--cal-number-line:rgba(160,125,80,.2);
  --cal-number-shadow:inset 0 1px 0 rgba(255,255,255,.95),0 2px 5px rgba(120,90,55,.09);
  background:linear-gradient(160deg,var(--cal-surface) 0%,#faf5ed 55%,var(--cal-surface-2) 100%);
  border:1px solid #f0e7da;box-shadow:0 14px 34px rgba(150,118,80,.1),var(--shadow-soft);color:var(--cal-ink)
}
html[data-theme=dark] .dash-calendar-card.dash-calendar-card{
  --cal-surface:#221e19;--cal-surface-2:#1d1a16;--cal-tile:#2a251f;--cal-tile-hover:#322c25;
  --cal-ink:#f2e9dc;--cal-muted:#b3a593;--cal-faded:#6c6256;--cal-line:#3a332b;
  --cal-accent:#e2b57a;--cal-accent-strong:#f0c890;--cal-accent-soft:#3b3023;--cal-gold:#c99a5c;
  --cal-red:#f19b92;--cal-red-soft:#3a2522;--cal-green:#7fcfa4;--cal-green-track:#28382e;--cal-habit:#c4a5e6;--cal-habit-track:#352d3f;
  --cal-raise:0 4px 12px rgba(0,0,0,.28),inset 0 1px 0 rgba(255,240,220,.04);--cal-raise-hover:0 8px 18px rgba(0,0,0,.36),inset 0 1px 0 rgba(255,240,220,.06);
  --cal-press:inset 0 2px 6px rgba(0,0,0,.35),inset 0 0 0 1px rgba(226,181,122,.12);
  --cal-number-glass:linear-gradient(145deg,rgba(255,255,255,.12),rgba(255,255,255,.035));--cal-number-line:rgba(255,235,210,.16);
  --cal-number-shadow:inset 0 1px 0 rgba(255,255,255,.08),0 2px 5px rgba(0,0,0,.18);
  background:linear-gradient(160deg,#25201a 0%,#201c17 60%,#1c1915 100%);border-color:#3a322a;box-shadow:0 10px 28px rgba(0,0,0,.28)
}

/* Heading */
.dash-calendar-card .dash-calendar-head h2{display:flex;align-items:center;gap:9px;color:var(--cal-accent)}
.dash-calendar-card .dash-calendar-head h2::before{content:"";width:20px;height:20px;flex:0 0 auto;background:currentColor;
  -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3.5' y='5' width='17' height='15.5' rx='3'/%3E%3Cpath d='M3.5 10h17M8 3v4M16 3v4M8 14h.01M12 14h.01M16 14h.01M8 17h.01M12 17h.01'/%3E%3C/svg%3E") center/contain no-repeat;
  mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3.5' y='5' width='17' height='15.5' rx='3'/%3E%3Cpath d='M3.5 10h17M8 3v4M16 3v4M8 14h.01M12 14h.01M16 14h.01M8 17h.01M12 17h.01'/%3E%3C/svg%3E") center/contain no-repeat}

/* Controls */
.dash-calendar-card .calendar-controls button,
.dash-calendar-card .calendar-controls .today-button{border:1px solid var(--cal-line);background:var(--cal-tile);color:var(--cal-accent);box-shadow:var(--cal-raise);font-weight:800}
.dash-calendar-card .calendar-controls button:hover,
.dash-calendar-card .calendar-controls .today-button:hover{background:var(--cal-tile-hover);box-shadow:var(--cal-raise-hover)}
/* One height for every control, so the row reads as a single toolbar */
.dash-calendar-card .calendar-controls{align-items:center;gap:8px}
.dash-calendar-card .calendar-controls>*{flex:0 0 auto}
.dash-calendar-card .calendar-controls .day-nav-button,
.dash-calendar-card .calendar-controls .today-button,
.dash-calendar-card .calendar-controls .calendar-select-wrap,
.dash-calendar-card .calendar-controls .view-select{height:38px;min-height:38px;margin:0;border-radius:12px;transform:none}
.dash-calendar-card .calendar-day-nav{display:inline-flex;align-items:center;gap:6px}
.dash-calendar-card .calendar-controls .today-button{min-width:64px;padding-inline:14px;font-size:11px}
.dash-calendar-card .calendar-controls .day-nav-button{width:38px;min-width:38px;padding:0;display:inline-flex;align-items:center;justify-content:center;font-size:0;line-height:0}
/* Chevrons drawn in CSS instead of the font's ‹ › glyphs; RTL: previous points right, next points left */
.dash-calendar-card .calendar-controls .day-nav-button::before{content:"";width:14px;height:14px;background:currentColor;
  -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 5l7 7-7 7'/%3E%3C/svg%3E") center/contain no-repeat;
  mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 5l7 7-7 7'/%3E%3C/svg%3E") center/contain no-repeat}
.dash-calendar-card .calendar-controls #nextDay::before{transform:scaleX(-1)}
.dash-calendar-card .calendar-controls .calendar-select-wrap{display:inline-flex;align-items:center;gap:6px;padding:0 12px 0 6px;border:1px solid var(--cal-line);background:var(--cal-tile);color:var(--cal-muted);box-shadow:var(--cal-press);font-size:10px}
.dash-calendar-card .calendar-controls .calendar-select-wrap .calendar-select-button{height:28px;min-height:28px;min-width:0;margin:0;padding:0 9px;gap:8px;border:0;border-radius:8px;background:transparent;box-shadow:none;color:var(--cal-accent);font-size:12px;font-weight:800;transform:none}
.dash-calendar-card .calendar-controls .calendar-select-wrap .calendar-select-button:hover,
.dash-calendar-card .calendar-controls .calendar-select-wrap .calendar-select-button[aria-expanded=true]{color:var(--cal-accent-strong);background:var(--cal-accent-soft);box-shadow:none;transform:none}
/* Dropdown arrow as a real chevron instead of the ⌄ glyph */
.dash-calendar-card .calendar-select-button i{width:10px;height:10px;flex:0 0 auto;font-size:0;background:var(--cal-accent);
  -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") center/contain no-repeat;
  mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") center/contain no-repeat}
.dash-calendar-card .calendar-controls .view-select{min-width:0;padding-inline:14px;gap:8px;font-size:11px}
.dash-calendar-card .calendar-select-menu{border-color:var(--cal-line);background:var(--cal-surface);box-shadow:0 14px 30px rgba(120,90,55,.18)}
.dash-calendar-card .calendar-select-menu .calendar-option{color:var(--cal-ink)}
.dash-calendar-card .calendar-select-menu .calendar-option:hover,
.dash-calendar-card .calendar-select-menu .calendar-option:focus-visible{background:var(--cal-accent-soft);color:var(--cal-accent-strong)}
.dash-calendar-card .calendar-select-menu .calendar-option.is-selected,
.dash-calendar-card .calendar-select-menu .calendar-option[aria-selected=true]{background:var(--cal-accent-soft);color:var(--cal-accent-strong);box-shadow:var(--cal-press)}
.dash-calendar-card .calendar-controls .view-select{border:1px solid color-mix(in srgb,var(--cal-accent) 22%,transparent);background:var(--cal-accent-soft);color:var(--cal-accent-strong);box-shadow:var(--cal-raise)}
.dash-calendar-card .calendar-controls .view-select:hover{background:color-mix(in srgb,var(--cal-accent-soft) 80%,var(--cal-gold))}

/* Weekday headers */
.dash-calendar-card .calendar-day-name{color:var(--cal-muted);font-size:11px;font-weight:700}
.dash-calendar-card .calendar-grid .calendar-day-name:nth-child(7n){color:var(--cal-red)}

/* Day tiles */
.dash-calendar-card .calendar-grid .calendar-day{margin:4px;border:1px solid transparent;border-radius:15px;background:var(--cal-tile);color:var(--cal-ink);box-shadow:var(--cal-raise)}
.dash-calendar-card .calendar-grid .calendar-day:not(.week-day){min-height:88px;display:flex;flex-direction:column;align-items:center;justify-content:flex-start;padding-top:9px;font-size:13px}
.dash-calendar-card .calendar-grid .calendar-day:hover{background:var(--cal-tile-hover);box-shadow:var(--cal-raise-hover)}
.dash-calendar-card .calendar-grid .calendar-day .day-number{position:relative;display:inline-grid;place-items:center;flex:0 0 auto;min-width:32px;height:28px;padding:0 7px;border:1px solid var(--cal-number-line);border-radius:9px;background:var(--cal-number-glass);box-shadow:var(--cal-number-shadow);-webkit-backdrop-filter:blur(5px);backdrop-filter:blur(5px);color:inherit;font-weight:800;line-height:1}
.dash-calendar-card .calendar-grid .calendar-day .week-day-name{color:var(--cal-muted)}
.dash-calendar-card .calendar-grid .calendar-day.outside{background:transparent;color:var(--cal-faded);box-shadow:none}
.dash-calendar-card .calendar-grid .calendar-day.outside:hover{background:var(--cal-tile);box-shadow:var(--cal-raise)}

/* Fridays and official holidays: same cream tile, red ink */
.dash-calendar-card .calendar-grid .calendar-day.official-holiday{background:linear-gradient(180deg,var(--cal-tile),var(--cal-red-soft));color:var(--cal-red)}
.dash-calendar-card .calendar-grid .calendar-day.official-holiday .week-day-name,
.dash-calendar-card .calendar-grid .calendar-day.official-holiday .day-number{color:var(--cal-red)}
.dash-calendar-card .calendar-grid .calendar-day.official-holiday.outside{background:transparent;color:color-mix(in srgb,var(--cal-red) 45%,transparent);box-shadow:none}

/* Selected day: pressed golden tile */
.dash-calendar-card .calendar-grid .calendar-day.selected,
.dash-calendar-card .calendar-grid .calendar-day.official-holiday.selected,
.dash-calendar-card .calendar-grid .calendar-day.today.selected{background:linear-gradient(160deg,#f7ead6,#f1ddc0);border-color:var(--cal-gold);color:var(--cal-accent-strong);box-shadow:inset 2px 2px 6px #e3cba6,inset -2px -2px 6px #fff8ec,0 6px 14px rgba(170,125,70,.18)}
.dash-calendar-card .calendar-grid .calendar-day.selected .day-number,
.dash-calendar-card .calendar-grid .calendar-day.selected .week-day-name{color:var(--cal-accent-strong)}
.dash-calendar-card .calendar-grid .calendar-day.official-holiday.selected .day-number,
.dash-calendar-card .calendar-grid .calendar-day.official-holiday.selected .week-day-name{color:var(--cal-red)}
html[data-theme=dark] .dash-calendar-card .calendar-grid .calendar-day.selected,
html[data-theme=dark] .dash-calendar-card .calendar-grid .calendar-day.official-holiday.selected,
html[data-theme=dark] .dash-calendar-card .calendar-grid .calendar-day.today.selected{background:linear-gradient(160deg,#3d3123,#33291d);border-color:var(--cal-gold);color:var(--cal-accent-strong);box-shadow:inset 0 2px 6px rgba(0,0,0,.3),0 6px 16px rgba(0,0,0,.3)}

/* Today keeps a stronger frame within the shared glass number badge. */
.dash-calendar-card .calendar-grid .calendar-day.today .day-number{border:1.5px solid var(--cal-gold);color:var(--cal-accent-strong)}
/* Keep the number clear of the activity dots at the bottom of each tile. */
.dash-calendar-card .calendar-grid .calendar-day.week-day{min-height:112px;gap:8px;padding-top:10px}
.dash-calendar-card .calendar-grid .calendar-day.week-day .day-markers{bottom:10px}
.dash-calendar-card .calendar-grid .calendar-day.today:not(.selected){border-color:color-mix(in srgb,var(--cal-gold) 55%,transparent);outline:0}

/* Completed habits on the upper row; completed tasks on the lower row. */
.dash-calendar-card .calendar-grid .calendar-day .calendar-activity-markers{position:absolute;bottom:7px;left:50%;transform:translateX(-50%);display:flex;flex-direction:column;align-items:center;width:calc(100% - 12px);max-width:78px;gap:4px}
.dash-calendar-card .calendar-activity-row{display:flex;align-items:center;justify-content:center;width:100%;height:4px;gap:3px;line-height:0}
.dash-calendar-card .calendar-activity-row.is-habit{color:var(--cal-habit)}
.dash-calendar-card .calendar-activity-row.is-task{color:var(--cal-green)}
.dash-calendar-card .calendar-activity-row .calendar-activity-dot{display:block;flex:0 0 4px;width:4px;height:4px;border-radius:50%;background:currentColor}
.dash-calendar-card .calendar-activity-more{display:block;flex:0 0 6px;width:6px;height:4px;font-size:8px;font-weight:800;line-height:4px}
.dash-calendar-card .calendar-section-icons{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:4px;width:100%;margin-top:4px}
.dash-calendar-card .calendar-section-indicator{display:grid;place-items:center;min-width:0;height:14px;color:var(--cal-red);opacity:.8}
.dash-calendar-card .calendar-section-indicator.is-positive{color:var(--cal-green);opacity:1}
.dash-calendar-card .calendar-section-indicator svg{display:block;width:100%;height:100%;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}

/* Legend and holiday note */
.dash-calendar-card .calendar-legend{padding-top:10px;border-top:1px solid var(--cal-line);color:var(--cal-muted)}
.dash-calendar-card .calendar-legend .task-line{background:var(--cal-green)}
.dash-calendar-card .calendar-legend .habit-line{background:var(--cal-habit)}
.dash-calendar-card .calendar-legend .official-holiday-dot{background:var(--cal-red)}
.dash-calendar-card .calendar-section-guide{margin-inline-start:auto;gap:4px}
.dash-calendar-card .calendar-section-guide .is-recorded{color:var(--cal-green)}
.dash-calendar-card .calendar-section-guide .is-missing{color:var(--cal-red)}
.dash-calendar-card .calendar-holiday-note{border-color:color-mix(in srgb,var(--cal-red) 18%,transparent);background:var(--cal-red-soft);color:var(--cal-red)}
.dash-calendar-card .holiday-note-heading{color:var(--cal-red)}
.dash-calendar-card .holiday-note-item{background:color-mix(in srgb,var(--cal-tile) 80%,transparent);color:var(--cal-ink)}
.dash-calendar-card .holiday-note-item.is-selected{background:var(--cal-tile);color:var(--cal-red);box-shadow:var(--cal-raise)}

@media(max-width:1000px){
  .dash-calendar-card .calendar-grid .calendar-day:not(.week-day){min-height:104px}
  .dash-calendar-card .calendar-grid .calendar-day.week-day{min-height:126px}
  .dash-calendar-card .calendar-section-icons{grid-template-columns:repeat(6,minmax(0,1fr));max-width:42px;gap:3px}
  .dash-calendar-card .calendar-section-indicator{grid-column:span 2;height:12px}
  .dash-calendar-card .calendar-section-indicator:nth-child(4){grid-column:2/span 2}
  .dash-calendar-card .calendar-section-indicator:nth-child(5){grid-column:4/span 2}
}
@media(max-width:680px){
  .dash-calendar-card .calendar-grid .calendar-day{margin:2px;border-radius:12px}
  .dash-calendar-card .calendar-grid .calendar-day:not(.week-day){min-height:96px;padding-top:6px;font-size:11px}
  .dash-calendar-card .calendar-day-name{font-size:9px}
  .dash-calendar-card .calendar-controls{gap:6px}
  .dash-calendar-card .calendar-controls .day-nav-button,
  .dash-calendar-card .calendar-controls .today-button,
  .dash-calendar-card .calendar-controls .calendar-select-wrap,
  .dash-calendar-card .calendar-controls .view-select{height:34px;min-height:34px}
  .dash-calendar-card .calendar-controls .day-nav-button{width:34px;min-width:34px}
  .dash-calendar-card .calendar-controls .calendar-select-wrap{padding:0 8px 0 4px}
  .dash-calendar-card .calendar-controls .calendar-select-wrap .calendar-select-button{padding-inline:6px;font-size:11px}
  .dash-calendar-card .calendar-controls .view-select{flex:1 1 auto}
  .dash-calendar-card .calendar-grid .calendar-day .day-number{min-width:26px;height:24px;padding:0 4px;border-radius:8px}
  .dash-calendar-card .calendar-grid .calendar-day.week-day{min-height:116px;gap:6px;padding-top:8px}
  .dash-calendar-card .calendar-grid .calendar-day.week-day .day-markers{bottom:8px}
  .dash-calendar-card .calendar-grid .calendar-day .calendar-activity-markers{bottom:6px;width:calc(100% - 6px);gap:4px}
  .dash-calendar-card .calendar-activity-row{height:3px;gap:1.5px}
  .dash-calendar-card .calendar-activity-row .calendar-activity-dot{flex-basis:3px;width:3px;height:3px}
  .dash-calendar-card .calendar-activity-more{flex-basis:4px;width:4px;height:3px;font-size:7px;line-height:3px}
  .dash-calendar-card .calendar-section-icons{max-width:36px;gap:2px}
  .dash-calendar-card .calendar-section-indicator{height:10px}
  .dash-calendar-card .calendar-section-guide{margin-inline-start:0}
}

/* Full calendar page (#calendar): the dashboard calendar in month view, then the selected day. */
.dashboard-main.calendar-mode>:not(#calendarPageHeading,.dash-calendar-card,.daily-grid,#calendarDayDeadlines){display:none}
.dashboard-main.calendar-mode #calendarViewToggle{display:none}
.dashboard-main.calendar-mode .calendar-day{min-height:76px}
.calendar-day-deadlines{margin-top:17px;padding:18px 21px 14px;border-radius:20px;background:var(--card);box-shadow:var(--shadow-soft)}
.calendar-day-deadlines .daily-card-head{justify-content:space-between}
.calendar-day-deadlines h2{margin:0;font-size:15px}
.calendar-day-deadline-list{display:grid;gap:8px;margin-top:12px}
.calendar-day-holiday{margin:0;padding:8px 12px;border-radius:12px;background:rgba(201,72,72,.1);color:#b14545;font-size:11px;font-weight:700}
.calendar-day-deadline{display:flex;align-items:center;gap:10px;padding:9px 12px;border-radius:12px;background:var(--card);box-shadow:var(--shadow-soft);color:inherit;text-decoration:none;font-size:11px}
.calendar-day-deadline b{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.calendar-day-deadline small{color:var(--muted);font-size:10px;white-space:nowrap}
.calendar-day-deadline.completed b{text-decoration:line-through;opacity:.6}
.calendar-day-deadline-icon{font-size:16px}
@media(max-width:680px){
  .dashboard-main.calendar-mode .calendar-day{min-height:48px}
  .calendar-day-deadlines{padding:15px 14px 12px;border-radius:17px}
}
