/* Stage 2: controlled AppShell, sidebar and top dock visual layer. */
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--focus-sidebar-expanded) minmax(0, 1fr) minmax(280px, 360px);
  gap: clamp(18px, 2vw, 28px);
  padding: clamp(14px, 1.7vw, 24px);
  position: relative;
  overflow: hidden auto;
  background:
    radial-gradient(circle at 64% 14%, color-mix(in srgb, var(--primary) 12%, transparent), transparent 32rem),
    radial-gradient(circle at 18% 82%, rgba(216, 154, 61, 0.13), transparent 30rem),
    linear-gradient(135deg, rgba(255, 248, 237, 0.74), rgba(239, 232, 221, 0.44));
}

.app-shell.is-hidden {
  display: none !important;
}

.app-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(19, 23, 34, 0.22), transparent 28%, rgba(245, 241, 234, 0.16)),
    radial-gradient(circle at 78% 24%, rgba(197, 106, 75, 0.14), transparent 20rem),
    radial-gradient(circle at 30% 28%, rgba(86, 120, 245, 0.12), transparent 22rem);
  filter: blur(0.1px);
}

:root[data-theme="dark"] .app-shell {
  background:
    radial-gradient(circle at 62% 10%, rgba(111, 140, 255, 0.16), transparent 34rem),
    radial-gradient(circle at 20% 84%, rgba(216, 154, 61, 0.10), transparent 30rem),
    linear-gradient(135deg, #121722, #1a2030);
}

:root[data-theme="contrast"] .app-shell {
  background:
    radial-gradient(circle at 70% 14%, rgba(51, 102, 255, 0.10), transparent 30rem),
    linear-gradient(135deg, #f7f7f5, #ecefea);
}

.app-shell > * {
  position: relative;
  z-index: 1;
}

.app-shell.sidebar-collapsed {
  grid-template-columns: var(--focus-sidebar-collapsed) minmax(0, 1fr) minmax(280px, 360px);
}

.sidebar {
  width: auto;
  min-height: calc(100vh - clamp(28px, 3.4vw, 48px));
  align-self: start;
  position: sticky;
  top: clamp(14px, 1.7vw, 24px);
  border-radius: var(--focus-radius-xl);
  border: 1px solid rgba(255, 255, 255, 0.16);
  background:
    linear-gradient(180deg, rgba(19, 23, 34, 0.76), rgba(19, 23, 34, 0.56)),
    rgba(255, 255, 255, 0.08);
  color: #f6f1e9;
  backdrop-filter: blur(28px);
  box-shadow: 0 30px 80px rgba(20, 21, 24, 0.24);
  padding: 18px;
}

.sidebar :where(strong, span, small, button) {
  color: inherit;
}

.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.brand.compact {
  min-width: 0;
}

.side-actions {
  display: grid;
  gap: 8px;
}

.side-button {
  min-height: 48px;
  border-radius: var(--focus-radius-md);
  color: rgba(246, 241, 233, 0.86);
  background: transparent;
  transition:
    transform var(--focus-motion-standard),
    background var(--focus-motion-standard),
    box-shadow var(--focus-motion-standard);
}

.side-button:hover,
.side-button.active {
  transform: translateX(2px);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.10), 0 0 24px rgba(86, 120, 245, 0.16);
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 12px;
}

.sidebar-user-card {
  border-radius: var(--focus-radius-lg);
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.logout-button {
  border-radius: var(--focus-radius-md);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(246, 241, 233, 0.82);
}

.main-surface {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: 16px;
  min-width: 0;
}

.topbar {
  position: relative;
  top: auto;
  z-index: 10;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
}

.top-actions {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(190px, 0.75fr) minmax(320px, 1.45fr) auto;
  align-items: stretch;
  gap: 14px;
}

.top-actions > * {
  min-height: 64px;
  border-radius: var(--focus-radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.42);
  box-shadow: var(--focus-shadow-main);
  backdrop-filter: blur(24px);
}

:root[data-theme="dark"] .top-actions > * {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
}

.current-date {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 12px 18px 12px 64px;
  color: var(--text-primary);
  font-size: 0.94rem;
  font-weight: 650;
  line-height: 1.25;
}

.current-date::before {
  position: absolute !important;
  left: 16px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
}

.current-date::after {
  left: 28px !important;
}

.quote-ticker {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
}

.quote-ticker strong {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.ticker-window {
  min-width: 0;
  overflow: hidden;
}

.ticker-window p {
  margin: 0;
  color: var(--text-primary);
  font-weight: 500;
  white-space: normal;
  transform: none !important;
  animation: none !important;
}

.add-menu-wrap {
  position: relative;
  display: flex;
  align-items: stretch;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
}

.top-add-button {
  min-width: 156px;
  min-height: 64px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: var(--focus-radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.30);
  color: #fff7ef;
  background: linear-gradient(135deg, rgba(197, 106, 75, 0.92), rgba(236, 154, 104, 0.88));
  box-shadow: 0 18px 42px rgba(197, 106, 75, 0.22);
  backdrop-filter: blur(20px);
  font-weight: 650;
  transition:
    transform var(--focus-motion-standard),
    box-shadow var(--focus-motion-standard);
}

.top-add-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 24px 56px rgba(197, 106, 75, 0.30);
}

.top-add-button > span:first-child {
  font-size: 1.45rem;
  line-height: 1;
}

.add-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: min(280px, 76vw);
  z-index: 50;
  display: grid;
  gap: 6px;
  padding: 10px;
  border-radius: var(--focus-radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.30);
  background: rgba(255, 255, 255, 0.58);
  box-shadow: var(--focus-shadow-elevated);
  backdrop-filter: blur(28px);
}

.add-menu[hidden] {
  display: none;
}

.add-menu button {
  min-height: 44px;
  padding: 0 14px;
  border-radius: var(--focus-radius-md);
  background: rgba(255, 255, 255, 0.34);
  color: var(--text-primary);
  text-align: left;
  font-weight: 600;
  transition:
    transform var(--focus-motion-standard),
    background var(--focus-motion-standard);
}

.add-menu button:hover {
  transform: translateX(2px);
  background: rgba(86, 120, 245, 0.14);
}

.today-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.today-board .day-summary {
  grid-column: 1 / -1;
}

.calendar-sheet,
.right-panel :where(.plan-panel, .quick-actions-panel),
.info-panel,
.day-summary,
.legend {
  border-radius: var(--focus-radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.40);
  box-shadow: var(--focus-shadow-main);
  backdrop-filter: blur(22px);
}

:root[data-theme="dark"] :where(.calendar-sheet, .right-panel .plan-panel, .right-panel .quick-actions-panel, .info-panel, .day-summary, .legend) {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.10);
}

