/* Calendar-specific surfaces and accents inherit the platform's stored theme. */
#tasksSection {
  --cal-meeting: var(--accent-blue);
  --cal-call: var(--accent-gold);
  --cal-task: #b295df;
  --cal-hover: var(--panel-strong-bg);
}
:root[data-theme="light"] #tasksSection { --cal-task: #7951ad; }
#tasksSection.is-calendar { color: var(--primary-text); }
#tasksSection.is-calendar .tasks-section-head { display:flex;align-items:center;justify-content:space-between;gap:16px;margin:0 0 4px; }
#tasksSection.is-calendar .tasks-section-head h2 { margin:0;font-size:28px;font-weight:650;letter-spacing:-.6px; }
#tasksSection.is-calendar .tasks-section-head p { margin:6px 0 0;color:var(--secondary-text);font-size:14px; }
#tasksSection .tasks-page-actions { display:flex;align-items:center;gap:14px;flex-wrap:wrap; }
#tasksSection.is-calendar .tasks-view-switch { display:flex;flex-wrap:nowrap;gap:0;border:1px solid var(--panel-border);padding:3px;border-radius:10px; }
#tasksSection.is-calendar .tasks-view-switch .tab-btn { border:0;border-radius:7px;min-height:38px;padding:8px 16px;background:transparent;color:var(--secondary-text);font-size:14px; }
#tasksSection.is-calendar .tasks-view-switch .tab-btn.active { background:var(--accent-gold);color:#101e30; }
#tasksSection .cal-layout { display:grid;grid-template-columns:minmax(0,2.75fr) minmax(260px,1fr);align-items:start;gap:16px; }
#tasksSection .cal-layout > *, #tasksSection .cal-layout * { min-width:0;box-sizing:border-box; }
#tasksSection .cal-month-panel, #tasksSection .cal-agenda-panel { background:var(--panel-bg);border:1px solid var(--panel-border);border-radius:13px;box-shadow:var(--metric-card-shadow); }
#tasksSection .cal-month-panel { overflow:hidden; }
#tasksSection .cal-toolbar { padding:16px;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px; }
#tasksSection .cal-navigation { display:flex;align-items:center;gap:6px;flex-wrap:wrap; }
#tasksSection .cal-navigation h3 { font-size:18px;font-weight:600;margin:0 0 0 8px; }
#tasksSection .cal-tools { display:flex;align-items:center;justify-content:space-between;gap:12px;flex:1 1 auto; }
#tasksSection .cal-legend { display:flex;gap:12px;flex-wrap:wrap;font-size:11px;color:var(--secondary-text); }
#tasksSection .cal-legend > span { display:flex;gap:6px;align-items:center;white-space:nowrap; }
#tasksSection .cal-legend > span::before { content:'';width:8px;height:8px;flex:none;border-radius:50%;background:var(--cal-accent); }
#tasksSection .cal-meeting { --cal-accent:var(--cal-meeting); }
#tasksSection .cal-call { --cal-accent:var(--cal-call); }
#tasksSection .cal-task { --cal-accent:var(--cal-task); }
#tasksSection .cal-button { display:inline-flex;align-items:center;justify-content:center;gap:8px;border:1px solid var(--panel-border);border-radius:8px;min-height:44px;padding:9px 13px;color:var(--primary-text);background:transparent;font:inherit;font-size:13px;font-weight:500;cursor:pointer;transition:background-color .15s; }
#tasksSection .cal-button:hover { background:var(--cal-hover); }
#tasksSection .cal-primary { background:var(--gold-400);color:#101e30;border-color:transparent;font-weight:600; }
#tasksSection .cal-primary:hover { background:color-mix(in srgb,var(--gold-400) 85%,white);color:#101e30; }
#tasksSection .cal-icon-button { padding:10px;width:44px;flex-shrink:0; }
#tasksSection svg { flex-shrink:0; }
#tasksSection .cal-button svg, #tasksSection .cal-link svg, #tasksSection .cal-deadline > svg, #tasksSection .cal-owner svg, #tasksSection .cal-detail-type svg { width:20px;height:20px; }
#tasksSection .cal-view-label { position:relative; }
#tasksSection .cal-view-label::after { content:"";position:absolute;right:12px;top:calc(50% - 4px);width:6px;height:6px;border:solid var(--secondary-text);border-width:0 1px 1px 0;transform:rotate(45deg);pointer-events:none; }
#tasksSection .cal-view-label select { appearance:none;height:44px; width:auto;min-height:44px;border:1px solid var(--panel-border);border-radius:8px;font:inherit;font-size:13px;padding:8px 30px 8px 10px;background:var(--panel-bg);color:var(--primary-text); }
#tasksSection .cal-view-label .sr-only { position:absolute;width:1px;height:1px;padding:0;margin:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap; }
#tasksSection .cal-feedback { margin:0;padding:10px 16px;font-size:13px;color:var(--secondary-text);border-top:1px solid var(--panel-border); }
#tasksSection .cal-weekdays, #tasksSection .cal-grid { display:grid;grid-template-columns:repeat(7,minmax(0,1fr)); }
#tasksSection .cal-weekdays { border-top:1px solid var(--panel-border);color:var(--secondary-text);font-size:12px;text-align:center; }
#tasksSection .cal-weekdays span { padding:10px 0; }
#tasksSection .cal-day { position:relative;border-top:1px solid var(--panel-border);border-right:1px solid var(--panel-border);min-height:clamp(76px,10.2vh,96px);padding:3px 4px 5px; }
#tasksSection .cal-day:nth-child(7n) { border-right:0; }
#tasksSection .cal-day:hover { background:var(--cal-hover); }
#tasksSection .cal-day.cal-selected { background:color-mix(in srgb,var(--cal-meeting) 12%,var(--panel-bg));box-shadow:inset 0 0 0 1px var(--cal-meeting); }
#tasksSection .cal-date { color:var(--primary-text);border:0;background:transparent;font:inherit;font-size:12px;display:flex;align-items:center;justify-content:flex-start;min-height:28px;width:100%;padding:0;cursor:pointer;border-radius:4px; }
#tasksSection .cal-date > span:first-child { width:25px;height:25px;display:grid;place-content:center;border-radius:50%; }
#tasksSection .cal-outside .cal-date { color:var(--secondary-text); }
#tasksSection .cal-outside { background:color-mix(in srgb,var(--workspace-bg) 45%,var(--panel-bg)); }
#tasksSection .cal-today .cal-date > span:first-child { border:1px solid var(--accent-gold);color:var(--accent-gold); }
#tasksSection .cal-selected .cal-date > span:first-child { background:var(--cal-meeting);color:#081725;font-weight:650; }
#tasksSection .cal-strips { display:grid;gap:3px; }
#tasksSection .cal-strip { display:flex;align-items:center;gap:4px;border:0;border-left:2px solid var(--cal-accent);border-radius:4px;padding:3px;color:var(--primary-text);background:color-mix(in srgb,var(--cal-accent) 14%,var(--panel-bg));font:inherit;font-size:12px;text-align:left;width:100%;cursor:pointer; }
#tasksSection .cal-strip svg { width:11px;height:11px;color:var(--cal-accent); }
#tasksSection .cal-strip span { overflow:hidden;white-space:nowrap;text-overflow:ellipsis; }
#tasksSection .cal-strip small { display:block;font-size:10px;color:var(--cal-accent); }
#tasksSection .cal-strip:hover { background:color-mix(in srgb,var(--cal-accent) 25%,var(--panel-bg)); }
#tasksSection .cal-more { border:0;background:none;color:var(--secondary-text);font:inherit;font-size:10px;text-align:left;padding:0 3px;cursor:pointer; }
#tasksSection .cal-dots { display:none; }
#tasksSection .cal-agenda-panel { padding:18px; }
#tasksSection .cal-agenda-heading { padding-bottom:14px;border-bottom:1px solid var(--panel-border); }
#tasksSection .cal-agenda-heading h3, #tasksSection .cal-upcoming h3 { font-size:17px;font-weight:600;margin:0;line-height:1.4; }
#tasksSection .cal-agenda-heading p, #tasksSection .cal-supporting { margin:5px 0 0;font-size:12px;color:var(--secondary-text); }
#tasksSection .cal-agenda-entry { position:relative;padding:14px 0 14px 12px;border-bottom:1px solid var(--panel-border);overflow-wrap:anywhere; }
#tasksSection .cal-agenda-entry::before { content:'';position:absolute;left:0;top:17px;bottom:17px;width:3px;border-radius:2px;background:var(--cal-accent); }
#tasksSection .cal-event-meta { display:flex;gap:8px;flex-wrap:wrap;align-items:center;color:var(--cal-accent);font-size:12px; }
#tasksSection .cal-type { display:flex;align-items:center;gap:5px; }
#tasksSection .cal-type svg { width:14px;height:14px; }
#tasksSection .cal-agenda-entry h4 { margin:8px 0 10px;font-size:15px;font-weight:600;line-height:1.4; }
#tasksSection .cal-owner { color:var(--secondary-text);display:flex;align-items:center;gap:7px;margin:0 0 8px;font-size:12px; }
#tasksSection .cal-owner svg { width:16px;height:16px; }
#tasksSection .cal-link { display:inline-flex;align-items:center;justify-content:space-between;gap:8px;padding:5px 0;min-height:32px;font:inherit;font-size:12px;font-weight:500;color:var(--accent-gold);background:transparent;border:0;cursor:pointer;text-align:left; }
#tasksSection .cal-link:hover { color:var(--primary-text); }
#tasksSection .cal-upcoming { margin-top:20px; }
#tasksSection .cal-deadline { width:100%;display:grid;grid-template-columns:22px minmax(0,1fr) 16px;align-items:start;gap:8px;text-align:left;border:0;border-bottom:1px solid var(--panel-border);border-radius:0;padding:13px 0;background:transparent;color:var(--primary-text);font:inherit;cursor:pointer;overflow-wrap:anywhere; }
#tasksSection .cal-deadline:hover { background:var(--cal-hover); }
#tasksSection .cal-deadline:last-child { border-bottom:0; }
#tasksSection .cal-deadline strong { font-size:13px;font-weight:550; }
#tasksSection .cal-deadline small { display:block;color:var(--secondary-text);font-size:11px;line-height:1.5;margin-top:5px; }
#tasksSection .cal-deadline-icon svg { width:19px;height:19px;color:var(--cal-accent); }
#tasksSection .cal-deadline > svg { width:16px;height:16px;color:var(--secondary-text); }
#tasksSection .cal-empty { margin:12px 0;font-size:13px;line-height:1.5;color:var(--secondary-text); }
#tasksSection .cal-all-events { width:100%;margin-top:18px; }
#tasksSection .cal-month-agenda { padding:0 16px 16px; }
#tasksSection .cal-month-agenda section > h3 { font-size:15px;margin:18px 0 0; }
#tasksSection .cal-skeleton { display:grid;gap:10px;padding:16px 0; }
#tasksSection .cal-skeleton span { height:16px;border-radius:4px;background:var(--panel-strong-bg); }
#tasksSection .cal-skeleton span:last-child { width:65%; }
#tasksSection .cal-grid[aria-busy="true"] .cal-day:nth-child(3n) .cal-strips::before { content:'';display:block;height:14px;margin:6px 4px;border-radius:4px;background:var(--panel-strong-bg); }
body.calendar-modal-open { overflow:hidden; }
#tasksSection .cal-dialog { box-sizing:border-box;width:min(560px,calc(100% - 32px));max-width:none;max-height:calc(100vh - 40px);max-height:calc(100dvh - 40px);margin:auto;border:1px solid var(--panel-border);border-radius:14px;padding:20px;background:var(--panel-bg);color:var(--primary-text);overflow:auto;overscroll-behavior:contain; }
#tasksSection .cal-dialog::backdrop { background:var(--modal-backdrop); }
#tasksSection .cal-dialog-heading { display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:18px; }
#tasksSection .cal-dialog-heading h2 { font-size:20px;margin:0;overflow-wrap:anywhere; }
#tasksSection .cal-form { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px; }
#tasksSection .cal-form label { min-width:0;display:block;color:var(--secondary-text);font-size:13px; }
#tasksSection .cal-form input, #tasksSection .cal-form select, #tasksSection .cal-form textarea { margin-top:7px;width:100%;min-width:0;max-width:100%;min-height:44px;padding:10px;border-radius:8px;border:1px solid var(--field-border);background:var(--field-bg);color:var(--field-text);font-size:16px;box-sizing:border-box; }
#tasksSection .cal-form textarea { resize:vertical; }
#tasksSection .cal-form-wide { grid-column:1/-1; }
#tasksSection .cal-required { font-size:11px; }
#tasksSection .cal-form-actions { display:flex;justify-content:flex-end;flex-wrap:wrap;gap:10px;padding-top:8px; }
#tasksSection .cal-error { margin:0;color:var(--danger);font-size:13px;overflow-wrap:anywhere; }
#tasksSection .cal-error:empty { display:none; }
#tasksSection .cal-form [aria-invalid="true"] { border-color:var(--danger); }
#tasksSection .cal-button:disabled { opacity:.6;cursor:wait; }
#tasksSection .cal-detail-type { display:flex;align-items:center;gap:8px;color:var(--accent-gold); }
#tasksSection .cal-detail-fields { display:grid;grid-template-columns:90px minmax(0,1fr);gap:16px;font-size:14px; }
#tasksSection .cal-detail-fields dt { color:var(--secondary-text); }
#tasksSection .cal-detail-fields dd { margin:0;overflow-wrap:anywhere; }
#tasksSection .cal-notes { white-space:pre-wrap; }
#tasksSection .cal-event-actions { margin-top:24px; }
#tasksSection .cal-event-actions summary { width:max-content;list-style:none; }
#tasksSection .cal-event-actions summary::-webkit-details-marker { display:none; }
#tasksSection .cal-event-actions > div { display:flex;flex-wrap:wrap;gap:8px;padding-top:8px; }
#tasksSection .cal-danger { color:var(--danger); }
#tasksSection :is(.cal-button,.cal-link,.cal-date,.cal-strip,.cal-more,.cal-deadline):focus-visible,
#tasksSection .cal-form :is(input,textarea,select):focus-visible,
#tasksSection #calendarDisplayMode:focus-visible { outline:2px solid var(--accent-gold);outline-offset:2px; }
@media (max-width:1100px) {
  #tasksSection .cal-layout { grid-template-columns:minmax(0,1fr); }
  #tasksSection .cal-day { min-height:92px; }
  #tasksSection .cal-date { min-height:44px; }
  #tasksSection .cal-strip, #tasksSection .cal-more { min-height:44px; }
  #tasksSection .cal-agenda-panel { display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:20px; }
  #tasksSection .cal-upcoming { margin:0; }
  #tasksSection .cal-all-events { grid-column:1/-1;margin-top:0; }
  #tasksSection .cal-link { min-height:44px; }
}
@media (max-width:767px) {
  #tasksSection.is-calendar .tasks-section-head { flex-direction:column;align-items:stretch;gap:16px; }
  #tasksSection.is-calendar .tasks-section-head h2 { font-size:26px; }
  #tasksSection .tasks-page-actions { justify-content:space-between;gap:10px; }
  #tasksSection .cal-toolbar { padding:12px;gap:10px; }
  #tasksSection .cal-navigation { width:100%; }
  #tasksSection .cal-navigation h3 { margin-left:auto;font-size:16px; }
  #tasksSection .cal-tools { width:100%;gap:6px; }
  #tasksSection .cal-legend { gap:6px;font-size:10px;flex:1; }
  #tasksSection .cal-legend > span { gap:4px; }
  #tasksSection .cal-view-label select { min-width:82px;font-size:16px;padding:8px 26px 8px 8px; }
  #tasksSection .cal-day { min-height:64px;padding:2px; }
  #tasksSection .cal-date { flex-direction:column;justify-content:flex-start;gap:4px;padding-top:3px;min-height:58px;font-size:13px; }
  #tasksSection .cal-date > span:first-child { width:28px;height:28px; }
  #tasksSection .cal-strips { display:none; }
  #tasksSection .cal-dots { display:flex;gap:3px;min-height:7px; }
  #tasksSection .cal-dots i { width:5px;height:5px;border-radius:50%;background:var(--cal-accent); }
  #tasksSection .cal-agenda-panel { display:block;padding:16px; }
  #tasksSection .cal-upcoming { margin-top:22px; }
  #tasksSection .cal-all-events { margin-top:16px; }
  #tasksSection .cal-agenda-heading h3 { font-size:18px; }
  #tasksSection .cal-dialog { width:100%;height:100vh;height:var(--cal-viewport-height,100dvh);max-height:100vh;max-height:var(--cal-viewport-height,100dvh);top:var(--cal-viewport-top,0px);bottom:auto;border-radius:0;margin:0;padding:16px max(16px,env(safe-area-inset-right)) max(20px,env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left)); }
  #tasksSection .cal-form { grid-template-columns:minmax(0,1fr);gap:14px; }
  #tasksSection .cal-form-actions { padding-bottom:12px; }
  #tasksSection .cal-form-actions button { flex:1; }
}
@media (prefers-reduced-motion:reduce) { #tasksSection .cal-button { transition:none; } }
