/* SWAP OS UX Shell 2 — Tasks and Calendar responsive refinement.
 * Presentation-only: preserves existing selectors, data hooks, actions and sources.
 */
:root {
  --swap-ux-ink: #17233d;
  --swap-ux-muted: #64718a;
  --swap-ux-line: #e2e8f2;
  --swap-ux-surface: #fff;
  --swap-ux-blue: #245fe8;
  --swap-ux-radius: 14px;
}

/* Tasks: make the execution surface easier to scan without hiding detail. */
.task-command-center {
  width: 100%;
  max-width: 1500px;
  gap: 16px;
  color: var(--swap-ux-ink);
}
.task-command-center .tcc-header,
.task-command-center .tcc-command-bar,
.task-command-center .tcc-section {
  min-width: 0;
}
.task-command-center .tcc-command-bar {
  align-items: center;
  border-color: var(--swap-ux-line);
  border-radius: 14px;
  box-shadow: 0 4px 16px rgba(20, 42, 85, .045);
}
.task-command-center .tcc-command-bar .btn,
.task-command-center .tcc-command-bar a.btn {
  min-height: 40px;
  border-radius: 10px;
}
.task-command-center .tcc-section {
  border-color: var(--swap-ux-line);
  border-radius: var(--swap-ux-radius);
  box-shadow: 0 4px 16px rgba(20, 42, 85, .035);
}
.task-command-center .tcc-section-head {
  padding: 17px 18px;
  align-items: center;
}
.task-command-center .tcc-section-head h2 {
  color: var(--swap-ux-ink);
  font-size: clamp(15px, 1.3vw, 18px);
  letter-spacing: -.02em;
  line-height: 1.3;
}
.task-command-center .tcc-section-head .muted,
.task-command-center .tcc-section-head p { color: var(--swap-ux-muted); }
.task-command-center .tcc-pulse-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.task-command-center .tcc-card {
  min-width: 0;
  min-height: 118px;
  border-right: 1px solid var(--swap-ux-line);
  border-bottom: 1px solid var(--swap-ux-line);
  padding: 15px 17px;
}
.task-command-center .tcc-card:nth-child(3n) { border-right: 0; }
.task-command-center .tcc-card:nth-last-child(-n+3) { border-bottom: 0; }
.task-command-center .tcc-card strong { color: var(--swap-ux-ink); font-variant-numeric: tabular-nums; }
.task-command-center .tcc-card a { color: var(--swap-ux-blue); }
.task-command-center .tcc-priority-card {
  border-color: var(--swap-ux-line);
  border-radius: 13px;
  background: #fbfcff;
}
.task-command-center .tcc-filters {
  align-items: center;
  gap: 8px;
  background: #f8faff;
  border-bottom-color: var(--swap-ux-line);
}
.task-command-center .tcc-filters select,
.task-command-center .tcc-filters input {
  min-height: 38px;
  max-width: 100%;
  border-color: #dce3ef;
  border-radius: 10px;
  color: var(--swap-ux-ink);
}
.task-command-center .tcc-task-workbench { min-width: 0; }
.task-command-center .gmail-task-list { min-width: 0; }
.task-command-center .gmail-task-row { min-width: 0; }
.task-command-center .tcc-workbench-head {
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-bottom-color: var(--swap-ux-line);
}
.task-command-center .tcc-workbench-head [data-sync-time] { overflow-wrap: anywhere; }
.task-command-center :is(button, a, input, select):focus-visible {
  outline: 3px solid rgba(36, 95, 232, .38);
  outline-offset: 2px;
}