.calendar-sheet {
  overflow: hidden;
}

.right-panel {
  display: grid;
  align-content: start;
  gap: 16px;
  min-width: 0;
}

.quick-actions-panel {
  padding: 20px;
}

@media (max-width: 1180px) {
  .app-shell,
  .app-shell.sidebar-collapsed {
    grid-template-columns: var(--focus-sidebar-collapsed) minmax(0, 1fr);
  }

  .right-panel {
    grid-column: 2;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .top-actions {
    grid-template-columns: minmax(0, 1fr);
  }

  .top-add-button {
    width: 100%;
  }

  .today-board,
  .right-panel {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .app-shell,
  .app-shell.sidebar-collapsed {
    grid-template-columns: minmax(0, 1fr);
    padding: 10px;
    padding-bottom: 96px;
    gap: 12px;
  }

  .sidebar {
    min-height: auto;
    position: relative;
    top: auto;
    display: none;
  }

  .main-surface,
  .right-panel {
    grid-column: 1;
  }

  .current-date,
  .quote-ticker,
  .top-add-button {
    min-height: 56px;
  }

  .current-date {
    justify-content: flex-start;
    padding-left: 64px;
  }

  .quote-ticker {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  .calendar-sheet,
  .right-panel :where(.plan-panel, .quick-actions-panel),
  .info-panel,
  .day-summary,
  .legend {
    border-radius: var(--focus-radius-md);
  }
}

/* Stage 3: Focus Dashboard composition. */
html,
body {
  overflow-x: hidden;
}

.app-shell,
.app-shell.sidebar-collapsed {
  grid-template-columns: var(--focus-sidebar-expanded) minmax(0, 1fr);
}

.app-shell.sidebar-collapsed {
  grid-template-columns: var(--focus-sidebar-collapsed) minmax(0, 1fr);
}

.main-surface {
  display: grid;
  width: min(100%, 1320px);
  justify-self: center;
  gap: 18px;
  min-width: 0;
}

.dashboard-mobile-date {
  display: none !important;
}

.focus-dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  align-items: start;
  gap: 18px;
  width: 100%;
  min-width: 0;
}

.dashboard-main {
  display: grid;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  gap: 12px;
}

.dashboard-rail {
  display: grid;
  align-content: start;
  gap: 16px;
  min-width: 0;
}

.dashboard-rail .day-summary,
.dashboard-rail .plan-panel {
  border-radius: var(--focus-radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.26);
  background: rgba(255, 255, 255, 0.48);
  box-shadow: var(--focus-shadow-main);
  backdrop-filter: blur(24px);
}

.dashboard-rail .day-summary {
  min-height: 230px;
  padding: 22px;
}

.dashboard-rail .plan-panel {
  min-height: 250px;
}

.dashboard-rail .panel-title :where(h2, h3) {
  color: var(--primary);
}

.dashboard-main .legend {
  order: 1;
  display: flex;
  align-items: center;
  justify-self: stretch;
  gap: 10px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 10px 14px;
  margin: 0;
  overflow: hidden;
}

.dashboard-main .legend:not(.is-hidden) {
  display: flex;
  flex-wrap: wrap;
}

.dashboard-main .legend.is-hidden {
  display: none;
}

.dashboard-main .calendar-sheet {
  order: 2;
}

/* stage-17-summary-labels-layer: contextual labels and today summary connected to the calendar route. */
.focus-dashboard {
  --summary-card-glow: 0 24px 62px rgba(63, 50, 38, 0.13);
  --labels-chip-glow: 0 10px 24px color-mix(in srgb, var(--primary) 12%, transparent);
}

.dashboard-main .focus-labels-row#markerLegend {
  position: relative;
  align-items: center;
  min-height: 48px;
  border-radius: 22px;
  border-color: rgba(255, 255, 255, 0.30);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.54), rgba(255, 255, 255, 0.28)),
    color-mix(in srgb, var(--surface-glass, rgba(255, 255, 255, 0.42)) 82%, transparent);
  box-shadow:
    var(--labels-chip-glow),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.dashboard-main .focus-labels-row#markerLegend p {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 750;
}

