/* TaskDay Figma shell — desktop Today / Others / hide Canva aside */

@media (min-width: 1025px) {
  body {
    background: var(--bg-app);
  }

  /* Sidebar: Figma 240px (override any legacy 88px) */
  .app-sidebar {
    width: var(--sidebar-w, 240px) !important;
    min-width: var(--sidebar-w, 240px) !important;
  }
  .app-side-btn {
    flex-direction: row !important;
    justify-content: flex-start !important;
    min-height: 40px !important;
    padding: 10px 16px !important;
    font-size: 13px !important;
  }
  .app-side-btn span {
    display: inline !important;
    max-width: none !important;
  }

  /* Old desktop chrome — fully off; nav/actions live in Figma shell */
  .app-shell .topbar-shell,
  .app-shell .topbar {
    display: none !important;
  }
  .day-load-banner,
  .day-load-banner.show {
    display: none !important;
  }
  .mobile-board-tabs,
  #mobileBoardTabs {
    display: none !important;
  }
  .nav-safe-fill {
    display: none !important;
  }
  #colToday .empty-slot-box,
  #colToday .empty-slot-pill,
  #colToday .slot-row .empty-slot-box,
  #colToday .empty-guide,
  #colToday .tc-empty {
    display: none !important;
  }
  #colToday > .completed-bar,
  #colToday > .done-summary-bar {
    display: none !important;
  }
  #colToday > .column-header,
  #colOther > .column-header {
    display: none !important;
  }
  /* AI FAB на desktop прячем — Дейли из sidebar */
  .ai-bot-root,
  .ai-bot-fab,
  .ai-bot-tip {
    display: none !important;
  }
  body.ai-bot-chat-open:not(.td-daily-page-open) .ai-bot-chat-overlay {
    display: flex !important;
  }
  body.td-daily-page-open .ai-bot-chat-overlay {
    display: none !important;
  }

  /* Единая колонка контента как в Figma (~1440 − sidebar 240).
     Скролл — у .app-main; workspace не режет высоту (layout.css иначе overflow:hidden). */
  .workspace {
    width: 100%;
    max-width: 1160px;
    margin: 0 auto;
    padding: 20px 28px 48px;
    box-sizing: border-box;
    flex: 0 0 auto;
    min-height: auto;
    overflow: visible;
  }

  #boardGrid.board-grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) var(--aside-w, 286px) !important;
    grid-template-areas: none !important;
    gap: 20px !important;
    align-items: start !important;
  }

  /* Hide legacy Canva aside styles if any leftover */
  .canva-aside:not(.td-today-rail) {
    display: none !important;
  }

  .td-today-rail {
    display: flex !important;
    flex-direction: column;
    gap: 16px;
    position: sticky;
    top: 16px;
    align-self: start;
  }

  body[data-desktop-nav="tasks"] #boardGrid.board-grid,
  body[data-desktop-nav="focus"] #boardGrid.board-grid,
  body[data-desktop-nav="daily"] #boardGrid.board-grid,
  body[data-desktop-nav="settings"] #boardGrid.board-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  body[data-desktop-nav="tasks"] .td-today-rail,
  body[data-desktop-nav="focus"] .td-today-rail,
  body[data-desktop-nav="daily"] .td-today-rail,
  body[data-desktop-nav="settings"] .td-today-rail {
    display: none !important;
  }

  body[data-desktop-nav="tasks"] #colToday,
  body:not([data-desktop-nav="tasks"]) #colOther {
    display: none !important;
  }
  body[data-desktop-nav="tasks"] #colOther {
    display: flex !important;
  }
  body:not([data-desktop-nav="tasks"]) #colToday {
    display: flex !important;
  }

  #colToday.column-panel,
  #colOther.column-panel {
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0 0 8px;
    min-height: 0;
    overflow: visible;
  }

  /* —— Today hero —— */
  .td-today-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin: 8px 0 18px;
  }
  .td-today-hero h1 {
    margin: 0;
    font-size: 30px;
    font-weight: 600;
    letter-spacing: -0.03em;
    color: var(--text-secondary);
    line-height: 1.15;
  }
  .td-today-hero p {
    margin: 10px 0 0;
    font-size: 14px;
    color: var(--text-soft);
  }
  .td-realm-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #fff;
    border: 1px solid var(--border-subtle);
    border-radius: 19px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
  }
  .td-realm-badge .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
  }
  body.realm-life .td-realm-badge .dot {
    background: var(--life);
  }

  .td-date-chip {
    display: inline-flex;
    align-items: center;
    margin: 0 0 14px;
    padding: 8px 12px;
    background: var(--accent-soft);
    border-radius: 8px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--accent);
  }

  .td-main-focus {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    background: #fff;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    margin-bottom: 28px;
    min-height: 120px;
    box-sizing: border-box;
  }
  .td-main-focus-copy {
    min-width: 0;
  }
  .td-main-focus-label {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
  }
  .td-main-focus-hint {
    margin: 8px 0 0;
    font-size: 12px;
    color: var(--text-soft);
  }
  .td-main-focus-title {
    margin: 18px 0 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-secondary);
    line-height: 1.25;
  }
  .td-main-focus-title.is-empty {
    color: var(--text-muted);
    font-size: 15px;
    font-weight: 500;
  }
  .td-main-focus-go {
    flex-shrink: 0;
    height: 42px;
    padding: 0 18px;
    border-radius: 10px;
    border: 0;
    background: var(--accent);
    color: #fff;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
  }
  .td-main-focus-go:hover {
    background: var(--accent-hover);
  }
  .td-main-focus-go:disabled {
    opacity: 0.45;
    cursor: default;
  }

  .td-plan-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 14px;
  }
  .td-plan-head h2 {
    margin: 0;
    font-size: 19px;
    font-weight: 600;
    color: var(--text-secondary);
  }
  .td-plan-head a,
  .td-plan-head button {
    border: 0;
    background: none;
    color: var(--accent);
    font: inherit;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
    padding: 0;
  }

  /* Soften old today column chrome */
  #colToday > .column-header {
    display: none;
  }
  #colToday .tc-sec-head,
  #colToday .section-label-row.tc-sec-head {
    display: none;
  }
  #colToday .section-block {
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
  }
  #colToday #mainSlotsList,
  #colToday #quickSlotsList,
  #colToday #lifeTodayList {
    display: flex;
    flex-direction: column;
    gap: 14px;
  }
  #colToday #workTodaySections,
  #colToday #lifeTodaySection {
    display: contents;
  }
  #colToday > .completed-bar,
  #colToday > .done-summary-bar {
    margin-top: 20px;
    background: transparent;
    border: 0;
    padding: 8px 0 0;
  }

  /* Empty today — Figma card style (no dashed box) */
  #colToday.is-today-empty .td-plan-head {
    margin-bottom: 14px;
  }
  #colToday .today-empty-hero.td-today-empty,
  #colToday.is-today-empty .today-empty-hero:not([hidden]) {
    display: block !important;
    align-items: stretch;
    justify-content: flex-start;
    text-align: left;
    gap: 0;
    padding: 0;
    min-height: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
  }
  #colToday .td-today-empty-card {
    background: #fff;
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 28px 24px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    min-height: 160px;
  }
  #colToday .td-today-empty .today-empty-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: -0.02em;
    line-height: 1.3;
  }
  #colToday .td-today-empty .today-empty-hint {
    margin: 0;
    max-width: 28em;
    font-size: 13px;
    font-weight: 400;
    color: var(--text-soft);
    line-height: 1.45;
  }
  #colToday .td-today-empty .today-empty-actions {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: none;
    margin-top: 10px;
  }
  #colToday .td-empty-btn {
    height: 42px;
    padding: 0 18px;
    border-radius: 10px;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    box-sizing: border-box;
  }
  #colToday .td-empty-btn.is-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
  }
  #colToday .td-empty-btn.is-primary:hover {
    background: var(--accent-hover);
  }
  #colToday .td-empty-btn.is-ghost {
    background: #fff;
    border-color: var(--border-subtle);
    color: var(--text-primary);
  }
  #colToday .td-empty-btn.is-ghost:hover {
    background: var(--bg-subtle);
  }

  /* Figma Today plan cards — компактнее, ⋯ без рамки */
  #colToday .tc-list.td-figma-plan {
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-top: 0 !important;
    border-bottom: 0 !important;
    background: transparent;
    padding: 0;
    margin: 0;
  }
  #colToday #mainSlotsList,
  #colToday #quickSlotsList,
  #colToday #lifeTodayList {
    gap: 10px;
  }
  /* Сброс старых list/planner правил: линия над списком и обрезанный низ последней */
  body.view-list #colToday .tc-list.td-figma-plan,
  body.view-cards #colToday .tc-list.td-figma-plan,
  body.view-planner #colToday .tc-list.td-figma-plan,
  #boardGrid #colToday .tc-list.td-figma-plan {
    border-top: 0 !important;
    border-bottom: 0 !important;
  }
  #boardGrid #colToday .tc-list.td-figma-plan > .tcard:last-child,
  #boardGrid #colToday .tc-list.td-figma-plan > :last-child,
  #colToday .tc-list.td-figma-plan > .tcard.is-figma-today:last-child {
    border-bottom: 1px solid var(--border-subtle) !important;
  }
  #colToday .tcard.is-figma-today,
  #colToday .tcard.is-figma-today:hover,
  #colToday .tcard.is-figma-today.is-selected,
  #colToday .tcard.is-figma-today.is-expanded,
  #colToday .tcard.is-figma-today.is-collapsed,
  #boardGrid #colToday .tcard.is-figma-today,
  #boardGrid #colToday .tcard.is-figma-today:hover,
  #boardGrid #colToday .tcard.is-figma-today.is-selected,
  #boardGrid #colToday .tcard.is-figma-today.is-expanded,
  body.view-list #boardGrid #colToday .tcard.is-figma-today,
  body.view-cards #boardGrid #colToday .tcard.is-figma-today,
  body.view-planner #boardGrid #colToday .tcard.is-figma-today {
    background: #fff !important;
    border: 1px solid var(--border-subtle) !important;
    border-radius: 12px !important;
    box-shadow: none !important;
    min-height: 0;
    padding: 0 !important;
    margin: 0;
    overflow: visible;
  }
  #colToday .tcard.is-figma-today.in-work-card,
  #boardGrid #colToday .tcard.is-figma-today.in-work-card {
    background: #fff !important;
    box-shadow: inset 3px 0 0 var(--accent) !important;
  }
  #colToday .tcard.is-figma-today .tc-row {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 56px;
    padding: 10px 14px;
    box-sizing: border-box;
  }
  #colToday .tcard.is-figma-today .tc-check {
    width: 20px;
    height: 20px;
    min-width: 20px;
    border-radius: 6px;
    border: 1.5px solid #ccd6e5;
    background: #fff;
    color: transparent;
    display: grid;
    place-items: center;
    padding: 0;
    flex-shrink: 0;
    box-shadow: none;
  }
  #colToday .tcard.is-figma-today .tc-check:hover {
    background: #fff !important;
    border-color: var(--accent) !important;
    color: transparent !important;
  }
  #colToday .tcard.is-figma-today .tc-check svg {
    width: 11px;
    height: 11px;
    opacity: 0;
  }
  #colToday .tcard.is-figma-today.is-done .tc-check {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
  }
  #colToday .tcard.is-figma-today.is-done .tc-check:hover {
    background: var(--accent-hover) !important;
    border-color: var(--accent-hover) !important;
    color: #fff !important;
  }
  #colToday .tcard.is-figma-today.is-done .tc-check svg {
    opacity: 1;
  }
  #colToday .tcard.is-figma-today .tc-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
  }
  #colToday .tcard.is-figma-today .tc-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    line-height: 1.25;
    margin: 0;
  }
  #colToday .tcard.is-figma-today.is-done .tc-title {
    text-decoration: none;
    color: var(--text-secondary);
    opacity: 0.72;
  }
  #colToday .tcard.is-figma-today .tc-meta {
    font-size: 11px;
    font-weight: 400;
    color: var(--text-soft);
    line-height: 1.2;
    gap: 0;
  }
  #colToday .tcard.is-figma-today .tc-meta .tc-sep {
    margin: 0 0.35em;
    opacity: 1;
  }
  #colToday .tcard.is-figma-today .tc-more {
    width: auto;
    min-width: 28px;
    height: 28px;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #8b97a8;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.08em;
    line-height: 1;
    padding: 0 4px;
    cursor: pointer;
    flex-shrink: 0;
    border-radius: 0;
    display: grid;
    place-items: center;
  }
  #colToday .tcard.is-figma-today .tc-more:hover,
  #colToday .tcard.is-figma-today .tc-more:focus-visible,
  #colToday .tcard.is-figma-today .tc-more[aria-expanded="true"] {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    color: var(--accent) !important;
  }

  /* Task ⋯ menu — Figma «Состояние 1 · Меню задачи открыто» */
  .td-task-menu {
    position: fixed;
    z-index: 2400;
    width: min(300px, calc(100vw - 16px));
    background: #fff;
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12), 0 2px 8px rgba(15, 23, 42, 0.06);
    padding: 6px;
    box-sizing: border-box;
  }
  .td-task-menu[hidden] {
    display: none !important;
  }
  .td-task-menu-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    border-radius: 10px;
    padding: 10px 12px;
    cursor: pointer;
    font: inherit;
    color: var(--text-primary);
  }
  .td-task-menu-item + .td-task-menu-item {
    border-top: 1px solid var(--border-subtle);
    border-radius: 0;
    margin-top: 0;
  }
  .td-task-menu-item:hover {
    background: var(--bg-subtle);
  }
  .td-task-menu-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    line-height: 1.25;
  }
  .td-task-menu-sub {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-soft);
    line-height: 1.3;
  }
  .td-task-menu-item.is-danger .td-task-menu-label {
    color: #c73838;
  }
  .td-task-menu-item[hidden] {
    display: none !important;
  }

  /* Редактирование задачи на desktop (views.css прячет шторку) */
  .task-sheet-overlay.active {
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.35);
    backdrop-filter: blur(4px);
    z-index: 2300;
  }
  .task-sheet-overlay.active .task-sheet {
    width: min(520px, calc(100vw - 48px));
    max-height: min(820px, calc(100vh - 48px));
    border-radius: 16px;
    border: 1px solid var(--border-subtle);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
    transform: none !important;
  }
  .task-sheet-overlay.active .task-sheet-grab {
    display: none;
  }

  .task-schedule-pop.open {
    z-index: 2500;
  }

  /* —— Today task detail (Figma Состояние 4) —— */
  body.td-today-detail-open .td-today-hero,
  body.td-today-detail-open .td-date-chip,
  body.td-today-detail-open .td-main-focus,
  body.td-today-detail-open .td-plan-head,
  body.td-today-detail-open #workTodaySections,
  body.td-today-detail-open #lifeTodaySection,
  body.td-today-detail-open .today-empty-hero,
  body.td-today-detail-open .td-today-rail {
    display: none !important;
  }
  body.td-today-detail-open #boardGrid.board-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  .td-today-detail[hidden] { display: none !important; }
  body.td-today-detail-open .td-today-detail:not([hidden]) {
    display: block;
  }
  .td-detail-back {
    display: inline-flex;
    align-items: center;
    height: 36px;
    padding: 0 12px;
    margin: 0 0 16px;
    border-radius: 9px;
    border: 1px solid var(--border-subtle);
    background: #fff;
    color: var(--accent);
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
  }
  .td-detail-back:hover { background: var(--accent-soft); }
  .td-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.85fr);
    gap: 20px;
    align-items: start;
  }
  .td-detail-main,
  .td-detail-card {
    background: #fff;
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    box-sizing: border-box;
  }
  .td-detail-main { padding: 22px 24px 24px; }
  .td-detail-kicker {
    margin: 0;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent);
  }
  .td-detail-title {
    margin: 10px 0 0;
    font-size: 25px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: -0.03em;
    line-height: 1.2;
    cursor: text;
    border-radius: 8px;
    padding: 2px 4px;
    margin-left: -4px;
  }
  .td-detail-title:hover {
    background: var(--accent-soft);
  }
  .td-detail-main .task-title-edit,
  #tdTodayDetailHost .task-title-edit,
  #boardGrid #tdTodayDetailHost .task-title-edit,
  body.view-list #boardGrid #tdTodayDetailHost .task-title-edit,
  body.view-cards #boardGrid #tdTodayDetailHost .task-title-edit,
  body.view-planner #boardGrid #tdTodayDetailHost .task-title-edit {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    height: auto !important;
    margin: 10px 0 0 !important;
    font-family: inherit !important;
    font-size: 25px !important;
    font-weight: 600 !important;
    color: var(--text-secondary) !important;
    letter-spacing: -0.03em !important;
    line-height: 1.2 !important;
    border: 1px solid var(--accent) !important;
    border-radius: 8px !important;
    padding: 6px 10px !important;
    background: #fff !important;
    box-sizing: border-box !important;
    box-shadow: 0 0 0 3px var(--accent-soft) !important;
  }
  .td-detail-sec-label {
    margin: 22px 0 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
  }
  .td-detail-desc {
    margin: 8px 0 0;
    font-size: 13px;
    color: var(--text-soft);
    line-height: 1.45;
    cursor: text;
    border-radius: 8px;
    padding: 4px 0;
    width: 100%;
    box-sizing: border-box;
  }
  .td-detail-desc.is-empty { font-style: italic; opacity: 0.85; }
  /* Описание на всю ширину карточки (перекрываем max-width: 68ch из tasks-view) */
  #tdTodayDetailHost .ti-desc-edit,
  .td-detail-main .ti-desc-edit,
  #boardGrid #tdTodayDetailHost .ti-desc-edit,
  .td-detail-desc-edit {
    display: block;
    width: 100% !important;
    max-width: none !important;
    box-sizing: border-box;
    margin: 8px 0 0;
    min-height: 96px;
    resize: vertical;
    font-family: inherit !important;
    font-size: 13px !important;
    font-weight: 400 !important;
    font-style: normal !important;
    line-height: 1.45 !important;
    letter-spacing: normal !important;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--accent);
    background: #fff;
    color: var(--text-soft) !important;
    outline: none;
    box-shadow: 0 0 0 3px var(--accent-soft);
    -webkit-text-size-adjust: 100%;
  }
  .td-detail-divider {
    height: 1px;
    background: var(--border-subtle);
    margin: 18px 0;
  }
  .td-detail-steps-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
  }
  .td-detail-steps-head h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    color: var(--text-secondary);
  }
  .td-detail-steps-head span {
    font-size: 11px;
    color: var(--text-soft);
  }
  .td-detail-progress {
    margin-top: 10px;
    height: 6px;
    border-radius: 3px;
    background: var(--accent-soft);
    overflow: hidden;
  }
  .td-detail-progress i {
    display: block;
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
  }
  .td-detail-steps {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 14px;
  }
  .td-detail-steps-empty {
    margin: 12px 0 0;
    font-size: 13px;
    color: var(--text-soft);
  }
  .td-detail-step {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 6px 8px 6px 10px;
    border-radius: 8px;
    border: 1px solid #e8f0ff;
    background: #fbfcff;
  }
  .td-detail-step-main {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
    cursor: pointer;
  }
  .td-detail-step-cb {
    position: absolute;
    opacity: 0;
    pointer-events: none;
  }
  .td-detail-step-box {
    width: 20px;
    height: 20px;
    border-radius: 10px;
    border: 1.5px solid #c7d1e0;
    background: #fff;
    flex-shrink: 0;
    display: grid;
    place-items: center;
  }
  .td-detail-step-box::after {
    content: "✓";
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    opacity: 0;
  }
  .td-detail-step-cb:checked + .td-detail-step-box {
    background: var(--accent);
    border-color: var(--accent);
  }
  .td-detail-step-cb:checked + .td-detail-step-box::after { opacity: 1; }
  .td-detail-step-t {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    min-width: 0;
  }
  .td-detail-step.is-done .td-detail-step-t {
    color: var(--text-soft);
    text-decoration: line-through;
  }
  .td-detail-step-del {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text-soft);
    font-size: 16px;
    font-weight: 500;
    line-height: 1;
    padding: 0;
    margin: 0;
    cursor: pointer;
    opacity: 0.55;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .td-detail-step:hover .td-detail-step-del {
    opacity: 1;
  }
  .td-detail-step-del:hover,
  .td-detail-step-del:focus-visible {
    background: var(--danger-soft, #fee2e2) !important;
    color: var(--danger, #c73838) !important;
    border: 0 !important;
    opacity: 1;
  }
  .td-detail-add-step {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    flex-wrap: wrap;
  }
  .td-detail-add-step input {
    flex: 1;
    min-width: 160px;
    height: 40px;
    border-radius: 9px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-subtle);
    padding: 0 12px;
    font: inherit;
    font-size: 13px;
  }
  .td-detail-add-btn {
    height: 40px;
    padding: 0 14px;
    border-radius: 9px;
    border: 0;
    background: var(--accent-soft);
    color: var(--accent);
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
  }
  .td-detail-side {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }
  .td-detail-card { padding: 18px 19px 20px; }
  .td-detail-card h3 {
    margin: 0 0 14px;
    font-size: 17px;
    font-weight: 600;
    color: var(--text-secondary);
  }
  .td-detail-kv {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 12px;
    font-size: 12px;
  }
  .td-detail-kv span { color: var(--text-soft); }
  .td-detail-kv strong { color: var(--text-secondary); font-weight: 600; }
  .td-detail-kv strong.is-accent { color: var(--accent); }
  .td-detail-kv-btn {
    border: 0;
    background: transparent;
    padding: 0;
    margin: 0;
    font: inherit;
    font-size: inherit;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    text-align: right;
  }
  .td-detail-kv-btn:hover {
    color: var(--accent) !important;
    background: transparent !important;
    border: 0 !important;
  }
  .td-detail-saved {
    margin: 14px 0 0;
    padding: 8px 10px;
    border-radius: 9px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.18s ease, transform 0.18s ease;
  }
  .td-detail-saved.is-on {
    opacity: 1;
    transform: none;
  }
  .td-detail-workspace {
    background: var(--bg-app, #f6f8fb) !important;
    border-radius: 18px !important;
  }
  .td-detail-ws-sub {
    margin: -6px 0 14px;
    font-size: 12px;
    color: var(--text-soft);
  }
  .td-detail-status-card {
    background: #fff;
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 12px 14px 14px;
    margin-bottom: 12px;
  }
  .td-detail-mini-label {
    margin: 0 0 8px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-soft);
  }
  .td-detail-status-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 0;
  }
  .td-detail-workspace .td-detail-focus-row,
  .td-detail-workspace .td-detail-daily {
    background: #fff;
  }
  .td-detail-chip {
    height: 24px;
    padding: 0 10px;
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
    background: #fff;
    font: inherit;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
  }
  .td-detail-chip.is-on {
    background: var(--accent-soft);
    border-color: var(--accent-soft);
    color: var(--accent);
  }
  .td-detail-chip.is-muted { background: var(--bg-subtle); }
  .td-detail-focus-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    margin-bottom: 12px;
  }
  .td-detail-focus-ico {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--life-soft);
    color: var(--life);
    display: grid;
    place-items: center;
    font-size: 18px;
    flex-shrink: 0;
  }
  .td-detail-focus-copy {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
  }
  .td-detail-focus-copy strong {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
  }
  .td-detail-focus-copy span {
    font-size: 12px;
    color: var(--text-soft);
  }
  .td-detail-focus-go {
    height: 34px;
    padding: 0 12px;
    border: 0;
    border-radius: 10px;
    background: var(--accent);
    color: #fff;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
  }
  .td-detail-focus-go:hover,
  .td-detail-focus-go:focus-visible {
    background: var(--accent-hover) !important;
    border-color: var(--accent-hover) !important;
    color: #fff !important;
  }
  .td-detail-daily {
    padding: 12px;
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
  }
  .td-detail-daily strong {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
  }
  .td-detail-daily p {
    margin: 6px 0 10px;
    font-size: 12px;
    color: var(--text-soft);
  }
  .td-main-focus-title:not(.is-empty) {
    cursor: pointer;
  }
  .td-main-focus-title:not(.is-empty):hover {
    color: var(--accent);
  }

  /* Dialogs: postpone / reschedule (Состояния 5–6) */
  .td-dialog-overlay {
    position: fixed;
    inset: 0;
    z-index: 2600;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.28);
    backdrop-filter: blur(3px);
  }
  .td-dialog-overlay[hidden] { display: none !important; }
  .td-dialog {
    width: min(512px, calc(100vw - 48px));
    background: #fff;
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.16);
    padding: 24px 24px 20px;
  }
  .td-dialog h3 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
  }
  .td-dialog-sub {
    margin: 6px 0 0;
    font-size: 14px;
    color: var(--text-soft);
    line-height: 1.4;
  }
  .td-dialog-opts {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 18px 0 20px;
  }
  .td-dialog-opt {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    width: 100%;
    text-align: left;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid transparent;
    background: var(--bg-subtle, #f3f5f8);
    cursor: pointer;
    color: var(--text-secondary);
  }
  .td-dialog-opt strong {
    font-size: 14px;
    font-weight: 650;
    color: inherit;
  }
  .td-dialog-opt span {
    font-size: 12px;
    color: var(--text-soft);
  }
  .td-dialog-opt.is-on {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
  }
  .td-dialog-opt.is-on span { color: color-mix(in srgb, var(--accent) 70%, #667387); }
  .td-dialog-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 14px;
  }
  .td-dialog-field span {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-soft);
  }
  .td-dialog-field input {
    height: 42px;
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-subtle, #f3f5f8);
    padding: 0 12px;
    font-size: 14px;
    color: var(--text-primary);
  }
  .td-dialog-note {
    margin: 14px 0 0;
    font-size: 12px;
    color: var(--text-soft);
    line-height: 1.4;
  }
  .td-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
  }
  .td-dialog-cancel,
  .td-dialog-ok {
    height: 38px;
    padding: 0 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
  }
  .td-dialog-cancel {
    background: #fff;
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
  }
  .td-dialog-ok {
    background: var(--accent);
    border: 0;
    color: #fff;
  }
  .td-dialog-ok:hover,
  .td-dialog-ok:focus-visible,
  .td-dialog-ok:active {
    background: var(--accent-hover) !important;
    border-color: transparent !important;
    color: #fff !important;
    filter: none;
  }

  /* Daily по задаче (Состояние 7) — оверлей поверх карточек, без сдвига layout */
  .td-task-daily {
    position: fixed;
    top: 24px;
    right: 24px;
    bottom: 24px;
    width: min(570px, 42vw);
    z-index: 2200;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    pointer-events: auto;
  }
  .td-task-daily[hidden] { display: none !important; }
  .td-task-daily-head {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 20px 22px 16px;
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
  }
  .td-task-daily-ico {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--accent-soft);
    color: var(--accent);
    display: grid;
    place-items: center;
    font-size: 18px;
    flex-shrink: 0;
  }
  .td-task-daily-head-copy {
    flex: 1;
    min-width: 0;
  }
  .td-task-daily-head-copy strong {
    display: block;
    font-size: 21px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
  }
  .td-task-daily-head-copy span {
    display: block;
    margin-top: 4px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--accent);
  }
  .td-task-daily-close {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--text-soft);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
  }
  .td-task-daily-close:hover {
    background: var(--bg-subtle) !important;
    color: var(--text-primary) !important;
    border-color: transparent !important;
  }
  .td-task-daily-body {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 18px 22px 12px;
  }
  .td-task-daily-ctx {
    background: var(--accent-soft);
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 18px;
  }
  .td-task-daily-ctx strong {
    display: block;
    font-size: 15px;
    font-weight: 650;
    color: var(--text-primary);
  }
  .td-task-daily-ctx span {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-soft);
  }
  .td-task-daily-lead {
    margin: 0 0 8px;
    font-size: 15px;
    font-weight: 650;
    color: var(--text-primary);
  }
  .td-task-daily-copy {
    margin: 0 0 16px;
    font-size: 13px;
    line-height: 1.45;
    color: var(--text-soft);
  }
  .td-task-daily-next {
    background: #f2f7ff;
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 12px 15px 14px;
    margin-bottom: 14px;
  }
  .td-task-daily-next em {
    display: block;
    font-style: normal;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--accent);
    margin-bottom: 8px;
  }
  .td-task-daily-next p {
    margin: 0;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.4;
  }
  .td-task-daily-act {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    height: 54px;
    padding: 0 14px;
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    text-align: left;
    font: inherit;
    margin-bottom: 16px;
  }
  .td-task-daily-act:hover {
    background: var(--accent-soft) !important;
    border-color: var(--accent) !important;
    color: inherit !important;
  }
  .td-task-daily-act-plus {
    color: var(--accent);
    font-size: 18px;
    font-weight: 700;
  }
  .td-task-daily-act span {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
  }
  .td-task-daily-act-go {
    color: var(--accent);
    font-size: 16px;
  }
  .td-task-daily-hist {
    margin: 0 0 8px;
    font-size: 11px;
    color: var(--text-soft);
  }
  .td-task-daily-myday {
    width: 100%;
    height: 42px;
    padding: 0 15px;
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    background: #fff;
    text-align: left;
    font: inherit;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
  }
  .td-task-daily-myday:hover {
    background: var(--bg-subtle) !important;
    border-color: var(--border-subtle) !important;
    color: var(--text-primary) !important;
  }
  .td-task-daily-foot {
    flex-shrink: 0;
    padding: 12px 22px 16px;
    border-top: 1px solid transparent;
  }
  .td-task-daily-input-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-app);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 8px 8px 8px 15px;
  }
  .td-task-daily-input-row input {
    flex: 1;
    min-width: 0;
    height: 40px;
    border: 0;
    background: transparent;
    font: inherit;
    font-size: 12px;
    color: var(--text-primary);
  }
  .td-task-daily-input-row input:focus { outline: none; }
  .td-task-daily-send {
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 12px;
    background: var(--accent);
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
  }
  .td-task-daily-send:hover,
  .td-task-daily-send:focus-visible {
    background: var(--accent-hover) !important;
    border-color: var(--accent-hover) !important;
    color: #fff !important;
  }
  .td-task-daily-note {
    margin: 10px 0 0;
    font-size: 10px;
    color: var(--text-soft);
  }

  .td-detail-daily-go {
    height: 22px;
    padding: 0 10px;
    border: 0;
    border-radius: 8px;
    background: var(--accent-soft);
    color: var(--accent);
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
  }
  .td-detail-daily-go:hover,
  .td-detail-daily-go:focus-visible {
    background: #d7e4ff !important;
    border-color: transparent !important;
    color: var(--accent) !important;
  }
  @media (max-width: 1200px) {
    .td-detail-grid { grid-template-columns: 1fr; }
  }
  #colToday .tcard.is-figma-today .tc-gut,
  #colToday .tcard.is-figma-today .tc-mins,
  #colToday .tcard.is-figma-today .tc-acts {
    display: none !important;
  }
  #colToday .tcard.is-figma-today.is-collapsed .task-drawer {
    display: none;
  }
  #colToday .tcard.is-figma-today.is-expanded .task-drawer {
    display: block;
    padding: 0 18px 14px 54px;
    border-top: 1px solid var(--border-subtle);
  }

  /* —— Right rail widgets —— */
  .td-card {
    background: #fff;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 16px 17px;
  }
  .td-card h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
  }
  .td-card .td-card-sub {
    margin: 8px 0 0;
    font-size: 11px;
    color: var(--text-soft);
  }
  .td-progress-stat {
    margin: 18px 0 10px;
    font-size: 25px;
    font-weight: 600;
    color: var(--text-secondary);
    line-height: 1;
  }
  .td-progress-track {
    height: 8px;
    border-radius: 4px;
    background: var(--accent-soft);
    overflow: hidden;
  }
  .td-progress-fill {
    height: 100%;
    width: 0%;
    background: var(--accent);
    border-radius: 4px;
  }
  .td-capture-input {
    width: 100%;
    margin-top: 14px;
    height: 48px;
    padding: 0 12px;
    border-radius: 9px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-subtle);
    font: inherit;
    font-size: 12px;
    color: var(--text-primary);
    box-sizing: border-box;
  }
  .td-capture-input:focus {
    outline: 2px solid var(--accent-soft);
    border-color: var(--accent);
    background: #fff;
  }
  .td-capture-btn {
    margin-top: 12px;
    width: 100%;
    height: 38px;
    border: 0;
    border-radius: 9px;
    background: var(--accent);
    color: #fff;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
  }
  .td-capture-btn:hover,
  .td-capture-btn:focus-visible,
  .td-capture-btn:active {
    background: var(--accent-hover) !important;
    border-color: transparent !important;
    color: #fff !important;
  }
  .td-capture-ok {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin: 12px 0 0;
    font-size: 13px;
    font-weight: 400;
    color: #0a8f7d;
    line-height: 1.35;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.18s ease, transform 0.18s ease;
  }
  .td-capture-ok.is-deferred {
    color: #6e7a8f;
  }
  .td-capture-ok.is-deferred .td-capture-ok-ico {
    color: #0a8f7d;
  }
  .td-capture-ok[hidden] { display: none !important; }
  .td-capture-ok.is-on {
    opacity: 1;
    transform: none;
  }
  .td-capture-ok-ico {
    width: auto;
    height: auto;
    border-radius: 0;
    background: transparent;
    color: #0a8f7d;
    display: inline;
    font-size: 13px;
    font-weight: 400;
    flex-shrink: 0;
    line-height: 1;
  }
  #colToday .tcard.is-figma-today.is-just-captured,
  #boardGrid #colToday .tcard.is-figma-today.is-just-captured {
    background: var(--accent-soft) !important;
    border-color: #b7caf8 !important;
  }
  #colToday .tcard.is-figma-today.is-just-captured .tc-m-just {
    color: var(--accent);
    font-weight: 600;
  }

  .td-rhythm-dialog {
    width: min(480px, calc(100vw - 48px));
  }
  .td-rhythm-section-label {
    margin: 18px 0 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
  }
  .td-rhythm-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  .td-rhythm-preset {
    height: 36px;
    padding: 0 14px;
    border-radius: 10px;
    border: 1px solid var(--border-subtle);
    background: #fff;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
  }
  .td-rhythm-preset:hover {
    background: var(--bg-subtle) !important;
    border-color: var(--border-subtle) !important;
    color: var(--text-secondary) !important;
  }
  .td-rhythm-preset.is-on {
    background: var(--accent-soft) !important;
    border-color: var(--accent) !important;
    color: var(--accent) !important;
  }
  .td-rhythm-preset.is-break.is-on {
    background: var(--life-soft) !important;
    border-color: var(--life) !important;
    color: var(--life) !important;
  }
  .td-rhythm-cycles {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 44px;
    padding: 0 8px;
    border-radius: 12px;
    background: var(--bg-subtle, #f3f5f8);
    border: 1px solid var(--border-subtle);
    width: 100%;
    max-width: 260px;
  }
  .td-rhythm-cycle-btn {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 8px;
    background: #fff;
    color: var(--text-secondary);
    font-size: 18px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .td-rhythm-cycle-btn:hover {
    background: var(--accent-soft) !important;
    color: var(--accent) !important;
    border: 0 !important;
  }
  .td-rhythm-cycle-val {
    flex: 1;
    text-align: center;
    font-size: 14px;
    font-weight: 650;
    color: var(--text-primary);
    min-width: 88px;
  }
  .td-rhythm-cycles-hint {
    margin: 8px 0 0;
    font-size: 12px;
    line-height: 1.35;
    color: var(--text-soft, #6e7a8f);
  }
  .td-dialog-ok:disabled {
    background: #c9d0db;
    color: #fff;
    cursor: default;
    filter: none;
  }
  .td-dialog-ok:disabled:hover {
    filter: none;
  }

  /* Calendar host kept for JS, visually parked */
  .td-cal-host {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  /* —— Others (desktop backlog) —— */
  /* Скрыть legacy UI, чтобы не наслаивался на Figma */
  body[data-desktop-nav="tasks"] #colOther > .column-header,
  body[data-desktop-nav="tasks"] #backlogToolbar,
  body[data-desktop-nav="tasks"] #backlogFilterTabs,
  body[data-desktop-nav="tasks"] #hideBacklogBtn,
  body[data-desktop-nav="tasks"] #desktopBacklogBack,
  body[data-desktop-nav="tasks"] #colOther .aside-back-btn,
  body[data-desktop-nav="tasks"] #colOther .column-title-wrap,
  body[data-desktop-nav="tasks"] #colOther .slot-load-pill#backlogCounter {
    display: none !important;
  }
  body[data-desktop-nav="tasks"] #colOther .column-body {
    padding: 0;
    overflow: visible;
  }
  body.td-new-task-open #boardGrid {
    display: none !important;
  }
  body.td-new-task-open .td-others-hero,
  body.td-new-task-open .td-others-toolbar {
    display: none !important;
  }

  .td-others-hero {
    display: none;
  }
  body[data-desktop-nav="tasks"] .td-others-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin: 4px 0 18px;
  }
  .td-others-hero h1 {
    margin: 0;
    font-size: 30px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
  }
  .td-others-hero p {
    margin: 8px 0 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
  }
  .td-others-toolbar {
    display: none;
  }
  body[data-desktop-nav="tasks"] .td-others-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
  }
  .td-others-search {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 48px;
    padding: 0 14px;
    background: #fff;
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    color: var(--text-muted);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
  }
  .td-others-search:focus-within,
  .td-others-search.is-active {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
  }
  .td-others-search input {
    flex: 1;
    border: 0;
    outline: none;
    background: transparent;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 0;
  }
  .td-others-filter-wrap {
    position: relative;
    flex-shrink: 0;
  }
  .td-others-filter-btn {
    height: 48px;
    min-width: 160px;
    padding: 0 14px;
    border-radius: 10px;
    border: 1px solid var(--border-subtle);
    background: #fff;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }
  .td-others-filter-btn.is-open,
  .td-others-filter-btn[aria-expanded="true"] {
    color: var(--accent);
    border-color: var(--accent);
  }
  .td-others-filter-btn .td-others-filter-caret {
    opacity: 0.7;
    font-size: 10px;
  }
  .td-others-filter-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 40;
    width: 220px;
    padding: 10px 0;
    background: #fff;
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    box-shadow: 0 10px 28px rgba(26, 36, 51, 0.12);
  }
  .td-others-filter-sheet,
  .td-others-filter-options { display: contents; }
  .td-others-filter-sheet-head,
  .td-others-filter-done { display: none; }
  .td-others-filter-menu[hidden] { display: none !important; }
  .td-others-filter-item {
    display: block;
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
    padding: 10px 16px;
    font: inherit;
    font-size: 14px;
    color: var(--text-primary);
    cursor: pointer;
  }
  .td-others-filter-item:hover {
    background: var(--bg-subtle) !important;
  }
  .td-others-filter-item.is-on {
    color: var(--accent);
    font-weight: 600;
  }
  .td-others-new {
    height: 48px;
    padding: 0 18px;
    border: 0;
    border-radius: 10px;
    background: var(--accent);
    color: #fff;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
  }
  /* global button:hover sets gray bg — keep accent + white text */
  .td-others-new:hover,
  .td-others-new:focus-visible,
  .td-others-new:active {
    background: var(--accent-hover, #1f54d0) !important;
    border-color: transparent !important;
    color: #fff !important;
    filter: none;
  }
  body[data-desktop-nav="tasks"] #backlogList {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
  }
  body[data-desktop-nav="tasks"] #backlogList.is-flat {
    grid-template-columns: minmax(0, 1fr);
    max-width: 720px;
  }
  /* Figma: колонка = прозрачный стек; шапка — отдельная карточка; задачи — отдельные карточки */
  body[data-desktop-nav="tasks"] #backlogList .backlog-group {
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  body[data-desktop-nav="tasks"] #backlogList .backlog-group > .tc-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 0;
    padding: 0;
    background: transparent;
    border: 0;
  }
  body[data-desktop-nav="tasks"] #backlogList .backlog-group-head {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    margin: 0;
    padding: 16px 18px;
    min-height: 82px;
    box-sizing: border-box;
    background: #fff;
    border: 1px solid #e0e5ed;
    border-radius: 16px;
  }
  body[data-desktop-nav="tasks"] #backlogList .backlog-group-head .tc-grp-dot,
  body[data-desktop-nav="tasks"] #backlogList .backlog-group-head .label-mob {
    display: none !important;
  }
  body[data-desktop-nav="tasks"] #backlogList .backlog-group-head .tc-grp-t {
    display: block;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.25;
    color: #1a2433;
  }
  body[data-desktop-nav="tasks"] #backlogList .backlog-group-head .tc-grp-t .label-desk {
    display: inline;
  }
  body[data-desktop-nav="tasks"] #backlogList .backlog-group-head .grp-count {
    display: block;
    margin: 0;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.3;
    color: #667387;
    background: transparent !important;
    border: 0 !important;
    padding: 0 !important;
    border-radius: 0 !important;
  }
  body[data-desktop-nav="tasks"] #backlogList .aside-others-empty {
    padding: 18px 8px !important;
    text-align: center;
    color: #6e7a8f !important;
    font-size: 13px !important;
  }
  body[data-desktop-nav="tasks"] #backlogList .tcard.is-figma-others,
  body[data-desktop-nav="tasks"] #boardGrid #backlogList .tcard.is-figma-others,
  body[data-desktop-nav="tasks"] #colOther .tcard.is-figma-others {
    background: #fff !important;
    border: 1px solid #e0e5ed !important;
    border-radius: 13px !important;
    box-shadow: none !important;
    padding: 14px 14px !important;
    margin: 0 !important;
    min-height: 78px;
    box-sizing: border-box;
  }
  body[data-desktop-nav="tasks"] #backlogList .tcard.is-figma-others:hover,
  body[data-desktop-nav="tasks"] #boardGrid #backlogList .tcard.is-figma-others:hover {
    background: #fff !important;
    border-color: #d5dbe6 !important;
    box-shadow: 0 4px 14px rgba(26, 36, 51, 0.06) !important;
  }
  body[data-desktop-nav="tasks"] #backlogList .tcard.is-figma-others .tc-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-height: 48px;
  }
  body[data-desktop-nav="tasks"] #backlogList .tcard.is-figma-others .tc-check,
  body[data-desktop-nav="tasks"] #colOther .tcard.is-figma-others .tc-check {
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    margin-top: 2px;
    border-radius: 6px !important;
    border: 1.5px solid #e3e8f0 !important;
    background: #fff !important;
    color: transparent !important;
    display: grid !important;
    place-items: center;
    padding: 0 !important;
    flex-shrink: 0;
    box-shadow: none !important;
  }
  body[data-desktop-nav="tasks"] #backlogList .tcard.is-figma-others .tc-check:hover {
    border-color: var(--accent) !important;
    background: #fff !important;
    color: transparent !important;
  }
  body[data-desktop-nav="tasks"] #backlogList .tcard.is-figma-others .tc-check svg {
    width: 11px;
    height: 11px;
    opacity: 0;
  }
  body[data-desktop-nav="tasks"] #backlogList .tcard.is-figma-others.is-done .tc-check {
    background: var(--accent) !important;
    border-color: var(--accent) !important;
    color: #fff !important;
  }
  body[data-desktop-nav="tasks"] #backlogList .tcard.is-figma-others.is-done .tc-check svg {
    opacity: 1;
  }
  body[data-desktop-nav="tasks"] #backlogList .tcard.is-figma-others .tc-body {
    flex: 1;
    min-width: 0;
    padding-top: 1px;
  }
  body[data-desktop-nav="tasks"] #backlogList .tcard.is-figma-others .tc-title {
    font-size: 12px !important;
    font-weight: 600 !important;
    line-height: 1.35;
    color: #1a2433 !important;
  }
  body[data-desktop-nav="tasks"] #backlogList .tcard.is-figma-others .tc-meta {
    margin-top: 6px;
    font-size: 10px !important;
    font-weight: 400 !important;
    line-height: 1.3;
    color: #667387 !important;
  }
  body[data-desktop-nav="tasks"] #backlogList .tcard.is-figma-others .tc-meta .tc-sep,
  body[data-desktop-nav="tasks"] #backlogList .tcard.is-figma-others .tc-acts,
  body[data-desktop-nav="tasks"] #backlogList .tcard.is-figma-others .tc-mins,
  body[data-desktop-nav="tasks"] #backlogList .tcard.is-figma-others .tc-gut,
  body[data-desktop-nav="tasks"] #backlogList .tcard.is-figma-others .task-drawer {
    display: none !important;
  }
  /* ⋯ только по hover — в макете его нет, но меню нужно */
  body[data-desktop-nav="tasks"] #backlogList .tcard.is-figma-others .tc-more {
    margin-left: auto;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.12s ease, background 0.12s ease, color 0.12s ease;
  }
  body[data-desktop-nav="tasks"] #backlogList .tcard.is-figma-others:hover .tc-more,
  body[data-desktop-nav="tasks"] #backlogList .tcard.is-figma-others .tc-more:focus-visible,
  body[data-desktop-nav="tasks"] #backlogList .tcard.is-figma-others .tc-more[aria-expanded="true"] {
    opacity: 1;
  }
  body[data-desktop-nav="tasks"] #backlogList .tcard.is-figma-others .tc-more:hover {
    background: var(--accent-soft) !important;
    color: var(--accent) !important;
  }
  body[data-desktop-nav="tasks"] .td-others-filter-btn {
    color: var(--accent);
    border-color: var(--border-subtle);
  }

  /* Empty states on Others — Figma card, not legacy dashed .es */
  body[data-desktop-nav="tasks"] #backlogList .es {
    display: none !important;
  }
  body[data-desktop-nav="tasks"] .td-others-empty {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    max-width: 720px;
    box-sizing: border-box;
    margin: 8px 0 0;
    padding: 22px 22px;
    background: #fff;
    border: 1px solid #e0e5ed;
    border-radius: 16px;
    box-shadow: none;
  }
  body[data-desktop-nav="tasks"] .td-others-empty-ico {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--accent-soft);
    color: var(--accent);
    display: grid;
    place-items: center;
    flex-shrink: 0;
  }
  body[data-desktop-nav="tasks"] .td-others-empty-ico .es-ico {
    width: 20px;
    height: 20px;
    opacity: 1;
  }
  body[data-desktop-nav="tasks"] .td-others-empty-copy {
    flex: 1;
    min-width: 0;
  }
  body[data-desktop-nav="tasks"] .td-others-empty-title {
    display: block;
    margin: 0;
    font-size: 15px;
    font-weight: 650;
    color: #1a2433;
    line-height: 1.3;
  }
  body[data-desktop-nav="tasks"] .td-others-empty-hint {
    margin: 6px 0 0;
    font-size: 13px;
    font-weight: 400;
    color: #6e7a8f;
    line-height: 1.4;
  }
  body[data-desktop-nav="tasks"] .td-others-empty-act {
    flex-shrink: 0;
    height: 40px;
    padding: 0 16px;
    border: 0;
    border-radius: 10px;
    background: var(--accent);
    color: #fff;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
  }
  body[data-desktop-nav="tasks"] .td-others-empty-act:hover,
  body[data-desktop-nav="tasks"] .td-others-empty-act:focus-visible,
  body[data-desktop-nav="tasks"] .td-others-empty-act:active {
    background: var(--accent-hover, #1f54d0) !important;
    border-color: transparent !important;
    color: #fff !important;
    filter: none;
  }

  /* Others detail overlay (State 9) — Figma 29:83: x=720 w=720 on 1440 → right half, full height */
  .td-others-detail-overlay {
    position: fixed;
    inset: 0;
    z-index: 2300;
    display: block;
    pointer-events: none;
  }
  .td-others-detail-overlay[hidden] { display: none !important; }
  .td-others-detail-backdrop {
    position: absolute;
    /* 29:82 Detail backdrop: x=240, covers main to the right of sidebar */
    top: 0;
    right: 0;
    bottom: 0;
    left: var(--sidebar-w, 240px);
    background: rgba(26, 36, 51, 0.18);
    pointer-events: auto;
  }
  .td-others-detail-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: auto;
    width: min(520px, 100%);
    max-width: 520px;
    height: auto;
    max-height: none;
    margin: 0;
    padding: 0;
    background: #fff;
    border: 0;
    border-left: 1px solid #e3e8f0;
    border-radius: 0 !important;
    box-shadow: -16px 0 48px rgba(26, 36, 51, 0.12);
    overflow-x: hidden;
    overflow-y: auto;
    pointer-events: auto;
    transform: translateX(0);
    animation: td-od-slide 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  }
  @keyframes td-od-slide {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
  }
  .td-others-detail-panel.is-others-drawer .td-detail-grid,
  .td-others-detail-panel.is-others-drawer > .td-detail-back {
    display: none !important;
  }
  body.td-others-detail-open #colOther {
    filter: none;
  }
  @media (max-width: 1100px) {
    .td-others-detail-backdrop { left: 0; }
    .td-others-detail-panel {
      left: auto;
      width: min(520px, 100%);
      max-width: 100%;
    }
  }
  @media (max-width: 560px) {
    .td-others-detail-panel {
      left: 0;
      width: 100%;
      max-width: none;
    }
  }

  .td-od {
    position: relative;
    padding: 0 28px 40px 36px;
    display: flex;
    flex-direction: column;
    gap: 0;
    min-height: 100%;
    width: 100%;
    max-width: none;
    box-sizing: border-box;
  }
  /* Крестик не уезжает при скролле панели */
  .td-od-top {
    position: sticky;
    top: 0;
    z-index: 6;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 -28px 14px -36px;
    padding: 18px 22px 12px 36px;
    background: #fff;
  }
  .td-od-kicker {
    margin: 0;
    font-size: 11px;
    font-weight: 650;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #6e7a8f;
  }
  .td-od-close {
    position: relative;
    z-index: 7;
    width: 36px;
    height: 36px;
    margin: 0;
    flex-shrink: 0;
    border: 0;
    border-radius: 10px;
    background: #fff;
    color: #6e7a8f;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
  }
  .td-od-close:hover {
    background: var(--bg-subtle) !important;
    color: var(--text-primary) !important;
  }
  .td-od-title {
    margin: 0 0 12px;
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
    color: #1a2433;
    letter-spacing: -0.02em;
    cursor: text;
  }
  button.td-od-desc,
  .td-od-desc {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin: 0 0 18px;
    padding: 0;
    border: 0;
    background: transparent;
    font: inherit;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.45;
    text-align: left;
    color: #667387;
    cursor: text;
    border-radius: 8px;
    white-space: pre-wrap;
    word-break: break-word;
  }
  button.td-od-desc:hover,
  .td-od-desc:hover {
    color: #1a2433;
    background: transparent !important;
  }
  button.td-od-desc:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--accent-soft);
  }
  button.td-od-desc.is-empty,
  .td-od-desc.is-empty {
    color: #9aa3b2;
    font-style: italic;
    cursor: pointer;
  }
  .td-od-desc-edit {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin: 0 0 18px;
    padding: 8px 10px;
    border: 1px solid #c5d6f7;
    border-radius: 8px;
    background: #fff;
    font: inherit;
    font-size: 14px;
    line-height: 1.45;
    color: #1a2433;
    resize: vertical;
    min-height: 72px;
  }
  .td-od-desc-edit:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
  }
  .td-od-status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 16px;
  }
  .td-od-status {
    display: inline-flex;
    align-items: center;
    height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 12px;
    font-weight: 650;
  }
  .td-od-status.is-work {
    background: #def5ed;
    color: #0a8f7d;
  }
  .td-od-more {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #6e7a8f;
    font-size: 18px;
    cursor: pointer;
  }
  .td-od-more:hover {
    background: var(--accent-soft) !important;
    color: var(--accent) !important;
  }
  .td-od-tip {
    background: #f6f7f9;
    border-radius: 14px;
    padding: 16px 18px;
    margin-bottom: 28px;
  }
  .td-od-tip-label {
    margin: 0 0 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #6e7a8f;
  }
  .td-od-tip-text {
    margin: 0;
    font-size: 14px;
    line-height: 1.45;
    color: #1a2433;
    font-weight: 600;
  }
  .td-od-tip-hint {
    margin: 8px 0 0;
    font-size: 13px;
    line-height: 1.4;
    color: #6e7a8f;
    font-weight: 400;
  }
  .td-od-steps-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
  }
  .td-od-steps-head h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #1a2433;
  }
  .td-od-steps-head span {
    font-size: 13px;
    color: #6e7a8f;
  }
  .td-od-progress {
    height: 5px;
    border-radius: 999px;
    background: #e8edf5;
    overflow: hidden;
    margin-bottom: 14px;
  }
  .td-od-progress i {
    display: block;
    height: 100%;
    background: var(--accent);
    border-radius: inherit;
  }
  .td-od-steps {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
  }
  .td-od-steps-empty {
    margin: 0 0 12px;
    font-size: 13px;
    color: #6e7a8f;
  }
  .td-od-step {
    border: 1px solid #e3e8f0;
    border-radius: 12px;
    background: #fff;
    padding: 0;
    min-height: 46px;
  }
  .td-od-step.is-done {
    background: #f3f7ff;
    border-color: #d7e3ff;
  }
  .td-od-step.is-next {
    border-color: #c5d4f5;
  }
  .td-od-step-main {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 12px 14px;
    width: 100%;
    box-sizing: border-box;
  }
  .td-od-step-cb {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    margin: 0;
    pointer-events: none;
  }
  .td-od-step-box {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: 1.5px solid #d0d7e4;
    background: #fff;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
  }
  .td-od-step.is-done .td-od-step-box {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: none;
  }
  .td-od-step.is-done .td-od-step-box::after {
    content: '';
    display: block;
    width: 11px;
    height: 11px;
    background: center / contain no-repeat
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
  }
  .td-od-step-t {
    flex: 1;
    min-width: 0;
    font-size: 14px;
    font-weight: 600;
    color: #1a2433;
    line-height: 1.35;
  }
  .td-od-step.is-done .td-od-step-t {
    text-decoration: line-through;
    color: #6e7a8f;
  }
  .td-od-step-st {
    flex-shrink: 0;
    font-size: 12px;
    color: #6e7a8f;
    font-weight: 500;
    text-align: right;
    min-width: 110px;
  }
  .td-od-step.is-next .td-od-step-st {
    color: var(--accent);
    font-weight: 650;
  }
  .td-od-step.is-done .td-od-step-st {
    color: #0a8f7d;
  }
  .td-od-add-step {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 28px;
  }
  .td-od-add-step.is-collapsed input {
    display: none;
  }
  .td-od-add-step input {
    width: 100%;
    height: 42px;
    border: 1px solid #e3e8f0;
    border-radius: 12px;
    padding: 0 14px;
    font: inherit;
    font-size: 14px;
    box-sizing: border-box;
  }
  .td-od-add-step input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
  }
  .td-od-add-btn {
    width: 100%;
    height: 42px;
    padding: 0 14px;
    border: 0;
    border-radius: 12px;
    background: var(--accent-soft);
    color: var(--accent);
    font: inherit;
    font-size: 14px;
    font-weight: 650;
    cursor: pointer;
    text-align: left;
  }
  .td-od-add-btn:hover {
    background: #d7e4ff !important;
    color: var(--accent) !important;
  }
  .td-od-params-head {
    margin: 0 0 12px;
    font-size: 18px;
    font-weight: 700;
    color: #1a2433;
  }
  .td-od-params {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 28px;
  }
  /* Override global `button { inline-flex; justify-content: center }` — Figma tiles are left-aligned */
  button.td-od-param,
  .td-od-param {
    display: flex !important;
    flex-direction: column;
    align-items: flex-start !important;
    justify-content: center !important;
    gap: 4px;
    width: 100%;
    box-sizing: border-box;
    text-align: left !important;
    white-space: normal;
    border: 0;
    border-radius: 10px;
    background: #f6f7f9;
    padding: 12px 16px;
    min-height: 54px;
    font: inherit;
    cursor: pointer;
  }
  .td-od-param.is-static {
    cursor: default;
  }
  .td-od-param span {
    display: block;
    width: 100%;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #6e7a8f;
    margin: 0;
    text-align: left;
  }
  .td-od-param strong {
    display: block;
    width: 100%;
    font-size: 14px;
    font-weight: 650;
    color: #1a2433;
    text-align: left;
  }
  .td-od-param strong.is-accent {
    color: var(--accent);
  }
  .td-od-param:not(.is-static):hover {
    background: #eef1f6 !important;
  }
  .td-od-actions {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    gap: 12px;
    margin-bottom: 18px;
  }
  .td-od-primary {
    width: 100%;
    height: 44px;
    border: 0;
    border-radius: 12px;
    background: var(--accent);
    color: #fff;
    font: inherit;
    font-size: 14px;
    font-weight: 650;
    cursor: pointer;
  }
  .td-od-primary:hover,
  .td-od-primary:focus-visible,
  .td-od-primary:active {
    background: var(--accent-hover, #1f54d0) !important;
    border-color: transparent !important;
    color: #fff !important;
  }
  .td-od-sec-btn {
    height: 44px;
    border: 1px solid #e3e8f0;
    border-radius: 12px;
    background: #fff;
    color: #1a2433;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
  }
  .td-od-sec-btn:hover {
    background: #f6f7f9 !important;
    color: #1a2433 !important;
  }
  .td-od-foot {
    margin: 0;
    font-size: 13px;
    line-height: 1.45;
    color: #6e7a8f;
    text-align: left;
  }

  /* New task — Figma 44 / 47 / 48 */
  .td-new-task-page {
    display: none;
  }
  body.td-new-task-open .td-new-task-page {
    display: block;
    width: 100%;
    max-width: none;
    margin: 0 0 32px;
    padding: 0 0 24px;
    box-sizing: border-box;
  }
  .td-nt-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin: 8px 0 18px;
  }
  .td-nt-head h1 {
    margin: 0 0 8px;
    font-size: 28px;
    font-weight: 650;
    color: #1f2938;
    letter-spacing: -0.02em;
  }
  .td-nt-sub {
    margin: 0;
    font-size: 15px;
    color: #6e7a8f;
  }
  .td-nt-daily-badge {
    height: 38px;
    padding: 0 16px;
    border: 0;
    border-radius: 19px;
    background: #e5edff;
    color: #2963e8;
    font: inherit;
    font-size: 13px;
    font-weight: 550;
    cursor: pointer;
    white-space: nowrap;
  }
  .td-nt-daily-badge:hover {
    background: #d7e4ff !important;
    color: #2963e8 !important;
  }
  .td-nt-steps { margin-bottom: 18px; }
  .td-nt-steps-label {
    margin: 0 0 10px;
    font-size: 11px;
    font-weight: 650;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #6e7a8f;
  }
  .td-nt-steps-label .is-on { color: #2963e8; }
  .td-nt-steps-label .sep { margin: 0 10px; color: #c5ccd8; }
  .td-nt-progress {
    height: 4px;
    border-radius: 2px;
    background: #e3e8f0;
    overflow: hidden;
    width: 100%;
  }
  .td-nt-progress i {
    display: block;
    height: 100%;
    width: 0;
    max-width: 100%;
    background: #2963e8;
    border-radius: inherit;
    transition: width 0.28s ease;
  }
  .td-nt-layout {
    display: grid;
    grid-template-columns: minmax(0, 704px) minmax(280px, 360px);
    gap: 36px;
    align-items: start;
  }
  .td-nt-label {
    display: block;
    margin: 0 0 8px;
    font-size: 12px;
    font-weight: 550;
    color: #6e7a8f;
  }
  .td-nt-h2 {
    margin: 22px 0 14px;
    font-size: 20px;
    font-weight: 650;
    color: #1f2938;
  }
  .td-nt-h3 {
    margin: 22px 0 6px;
    font-size: 16px;
    font-weight: 650;
    color: #1f2938;
  }
  .td-nt-hint {
    margin: 0 0 12px;
    font-size: 13px;
    color: #6e7a8f;
    line-height: 1.4;
  }
  .td-nt-mode {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    padding: 4px;
    border: 1px solid #e3e8f0;
    border-radius: 12px;
    background: #fff;
    margin-bottom: 8px;
  }
  .td-nt-mode-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    text-align: left;
    min-height: 46px;
    padding: 8px 16px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    font: inherit;
    cursor: pointer;
    color: #1f2938;
  }
  .td-nt-mode-btn strong {
    font-size: 14px;
    font-weight: 650;
  }
  .td-nt-mode-btn span {
    font-size: 11px;
    color: #6e7a8f;
  }
  .td-nt-mode-btn.is-on {
    background: #e5edff;
    color: #2963e8;
  }
  .td-nt-mode-btn.is-on span { color: #2963e8; }
  /* Белые поля: перебить глобальный input[type=text] { background: var(--bg-subtle) } */
  .td-new-task-page input.td-nt-input,
  .td-new-task-page input[type="text"].td-nt-input,
  .td-new-task-page textarea.td-nt-textarea,
  .td-new-task-page button.td-nt-deadline,
  .td-new-task-page .td-nt-input,
  .td-new-task-page .td-nt-textarea,
  .td-new-task-page .td-nt-deadline {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #e3e8f0;
    border-radius: 10px;
    background: #ffffff;
    font: inherit;
    font-size: 14px;
    color: #1f2938;
    padding: 12px 14px;
    margin-bottom: 12px;
  }
  .td-new-task-page textarea.td-nt-textarea {
    min-height: 72px;
    resize: vertical;
    font-size: 13px;
  }
  .td-new-task-page input.td-nt-input:focus,
  .td-new-task-page input[type="text"].td-nt-input:focus,
  .td-new-task-page textarea.td-nt-textarea:focus,
  .td-new-task-page button.td-nt-deadline:focus,
  .td-new-task-page button.td-nt-deadline:hover {
    outline: none;
    background: #ffffff;
    border-color: #2963e8;
    box-shadow: 0 0 0 3px #e5edff;
    color: #1f2938;
  }
  .td-new-task-page input.td-nt-input:focus,
  .td-new-task-page textarea.td-nt-textarea:focus {
    border-color: #2963e8;
    box-shadow: 0 0 0 3px #e5edff;
  }
  .td-new-task-page button.td-nt-deadline {
    text-align: center;
    cursor: pointer;
    color: #6e7a8f;
    justify-content: center;
  }
  .td-new-task-page button.td-nt-deadline.is-soon {
    color: #2963e8;
    border-color: #c5d6f7;
    background: #f5f8ff;
  }
  .td-new-task-page button.td-nt-deadline.is-overdue {
    color: #b42318;
    border-color: #f3c4c0;
    background: #fff5f5;
  }
  .tc-m-deadline.is-overdue {
    color: #b42318;
  }
  .td-new-task-page input.td-nt-input:-webkit-autofill,
  .td-new-task-page input.td-nt-input:-webkit-autofill:hover,
  .td-new-task-page input.td-nt-input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px #ffffff inset;
    box-shadow: 0 0 0 1000px #ffffff inset;
    -webkit-text-fill-color: #1f2938;
  }
  .td-nt-cal {
    border: 1px solid #e3e8f0;
    border-radius: 12px;
    background: #fff;
    padding: 14px 16px 12px;
    margin-bottom: 14px;
  }
  .td-nt-cal-top {
    margin-bottom: 12px;
  }
  .td-nt-cal-nav {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .td-nt-cal-nav-mid {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: center;
  }
  .td-nt-cal-nav-mid strong {
    font-size: 16px;
    font-weight: 650;
    color: #1f2938;
  }
  .td-nt-cal-nav-mid span {
    font-size: 11px;
    color: #6e7a8f;
  }
  .td-nt-cal-nav-btn {
    width: 34px;
    height: 34px;
    min-width: 34px;
    min-height: 34px;
    box-sizing: border-box;
    flex-shrink: 0;
    border: 1px solid #e3e8f0 !important;
    border-radius: 8px !important;
    background: #fff !important;
    color: #1f2938 !important;
    font: inherit;
    line-height: 0 !important;
    cursor: pointer;
    padding: 0 !important;
    margin: 0 !important;
    gap: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  .td-nt-cal-nav-btn:hover {
    background: #f5f8ff !important;
    border-color: #c5d6f7 !important;
    color: #2963e8 !important;
  }
  .td-nt-cal-nav-ico {
    width: 16px;
    height: 16px;
    display: block;
    flex-shrink: 0;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
  }
  /* Одна сетка: колонка времени + 7 дней — дни и слоты в одних столбцах */
  .td-nt-cal-days,
  .td-nt-cal-row {
    display: grid;
    grid-template-columns: 44px repeat(7, minmax(0, 1fr));
    gap: 8px;
    align-items: center;
  }
  .td-nt-cal-days {
    margin-bottom: 14px;
    padding-right: 10px; /* запас под скроллбар сетки */
  }
  .td-nt-cal-days-spacer {
    min-width: 0;
  }
  .td-nt-day {
    height: 34px;
    border: 1px solid #e3e8f0;
    border-radius: 8px;
    background: #fff;
    font: inherit;
    font-size: 10px;
    font-weight: 550;
    color: #6e7a8f;
    cursor: pointer;
    padding: 0 !important;
    gap: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100%;
    box-sizing: border-box;
  }
  .td-nt-day.is-on {
    background: #e5edff;
    border-color: #2963e8;
    color: #2963e8;
    font-weight: 650;
  }
  .td-nt-day.is-past,
  .td-nt-slot.is-past {
    background: #f3f4f6;
    color: #9aa3b2;
    border-color: #e8ecf2;
    cursor: default;
    opacity: 0.72;
  }
  .task-schedule-pop .cal-day.is-past:disabled {
    opacity: 0.35;
    color: #9aa3b2;
    background: transparent;
    cursor: default;
  }
  .td-nt-cal-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 220px;
    overflow-y: auto;
    padding-right: 2px;
    scrollbar-gutter: stable;
  }
  .td-nt-cal-time {
    font-size: 10px;
    color: #6e7a8f;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    height: 24px;
    padding-right: 2px;
    box-sizing: border-box;
  }
  .td-nt-slot {
    height: 24px;
    border: 1px solid #e3e8f0;
    border-radius: 5px;
    background: #fff;
    font: inherit;
    font-size: 10px;
    color: #2963e8;
    font-weight: 650;
    cursor: pointer;
    padding: 0 !important;
    gap: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100%;
    box-sizing: border-box;
  }
  .td-nt-slot.is-busy {
    background: #e8ebf0;
    border-color: #d8dde6;
    color: #6e7a8f;
    font-size: 9px;
    font-weight: 550;
    letter-spacing: -0.02em;
    cursor: default;
    pointer-events: none;
    user-select: none;
  }
  .td-nt-slot.is-on {
    background: #e5edff;
    border-color: #2963e8;
  }
  .td-nt-cal-custom {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #eef1f6;
  }
  .td-nt-cal-custom .td-nt-label {
    margin-bottom: 6px;
  }
  .td-nt-cal-custom-row {
    display: flex;
    gap: 8px;
    align-items: center;
  }
  .td-nt-cal-schedule-btn {
    flex: 1;
    min-width: 0;
  }
  .td-nt-cal-custom-btn {
    height: 40px;
    padding: 0 14px;
    border: 1px solid #e3e8f0;
    border-radius: 10px;
    background: #fff;
    color: #2963e8;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .td-nt-cal-custom-btn:hover {
    background: #f5f8ff;
    border-color: #c5d6f7;
  }
  .td-nt-cal-reset {
    height: 40px;
    padding: 0 14px;
    border: 1px solid #e3e8f0;
    border-radius: 10px;
    background: #fff;
    color: #6e7a8f;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .td-nt-cal-reset:hover {
    background: #fff5f5;
    border-color: #f3c4c0;
    color: #b42318;
  }
  .td-nt-cal-sel-row {
    margin-top: 12px;
  }
  .td-nt-cal-sel {
    margin: 0;
    font-size: 11px;
    font-weight: 550;
    color: #2963e8;
  }
  .td-nt-recur {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
    align-items: stretch;
  }
  .td-nt-recur-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 1px;
    text-align: left;
    min-height: 42px;
    padding: 7px 10px;
    border: 1px solid #e3e8f0;
    border-radius: 8px;
    background: #fff;
    font: inherit;
    cursor: pointer;
    width: 100%;
    box-sizing: border-box;
  }
  .td-nt-recur-btn strong {
    font-size: 12px;
    font-weight: 650;
    color: #1f2938;
    line-height: 1.2;
  }
  .td-nt-recur-btn span {
    font-size: 10px;
    color: #6e7a8f;
    line-height: 1.2;
  }
  .td-nt-recur-btn.is-on {
    background: #e5edff;
    border-color: #2963e8;
  }
  .td-nt-recur-btn.is-on strong { color: #2963e8; }
  .td-nt-recur-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    min-width: 0;
    min-height: 42px;
    padding: 0;
    border: 1px solid #e3e8f0;
    border-radius: 8px;
    background: #fff;
    box-sizing: border-box;
    overflow: hidden;
  }
  .td-nt-recur-card.is-on {
    background: #e5edff;
    border-color: #2963e8;
  }
  .td-nt-recur-card .td-nt-recur-count-head {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    border: 0;
    border-radius: 0;
    background: transparent;
    min-height: 0;
    height: 100%;
    padding: 7px 6px 7px 10px;
  }
  .td-nt-recur-card.is-on .td-nt-recur-count-head,
  .td-nt-recur-card.is-on .td-nt-recur-count-head.is-on {
    background: transparent;
    border-color: transparent;
  }
  .td-nt-recur-card.is-on .td-nt-recur-count-head strong { color: #2963e8; }
  .td-nt-recur-card .td-nt-recur-stepper {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 3px;
    flex: 0 0 auto;
    padding: 0 8px 0 0;
    margin: 0;
  }
  .td-nt-recur-nudge {
    width: 24px;
    height: 24px;
    border: 1px solid #c5d6f7;
    border-radius: 6px;
    background: #fff;
    color: #2963e8;
    cursor: pointer;
    padding: 0 !important;
    gap: 0 !important;
    flex: 0 0 24px;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 0;
  }
  .td-nt-recur-nudge-ico {
    width: 12px;
    height: 12px;
    display: block;
    flex-shrink: 0;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
  }
  .td-nt-recur-card.is-on .td-nt-recur-nudge:hover {
    background: #f5f8ff;
  }
  .td-new-task-page input.td-nt-recur-n,
  .td-nt-recur-n {
    width: 28px !important;
    min-width: 28px !important;
    max-width: 28px !important;
    flex: 0 0 28px;
    height: 24px;
    text-align: center;
    margin: 0 !important;
    padding: 0 !important;
    font-size: 12px !important;
    font-weight: 650;
    line-height: 24px;
    color: #2963e8;
    border: 1px solid #c5d6f7 !important;
    border-radius: 6px !important;
    background: #fff !important;
    box-shadow: none !important;
    box-sizing: border-box;
    -moz-appearance: textfield;
    appearance: textfield;
  }
  .td-new-task-page input.td-nt-recur-n:focus,
  .td-nt-recur-n:focus {
    outline: none;
    border-color: #2963e8 !important;
    box-shadow: 0 0 0 2px #e5edff !important;
  }
  .td-nt-recur-n::-webkit-outer-spin-button,
  .td-nt-recur-n::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
  }
  .td-nt-save-opts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 8px;
  }
  .td-nt-save-opt {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    text-align: left;
    min-height: 54px;
    padding: 10px 12px;
    border: 1px solid #e3e8f0;
    border-radius: 10px;
    background: #fff;
    font: inherit;
    cursor: pointer;
  }
  .td-nt-save-opt strong {
    font-size: 13px;
    font-weight: 650;
    color: #1f2938;
  }
  .td-nt-save-opt span {
    font-size: 11px;
    color: #6e7a8f;
  }
  .td-nt-save-opt.is-on {
    background: #def5ed;
    border-color: #def5ed;
  }
  .td-nt-save-opt.is-on strong,
  .td-nt-save-opt.is-on span { color: #0a8f7d; }
  .td-nt-side {
    position: sticky;
    top: 12px;
  }
  .td-nt-prio {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    margin-bottom: 16px;
  }
  .td-nt-prio-btn {
    height: 36px;
    border: 1px solid #e3e8f0;
    border-radius: 8px;
    background: #fff;
    font: inherit;
    font-size: 11px;
    color: #6e7a8f;
    cursor: pointer;
  }
  .td-nt-prio-btn.is-on {
    background: #e5edff;
    border-color: #2963e8;
    color: #2963e8;
    font-weight: 550;
  }
  .td-nt-steps-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 8px;
  }
  .td-nt-step-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid #e3e8f0;
    border-radius: 9px;
    font-size: 13px;
    color: #1f2938;
  }
  .td-nt-step-del {
    border: 0;
    background: transparent;
    color: #6e7a8f;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
  }
  .td-nt-step-input { margin-bottom: 8px; }
  .td-nt-add-step {
    height: 34px;
    padding: 0 12px;
    border: 0;
    border-radius: 8px;
    background: #e5edff;
    color: #2963e8;
    font: inherit;
    font-size: 11px;
    font-weight: 550;
    cursor: pointer;
    margin-bottom: 18px;
  }
  .td-nt-tip {
    border: 1px solid #e3e8f0;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 18px;
  }
  .td-nt-tip strong {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    color: #2963e8;
  }
  .td-nt-tip p {
    margin: 0;
    font-size: 12px;
    color: #6e7a8f;
    line-height: 1.4;
  }
  .td-nt-side-foot {
    border-top: 1px solid #e3e8f0;
    padding-top: 16px;
  }
  .td-nt-actions {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 12px;
  }
  .td-nt-cancel,
  .td-nt-submit {
    height: 46px;
    border-radius: 10px;
    font: inherit;
    font-size: 13px;
    font-weight: 550;
    cursor: pointer;
  }
  .td-nt-cancel {
    border: 1px solid #e3e8f0;
    background: #fff;
    color: #1f2938;
  }
  .td-nt-submit {
    border: 0;
    background: #2963e8;
    color: #fff;
  }
  .td-nt-submit:hover,
  .td-nt-submit:focus-visible,
  .td-nt-submit:active {
    background: #1f54d0 !important;
    color: #fff !important;
  }
  .td-nt-voice {
    text-align: center;
    border: 1px solid #e3e8f0;
    border-radius: 20px;
    background: #fff;
    padding: 42px 52px 36px;
    min-height: 420px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }
  .td-nt-voice[hidden],
  .td-nt-manual[hidden] { display: none !important; }
  .td-nt-voice-record,
  .td-nt-voice-parse {
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
  }
  .td-nt-voice .td-nt-h2 { margin-top: 0; }
  .td-nt-mic {
    position: relative;
    width: 96px;
    height: 96px;
    margin: 28px auto 18px;
    padding: 0 !important;
    gap: 0 !important;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #295fe8;
    cursor: pointer;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  .td-nt-mic-halo {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: #e6edff;
    z-index: 0;
  }
  .td-nt-mic-ico {
    position: relative;
    z-index: 1;
    width: 40px;
    height: 40px;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 3;
  }
  .td-nt-mic.is-live .td-nt-mic-halo {
    background: #fee2e2;
  }
  .td-nt-mic.is-live {
    color: #b91c1c;
    animation: td-mic-pulse 1.2s ease-in-out infinite;
  }
  @keyframes td-mic-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.06); }
  }
  .td-nt-voice-status {
    margin: 0 0 10px;
    font-size: 17px;
    font-weight: 650;
    color: #1f2938;
  }
  .td-nt-voice-go {
    height: 52px;
    min-width: 280px;
    max-width: 360px;
    width: 100%;
    margin: 18px auto 12px;
    padding: 0 24px;
    border: 0;
    border-radius: 12px;
    background: #2963e8;
    color: #fff;
    font: inherit;
    font-size: 16px;
    font-weight: 650;
    cursor: pointer;
  }
  .td-nt-voice-go[hidden] { display: none !important; }
  .td-nt-voice-go:disabled {
    opacity: 0.45;
    cursor: default;
  }
  .td-nt-voice-go:not(:disabled):hover {
    background: #1f54d0 !important;
    color: #fff !important;
  }
  .td-nt-voice-note { margin-top: 8px; }
  .td-nt-voice-note[hidden] { display: none !important; }
  .td-nt-voice-parse[hidden] { display: none !important; }
  .td-nt-voice-parse {
    padding: 24px 0;
  }
  .td-nt-voice-spinner {
    width: 48px;
    height: 48px;
    margin: 0 auto 22px;
    border: 3px solid #e5edff;
    border-top-color: #2963e8;
    border-radius: 50%;
    animation: td-nt-spin 0.85s linear infinite;
  }
  @keyframes td-nt-spin {
    to { transform: rotate(360deg); }
  }
  .td-nt-voice-parse-quote {
    margin: 18px auto 0;
    max-width: 520px;
    padding: 12px 16px;
    border-radius: 12px;
    background: #f6f8fb;
    color: #6e7a8f;
    font-size: 13px;
    line-height: 1.45;
    text-align: left;
  }
  .td-nt-voice-parse-quote[hidden] { display: none !important; }
  body.td-new-task-open[data-nt-mode="daily"] .td-nt-side {
    opacity: 0.45;
    pointer-events: none;
  }
  @media (max-width: 1180px) {
    .td-nt-layout { grid-template-columns: 1fr; }
    .td-nt-side { position: static; }
  }
}

