:root {
      /* Page canvas: lighter mint than sidebars (--surface-tint) */
      --canvas: #f0f6f2;
      /* Surfaces */
      --surface: #f4f5f3;
      --surface-tint: #e6efe8;
      --surface-highlight: #a9d3a6;
      /* Brand greens */
      --accent: #2f7d55;
      --accent-hover: #256746;
      --green-deep: #2f6f50;
      /* Anchor (sparingly: icons, key headings) */
      --anchor: #1f4d4d;
      /* Text */
      --text: #2e3a34;
      --text-soft: #6f7f76;
      --text-inverse: #ffffff;
      /* Chrome */
      --border: #dde5df;
      --shadow: 0 2px 14px rgba(31, 77, 77, 0.08);
      --shadow-drawer: 6px 0 28px rgba(31, 77, 77, 0.1);
      --radius: 14px;
      --radius-sm: 10px;
      --sidebar-bg: var(--surface-tint);
      --sidebar-border: var(--border);
      --sidebar-rail: 3.5rem;
      --sidebar-expanded: 15.75rem;
      --chatbar-rail: 3.5rem;
      --chatbar-expanded: 20rem;
      --chatbar-gap: 0.5rem;
      --mobile-header-h: 3.25rem;
      /* Add task + work mode: single height on web and mobile (borders included). */
      --toolbar-control-h: 2rem;
      --font: "DM Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    }
    * { box-sizing: border-box; }
    html { height: 100%; }
    body {
      margin: 0;
      min-height: 100%;
      font-family: var(--font);
      font-size: 1rem;
      line-height: 1.55;
      color: var(--text);
      background: var(--canvas);
      -webkit-font-smoothing: antialiased;
    }
    body.nav-open,
    body.chat-open {
      overflow: hidden;
    }
    .mobile-header {
      display: none;
    }
    .nav-backdrop,
    .chat-backdrop {
      display: none;
    }
    .app {
      display: flex;
      min-height: 100vh;
    }
    /* Desktop: hover rail */
    .sidebar {
      position: fixed;
      left: 0;
      top: 0;
      bottom: 0;
      z-index: 40;
      width: var(--sidebar-rail);
      background: var(--sidebar-bg);
      border-right: 1px solid var(--sidebar-border);
      overflow: hidden;
      transition: width 0.22s ease, box-shadow 0.22s ease;
    }
    @media (min-width: 721px) {
      .sidebar:hover,
      .sidebar:focus-within {
        width: var(--sidebar-expanded);
        box-shadow: var(--shadow-drawer);
      }
    }
    .sidebar-inner {
      width: var(--sidebar-expanded);
      min-height: 100%;
      display: flex;
      flex-direction: column;
      padding: 1.15rem 0.85rem 1.1rem;
    }
    .sidebar-icon {
      flex-shrink: 0;
      width: 1.2rem;
      height: 1.2rem;
      color: var(--anchor);
      opacity: 0.92;
      display: block;
      stroke-width: 1.85;
      stroke-linecap: round;
      stroke-linejoin: round;
      vector-effect: non-scaling-stroke;
    }
    .sidebar a.active .sidebar-icon {
      color: var(--green-deep);
      opacity: 1;
    }
    .brand {
      display: flex;
      align-items: center;
      gap: 0.65rem;
      font-weight: 700;
      font-size: 1.05rem;
      letter-spacing: -0.03em;
      color: var(--anchor);
      text-decoration: none;
      padding: 0.4rem 0.5rem 0.4rem 0.7rem;
      margin-bottom: 1.35rem;
      border-radius: var(--radius-sm);
    }
    .brand:hover {
      background: color-mix(in srgb, var(--surface-highlight) 35%, transparent);
    }
    .brand-text {
      white-space: nowrap;
      overflow: hidden;
    }
    .nav {
      display: flex;
      flex-direction: column;
      gap: 0.2rem;
    }
    .nav-group {
      display: flex;
      flex-direction: column;
      gap: 0.2rem;
    }
    .nav a {
      display: flex;
      align-items: center;
      gap: 0.65rem;
      padding: 0.55rem 0.5rem;
      min-height: 2.375rem;
      position: relative;
      border-radius: var(--radius-sm);
      border: 1px solid transparent;
      font-size: 0.9375rem;
      font-weight: 500;
      color: var(--text-soft);
      text-decoration: none;
      transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    }
    .nav a:hover {
      background: color-mix(in srgb, var(--surface) 70%, transparent);
      color: var(--text);
    }
    .nav a.active {
      background: var(--surface);
      color: var(--text);
      box-shadow: 0 1px 3px rgba(31, 77, 77, 0.07);
      border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
    }
    .nav a.nav-divider-after {
      margin-bottom: 0.55rem;
    }
    .nav a.nav-divider-after::after {
      content: "";
      position: absolute;
      left: 0.5rem;
      right: 0.5rem;
      bottom: -0.4rem;
      border-bottom: 1px solid color-mix(in srgb, var(--green-deep) 20%, var(--border));
      pointer-events: none;
    }
    .nav-label {
      display: block;
      line-height: 1.2;
      white-space: nowrap;
      overflow: hidden;
    }
    .nav-icon-slot {
      width: 1.5rem;
      height: 1.5rem;
      flex: 0 0 1.5rem;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      line-height: 0;
    }
    .nav-icon-slot .sidebar-icon {
      margin: 0;
    }
    .sidebar-foot {
      margin-top: auto;
      padding-top: 1.25rem;
      display: flex;
      flex-direction: column;
      gap: 0.55rem;
    }
    .logout-form { margin: 0; }
    .logout-form button {
      display: flex;
      align-items: center;
      justify-content: flex-start;
      gap: 0.65rem;
      width: 100%;
      cursor: pointer;
      font: inherit;
      font-size: 0.875rem;
      font-weight: 500;
      padding: 0.5rem 0.5rem;
      border-radius: var(--radius-sm);
      border: 1px solid transparent;
      background: transparent;
      color: var(--text-soft);
      transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    }
    .logout-form button:hover {
      background: color-mix(in srgb, var(--surface) 70%, transparent);
      color: var(--text);
      border-color: transparent;
    }
    .logout-form button:focus-visible {
      outline: 2px solid var(--anchor);
      outline-offset: 2px;
    }
    .logout-form .sidebar-icon {
      flex-shrink: 0;
      color: var(--anchor);
      opacity: 0.88;
    }
    .main {
      flex: 1;
      min-width: 0;
      margin-left: var(--sidebar-rail);
      margin-right: calc(var(--chatbar-rail) + var(--chatbar-gap));
      /* Top padding sized so the page-title vertically aligns with the sidebar / chatbar icons
         (sidebar-inner 1.15rem + brand 0.4rem + half-icon 0.75rem = 2.3rem icon centre). */
      padding: 1.4rem 1.75rem 3rem;
      position: relative;
    }
    .work-mode-toolbar {
      display: flex;
      justify-content: flex-end;
    }
    /* Deep work toggle + Add task: same baseline as the page heading. */
    .main-toolbar-cluster {
      position: absolute;
      top: 1.4rem;
      right: 1.75rem;
      margin: 0;
      z-index: 5;
      display: flex;
      align-items: center;
      gap: 0.65rem;
    }
    .work-mode-toolbar--main {
      margin: 0;
    }
    .main > .page-title {
      padding-right: 20rem;
    }
    .work-mode-toolbar--mobile {
      display: none;
    }
    button.subtle {
      border: 1px solid var(--border);
      background: color-mix(in srgb, var(--surface) 80%, transparent);
      color: var(--text);
      font-weight: 500;
      font: inherit;
      font-size: 0.85rem;
      padding: 0.45rem 0.75rem;
      border-radius: var(--radius-sm);
      cursor: pointer;
    }
    button.subtle:hover {
      background: color-mix(in srgb, var(--surface-tint) 55%, var(--surface));
      border-color: color-mix(in srgb, var(--green-deep) 22%, var(--border));
    }
    .add-manual-task-toggle {
      appearance: none;
      margin: 0;
      font: inherit;
      font-size: 0.8rem;
      font-weight: 600;
      padding: 0 0.7rem;
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      background: color-mix(in srgb, var(--surface-tint) 50%, var(--surface));
      color: var(--green-deep);
      cursor: pointer;
      line-height: 1.2;
      box-sizing: border-box;
      height: var(--toolbar-control-h);
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 0.35rem;
      text-decoration: none;
    }
    .add-manual-task-toggle:hover {
      background: color-mix(in srgb, var(--surface-highlight) 28%, var(--surface));
    }
    .add-manual-task-toggle:focus-visible {
      outline: 2px solid var(--anchor);
      outline-offset: 1px;
    }
    .add-manual-task-toggle-icon {
      flex-shrink: 0;
      display: block;
    }
    .add-manual-task-wrap {
      position: relative;
    }
    .mobile-header-toolbar {
      display: none;
    }
    .work-mode-form {
      margin: 0;
    }
    .work-mode-segmented {
      display: inline-flex;
      align-items: stretch;
      border-radius: var(--radius-sm);
      border: 1px solid var(--border);
      overflow: hidden;
      background: var(--surface);
      box-sizing: border-box;
      height: var(--toolbar-control-h);
    }
    .work-mode-btn {
      appearance: none;
      margin: 0;
      font: inherit;
      font-size: 0.8rem;
      font-weight: 600;
      padding: 0 0.7rem;
      border: none;
      border-radius: 0;
      background: color-mix(in srgb, var(--surface-tint) 50%, var(--surface));
      color: var(--green-deep);
      cursor: pointer;
      line-height: 1.2;
      box-sizing: border-box;
      flex: 1 1 auto;
      align-self: stretch;
      min-height: 0;
      display: inline-flex;
      align-items: center;
      justify-content: center;
    }
    .work-mode-btn + .work-mode-btn {
      border-left: 1px solid color-mix(in srgb, var(--green-deep) 28%, var(--border));
    }
    .work-mode-btn.is-active {
      background: var(--accent);
      color: var(--text-inverse);
    }
    .work-mode-btn:hover:not(.is-active) {
      background: color-mix(in srgb, var(--surface-highlight) 28%, var(--surface));
    }
    .work-mode-label--short {
      display: none;
    }
    /* Web chat — desktop: right hover rail */
    .chat-backdrop {
      display: none;
    }
    .chatbar {
      position: fixed;
      right: 0;
      top: 0;
      bottom: 0;
      z-index: 35;
      width: var(--chatbar-rail);
      background: var(--sidebar-bg);
      border-left: 1px solid var(--sidebar-border);
      overflow: hidden;
      transition: width 0.22s ease, box-shadow 0.22s ease;
      display: flex;
      flex-direction: column;
    }
    @media (min-width: 721px) {
      .chatbar:hover,
      .chatbar:focus-within {
        width: var(--chatbar-expanded);
        box-shadow: -6px 0 28px rgba(31, 77, 77, 0.1);
      }
      .chat-history,
      .chat-form {
        visibility: hidden;
        opacity: 0;
        transition: opacity 0.18s ease, visibility 0.18s ease;
      }
      .chatbar:hover .chat-history,
      .chatbar:hover .chat-form,
      .chatbar:focus-within .chat-history,
      .chatbar:focus-within .chat-form {
        visibility: visible;
        opacity: 1;
      }
      .chatbar-brand .brand-text {
        opacity: 0;
        transition: opacity 0.18s ease;
      }
      .chatbar:hover .chatbar-brand .brand-text,
      .chatbar:focus-within .chatbar-brand .brand-text {
        opacity: 1;
      }
    }
    .chatbar-inner {
      width: var(--chatbar-expanded);
      min-height: 100%;
      display: flex;
      flex-direction: column;
      padding: 1.15rem 0.85rem 1.1rem;
      min-width: 0;
    }
    .chatbar-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 0.5rem;
      margin-bottom: 1.35rem;
    }
    .chatbar-brand {
      display: flex;
      align-items: center;
      gap: 0.65rem;
      min-width: 0;
      padding: 0.4rem 0.5rem;
      margin: -0.4rem -0.5rem;
      border-radius: var(--radius-sm);
    }
    .chatbar-brand .sidebar-icon {
      flex-shrink: 0;
    }
    .chatbar-brand .brand-text {
      font-weight: 700;
      font-size: 1.05rem;
      letter-spacing: -0.03em;
      color: var(--anchor);
    }
    .chatbar-close-mobile {
      display: none;
    }
    .chat-history {
      flex: 1;
      min-height: 0;
      overflow-y: auto;
      margin: 0 -0.15rem 0.65rem 0;
      padding-right: 0.25rem;
      font-size: 0.875rem;
    }
    .chat-line {
      margin-bottom: 0.75rem;
      padding-bottom: 0.65rem;
      border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
    }
    .chat-line:last-child {
      border-bottom: none;
    }
    .chat-line-text {
      white-space: pre-wrap;
      word-break: break-word;
      color: var(--text);
    }
    .chat-line-meta {
      margin-top: 0.35rem;
      font-size: 0.8125rem;
      color: var(--text-soft);
    }
    .chat-outcome--ok { color: var(--green-deep); font-weight: 500; }
    .chat-outcome--err { color: #a34; }
    .chat-outcome--pending { font-style: italic; }
    .chat-form {
      display: flex;
      flex-direction: column;
      gap: 0.5rem;
      margin-top: auto;
    }
    .chat-form textarea {
      width: 100%;
      resize: vertical;
      min-height: 4rem;
      max-height: 10rem;
      padding: 0.5rem 0.6rem;
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      font: inherit;
      font-size: 0.875rem;
      background: var(--surface);
      color: var(--text);
    }
    .chat-send {
      align-self: flex-end;
      padding: 0.45rem 1rem;
      border-radius: var(--radius-sm);
      border: 1px solid color-mix(in srgb, var(--accent-hover) 35%, var(--accent));
      background: var(--accent);
      color: var(--text-inverse);
      font-weight: 600;
      font-size: 0.875rem;
      cursor: pointer;
    }
    .chat-send:hover {
      background: var(--accent-hover);
    }
    .chat-send:disabled {
      opacity: 0.55;
      cursor: not-allowed;
    }
    .visually-hidden {
      position: absolute;
      width: 1px;
      height: 1px;
      padding: 0;
      margin: -1px;
      overflow: hidden;
      clip: rect(0, 0, 0, 0);
      white-space: nowrap;
      border: 0;
    }
    .chatbar-expanded-wrap {
      flex: 1;
      min-height: 0;
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }
    .page-title {
      font-size: 1.2rem;
      font-weight: 600;
      letter-spacing: -0.025em;
      margin: 0 0 1.35rem;
      color: var(--anchor);
    }
    @media (prefers-reduced-motion: reduce) {
      .sidebar { transition: none; }
      body.nav-open .sidebar { transition: none; }
      .chatbar { transition: none; }
      .chatbar-expanded-wrap { transition: none; }
    }
    /* Flash toasts (success/info/debug) + inline alerts (error/warning) */
    .toast-region {
      position: fixed;
      top: max(1rem, env(safe-area-inset-top, 0px));
      left: 50%;
      transform: translateX(-50%);
      z-index: 170;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 0.5rem;
      max-width: min(22rem, calc(100vw - 2rem));
      pointer-events: none;
    }
    .toast-region .toast {
      pointer-events: auto;
    }
    .toast {
      display: flex;
      align-items: flex-start;
      gap: 0.5rem;
      padding: 0.65rem 0.75rem;
      border-radius: var(--radius-sm);
      border: 1px solid var(--border);
      background: var(--surface);
      box-shadow: var(--shadow);
      font-size: 0.9rem;
      line-height: 1.45;
      color: var(--text);
      outline: none;
    }
    .toast:focus-visible {
      box-shadow: var(--shadow), 0 0 0 2px color-mix(in srgb, var(--accent) 55%, transparent);
    }
    .toast--success {
      border-color: color-mix(in srgb, var(--green-deep) 28%, var(--border));
      background: color-mix(in srgb, var(--surface-highlight) 28%, var(--surface));
    }
    .toast--info {
      border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
      background: color-mix(in srgb, var(--surface-tint) 45%, var(--surface));
    }
    .toast--debug {
      border-color: var(--border);
      background: color-mix(in srgb, var(--surface-tint) 30%, var(--surface));
    }
    .toast__msg {
      flex: 1;
      min-width: 0;
    }
    .toast__close {
      flex-shrink: 0;
      margin: -0.15rem -0.1rem -0.15rem 0;
      padding: 0.1rem 0.35rem;
      border: none;
      border-radius: var(--radius-sm);
      background: transparent;
      color: var(--text-soft);
      font: inherit;
      font-size: 1.15rem;
      line-height: 1;
      cursor: pointer;
    }
    .toast__close:hover {
      color: var(--text);
      background: color-mix(in srgb, var(--surface-tint) 40%, var(--surface));
    }
    .toast--leaving {
      opacity: 0;
      transition: opacity 0.22s ease;
    }
    @media (prefers-reduced-motion: reduce) {
      .toast--leaving {
        transition: none;
      }
    }
    .alerts {
      list-style: none;
      margin: 0 0 1rem;
      padding: 0;
    }
    .alerts__item {
      display: flex;
      align-items: flex-start;
      gap: 0.5rem;
      padding: 0.65rem 0.85rem;
      margin: 0 0 0.5rem;
      border-radius: var(--radius-sm);
      border: 1px solid var(--border);
      font-size: 0.92rem;
      line-height: 1.45;
    }
    .alerts__item:last-child {
      margin-bottom: 0;
    }
    .alerts__item--error {
      border-color: color-mix(in srgb, #a34 35%, var(--border));
      background: color-mix(in srgb, #fde8e6 55%, var(--surface));
      color: var(--text);
    }
    .alerts__item--warning {
      border-color: color-mix(in srgb, #b86 40%, var(--border));
      background: color-mix(in srgb, #fff4e0 70%, var(--surface));
      color: var(--text);
    }
    .alerts__text {
      flex: 1;
      min-width: 0;
    }
    .alerts__close {
      flex-shrink: 0;
      margin: -0.1rem -0.15rem -0.1rem 0;
      padding: 0.15rem 0.4rem;
      border: none;
      border-radius: var(--radius-sm);
      background: transparent;
      color: var(--text-soft);
      font: inherit;
      font-size: 1.1rem;
      line-height: 1;
      cursor: pointer;
    }
    .alerts__close:hover {
      color: var(--text);
      background: color-mix(in srgb, var(--surface-tint) 35%, var(--surface));
    }
    .global-ingest-alert {
      display: flex;
      align-items: flex-start;
      gap: 0.5rem;
      margin: 0 0 1rem;
      padding: 0.65rem 0.85rem;
      border-radius: var(--radius-sm);
      border: 1px solid color-mix(in srgb, #a34 35%, var(--border));
      background: color-mix(in srgb, #fde8e6 55%, var(--surface));
      color: var(--text);
      font-size: 0.92rem;
      line-height: 1.45;
    }
    /* Reserve space so the alert doesn't slide under the absolutely-positioned
       Add task / Deep work / Task clearing buttons. Mirrors .page-title spacing. */
    .main > .global-ingest-alert {
      margin-right: 20rem;
    }
    @media (max-width: 720px) {
      .mobile-header {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 200;
        min-height: var(--mobile-header-h);
        padding: 0.5rem 0.75rem;
        padding-top: max(0.5rem, env(safe-area-inset-top));
        padding-left: max(0.75rem, env(safe-area-inset-left));
        padding-right: max(0.75rem, env(safe-area-inset-right));
        background: var(--surface);
        border-bottom: 1px solid var(--border);
        box-shadow: 0 1px 0 rgba(31, 77, 77, 0.04);
      }
      .toast-region {
        top: calc(var(--mobile-header-h) + env(safe-area-inset-top, 0px) + 1rem);
      }
      .menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 2.5rem;
        height: 2.5rem;
        padding: 0;
        border: 1px solid var(--border);
        border-radius: var(--radius-sm);
        background: color-mix(in srgb, var(--surface-tint) 50%, var(--surface));
        color: var(--anchor);
        cursor: pointer;
        transition: background 0.15s ease, border-color 0.15s ease;
      }
      .menu-toggle:hover {
        background: var(--surface-tint);
        border-color: color-mix(in srgb, var(--green-deep) 18%, var(--border));
      }
      .menu-toggle svg {
        width: 1.35rem;
        height: 1.35rem;
      }
      .mobile-header-title {
        display: none;
      }
      .nav-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 150;
        background: rgba(31, 45, 42, 0.42);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 0.22s ease, visibility 0.22s ease;
      }
      body.nav-open .nav-backdrop {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
      }
      .sidebar {
        z-index: 160;
        top: calc(var(--mobile-header-h) + env(safe-area-inset-top, 0px));
        bottom: 0;
        width: min(17.5rem, 86vw);
        max-width: 100%;
        height: auto;
        border-right: 1px solid var(--sidebar-border);
        border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
        box-shadow: var(--shadow-drawer);
        transform: translateX(-100%);
        transition: transform 0.24s ease, box-shadow 0.24s ease;
      }
      body.nav-open .sidebar {
        transform: translateX(0);
      }
      .sidebar-inner {
        min-height: 100%;
        padding: 1.15rem 0.85rem max(1.1rem, env(safe-area-inset-bottom));
      }
      .main {
        margin-left: 0;
        margin-right: 0;
        padding-top: calc(var(--mobile-header-h) + max(1rem, env(safe-area-inset-top)) + 0.35rem);
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
        padding-bottom: 2.5rem;
      }
      .chat-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 154;
        background: rgba(31, 45, 42, 0.42);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 0.22s ease, visibility 0.22s ease;
      }
      body.chat-open .chat-backdrop {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
      }
      .chatbar {
        z-index: 160;
        top: auto;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        max-width: 100%;
        height: auto;
        max-height: min(80vh, 36rem);
        flex-direction: column;
        border-left: none;
        border-top: 1px solid var(--sidebar-border);
        border-radius: var(--radius-sm) var(--radius-sm) 0 0;
        box-shadow: var(--shadow-drawer);
        transform: translateY(100%);
        transition: transform 0.24s ease, box-shadow 0.24s ease;
      }
      body.chat-open .chatbar {
        transform: translateY(0);
      }
      .chatbar:hover,
      .chatbar:focus-within {
        width: 100%;
        box-shadow: var(--shadow-drawer);
      }
      .chatbar-expanded-wrap {
        flex: 1;
        min-height: 0;
        max-height: none;
        overflow: hidden;
      }
      .chatbar-inner {
        width: 100%;
        padding-bottom: max(1.1rem, env(safe-area-inset-bottom));
        min-height: 12rem;
      }
      .chatbar-close-mobile {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 2rem;
        height: 2rem;
        padding: 0;
        border: 1px solid var(--border);
        border-radius: var(--radius-sm);
        background: var(--surface);
        color: var(--anchor);
        font-size: 1.25rem;
        line-height: 1;
        cursor: pointer;
      }
      .mobile-header {
        justify-content: space-between;
        flex-wrap: nowrap;
        gap: 0.5rem;
      }
      .work-mode-toolbar--main,
      .main-toolbar-cluster {
        display: none;
      }
      .main > .page-title {
        padding-right: 0;
      }
      .main > .global-ingest-alert {
        margin-right: 0;
      }
      .mobile-header-toolbar {
        display: flex;
        flex: 1;
        min-width: 0;
        justify-content: space-between;
        align-items: center;
        gap: 0.45rem;
        flex-wrap: nowrap;
        margin-bottom: 0;
      }
      .work-mode-toolbar--mobile {
        display: flex;
        margin: 0;
        flex-shrink: 0;
      }
      .work-mode-toolbar--mobile .work-mode-btn {
        font-size: 0.72rem;
        padding: 0 0.45rem;
      }
      .mobile-header-toolbar .add-manual-task-toggle {
        font-size: 0.72rem;
        padding: 0 0.45rem;
        gap: 0.28rem;
      }
      .mobile-header-toolbar .add-manual-task-toggle-icon {
        width: 12px;
        height: 12px;
      }
      .work-mode-label--full {
        display: none;
      }
      .work-mode-label--short {
        display: inline;
      }
      .chat-toggle-header {
        flex-shrink: 0;
        margin-left: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.4rem;
        padding: 0.35rem 0.65rem;
        border: 1px solid var(--border);
        border-radius: var(--radius-sm);
        background: color-mix(in srgb, var(--surface-tint) 50%, var(--surface));
        color: var(--anchor);
        font: inherit;
        font-weight: 600;
        font-size: 0.85rem;
        cursor: pointer;
      }
    }

    /* Task priority / effort level colors (dashboard, task list, recurring) */
    .task-priority-level-1,
    .task-effort-level-1 {
      color: #2e7d4a;
    }
    .task-priority-level-2,
    .task-effort-level-2 {
      color: #4a9a6a;
    }
    .task-priority-level-3,
    .task-effort-level-3 {
      color: #8a7a2e;
    }
    .task-priority-level-4,
    .task-effort-level-4 {
      color: #c75a28;
    }
    .task-priority-level-5,
    .task-effort-level-5 {
      color: #b32d2d;
    }

    /* Icon buttons (dashboard detail, task list, recurring list, etc.) */
    .icon-button {
      appearance: none;
      background: transparent;
      border: none;
      padding: 0.15rem;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      color: var(--text-soft);
      cursor: pointer;
      opacity: 0.48;
      border-radius: var(--radius-sm);
      flex-shrink: 0;
      transition: opacity 120ms ease, background-color 120ms ease;
    }
    .icon-button svg {
      width: 0.95rem;
      height: 0.95rem;
    }
    .icon-button:hover:not(:disabled),
    .icon-button:focus-visible:not(:disabled) {
      opacity: 0.95;
      background: color-mix(in srgb, var(--surface-highlight) 40%, transparent);
    }
    .icon-button--edit:hover:not(:disabled),
    .icon-button--edit:focus-visible:not(:disabled) {
      background: color-mix(in srgb, var(--accent) 20%, transparent);
      color: color-mix(in srgb, var(--anchor) 88%, var(--text-soft));
    }
    .icon-button--done:hover:not(:disabled),
    .icon-button--done:focus-visible:not(:disabled) {
      background: color-mix(in srgb, var(--green-deep) 22%, transparent);
      color: var(--green-deep);
    }
    .icon-button--danger:hover:not(:disabled),
    .icon-button--danger:focus-visible:not(:disabled) {
      background: color-mix(in srgb, #c33 22%, transparent);
      color: #a22;
    }
    .icon-button:focus-visible {
      outline: 2px solid var(--anchor);
      outline-offset: 1px;
    }
    .icon-button--done:focus-visible {
      outline-color: color-mix(in srgb, var(--green-deep) 80%, var(--anchor));
    }
    .icon-button--danger:focus-visible {
      outline-color: #c44;
    }
    .task-list-row-actions .icon-button,
    .recurring-actions .icon-button {
      line-height: 0;
    }

    /* Empty queue "caught up" + same-day ping opt-in (current task + dashboard) */
    .empty-queue-caught-up-lead {
      margin: 0 0 0.65rem;
      font-size: 1.02rem;
      line-height: 1.6;
      color: var(--text-soft);
    }
    .empty-queue-notify-form {
      margin-top: 1rem;
    }
    .empty-queue-notify-submit {
      appearance: none;
      margin: 0;
      cursor: pointer;
      font: inherit;
      font-size: 0.9rem;
      font-weight: 500;
      padding: 0.58rem 1.15rem;
      border-radius: var(--radius-sm);
      background: var(--accent);
      color: var(--text-inverse);
      border: 1px solid color-mix(in srgb, var(--accent-hover) 35%, var(--accent));
      transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    }
    .empty-queue-notify-submit:hover {
      background: var(--accent-hover);
      border-color: var(--accent-hover);
    }
    .empty-queue-notify-submit:focus-visible {
      outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent);
      outline-offset: 2px;
    }
    .empty-queue-notify-status {
      margin-top: 1rem !important;
      font-size: 0.92rem !important;
      color: var(--text-soft);
    }