.focus-labels-track {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  min-width: 0;
}

.focus-label-chip {
  --label-color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  max-width: min(240px, 100%);
  border: 1px solid color-mix(in srgb, var(--label-color) 19%, rgba(255, 255, 255, 0.32));
  border-radius: 999px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--label-color) 11%, rgba(255, 255, 255, 0.36)), rgba(255, 255, 255, 0.20));
  color: color-mix(in srgb, var(--text-primary) 78%, var(--label-color));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24);
  padding: 5px 10px;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition:
    transform var(--focus-motion-standard),
    border-color var(--focus-motion-standard),
    box-shadow var(--focus-motion-standard);
}

.focus-label-chip:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--label-color) 38%, rgba(255, 255, 255, 0.34));
  box-shadow:
    0 12px 26px color-mix(in srgb, var(--label-color) 14%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.26);
}

.focus-label-dot {
  width: 7px;
  height: 7px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.08),
    0 0 12px color-mix(in srgb, currentColor 44%, transparent);
}

.dashboard-rail .focus-summary-card {
  position: relative;
  overflow: hidden;
  border-radius: 26px;
  border-color: rgba(255, 255, 255, 0.30);
  background:
    radial-gradient(circle at 88% 8%, color-mix(in srgb, var(--primary) 10%, transparent), transparent 32%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0.34));
  box-shadow:
    var(--summary-card-glow),
    inset 0 1px 0 rgba(255, 255, 255, 0.26);
  backdrop-filter: blur(26px);
  -webkit-backdrop-filter: blur(26px);
}

.dashboard-rail .focus-summary-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 16% 0%, rgba(255, 255, 255, 0.26), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.10), transparent 62%);
  opacity: 0.82;
}

.dashboard-rail .focus-summary-card > * {
  position: relative;
  z-index: 1;
}

.dashboard-rail .focus-summary-card .panel-title {
  margin-bottom: 14px;
}

.focus-summary-list {
  display: grid;
  gap: 10px;
}

.focus-summary-item {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 62px;
  border: 1px solid color-mix(in srgb, var(--summary-color, var(--primary)) 18%, rgba(255, 255, 255, 0.28));
  border-radius: 18px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--summary-color, var(--primary)) 9%, rgba(255, 255, 255, 0.46)), rgba(255, 255, 255, 0.24));
  box-shadow:
    0 14px 30px rgba(44, 35, 26, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
  padding: 12px 14px;
  overflow: hidden;
  transition:
    transform var(--focus-motion-standard),
    border-color var(--focus-motion-standard),
    box-shadow var(--focus-motion-standard);
}