@media (min-width: 1025px) {
  /* Focus overlay — Figma light workspace */
  .focus-overlay.active {
    background: rgba(246, 248, 251, 0.92);
    backdrop-filter: blur(8px);
  }
  .focus-overlay.active .focus-modal {
    background: #fff;
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    max-width: 720px;
  }
  .focus-kicker {
    color: var(--accent);
    letter-spacing: 0.08em;
  }
  .focus-start-btn,
  #focusStartPauseBtn.btn-primary {
    background: var(--accent);
    border-radius: 12px;
  }

  /* Daily chat panel */
  .ai-bot-chat-overlay .ai-bot-chat,
  .ai-bot-panel {
    border-radius: 16px;
    border-color: var(--border-subtle);
  }

  /* Settings sheet */
  .settings-overlay .settings-panel,
  #settingsModal .modal-card {
    border-radius: 16px;
    border: 1px solid var(--border-subtle);
  }
}

@media (max-width: 1024px) {
  .td-today-rail,
  .td-today-hero,
  .td-date-chip,
  .td-main-focus,
  .td-plan-head,
  .td-others-hero,
  .td-others-toolbar {
    display: none !important;
  }

  /* Mobile empty today — same Figma card language */
  #colToday .today-empty-hero.td-today-empty,
  #colToday.is-today-empty .today-empty-hero:not([hidden]) {
    display: block !important;
    border: 0;
    background: transparent;
    padding: 0;
    min-height: 0;
    text-align: left;
  }
  #colToday .td-today-empty-card {
    background: #fff;
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 22px 18px;
  }
  #colToday .td-today-empty .today-empty-actions {
    flex-direction: column;
    align-items: stretch;
    max-width: none;
  }
  #colToday .td-empty-btn {
    width: 100%;
    justify-content: center;
  }

  /* Mobile Figma tokens */
  body {
    background: var(--bg-app);
  }
  .mobile-board-tabs {
    background: #fff;
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    margin: 8px 12px 12px;
    padding: 4px;
    gap: 4px;
  }
  .mobile-board-tabs button {
    border-radius: 10px;
    font-weight: 600;
  }
  .mobile-board-tabs button.active {
    background: var(--accent-soft);
    color: var(--accent);
  }
  #colToday .task-card,
  #colToday .tc-card,
  #colOther .task-card,
  #colOther .tc-card {
    background: #fff;
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    box-shadow: none;
  }
  .auth-overlay .auth-card {
    border-radius: 16px;
    border: 1px solid var(--border-subtle);
  }
  .bottom-dock,
  .mobile-add-bar {
    border-color: var(--border-subtle);
  }
}