/* Calendar: allow controls to wrap at laptop/tablet widths. */
.swap-calendar-reference-shell {
  width: 100%;
  max-width: 1600px;
  min-width: 0;
}
.swap-calendar-reference-shell .swap-cal-reference-head,
.swap-calendar-reference-shell .swap-cal-reference-toolbar,
.swap-calendar-reference-shell .swap-cal-reference-body,
.swap-calendar-reference-shell .swap-cal-reference-main { min-width: 0; }
.swap-calendar-reference-shell .swap-cal-reference-title h1 {
  letter-spacing: -.03em;
  line-height: 1.2;
}
.swap-calendar-reference-shell .swap-cal-reference-search {
  min-width: min(240px, 100%);
  border-radius: 11px;
}
.swap-calendar-reference-shell .swap-cal-reference-actions,
.swap-calendar-reference-shell .swap-cal-reference-tools,
.swap-calendar-reference-shell .swap-cal-group-tools {
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
}
.swap-calendar-reference-shell .swap-cal-reference-actions .btn,
.swap-calendar-reference-shell .swap-cal-reference-tools .btn,
.swap-calendar-reference-shell .swap-cal-group-tools .btn { min-height: 38px; border-radius: 10px; }
.swap-calendar-reference-shell .swap-cal-view-tabs { max-width: 100%; overflow-x: auto; scrollbar-width: thin; }
.swap-calendar-reference-shell .swap-cal-view-tabs button { min-height: 38px; white-space: nowrap; }
.swap-calendar-reference-shell .swap-cal-grid-card {
  min-width: 0;
  border-color: var(--swap-ux-line, #e2e8f2);
  border-radius: 14px;
  box-shadow: 0 4px 16px rgba(20, 42, 85, .04);
}
.swap-calendar-reference-shell [data-calendar-shell-scroll] { min-width: 0; max-width: 100%; }
.swap-calendar-reference-shell :is(button, a, input, select):focus-visible {
  outline: 3px solid rgba(36, 95, 232, .38);
  outline-offset: 2px;
}

@media (min-width: 761px) and (max-width: 1120px) {
  .task-command-center .tcc-pulse-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .task-command-center .tcc-attention-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .swap-calendar-reference-shell .swap-cal-reference-head { flex-wrap: wrap; gap: 12px; }
  .swap-calendar-reference-shell .swap-cal-reference-title { flex: 1 1 300px; }
  .swap-calendar-reference-shell .swap-cal-reference-search { flex: 1 1 260px; }
  .swap-calendar-reference-shell .swap-cal-reference-actions { flex: 1 1 100%; }
  .swap-calendar-reference-shell .swap-cal-reference-toolbar { flex-wrap: wrap; gap: 10px; }
  .swap-calendar-reference-shell .swap-cal-month-nav { flex: 1 1 220px; }
  .swap-calendar-reference-shell .swap-cal-view-tabs { flex: 1 1 100%; order: 3; }
  .swap-calendar-reference-shell .swap-cal-group-tools,
  .swap-calendar-reference-shell .swap-cal-reference-tools { flex: 1 1 100%; }
}

@media (max-width: 760px) {
  .task-command-center { gap: 12px; }
  .task-command-center .tcc-header h1 { font-size: 25px; }
  .task-command-center .tcc-header p { font-size: 12px; line-height: 1.5; }
  .task-command-center .tcc-health { flex-wrap: wrap; white-space: normal; }
  .task-command-center .tcc-command-bar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; padding: 10px; }
  .task-command-center .tcc-command-bar .btn,
  .task-command-center .tcc-command-bar a.btn { min-width: 0; justify-content: center; padding-inline: 8px; font-size: 11px; }
  .task-command-center .tcc-command-bar .btn:first-child { grid-column: 1 / -1; }
  .task-command-center .tcc-section-head { padding: 14px; }
  .task-command-center .tcc-pulse-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .task-command-center .tcc-card { min-height: 104px; padding: 12px; border-right: 1px solid var(--swap-ux-line); border-bottom: 1px solid var(--swap-ux-line); }
  .task-command-center .tcc-card:nth-child(3n) { border-right: 1px solid var(--swap-ux-line); }
  .task-command-center .tcc-card:nth-child(2n) { border-right: 0; }
  .task-command-center .tcc-card:nth-last-child(-n+3) { border-bottom: 1px solid var(--swap-ux-line); }
  .task-command-center .tcc-card:last-child { border-bottom: 0; }
  .task-command-center .tcc-card strong { font-size: 23px; }
  .task-command-center .tcc-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 10px; gap: 7px; }
  .task-command-center .tcc-filters > * { width: 100%; min-width: 0; }
  .task-command-center .tcc-filters input { grid-column: 1 / -1; min-width: 0; }
  .task-command-center .tcc-workbench-head { align-items: flex-start; padding: 10px 12px; }
  .task-command-center .tcc-workbench-head span:last-child { width: 100%; margin-left: 0; }
  .task-command-center .tcc-risk-row { grid-template-columns: minmax(0, 1fr) repeat(3, minmax(42px, auto)); gap: 5px; overflow-wrap: anywhere; }
  .task-command-center .tcc-goal-row { grid-template-columns: minmax(0, 1fr) 72px 44px; }
  .task-command-center .tcc-decision { padding: 12px 14px; }
  .swap-calendar-reference-shell .swap-cal-reference-head { gap: 9px; padding: 12px 12px 10px; }
  .swap-calendar-reference-shell .swap-cal-reference-title h1 { font-size: 23px; }
  .swap-calendar-reference-shell .swap-cal-reference-title p { max-width: 62ch; }
  .swap-calendar-reference-shell .swap-cal-reference-actions { grid-template-columns: auto 40px 40px minmax(0, 1fr); gap: 6px; }
  .swap-calendar-reference-shell .swap-cal-reference-actions .btn { min-height: 40px; }
  .swap-calendar-reference-shell .swap-cal-reference-search { min-height: 42px; }
  .swap-calendar-reference-shell .swap-cal-reference-body { padding-inline: 8px; }
}

@media (max-width: 380px) {
  .task-command-center .tcc-command-bar { grid-template-columns: 1fr 1fr; }
  .task-command-center .tcc-command-bar .btn,
  .task-command-center .tcc-command-bar a.btn { font-size: 10px; }
  .task-command-center .tcc-card { padding: 10px; }
  .task-command-center .tcc-card strong { font-size: 21px; }
  .task-command-center .tcc-risk-row { grid-template-columns: minmax(0, 1fr) repeat(3, 36px); font-size: 10px; }
  .swap-calendar-reference-shell .swap-cal-reference-actions { grid-template-columns: 1fr 38px 38px; }
  .swap-calendar-reference-shell .swap-cal-reference-actions .swap-cal-create-wrap { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  .task-command-center *, .swap-calendar-reference-shell * {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }
}