.focus-summary-item::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 0% 50%, color-mix(in srgb, var(--summary-color, var(--primary)) 16%, transparent), transparent 42%);
  opacity: 0.82;
}

.focus-summary-item:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--summary-color, var(--primary)) 34%, rgba(255, 255, 255, 0.34));
  box-shadow:
    0 18px 38px color-mix(in srgb, var(--summary-color, var(--primary)) 13%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.26);
}

.focus-summary-dot {
  position: relative;
  z-index: 1;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--summary-color, var(--primary));
  box-shadow:
    0 0 0 4px color-mix(in srgb, var(--summary-color, var(--primary)) 13%, transparent),
    0 0 16px color-mix(in srgb, var(--summary-color, var(--primary)) 34%, transparent);
}

.focus-summary-copy {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 3px;
  min-width: 0;
}

.focus-summary-copy strong {
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 750;
  line-height: 1.2;
}

.focus-summary-meta {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.focus-summary-empty {
  min-height: 94px;
  display: grid;
  place-items: center;
  border: 1px dashed color-mix(in srgb, var(--primary) 20%, rgba(255, 255, 255, 0.36));
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.22);
  color: var(--text-muted);
  text-align: center;
  padding: 18px;
}

:root[data-theme="dark"] .dashboard-main .focus-labels-row#markerLegend {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.05)),
    rgba(19, 23, 34, 0.48);
  border-color: rgba(255, 255, 255, 0.13);
}

:root[data-theme="dark"] .focus-label-chip {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--label-color) 16%, rgba(255, 255, 255, 0.08)), rgba(255, 255, 255, 0.055));
  color: color-mix(in srgb, var(--text-primary) 88%, var(--label-color));
}

:root[data-theme="dark"] .dashboard-rail .focus-summary-card {
  background:
    radial-gradient(circle at 88% 8%, color-mix(in srgb, var(--primary) 12%, transparent), transparent 32%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.095), rgba(255, 255, 255, 0.055));
  border-color: rgba(255, 255, 255, 0.13);
}

:root[data-theme="dark"] .focus-summary-item {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--summary-color, var(--primary)) 12%, rgba(255, 255, 255, 0.07)), rgba(255, 255, 255, 0.045));
  border-color: color-mix(in srgb, var(--summary-color, var(--primary)) 24%, rgba(255, 255, 255, 0.10));
}

/* stage-18-today-tasks-layer: separate daily checklist, calm and non-calendar-like. */
.focus-dashboard {
  --tasks-card-glow: 0 24px 64px rgba(58, 43, 30, 0.12);
  --tasks-action-glow: 0 14px 30px color-mix(in srgb, var(--primary) 14%, transparent);
}

.dashboard-rail .focus-tasks-card {
  position: relative;
  overflow: hidden;
  border-radius: 26px;
  border-color: rgba(255, 255, 255, 0.30);
  background:
    radial-gradient(circle at 12% 0%, color-mix(in srgb, var(--primary) 10%, transparent), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.56), rgba(255, 255, 255, 0.32));
  box-shadow:
    var(--tasks-card-glow),
    inset 0 1px 0 rgba(255, 255, 255, 0.26);
  backdrop-filter: blur(26px);
  -webkit-backdrop-filter: blur(26px);
}

.dashboard-rail .focus-tasks-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 86% 14%, rgba(255, 255, 255, 0.24), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.10), transparent 68%);
  opacity: 0.78;
}

.dashboard-rail .focus-tasks-card > * {
  position: relative;
  z-index: 1;
}

.dashboard-rail .focus-tasks-card .panel-title {
  margin-bottom: 10px;
}

.focus-tasks-card .plan-motto {
  margin: 0 0 14px;
  color: var(--text-muted);
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.42;
}

.focus-tasks-list {
  display: grid;
  gap: 10px;
}

.focus-task-item {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  border: 1px solid color-mix(in srgb, var(--primary) 12%, rgba(255, 255, 255, 0.30));
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.20)),
    color-mix(in srgb, var(--surface-glass, rgba(255, 255, 255, 0.42)) 74%, transparent);
  box-shadow:
    0 12px 26px rgba(44, 35, 26, 0.075),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
  padding: 11px 12px 11px 14px;
  overflow: hidden;
  transition:
    transform var(--focus-motion-standard),
    border-color var(--focus-motion-standard),
    box-shadow var(--focus-motion-standard);
}