/* ===== Focus workspace � Figma 58 / 61 / 65 / 66 / 68 ===== */
.td-focus-page { display: none; }
body.td-focus-page-open .td-focus-page {
  display: block;
  width: 100%;
  max-width: none;
  margin: 0 0 28px;
  padding: 0 0 20px;
  box-sizing: border-box;
}
body.td-focus-page-open #boardGrid.board-grid,
body.td-focus-page-open .td-today-rail {
  display: none !important;
}
body.td-focus-page-open .td-new-task-page { display: none !important; }

.td-fp-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin: 4px 0 22px;
}
.td-fp-crumb {
  margin: 0 0 8px;
  font-size: 12px;
  color: #637185;
}
.td-fp-head h1 {
  margin: 0 0 8px;
  font-size: 30px;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: #1a2433;
  line-height: 1.15;
}
.td-fp-sub {
  margin: 0;
  font-size: 15px;
  color: #637185;
  max-width: 820px;
}
.td-fp-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  height: 38px;
  padding: 0 16px 0 14px;
  border-radius: 19px;
  background: #e3f7ed;
  color: #1c9c6b;
  font-size: 13px;
  font-weight: 550;
  white-space: nowrap;
}
.td-fp-badge i {
  width: 8px;
  height: 8px;
  border-radius: 4px;
  background: #1c9c6b;
}

.td-fp-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 20px;
  align-items: start;
}
.td-fp-main {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}
.td-fp-side {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.td-fp-card {
  background: #fff;
  border: 1px solid #e0e6ee;
  border-radius: 20px;
  padding: 24px 27px 28px;
  box-sizing: border-box;
}
.td-fp-kicker {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.04em;
  color: #2963e8;
  text-transform: uppercase;
}
.td-fp-hero h2 {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 650;
  color: #1a2433;
  letter-spacing: -0.01em;
}
.td-fp-hero-sub {
  margin: 0;
  font-size: 13px;
  color: #637185;
}
.td-fp-divider {
  height: 1px;
  background: #e0e6ee;
  margin: 18px 0;
}
.td-fp-label {
  margin: 0 0 10px;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.06em;
  color: #919eb0;
  text-transform: uppercase;
}
.td-fp-setup {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 22px;
}
.td-fp-setup > .td-fp-label {
  margin: 0 0 12px;
}
.td-fp-task {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  margin: 0 0 4px;
  padding: 8px 12px;
  border: 1px solid #e0e6ee;
  border-radius: 10px;
  background: #fff;
  text-align: left;
  cursor: pointer;
  box-sizing: border-box;
  font: inherit;
  color: inherit;
}
.td-fp-task:hover { border-color: #c5d0e0; background: #fafbfd; }
.td-fp-task.is-empty .td-fp-task-action { opacity: 1; }
.td-fp-task-ico {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: #e6edff;
  color: #2963e8;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 700;
}
.td-fp-task-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.td-fp-task-copy strong {
  font-size: 14px;
  font-weight: 650;
  color: #1a2433;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.td-fp-task-copy span {
  font-size: 11px;
  color: #637185;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.td-fp-task-action {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 550;
  color: #2963e8;
  white-space: nowrap;
}

.td-fp-durs {
  display: flex;
  gap: 10px;
  margin: 0 0 14px;
  flex-wrap: wrap;
}
.td-fp-dur {
  min-width: 72px;
  width: auto;
  height: 56px;
  padding: 0 10px;
  border-radius: 12px;
  border: 1px solid #e0e6ee;
  background: #f3f5f9;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  cursor: pointer;
  font: inherit;
  color: #1a2433;
  box-sizing: border-box;
}
.td-fp-dur strong { font-size: 22px; font-weight: 650; line-height: 1.2; }
.td-fp-dur span { font-size: 11px; color: #637185; }
.td-fp-dur.is-on {
  background: #e6edff;
  border-color: #2963e8;
  color: #2963e8;
}
.td-fp-dur.is-on span { color: #2963e8; }
.td-fp-hint {
  margin: 0 0 20px;
  font-size: 12px;
  color: #637185;
  line-height: 1.45;
}
.td-fp-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: auto;
  min-width: 200px;
  max-width: 280px;
  min-height: 40px;
  height: 40px;
  padding: 0 20px;
  margin: 4px auto 0;
  border: 1px solid #2963e8;
  border-radius: 10px;
  background: #2963e8;
  color: #fff;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
  font-family: inherit;
  box-sizing: border-box;
}
/* global button:hover → white/gray — keep blue */
.td-fp-primary:hover,
.td-fp-primary:focus-visible,
.td-fp-primary:active {
  background: #1f54d0 !important;
  border-color: #1f54d0 !important;
  color: #fff !important;
  filter: none;
}
.td-fp-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  filter: none;
}
.td-fp-setup .td-fp-primary,
.td-fp-live .td-fp-primary {
  display: flex;
}
.td-fp-primary-mid {
  width: auto;
  min-width: 220px;
  max-width: 300px;
  margin: 0 auto;
}
.td-fp-primary-ico { font-size: 13px; line-height: 1; }
.td-fp-foot {
  margin: 16px 0 0;
  font-size: 12px;
  color: #637185;
  text-align: center;
  line-height: 1.45;
}

.td-fp-live { text-align: center; }
.td-fp-ring-wrap {
  position: relative;
  width: 176px;
  height: 176px;
  margin: 8px auto 22px;
}
.td-fp-ring { display: block; transform: rotate(-90deg); }
.td-fp-ring-track { stroke: #dbe3f2; }
.td-fp-ring-prog {
  stroke: #2963e8;
  stroke-dasharray: 527.79;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.35s linear;
}
.td-fp-ring-readout {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.td-fp-ring-readout strong {
  font-size: 28px;
  font-weight: 650;
  color: #2963e8;
  letter-spacing: -0.02em;
  line-height: 1;
}
.td-fp-ring-readout span {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 550;
  color: #667385;
  letter-spacing: 0.06em;
}

.td-fp-steps-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.td-fp-steps-head h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 650;
  color: #1a2433;
}
.td-fp-steps-head span {
  font-size: 12px;
  font-weight: 550;
  color: #637185;
}
.td-fp-steps-list { display: flex; flex-direction: column; gap: 14px; }
.td-fp-step {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}
.td-fp-step-n {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #f3f5f9;
  color: #637185;
  font-size: 10px;
  font-weight: 650;
  display: grid;
  place-items: center;
}
.td-fp-step-t {
  font-size: 13px;
  font-weight: 550;
  color: #1a2433;
  min-width: 0;
}
.td-fp-step-m {
  font-size: 11px;
  color: #637185;
  white-space: nowrap;
}
.td-fp-steps-empty {
  font-size: 13px;
  color: #919eb0;
  padding: 4px 0;
}

.td-fp-settings h3,
.td-fp-prep h3 {
  margin: 0 0 6px;
  font-size: 19px;
  font-weight: 650;
  color: #1a2433;
}
.td-fp-side-sub {
  margin: 0;
  font-size: 12px;
  color: #637185;
  line-height: 1.45;
}
.td-fp-setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 8px;
  font-size: 12px;
  color: #637185;
}
.td-fp-setting-row strong {
  font-size: 13px;
  font-weight: 650;
  color: #1a2433;
  text-align: right;
}
.td-fp-set-block {
  margin: 0 0 14px;
}
.td-fp-set-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.td-fp-set-chip {
  min-width: 44px;
  height: 32px;
  padding: 0 10px;
  border-radius: 9px;
  border: 1px solid #e0e6ee;
  background: #f3f5f9;
  color: #1a2433;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}
.td-fp-set-chip:hover { border-color: #c5d0e0; }
.td-fp-set-chip.is-on {
  background: #e6edff;
  border-color: #2963e8;
  color: #2963e8;
}
.td-fp-set-chip.is-break.is-on {
  background: #e3f7ed;
  border-color: #1c9c6b;
  color: #1c9c6b;
}
.td-fp-set-hint {
  margin: 8px 0 0;
  font-size: 11px;
  color: #919eb0;
  line-height: 1.4;
}
.td-fp-set-cycle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.td-fp-set-cycle-btn {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  border: 1px solid #e0e6ee;
  background: #fff;
  color: #1a2433;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
}
.td-fp-set-cycle-btn:hover { border-color: #2963e8; color: #2963e8; }
.td-fp-set-cycle span {
  min-width: 1.5em;
  text-align: center;
  font-size: 15px;
  font-weight: 650;
  color: #1a2433;
}
.td-fp-sound {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 4px;
  width: 100%;
  border: none;
  background: transparent;
  padding: 0;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.td-fp-sound:hover .td-fp-sound-ico { filter: brightness(0.97); }
.td-fp-sound.is-off .td-fp-sound-ico {
  background: #f3f5f9;
  color: #919eb0;
}
.td-fp-sound-ico {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #e3f7ed;
  color: #1c9c6b;
  display: grid;
  place-items: center;
  font-size: 14px;
  flex-shrink: 0;
}
.td-fp-sound strong {
  display: block;
  font-size: 13px;
  font-weight: 550;
  color: #1a2433;
}
.td-fp-sound span {
  font-size: 11px;
  color: #637185;
}
body[data-desktop-nav="focus"] .td-fp-settings.is-locked .td-fp-set-presets,
body[data-desktop-nav="focus"] .td-fp-settings.is-locked .td-fp-set-cycle {
  opacity: 0.55;
  pointer-events: none;
}
.td-fp-checklist {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.td-fp-checklist li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12px;
  color: #1a2433;
  line-height: 1.35;
}
.td-fp-checklist i {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 9px;
  background: #e3f7ed;
  color: #1c9c6b;
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
}
.td-fp-quote {
  margin: 28px 0 0;
  font-size: 11px;
  color: #637185;
}

/* Picker modal */
.td-fp-picker {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(20, 31, 48, 0.24);
  display: grid;
  place-items: center;
  padding: 24px;
  box-sizing: border-box;
}
.td-fp-picker[hidden] { display: none !important; }
.td-fp-picker-modal {
  position: relative;
  width: min(600px, 100%);
  max-height: min(650px, calc(100vh - 48px));
  overflow: auto;
  background: #fff;
  border: 1px solid #e0e5ed;
  border-radius: 16px;
  padding: 24px 27px 24px;
  box-sizing: border-box;
}
.td-fp-picker-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: #667385;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.td-fp-picker-modal h2 {
  margin: 4px 0 8px;
  font-size: 24px;
  font-weight: 650;
  color: #1a2433;
  padding-right: 28px;
}
.td-fp-picker-sub {
  margin: 0 0 18px;
  font-size: 13px;
  color: #667385;
}
.td-fp-picker-search {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 14px;
  border: 1px solid #e0e5ed;
  border-radius: 10px;
  background: #fafbfe;
  margin-bottom: 16px;
  box-sizing: border-box;
}
.td-fp-picker-search span { color: #667385; font-size: 18px; }
.td-fp-picker-search input {
  flex: 1;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 14px;
  color: #1a2433;
  outline: none;
  min-width: 0;
}
.td-fp-picker-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 11px;
  font-weight: 650;
  color: #667385;
  letter-spacing: 0.04em;
}
.td-fp-picker-link {
  border: none;
  background: none;
  color: #2963e8;
  font-size: 12px;
  font-weight: 550;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
}
.td-fp-picker-results {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 280px;
  overflow: auto;
  margin-bottom: 14px;
}
.td-fp-pick-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
  align-items: center;
  width: 100%;
  min-height: 62px;
  padding: 10px 14px;
  border: 1px solid #e0e5ed;
  border-radius: 10px;
  background: #fff;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  box-sizing: border-box;
}
.td-fp-pick-item strong {
  grid-column: 1;
  font-size: 13px;
  font-weight: 550;
  color: #1a2433;
}
.td-fp-pick-item em {
  grid-column: 1;
  font-style: normal;
  font-size: 11px;
  color: #667385;
}
.td-fp-pick-item span {
  grid-column: 2;
  grid-row: 1 / span 2;
  font-size: 10px;
  color: #667385;
  text-align: right;
}
.td-fp-pick-item.is-on {
  background: #e8f0ff;
  border-color: #2963e8;
}
.td-fp-pick-item.is-on span {
  color: #2963e8;
  font-size: 17px;
  font-weight: 700;
}
.td-fp-picker-note {
  margin: 0 0 16px;
  font-size: 11px;
  color: #667385;
}
.td-fp-cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.td-fp-cal-nav strong { font-size: 15px; color: #1a2433; }
.td-fp-cal-nav button {
  width: 32px;
  height: 32px;
  border: 1px solid #e0e5ed;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-size: 18px;
  color: #637185;
}
.td-fp-cal-weekdays,
.td-fp-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 10px;
}
.td-fp-cal-weekdays span {
  text-align: center;
  font-size: 11px;
  color: #919eb0;
  padding: 4px 0;
}
.td-fp-cal-day {
  height: 34px;
  border: none;
  border-radius: 8px;
  background: transparent;
  font: inherit;
  font-size: 12px;
  color: #1a2433;
  cursor: pointer;
}
.td-fp-cal-day.is-mute { color: #b8bfcc; }
.td-fp-cal-day.is-on {
  background: #e6edff;
  color: #2963e8;
  font-weight: 650;
}
.td-fp-cal-day.has-tasks { box-shadow: inset 0 -2px 0 #2963e8; }
.td-fp-cal-find { margin-top: 8px; }
.td-fp-cal-results { max-height: 160px; }

@media (max-width: 1100px) {
  .td-fp-layout { grid-template-columns: 1fr; }
  .td-fp-side { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
}
@media (max-width: 720px) {
  .td-fp-head { flex-direction: column; }
  .td-fp-side { grid-template-columns: 1fr; }
  .td-fp-durs { flex-wrap: wrap; }
  .td-fp-card { padding: 20px 18px 22px; border-radius: 16px; }
}

/* ===== Daily workspace — Figma 69 / 76 ===== */
.td-daily-page { display: none; }
body.td-daily-page-open .app-main {
  overflow: hidden !important;
}
body.td-daily-page-open .workspace {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: 100%;
  max-height: 100%;
  overflow: hidden !important;
  padding-bottom: 16px !important;
  display: flex;
  flex-direction: column;
}
body.td-daily-page-open .td-daily-page {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  overflow: hidden;
}
body.td-daily-page-open #boardGrid.board-grid,
body.td-daily-page-open .td-today-rail {
  display: none !important;
}
body.td-daily-page-open .td-new-task-page,
body.td-daily-page-open .td-focus-page {
  display: none !important;
}

.td-dp-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin: 4px 0 16px;
  flex-shrink: 0;
}
.td-dp-head h1 {
  margin: 0 0 8px;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #1a2433;
  line-height: 1.15;
}
.td-dp-sub {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #1a2433;
}
.td-dp-badge {
  flex-shrink: 0;
  height: 38px;
  padding: 0 18px;
  border-radius: 18px;
  background: #e5edff;
  color: #1a2433;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
}

.td-dp-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 20px;
  align-items: stretch;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}
.td-dp-main {
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.td-dp-card {
  background: #fff;
  border: 1px solid #e0e5ed;
  border-radius: 18px;
  box-sizing: border-box;
}
.td-dp-chat {
  padding: 22px 24px 18px;
  min-height: 0;
  height: 100%;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
}
.td-dp-chat-head {
  flex-shrink: 0;
}
.td-dp-chat-head h2 {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 600;
  color: #1a2433;
}
.td-dp-meta {
  margin: 0 0 14px;
  font-size: 12px;
  color: #637082;
}

.td-dp-greet {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 12px;
  flex-shrink: 0;
}
.td-dp-greet-dot {
  width: 8px;
  height: 8px;
  margin-top: 7px;
  border-radius: 4px;
  background: #1a9166;
  flex-shrink: 0;
}
.td-dp-greet strong {
  display: block;
  font-size: 16px;
  font-weight: 600;
  color: #1a2433;
  margin-bottom: 6px;
}
.td-dp-greet p {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: #637082;
}

.td-dp-feed {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1 1 auto;
  min-height: 0;
  margin-bottom: 12px;
  padding-right: 6px;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.td-dp-feed:empty {
  display: flex;
  min-height: 48px;
}
.td-dp-bubble {
  max-width: 92%;
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.45;
  color: #1a2433;
  white-space: pre-wrap;
  word-break: break-word;
  box-sizing: border-box;
}
.td-dp-bubble.user {
  align-self: flex-end;
  background: #ebf2ff;
  border: 1px solid #ebf2ff;
}
.td-dp-bubble.bot {
  align-self: flex-start;
  background: #fff;
  border: 1px solid #dee5f0;
}
.td-dp-bubble.is-rich,
.td-dp-bubble.is-fn {
  max-width: 100%;
  align-self: stretch;
  padding: 18px 16px 14px;
  background: #fff;
  border: 1px solid #dee5f0;
  border-radius: 14px;
  white-space: normal;
  position: relative;
  overflow: visible;
}
/* богатый ответ ИИ внутри ленты Daily */
.td-dp-bubble.is-rich {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.td-dp-bubble.is-rich .ai-bot-md {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.td-dp-bubble.is-rich .ai-bot-md-p {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  color: #1a2433;
}
.td-dp-bubble.is-rich .ai-bot-md-h {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
  color: #1a2433;
}
.td-dp-bubble.is-rich .ai-bot-md-ul,
.td-dp-bubble.is-rich .ai-bot-md-ol {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.td-dp-bubble.is-rich .ai-bot-md-li {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  color: #1a2433;
  padding: 8px 12px 8px 28px;
  border: 1px solid #dee5f0;
  border-radius: 8px;
  background: #fff;
}
.td-dp-bubble.is-rich .ai-bot-steps {
  margin-top: 10px;
}
.td-dp-bubble.is-rich .ai-bot-task-cards {
  margin-top: 10px;
}
.td-dp-bubble.is-rich .ai-bot-msg-actions {
  margin-top: 10px;
}
.td-dp-bubble.is-fn .aifn-kind,
.td-dp-bubble.is-rich > .aifn-kind {
  align-self: flex-end;
  margin: -2px 0 2px;
}
.td-dp-bubble.is-fn .aifn {
  gap: 10px;
}
.td-dp-bubble.is-fn .aifn-sum {
  font-size: 15px;
  font-weight: 650;
  color: #1a2433;
}
.td-dp-bubble.is-fn .aifn-sec {
  color: #5b5bd6;
}
.td-dp-bubble.is-fn .aifn-card:not(.aifn-card-v2) {
  border-color: #dee5f0;
  border-radius: 12px;
  background: #fff;
}
.td-dp-bubble.is-fn .aifn-card-v2 {
  border: none;
  border-radius: 0;
  background: transparent;
  gap: 8px;
}
.td-dp-bubble.is-fn .aifn-card-v2 .aifn-row {
  border: 1px solid #dee5f0;
  border-radius: 8px;
  background: #fff;
}
.td-dp-bubble.is-fn .aifn-foot-v2 {
  padding: 4px 0 0;
  border-top: none;
  background: transparent;
}
.td-dp-feed .ai-bot-msg.bot.is-fn {
  /* если когда-то попадёт сырой msg — без двойной рамки */
  border: 0;
  padding: 0;
  background: transparent;
}
/* план — сообщение бота в ленте */
.td-dp-bubble.td-dp-plan-msg {
  max-width: 100%;
  align-self: stretch;
  padding: 16px 16px 14px;
  background: #fff;
  border: 1px solid #dee5f0;
  border-radius: 14px;
}
.td-dp-plan {
  border: 1px solid #dee5f0;
  border-radius: 14px;
  padding: 16px 16px 14px;
  margin-bottom: 18px;
  background: #fff;
}
.td-dp-plan-intro strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #1a2433;
  margin-bottom: 4px;
}
.td-dp-plan-intro p {
  margin: 0 0 12px;
  font-size: 12px;
  color: #637082;
}
.td-dp-plan-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}
.td-dp-plan-empty {
  margin: 0;
  font-size: 13px;
  color: #637082;
  padding: 8px 0;
}
.td-dp-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 12px;
  align-items: center;
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 8px;
  border: 1px solid #dee5f0;
  background: #fff;
  box-sizing: border-box;
}
.td-dp-row.is-alt { background: #f7faff; }
.td-dp-row-title {
  font-size: 13px;
  font-weight: 600;
  color: #1a2433;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.td-dp-row-meta {
  font-size: 12px;
  color: #637082;
  text-align: right;
  white-space: nowrap;
}
.td-dp-row.is-edit {
  grid-template-columns: 18px minmax(0, 1fr) 108px 88px auto;
  background: #fff;
  cursor: grab;
}
.td-dp-row.is-dragging { opacity: 0.55; }
.td-dp-drag {
  color: #9aa6b8;
  font-size: 12px;
  letter-spacing: -2px;
  user-select: none;
}
.td-dp-row-time input,
.td-dp-row-dur input {
  width: 100%;
  height: 28px;
  border: 1px solid #dee5f0;
  border-radius: 8px;
  padding: 0 6px;
  font: inherit;
  font-size: 12px;
  color: #1a2433;
  background: #fff;
  box-sizing: border-box;
}
.td-dp-row-dur {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #637082;
}
.td-dp-row-dur input { width: 56px; }
.td-dp-row-tag {
  font-size: 12px;
  color: #637082;
  white-space: nowrap;
}

.td-dp-plan-acts {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.td-dp-btn-primary {
  height: 34px;
  padding: 0 18px;
  border: 1px solid #2963e8 !important;
  border-radius: 10px;
  background: #2963e8 !important;
  color: #fff !important;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.td-dp-btn-primary:hover,
.td-dp-btn-primary:focus-visible,
.td-dp-btn-primary:active {
  background: #1f54d0 !important;
  border-color: #1f54d0 !important;
  color: #fff !important;
  filter: none;
}
.td-dp-btn-ghost {
  height: 34px;
  padding: 0 16px;
  border: 1px solid #dee5f0 !important;
  border-radius: 10px;
  background: #fff !important;
  color: #1a2433 !important;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.td-dp-btn-ghost:hover,
.td-dp-btn-ghost:focus-visible,
.td-dp-btn-ghost:active {
  background: #f7faff !important;
  border-color: #c9d4e6 !important;
  color: #1a2433 !important;
}

.td-dp-quick {
  margin-bottom: 12px;
  flex-shrink: 0;
}
.td-dp-quick-label {
  display: block;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 600;
  color: #637082;
}
.td-dp-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.td-dp-chip {
  height: 34px;
  padding: 0 14px;
  border-radius: 17px;
  border: 1px solid #e0e5ed !important;
  background: #fff !important;
  color: #1a2433 !important;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.td-dp-chip:hover,
.td-dp-chip:focus-visible,
.td-dp-chip:active {
  background: #f7faff !important;
  border-color: #c9d4e6 !important;
  color: #1a2433 !important;
}

.td-dp-composer {
  margin-top: 0;
  border: 1px solid #e0e5ed;
  border-radius: 14px;
  padding: 14px 14px 12px;
  background: #fff;
  flex-shrink: 0;
}
.td-dp-composer textarea {
  width: 100%;
  border: none;
  outline: none;
  resize: none;
  font: inherit;
  font-size: 14px;
  color: #1a2433;
  background: transparent;
  min-height: 44px;
  box-sizing: border-box;
}
.td-dp-composer textarea::placeholder { color: #637082; }
.td-dp-composer-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
}
.td-dp-composer-foot span {
  font-size: 11px;
  color: #637082;
}
.td-dp-send {
  width: 36px;
  height: 36px;
  border: 1px solid #2963e8 !important;
  border-radius: 10px;
  background: #2963e8 !important;
  color: #fff !important;
  font-size: 18px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0 !important;
}
.td-dp-send:hover,
.td-dp-send:focus-visible,
.td-dp-send:active {
  background: #1f54d0 !important;
  border-color: #1f54d0 !important;
  color: #fff !important;
  filter: none;
}
.td-dp-foot {
  margin: 10px 0 0;
  font-size: 11px;
  color: #637082;
  flex-shrink: 0;
}

.td-dp-side {
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.td-dp-side .td-dp-day {
  padding: 22px 20px 20px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.td-dp-day h3 {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 600;
  color: #1a2433;
}
.td-dp-day-date {
  margin: 0 0 16px;
  font-size: 12px;
  color: #637082;
}
.td-dp-day-box {
  border: 1px solid #e0e5ed;
  border-radius: 12px;
  background: #f7fafc;
  padding: 14px 16px 16px;
  margin-bottom: 22px;
}
.td-dp-day-box strong {
  display: block;
  font-size: 22px;
  font-weight: 600;
  color: #1a2433;
  margin-bottom: 4px;
}
.td-dp-day-box p {
  margin: 0 0 12px;
  font-size: 12px;
  color: #637082;
}
.td-dp-bar {
  height: 6px;
  border-radius: 3px;
  background: #e5ebf2;
  overflow: hidden;
}
.td-dp-bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 3px;
  background: #2963e8;
  transition: width 0.25s ease;
}

.td-dp-help-title {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 600;
  color: #1a2433;
}
.td-dp-tools {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}
.td-dp-tool {
  display: flex !important;
  flex-direction: row;
  justify-content: flex-start !important;
  align-items: flex-start !important;
  gap: 12px;
  width: 100%;
  text-align: left !important;
  min-height: 74px;
  padding: 14px 12px !important;
  border-radius: 12px;
  border: 1px solid #e0e5ed !important;
  background: #fff !important;
  color: #1a2433 !important;
  cursor: pointer;
  font: inherit;
  box-sizing: border-box;
  white-space: normal !important;
}
.td-dp-tool:hover,
.td-dp-tool:focus-visible,
.td-dp-tool:active {
  background: #f7faff !important;
  border-color: #c9d4e6 !important;
  color: #1a2433 !important;
  opacity: 1 !important;
  filter: none;
}
.td-dp-tool-ico {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #ebf2ff !important;
  color: #2963e8 !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin: 0;
}
.td-dp-tool-ico svg {
  width: 18px;
  height: 18px;
  display: block;
}
.td-dp-tool:hover .td-dp-tool-ico,
.td-dp-tool:focus-visible .td-dp-tool-ico {
  background: #ebf2ff !important;
  color: #2963e8 !important;
}
.td-dp-tool > span:last-child {
  display: block;
  min-width: 0;
  flex: 1;
  text-align: left;
}
.td-dp-tool strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #1a2433 !important;
  margin-bottom: 3px;
}
.td-dp-tool small {
  display: block;
  font-size: 11px;
  color: #637082 !important;
  line-height: 1.35;
  white-space: normal;
}
.td-dp-tool:hover strong,
.td-dp-tool:hover small {
  color: inherit;
}
.td-dp-tool:hover strong { color: #1a2433 !important; }
.td-dp-tool:hover small { color: #637082 !important; }

.td-dp-tip {
  border-radius: 12px;
  background: #ebf2ff;
  padding: 16px;
}
.td-dp-tip strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #2963e8;
  margin-bottom: 8px;
}
.td-dp-tip p {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.45;
  color: #1a2433;
}
.td-dp-tip-link {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  color: #2963e8;
  cursor: pointer;
}
.td-dp-tip-link:hover { text-decoration: underline; }

@media (max-width: 1100px) {
  .td-dp-layout {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }
  .td-dp-side {
    max-height: none;
    overflow: visible;
  }
  .td-dp-side .td-dp-day {
    overflow: visible;
  }
}
@media (max-width: 720px) {
  .td-dp-head { flex-direction: column; }
  .td-dp-chat { min-height: 0; padding: 18px 16px; }
  .td-dp-row.is-edit {
    grid-template-columns: 18px minmax(0, 1fr);
  }
  .td-dp-row-time,
  .td-dp-row-dur,
  .td-dp-row-tag { grid-column: 2; }
}

/* ========== Settings page (Figma 1:268 / 83:xxxx) ========== */
.td-settings-page { display: none; }
body.td-settings-page-open .td-settings-page {
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 28px 20px 48px;
  box-sizing: border-box;
}
body.td-settings-page-open .app-main { overflow-y: auto; }
body.td-settings-page-open #boardGrid.board-grid,
body.td-settings-page-open .td-today-rail,
body.td-settings-page-open .td-daily-page,
body.td-settings-page-open .td-focus-page,
body.td-settings-page-open .td-new-task-page {
  display: none !important;
}
.td-sp-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  max-width: 1100px;
}
.td-sp-head h1 {
  margin: 0;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #1a2433;
}
.td-sp-sub {
  margin: 6px 0 0 2px;
  font-size: 14px;
  font-weight: 600;
  color: #1a2433;
}
.td-sp-badge {
  height: 38px;
  width: 190px;
  padding: 0 16px 0 17px;
  border-radius: 18px;
  background: #e5edff;
  color: #1a2433;
  font-size: 12px;
  font-weight: 650;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  white-space: nowrap;
  box-sizing: border-box;
}
.td-sp-badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2963e8;
}
.td-sp-badge.is-life { background: #def5ed; }
.td-sp-badge.is-life::before { background: #0a8f7d; }
.td-sp-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px;
  background: #eef2f7;
  border-radius: 12px;
  width: fit-content;
  max-width: 100%;
}
.td-sp-tab {
  border: 0;
  background: transparent;
  height: 36px;
  padding: 0 14px;
  border-radius: 9px;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  color: #667387;
  cursor: pointer;
}
.td-sp-tab.is-on {
  background: #fff;
  color: #2963e8;
  box-shadow: 0 1px 2px rgba(26, 36, 51, 0.06);
}
.td-sp-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 20px;
  align-items: start;
  width: 100%;
  max-width: 1100px;
}
.td-sp-main { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.td-sp-card {
  border: 1px solid #e0e5ed;
  border-radius: 16px;
  background: #fff;
  padding: 22px 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.td-sp-card h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 750;
  color: #1a2433;
}
.td-sp-hint { margin: -4px 0 0; font-size: 13px; line-height: 1.45; color: #667387; }
.td-sp-field { display: flex; flex-direction: column; gap: 6px; }
.td-sp-field > span,
.td-sp-field .settings-field-label {
  font-size: 12px;
  font-weight: 650;
  color: #667387;
}
.td-sp-field input,
.td-sp-field select,
.td-sp-card .tz-select {
  height: 44px;
  padding: 0 12px;
  border: 1px solid #dee5f0;
  border-radius: 10px;
  font: inherit;
  font-size: 14px;
  color: #1a2433;
  background: #fff;
  box-sizing: border-box;
}
.td-sp-field select,
.td-sp-card .tz-select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23667387' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.td-sp-field select:hover,
.td-sp-card .tz-select:hover {
  border-color: #b8c9f8;
}
.td-sp-field select:focus-visible,
.td-sp-card .tz-select:focus-visible {
  outline: none;
  border-color: #2963e8;
  box-shadow: 0 0 0 3px rgba(41, 99, 232, .14);
}
.td-sp-field select:disabled {
  cursor: not-allowed;
  opacity: .65;
}
.td-sp-timezone-picker { position: relative; }
.td-sp-timezone-picker input { padding-right: 44px; }
.td-sp-timezone-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  display: grid;
  width: 30px;
  height: 30px;
  padding: 0;
  place-items: center;
  transform: translateY(-50%);
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #667387;
  cursor: pointer;
}
.td-sp-timezone-toggle:hover { background: #f3f6fa; color: #245de0; }
.td-sp-timezone-toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.td-sp-timezone-options {
  position: absolute;
  z-index: 300;
  top: calc(100% + 5px);
  right: 0;
  left: 0;
  max-height: 280px;
  overflow: auto;
  padding: 5px;
  border: 1px solid #dee5f0;
  border-radius: 12px;
  background: var(--bg-panel, #fff);
  color: var(--text-primary, #1a2433);
  box-shadow: 0 12px 30px rgba(26, 36, 51, .16);
}
.td-sp-timezone-options[hidden] { display: none; }
.td-sp-timezone-option {
  display: flex;
  width: 100%;
  min-height: 48px;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  padding: 7px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.td-sp-timezone-option:hover,
.td-sp-timezone-option[aria-selected="true"] { background: #e5edff; }
.td-sp-timezone-option strong { font-size: 13px; font-weight: 650; }
.td-sp-timezone-option small { color: #78869b; font-size: 11px; }
.td-sp-timezone-empty { padding: 12px 10px; color: #78869b; font-size: 12px; }
.td-sp-legacy-timezone-select { display: none !important; }
.td-sp-timezone-error { color: #b91c1c !important; }
.td-sp-field input[readonly] { background: #f6f8fb; color: #667387; }
.td-sp-timezone-input[aria-invalid="true"] { border-color: #dc2626; }
.td-sp-primary,
.td-sp-secondary,
.td-sp-danger {
  align-self: flex-start;
  height: 42px;
  padding: 0 18px;
  border-radius: 10px;
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
  border: 1px solid transparent;
}
.td-sp-primary {
  background: #2963e8;
  border-color: #2963e8;
  color: #fff;
}
.td-sp-primary:hover { background: #1f54d0; }
.td-sp-secondary {
  background: #fff;
  border-color: #dee5f0;
  color: #1a2433;
}
.td-sp-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.td-sp-danger {
  background: #fff;
  border-color: #fecaca;
  color: #b91c1c;
}
.td-sp-link-danger {
  align-self: flex-start;
  border: 0;
  background: none;
  padding: 0;
  color: #b91c1c;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}
.td-sp-hr {
  border: 0;
  border-top: 1px solid #eef2f7;
  margin: 4px 0;
}
.td-sp-list {
  margin: 0;
  padding-left: 1.15em;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: #1a2433;
  font-size: 14px;
  line-height: 1.4;
}
.td-sp-spaces {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.td-sp-space {
  border: 1px solid #dee5f0;
  border-radius: 12px;
  padding: 14px 16px;
  text-align: left;
  cursor: pointer;
  font: inherit;
  background: #fff;
  color: #1a2433;
}
.td-sp-space strong { display: block; font-size: 14px; }
.td-sp-space small { display: block; margin-top: 4px; font-size: 12px; color: #667387; }
.td-sp-space.is-work.is-on,
.td-sp-space.is-work:hover { background: #e5edff; border-color: #c9d7ff; }
.td-sp-space.is-life.is-on,
.td-sp-space.is-life:hover { background: #def5ed; border-color: #b7e8d8; }
.td-sp-side { display: flex; flex-direction: column; gap: 12px; }
.td-sp-side-card {
  border: 1px solid #e0e5ed;
  border-radius: 16px;
  background: #fff;
  padding: 16px;
  color: #1a2433;
}
.td-sp-side-card h3 { margin: 0 0 6px; font-size: 14px; font-weight: 650; }
.td-sp-side-card p { margin: 0 0 12px; font-size: 12px; line-height: 1.45; color: #667387; }
.td-sp-side-pill {
  display: block;
  width: 100%;
  height: 44px;
  margin-top: 8px;
  border: 0;
  border-radius: 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  text-align: left;
  padding: 0 16px;
}
.td-sp-side-pill.is-work { background: #e5edff; color: #1a2433; }
.td-sp-side-pill.is-life { background: #def5ed; color: #1a2433; }
.td-sp-side-pill:focus-visible,
.td-sp-tab:focus-visible {
  outline: 2px solid #2963e8;
  outline-offset: 2px;
}
.td-sp-card .ww-grid { margin-top: 4px; }
.td-sp-card .theme-pill-toggle { flex-wrap: wrap; }
.td-sp-card .settings-check { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.td-sp-panel:not([hidden]) { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.td-sp-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.td-sp-field small,
.td-sp-muted { color: #78869b; font-size: 12px; line-height: 1.45; }
.td-sp-choice-field { min-width: 0; margin: 0; padding: 0; border: 0; }
.td-sp-choice-field legend { margin-bottom: 8px; color: #667387; font-size: 12px; font-weight: 650; }
.td-sp-segmented {
  display: flex;
  min-height: 42px;
  padding: 2px;
  gap: 4px;
  border: 1px solid #dee5f0;
  border-radius: 10px;
  background: #fff;
}
.td-sp-segmented button {
  flex: 1 1 0;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #344055;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.td-sp-segmented button[aria-pressed="true"] { border-color: #7093ff; background: #e5edff; color: #245de0; }
.td-sp-segmented button:focus-visible { outline: 2px solid #2963e8; outline-offset: 1px; }
.td-sp-preview,
.td-sp-capture-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid #eef2f7;
  padding-top: 12px;
  color: #78869b;
  font-size: 12px;
}
.td-sp-preview strong { color: #344055; }
.td-sp-profile-email { max-width: 50%; }
.td-sp-backup-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 16px;
  border-top: 1px solid #eef2f7;
}
.td-sp-backup-actions h3 { margin: 0 0 4px; color: #1a2433; font-size: 14px; }
.td-sp-backup-actions .td-sp-muted { margin: 0; }
.td-sp-backup-actions .td-sp-actions { flex-wrap: wrap; }
.td-sp-spaces .td-sp-space {
  display: flex;
  width: 100%;
  box-sizing: border-box;
  min-height: 112px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  font: inherit;
  cursor: pointer;
  transition: box-shadow .16s ease, border-color .16s ease, transform .16s ease;
}
.td-sp-spaces .td-sp-space:hover { transform: none; }
.td-sp-space.is-work { background: #e7eeff; border-color: #e7eeff; }
.td-sp-space.is-life { background: #def5ed; border-color: #def5ed; }
.td-sp-space.is-selected.is-work { border-color: #8eacff; box-shadow: 0 0 0 2px rgba(41, 99, 232, .18); }
.td-sp-space.is-selected.is-life { border-color: #87d7c5; box-shadow: 0 0 0 2px rgba(10, 143, 125, .17); }
.td-sp-space:focus-visible { outline: 2px solid #2963e8; outline-offset: 3px; }
.td-sp-space span { display: flex; justify-content: space-between; width: 100%; margin-top: 14px; color: #78869b; font-size: 11px; }
.td-sp-space span b { color: #2963e8; font-weight: 650; }
.td-sp-space.is-life span b { color: #078c79; }
.td-sp-capture-preview { position: relative; flex-wrap: wrap; justify-content: flex-start; }
.td-sp-capture-preview span { width: 100%; color: #1a2433; font-weight: 650; }
.td-sp-capture-preview small { color: #78869b; }
.td-sp-capture-preview b { margin-left: auto; padding: 7px 12px; border-radius: 8px; background: #def5ed; color: #078c79; font-size: 12px; }
.td-sp-capture-preview b.is-work { background: #e7eeff; color: #245de0; }
.td-sp-form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 44px;
  color: #78869b;
  font-size: 12px;
}
.td-sp-form-actions > div { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.td-sp-form-actions .td-sp-primary,
.td-sp-form-actions .td-sp-secondary,
.td-sp-form-actions .td-sp-danger { align-self: auto; height: 40px; }
.td-sp-switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 48px;
  border-bottom: 1px solid #eef2f7;
  cursor: pointer;
}
.td-sp-switch-row:last-child { border-bottom: 0; }
.td-sp-switch-row span { display: flex; flex: 1; flex-direction: column; gap: 4px; }
.td-sp-switch-row strong { color: #1a2433; font-size: 13px; font-weight: 600; }
.td-sp-switch-row small { color: #78869b; font-size: 11px; line-height: 1.4; }
.td-sp-switch-row input[type="checkbox"] {
  appearance: none;
  position: relative;
  flex: 0 0 42px;
  width: 42px;
  height: 24px;
  margin: 0;
  border: 0;
  border-radius: 99px;
  background: #cbd4e1;
  cursor: pointer;
  transition: background .16s ease;
}
.td-sp-switch-row input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(20, 32, 54, .2);
  transition: transform .16s ease;
}
.td-sp-switch-row input[type="checkbox"]:checked { background: #2963e8; }
.td-sp-switch-row input[type="checkbox"]:checked::after { transform: translateX(18px); }
.td-sp-switch-row input[type="checkbox"]:focus-visible { outline: 2px solid #2963e8; outline-offset: 3px; }
.td-sp-push-wrap { min-width: 0; }
.td-sp-danger-card { border-color: #f2d5d5; }
.td-sp-danger-card h2 { color: #1a2433; }
.td-sp-data-actions { display: flex; justify-content: flex-end; }
.td-sp-data-actions .td-sp-primary,
.td-sp-data-actions .td-sp-danger { align-self: auto; }
.td-sp-side-card.is-accent { border-color: #d7eee7; background: #def5ed; }
.td-sp-side-card.is-accent h3 { color: #078c79; }
.td-sp-side-card.is-accent-blue { border-color: #d9e4ff; background: #e7eeff; }
.td-sp-side-card.is-accent-blue h3 { color: #245de0; }
.td-sp-side-link {
  display: block;
  margin-top: 10px;
  padding: 0;
  border: 0;
  background: none;
  color: #245de0;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}
.td-sp-side-card .td-sp-hr { margin: 10px 0; }
.td-sp-danger-card .td-sp-form-grid { margin-top: 4px; }
@media (max-width: 640px) {
  .td-sp-form-grid { grid-template-columns: 1fr; }
  .td-sp-profile-email { max-width: none; }
  .td-sp-form-actions { align-items: stretch; flex-direction: column; }
  .td-sp-form-actions > div { justify-content: flex-start; }
  .td-sp-preview { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 980px) {
  .td-sp-layout { grid-template-columns: 1fr; }
  .td-sp-side { order: -1; }
  .td-sp-spaces { grid-template-columns: 1fr; }
}

body.td-settings-page-open .td-settings-page[data-tab="rhythm"] .td-sp-layout {
  display: block;
  max-width: none;
}
body.td-settings-page-open .td-settings-page[data-tab="rhythm"] .td-sp-main {
  width: 100%;
}
body.td-settings-page-open .td-settings-page[data-tab="rhythm"] #tdSettingsSide {
  display: none !important;
}
.td-sp-panel[data-panel="rhythm"]:not([hidden]) {
  display: block;
  width: 100%;
}
.td-sp-rhythm-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 286px;
  gap: 20px;
  align-items: start;
  width: 100%;
}
.td-sp-rhythm-main,
.td-sp-rhythm-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
.td-sp-rhythm-card,
.td-sp-daily-card {
  padding: 22px;
}
.td-sp-rhythm-card h2,
.td-sp-daily-card h2 {
  font-size: 19px;
}
.td-sp-choice-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
}
.td-sp-choice-group,
.td-sp-day-group {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.td-sp-choice-group legend,
.td-sp-day-group legend {
  margin-bottom: 8px;
  padding: 0;
  color: #1a2433;
  font-size: 13px;
  font-weight: 650;
}
.td-sp-choice-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
#tdSpBreakPresets {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.td-sp-choice {
  min-height: 44px;
  padding: 0 8px;
  border: 1px solid #e0e5ed;
  border-radius: 10px;
  background: #fff;
  color: #1a2433;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.td-sp-choice:hover { border-color: #b8c9f8; }
.td-sp-choice.is-on {
  border-color: #2963e8;
  background: #e5edff;
  color: #2963e8;
  font-weight: 700;
}
.td-sp-choice.is-break.is-on {
  border-color: #0a8f7d;
  background: #def5ed;
  color: #087968;
}
.td-sp-select-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}
.td-sp-rhythm-note {
  margin: -4px 0 0;
  color: #6e7a8f;
  font-size: 12px;
  line-height: 1.45;
}
.td-sp-day-group { margin-top: 2px; }
.td-sp-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}
.td-sp-day {
  min-width: 0;
  height: 44px;
  padding: 0 4px;
  border: 0;
  border-radius: 9px;
  background: #f3f6fa;
  color: #667387;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.td-sp-day.is-on {
  background: #e5edff;
  color: #2963e8;
  font-weight: 700;
}
.td-sp-days-hint {
  margin: -6px 0 0;
  color: #7a8799;
  font-size: 11px;
}
.td-sp-days-hint span { color: #2963e8; font-weight: 700; }
.td-sp-time-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}
.td-sp-time-grid .td-sp-field input { width: 100%; }
.td-sp-available {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 120px;
  padding: 0 0 5px;
}
.td-sp-available span {
  color: #667387;
  font-size: 12px;
}
.td-sp-available strong {
  color: #1a2433;
  font-size: 17px;
}
.td-sp-timezone {
  margin: -6px 0 0;
  color: #6e7a8f;
  font-size: 12px;
}
.td-sp-rhythm-callout,
.td-sp-rhythm-cycle {
  padding: 16px;
  border: 1px solid #e0e5ed;
  border-radius: 16px;
  background: #fff;
  color: #1a2433;
}
.td-sp-rhythm-callout {
  border-color: transparent;
  background: #e5edff;
  color: #2963e8;
}
.td-sp-rhythm-callout strong {
  display: block;
  font-size: 14px;
  line-height: 1.4;
}
.td-sp-rhythm-callout p {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.5;
}
.td-sp-rhythm-callout.is-life {
  background: #def5ed;
  color: #087968;
}
.td-sp-rhythm-cycle h3 {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 700;
}
.td-sp-rhythm-cycle dl {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
}
.td-sp-rhythm-cycle dl div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.td-sp-rhythm-cycle dt {
  color: #667387;
  font-size: 12px;
}
.td-sp-rhythm-cycle dd {
  margin: 0;
  color: #1a2433;
  font-size: 12px;
  font-weight: 700;
  text-align: right;
}
.td-sp-rhythm-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 2px 0 0;
  color: #6e7a8f;
  font-size: 12px;
  line-height: 1.4;
}
.td-sp-rhythm-actions > div {
  display: flex;
  flex-shrink: 0;
  gap: 10px;
}
.td-sp-rhythm-actions .td-sp-secondary,
.td-sp-rhythm-actions .td-sp-primary {
  align-self: auto;
  white-space: nowrap;
}
.td-sp-choice:focus-visible,
.td-sp-day:focus-visible,
.td-sp-rhythm-actions button:focus-visible {
  outline: 2px solid #2963e8;
  outline-offset: 2px;
}
@media (max-width: 980px) {
  .td-sp-rhythm-layout { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .td-sp-rhythm-card,
  .td-sp-daily-card { padding: 16px; }
  .td-sp-choice-grid,
  .td-sp-select-grid { grid-template-columns: 1fr; gap: 14px; }
  .td-sp-choice-row { gap: 6px; }
  .td-sp-choice { min-height: 42px; font-size: 12px; }
  .td-sp-days { gap: 4px; }
  .td-sp-day { height: 44px; }
  .td-sp-time-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .td-sp-available {
    grid-column: 1 / -1;
    padding: 0;
  }
  .td-sp-rhythm-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .td-sp-rhythm-actions > div {
    flex-direction: column-reverse;
  }
  .td-sp-rhythm-actions .td-sp-secondary,
  .td-sp-rhythm-actions .td-sp-primary {
    width: 100%;
    justify-content: center;
  }
}

.mobile-app-nav { display: none; }
.td-nt-back { display: none; }

@media (max-width: 1024px) {
  .mobile-app-nav {
    position: fixed;
    z-index: 250;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    min-height: 60px;
    padding: 6px 8px max(6px, env(safe-area-inset-bottom));
    border-top: 1px solid #e0e5ed;
    background: rgba(255, 255, 255, 0.97);
    box-sizing: content-box;
    backdrop-filter: blur(14px);
  }
  .mobile-app-nav button {
    display: flex;
    min-width: 0;
    min-height: 48px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 3px 2px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #78869b;
    font: inherit;
    font-size: 10px;
    font-weight: 500;
    line-height: 1.15;
    cursor: pointer;
    box-shadow: none;
  }
  .mobile-app-nav button[aria-current="page"] {
    color: #2963e8;
    font-weight: 650;
  }
  .mobile-app-nav svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  .mobile-app-nav button:focus-visible {
    outline: 2px solid #2963e8;
    outline-offset: -2px;
  }
  .mobile-add-fab {
    bottom: calc(66px + env(safe-area-inset-bottom)) !important;
  }
  #boardGrid.board-grid {
    padding-bottom: 142px !important;
  }
  body.app-locked .mobile-app-nav,
  body.app-booting .mobile-app-nav,
  body.td-new-task-open .mobile-app-nav,
  body.td-settings-page-open .mobile-app-nav,
  body:has(#captureModal.active) .mobile-app-nav,
  body:has(#taskSheetOverlay.active) .mobile-app-nav,
  body:has(#settingsModal.active) .mobile-app-nav,
  body:has(#focusOverlay.active) .mobile-app-nav,
  body:has(.td-others-detail-overlay:not([hidden])) .mobile-app-nav {
    display: none !important;
  }
  body.td-new-task-open .ai-bot-root,
  body.td-focus-page-open .ai-bot-root,
  body.td-daily-page-open .ai-bot-root,
  body.td-settings-page-open .ai-bot-root {
    display: none !important;
  }
  body.td-new-task-open .mobile-add-fab,
  body.td-focus-page-open .mobile-add-fab,
  body.td-daily-page-open .mobile-add-fab,
  body.td-settings-page-open .mobile-add-fab {
    display: none !important;
  }

  body.td-new-task-open .app-main,
  body.td-focus-page-open .app-main,
  body.td-settings-page-open .app-main {
    overflow-y: auto !important;
  }
  body.td-new-task-open .workspace,
  body.td-focus-page-open .workspace,
  body.td-settings-page-open .workspace {
    flex: 0 0 auto;
    min-height: 0;
    height: auto;
    max-height: none;
    overflow: visible;
    padding: 8px 12px 96px;
  }
  body.td-new-task-open #boardGrid,
  body.td-new-task-open .td-focus-page,
  body.td-new-task-open .td-daily-page,
  body.td-new-task-open .td-settings-page {
    display: none !important;
  }
  body.td-new-task-open .td-new-task-page {
    display: flex !important;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 6px 0 24px;
    box-sizing: border-box;
  }
  .td-nt-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 4px 0 0;
  }
  .td-nt-back {
    display: grid;
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    place-items: center;
    margin: -2px 0 0 -4px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #2963e8;
    box-shadow: none;
  }
  .td-nt-back svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  .td-nt-head h1 {
    margin: 0 0 5px;
    font-size: 24px;
    line-height: 1.2;
  }
  .td-nt-sub {
    font-size: 13px;
    line-height: 1.4;
  }
  .td-nt-daily-badge {
    flex: 0 0 auto;
    height: auto;
    min-height: 36px;
    max-width: 42%;
    padding: 7px 10px;
    white-space: normal;
    font-size: 11px;
  }
  .td-nt-steps { margin: 0; }
  .td-nt-layout {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .td-nt-main,
  .td-nt-side {
    min-width: 0;
    padding: 15px 14px;
    border: 1px solid #e0e5ed;
    border-radius: 12px;
    background: #fff;
  }
  .td-nt-side {
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: static;
    opacity: 1;
    pointer-events: auto;
  }
  .td-nt-side > h2:first-child { margin-top: 0; }
  .td-nt-mode {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 14px;
  }
  .td-nt-mode-btn {
    min-width: 0;
    min-height: 44px;
    justify-content: center;
    align-items: center;
    padding: 8px 5px;
    text-align: center;
  }
  .td-nt-mode-btn strong { font-size: 11px; }
  .td-nt-mode-btn span { font-size: 10px; }
  .td-nt-h2 {
    margin: 16px 0 9px;
    font-size: 17px;
  }
  .td-nt-hint { font-size: 12px; }
  .td-nt-input,
  .td-nt-textarea,
  .td-nt-deadline,
  .td-nt-cal-custom-btn {
    min-height: 44px;
    font-size: 16px;
  }
  .td-nt-textarea { min-height: 84px; }
  .td-nt-cal {
    padding: 12px 10px;
    border-radius: 10px;
  }
  .td-nt-cal-grid { overflow-x: auto; }
  .td-nt-prio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .td-nt-prio-btn { min-width: 0; padding: 0 4px; }
  .td-nt-actions {
    display: flex;
    flex-direction: column-reverse;
    gap: 8px;
    margin-top: 8px;
  }
  .td-nt-actions button {
    width: 100%;
    min-height: 48px;
    justify-content: center;
  }
  .td-nt-side-foot { position: static; }
  .td-nt-voice {
    padding: 16px 12px;
    border: 1px solid #e0e5ed;
    border-radius: 12px;
    background: #fff;
  }

  body.td-focus-page-open .workspace {
    padding-top: 10px;
  }
  body.td-focus-page-open .td-focus-page {
    display: flex !important;
    flex-direction: column;
    gap: 12px;
    margin: 0;
    padding: 0 0 96px;
  }
  .td-fp-head {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 0 0 2px;
  }
  .td-fp-head h1 { font-size: 23px; }
  .td-fp-sub { font-size: 13px; line-height: 1.4; }
  .td-fp-badge { height: 30px; padding: 0 11px; font-size: 11px; }
  .td-fp-layout { display: flex; flex-direction: column; gap: 12px; }
  .td-fp-main,
  .td-fp-side { display: flex; flex-direction: column; gap: 12px; width: 100%; }
  .td-fp-card { padding: 16px 14px; border-radius: 12px; }
  .td-fp-hero h2 { font-size: 19px; }
  .td-fp-durs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
  .td-fp-dur { min-width: 0; height: 48px; }
  .td-fp-primary { width: 100%; max-width: none; min-height: 48px; }
  .td-fp-steps-list { gap: 7px; }
  .td-fp-picker {
    align-items: end;
    padding: 0;
  }
  .td-fp-picker-modal {
    width: 100%;
    max-height: min(88dvh, 760px);
    padding: 22px 18px max(20px, env(safe-area-inset-bottom));
    border-radius: 20px 20px 0 0;
  }
  .td-fp-picker-results { max-height: min(40dvh, 320px); }

  body.td-daily-page-open .app-main {
    overflow: hidden !important;
    min-height: 0;
  }
  body.td-daily-page-open .workspace {
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    padding: 8px 12px 82px;
  }
  body.td-daily-page-open .td-daily-page {
    min-height: 0;
    overflow: auto;
    padding-bottom: 8px;
  }
  .td-dp-head { gap: 4px; margin: 0 0 12px; }
  .td-dp-head h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
  .td-dp-sub { font-size: 14px; line-height: 1.4; }
  /* карточки Daily в масштабе макета 25 */
  body.td-daily-page-open .td-dp-day-box,
  body.td-daily-page-open .td-dp-tip,
  body.td-daily-page-open .td-dp-chat {
    padding: 16px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid #e6ebf3;
  }
  body.td-daily-page-open .td-dp-feed {
    gap: 10px;
    font-size: 14px;
    line-height: 1.45;
  }
  body.td-daily-page-open .td-dp-day-box h2,
  body.td-daily-page-open .td-dp-tip h2 {
    font-size: 17px;
    font-weight: 700;
  }
  .td-dp-sub { font-size: 12px; }
  .td-dp-layout { display: flex; flex-direction: column; gap: 10px; overflow: visible; }
  .td-dp-main,
  .td-dp-side { display: flex; flex-direction: column; gap: 10px; overflow: visible; }
  .td-dp-side { max-height: none; }
  .td-dp-chat { min-height: 250px; padding: 14px 12px; }
  .td-dp-feed { min-height: 150px; }
  .td-dp-day-box,
  .td-dp-tip { padding: 13px 12px; border-radius: 12px; }

  body.td-settings-page-open .workspace {
    padding-top: 10px;
    padding-bottom: 24px;
  }
  body.td-settings-page-open .td-settings-page {
    display: flex !important;
    gap: 12px;
    padding: 0 0 24px;
  }
  .td-sp-head { align-items: flex-start; gap: 8px; }
  .td-sp-head h1 { font-size: 24px; line-height: 1.2; }
  .td-sp-sub { font-size: 12px; }
  .td-sp-badge { display: none; }
  .td-sp-tabs {
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }
  .td-sp-tabs::-webkit-scrollbar { display: none; }
  .td-sp-tab { flex: 0 0 auto; padding: 0 12px; }
  .td-sp-layout { display: flex; flex-direction: column; gap: 12px; }
  .td-sp-main,
  .td-sp-side { display: flex; flex-direction: column; gap: 12px; width: 100%; }
  .td-sp-card { padding: 16px 14px; gap: 12px; border-radius: 12px; }
  .td-sp-card h2 { font-size: 17px; }
  .td-sp-hint { font-size: 12px; }
  .td-sp-field input,
  .td-sp-field select,
  .td-sp-card .tz-select { min-height: 44px; font-size: 16px; }
  .td-sp-timezone-options { max-height: min(42dvh, 320px); }
  .td-sp-actions { flex-direction: column; }
  .td-sp-actions button,
  .td-sp-primary,
  .td-sp-secondary { width: 100%; min-height: 46px; justify-content: center; }

  body:has(.td-others-detail-overlay:not([hidden])) .mobile-add-fab {
    display: none !important;
  }
  .td-others-detail-overlay:not([hidden]) {
    position: fixed;
    z-index: 300;
    display: block;
    inset: 0;
    pointer-events: auto;
    background: #f6f8fb;
  }
  .td-others-detail-backdrop { display: none; }
  .td-others-detail-panel {
    position: absolute;
    inset: 0;
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: 100%;
    padding-bottom: max(16px, env(safe-area-inset-bottom));
    border: 0;
    border-radius: 0 !important;
    box-shadow: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    animation: none;
  }
  .td-od { padding: 16px 14px 28px; }

  .auth-overlay {
    align-items: flex-start;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-top: env(safe-area-inset-top);
  }
  .auth-shell {
    min-height: 100%;
    padding: 0 24px max(24px, env(safe-area-inset-bottom));
  }
  .auth-top {
    height: 60px;
    border: 0;
  }
  .auth-logo { font-size: 22px; }
  .auth-top-note { display: none; }
  .auth-body {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 24px;
    padding: 36px 0 12px;
  }
  .auth-headline { font-size: clamp(36px, 10vw, 46px); }
  .auth-lead { margin-top: 12px; font-size: 15px; }
  .auth-card {
    gap: 14px;
    width: 100%;
    max-width: none;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }
  .auth-card-head h2 { font-size: 22px; }
  .auth-card .auth-sub { display: none; }
  .auth-form { gap: 14px; }
  .auth-form input { height: 50px; font-size: 16px; }
  .auth-submit { height: 50px; justify-content: center; }
  .auth-switch { text-align: left; }
  .auth-install-hint { padding-left: 0 !important; padding-right: 0 !important; }
}

@media (max-width: 380px) {
  .mobile-app-nav { padding-right: 4px; padding-left: 4px; }
  .mobile-app-nav button { font-size: 9px; }
  .td-nt-daily-badge { max-width: 38%; }
  .td-nt-prio-btn { font-size: 11px; }
  .td-sp-tab { padding: 0 9px; font-size: 12px; }
}

.td-sp-back,
.td-capture-label,
.td-others-search-label { display: none; }

@media (max-width: 1024px) {
  .topbar-shell {
    padding: env(safe-area-inset-top) 12px 0;
  }
  .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "brand actions" "realm realm";
    gap: 12px 8px;
    padding: 8px 0 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }
  .topbar-left { display: contents; }
  .brand-logo {
    grid-area: brand;
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: visible;
    height: auto;
  }
  .brand-logo .brand-lockup {
    display: flex !important;
    align-items: center;
    gap: 8px;
    color: #172338;
    white-space: nowrap;
  }
  .brand-lockup-mark {
    width: 34px;
    height: 32px;
    display: block;
    flex-shrink: 0;
  }
  .brand-lockup-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }
  .brand-logo .brand-word img { height: 22px; }
  .brand-lockup .brand-lockup-tagline {
    font-size: 6.5px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #8b97a9;
  }
  .brand-mark,
  .brand-ring { display: none !important; }
  .realm-switch,
  .topbar .realm-pill-toggle {
    grid-area: realm;
    display: flex;
    width: 100%;
    height: 38px;
    margin: 0;
    padding: 3px;
    border: 1px solid #e0e5ed;
    border-radius: 9px;
    background: #e7ebf2;
  }
  .realm-switch button,
  .topbar .realm-opt {
    flex: 1 1 50%;
    justify-content: center;
    height: 30px;
    min-height: 30px;
    padding: 0 8px;
    border-radius: 7px;
    font-size: 12px;
  }
  .realm-switch .realm-opt.active {
    color: #2963e8;
    background: #fff;
    box-shadow: 0 1px 3px rgba(17, 35, 67, 0.12);
  }
  .topbar-v-sep,
  .topbar-center,
  .topbar-menu,
  .add-task-group,
  #quickStartBtn {
    display: none !important;
  }
  .topbar-right,
  .topbar-actions {
    grid-area: actions;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    height: auto;
  }
  .mobile-topbar-action {
    display: grid;
    width: 38px;
    height: 38px;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: #e7edff;
    color: #2963e8;
    box-shadow: none;
  }
  .mobile-topbar-action.mobile-settings-action {
    background: transparent;
    color: #6b7a90;
  }
  .mobile-settings-action svg {
    width: 22px;
    height: 22px;
    stroke-width: 1.9;
  }
  .mobile-topbar-action svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  #mobileBoardTabs { display: none !important; }
  .day-load-banner { display: none !important; }
  .workspace {
    padding: 6px 12px 88px;
    gap: 0;
  }
  .board-grid {
    display: flex;
    flex: 0 0 auto;
    min-height: 0;
    gap: 0;
    padding-bottom: 0;
    overflow: visible;
  }
  .board-grid > .column-panel {
    flex: 0 0 auto;
    width: 100%;
    min-height: 0;
    overflow: visible;
  }

  body[data-desktop-nav="today"] #colToday,
  body[data-desktop-nav="today"] #colAside,
  body[data-desktop-nav="today"] #colToday > .column-body,
  body[data-desktop-nav="today"] #workTodaySections,
  body[data-desktop-nav="today"] #workTodaySections > .section-block,
  body[data-desktop-nav="today"] #lifeTodaySection {
    display: contents !important;
  }
  body[data-desktop-nav="today"] .td-today-hero {
    display: flex !important;
    order: 1;
    margin: 0 0 8px;
  }
  body[data-desktop-nav="today"] .td-today-hero h1 {
    font-size: 23px;
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.2;
    color: #1b2638;
  }
  body[data-desktop-nav="today"] .td-today-hero p {
    margin-top: 6px;
    font-size: 12px;
  }
  body[data-desktop-nav="today"] .td-today-hero .td-realm-badge { display: none; }
  body[data-desktop-nav="today"] .td-date-chip {
    display: inline-flex !important;
    order: 2;
    margin: 0 0 12px;
    padding: 0;
    background: transparent;
    color: #7a879b;
    font-size: 9px;
    letter-spacing: 0.04em;
  }
  body[data-desktop-nav="today"] .td-main-focus {
    display: flex !important;
    order: 3;
    flex-direction: column;
    align-items: stretch;
    gap: 11px;
    min-height: 0;
    margin: 0 0 12px;
    padding: 14px;
    border: 1px solid #e0e8fa;
    border-radius: 13px;
    background: #e8efff;
  }
  body[data-desktop-nav="today"] .td-main-focus-label {
    font-size: 13px;
    color: #1c2a42;
  }
  body[data-desktop-nav="today"] .td-main-focus-hint {
    margin-top: 5px;
    font-size: 11px;
  }
  body[data-desktop-nav="today"] .td-main-focus-title {
    margin: 7px 0 0;
    font-size: 15px;
    line-height: 1.3;
  }
  body[data-desktop-nav="today"] .td-main-focus-go {
    width: 100%;
    min-height: 42px;
    border-radius: 9px;
    border: 1px solid #2963e8;
    background: #2963e8;
    color: #fff;
    box-shadow: none;
  }
  body[data-desktop-nav="today"] .td-main-focus-go:not(:disabled):hover {
    border-color: #1f54d0;
    background: #1f54d0;
    color: #fff;
  }
  body[data-desktop-nav="today"] #tdProgressCard {
    display: block !important;
    order: 4;
    width: 100%;
    margin: 0 0 15px;
    padding: 12px;
    border: 1px solid #e3e8f0;
    border-radius: 12px;
    background: #fff;
    box-sizing: border-box;
  }
  body[data-desktop-nav="today"] #tdProgressCard h3 {
    display: inline;
    margin: 0;
    font-size: 11px;
    font-weight: 500;
    color: #8793a7;
  }
  body[data-desktop-nav="today"] #tdProgressCard .td-card-sub {
    display: block;
    margin: 7px 0 0;
    font-size: 9px;
  }
  body[data-desktop-nav="today"] #tdProgressCard .td-progress-track {
    display: block !important;
    width: 100%;
    height: 4px;
    margin-top: 9px;
    overflow: hidden;
    border-radius: 999px;
    background: #e5ebf5;
  }
  body[data-desktop-nav="today"] #tdProgressCard .td-progress-fill {
    height: 100%;
    border-radius: inherit;
    background: #2963e8;
  }
  body[data-desktop-nav="today"] #tdProgressStat {
    float: right;
    font-size: 12px;
    font-weight: 650;
  }
  body[data-desktop-nav="today"] .td-progress-track {
    height: 4px;
    margin-top: 9px;
  }
  body[data-desktop-nav="today"] .td-plan-head {
    display: flex !important;
    flex-direction: column;
    order: 5;
    align-items: flex-start;
    gap: 4px;
    margin: 0 0 3px;
  }
  body[data-desktop-nav="today"] .td-plan-head h2 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
  }
  body[data-desktop-nav="today"] .td-plan-summary {
    margin: 0;
    color: #7a879b;
    font-size: 10px;
  }
  body[data-desktop-nav="today"] #asideWorkday { display: none !important; }
  body[data-desktop-nav="today"] #colToday > .column-header,
  body[data-desktop-nav="today"] #colToday .tc-sec-head,
  body[data-desktop-nav="today"] #focusHero,
  body[data-desktop-nav="today"] .done-summary-bar,
  body[data-desktop-nav="today"] #asideWorkday {
    display: none !important;
  }
  body[data-desktop-nav="today"] #todayEmptyHero {
    display: block;
    order: 6;
  }
  body[data-desktop-nav="today"] #workTodaySections > .section-block:first-child {
    order: 7;
  }
  body[data-desktop-nav="today"] #workTodaySections > .section-block:nth-child(2) {
    order: 8;
  }
  body[data-desktop-nav="today"] #lifeTodaySection {
    order: 7;
  }
  body[data-desktop-nav="today"] #mainSlotsList,
  body[data-desktop-nav="today"] #quickSlotsList,
  body[data-desktop-nav="today"] #lifeTodayList {
    display: contents !important;
  }
  body[data-desktop-nav="today"] #quickSlotsList { display: none !important; }
  body[data-desktop-nav="today"] #mainSlotsList .tc-list,
  body[data-desktop-nav="today"] #quickSlotsList .tc-list,
  body[data-desktop-nav="today"] #lifeTodayList .tc-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
    width: 100%;
    min-width: 0;
    padding: 0;
    order: 6;
    box-sizing: border-box;
  }
  body[data-desktop-nav="today"] .td-plan-show-all:not([hidden]) {
    display: flex;
    order: 7;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 36px;
    margin: 0 0 2px;
    border: 1px solid #e2e8f1;
    border-radius: 9px;
    background: #fff;
    color: #1b2638;
    font-size: 10px;
    font-weight: 600;
    box-shadow: none;
  }
  body[data-desktop-nav="today"] .td-plan-show-all:not([hidden]):hover {
    border-color: #cbd6e5;
    background: #f8faff;
  }
  body[data-desktop-nav="today"] .td-figma-plan > .tcard:nth-child(n + 5) {
    display: none !important;
  }
  body[data-desktop-nav="today"].td-plan-expanded .td-figma-plan > .tcard {
    display: flex !important;
  }
  body[data-desktop-nav="today"] #colToday .tc-empty,
  body[data-desktop-nav="today"] #colToday .empty-slot-box,
  body[data-desktop-nav="today"] #colToday .empty-slot-pill,
  body[data-desktop-nav="today"] #colToday .empty-guide {
    display: none !important;
  }
  body[data-desktop-nav="today"] #colToday .task-card.tcard {
    width: 100%;
    min-width: 0;
    min-height: 46px;
    padding: 0;
    box-sizing: border-box;
  }
  body[data-desktop-nav="today"] #colToday .task-card.tcard .tc-row {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr) 26px;
    grid-template-rows: auto auto;
    grid-template-areas: "check title more" "check meta more";
    min-height: 44px;
    row-gap: 0;
    padding: 4px 8px;
    font-size: 11px;
    line-height: 1.25;
    box-sizing: border-box;
  }
  body[data-desktop-nav="today"] #colToday .task-card.tcard .tc-title {
    font-size: 11px;
    font-weight: 500;
    line-height: 1.25;
  }
  body[data-desktop-nav="today"] #colToday .task-card.tcard .tc-meta {
    margin-top: 1px;
    font-size: 9px;
    line-height: 1.2;
  }
  body[data-desktop-nav="today"] #tdCaptureCard .td-capture-label {
    display: block;
    margin: 0 0 5px;
    color: #1b2638;
    font-size: 9px;
    font-weight: 500;
  }
  body[data-desktop-nav="today"] #tdCaptureCard .td-capture-input {
    width: 100%;
    min-height: 34px;
    padding: 0 10px;
    border: 1px solid #e2e8f1;
    border-radius: 8px;
    background: #fff;
    color: #1b2638;
    font-size: 10px;
    box-sizing: border-box;
  }
  body[data-desktop-nav="today"] #tdCaptureCard .td-capture-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 36px;
    margin-top: 8px;
    border: 1px solid #2963e8;
    border-radius: 9px;
    background: #2963e8;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    box-shadow: none;
  }
  body[data-desktop-nav="today"] #tdCaptureCard .td-capture-btn:hover {
    border-color: #1f54d0;
    background: #1f54d0;
    color: #fff;
  }
  body[data-desktop-nav="today"] #mainSlotsList .task-card.tcard,
  body[data-desktop-nav="today"] #quickSlotsList .task-card.tcard,
  body[data-desktop-nav="today"] #lifeTodayList .task-card.tcard {
    width: 100%;
    min-height: 46px;
    padding: 0;
    box-sizing: border-box;
    border: 1px solid #e2e8f1;
    border-radius: 10px;
    background: #fff;
    box-shadow: none;
  }
  body[data-desktop-nav="today"] .task-card.tcard .tc-row {
    min-height: 54px;
    grid-template-columns: 20px minmax(0, 1fr) 26px;
    gap: 8px;
    padding: 8px;
  }
  body[data-desktop-nav="today"] .task-card.tcard .tc-gut,
  body[data-desktop-nav="today"] .task-card.tcard .tc-mins,
  body[data-desktop-nav="today"] .task-card.tcard .tc-acts {
    display: none !important;
  }
  body[data-desktop-nav="today"] .task-card.tcard .tc-more {
    display: grid;
    grid-column: 3;
    grid-row: 1;
    width: 26px;
    height: 26px;
    place-items: center;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: #748198;
    font-size: 20px;
    box-shadow: none;
  }
  body[data-desktop-nav="today"] .task-card.tcard .tc-check {
    grid-column: 1;
    grid-row: 1;
    width: 17px;
    height: 17px;
  }
  body[data-desktop-nav="today"] .task-card.tcard .tc-body {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
  }
  body[data-desktop-nav="today"] .task-card.tcard .tc-title {
    font-size: 11px;
    font-weight: 500;
    line-height: 1.25;
  }
  body[data-desktop-nav="today"] .task-card.tcard .tc-meta {
    margin-top: 3px;
    font-size: 9px;
    color: #78869b;
  }
  body[data-desktop-nav="today"] #tdCaptureCard {
    display: block !important;
    width: 100%;
    margin-top: 12px;
    padding: 12px;
    border: 1px solid #e2e8f1;
    border-radius: 12px;
    background: #fff;
    box-sizing: border-box;
  }
  body[data-desktop-nav="today"] #tdCaptureCard { order: 8; }
  body[data-desktop-nav="today"] #tdCaptureCard h3 {
    margin: 0;
    font-size: 12px;
  }
  body[data-desktop-nav="today"] #tdCaptureCard .td-card-sub {
    margin: 6px 0 9px;
    font-size: 10px;
  }

  body[data-desktop-nav="tasks"] .td-others-hero {
    display: flex !important;
    flex-direction: column;
    gap: 5px;
    margin: 2px 0 13px;
  }
  body[data-desktop-nav="tasks"] .td-others-hero h1 {
    font-size: 22px;
    line-height: 1.2;
  }
  body[data-desktop-nav="tasks"] .td-others-hero p {
    margin: 3px 0 0;
    color: #7a879b;
    font-size: 11px;
    font-weight: 400;
  }
  body[data-desktop-nav="tasks"] .td-others-hero .td-realm-badge { display: none; }
  body[data-desktop-nav="tasks"] .td-others-toolbar {
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-bottom: 12px;
  }
  body[data-desktop-nav="tasks"] .td-others-search-label {
    display: block;
    align-self: flex-start;
    margin: 0 0 -4px;
    color: #1b2638;
    font-size: 9px;
    font-weight: 500;
  }
  body[data-desktop-nav="tasks"] .td-others-search {
    display: flex !important;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    flex: none;
    width: 100%;
    height: 42px;
    padding: 0 12px;
    box-sizing: border-box;
  }
  body[data-desktop-nav="tasks"] .td-others-search svg {
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
  }
  body[data-desktop-nav="tasks"] .td-others-search input {
    width: 100%;
    height: 100%;
    padding: 0;
    font-size: 10px;
    font-weight: 400;
  }
  body[data-desktop-nav="tasks"] .td-others-filter-wrap,
  body[data-desktop-nav="tasks"] .td-others-filter-btn,
  body[data-desktop-nav="tasks"] .td-others-new {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    box-sizing: border-box;
  }
  body[data-desktop-nav="tasks"] .td-others-filter-btn {
    display: flex;
    justify-content: space-between;
  }
  body[data-desktop-nav="tasks"] #tdOthersFilterMenu:not([hidden]) {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: rgba(15, 25, 43, 0.28);
    box-shadow: none;
    box-sizing: border-box;
  }
  body[data-desktop-nav="tasks"] .td-others-filter-sheet {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-height: min(80dvh, 680px);
    padding: 8px 20px max(24px, env(safe-area-inset-bottom));
    overflow-y: auto;
    border: 0;
    border-radius: 20px 20px 0 0;
    background: #fff;
    box-sizing: border-box;
  }
  body[data-desktop-nav="tasks"] .td-others-filter-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 56px;
    margin-bottom: 10px;
  }
  body[data-desktop-nav="tasks"] .td-others-filter-sheet-head h2 {
    margin: 0;
    color: #1b2638;
    font-size: 18px;
    font-weight: 650;
  }
  body[data-desktop-nav="tasks"] .td-others-filter-close {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #78869b;
    font-size: 24px;
    box-shadow: none;
  }
  body[data-desktop-nav="tasks"] .td-others-filter-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
  }
  body[data-desktop-nav="tasks"] .td-others-filter-item {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 0 12px;
    border: 1px solid #e0e5ed;
    border-radius: 10px;
    background: #fff;
    color: #1b2638;
    font-size: 12px;
    font-weight: 400;
    box-sizing: border-box;
  }
  body[data-desktop-nav="tasks"] .td-others-filter-item.is-on {
    border-color: #2963e8;
    background: #e6edff;
    color: #2963e8;
    font-weight: 600;
  }
  body[data-desktop-nav="tasks"] .td-others-filter-done {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 50px;
    border: 1px solid #2963e8;
    border-radius: 10px;
    background: #2963e8;
    color: #fff;
    font-size: 13px;
    font-weight: 650;
    box-shadow: none;
  }
  body[data-desktop-nav="tasks"] .td-others-filter-done:hover {
    border-color: #1f54d0;
    background: #1f54d0;
    color: #fff;
  }
  body[data-desktop-nav="tasks"] .td-others-new {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  body[data-desktop-nav="tasks"] #backlogToolbar,
  body[data-desktop-nav="tasks"] #backlogFilterTabs,
  body[data-desktop-nav="tasks"] #hideBacklogBtn,
  body[data-desktop-nav="tasks"] #colOther .column-header {
    display: none !important;
  }
  body[data-desktop-nav="tasks"] #colOther .column-body {
    display: block;
    padding: 0;
    overflow: visible;
  }
  body[data-desktop-nav="tasks"] #backlogList {
    display: flex;
    flex-direction: column;
    gap: 13px;
  }
  body[data-desktop-nav="tasks"] #backlogList .backlog-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
  body[data-desktop-nav="tasks"] #backlogList .backlog-group > .tc-list {
    gap: 6px;
  }
  body[data-desktop-nav="tasks"] #backlogList .td-backlog-preview {
    margin: -2px 0 0;
    color: #7a879b;
    font-size: 9px;
    line-height: 1.3;
  }
  body[data-desktop-nav="tasks"] #colOther .tcard.is-figma-others {
    min-height: 60px !important;
    padding: 8px 10px !important;
    border: 1px solid #e0e5ed !important;
    border-radius: 10px !important;
    background: #fff !important;
    box-shadow: none !important;
    box-sizing: border-box;
  }
  body[data-desktop-nav="tasks"] #backlogList .tcard.is-figma-others .tc-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    min-height: 42px;
  }
  body[data-desktop-nav="tasks"] #backlogList .tcard.is-figma-others .tc-check {
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    margin-top: 2px;
    border: 1px solid #e1e7f0 !important;
    border-radius: 6px !important;
    background: #fff !important;
  }
  body[data-desktop-nav="tasks"] #backlogList .tcard.is-figma-others .tc-body {
    flex: 1;
    min-width: 0;
  }
  body[data-desktop-nav="tasks"] #backlogList .tcard.is-figma-others .tc-title {
    font-size: 11px !important;
    font-weight: 500 !important;
    line-height: 1.3;
  }
  body[data-desktop-nav="tasks"] #backlogList .tcard.is-figma-others .tc-meta {
    margin-top: 4px;
    font-size: 9px !important;
    line-height: 1.25;
  }
  body[data-desktop-nav="tasks"] #backlogList .tcard.is-figma-others .tc-more {
    display: grid;
    width: 24px;
    height: 24px;
    margin-left: auto;
    place-items: center;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #78869b;
    font-size: 18px;
    opacity: 1;
    box-shadow: none;
  }
  body[data-desktop-nav="tasks"] #backlogList .td-others-show-all {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 34px;
    padding: 0 10px;
    border: 1px solid #e2e8f1;
    border-radius: 9px;
    background: #fff;
    color: #1b2638;
    font-size: 10px;
    font-weight: 600;
    box-shadow: none;
  }
  body[data-desktop-nav="tasks"] #backlogList .td-others-show-all:hover {
    border-color: #cbd6e5;
    background: #f8faff;
  }

  body.td-new-task-open .topbar-shell,
  body.td-settings-page-open .topbar-shell {
    display: none !important;
  }
  body.td-new-task-open .day-load-banner,
  body.td-settings-page-open .day-load-banner,
  body.td-focus-page-open .day-load-banner,
  body.td-daily-page-open .day-load-banner {
    display: none !important;
  }
  #mobileAddFab {
    display: none !important;
  }
  body.td-settings-page-open .td-sp-back {
    display: grid;
    flex: 0 0 24px;
    width: 24px;
    height: 36px;
    place-items: center;
    margin: 0 6px 0 -4px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #2963e8;
    box-shadow: none;
  }
  body.td-settings-page-open .td-sp-back svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  body.td-settings-page-open .td-sp-head {
    align-items: center;
    gap: 0;
    margin: 0;
  }
  body.td-settings-page-open .td-sp-head h1 {
    font-size: 16px;
    line-height: 1.3;
  }
  body.td-settings-page-open .td-sp-head .td-sp-sub,
  body.td-settings-page-open .td-sp-badge {
    display: none !important;
  }
  body.td-settings-page-open .td-sp-tabs {
    display: flex;
  }
  body.td-settings-page-open .td-sp-layout {
    display: flex;
    flex-direction: column;
  }
  body.td-settings-page-open .td-sp-side {
    order: 2;
  }
  body.td-settings-page-open .td-sp-main {
    order: 1;
  }
  body.td-settings-page-open .workspace {
    padding-top: 10px;
  }

  /* Настройки: типографика и поля в масштабе макета (27–33) */
  body.td-settings-page-open .td-sp-head h1 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.01em;
  }
  body.td-settings-page-open .td-sp-tabs {
    gap: 6px;
  }
  body.td-settings-page-open .td-sp-tab {
    min-height: 40px;
    padding: 0 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
  }
  body.td-settings-page-open .td-sp-card {
    padding: 18px 16px;
    border: 1px solid #e6ebf3;
    border-radius: 16px;
    background: #fff;
  }
  body.td-settings-page-open .td-sp-card h2 {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.01em;
  }
  body.td-settings-page-open .td-sp-hint {
    font-size: 13px;
    line-height: 1.45;
    color: #637185;
  }
  body.td-settings-page-open .td-sp-field > span,
  body.td-settings-page-open .td-sp-field legend,
  body.td-settings-page-open .td-sp-choice-field legend {
    font-size: 13px;
    font-weight: 600;
    color: #637185;
  }
  body.td-settings-page-open .td-sp-field input,
  body.td-settings-page-open .td-sp-field select,
  body.td-settings-page-open .td-sp-field textarea {
    min-height: 48px;
    font-size: 15px;
    border-radius: 12px;
  }
  body.td-settings-page-open .td-sp-field small {
    font-size: 12px;
    line-height: 1.4;
    color: #919eb0;
  }
  body.td-settings-page-open .td-sp-segmented button {
    min-height: 44px;
    font-size: 14px;
    border-radius: 10px;
  }
  body.td-settings-page-open .td-sp-primary {
    width: 100%;
    min-height: 52px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
  }
  body.td-settings-page-open .td-sp-actions {
    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
  }
  body.td-settings-page-open .td-sp-actions .btn-ghost,
  body.td-settings-page-open .td-sp-actions button:not(.td-sp-primary) {
    width: 100%;
    min-height: 52px;
    border: 1px solid #e3e8f0;
    border-radius: 12px;
    background: #fff;
    font-size: 16px;
    font-weight: 600;
  }
  body.td-settings-page-open .td-sp-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }
  body.td-settings-page-open .td-sp-tabs::-webkit-scrollbar { display: none; }
  body.td-settings-page-open .td-sp-tab { flex: 0 0 auto; }

  /* Выбор задачи для фокуса (макет 21): шторка не должна вылезать за экран,
     список скроллится внутри, кнопка «Выбрать задачу» всегда видна */
  .td-fp-picker-modal {
    display: flex;
    flex-direction: column;
    height: 84dvh;
    max-height: 84dvh;
    overflow: hidden;
    padding-bottom: max(20px, env(safe-area-inset-bottom));
  }
  /* шторка перекрывает нижнее меню, как в макете 21 */
  .td-fp-picker {
    z-index: 2700 !important;
    padding: 0 !important;
  }
  .td-fp-picker-list-mode {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1 1 auto;
  }
  .td-fp-picker-results {
    flex: 1 1 auto;
    min-height: 0;
    max-height: calc(84dvh - 330px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .td-fp-picker-search { flex: 0 0 auto; }
  .td-fp-primary {
    flex: 0 0 auto;
    margin-top: 12px;
    min-height: 52px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
  }
}

/* Manrope для hero-заголовков входа на десктопе (Figma 89:800 / 34–36) */
@media (min-width: 1025px) {
  #authHeadline {
    font-family: var(--td-font-sans) ;
    font-size: 43px;
    font-weight: 700;
    line-height: 49px;
    letter-spacing: -0.02em;
  }
}

/* Скрытие блоков фокуса по атрибуту hidden: display у .td-fp-setup перебивал UA-стиль */
.td-fp-setup[hidden],
.td-fp-live[hidden],
.td-fp-break[hidden] { display: none !important; }

/* ==== Экран-меню настроек (макет 27) ==== */
.td-sp-hub {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.td-sp-hub-item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid #e6ebf3;
  border-radius: 14px;
  background: #fff;
  text-align: left;
  font: inherit;
  cursor: pointer;
  box-shadow: none;
}
.td-sp-hub-item:hover { background: #fbfcfe; }
.td-sp-hub-ico {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 12px;
  background: #eef3ff;
  color: #2963e8;
}
.td-sp-hub-ico svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.td-sp-hub-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.td-sp-hub-title {
  font-size: 16px;
  font-weight: 600;
  color: #1a2433;
}
.td-sp-hub-sub {
  font-size: 13px;
  color: #637185;
}
.td-sp-hub-chev {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  fill: none;
  stroke: #919eb0;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.td-settings-page[data-tab="hub"] .td-sp-tabs { display: none; }
.td-settings-page[data-tab="hub"] .td-sp-badge { display: none; }

/* Новые части меню задачи нужны только на телефоне (десктоп — компактный поповер) */
.td-task-menu-head,
.td-task-menu-task,
.td-task-menu-close,
.td-task-menu-ico { display: none; }
.td-task-menu-backdrop { display: none; }

/* ==== Мобильная сверка с Figma (страница «02 - Mobile») ==== */
@media (max-width: 1024px) {
  /* Переключатель сферы: без точек, активный сегмент — белая «таблетка» как в макете */
  .realm-switch .realm-opt .dot { display: none; }
  .realm-pill-toggle.realm-switch {
    padding: 4px;
    border-radius: 12px;
    background: #eef1f6;
  }
  .realm-pill-toggle.realm-switch .realm-opt {
    flex: 1 1 0;
    border-radius: 9px;
    background: transparent;
    color: #637185;
    font-weight: 600;
    box-shadow: none;
  }
  .realm-pill-toggle.realm-switch .realm-opt.active {
    background: #fff;
    color: #2963e8;
    box-shadow: 0 1px 2px rgba(26, 36, 51, 0.06);
  }

  /* Прогресс дня: заголовок и «N из M» в одну строку, затем полоса, затем подпись */
  body[data-desktop-nav="today"] #tdProgressCard {
    display: grid !important;
    grid-template-columns: 1fr auto;
    align-items: baseline;
    column-gap: 12px;
    order: 4;
    width: 100%;
    margin: 0 0 16px;
    padding: 16px;
    border: 1px solid #e6ebf3;
    border-radius: 16px;
    background: #fff;
    box-sizing: border-box;
  }
  body[data-desktop-nav="today"] #tdProgressCard h3 {
    grid-column: 1;
    grid-row: 1;
    display: block;
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: #1a2433;
  }
  body[data-desktop-nav="today"] #tdProgressStat {
    grid-column: 2;
    grid-row: 1;
    float: none;
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #1a2433;
  }
  body[data-desktop-nav="today"] #tdProgressCard .td-progress-track {
    grid-column: 1 / -1;
    grid-row: 2;
    display: block !important;
    width: 100%;
    height: 8px;
    margin: 14px 0 0;
    overflow: hidden;
    border-radius: 999px;
    background: #e5edff;
  }
  body[data-desktop-nav="today"] #tdProgressCard .td-progress-fill {
    height: 100%;
    border-radius: inherit;
    background: #2963e8;
  }
  body[data-desktop-nav="today"] #tdProgressCard .td-card-sub {
    grid-column: 1 / -1;
    grid-row: 3;
    display: block;
    margin: 10px 0 0;
    font-size: 13px;
    line-height: 1.35;
    color: #637185;
  }

  /* Плавающая кнопка Дейли — её нет в мобильном макете (есть таб «Daily») */
  .ai-bot-fab { display: none !important; }

  /* ==== «Другие» (макет 13–16): типографика и элементы по макету ==== */
  body[data-desktop-nav="tasks"] .td-others-hero h1 {
    font-size: 30px;
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: -0.02em;
  }
  body[data-desktop-nav="tasks"] .td-others-hero p {
    margin: 6px 0 0;
    font-size: 15px;
    color: #637185;
  }
  body[data-desktop-nav="tasks"] .td-others-search-label {
    font-size: 13px;
    font-weight: 600;
    color: #1a2433;
  }
  body[data-desktop-nav="tasks"] .td-others-search {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 48px;
    padding: 0 14px;
    border: 1px solid #e3e8f0;
    border-radius: 12px;
    background: #fff;
    box-sizing: border-box;
  }
  body[data-desktop-nav="tasks"] .td-others-search svg {
    order: 2;
    margin-left: auto;
    color: #919eb0;
  }
  body[data-desktop-nav="tasks"] .td-others-search input {
    order: 1;
    flex: 1;
    min-width: 0;
    height: 100%;
    border: 0;
    background: transparent;
    font-size: 15px;
    color: #1a2433;
  }
  body[data-desktop-nav="tasks"] .td-others-search input::placeholder {
    color: #919eb0;
  }
  body[data-desktop-nav="tasks"] .td-others-filter-btn {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    width: 100%;
    height: 48px;
    padding: 0 16px;
    border: 1px solid #e3e8f0;
    border-radius: 12px;
    background: #fff;
    color: #1a2433;
    font-size: 15px;
    font-weight: 600;
    box-shadow: none;
  }
  body[data-desktop-nav="tasks"] .td-others-filter-caret {
    margin: 0;
    color: #637185;
    font-size: 12px;
  }
  body[data-desktop-nav="tasks"] .td-others-new {
    width: 100%;
    height: 48px;
    border: 0;
    border-radius: 12px;
    background: #2963e8;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    box-shadow: none;
  }
  body[data-desktop-nav="tasks"] .td-others-new:hover {
    background: #1f54d0;
    color: #fff;
  }
  body[data-desktop-nav="tasks"] #backlogList .backlog-group-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin: 6px 0 2px;
  }
  body[data-desktop-nav="tasks"] #backlogList .backlog-group-head .tc-grp-dot {
    display: none;
  }
  body[data-desktop-nav="tasks"] #backlogList .backlog-group-head .tc-grp-t {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: #1a2433;
  }
  body[data-desktop-nav="tasks"] #backlogList .backlog-group-head .grp-count {
    padding: 0;
    border: 0;
    background: transparent;
    color: #2963e8;
    font-size: 15px;
    font-weight: 600;
  }
  body[data-desktop-nav="tasks"] #backlogList .td-backlog-preview {
    margin: 2px 0 8px;
    color: #637185;
    font-size: 13px;
    line-height: 1.35;
  }
  body[data-desktop-nav="tasks"] #backlogList .tcard.is-figma-others {
    min-height: 64px !important;
    padding: 12px 14px !important;
    border: 1px solid #e6ebf3 !important;
    border-radius: 12px !important;
    background: #fff !important;
  }
  body[data-desktop-nav="tasks"] #backlogList .tcard.is-figma-others .tc-check {
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
  }
  body[data-desktop-nav="tasks"] #backlogList .tcard.is-figma-others .tc-title {
    font-size: 15px !important;
    font-weight: 600 !important;
    line-height: 1.35;
    color: #1a2433;
  }
  body[data-desktop-nav="tasks"] #backlogList .tcard.is-figma-others .tc-meta {
    display: block !important;
    margin-top: 3px;
    font-size: 13px !important;
    line-height: 1.3;
    color: #637185;
  }
  body[data-desktop-nav="tasks"] #backlogList .td-others-show-all {
    min-height: 48px;
    border: 1px solid #e6ebf3;
    border-radius: 12px;
    background: #fff;
    color: #1a2433;
    font-size: 15px;
    font-weight: 600;
  }
  body[data-desktop-nav="tasks"] #backlogList .aside-others-empty {
    font-size: 15px !important;
    color: #637185 !important;
  }

  /* Шторка фильтра (макет 15): руббер, радио-точки, крупные пункты */
  body[data-desktop-nav="tasks"] .td-others-filter-sheet {
    padding: 10px 20px 24px;
    border-radius: 24px 24px 0 0;
    background: #fff;
  }
  body[data-desktop-nav="tasks"] .td-others-filter-sheet::before {
    content: '';
    display: block;
    width: 44px;
    height: 5px;
    margin: 0 auto 14px;
    border-radius: 999px;
    background: #e3e8f0;
  }
  body[data-desktop-nav="tasks"] .td-others-filter-sheet-head h2 {
    font-size: 27px;
    font-weight: 700;
    letter-spacing: -0.02em;
  }
  body[data-desktop-nav="tasks"] .td-others-filter-options {
    gap: 10px;
    margin: 18px 0 20px;
  }
  body[data-desktop-nav="tasks"] .td-others-filter-item {
    position: relative;
    justify-content: flex-start;
    gap: 12px;
    min-height: 60px;
    padding: 0 18px 0 20px;
    border: 1px solid #e3e8f0;
    border-radius: 14px;
    background: #fff;
    color: #1a2433;
    font-size: 18px;
    text-align: left;
  }
  body[data-desktop-nav="tasks"] .td-others-filter-item::before {
    content: '';
    display: block;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    border: 1.5px solid #ccd6e5;
    border-radius: 50%;
    background: #fff;
    box-sizing: border-box;
  }
  body[data-desktop-nav="tasks"] .td-others-filter-item.is-on {
    border-color: #2963e8;
    background: #e8eeff;
    color: #2963e8;
    font-weight: 600;
  }
  body[data-desktop-nav="tasks"] .td-others-filter-item.is-on::before {
    border: 5px solid #2963e8;
    background: #fff;
  }
  body[data-desktop-nav="tasks"] .td-others-filter-done {
    min-height: 60px;
    border-radius: 14px;
    font-size: 18px;
    font-weight: 600;
  }

  /* ==== Модальные диалоги на телефоне (макеты 03, 04, 08) ====
     Десктопные правила заперты в min-width:1025px, из-за чего на мобиле
     диалоги рендерились inline-блоками внизу страницы. */
  .td-dialog-overlay {
    position: fixed;
    inset: 0;
    z-index: 2600;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.35);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
  }
  .td-dialog-overlay[hidden] { display: none !important; }
  .td-dialog {
    width: 100%;
    max-width: 420px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    padding: 22px;
    border: 0;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.2);
    box-sizing: border-box;
  }
  .td-dialog h3 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #1a2433;
  }
  .td-dialog-sub {
    margin: 6px 0 0;
    font-size: 14px;
    line-height: 1.4;
    color: #637185;
  }
  .td-dialog-opts {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 18px 0 20px;
  }
  .td-dialog-opt {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    width: 100%;
    padding: 14px 16px 14px 46px;
    border: 1px solid #e3e8f0;
    border-radius: 14px;
    background: #fff;
    text-align: left;
  }
  .td-dialog-opt::before {
    content: '';
    position: absolute;
    left: 16px;
    top: 50%;
    width: 18px;
    height: 18px;
    margin-top: -9px;
    border: 1.5px solid #ccd6e5;
    border-radius: 50%;
    background: #fff;
    box-sizing: border-box;
  }
  .td-dialog-opt strong {
    font-size: 16px;
    font-weight: 600;
    color: #1a2433;
  }
  .td-dialog-opt span { font-size: 13px; color: #637185; }
  .td-dialog-opt.is-on {
    border-color: #2963e8;
    background: #eef3ff;
  }
  .td-dialog-opt.is-on::before { border: 5px solid #2963e8; }
  .td-dialog-opt.is-on strong { color: #2963e8; }
  .td-dialog-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 14px;
  }
  .td-dialog-field span {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    color: #637185;
  }
  .td-dialog-field input {
    height: 52px;
    padding: 0 14px;
    border: 1px solid #e3e8f0;
    border-radius: 12px;
    background: #fff;
    font-size: 16px;
    color: #1a2433;
    box-sizing: border-box;
  }
  .td-dialog-note {
    margin: 14px 0 0;
    padding: 12px 14px;
    border-radius: 12px;
    background: #eef3ff;
    color: #46608f;
    font-size: 13px;
    line-height: 1.45;
  }
  .td-dialog-actions {
    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
    margin-top: 18px;
  }
  .td-dialog-ok {
    width: 100%;
    height: 52px;
    border: 0;
    border-radius: 12px;
    background: #2963e8;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    box-shadow: none;
  }
  .td-dialog-ok:hover { background: #1f54d0; color: #fff; }
  .td-dialog-ok:disabled { opacity: 0.5; }
  .td-dialog-cancel {
    width: 100%;
    height: 52px;
    border: 1px solid #e3e8f0;
    border-radius: 12px;
    background: #fff;
    color: #1a2433;
    font-size: 16px;
    font-weight: 600;
    box-shadow: none;
  }
  .td-rhythm-section-label {
    margin: 18px 0 8px;
    font-size: 13px;
    font-weight: 600;
    color: #637185;
  }
  .td-rhythm-presets { display: flex; flex-wrap: wrap; gap: 8px; }
  .td-rhythm-preset {
    flex: 1 1 calc(25% - 8px);
    min-width: 0;
    min-height: 48px;
    border: 1px solid #e3e8f0;
    border-radius: 12px;
    background: #fff;
    color: #1a2433;
    font-size: 15px;
    font-weight: 600;
    box-shadow: none;
  }
  .td-rhythm-preset.is-on { border-color: #2963e8; background: #e8eeff; color: #2963e8; }
  .td-rhythm-preset.is-break.is-on { border-color: #0a8f7d; background: #e3f7ed; color: #0a8f7d; }
  .td-rhythm-cycles {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    height: 52px;
    padding: 0 8px;
    border: 1px solid #e3e8f0;
    border-radius: 12px;
    background: #fff;
  }
  .td-rhythm-cycle-btn {
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 10px;
    background: #f3f5f9;
    color: #1a2433;
    font-size: 22px;
    font-weight: 600;
    box-shadow: none;
  }
  .td-rhythm-cycle-val { font-size: 16px; font-weight: 600; color: #1a2433; }
  .td-rhythm-cycles-hint {
    margin: 8px 0 0;
    font-size: 13px;
    color: #637185;
  }

  /* ==== Меню действий задачи на телефоне (макет 02) ==== */
  .td-task-menu-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 2390;
    background: rgba(15, 23, 42, 0.35);
  }
  .td-task-menu-backdrop[hidden] { display: none !important; }
  .td-task-menu {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    top: auto !important;
    z-index: 2400;
    width: 100% !important;
    max-width: none !important;
    max-height: 90vh;
    overflow-y: auto;
    padding: 12px 20px 24px;
    border: 0;
    border-radius: 24px 24px 0 0;
    background: #fff;
    box-shadow: 0 -12px 40px rgba(15, 23, 42, 0.18);
    box-sizing: border-box;
  }
  .td-task-menu::before {
    content: '';
    display: block;
    width: 44px;
    height: 5px;
    margin: 0 auto 12px;
    border-radius: 999px;
    background: #e3e8f0;
  }
  .td-task-menu-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
  }
  .td-task-menu-title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #1a2433;
  }
  .td-task-menu-x {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #78869b;
  }
  .td-task-menu-x svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
  }
  .td-task-menu-task {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 14px 16px;
    border-radius: 14px;
    background: #eef3ff;
  }
  .td-task-menu-task-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a2433;
  }
  .td-task-menu-task-meta {
    font-size: 13px;
    color: #637185;
  }
  .td-task-menu-list {
    display: flex;
    flex-direction: column;
    margin-top: 10px;
  }
  .td-task-menu-item {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 14px;
    width: 100%;
    padding: 15px 0;
    border: 0 !important;
    border-bottom: 1px solid #eef1f6 !important;
    border-radius: 0 !important;
    background: transparent;
    text-align: left;
  }
  .td-task-menu-item:last-child { border-bottom: 0 !important; }
  .td-task-menu-item[hidden] { display: none !important; }
  .td-task-menu-ico {
    display: grid;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    place-items: center;
    color: #637185;
  }
  .td-task-menu-ico svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  .td-task-menu-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
  }
  .td-task-menu-label {
    font-size: 16px;
    font-weight: 600;
    color: #1a2433;
  }
  .td-task-menu-sub {
    font-size: 13px;
    font-weight: 400;
    color: #637185;
  }
  .td-task-menu-item.is-danger .td-task-menu-label,
  .td-task-menu-item.is-danger .td-task-menu-ico { color: #c73838; }
  .td-task-menu-close {
    display: block;
    width: 100%;
    height: 52px;
    margin-top: 14px;
    border: 1px solid #e3e8f0;
    border-radius: 12px;
    background: #fff;
    color: #1a2433;
    font-size: 16px;
    font-weight: 600;
  }

  /* ==== Новая задача (макеты 17–19): одна колонка, крупные поля ==== */
  body.td-new-task-open .td-new-task-page {
    padding-left: 16px !important;
    padding-right: 16px !important;
    padding-bottom: 120px !important;
  }
  .td-nt-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 10px;
  }
  .td-nt-head-copy {
    flex: 1 1 auto;
    min-width: 0;
  }
  .td-nt-head-copy h1 {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.02em;
  }
  .td-nt-sub {
    margin-top: 4px;
    font-size: 14px;
    line-height: 1.4;
    color: #637185;
  }
  .td-nt-daily-badge {
    order: 3;
    flex: 0 0 auto;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 13px;
  }
  .td-nt-steps { margin: 14px 0 4px; }
  .td-nt-layout {
    display: block !important;
  }
  .td-nt-main,
  .td-nt-side {
    width: 100% !important;
    max-width: none !important;
  }
  .td-nt-side { margin-top: 10px; }
  .td-nt-label {
    margin: 0 0 6px;
    font-size: 13px;
    font-weight: 600;
    color: #637185;
  }
  .td-nt-h2 {
    margin: 18px 0 10px;
    font-size: 20px;
  }
  .td-nt-h3 { font-size: 16px; }
  .td-nt-hint { font-size: 13px; line-height: 1.45; }
  .td-nt-mode {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    padding: 4px;
    gap: 4px;
  }
  .td-nt-mode > * { min-width: 0; }
  /* короткие подписи режимов, как в макете */
  .td-nt-mode-btn {
    min-height: 52px;
    justify-content: center !important;
    align-items: center !important;
  }
  .td-nt-mode-btn span { display: none !important; }
  .td-nt-mode-btn strong {
    font-size: 15px;
    text-align: center;
  }
  /* активный режим — как сегмент в макете 11 */
  .td-nt-mode-btn.is-on {
    border: 1px solid #2963e8;
    background: #e8eeff;
    color: #2963e8;
  }
  .td-nt-mode-btn.is-on strong { color: #2963e8; }
  /* компактная неделя */
  .td-nt-cal-days {
    display: flex;
    gap: 6px;
    overflow-x: auto;
  }
  .td-nt-cal-days > * { flex: 0 0 auto; }
  .td-nt-cal-grid {
    font-size: 12px;
    overflow-x: auto;
  }
  .td-nt-cal-grid button {
    min-height: 34px;
    font-size: 12px;
  }
  .td-nt-mode-btn {
    min-width: 0;
    flex-direction: column !important;
    align-items: flex-start !important;
    min-height: 56px;
    padding: 8px 12px;
    border-radius: 10px;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .td-nt-mode-btn strong,
  .td-nt-mode-btn span {
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: left;
  }
  .td-nt-main,
  .td-nt-side {
    overflow: hidden;
    box-sizing: border-box;
  }
  .td-nt-mode-btn strong { font-size: 15px; }
  .td-nt-mode-btn span { font-size: 12px; }
  .td-new-task-page .td-nt-input,
  .td-new-task-page .td-nt-textarea,
  .td-new-task-page .td-nt-deadline {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    border-radius: 12px !important;
    font-size: 15px !important;
  }
  .td-new-task-page .td-nt-input { height: 48px; padding: 0 14px; }
  body.td-new-task-open .td-new-task-page { overflow-x: hidden; }
  .td-new-task-page .td-nt-textarea {
    min-height: 110px;
    padding: 12px 14px;
    line-height: 1.45;
    resize: none;
  }
  .td-nt-cal-days,
  .td-nt-cal-grid {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .td-nt-cal-custom-row { display: flex; gap: 8px; }
  .td-nt-cal-custom-btn { flex: 1 1 auto; }
  .td-nt-recur { display: flex; flex-wrap: wrap; gap: 6px; }
  .td-nt-save-opts {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .td-nt-save-opt {
    width: 100%;
    min-height: 56px;
  }
  .td-nt-actions {
    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
    margin-top: 16px;
  }
  .td-nt-submit,
  .td-nt-cancel {
    width: 100%;
    min-height: 52px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
  }
  .td-nt-submit { border: 0; background: #2963e8; color: #fff; }
  .td-nt-cancel {
    border: 1px solid #e3e8f0;
    background: #fff;
    color: #1a2433;
  }

  /* ==== Полноэкранная карточка задачи (макеты 05 / 16–19) ==== */
  body.td-today-detail-open .td-today-detail {
    position: fixed;
    inset: 0;
    z-index: 2500;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0 16px calc(24px + env(safe-area-inset-bottom));
    background: #f6f8fb;
    box-sizing: border-box;
  }
  .td-detail-topbar {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 0 10px;
    margin: 0 0 4px;
    background: #f6f8fb;
  }
  .td-detail-topbar-title {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: #1a2433;
    letter-spacing: -0.01em;
  }
  .td-detail-back {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #2963e8;
    font-size: 24px;
    line-height: 1;
    box-shadow: none;
  }
  .td-detail-grid { display: block; }
  .td-detail-main {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
  }
  .td-detail-kicker { display: none; }
  .td-detail-title {
    margin: 6px 0 0;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: #1a2433;
  }
  .td-detail-sec-label {
    margin: 18px 0 6px;
    font-size: 13px;
    font-weight: 600;
    color: #637185;
  }
  .td-detail-desc { font-size: 15px; line-height: 1.45; color: #1a2433; }
  .td-detail-divider { display: none; }
  .td-detail-steps-head { margin-top: 18px; }
  .td-detail-steps-head h3 { font-size: 17px; }
  .td-detail-card {
    margin-top: 14px;
    padding: 16px;
    border: 1px solid #e6ebf3;
    border-radius: 16px;
    background: #fff;
  }
  .td-detail-card h3 {
    margin: 0 0 10px;
    font-size: 17px;
    font-weight: 700;
  }
  .td-detail-kv {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px solid #eef1f6;
    font-size: 14px;
  }
  .td-detail-kv:last-child { border-bottom: 0; }
  .td-detail-kv > span { font-size: 14px; color: #637185; }
  .td-detail-chip {
    min-height: 40px;
    padding: 0 14px;
    border-radius: 10px;
    font-size: 14px;
  }
  .td-detail-focus-row {
    margin-top: 12px;
    padding: 14px;
    border-radius: 14px;
    background: #eef3ff;
  }
  .td-detail-focus-go {
    width: 100%;
    min-height: 48px;
    border-radius: 12px;
    font-size: 15px;
  }
  .td-detail-daily {
    margin-top: 14px;
    padding: 14px;
    border-radius: 14px;
    background: #eef3ff;
  }
  .td-detail-daily-go {
    width: 100%;
    min-height: 44px;
    margin-top: 10px;
    border-radius: 10px;
    font-size: 14px;
  }

  /* ==== Карточка задачи на телефоне — полноэкранная страница (макет 05) ==== */
  .task-sheet-overlay {
    align-items: stretch;
    padding: 0;
  }
  .task-sheet {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: 100%;
    border: 0;
    border-radius: 0;
    background: #f6f8fb;
  }
  .task-sheet-grab { display: none; }
  .task-sheet-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px 16px 24px;
  }
  .task-sheet-footer {
    position: sticky;
    bottom: 0;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    border-top: 1px solid #eef1f6;
    background: #fff;
  }
  .task-sheet-footer .task-sheet-btn,
  .task-sheet-footer button {
    min-height: 52px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
  }
  .task-sheet-footer svg,
  .task-sheet-footer .icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
  }
  .task-sheet-title {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: #1a2433;
  }
  .task-sheet-scroll h3 { font-size: 17px; font-weight: 700; }
  /* Шапка карточки задачи (макеты 05/16) */
  .task-sheet-topbar {
    position: sticky;
    top: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 0 12px;
    margin: 0 0 10px;
    background: #f6f8fb;
  }
  .task-sheet-topbar-title {
    flex: 1;
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    text-align: center;
    color: #1a2433;
  }
  .task-sheet-back {
    display: grid;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #2963e8;
    font-size: 24px;
    line-height: 1;
    box-shadow: none;
  }
  .task-sheet-topbar .task-sheet-close {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
  }
  .task-sheet-status {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 0 0 10px;
  }
  .task-sheet-card {
    margin-top: 14px;
    padding: 16px;
    border: 1px solid #e6ebf3;
    border-radius: 16px;
    background: #fff;
  }
  .task-sheet-card h3 {
    margin: 0 0 8px;
    font-size: 17px;
    font-weight: 700;
    color: #1a2433;
  }
  .task-sheet-start {
    margin: 0;
    font-size: 15px;
    line-height: 1.45;
    color: #1a2433;
  }
  .task-sheet-card-hint {
    margin: 8px 0 0;
    font-size: 13px;
    line-height: 1.4;
    color: #637185;
  }
  .task-sheet-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  /* Блок «Действия» в карточке задачи (макет Mobile · 37) */
  .task-sheet-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .task-sheet-action {
    width: 100%;
    min-height: 48px;
    border: 1px solid #e3e8f0;
    border-radius: 12px;
    background: #fff;
    color: #1a2433;
    font-size: 15px;
    font-weight: 600;
    box-shadow: none;
  }
  .task-sheet-action:active {
    background: #f6f8fb;
  }

  /* Сброс пароля (макет 36): вторичная кнопка возврата */
  .auth-back-btn {
    width: 100%;
    min-height: 52px;
    margin: 10px 0 0;
    border: 1px solid #e3e8f0;
    border-radius: 12px;
    background: #fff;
    color: #1a2433;
    font-size: 16px;
    font-weight: 600;
    box-shadow: none;
  }
  #authResetForm .auth-link.auth-back {
    display: block;
    margin: 10px auto 0;
    font-size: 13px;
    color: #637185;
    text-align: center;
  }

  /* Поиск в «Других» (макет 14): отдельный экран */
  body[data-desktop-nav="tasks"] #backlogToolbar.is-search-open {
    display: block !important;
    margin: 0 0 14px;
  }
  body[data-desktop-nav="tasks"] #backlogToolbar.is-search-open::before {
    content: 'Поиск задач';
    display: block;
    margin: 0 0 12px;
    font-size: 17px;
    font-weight: 700;
    color: #1a2433;
  }
  body[data-desktop-nav="tasks"] #backlogToolbar .backlog-search-toggle { display: none !important; }
  body[data-desktop-nav="tasks"] #backlogToolbar .backlog-search {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    height: 48px;
    padding: 0 14px;
    border: 1px solid #e3e8f0;
    border-radius: 12px;
    background: #fff;
    box-sizing: border-box;
  }
  body[data-desktop-nav="tasks"] #backlogToolbar .backlog-search input {
    flex: 1;
    min-width: 0;
    height: 100%;
    border: 0;
    background: transparent;
    font-size: 15px;
    color: #1a2433;
  }
  body[data-desktop-nav="tasks"] #backlogToolbar .backlog-search-icon { color: #919eb0; }
  body[data-desktop-nav="tasks"] #backlogToolbar .backlog-search-back {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #2963e8;
    font-size: 20px;
  }
  body[data-desktop-nav="tasks"]:has(#backlogToolbar.is-search-open) .td-others-hero,
  body[data-desktop-nav="tasks"]:has(#backlogToolbar.is-search-open) .td-others-toolbar,
  body[data-desktop-nav="tasks"]:has(#backlogToolbar.is-search-open) .other-col-header {
    display: none !important;
  }

  /* Daily по задаче (макет 06): полноэкранная страница */
  #tdTaskDailyPanel[hidden] { display: none !important; }
  #tdTaskDailyPanel {
    position: fixed;
    inset: 0;
    z-index: 2600;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: #f6f8fb;
    box-shadow: none;
  }
  #tdTaskDailyPanel .td-task-daily-head {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid #eef1f6;
    background: #f6f8fb;
  }
  #tdTaskDailyPanel .td-task-daily-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 16px;
  }
  #tdTaskDailyPanel .td-task-daily-foot {
    flex: 0 0 auto;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    border-top: 1px solid #eef1f6;
    background: #fff;
  }
  #tdTaskDailyPanel .td-task-daily-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  #tdTaskDailyPanel #tdTaskDailyInput {
    flex: 1;
    min-height: 48px;
    padding: 0 14px;
    border: 1px solid #e3e8f0;
    border-radius: 12px;
    font-size: 15px;
  }
  #tdTaskDailyPanel .td-task-daily-send {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    font-size: 20px;
  }
  #tdTaskDailyPanel .td-task-daily-body h3 { font-size: 17px; font-weight: 700; }
  /* содержимое страницы Daily по задаче — карточки как в макете 06 */
  #tdTaskDailyPanel .td-task-daily-ctx {
    display: flex;
    flex-direction: column;
    gap: 9px;
    padding: 16px;
    border: 1px solid #e6ebf3;
    border-radius: 16px;
    background: #fff;
  }
  #tdTaskDailyPanel .td-task-daily-ctx > strong,
  #tdTaskDailyPanel .td-task-daily-ctx h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: #1a2433;
  }
  #tdTaskDailyPanel .td-task-daily-lead {
    margin: 6px 0 0;
    font-size: 15px;
    font-weight: 600;
    color: #1a2433;
  }
  #tdTaskDailyPanel .td-task-daily-copy {
    margin: 0;
    font-size: 13px;
    line-height: 1.45;
    color: #637185;
  }
  #tdTaskDailyPanel .td-task-daily-next {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 4px 0 0;
    padding: 12px 14px;
    border-radius: 12px;
    background: #eef3ff;
  }
  #tdTaskDailyPanel .td-task-daily-next strong {
    font-size: 12px;
    font-weight: 600;
    color: #637185;
  }
  #tdTaskDailyPanel .td-task-daily-next span,
  #tdTaskDailyPanel .td-task-daily-next p {
    margin: 0;
    font-size: 15px;
    color: #1a2433;
  }
  #tdTaskDailyPanel .td-task-daily-act {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 48px;
    margin-top: 4px;
    padding: 0 14px;
    border: 0;
    border-radius: 12px;
    background: #2963e8;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    text-align: left;
  }
  #tdTaskDailyPanel .td-task-daily-act-go { margin-left: auto; }
  #tdTaskDailyPanel .td-task-daily-hist {
    margin: 6px 0 0;
    font-size: 13px;
    color: #637185;
  }
  #tdTaskDailyPanel .td-task-daily-myday {
    width: 100%;
    min-height: 48px;
    margin-top: 4px;
    border: 1px solid #e3e8f0;
    border-radius: 12px;
    background: #fff;
    color: #1a2433;
    font-size: 15px;
    font-weight: 600;
  }

  /* Порядок блоков Daily как в макете 25: «Твой день» → чат → подсказки */
  body.td-daily-page-open .td-dp-layout {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  body.td-daily-page-open .td-dp-side {
    display: contents;
  }
  body.td-daily-page-open .td-dp-day { order: 1; }
  body.td-daily-page-open .td-dp-main { order: 2; }
  body.td-daily-page-open .td-dp-tip { order: 3; }

  /* Слоты времени на телефоне (макет 17): чипы вместо матрицы 7×N */
  .td-nt-slot-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  .td-nt-slot-chip {
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid #e3e8f0;
    border-radius: 12px;
    background: #fff;
    color: #1a2433;
    font-size: 14px;
    font-weight: 600;
    box-shadow: none;
  }
  .td-nt-slot-chip.is-on {
    border-color: #2963e8;
    background: #e8eeff;
    color: #2963e8;
  }
  .td-nt-slot-chip.is-busy {
    border-color: #eef1f6;
    background: #f3f5f9;
    color: #919eb0;
  }
  .td-nt-slot-chip.is-past {
    border-color: #eef1f6;
    background: #fafbfc;
    color: #c3ccd9;
  }
  /* Стрелки листания недели и повтор — карточками */
  .td-nt-cal-nav-btn {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    padding: 0;
    border: 1px solid #e3e8f0;
    border-radius: 10px;
    background: #fff;
    color: #2963e8;
    box-shadow: none;
  }
  .td-nt-cal-nav-btn svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  .td-nt-recur-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    flex: 1 1 calc(50% - 6px);
    min-height: 56px;
    padding: 8px 12px;
    border: 1px solid #e3e8f0;
    border-radius: 12px;
    background: #fff;
    text-align: left;
    box-shadow: none;
  }
  .td-nt-recur-btn strong { font-size: 14px; font-weight: 600; color: #1a2433; }
  .td-nt-recur-btn span { font-size: 12px; color: #637185; }
  .td-nt-recur-btn.is-on {
    border-color: #2963e8;
    background: #eef3ff;
  }
  .td-nt-recur-btn.is-on strong { color: #2963e8; }
  /* «Без плановой даты» — карточки в столбик */
  .td-nt-save-opts { display: flex; flex-direction: column; gap: 8px; }
  .td-nt-save-opt {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    width: 100%;
    min-height: 56px;
    padding: 8px 14px;
    border: 1px solid #e3e8f0;
    border-radius: 12px;
    background: #fff;
    text-align: left;
    box-shadow: none;
  }
  .td-nt-save-opt strong { font-size: 14px; font-weight: 600; color: #1a2433; }
  .td-nt-save-opt span { font-size: 12px; color: #637185; }
  .td-nt-save-opt.is-on { border-color: #2963e8; background: #eef3ff; }
  .td-nt-save-opt.is-on strong { color: #2963e8; }
  /* Голосовой ввод в «Новой задаче» (макет 09) */
  .td-nt-voice-record {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 8px 0 4px;
    text-align: center;
  }
  .td-nt-voice-record .td-nt-h2,
  .td-nt-voice-record .td-nt-hint {
    text-align: center;
    margin: 0;
  }
  .td-nt-mic {
    position: relative;
    display: grid;
    width: 96px;
    height: 96px;
    place-items: center;
    margin: 6px auto;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #2963e8;
    color: #fff;
    box-shadow: 0 12px 30px rgba(41, 99, 232, 0.25);
  }
  .td-nt-mic-halo {
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    background: rgba(41, 99, 232, 0.12);
  }
  .td-nt-mic-ico {
    position: relative;
    width: 40px;
    height: 40px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
  }
  .td-nt-voice-status {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #1a2433;
  }
  .td-nt-voice-lang {
    margin: 0;
    font-size: 13px;
    color: #919eb0;
  }
  .td-nt-voice-cancel,
  .td-nt-voice-manual {
    width: 100%;
    min-height: 52px;
    margin-top: 10px;
    border: 1px solid #e3e8f0;
    border-radius: 12px;
    background: #fff;
    color: #1a2433;
    font-size: 16px;
    font-weight: 600;
    box-shadow: none;
  }
  .td-nt-voice-note {
    padding: 12px 14px;
    border-radius: 12px;
    background: #eef3ff;
    color: #46608f;
    font-size: 13px;
    line-height: 1.45;
  }
  .td-nt-voice-go {
    width: 100%;
    min-height: 52px;
    margin-top: 6px;
    border: 0;
    border-radius: 12px;
    background: #2963e8;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
  }

  /* Модалка «Добавить шаг» (макет 07) */
  .td-add-step-task {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin: 14px 0 4px;
    padding: 14px 16px;
    border-radius: 14px;
    background: #eef3ff;
  }
  .td-add-step-task-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a2433;
  }
  .td-add-step-task-meta {
    font-size: 13px;
    color: #637185;
  }
  #tdAddStepOverlay .td-dialog-field textarea {
    min-height: 96px;
    padding: 12px 14px;
    border: 1px solid #e3e8f0;
    border-radius: 12px;
    background: #fff;
    font: inherit;
    font-size: 15px;
    line-height: 1.45;
    color: #1a2433;
    resize: none;
    box-sizing: border-box;
  }
  .task-sheet-add-step {
    width: 100%;
    min-height: 48px;
    margin: 0 0 10px;
    border: 1px solid #e3e8f0;
    border-radius: 12px;
    background: #fff;
    color: #2963e8;
    font-size: 15px;
    font-weight: 600;
    box-shadow: none;
  }

  /* Перенести задачу (макет 04): поля с иконками как в макете */
  .td-dialog-field-date input,
  .td-dialog-field-time input {
    padding-right: 46px;
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 18px 18px;
  }
  .td-dialog-field-date input {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23637185' stroke-width='1.8' stroke-linecap='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='3'/%3E%3Cpath d='M8 3v4M16 3v4M3 11h18'/%3E%3C/svg%3E");
  }
  .td-dialog-field-time input {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23637185' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E");
  }
  .td-dialog-field-date input::-webkit-calendar-picker-indicator,
  .td-dialog-field-time input::-webkit-calendar-picker-indicator {
    position: absolute;
    right: 0;
    width: 46px;
    height: 100%;
    margin: 0;
    padding: 0;
    opacity: 0;
    cursor: pointer;
  }
  .td-dialog-field-date,
  .td-dialog-field-time {
    position: relative;
  }

  /* Карточка «Предлагаю такой план» в Daily (макет 25) */
  #tdDailyFeed .aifn-dayplan {
    padding: 16px;
    border: 1px solid #e6ebf3;
    border-radius: 16px;
    background: #fff;
  }
  #tdDailyFeed .aifn-dayplan .aifn-title {
    font-size: 17px;
    font-weight: 700;
    color: #1a2433;
  }
  #tdDailyFeed .aifn-dayplan .aifn-dayplan-row {
    min-height: 48px;
    padding: 10px 12px;
    border: 1px solid #eef1f6;
    border-radius: 12px;
    background: #fff;
  }
  #tdDailyFeed .aifn-dayplan .aifn-dayplan-title {
    font-size: 15px;
    font-weight: 600;
    color: #1a2433;
  }
  #tdDailyFeed .aifn-dayplan .aifn-dayplan-meta {
    font-size: 13px;
    color: #637185;
  }
  #tdDailyFeed .aifn-dayplan .aifn-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
  }
  #tdDailyFeed .aifn-dayplan .aifn-btn {
    width: 100%;
    min-height: 48px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
  }
  #tdDailyFeed .aifn-dayplan .aifn-btn.is-primary {
    border-color: #2963e8;
    background: #2963e8;
    color: #fff;
  }
  #tdDailyFeed .aifn-dayplan .aifn-hint {
    margin: 10px 0 0;
    font-size: 13px;
    line-height: 1.4;
    color: #637185;
  }

  /* Перерыв фокуса (макет 24): зелёный акцент карточек */
  #tdFocusPage[data-phase="break"] .td-fp-card {
    background: #e3f7ed;
    border-color: #cdeee1;
  }
  #tdFocusPage[data-phase="break"] .td-fp-hero-sub,
  #tdFocusPage[data-phase="break"] .td-fp-kicker {
    color: #0a8f7d;
  }
  #tdFocusPage[data-phase="break"] .td-fp-live-ico,
  #tdFocusPage[data-phase="break"] .td-fp-ring-label {
    color: #0a8f7d;
  }

  /* Баннер после разбора Daily (макет 11) */
  .td-nt-daily-banner {
    margin: 0 0 12px;
    padding: 14px 16px;
    border-radius: 14px;
    background: #eef3ff;
    color: #46608f;
    font-size: 14px;
    line-height: 1.4;
  }
  .td-nt-daily-banner[hidden] { display: none !important; }

  /* Группировка полей «Новой задачи» в карточки (макет 11) */
  body.td-new-task-open .td-nt-main {
    padding: 0;
    border: 0;
    background: transparent;
  }
  body.td-new-task-open .td-nt-group {
    display: block;
    margin: 0 0 12px;
    padding: 16px;
    border: 1px solid #e6ebf3;
    border-radius: 16px;
    background: #fff;
  }
  body.td-new-task-open .td-nt-group > .td-nt-h2:first-child {
    margin-top: 0;
  }
  body.td-new-task-open .td-nt-group .td-nt-cal {
    margin-top: 4px;
  }

  /* ==== Типографика: точные значения из Figma (frames 01/13/20/25/27/34) ==== */
  .brand-logo .brand-word img {
    height: 22px;
  }
  .brand-lockup .brand-lockup-tagline {
    font-size: 6.5px;
    font-weight: 600;
    line-height: 9px;
    letter-spacing: 0.12em;
    color: #6e7a8f;
  }

  #tdGreetingTitle,
  .td-others-hero h1,
  #tdFocusTitle,
  .td-sp-head h1,
  .td-dp-head h1 {
    font-size: 26px !important;
    font-weight: 600 !important;
    line-height: 38px !important;
    letter-spacing: 0 !important;
    color: #1a2433;
  }
  #tdGreetingSub,
  .td-others-hero p,
  .td-dp-sub,
  .td-sp-head .td-sp-sub {
    font-size: 15px !important;
    font-weight: 400 !important;
    line-height: 22px !important;
    color: #6e7a8f !important;
  }
  .td-date-chip {
    font-size: 13px !important;
    font-weight: 600 !important;
    line-height: 19px !important;
    color: #6e7a8f !important;
  }

  .td-main-focus-label {
    font-size: 17px !important;
    font-weight: 600 !important;
    line-height: 25px !important;
    color: #1a2433 !important;
  }
  .td-main-focus-hint {
    font-size: 13px !important;
    font-weight: 400 !important;
    line-height: 19px !important;
    color: #6e7a8f !important;
  }
  #tdMainFocusTitle {
    font-size: 22px !important;
    font-weight: 600 !important;
    line-height: 32px !important;
    color: #1a2433;
  }
  .td-main-focus-go {
    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 19px !important;
  }

  #tdProgressCard h3 {
    font-size: 14px !important;
    font-weight: 400 !important;
    line-height: 17px !important;
    color: #6e7a8f !important;
  }
  #tdProgressStat {
    font-size: 20px !important;
    font-weight: 600 !important;
    line-height: 24px !important;
    color: #1a2433 !important;
  }
  #tdProgressHint {
    font-size: 12px !important;
    font-weight: 400 !important;
    line-height: 17px !important;
    color: #6e7a8f !important;
  }

  .td-plan-head h2 {
    font-size: 20px !important;
    font-weight: 600 !important;
    line-height: 29px !important;
    color: #1a2433 !important;
  }
  .td-plan-summary {
    font-size: 13px !important;
    font-weight: 400 !important;
    line-height: 19px !important;
    color: #6e7a8f !important;
  }
  #colToday .tcard .tc-title {
    font-size: 14px !important;
    font-weight: 500 !important;
    line-height: 20px !important;
    color: #1a2433 !important;
  }
  #colToday .tcard.is-done .tc-title {
    color: #6e7a8f !important;
  }
  #colToday .tcard .tc-meta {
    font-size: 12px !important;
    font-weight: 400 !important;
    line-height: 17px !important;
    color: #6e7a8f !important;
  }
  /* Figma: кнопки «Показать все N задач» в мобильной раскладке нет — список показываем целиком */
  .td-plan-show-all {
    display: none !important;
  }
  body[data-desktop-nav="today"] .td-figma-plan > .tcard:nth-child(n + 5) {
    display: flex !important;
  }

  #tdCaptureCard h3 {
    font-size: 17px !important;
    font-weight: 600 !important;
    line-height: 25px !important;
  }
  #tdCaptureCard .td-card-sub {
    font-size: 13px !important;
    font-weight: 400 !important;
    line-height: 19px !important;
    color: #6e7a8f !important;
  }
  .td-capture-label {
    font-size: 13px !important;
    font-weight: 500 !important;
    line-height: 19px !important;
  }
  .td-capture-input {
    font-size: 14px !important;
    font-weight: 400 !important;
  }
  .td-capture-btn {
    font-size: 14px !important;
    font-weight: 600 !important;
  }

  .mobile-app-nav span {
    font-size: 11px !important;
    line-height: 13px !important;
  }

  /* «Другие» */
  body[data-desktop-nav="tasks"] .td-others-search-label {
    font-size: 13px !important;
    font-weight: 500 !important;
    line-height: 19px !important;
  }
  body[data-desktop-nav="tasks"] .td-others-search input {
    font-size: 14px !important;
  }
  body[data-desktop-nav="tasks"] .td-others-filter-btn {
    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 19px !important;
  }
  body[data-desktop-nav="tasks"] .td-others-new {
    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 19px !important;
  }
  body[data-desktop-nav="tasks"] #backlogList .backlog-group-head .tc-grp-t {
    font-size: 19px !important;
    font-weight: 600 !important;
    line-height: 23px !important;
  }
  body[data-desktop-nav="tasks"] #backlogList .backlog-group-head .grp-count {
    font-size: 14px !important;
    font-weight: 400 !important;
    line-height: 17px !important;
  }
  body[data-desktop-nav="tasks"] #backlogList .td-backlog-preview {
    font-size: 13px !important;
    font-weight: 600 !important;
    line-height: 19px !important;
    color: #6e7a8f !important;
  }
  body[data-desktop-nav="tasks"] #backlogList .tcard.is-figma-others .tc-title {
    font-size: 14px !important;
    font-weight: 500 !important;
    line-height: 20px !important;
  }
  body[data-desktop-nav="tasks"] #backlogList .tcard.is-figma-others .tc-meta {
    font-size: 12px !important;
    font-weight: 400 !important;
    line-height: 17px !important;
  }

  /* Настройки: хаб */
  .td-sp-hub-title {
    font-size: 15px !important;
    font-weight: 600 !important;
    line-height: 22px !important;
  }
  .td-sp-hub-sub {
    font-size: 12px !important;
    font-weight: 400 !important;
    line-height: 17px !important;
    color: #6e7a8f !important;
  }

  /* Daily */
  .td-dp-card h2,
  .td-dp-day h2 {
    font-size: 17px !important;
    font-weight: 600 !important;
    line-height: 25px !important;
  }
  .td-dp-day-date {
    font-size: 13px !important;
    font-weight: 600 !important;
    line-height: 19px !important;
    color: #6e7a8f !important;
  }

  /* Фокус */
  #tdFocusHeroTitle {
    font-size: 24px !important;
    font-weight: 600 !important;
    line-height: 35px !important;
  }
  #tdFocusHeroSub {
    font-size: 15px !important;
    font-weight: 400 !important;
    line-height: 22px !important;
    color: #6e7a8f !important;
  }
  #tdFocusTaskTitle {
    font-size: 14px !important;
    font-weight: 500 !important;
    line-height: 20px !important;
  }
  #tdFocusTaskMeta {
    font-size: 12px !important;
    font-weight: 400 !important;
    line-height: 17px !important;
    color: #6e7a8f !important;
  }

  /* Карточка задачи */
  .task-sheet-title {
    font-size: 26px !important;
    font-weight: 600 !important;
    line-height: 38px !important;
  }
  .task-sheet-card h3 {
    font-size: 17px !important;
    font-weight: 600 !important;
    line-height: 25px !important;
  }
  .task-sheet-start,
  .task-sheet-card .td-detail-kv {
    font-size: 14px !important;
    line-height: 20px !important;
  }

  /* Вход / регистрация / сброс пароля */
  #authHeadline {
    font-family: var(--td-font-sans) !important;
    font-size: 43px !important;
    font-weight: 700 !important;
    line-height: 49px !important;
    letter-spacing: -0.02em !important;
  }
  #authLead {
    font-size: 15px !important;
    font-weight: 400 !important;
    line-height: 22px !important;
    color: #6e7a8f !important;
  }
  #authCardTitle {
    font-size: 22px !important;
    font-weight: 600 !important;
    line-height: 32px !important;
  }
  #authOverlay .auth-form label {
    font-size: 13px !important;
    font-weight: 500 !important;
    line-height: 19px !important;
  }
  #authOverlay .auth-form input {
    font-size: 14px !important;
    font-weight: 400 !important;
    line-height: 20px !important;
  }
  #authOverlay .auth-submit {
    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 19px !important;
  }
  #authOverlay .auth-switch,
  #authOverlay .auth-switch .auth-link,
  #authOverlay .auth-link,
  #authOverlay .auth-step-hint,
  #authOverlay .auth-install-hint {
    font-size: 13px !important;
    line-height: 19px !important;
  }
  /* Кнопка «Зарегистрироваться» как в макете 34 (белая, на всю ширину) */
  #authOverlay .auth-secondary {
    width: 100%;
    min-height: 52px;
    margin-top: 8px;
    border: 1px solid #e3e8f0;
    border-radius: 12px;
    background: #fff;
    color: #1a2433;
    font-size: 14px;
    font-weight: 600;
  }
  #authOverlay .auth-footnote {
    margin: 16px 0 0;
    font-size: 12px;
    line-height: 17px;
    color: #6e7a8f;
    text-align: left;
  }
  #authOverlay[data-auth-tab="login"] .auth-install-hint {
    display: none;
  }

  /* Чекбокс в макете — скруглённый квадрат 20×20, а не круг */
  #colToday .tcard .tc-check,
  #boardGrid .tcard .tc-check,
  #colToday .tc-check {
    border-radius: 6px !important;
  }

  /* Прокрутка на телефоне: оболочка фиксированной высоты, скроллится .app-main */
  .app-shell {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
  }
  .app-main {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
  }


  /* Карточки «Быстрый захват» и «Ритм дня»: размеры как в макете */
  body[data-desktop-nav="today"] #tdCaptureCard {
    padding: 18px 16px;
    border-radius: 16px;
  }
  body[data-desktop-nav="today"] #tdCaptureCard h3 {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.01em;
  }
  body[data-desktop-nav="today"] #tdCaptureCard .td-card-sub {
    margin: 6px 0 0;
    font-size: 13px;
    color: #637185;
  }
  body[data-desktop-nav="today"] #tdCaptureCard .td-capture-label {
    display: block;
    margin: 14px 0 6px;
    font-size: 13px;
    font-weight: 600;
    color: #1a2433;
  }
  body[data-desktop-nav="today"] #tdCaptureCard .td-capture-input {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    border: 1px solid #e3e8f0;
    border-radius: 12px;
    background: #fff;
    font-size: 15px;
    box-sizing: border-box;
  }
  body[data-desktop-nav="today"] #tdCaptureCard .td-capture-input::placeholder {
    color: #919eb0;
  }
  body[data-desktop-nav="today"] #tdCaptureCard .td-capture-btn {
    width: 100%;
    height: 48px;
    margin-top: 12px;
    border: 0;
    border-radius: 12px;
    background: #2963e8;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
  }
  html, body {
    overflow: hidden !important;
  }
}