.focus-task-item::before {
  content: "";
  position: absolute;
  inset: 10px auto 10px 0;
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--label-reminder, var(--primary)), color-mix(in srgb, var(--primary) 28%, transparent));
  opacity: 0.72;
  box-shadow: 0 0 16px color-mix(in srgb, var(--primary) 28%, transparent);
}

.focus-task-item:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--primary) 28%, rgba(255, 255, 255, 0.34));
  box-shadow:
    0 16px 34px color-mix(in srgb, var(--primary) 11%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.26);
}

.focus-task-copy {
  min-width: 0;
  margin: 0;
  padding-left: 5px;
  color: var(--text-primary);
  font-size: 0.94rem;
  font-weight: 650;
  line-height: 1.32;
  text-wrap: pretty;
}

.focus-task-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  border: 1px solid color-mix(in srgb, var(--primary) 10%, rgba(255, 255, 255, 0.28));
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
  padding: 4px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.focus-task-actions .icon-action {
  width: 30px;
  height: 30px;
  border-radius: 11px;
  background-color: transparent;
  background-size: 66% 66%;
}

.focus-task-actions .icon-action:hover {
  background-color: color-mix(in srgb, var(--primary) 12%, rgba(255, 255, 255, 0.22));
  box-shadow: 0 8px 18px color-mix(in srgb, var(--primary) 13%, transparent);
}

.focus-tasks-action {
  margin-top: 12px;
  min-height: 46px;
  border-color: color-mix(in srgb, var(--primary) 16%, rgba(255, 255, 255, 0.30));
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.44), rgba(255, 255, 255, 0.20)),
    color-mix(in srgb, var(--primary) 8%, transparent);
  box-shadow: var(--tasks-action-glow);
}

.focus-tasks-action:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--primary) 34%, rgba(255, 255, 255, 0.34));
}

.focus-task-empty {
  display: grid;
  place-items: center;
  min-height: 84px;
  margin: 0;
  border: 1px dashed color-mix(in srgb, var(--primary) 20%, rgba(255, 255, 255, 0.36));
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.20);
  color: var(--text-muted);
  text-align: center;
  padding: 16px;
}

:root[data-theme="dark"] .dashboard-rail .focus-tasks-card {
  background:
    radial-gradient(circle at 12% 0%, color-mix(in srgb, var(--primary) 13%, transparent), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.095), rgba(255, 255, 255, 0.055));
  border-color: rgba(255, 255, 255, 0.13);
}

:root[data-theme="dark"] .focus-task-item {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.042)),
    rgba(19, 23, 34, 0.32);
  border-color: color-mix(in srgb, var(--primary) 19%, rgba(255, 255, 255, 0.10));
}

:root[data-theme="dark"] .focus-task-actions {
  background: rgba(255, 255, 255, 0.055);
  border-color: rgba(255, 255, 255, 0.11);
}

@media (max-width: 760px) {
  .focus-task-item {
    grid-template-columns: minmax(0, 1fr);
    gap: 9px;
    border-radius: 17px;
    padding: 11px 12px;
  }

  .focus-task-actions {
    justify-self: end;
  }

  .focus-tasks-card .plan-motto {
    font-size: 0.82rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .focus-task-item,
  .focus-tasks-action,
  .focus-label-chip {
    transition: none;
  }

  .focus-task-item:hover,
  .focus-tasks-action:hover {
    transform: none;
  }
}

.calendar-sheet {
  min-height: min(68vh, 720px);
}

.interesting-today {
  border-radius: var(--focus-radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.40);
  box-shadow: var(--focus-shadow-main);
  backdrop-filter: blur(22px);
  padding: 20px;
}

.interesting-today > .panel-title {
  margin-bottom: 14px;
}

.interesting-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.interesting-grid .info-panel {
  min-height: 170px;
}

.quick-actions-panel {
  display: none !important;
}

:root[data-theme="dark"] :where(.dashboard-rail .day-summary, .dashboard-rail .plan-panel, .interesting-today) {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.11);
}

@media (max-width: 1180px) {
  .app-shell,
  .app-shell.sidebar-collapsed {
    grid-template-columns: var(--focus-sidebar-collapsed) minmax(0, 1fr);
  }

  .focus-dashboard {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 330px);
  }
}