@media (max-width: 1024px) { .td-sp-spaces { grid-template-columns: minmax(0, 1fr) !important; } .td-sp-spaces .td-sp-space { min-width: 0; max-width: 100%; } }

/* ===== Figma M26 · Ритм дня (585:1351) ===== */
#tdRhythmOverlay .td-rh-page {
  --rh-bg: #f4f2f8; --rh-surface: #fff; --rh-subtle: #f6f7f9; --rh-border: #e3e8f0;
  --rh-accent: #3d63eb; --rh-accent-subtle: #e8f0ff; --rh-text: #1f2633; --rh-heading: #1f2938; --rh-muted: #6e788a; --rh-check-border: #b0bfd4;
  display: flex; flex-direction: column; padding: 0; gap: 0;
  width: min(440px, calc(100vw - 48px)); max-height: calc(100vh - 48px);
  background: var(--rh-bg); font-family: Manrope, sans-serif; overflow: hidden;
  border-radius: 16px 0 16px 0;
}
#tdRhythmOverlay .td-rh-nav { display: flex; align-items: center; justify-content: space-between; padding: 0 4px; flex: none; }
#tdRhythmOverlay .td-rh-back, #tdRhythmOverlay .td-rh-spacer { width: 44px; height: 44px; flex: none; }
#tdRhythmOverlay .td-rh-back { display: flex; align-items: center; justify-content: center; border: 0; background: none; padding: 0; color: var(--rh-accent); cursor: pointer; border-radius: 12px 0 12px 0; }
#tdRhythmOverlay .td-rh-back .td-icon { width: 24px; height: 24px; }
#tdRhythmOverlay .td-rh-nav h3 { margin: 0; font-size: 16px; font-weight: 700; line-height: 1.35; color: var(--rh-heading); }
#tdRhythmOverlay .td-rh-content { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding: 8px 16px 16px; }
#tdRhythmOverlay .td-rh-intro { margin: 0; font-size: 15px; font-weight: 500; line-height: 1.35; color: var(--rh-muted); }
#tdRhythmOverlay .td-rh-group { display: flex; flex-direction: column; gap: 8px; }
#tdRhythmOverlay .td-rh-label { margin: 0; font-size: 12px; font-weight: 700; line-height: 1.35; letter-spacing: .6px; text-transform: uppercase; color: var(--rh-muted); }
#tdRhythmOverlay .td-rh-opt {
  display: flex; align-items: center; gap: 12px; min-height: 56px; width: 100%; padding: 8px 12px; margin: 0;
  background: var(--rh-subtle); border: 1px solid var(--rh-border); border-radius: 12px 0 12px 0;
  text-align: left; font: inherit; color: inherit; cursor: pointer;
}
#tdRhythmOverlay .td-rh-opt:hover { background: var(--rh-subtle); border-color: var(--rh-check-border); }
#tdRhythmOverlay .td-rh-opt.is-on { background: var(--rh-accent-subtle); border: 1.5px solid var(--rh-accent); padding: 7.5px 11.5px; }
#tdRhythmOverlay .td-rh-opt:focus-visible, #tdRhythmOverlay .td-rh-btn:focus-visible, #tdRhythmOverlay .td-rh-save:focus-visible, #tdRhythmOverlay .td-rh-back:focus-visible { outline: 2px solid rgba(61,99,235,.35); outline-offset: 2px; }
#tdRhythmOverlay .td-rh-txt { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 2px; line-height: 1.35; }
#tdRhythmOverlay .td-rh-t { font-size: 15px; font-weight: 600; color: var(--rh-text); }
#tdRhythmOverlay .td-rh-s { font-size: 13px; font-weight: 500; color: var(--rh-muted); }
#tdRhythmOverlay .td-rh-check { flex: none; width: 20px; height: 20px; box-sizing: border-box; border-radius: 6px; border: 1.5px solid var(--rh-check-border); display: flex; align-items: center; justify-content: center; color: #fff; }
#tdRhythmOverlay .td-rh-check .td-icon { width: 12px; height: 12px; visibility: hidden; }
#tdRhythmOverlay .td-rh-opt.is-on .td-rh-check { background: #336ee8; border-color: #336ee8; }
#tdRhythmOverlay .td-rh-opt.is-on .td-rh-check .td-icon { visibility: visible; }
#tdRhythmOverlay .td-rh-custom { display: flex; flex-direction: column; gap: 4px; padding: 16px; background: var(--rh-surface); border-radius: 0 16px 16px 0; }
#tdRhythmOverlay .td-rh-step { display: flex; align-items: center; gap: 12px; min-height: 56px; }
#tdRhythmOverlay .td-rh-txt .td-rh-t, #tdRhythmOverlay .td-rh-txt .td-rh-s { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#tdRhythmOverlay .td-rh-ctl { flex: none; display: flex; align-items: center; gap: 4px; }
#tdRhythmOverlay .td-rh-btn {
  width: 44px; height: 44px; padding: 0; margin: 0; border: 0; border-radius: 12px 0 12px 0; background: var(--rh-subtle);
  display: flex; align-items: center; justify-content: center; color: var(--rh-accent); font: 700 20px/1.35 Manrope, sans-serif; cursor: pointer;
}
#tdRhythmOverlay .td-rh-btn:hover { background: var(--rh-accent-subtle); color: var(--rh-accent); }
#tdRhythmOverlay .td-rh-btn .td-icon { width: 20px; height: 20px; }
#tdRhythmOverlay .td-rh-val { width: 76px; text-align: center; font-size: 17px; font-weight: 800; line-height: 1.35; color: var(--rh-heading); }
#tdRhythmOverlay .td-rh-foot { margin: 0; font-size: 13px; font-weight: 600; line-height: 1.35; color: var(--rh-muted); }
#tdRhythmOverlay .td-rh-cta { flex: none; padding: 12px 16px; background: var(--rh-bg); }
#tdRhythmOverlay .td-rh-save {
  width: 100%; min-height: 44px; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; margin: 0;
  border: 0; border-radius: 10px 0 0 10px; background: var(--rh-accent); color: #fff; font: 600 14px/1 Manrope, sans-serif; cursor: pointer;
}
#tdRhythmOverlay .td-rh-save:hover { background: #2f55d9; }
#tdRhythmOverlay .td-rh-save .td-icon { width: 20px; height: 20px; }
@media (max-width: 1024px) {
  #tdRhythmOverlay.td-rh-overlay { padding: 0; background: var(--rh-bg, #f4f2f8); backdrop-filter: none; z-index: 5000; align-items: stretch; justify-content: stretch; }
  #tdRhythmOverlay .td-rh-page { width: 100%; max-width: none; height: 100%; max-height: none; border-radius: 0; box-shadow: none; padding-top: env(safe-area-inset-top, 0px); }
  #tdRhythmOverlay .td-rh-cta { padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
  html.td-rh-open, html.td-rh-open body { overflow: hidden; }
}
html[data-theme="dark"] #tdRhythmOverlay .td-rh-page {
  --rh-bg: #141414; --rh-surface: #1d1d1d; --rh-subtle: #242424; --rh-border: #2d3643;
  --rh-accent: #6f8ff5; --rh-accent-subtle: #1b2646; --rh-text: #e7e9ed; --rh-heading: #f1f3f6; --rh-muted: #b6bec9; --rh-check-border: #56627a;
}
html[data-theme="dark"] #tdRhythmOverlay .td-rh-save { background: #3d63eb; }
@media (max-width: 1024px) { html[data-theme="dark"] #tdRhythmOverlay.td-rh-overlay { background: #141414; } }

/* ===== Праздничное завершение задачи (галочка + конфетти) ===== */
.td-celebrate-overlay {
  position: fixed; inset: 0; z-index: 3200;
  display: flex; align-items: center; justify-content: center;
  background: rgba(15, 23, 42, 0.45);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  overflow: hidden;
}
.td-celebrate-overlay[hidden] { display: none !important; }
.td-celebrate-card {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; align-items: center;
  width: min(360px, calc(100vw - 48px));
  padding: 32px 28px; box-sizing: border-box;
  background: var(--td-color-bg-surface, #fff);
  border-radius: 24px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25);
  text-align: center;
  animation: td-celebrate-pop .45s cubic-bezier(.2, 1.4, .4, 1) both;
}
.td-celebrate-check { width: 96px; height: 96px; }
.td-celebrate-check__circle {
  stroke: var(--td-color-success, #16a34a); stroke-width: 3; stroke-linecap: round;
  stroke-dasharray: 145; stroke-dashoffset: 145;
  animation: td-celebrate-draw .5s .1s ease-out forwards;
}
.td-celebrate-check__check {
  stroke: var(--td-color-success, #16a34a); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 48; stroke-dashoffset: 48;
  animation: td-celebrate-draw .35s .55s ease-out forwards;
}
.td-celebrate-title {
  margin: 18px 0 6px; font: var(--td-fw-bold, 700) 22px/28px var(--td-font-sans);
  color: var(--td-color-text-heading, #1a2433);
}
.td-celebrate-sub {
  margin: 0; font: var(--td-fw-regular, 400) 14px/20px var(--td-font-sans);
  color: var(--td-color-text-secondary, #637185);
  max-width: 280px; overflow: hidden; text-overflow: ellipsis;
}
.td-celebrate-confetti { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.td-celebrate-confetti i {
  position: absolute; top: -12px; display: block;
  width: 10px; height: 16px; border-radius: 2px;
  animation: td-celebrate-fall var(--dur, 2s) var(--delay, 0s) linear forwards;
}
@keyframes td-celebrate-pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes td-celebrate-draw { to { stroke-dashoffset: 0; } }
@keyframes td-celebrate-fall {
  0% { transform: translateY(-10vh) rotate(0deg); opacity: 1; }
  100% { transform: translateY(110vh) rotate(var(--rot, 720deg)); opacity: 1; }
}

/* ===== Закрытая (выполненная) задача — модальное окно ===== */
.td-done-modal {
  width: min(480px, calc(100vw - 48px));
  padding: 32px 32px 28px;
}
.td-done-eyebrow {
  margin: 16px 0 0;
  color: var(--td-color-accent, #2963e8);
  font: var(--td-fw-semibold, 600) 12px/16px var(--td-font-sans);
  letter-spacing: .06em; text-transform: uppercase;
}
.td-done-modal .td-celebrate-title { margin: 8px 0 10px; }
.td-done-task {
  margin: 0 0 6px;
  font: var(--td-fw-semibold, 600) 17px/23px var(--td-font-sans);
  color: var(--td-color-text-primary, #1a2433);
}
.td-done-desc {
  margin: 0 0 18px;
  font: var(--td-fw-regular, 400) 13px/19px var(--td-font-sans);
  color: var(--td-color-text-secondary, #637185);
}
.td-done-summary {
  display: grid; grid-template-columns: 1fr auto; gap: 10px 20px;
  padding: 16px; border-radius: 12px;
  background: var(--td-color-bg-subtle, #f3f5f9);
  text-align: left;
  font: var(--td-fw-regular, 400) 12px/17px var(--td-font-sans);
  color: var(--td-color-text-secondary, #637185);
}
.td-done-summary strong {
  color: var(--td-color-text-primary, #1a2433);
  font-weight: var(--td-fw-semibold, 600);
  text-align: right;
}
.td-done-close {
  margin-top: 22px; min-height: 44px; padding: 0 24px;
  border: 0; border-radius: 12px;
  background: var(--td-color-accent, #3d63eb); color: var(--td-color-text-on-accent, #fff);
  font: var(--td-fw-semibold, 600) 14px/19px var(--td-font-sans);
  cursor: pointer;
}
/* глобальный button:hover (layout.css) закрашивает фон белым — фиксируем акцент явно */
.td-done-close:hover { background: var(--td-color-accent, #3d63eb); color: #fff; filter: brightness(0.92); }

/* Мобайл: экран завершения и «закрытая задача» — компактнее */
@media (max-width: 1024px) {
  .td-celebrate-overlay { padding: 20px; }
  .td-celebrate-card { width: min(420px, calc(100vw - 40px)); padding: 28px 22px 24px; }
  .td-done-modal { width: min(440px, calc(100vw - 40px)); padding: 28px 22px 24px; }
  .td-celebrate-check { width: 84px; height: 84px; }
  .td-done-summary { gap: 8px 12px; padding: 14px; }
  .td-done-close { width: 100%; }
}