@media (max-width: 900px) {
  .focus-dashboard {
    grid-template-columns: minmax(0, 1fr);
    max-width: 100%;
  }

  .dashboard-rail {
    order: 1;
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    min-width: 0 !important;
    max-width: 100%;
  }

  .dashboard-rail .plan-panel {
    order: 1;
  }

  .dashboard-rail .day-summary {
    order: 2;
  }

  .dashboard-main {
    order: 3;
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    min-width: 0 !important;
    max-width: 100%;
  }

  .interesting-today {
    order: 4;
  }

  .interesting-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  /* stage-3-mobile-shell-reset: keep legacy mobile rules from reordering the dashboard. */
  .app-shell,
  .app-shell.sidebar-collapsed {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr);
  }

  .main-surface {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    max-width: 100%;
    min-width: 0 !important;
    gap: 14px;
    padding-bottom: calc(86px + env(safe-area-inset-bottom));
    box-sizing: border-box;
  }

  .topbar {
    order: 0;
  }

  .focus-dashboard {
    order: 1;
  }

  .interesting-today {
    order: 2;
  }

  .sidebar,
  .app-shell.sidebar-collapsed .sidebar {
    display: contents !important;
  }

  .sidebar-top,
  .app-shell.sidebar-collapsed .sidebar-top,
  .sidebar-footer,
  .app-shell.sidebar-collapsed .sidebar-footer,
  .mobile-logout {
    display: none !important;
  }

  .side-actions,
  .app-shell.sidebar-collapsed .side-actions {
    position: fixed;
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
    left: max(12px, env(safe-area-inset-left));
    z-index: 40;
    display: flex !important;
  }

  .focus-dashboard {
    gap: 14px;
    max-width: 100%;
    min-width: 0 !important;
  }

  .calendar-sheet {
    width: 100%;
    min-height: auto;
    max-width: 100%;
    margin-inline: 0;
    overflow: hidden;
    box-sizing: border-box;
    padding: clamp(12px, 3.5vw, 18px);
  }

  .dashboard-main {
    width: 100%;
    max-width: 100%;
    min-width: 0 !important;
  }

  .dashboard-main .legend:not(.is-hidden) {
    position: static;
    flex: 0 0 auto;
    width: 100%;
    max-width: 100%;
    margin: 0 !important;
    align-self: stretch;
    justify-self: stretch;
    overflow: hidden;
  }

  .dashboard-main #markerLegendItems {
    width: 100%;
    min-width: 0;
  }

  .dashboard-main .focus-labels-row#markerLegend {
    min-height: auto;
    align-items: flex-start;
    border-radius: 20px;
    padding: 10px 12px;
  }

  .focus-labels-track {
    gap: 6px;
  }

  .focus-label-chip {
    min-height: 28px;
    max-width: 100%;
    padding: 5px 9px;
    font-size: 0.72rem;
  }

  .calendar-sheet .weekdays,
  .calendar-sheet .calendar-grid {
    width: 100%;
    max-width: 100%;
    min-width: 0 !important;
    box-sizing: border-box;
    grid-template-columns: repeat(7, minmax(32px, 1fr)) !important;
    gap: clamp(4px, 1.4vw, 6px);
  }

  .calendar-sheet .day-cell {
    min-width: 0 !important;
    min-height: clamp(44px, 12.4vw, 58px) !important;
    box-sizing: border-box;
    padding: 6px 5px;
    border-radius: 12px;
    aspect-ratio: auto;
    overflow: hidden;
  }

  .calendar-sheet .day-cell > span:last-child {
    font-size: clamp(0.82rem, 3.4vw, 0.95rem);
  }

  .calendar-sheet .marker-row {
    min-height: 9px;
    gap: 3px;
    overflow: hidden;
  }

  .calendar-sheet .marker-row .dot {
    width: 6px;
    height: 6px;
  }

  .dashboard-rail .day-summary,
  .dashboard-rail .plan-panel,
  .interesting-today {
    border-radius: var(--focus-radius-md);
  }

  .dashboard-rail .focus-summary-card {
    border-radius: 22px;
    min-height: auto;
    padding: 18px;
  }

  .focus-summary-list {
    gap: 8px;
  }

  .focus-summary-item {
    min-height: 58px;
    border-radius: 16px;
    padding: 11px 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .focus-label-chip,
  .focus-summary-item {
    transition: none;
  }

  .focus-label-chip:hover,
  .focus-summary-item:hover {
    transform: none;
  }
}
