/* =============================================================
   NOTION.CSS — United Post House
   Notion-inspired layout overlay — loaded after styles.css
   ============================================================= */

/* ── 1. TOKENS ─────────────────────────────────────────────── */
:root {
  --notion-bg:           #ffffff;
  --notion-sidebar-bg:   #f7f6f3;
  --notion-hover:        rgba(55, 53, 47, 0.08);
  --notion-active:       rgba(55, 53, 47, 0.11);
  --notion-border:       rgba(55, 53, 47, 0.09);
  --notion-text:         #37352f;
  --notion-muted:        rgba(55, 53, 47, 0.45);
  --notion-sidebar-w:    240px;
  --notion-topbar-h:     44px;
  --accent:              #c6b4ff;
  --ink:                 #37352f;
  --muted:               rgba(55, 53, 47, 0.55);
  --border:              rgba(55, 53, 47, 0.09);
  --surface:             #f7f6f3;
  --surface-soft:        #f1f0ed;
  --surface-strong:      #ffffff;
  --card:                #ffffff;
  --icon-rail-bg:        #eeece9;
  --topbar-bg:           rgba(255, 255, 255, 0.92);
  --radius-sm:           3px;
  --radius-md:           6px;
  --radius-lg:           8px;
}

/* ── DARK MODE TOKENS ───────────────────────────────────────── */
html[data-theme="dark"] {
  --notion-bg:           #191919;
  --notion-sidebar-bg:   #202020;
  --notion-hover:        rgba(255, 255, 255, 0.06);
  --notion-active:       rgba(255, 255, 255, 0.1);
  --notion-border:       rgba(255, 255, 255, 0.09);
  --notion-text:         #e6e3de;
  --notion-muted:        rgba(230, 227, 222, 0.45);
  --accent:              #c6b4ff;
  --ink:                 #e6e3de;
  --muted:               rgba(230, 227, 222, 0.5);
  --border:              rgba(255, 255, 255, 0.09);
  --surface:             #202020;
  --surface-soft:        #272727;
  --surface-strong:      #2e2e2e;
  --card:                #2e2e2e;
  --icon-rail-bg:        #252525;
  --topbar-bg:           rgba(25, 25, 25, 0.92);
}

/* ── GLOBAL UTILITY ────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── 2. BODY / LAYOUT RESET ────────────────────────────────── */
html {
  background: var(--notion-bg);
}

body {
  margin: 0 !important;
  padding: 0 !important;
  background: var(--notion-bg) !important;
  color: var(--notion-text) !important;
  font-family: 'Suit', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
  display: flex !important;
  min-height: 100vh;
  animation: none;
}

/* Reset global font overrides from legacy home/styles.css */
p, small, label, span, div, button, input, select, textarea {
  font-family: inherit;
}

/* Hide old chrome */
.flow-header,
.ops-rail,
.ambient {
  display: none !important;
}

/* ── 3. ICON RAIL ──────────────────────────────────────────── */
.icon-rail {
  width: 48px;
  min-width: 48px;
  height: 100vh;
  position: sticky;
  top: 0;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0 10px;
  background: var(--icon-rail-bg);
  border-right: 1px solid var(--notion-border);
  z-index: 110;
}

.icon-rail__top,
.icon-rail__bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.icon-rail__btn {
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: background 0.1s;
  padding: 0;
  flex-shrink: 0;
}

.icon-rail__btn:hover { background: rgba(55, 53, 47, 0.1); }

.icon-rail__btn img {
  width: 16px;
  height: 16px;
  opacity: 0.5;
}

.icon-rail__btn:hover img { opacity: 0.85; }

.icon-rail__avatar {
  width: 26px;
  height: 26px;
  border-radius: 5px;
  background: #e8e3f7;
  color: #37352f;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  font-weight: 700;
  font-family: 'PPNeueBit-Bold', sans-serif;
  letter-spacing: 0.04em;
  cursor: pointer;
}

/* ── SEARCH MODAL ──────────────────────────────────────────── */
.search-modal {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
}

.search-modal.hidden { display: none !important; }

.search-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
}

.search-modal__box {
  position: relative;
  width: 100%;
  max-width: 560px;
  background: var(--surface-strong);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.18);
  overflow: hidden;
  border: 1px solid var(--notion-border);
}

.search-modal__input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--notion-border);
}

.search-modal__icon {
  width: 16px;
  height: 16px;
  opacity: 0.4;
  flex-shrink: 0;
}

.search-modal__input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 1rem;
  color: var(--notion-text);
  background: transparent;
  font-family: inherit;
}

.search-modal__input::placeholder { color: var(--notion-muted); }

.search-modal__results {
  max-height: 380px;
  overflow-y: auto;
  padding: 6px;
}

.search-modal__results::-webkit-scrollbar { width: 4px; }
.search-modal__results::-webkit-scrollbar-thumb {
  background: rgba(55, 53, 47, 0.18);
  border-radius: 2px;
}

.search-modal__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: var(--radius-sm);
  text-align: left;
  font-family: inherit;
  transition: background 0.1s;
}

.search-modal__item:hover { background: var(--notion-hover); }

.search-modal__item-icon {
  width: 16px;
  height: 16px;
  opacity: 0.5;
  flex-shrink: 0;
}

.search-modal__item-label {
  flex: 1;
  font-size: 0.9rem;
  color: var(--notion-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-modal__item-meta {
  font-size: 0.72rem;
  color: var(--notion-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.search-modal__empty {
  padding: 24px;
  text-align: center;
  font-size: 0.875rem;
  color: var(--notion-muted);
}

/* ── 4. SIDEBAR ────────────────────────────────────────────── */
.sidebar {
  width: var(--notion-sidebar-w);
  min-width: var(--notion-sidebar-w);
  height: 100vh;
  position: sticky;
  top: 0;
  flex-shrink: 0;
  background: var(--notion-sidebar-bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: none;
}

.sidebar--animate {
  transition: width 0.2s ease, min-width 0.2s ease !important;
  z-index: 100;
  border-right: 1px solid var(--notion-border);
  user-select: none;
}

.sidebar.is-collapsed {
  width: 52px !important;
  min-width: 52px !important;
  overflow: hidden;
}

/* Icon-only mode — hide text and labels */
.sidebar.is-collapsed .sidebar__item-text,
.sidebar.is-collapsed .sidebar__section-label,
.sidebar.is-collapsed .sidebar__section-add,
.sidebar.is-collapsed .sidebar__children,
.sidebar.is-collapsed .sidebar__workspace-name,
.sidebar.is-collapsed .sidebar__user-info {
  display: none !important;
}

/* Rotate chevron to point right when collapsed */
.sidebar.is-collapsed .sidebar__collapse-btn img {
  transform: rotate(180deg);
}

/* Thinking icon — only visible when collapsed */
.sidebar__thinking-icon { display: none !important; }
.sidebar.is-collapsed .sidebar__thinking-icon { display: flex !important; }

.sidebar.is-collapsed .sidebar__item {
  justify-content: center !important;
  padding: 5px !important;
}

.sidebar.is-collapsed .sidebar__item-icon {
  opacity: 0.7;
  width: 20px !important;
  height: 20px !important;
}

.sidebar.is-collapsed .sidebar__item-icon img {
  width: 16px !important;
  height: 16px !important;
}

.sidebar.is-collapsed .sidebar__workspace {
  display: none !important;
}

.sidebar.is-collapsed .sidebar__header {
  justify-content: center;
  padding: 10px 6px 2px;
}

.sidebar.is-collapsed .sidebar__user {
  justify-content: center !important;
  padding: 6px 4px !important;
}

.sidebar.is-collapsed .sidebar__user-avatar {
  min-width: 26px;
}


/* Workspace header */
.sidebar__header {
  flex-shrink: 0;
  padding: 10px 6px 2px;
  display: flex;
  align-items: center;
  gap: 2px;
}

.sidebar__workspace {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  flex: 1;
  min-width: 0;
}

.sidebar__workspace-logo {
  width: 22px;
  height: 22px;
  min-width: 22px;
  border-radius: 4px;
  background: #1c1c1c;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'PPNeueBit-Bold', sans-serif;
  font-size: 0.58rem;
  letter-spacing: 0.12em;
}

.sidebar__workspace-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--notion-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.sidebar__collapse-btn {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border: none;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--notion-muted);
  transition: background 0.12s, color 0.12s;
  flex-shrink: 0;
}

.sidebar__collapse-btn:hover {
  background: var(--notion-hover);
  color: var(--notion-text);
}

.sidebar__collapse-btn img {
  width: 14px;
  height: 14px;
  opacity: 0.55;
}

/* Nav scroll container */
.sidebar__nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px 4px 8px;
}

.sidebar__nav::-webkit-scrollbar { width: 4px; }
.sidebar__nav::-webkit-scrollbar-thumb {
  background: rgba(55, 53, 47, 0.18);
  border-radius: 2px;
}

/* Section labels */
.sidebar__section-label {
  padding: 14px 12px 3px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--notion-muted);
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.sidebar__section-add {
  width: 18px;
  height: 18px;
  min-width: 18px;
  border: none;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--notion-muted);
  font-size: 1rem;
  line-height: 1;
  padding: 0;
  transition: background 0.1s, color 0.1s;
  margin-right: 2px;
  flex-shrink: 0;
}

.sidebar__section-add:hover {
  background: var(--notion-hover);
  color: var(--notion-text);
}

/* Nav items */
.sidebar__item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  color: var(--notion-text);
  font-size: 0.875rem;
  line-height: 1.2;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  text-decoration: none;
  min-height: 28px;
  transition: background 0.1s;
  white-space: nowrap;
  overflow: hidden;
  font-family: inherit;
}

.sidebar__item:hover { background: var(--notion-hover); }
.sidebar__item.is-active { background: var(--notion-active); font-weight: 500; }

.sidebar__item-emoji {
  font-size: 0.9rem;
  line-height: 1;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar__item-icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  opacity: 0.55;
}

.sidebar__item-icon img { width: 14px; height: 14px; }
.sidebar__item.is-active .sidebar__item-icon { opacity: 1; }

.sidebar__item-emoji {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
  line-height: 1;
}

.sidebar__item-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Nested children — indented under a parent item */
.sidebar__children {
  margin-left: 20px;
  padding-left: 8px;
  border-left: 1px solid var(--notion-border);
}

/* Sidebar doc page icon (CSS mask — color set inline) */
.sidebar__child-icon {
  display: inline-block;
  width: 14px;
  height: 14px;
  vertical-align: middle;
  margin-right: 6px;
  flex-shrink: 0;
  background-color: currentColor;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
}

/* Sidebar child: flex so icon + text sit in a row */
.sidebar__child {
  display: flex !important;
  align-items: center;
}

/* Thinking pages sit flush under the section label, no indent */
#docsSidebarPages {
  margin-left: 0;
  padding-left: 0;
  border-left: none;
}

/* ── SIDEBAR TODO ─────────────────────────────────────────── */
.todo-section-label { cursor: default; }

/* nav list */
.todo-nav-empty {
  padding: 3px 8px 5px;
  font-size: 0.78rem;
  color: var(--notion-muted);
}

.todo-nav-item {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 2px 4px 2px 8px;
  border-radius: var(--radius-sm);
  min-height: 27px;
  cursor: pointer;
  transition: background 0.1s;
  position: relative;
}
.todo-nav-item:hover            { background: var(--notion-hover); }
.todo-nav-item.is-active        { background: var(--notion-active); }
.todo-nav-item:hover .todo-nav-del { opacity: 1; }

.todo-nav-icon {
  font-size: 0.75rem;
  flex-shrink: 0;
  opacity: 0.5;
  line-height: 1;
}

.todo-nav-name {
  flex: 1;
  font-size: 0.8125rem;
  color: var(--notion-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.todo-nav-count {
  font-size: 0.65rem;
  font-weight: 600;
  background: var(--accent, #9b8af4);
  color: #fff;
  border-radius: 999px;
  padding: 1px 6px;
  line-height: 1.4;
  flex-shrink: 0;
}

.todo-nav-del {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  padding: 0;
  border: none;
  background: none;
  color: var(--notion-muted);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.1s, background 0.1s;
}
.todo-nav-del:hover {
  background: var(--notion-hover);
  color: var(--notion-text);
}

/* collapsed sidebar — hide todo section */
.sidebar.is-collapsed #todoSidebarSection { display: none; }

/* ── TODO MAIN VIEW ──────────────────────────────────────── */
.todo-main-view {
  position: fixed;
  top: var(--notion-topbar-h, 44px);
  left: calc(48px + var(--notion-sidebar-w, 240px));
  right: 0;
  bottom: 0;
  background: var(--notion-bg, #ffffff);
  z-index: 600;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}
.todo-main-view.is-open { transform: translateX(0); }

/* Topbar */
.todo-main-topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 24px;
  height: 52px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.todo-main-back {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  opacity: 0.55;
  transition: background 0.1s, opacity 0.1s;
}
.todo-main-back:hover { background: var(--notion-hover); opacity: 1; }
.todo-main-back img   { width: 16px; height: 16px; }

.todo-main-title {
  flex: 1;
  font-size: 1rem;
  font-weight: 600;
  color: var(--notion-text);
  background: none;
  border: none;
  outline: none;
  font-family: inherit;
  min-width: 0;
}
.todo-main-title::placeholder { color: var(--notion-muted); font-weight: 400; }

/* ── List prev/next nav (top-right of topbar) ───────────── */
.todo-list-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  margin-left: 8px;
}

.todo-list-nav__btn {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: none;
  color: var(--notion-text);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.1s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.todo-list-nav__btn:hover { background: var(--notion-hover); }

/* ── Mon–Sun day tabs ────────────────────────────────────── */
.todo-day-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  padding: 0 24px;
  overflow-x: auto;
  scrollbar-width: none;
}
.todo-day-tabs::-webkit-scrollbar { display: none; }

.todo-day-tab {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px 10px;
  font-size: 0.8125rem;
  font-family: inherit;
  font-weight: 500;
  color: var(--notion-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
}
.todo-day-tab:hover { color: var(--notion-text); background: var(--notion-hover); }
.todo-day-tab.is-active {
  color: var(--notion-text);
  border-bottom-color: var(--accent, #9b8af4);
}
/* today's tab label gets accent dot */
.todo-day-tab.is-today { color: var(--notion-text); }
.todo-day-tab.is-today::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent, #9b8af4);
  flex-shrink: 0;
}
.todo-day-tab__count {
  font-size: 0.65rem;
  font-weight: 600;
  background: var(--accent, #9b8af4);
  color: #fff;
  border-radius: 999px;
  padding: 1px 6px;
  line-height: 1.4;
}

/* ── Single-day content area ─────────────────────────────── */
.todo-day-view {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 0;
}

/* ── DARK MODE — todo ────────────────────────────────────── */
html[data-theme="dark"] .todo-main-view { background: var(--notion-bg); }
html[data-theme="dark"] .todo-main-back img { filter: invert(1) brightness(0.85); }
html[data-theme="dark"] .todo-block:hover .todo-block__note,
html[data-theme="dark"] .todo-block:hover .todo-block__url {
  background: var(--notion-hover);
}
html[data-theme="dark"] .todo-block__note:focus,
html[data-theme="dark"] .todo-block__url:focus {
  background: var(--notion-hover);
}

.todo-block {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 30px;
  padding: 3px 6px 3px 2px;
  border-radius: 8px;
  transition: background 0.12s ease;
}

.todo-block:hover {
  background: var(--notion-hover);
}

.todo-block.is-done .todo-block__content {
  opacity: 0.48;
  text-decoration: line-through;
}

.todo-block__handle,
.todo-block__del,
.todo-block__check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--notion-muted);
}

.todo-block__handle {
  width: 16px;
  cursor: grab;
  opacity: 0;
}

.todo-block:hover .todo-block__handle,
.todo-block:hover .todo-block__del {
  opacity: 1;
}

.todo-block__del,
.todo-block__check {
  cursor: pointer;
}

.todo-block__del:hover,
.todo-block__check:hover {
  background: var(--notion-active);
  color: var(--notion-text);
}

.todo-block__check-box,
.todo-block__check-ghost {
  width: 15px;
  height: 15px;
  border-radius: 4px;
  border: 1.5px solid var(--notion-muted);
  flex-shrink: 0;
}

.todo-block__check-box.is-checked {
  position: relative;
  border-color: var(--accent, #9b8af4);
  background: var(--accent, #9b8af4);
}

.todo-block__check-box.is-checked::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 1px;
  width: 5px;
  height: 9px;
  border: 1.5px solid #fff;
  border-top: 0;
  border-left: 0;
  transform: rotate(45deg) translateY(-1px);
}

.todo-block__content {
  flex: 1;
  min-width: 0;
  padding: 1px 4px;
  outline: none;
  color: var(--notion-text);
  font-size: 0.875rem;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.todo-block__content:focus {
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
}

.todo-block__content:empty::before {
  content: attr(data-placeholder);
  color: var(--notion-muted);
  pointer-events: none;
}

.todo-block__note,
.todo-block__url {
  box-sizing: border-box;
  width: 0;
  height: 26px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  font: inherit;
  font-size: 0.8rem;
  color: var(--notion-muted);
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  flex-shrink: 0;
  transition: width 0.15s ease, opacity 0.15s ease, padding 0.15s ease, border-color 0.15s ease;
}

.todo-block:hover .todo-block__note,
.todo-block:hover .todo-block__url,
.todo-block:focus-within .todo-block__note,
.todo-block:focus-within .todo-block__url,
.todo-block.has-note .todo-block__note,
.todo-block.has-url .todo-block__url {
  width: 130px;
  padding: 0 8px;
  border-color: var(--border);
  opacity: 1;
  pointer-events: auto;
}

.todo-block__note:focus,
.todo-block__url:focus {
  outline: none;
  border-color: var(--accent, #9b8af4);
  color: var(--notion-text);
  box-shadow: 0 0 0 2px rgba(155, 138, 244, 0.12);
}

.todo-block__url-open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 5px;
  color: var(--accent, #9b8af4);
  font-size: 0.9rem;
  opacity: 0;
  transition: opacity 0.12s;
  text-decoration: none;
  flex-shrink: 0;
}

.todo-block__url-open.is-hidden {
  pointer-events: none;
  opacity: 0 !important;
}

.todo-block:hover .todo-block__url-open:not(.is-hidden),
.todo-block:focus-within .todo-block__url-open:not(.is-hidden),
.todo-block.has-url .todo-block__url-open:not(.is-hidden) {
  opacity: 1;
}

.todo-block__url-open:hover {
  background: var(--notion-active);
}

.todo-block--ghost {
  background: transparent;
}

.todo-block__content--ghost {
  color: var(--notion-muted);
}

.todo-block.is-dragging {
  opacity: 0.45;
}

.todo-block--drop-above {
  box-shadow: inset 0 2px 0 var(--accent, #9b8af4);
}

.todo-block--drop-below {
  box-shadow: inset 0 -2px 0 var(--accent, #9b8af4);
}

/* Week grid collapses to 3+4 scrollable cols on narrow viewports */
@media (max-width: 900px) {
  .todo-week-grid {
    grid-template-columns: repeat(7, minmax(120px, 1fr));
    overflow-x: auto;
  }
  .todo-main-week-label { min-width: 120px; font-size: 0.75rem; }
}

.sidebar__child {
  display: block;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  color: var(--notion-muted);
  font-size: 0.8125rem;
  line-height: 27px;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  min-height: 27px;
  transition: background 0.1s, color 0.1s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: inherit;
}

.sidebar__child:hover {
  background: var(--notion-hover);
  color: var(--notion-text);
}

.sidebar__child.is-active {
  background: var(--notion-active);
  color: var(--notion-text);
  font-weight: 500;
}

.sidebar__divider {
  height: 1px;
  background: var(--notion-border);
  margin: 6px 8px;
}

/* Footer — user */
.sidebar__footer {
  flex-shrink: 0;
  padding: 4px 4px 8px;
  border-top: 1px solid var(--notion-border);
}

.sidebar__user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  transition: background 0.1s;
  font-family: inherit;
}

.sidebar__user:hover { background: var(--notion-hover); }

.sidebar__user-avatar {
  width: 26px;
  height: 26px;
  min-width: 26px;
  border-radius: 5px;
  background: #e8e3f7;
  color: #1c1c1c;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 700;
  font-family: 'PPNeueBit-Bold', sans-serif;
  letter-spacing: 0.04em;
}

.sidebar__user-info {
  flex: 1;
  min-width: 0;
}

.sidebar__user-name {
  font-size: 0.875rem;
  color: var(--notion-text);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.3;
}

.sidebar__user-hint {
  font-size: 0.72rem;
  color: var(--notion-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── 4. PAGE WRAPPER ───────────────────────────────────────── */
.page-wrapper {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--notion-bg);
}

/* ── 5. TOPBAR ─────────────────────────────────────────────── */
.page-topbar {
  height: var(--notion-topbar-h);
  min-height: var(--notion-topbar-h);
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 8px;
  position: sticky;
  top: 0;
  background: var(--topbar-bg);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--notion-border);
  z-index: 50;
  flex-shrink: 0;
}

.page-topbar__left {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.sidebar-open-btn {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border: none;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--notion-muted);
  transition: background 0.12s, color 0.12s;
}

.sidebar-open-btn:hover {
  background: var(--notion-hover);
  color: var(--notion-text);
}

.sidebar-open-btn img { width: 16px; height: 16px; opacity: 0.55; }

.page-breadcrumb {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.875rem;
  color: var(--notion-muted);
  overflow: hidden;
}

.page-breadcrumb__link {
  color: var(--notion-muted);
  text-decoration: none;
  border-radius: 3px;
  padding: 2px 4px;
  transition: background 0.1s, color 0.1s;
  white-space: nowrap;
}

.page-breadcrumb__link:hover {
  background: var(--notion-hover);
  color: var(--notion-text);
}

.page-breadcrumb__sep {
  font-size: 0.72rem;
  opacity: 0.45;
  user-select: none;
}

.page-breadcrumb__current {
  color: var(--notion-text);
  font-weight: 500;
  border-radius: 3px;
  padding: 2px 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.page-topbar__right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* ── 6. MAIN CONTENT AREA ──────────────────────────────────── */
.app {
  padding: 2.5rem 4rem 4rem !important;
  flex: 1;
}

/* Page section title — Notion page style */
.section__header--hero h2 {
  font-size: 2.4rem !important;
  font-weight: 700 !important;
  line-height: 1.15 !important;
  letter-spacing: -0.01em !important;
  font-family: var(--font-title) !important;
  color: var(--notion-text) !important;
}

.section__eyebrow {
  font-size: 0.7rem !important;
  color: var(--notion-muted) !important;
  letter-spacing: 0.1em !important;
}

.section__eyebrow::before { display: none !important; }

/* ── 7. BUTTONS ────────────────────────────────────────────── */
.primary-btn {
  background: #2f2f2f !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: var(--radius-sm) !important;
  font-size: 0.875rem !important;
  font-family: inherit !important;
  padding: 0.38rem 0.85rem !important;
  cursor: pointer !important;
  font-weight: 500 !important;
  transition: background 0.12s !important;
}

.primary-btn:hover { background: #1a1a1a !important; }

.primary-btn.is-accent {
  background: var(--accent) !important;
  color: #37352f !important;
}

.primary-btn.is-accent:hover { background: #b8a2f5 !important; }

.ghost-btn {
  background: transparent !important;
  border: 1px solid rgba(55, 53, 47, 0.2) !important;
  color: var(--notion-text) !important;
  border-radius: var(--radius-sm) !important;
  font-size: 0.875rem !important;
  font-family: inherit !important;
  padding: 0.38rem 0.85rem !important;
  cursor: pointer !important;
  font-weight: 400 !important;
  transition: background 0.12s !important;
}

.ghost-btn:hover { background: var(--notion-hover) !important; }

.ghost-btn.danger {
  border-color: rgba(220, 60, 60, 0.35) !important;
  color: #c0392b !important;
}

.ghost-btn.danger:hover { background: rgba(220, 60, 60, 0.06) !important; }

.ghost-btn.is-icon,
.primary-btn.is-icon {
  width: 30px !important;
  height: 30px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: var(--radius-sm) !important;
}

.ghost-btn.is-icon img,
.primary-btn.is-icon img {
  width: 14px !important;
  height: 14px !important;
}

/* ── 8. INPUTS ─────────────────────────────────────────────── */
.search {
  background: var(--notion-bg) !important;
  border: 1px solid rgba(55, 53, 47, 0.2) !important;
  border-radius: var(--radius-sm) !important;
  height: 30px !important;
  padding: 0 10px !important;
  font-size: 0.875rem !important;
  color: var(--notion-text) !important;
  font-family: inherit !important;
}

.search::placeholder { color: var(--notion-muted) !important; }

/* ── 9. SUBTABS (inline nav within sections) ───────────────── */
.subtabs {
  margin-bottom: 1rem !important;
}

.subtab {
  height: auto !important;
  padding: 4px 10px !important;
  font-size: 0.875rem !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  color: var(--notion-muted) !important;
  border-radius: var(--radius-sm) !important;
  font-family: inherit !important;
  transition: background 0.1s, color 0.1s !important;
}

.subtab:hover { background: var(--notion-hover) !important; color: var(--notion-text) !important; }

.subtab.is-active {
  background: var(--notion-active) !important;
  color: var(--notion-text) !important;
  font-weight: 500 !important;
}

.subtab-indicator { display: none !important; }

/* ── 10. PANELS ────────────────────────────────────────────── */
.subtab-panel {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  border-radius: 0 !important;
}

.invoice-panel {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
}

/* ── 11. TABLES / DATA GRIDS ───────────────────────────────── */
.data-grid__row,
.invoice-row,
.line-item-row {
  background: transparent !important;
  border-left: none !important;
  border-right: none !important;
  border-top: none !important;
  border-bottom: 1px solid var(--notion-border) !important;
  border-radius: 0 !important;
  font-size: 0.875rem !important;
  padding: 0.45rem 0.5rem !important;
}

.data-grid__row:first-child,
.invoice-row:first-child { border-top: 1px solid var(--notion-border) !important; }

.data-grid__row:hover,
.invoice-row:hover { background: rgba(55, 53, 47, 0.025) !important; }

.data-grid__row--head,
.invoice-row--head,
.line-item-row--head {
  border: none !important;
  background: transparent !important;
  color: var(--notion-muted) !important;
  font-size: 0.72rem !important;
  letter-spacing: 0.04em !important;
}

/* ── 12. OVERVIEW CARDS ────────────────────────────────────── */
.overview-card {
  border: 1px solid var(--notion-border) !important;
  border-radius: var(--radius-md) !important;
  background: var(--notion-bg) !important;
  box-shadow: none !important;
}

.overview-card h4 { color: var(--notion-muted) !important; font-size: 0.75rem !important; }
.overview-card .value { color: var(--notion-text) !important; }

/* ── 13. EDIT CARDS (project flow insight grid) ────────────── */
.edit-card {
  background: #faf9f7 !important;
  border: 1px solid var(--notion-border) !important;
  border-radius: var(--radius-md) !important;
}

/* ── 14. MODALS / WIZARD ───────────────────────────────────── */
.modal,
.wizard {
  background: rgba(0, 0, 0, 0.35) !important;
}

.modal__panel,
.wizard__panel {
  background: #ffffff !important;
  border: 1px solid var(--notion-border) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.14) !important;
}

.modal__header h3,
.wizard__header h3 {
  font-size: 1.1rem !important;
  color: var(--notion-text) !important;
}

.modal__eyebrow,
.wizard__eyebrow {
  color: var(--notion-muted) !important;
  font-size: 0.68rem !important;
  letter-spacing: 0.08em !important;
}

/* Login form */
.ops-login-form input {
  background: #ffffff !important;
  border: 1px solid rgba(55, 53, 47, 0.2) !important;
  color: var(--notion-text) !important;
  border-radius: var(--radius-sm) !important;
}

.ops-login-form .form-field {
  color: var(--notion-muted) !important;
}

/* Wizard fields */
.wizard__field input,
.wizard__field select,
.wizard__field textarea,
.modal__form input,
.modal__form select,
.modal__form textarea {
  background: #ffffff !important;
  border: 1px solid rgba(55, 53, 47, 0.2) !important;
  color: var(--notion-text) !important;
  border-radius: var(--radius-sm) !important;
}

/* ── 15. STATUS PILL ───────────────────────────────────────── */
.status-pill {
  font-size: 0.72rem !important;
  border-radius: var(--radius-sm) !important;
  border: 1px solid var(--notion-border) !important;
  background: var(--notion-bg) !important;
  color: var(--notion-text) !important;
}

.status-pill--icon {
  width: 28px !important;
  height: 28px !important;
}

/* ── 16. FLOW (Project Flow) ───────────────────────────────── */
.flow-vertical {
  max-width: 900px !important;
}

.flow-vline {
  background: linear-gradient(to bottom,
    rgba(55,53,47,0) 0%,
    rgba(55,53,47,0.35) 18%,
    rgba(55,53,47,0.35) 82%,
    rgba(55,53,47,0) 100%) !important;
}

.flow-vline::after {
  background: #37352f !important;
  box-shadow: 0 0 0 6px rgba(55, 53, 47, 0.1) !important;
}

/* ── 17. SECTION ACTIONS ───────────────────────────────────── */
.section__actions {
  gap: 0.5rem !important;
}

.section__header {
  padding-bottom: 0.75rem !important;
  border-bottom: 1px solid var(--notion-border) !important;
  margin-bottom: 1.25rem !important;
}

.section__header .subtabs {
  border-bottom: none !important;
  margin-bottom: 0 !important;
}

/* ── 18. CONSTANTS STACK ───────────────────────────────────── */
.constants-stack { gap: 1.5rem !important; }

.subtabs--vertical .subtab {
  text-align: left !important;
  justify-content: flex-start !important;
}

/* ── 19. TRACKING ITEMS (light bg) ────────────────────────── */
.tracking-item {
  background: #faf9f7 !important;
  border-color: var(--notion-border) !important;
  border-radius: var(--radius-md) !important;
}

.tracking-item__icon {
  background: var(--notion-bg) !important;
  border-color: var(--notion-border) !important;
}

.tracking-item__action,
.tracking-item__remove {
  background: var(--notion-bg) !important;
  border-color: var(--notion-border) !important;
}

/* ── 20. FLOW PROJECT SELECT ───────────────────────────────── */
.flow-project-select {
  border-radius: var(--radius-sm) !important;
  border: 1px solid rgba(55, 53, 47, 0.2) !important;
  background: var(--notion-bg) !important;
  color: var(--notion-text) !important;
  font-size: 0.875rem !important;
  height: 30px !important;
}

/* ── 21. VAULT UPLOAD ──────────────────────────────────────── */
.vault-upload__drop {
  border: 2px dashed rgba(55, 53, 47, 0.18) !important;
  border-radius: var(--radius-md) !important;
  background: #faf9f7 !important;
}

/* ── 22. RESPONSIVE: sidebar collapses ─────────────────────── */
@media (max-width: 768px) {
  .sidebar {
    position: fixed !important;
    z-index: 200 !important;
    box-shadow: 2px 0 16px rgba(0,0,0,0.1);
  }

  .sidebar.is-collapsed {
    transform: translateX(-100%);
    width: var(--notion-sidebar-w) !important;
    min-width: var(--notion-sidebar-w) !important;
    overflow: hidden;
  }

  .app {
    padding: 1.5rem 1.5rem 3rem !important;
  }
}

/* ── 23. PAGE-ENTER ANIMATION ──────────────────────────────── */
@keyframes page-enter {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── 24. SECTION RISE ANIMATION ────────────────────────────── */
.section.is-active {
  animation: section-in 0.15s ease;
}

@keyframes section-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── 25. MISC FIXES ────────────────────────────────────────── */

/* Remove dark bg from tracking form inputs */
.tracking-form input,
.tracking-form select {
  background: var(--notion-bg) !important;
  color: var(--notion-text) !important;
  border-color: rgba(55, 53, 47, 0.2) !important;
  border-radius: var(--radius-sm) !important;
}

/* Flow step list */
.flow__step-list {
  background: #faf9f7;
  border: 1px solid var(--notion-border);
  border-radius: var(--radius-md);
}

/* Avatar button in topbar is hidden — user is in sidebar footer */
.ops-avatar { display: none !important; }

/* Status in topbar */
#ops-status {
  border-radius: var(--radius-sm) !important;
}

/* Line item row */
.line-item-status {
  background: var(--notion-bg) !important;
  border-color: var(--notion-border) !important;
}

/* Wizard progress dots */
.wizard__dot {
  background: rgba(55, 53, 47, 0.12) !important;
}

.wizard__dot.is-active {
  background: #37352f !important;
}

/* Select styling */
.edit-calendar-swap select {
  background: var(--notion-bg) !important;
  border-color: rgba(55, 53, 47, 0.2) !important;
  color: var(--notion-text) !important;
  border-radius: var(--radius-sm) !important;
}

/* Empty state */
.empty-state {
  border-color: rgba(55, 53, 47, 0.12) !important;
  background: #faf9f7 !important;
  border-radius: var(--radius-md) !important;
}

.empty-state h3 { color: var(--notion-text) !important; }

/* Module embed */
.module-embed {
  border-color: var(--notion-border) !important;
  border-radius: var(--radius-md) !important;
  background: #faf9f7 !important;
}

/* ── 26. OPS SECTION LAYOUT — responsive fit ───────────────── */

/* Section header: title + subtabs wrap cleanly */
.section__header--hero {
  flex-wrap: wrap !important;
  gap: 0.5rem 1rem !important;
  align-items: flex-end !important;
}

/* Overview grid: fluid columns, no fixed-px overflow */
.section[data-section="overview"] .overview-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)) !important;
  grid-auto-rows: minmax(30px, auto) !important;
  max-width: 100% !important;
  width: 100% !important;
}

/* Flow / invoices / vault: remove fixed max-width that causes overflow */
.section[data-section="flow"] .flow-stack,
.section[data-section="invoices"] .subtab-panels,
.section[data-section="vault"] .subtab-panels {
  max-width: 100% !important;
}

/* Constants: vertical subtabs row → sits cleanly above panels */
.section[data-section="constants"] .subtab-layout {
  flex-direction: column !important;
  gap: 1rem !important;
}

.section[data-section="constants"] .subtabs--vertical {
  justify-content: flex-start !important;
  flex-wrap: wrap !important;
}

/* Ensure all section content doesn't clip */
.section {
  overflow: visible !important;
}

.app {
  overflow-x: hidden !important;
}

/* ── VISION DOC PANEL ──────────────────────────────────────── */
.vision-panel {
  position: fixed;
  top: 0;
  left: 0;
  width: 600px;
  max-width: calc(100vw - 48px);
  height: 100vh;
  background: #fff;
  border-right: 1px solid rgba(55,53,47,0.1);
  box-shadow: 8px 0 40px rgba(0,0,0,0.12);
  z-index: 1100;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.24s cubic-bezier(0.22,1,0.36,1);
}
.vision-panel.is-open { transform: translateX(48px); }

.vision-panel__overlay {
  position: fixed;
  top: 0;
  left: 48px;
  right: 0;
  bottom: 0;
  z-index: 1099;
  background: rgba(0,0,0,0.18);
}

/* Close button — absolute top-right corner */
.vision-panel__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  opacity: 0.4;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}
.vision-panel__close:hover { background: rgba(55,53,47,0.08); opacity: 1; }
.vision-panel__close img { width: 14px; height: 14px; }

/* Page content area — matches docs editor layout */
.vision-panel__page {
  flex: 1;
  overflow-y: auto;
  padding: 40px 44px 80px 44px;
  display: flex;
  flex-direction: column;
}

.vision-panel__page-header {
  display: flex;
  align-items: center;
  margin-bottom: 0.4rem;
}

.vision-panel__page-icon {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #37352f;
  cursor: default;
}

.vision-panel__icon-mask {
  width: 100%;
  height: 100%;
  background-color: currentColor;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
}

.vision-panel__eyebrow {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: rgba(55,53,47,0.35);
  margin-bottom: 0.4rem;
}

.vision-panel__title {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  color: #2f2f2f;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  padding: 0;
  margin-bottom: 1.2rem;
  font-family: inherit;
  font-weight: 700;
  -webkit-appearance: none;
  appearance: none;
  box-shadow: none;
}
.vision-panel__title::placeholder {
  color: rgba(55,53,47,0.24);
}

.vision-panel__editor {
  flex: 1;
  font-size: 1rem;
  line-height: 1.75;
  color: #37352f;
  outline: none;
  min-height: 60vh;
  font-family: inherit;
}
.vision-panel__editor:empty::before {
  content: attr(data-placeholder);
  color: rgba(55,53,47,0.35);
  pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════
   OPS PAGE — normalize to Notion style
   home/styles.css loads first so equal-specificity rules here win.
   ═══════════════════════════════════════════════════════════ */

/* Restore box shadows nuked by home/styles.css * { box-shadow: none !important } */
.sidebar           { box-shadow: 2px 0 8px rgba(0,0,0,0.06) !important; }
.search-modal__box { box-shadow: 0 8px 40px rgba(0,0,0,0.18) !important; }
.vision-panel      { box-shadow: 8px 0 40px rgba(0,0,0,0.12) !important; }

/* ── TIME TRACKER PANEL ────────────────────────────────────── */
.tt-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 460px;
  max-width: calc(100vw - 48px);
  height: 100vh;
  background: #fff;
  border-left: 1px solid rgba(55,53,47,0.1);
  box-shadow: -8px 0 40px rgba(0,0,0,0.12);
  z-index: 1100;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.24s cubic-bezier(0.22,1,0.36,1);
}
.tt-panel      { box-shadow: -8px 0 40px rgba(0,0,0,0.12) !important; }
.tt-panel.is-open { transform: translateX(0); }

.tt-panel__overlay {
  position: fixed;
  top: 0;
  left: 48px;
  right: 0;
  bottom: 0;
  z-index: 1099;
  background: rgba(0,0,0,0.18);
}

.tt-panel__close {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  opacity: 0.4;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}
.tt-panel__close:hover { background: rgba(55,53,47,0.08); opacity: 1; }
.tt-panel__close img { width: 14px; height: 14px; }

.tt-panel__inner {
  flex: 1;
  overflow-y: auto;
  padding: 48px 28px 80px 28px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Page header */
.tt-page-header { margin-bottom: 20px; }

.tt-page-icon {
  width: 40px;
  height: 40px;
  color: #37352f;
  margin-bottom: 6px;
}
.tt-icon-mask {
  width: 100%;
  height: 100%;
  background-color: currentColor;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
}

.tt-eyebrow {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: rgba(55,53,47,0.35);
  margin-bottom: 2px;
}
.tt-title {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #2f2f2f;
  line-height: 1.1;
}

/* Stats bar */
.tt-statsbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  font-size: 12px;
  color: rgba(55,53,47,0.55);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  margin-bottom: 14px;
}
.tt-dot { opacity: 0.45; }
.tt-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 2px;
  background: transparent;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  opacity: 0.4;
}
.tt-icon-btn:hover { opacity: 1; background: rgba(55,53,47,0.08); }
.tt-icon-btn img { width: 14px; height: 14px; }

/* Live card */
.tt-live {
  background: var(--surface-soft, #f7f6f4);
  border: 1px solid rgba(55,53,47,0.12);
  border-radius: var(--radius-lg, 10px);
  padding: 14px 16px;
  margin-bottom: 14px;
}
.tt-live__row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}
.tt-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--accent, #9b8af4);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
}
.tt-since {
  font-size: 12px;
  color: rgba(55,53,47,0.45);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
.tt-elapsed {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: #2f2f2f;
  margin-bottom: 2px;
}
.tt-totals {
  font-size: 12px;
  color: rgba(55,53,47,0.45);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  margin-bottom: 10px;
}
.tt-live__actions { display: flex; gap: 8px; }

/* Buttons */
.tt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 13px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: #37352f;
  background: transparent;
  border: 1px solid rgba(55,53,47,0.2);
  border-radius: 6px;
  transition: background 0.12s, border-color 0.12s;
  font-family: inherit;
}
.tt-btn:hover { background: rgba(55,53,47,0.06); border-color: rgba(55,53,47,0.35); }
.tt-btn:active { background: rgba(55,53,47,0.1); }
.tt-btn--primary {
  background: var(--accent, #9b8af4);
  border-color: var(--accent, #9b8af4);
  color: #fff;
}
.tt-btn--primary:hover {
  background: var(--accent-dark, #7c6bd4);
  border-color: var(--accent-dark, #7c6bd4);
}
.tt-btn--ghost { opacity: 0.6; }
.tt-btn--ghost:hover { opacity: 1; }
.tt-btn--sm { padding: 5px 10px; font-size: 12px; }
.tt-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Toolbar */
.tt-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
}
.tt-export-wrap { position: relative; }
.tt-export-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 150px;
  background: #fff;
  border: 1px solid rgba(55,53,47,0.12);
  border-radius: 8px;
  padding: 4px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  z-index: 1200;
}
.tt-export-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 5px;
  font-size: 13px;
  color: #37352f;
}
.tt-export-item:hover { background: rgba(55,53,47,0.06); }

/* History */
.tt-history { flex: 1; }
.tt-empty { text-align: center; color: rgba(55,53,47,0.4); font-size: 13px; padding: 24px 0; }
.tt-week-group { margin-bottom: 8px; }
.tt-day-group { margin-bottom: 14px; }
.tt-day-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  color: rgba(55,53,47,0.55);
  letter-spacing: 0.01em;
  margin-bottom: 6px;
}
.tt-day-total { font-size: 12px; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
.tt-entry {
  background: var(--surface-soft, #f7f6f4);
  border: 1px solid rgba(55,53,47,0.08);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 6px;
}
.tt-entry__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.tt-entry__range {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  font-weight: 600;
  color: #37352f;
}
.tt-entry__dur {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  color: rgba(55,53,47,0.45);
  white-space: nowrap;
}
.tt-entry__meta { display: flex; gap: 6px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.tt-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  color: rgba(55,53,47,0.55);
  background: rgba(55,53,47,0.07);
}
.tt-chip--added { background: rgba(155,138,244,0.15); color: var(--accent, #9b8af4); }
.tt-entry__btn {
  font-size: 11px;
  padding: 2px 7px;
  border: 1px solid rgba(55,53,47,0.15);
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  color: rgba(55,53,47,0.55);
  font-family: inherit;
}
.tt-entry__btn:hover { background: rgba(55,53,47,0.06); color: #37352f; }

/* Modals */
.tt-modal-backdrop {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1200;
  background: rgba(31,35,40,0.35);
}
.tt-modal {
  width: 92%;
  max-width: 480px;
  background: #fff;
  border: 1px solid rgba(55,53,47,0.12);
  border-radius: 12px;
  padding: 20px 22px 16px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.15);
  color: #37352f;
}
.tt-modal h3 {
  margin: 0 0 14px;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #2f2f2f;
}
.tt-modal small {
  display: block;
  font-size: 12px;
  color: rgba(55,53,47,0.45);
  line-height: 1.5;
  margin: 8px 0;
}
.tt-modal__row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.tt-modal__row label {
  min-width: 110px;
  font-size: 13px;
  color: rgba(55,53,47,0.55);
  flex-shrink: 0;
}
.tt-modal__row input {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  background: #fff;
  color: #37352f;
  border: 1px solid rgba(55,53,47,0.2);
  border-radius: 6px;
  font-size: 14px;
  outline: none;
  font-family: inherit;
}
.tt-modal__row input:focus {
  border-color: var(--accent, #9b8af4);
  box-shadow: 0 0 0 2px rgba(155,138,244,0.2);
}
.tt-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

/* ── DARK MODE — time tracker ───────────────────────────────── */
html[data-theme="dark"] .tt-panel {
  background: var(--surface-strong) !important;
  border-left-color: var(--border) !important;
  box-shadow: -8px 0 40px rgba(0,0,0,0.5) !important;
}
html[data-theme="dark"] .tt-page-icon { color: var(--notion-text); }
html[data-theme="dark"] .tt-eyebrow  { color: var(--notion-muted); }
html[data-theme="dark"] .tt-title    { color: var(--notion-text); }
html[data-theme="dark"] .tt-elapsed  { color: var(--notion-text); }
html[data-theme="dark"] .tt-statsbar { color: var(--notion-muted); }
html[data-theme="dark"] .tt-panel__close:hover  { background: var(--notion-hover); }
html[data-theme="dark"] .tt-icon-btn:hover      { background: var(--notion-hover); }
html[data-theme="dark"] .tt-live {
  background: var(--surface-soft);
  border-color: var(--border);
}
html[data-theme="dark"] .tt-since  { color: var(--notion-muted); }
html[data-theme="dark"] .tt-totals { color: var(--notion-muted); }
html[data-theme="dark"] .tt-btn {
  color: var(--notion-text);
  border-color: rgba(255,255,255,0.18);
}
html[data-theme="dark"] .tt-btn:hover {
  background: var(--notion-hover);
  border-color: rgba(255,255,255,0.35);
}
html[data-theme="dark"] .tt-export-menu {
  background: var(--surface-strong);
  border-color: var(--border);
}
html[data-theme="dark"] .tt-export-item {
  color: var(--notion-text);
}
html[data-theme="dark"] .tt-export-item:hover { background: var(--notion-hover); }
html[data-theme="dark"] .tt-day-header  { color: var(--notion-muted); }
html[data-theme="dark"] .tt-entry {
  background: var(--surface-soft);
  border-color: var(--border);
}
html[data-theme="dark"] .tt-entry__range { color: var(--notion-text); }
html[data-theme="dark"] .tt-entry__dur   { color: var(--notion-muted); }
html[data-theme="dark"] .tt-entry__btn {
  color: var(--notion-muted);
  border-color: var(--border);
}
html[data-theme="dark"] .tt-entry__btn:hover {
  background: var(--notion-hover);
  color: var(--notion-text);
}
html[data-theme="dark"] .tt-chip { background: rgba(255,255,255,0.08); color: var(--notion-muted); }
html[data-theme="dark"] .tt-chip--added { background: rgba(155,138,244,0.2); color: var(--accent); }
html[data-theme="dark"] .tt-empty { color: var(--notion-muted); }
html[data-theme="dark"] .tt-modal {
  background: var(--surface-strong);
  border-color: var(--border);
  color: var(--notion-text);
}
html[data-theme="dark"] .tt-modal h3   { color: var(--notion-text); }
html[data-theme="dark"] .tt-modal small { color: var(--notion-muted); }
html[data-theme="dark"] .tt-modal__row label { color: var(--notion-muted); }
html[data-theme="dark"] .tt-modal__row input {
  background: var(--surface-soft);
  color: var(--notion-text);
  border-color: var(--border);
}
html[data-theme="dark"] .tt-modal__row input:focus {
  border-color: var(--accent);
}

/* ── Section headers ── */
/* Generic rule (specificity 0,1,1) */
.section__header h2,
.section__header--hero h2 {
  font-family: 'Suit', system-ui, -apple-system, sans-serif;
  font-size: 1.75rem !important;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: #2f2f2f;
  margin: 0;
}
/* Section-specific rules in home/styles.css use [data-section] + class + element = 0,2,1
   so we must match that specificity here */
[data-section] .section__header--hero h2,
[data-module-panel] .section__header--hero h2 {
  font-family: 'Suit', system-ui, -apple-system, sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.section__eyebrow {
  font-family: 'Suit', system-ui, -apple-system, sans-serif;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(55,53,47,0.4);
  margin-bottom: 0.25rem;
}

/* Section header layout */
.section__header {
  padding-bottom: 1.25rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid rgba(55,53,47,0.08);
}

/* Section action bar */
.section__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ── Subtab pills ── */
.subtabs {
  display: flex;
  gap: 2px;
  align-items: center;
}
.subtab {
  font-family: 'Suit', system-ui, -apple-system, sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  height: 30px;
  padding: 0 10px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: rgba(55,53,47,0.55);
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}
.subtab:hover:not(.is-active) { background: rgba(55,53,47,0.06); color: #37352f; }
.subtab.is-active { background: rgba(55,53,47,0.08); color: #37352f; font-weight: 600; }

/* Vertical subtabs (constants panel) */
.subtabs--vertical { flex-direction: column; align-items: stretch; }
.subtabs--vertical .subtab { height: auto; padding: 6px 10px; text-align: left; }

/* ── Overview & edit cards ── */
.overview-card .value,
.overview-card__value,
.overview-card h4 {
  font-family: 'Suit', system-ui, -apple-system, sans-serif;
  letter-spacing: -0.02em;
}

.edit-card p,
.edit-card h3 {
  font-family: 'Suit', system-ui, -apple-system, sans-serif;
}
.edit-card h3 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* ── Project flow ── */
.flow__req-title {
  font-family: 'Suit', system-ui, -apple-system, sans-serif;
  letter-spacing: -0.01em;
  text-transform: none;
}

/* ── Buttons ── */
.primary-btn,
.ghost-btn {
  font-family: 'Suit', system-ui, -apple-system, sans-serif;
}

/* ── Modals ── */
.modal__header h3,
.wizard__header h3 {
  font-family: 'Suit', system-ui, -apple-system, sans-serif;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* ── Search / form inputs ── */
.search {
  font-family: 'Suit', system-ui, -apple-system, sans-serif;
}

/* ── p / small global reset for home/styles.css subhead rule ── */
/* home/styles.css: p, small, .section__eyebrow, ... { font-family: var(--font-subhead) } */
p, small {
  font-family: inherit;
}

/* ── THEME TOGGLE BUTTON ────────────────────────────────────── */
.theme-toggle {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border: none;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--notion-muted);
  transition: background 0.12s;
  padding: 0;
  flex-shrink: 0;
}

.theme-toggle:hover { background: var(--notion-hover); }

.theme-toggle img {
  width: 15px;
  height: 15px;
  opacity: 0.55;
}

.theme-toggle:hover img { opacity: 0.85; }

/* ── DARK MODE OVERRIDES ────────────────────────────────────── */

/* Invert SVG icon images in dark mode */
html[data-theme="dark"] img[src$=".svg"] {
  filter: invert(1) brightness(0.88);
}

/* Re-invert elements that should stay coloured */
html[data-theme="dark"] .sidebar__user-avatar,
html[data-theme="dark"] .icon-rail__avatar {
  filter: none;
  background: #3d3473;
  color: #e6e3de;
}

/* Body & chrome */
html[data-theme="dark"] body {
  background: var(--notion-bg) !important;
  color: var(--notion-text) !important;
}

/* Modals */
html[data-theme="dark"] .modal__panel,
html[data-theme="dark"] .modal {
  background: var(--surface-strong);
  color: var(--notion-text);
  border-color: var(--border);
}

html[data-theme="dark"] .modal__panel {
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6) !important;
}

html[data-theme="dark"] .modal__header {
  border-color: var(--border);
}

/* Form inputs */
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
  background: var(--surface-soft) !important;
  color: var(--notion-text) !important;
  border-color: var(--border) !important;
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
  color: var(--notion-muted);
}

/* Tables */
html[data-theme="dark"] .table-shell,
html[data-theme="dark"] table {
  color: var(--notion-text);
}

html[data-theme="dark"] .table-shell th,
html[data-theme="dark"] thead th {
  background: var(--surface-soft);
  color: var(--notion-muted);
  border-color: var(--border);
}

html[data-theme="dark"] .table-shell td,
html[data-theme="dark"] tbody td {
  border-color: var(--border);
  color: var(--notion-text);
}

html[data-theme="dark"] tbody tr:hover td {
  background: var(--notion-hover);
}

/* Cards and surfaces */
html[data-theme="dark"] .edit-card,
html[data-theme="dark"] .edit-card__item,
html[data-theme="dark"] .tracking-item,
html[data-theme="dark"] .invoice-panel,
html[data-theme="dark"] .subtab-panel {
  background: var(--surface-strong);
  border-color: var(--border);
}

/* Primary button */
html[data-theme="dark"] .primary-btn {
  background: #e6e3de !important;
  color: #191919 !important;
}

html[data-theme="dark"] .primary-btn:hover {
  background: #ffffff !important;
}

html[data-theme="dark"] .primary-btn.is-accent {
  background: var(--accent) !important;
  color: #1c1c1c !important;
}

/* Ghost button */
html[data-theme="dark"] .ghost-btn {
  color: var(--notion-text) !important;
  border-color: var(--border) !important;
}

html[data-theme="dark"] .ghost-btn:hover {
  background: var(--notion-hover) !important;
}

/* Search input */
html[data-theme="dark"] .search {
  background: var(--surface-soft) !important;
  color: var(--notion-text) !important;
  border-color: var(--border) !important;
}

/* Scrollbars */
html[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
}

/* Vision panel */
html[data-theme="dark"] .vision-panel {
  background: var(--surface-strong) !important;
  border-right-color: var(--border) !important;
  box-shadow: 8px 0 40px rgba(0, 0, 0, 0.5) !important;
}

html[data-theme="dark"] .vision-panel__page-icon {
  color: var(--notion-text);
}

html[data-theme="dark"] .vision-panel__eyebrow {
  color: var(--notion-muted);
}

html[data-theme="dark"] .vision-panel__title {
  color: var(--notion-text) !important;
}

html[data-theme="dark"] .vision-panel__title::placeholder {
  color: rgba(230, 227, 222, 0.25);
}

html[data-theme="dark"] .vision-panel__editor {
  color: var(--notion-text);
}

html[data-theme="dark"] .vision-panel__editor:empty::before {
  color: rgba(230, 227, 222, 0.3);
}

html[data-theme="dark"] .vision-panel__close:hover {
  background: var(--notion-hover);
}

/* ── TEXT COLOR — ensure content text is light in dark mode ── */
html[data-theme="dark"] .app,
html[data-theme="dark"] .docs-editor-wrap,
html[data-theme="dark"] .docs-body,
html[data-theme="dark"] .module-panel__body {
  color: var(--notion-text);
}

html[data-theme="dark"] .app h1,
html[data-theme="dark"] .app h2,
html[data-theme="dark"] .app h3,
html[data-theme="dark"] .app h4,
html[data-theme="dark"] .app h5,
html[data-theme="dark"] .app h6,
html[data-theme="dark"] .app p,
html[data-theme="dark"] .app td,
html[data-theme="dark"] .app label,
html[data-theme="dark"] .app .edit-card p,
html[data-theme="dark"] .app .edit-card__meta,
html[data-theme="dark"] .app .overview-card__stat span,
html[data-theme="dark"] .app .overview-card__stat strong,
html[data-theme="dark"] .docs-editor-wrap *,
html[data-theme="dark"] .docs-body * {
  color: var(--notion-text);
}

/* Keep muted elements muted */
html[data-theme="dark"] .app .section__eyebrow,
html[data-theme="dark"] .app .overview-card h4,
html[data-theme="dark"] .app .overview-card__header h4,
html[data-theme="dark"] .app .overview-card__subtext {
  color: var(--notion-muted) !important;
}

/* ── CALENDAR LIGHT MODE FIXES ───────────────────────────────
   time.css uses hardcoded dark rgba values for borders/hovers.
   Override them to work on the light panel background.       */
html:not([data-theme="dark"]) #ops-time-root .table-wrapper {
  background: var(--surface-soft);
  border: 1px solid var(--border);
}

html:not([data-theme="dark"]) #ops-time-root .data-table thead th {
  background: var(--surface-strong);
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}

html:not([data-theme="dark"]) #ops-time-root .data-table th,
html:not([data-theme="dark"]) #ops-time-root .data-table td {
  border-bottom: 1px solid var(--border);
}

html:not([data-theme="dark"]) #ops-time-root .data-table tr:hover td {
  background: rgba(55, 53, 47, 0.04);
}

html:not([data-theme="dark"]) #ops-time-root .table-input:focus {
  border-color: rgba(55, 53, 47, 0.25);
  background: rgba(55, 53, 47, 0.04);
}

html:not([data-theme="dark"]) #ops-time-root .event-tooltip {
  border: 1px solid var(--border);
}

html:not([data-theme="dark"]) #ops-time-root .sidebar::-webkit-scrollbar-thumb {
  background: rgba(55, 53, 47, 0.2);
}

/* Calendar icon-img elements have filter:none hardcoded — restore inversion in dark mode */
html[data-theme="dark"] #ops-time-root .icon-img {
  filter: invert(1) brightness(0.88) !important;
}

/* Filter + icon buttons: visible border and consistent bg in dark mode */
html[data-theme="dark"] #ops-time-root .filter-toggle-btn,
html[data-theme="dark"] #ops-time-root .btn.is-icon,
html[data-theme="dark"] #ops-time-root button.is-icon,
html[data-theme="dark"] #ops-time-root .version-trigger {
  background: var(--surface-strong) !important;
  border-color: rgba(255, 255, 255, 0.55) !important;
}

html[data-theme="dark"] #ops-time-root .filter-toggle-btn.is-active {
  background: rgba(255, 255, 255, 0.1) !important;
  border-color: rgba(255, 255, 255, 0.75) !important;
}

html[data-theme="dark"] #ops-time-root .btn:hover,
html[data-theme="dark"] #ops-time-root button:hover,
html[data-theme="dark"] #ops-time-root .version-trigger:hover {
  background: rgba(255, 255, 255, 0.08) !important;
}

html[data-theme="dark"] #ops-time-root .view-toggle {
  background: rgba(255, 255, 255, 0.06) !important;
}

/* ── CALENDAR DARK MODE FIXES ────────────────────────────────
   Override hardcoded #ffffff / #fbfbfa values in time.css.   */
html[data-theme="dark"] #ops-time-root .data-table thead th {
  background: var(--surface-soft);
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}

html[data-theme="dark"] #ops-time-root .data-table th,
html[data-theme="dark"] #ops-time-root .data-table td {
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

html[data-theme="dark"] #ops-time-root .data-table tr:hover td {
  background: rgba(255, 255, 255, 0.04);
}

html[data-theme="dark"] #ops-time-root .table-input:focus,
html[data-theme="dark"] #ops-time-root .input:focus,
html[data-theme="dark"] #ops-time-root select:focus,
html[data-theme="dark"] #ops-time-root input:not([type="checkbox"]):not([type="radio"]):focus {
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.06);
  background: var(--surface-strong) !important;
}

html[data-theme="dark"] #ops-time-root .modal,
html[data-theme="dark"] #ops-time-root .event-editor__panel {
  background: var(--surface-strong) !important;
  background-image: none !important;
  color: var(--text);
}

html[data-theme="dark"] #ops-time-root .event-editor__panel .modal__header,
html[data-theme="dark"] #ops-time-root .event-editor__panel .modal__body,
html[data-theme="dark"] #ops-time-root .event-editor__panel .modal__footer {
  background: var(--surface-strong) !important;
  background-image: none !important;
}

html[data-theme="dark"] #ops-time-root .monthtag {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] #ops-time-root .day:hover {
  outline-color: rgba(255, 255, 255, 0.14);
}

html[data-theme="dark"] #ops-time-root .event .label,
html[data-theme="dark"] #ops-time-root .bar .label {
  background: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] #ops-time-root .event-editor__panel select:hover,
html[data-theme="dark"] #ops-time-root .event-editor__panel select:focus {
  background-color: var(--surface-strong) !important;
}

html[data-theme="dark"] #ops-time-root input.switch {
  background: rgba(255, 255, 255, 0.12) !important;
  border: 1px solid rgba(255, 255, 255, 0.55) !important;
}

html[data-theme="dark"] #ops-time-root input.switch:checked {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
}

html[data-theme="dark"] #ops-time-root input.switch::after {
  background: #ffffff !important;
}

html[data-theme="dark"] #ops-time-root input.switch:checked::after {
  background: #ffffff !important;
}

/* ── REMINDERS DARK MODE ─────────────────────────────────────── */
html[data-theme="dark"] .reminder-dock {
  background: var(--surface-strong) !important;
  border-color: var(--border) !important;
  color: var(--notion-text) !important;
}

html[data-theme="dark"] .reminder-modal__panel,
html[data-theme="dark"] .reminder-toast,
html[data-theme="dark"] .reminder-voice-popup,
html[data-theme="dark"] .reminder-item {
  background: var(--surface-strong) !important;
  border-color: var(--border) !important;
  color: var(--notion-text) !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5) !important;
}

html[data-theme="dark"] .reminder-modal__header {
  background: var(--surface-strong) !important;
  border-color: var(--border) !important;
}

html[data-theme="dark"] .reminder-modal__eyebrow,
html[data-theme="dark"] .reminder-toast__eyebrow,
html[data-theme="dark"] .reminder-toast__meta,
html[data-theme="dark"] .reminder-item__meta,
html[data-theme="dark"] .reminder-list-wrap__meta,
html[data-theme="dark"] .reminder-modal__subtitle,
html[data-theme="dark"] .reminder-voice-popup__eyebrow,
html[data-theme="dark"] .reminder-voice-popup__status,
html[data-theme="dark"] .reminder-status,
html[data-theme="dark"] .reminder-empty {
  color: var(--notion-muted) !important;
}

html[data-theme="dark"] .reminder-modal__title,
html[data-theme="dark"] .reminder-toast__title,
html[data-theme="dark"] .reminder-voice-popup__title,
html[data-theme="dark"] .reminder-item__title,
html[data-theme="dark"] .reminder-list-wrap__header {
  color: var(--notion-text) !important;
}

html[data-theme="dark"] .reminder-composer {
  background: var(--surface-soft) !important;
  border-color: var(--border) !important;
}

html[data-theme="dark"] .reminder-composer input,
html[data-theme="dark"] .reminder-composer select,
html[data-theme="dark"] .reminder-composer textarea {
  background: var(--surface-strong) !important;
  color: var(--notion-text) !important;
  border-color: var(--border) !important;
}

html[data-theme="dark"] .reminder-item__pill {
  background: rgba(255, 255, 255, 0.08) !important;
  color: var(--notion-muted) !important;
  border-color: var(--border) !important;
}

html[data-theme="dark"] .reminder-modal__backdrop {
  background: rgba(0, 0, 0, 0.55) !important;
}

html[data-theme="dark"] .reminder-voice-popup__preview {
  background: var(--surface-soft) !important;
  color: var(--notion-text) !important;
}

/* ── DOCS DARK MODE ──────────────────────────────────────────── */

/* Sidebar page cards */
html[data-theme="dark"] .docs-page-card__icon {
  color: var(--notion-muted);
}
html[data-theme="dark"] .docs-page-card__title,
html[data-theme="dark"] .docs-page-card {
  color: var(--notion-text);
}
html[data-theme="dark"] .docs-page-card:hover,
html[data-theme="dark"] .docs-page-card.is-active {
  background: var(--notion-hover);
}

/* Sidebar panel header / buttons */
html[data-theme="dark"] .docs-sidebar-panel__header,
html[data-theme="dark"] .docs-sidebar-panel__new {
  color: var(--notion-muted);
}
html[data-theme="dark"] .docs-sidebar-panel__new:hover {
  background: var(--notion-hover);
  color: var(--notion-text);
}
html[data-theme="dark"] .docs-sidebar-panel__search {
  background: rgba(255, 255, 255, 0.06);
  color: var(--notion-text);
}

/* Editor text & placeholder */
html[data-theme="dark"] .docs-editor__title,
html[data-theme="dark"] .doc-block__content,
html[data-theme="dark"] .docs-editor__eyebrow,
html[data-theme="dark"] .docs-editor__breadcrumb-path,
html[data-theme="dark"] .docs-editor__back-btn {
  color: var(--notion-text);
}
html[data-theme="dark"] .docs-editor__icon:hover {
  background: var(--notion-hover);
}
html[data-theme="dark"] .docs-editor__action {
  background: var(--notion-hover);
  color: var(--notion-text);
}

/* Blockquote */
html[data-theme="dark"] .doc-block__content[data-block-type="quote"] {
  border-left-color: rgba(255, 255, 255, 0.25);
  color: var(--notion-muted);
}

/* Block handles */
html[data-theme="dark"] .doc-block__handle,
html[data-theme="dark"] .doc-props__handle {
  color: rgba(230, 227, 222, 0.35);
}
html[data-theme="dark"] .doc-block__handle:hover,
html[data-theme="dark"] .doc-props__handle:hover {
  background: var(--notion-hover);
  color: var(--notion-muted);
}

/* Page context menu */
html[data-theme="dark"] .page-context-menu {
  background: var(--surface-strong);
  border-color: var(--border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
html[data-theme="dark"] .page-context-menu__item {
  color: var(--notion-text);
}
html[data-theme="dark"] .page-context-menu__item:hover {
  background: var(--notion-hover);
}

/* Mask-based doc icons: flip 'black' icons to light in dark mode */
html[data-theme="dark"] .doc-page-icon-mask[data-icon-color="black"],
html[data-theme="dark"] .sidebar__child-icon[data-icon-color="black"],
html[data-theme="dark"] .doc-block__page-card-icon[data-icon-color="black"] {
  color: var(--notion-text) !important;
}

/* Page block card (sub-page inserted inline in doc) */
html[data-theme="dark"] .doc-block__page-card {
  background: var(--surface-strong);
  border-color: var(--border);
}
html[data-theme="dark"] .doc-block__page-card:hover {
  background: var(--notion-hover);
}
html[data-theme="dark"] .doc-block__page-card-title {
  color: var(--notion-text);
}
html[data-theme="dark"] .doc-block__page-card-icon {
  background-color: var(--notion-text);
}

/* Slash command menu */
html[data-theme="dark"] .docs-slash-menu {
  background: var(--surface-strong);
  border-color: var(--border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}
html[data-theme="dark"] .docs-slash-menu__item {
  color: var(--notion-text);
}
html[data-theme="dark"] .docs-slash-menu__item:hover {
  background: var(--notion-hover);
}
html[data-theme="dark"] .docs-slash-menu__item-icon {
  background-color: var(--notion-text);
}
html[data-theme="dark"] .docs-slash-menu__item-desc {
  color: var(--notion-muted);
}

/* Floating toolbar */
html[data-theme="dark"] .docs-float-toolbar {
  background: var(--surface-strong);
  border-color: var(--border);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}
html[data-theme="dark"] .docs-float-toolbar__btn {
  color: var(--notion-text);
}
html[data-theme="dark"] .docs-float-toolbar__btn:hover {
  background: var(--notion-hover);
}
html[data-theme="dark"] .docs-float-toolbar__sep {
  background: var(--border);
}

/* Back button */
html[data-theme="dark"] .docs-editor__back-btn:hover {
  background: var(--notion-hover);
}

/* Properties panel */
html[data-theme="dark"] .doc-props__row:hover {
  background: var(--notion-hover);
}
html[data-theme="dark"] .doc-props__name,
html[data-theme="dark"] .doc-props__value,
html[data-theme="dark"] .doc-props__add-btn {
  color: var(--notion-text);
}
html[data-theme="dark"] .doc-props__name:hover,
html[data-theme="dark"] .doc-props__value:hover,
html[data-theme="dark"] .doc-props__add-btn:hover {
  background: var(--notion-hover);
  color: var(--notion-text);
}
html[data-theme="dark"] .doc-props__val-empty {
  color: var(--notion-muted);
}
html[data-theme="dark"] .doc-props__val-tag {
  background: rgba(255, 255, 255, 0.08);
  color: var(--notion-text);
}
html[data-theme="dark"] .doc-props__val-checkbox {
  border-color: rgba(255, 255, 255, 0.3);
}
html[data-theme="dark"] .doc-props__val-checkbox.is-checked {
  background: var(--notion-text);
  border-color: var(--notion-text);
  color: var(--notion-bg);
}

/* Props popup */
html[data-theme="dark"] .doc-props-popup {
  background: var(--surface-strong);
  border-color: var(--border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}
html[data-theme="dark"] .doc-props-popup__search {
  background: var(--surface-soft);
  color: var(--notion-text);
  border-color: var(--border);
}
html[data-theme="dark"] .doc-props-popup__option,
html[data-theme="dark"] .doc-props-popup__type-btn,
html[data-theme="dark"] .doc-props-popup__label {
  color: var(--notion-text);
}
html[data-theme="dark"] .doc-props-popup__option:hover,
html[data-theme="dark"] .doc-props-popup__type-btn:hover {
  background: var(--notion-hover);
}
html[data-theme="dark"] .doc-props-popup__option--create {
  color: var(--notion-muted);
}

/* Icon picker */
html[data-theme="dark"] .icon-picker-popup {
  background: var(--surface-strong);
  border-color: var(--border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}
html[data-theme="dark"] .icon-picker-popup__item:hover {
  background: var(--notion-hover);
}
html[data-theme="dark"] .icon-picker-popup__color-swatch.is-active {
  border-color: var(--notion-text);
}

/* Docs form (login modal in docs) */
html[data-theme="dark"] .form-field label {
  color: var(--notion-muted);
}
html[data-theme="dark"] .form-field input {
  background: var(--surface-soft);
  color: var(--notion-text);
  border-color: var(--border);
}
html[data-theme="dark"] .form-field input:focus {
  border-color: rgba(255, 255, 255, 0.3);
}
html[data-theme="dark"] .ghost-btn {
  border-color: var(--border);
  color: var(--notion-muted);
}
html[data-theme="dark"] .ghost-btn:hover {
  background: var(--notion-hover);
  color: var(--notion-text);
}

/* ══════════════════════════════════════════════════════════════
   PROJECT FLOW — DARK MODE
   Covers: Flow tab, Edit tab, Tracking tab
   ══════════════════════════════════════════════════════════════ */

/* ── Flow: vertical line + dot ──────────────────────────────── */
html[data-theme="dark"] .flow-vline {
  background: linear-gradient(
    to bottom,
    rgba(255,255,255,0) 0%,
    rgba(255,255,255,0.35) 18%,
    rgba(255,255,255,0.35) 82%,
    rgba(255,255,255,0) 100%
  ) !important;
}
html[data-theme="dark"] .flow-vline::after {
  background: rgba(255,255,255,0.85) !important;
  box-shadow: 0 0 0 6px rgba(255,255,255,0.1) !important;
}
html[data-theme="dark"] .flow-connector {
  background: rgba(255,255,255,0.25) !important;
}

/* ── Flow: step list (left sidebar) ─────────────────────────── */
html[data-theme="dark"] .flow__step-list {
  border-top-color: rgba(255,255,255,0.1) !important;
}
html[data-theme="dark"] .flow__step-item {
  background: rgba(255,255,255,0.05) !important;
  border-color: rgba(255,255,255,0.1) !important;
}
html[data-theme="dark"] .flow__step-item:hover:not(:disabled) {
  border-color: rgba(255,255,255,0.35) !important;
}
html[data-theme="dark"] .flow__step-item.is-current {
  background: rgba(255,255,255,0.1) !important;
  border-color: rgba(255,255,255,0.6) !important;
}
html[data-theme="dark"] .flow__step-item.is-done {
  background: rgba(255,255,255,0.03) !important;
}
html[data-theme="dark"] .flow__step-status {
  border-color: rgba(255,255,255,0.18) !important;
}
html[data-theme="dark"] .flow__step-status.current {
  border-color: rgba(255,255,255,0.7) !important;
}
html[data-theme="dark"] .flow__step-status.done {
  border-color: rgba(255,255,255,0.45) !important;
}
html[data-theme="dark"] .flow__step-status.seen {
  border-color: rgba(255,255,255,0.25) !important;
}
html[data-theme="dark"] .flow__step-status.locked {
  border-color: rgba(255,255,255,0.12) !important;
  color: rgba(255,255,255,0.3) !important;
}

/* ── Flow: pills ─────────────────────────────────────────────── */
html[data-theme="dark"] .flow__pill {
  background: var(--surface-strong) !important;
}
html[data-theme="dark"] .flow__pill-nav,
html[data-theme="dark"] .flow__pill-check {
  background: var(--surface-strong) !important;
  border-color: rgba(255,255,255,0.2) !important;
  color: var(--notion-text) !important;
}
html[data-theme="dark"] .flow__pill-nav img,
html[data-theme="dark"] .flow__pill-check img {
  filter: invert(1) brightness(0.88);
}
html[data-theme="dark"] .flow__pill-text {
  color: var(--notion-text) !important;
}

/* ── Flow: slider + nodes ────────────────────────────────────── */
html[data-theme="dark"] .flow__slider::before {
  background: rgba(255,255,255,0.12) !important;
}
html[data-theme="dark"] .flow__node-fill {
  background: rgba(255,255,255,0.75) !important;
}
html[data-theme="dark"] .flow__node {
  background: var(--surface-strong) !important;
  border-color: rgba(255,255,255,0.3) !important;
}
html[data-theme="dark"] .flow__node--current {
  background: rgba(255,255,255,0.85) !important;
  border-color: rgba(255,255,255,0.85) !important;
}
html[data-theme="dark"] .flow__node--nav:hover:not(:disabled) {
  border-color: rgba(255,255,255,0.8) !important;
}

/* ── Flow: project card text ─────────────────────────────────── */
html[data-theme="dark"] .flow__project {
  color: var(--notion-text) !important;
}
html[data-theme="dark"] .flow__title {
  color: var(--notion-text) !important;
}
html[data-theme="dark"] .flow__subtitle {
  color: var(--notion-muted) !important;
}
html[data-theme="dark"] .flow__step-label {
  color: var(--notion-muted) !important;
}
html[data-theme="dark"] .flow__step-label--cursor {
  color: rgba(230,227,222,0.4) !important;
}
html[data-theme="dark"] .flow-task-row {
  background: rgba(255,255,255,0.05) !important;
  border-color: rgba(255,255,255,0.1) !important;
}

/* ── Flow: requirements panel + cards ───────────────────────── */
html[data-theme="dark"] .flow-req-box,
html[data-theme="dark"] .flow-req-panel {
  background: var(--surface-strong) !important;
  border-color: var(--border) !important;
  box-shadow: 0 18px 38px rgba(0,0,0,0.45) !important;
}
html[data-theme="dark"] .flow-req-box .flow__req-card,
html[data-theme="dark"] .flow-req-panel .flow__req-card,
html[data-theme="dark"] .flow-req-box .flow__req-card.is-active,
html[data-theme="dark"] .flow-req-panel .flow__req-card.is-active {
  background: var(--surface-soft) !important;
  border-color: var(--border) !important;
}
html[data-theme="dark"] .flow__req-card {
  border-color: rgba(255,255,255,0.1) !important;
}
html[data-theme="dark"] .flow__req-pill {
  border-color: rgba(255,255,255,0.2) !important;
  color: var(--notion-muted) !important;
}
html[data-theme="dark"] .flow__req-pill.auto {
  background: rgba(255,255,255,0.1) !important;
  color: var(--notion-text) !important;
  border-color: transparent !important;
}
html[data-theme="dark"] .flow__req-inline input,
html[data-theme="dark"] .flow__req-inline select {
  background: var(--surface-soft) !important;
  color: var(--notion-text) !important;
  border-color: var(--border) !important;
}
html[data-theme="dark"] .flow__req-inline button {
  background: var(--surface-soft) !important;
  color: var(--notion-text) !important;
  border-color: var(--border) !important;
}

/* ── Project select dropdown ─────────────────────────────────── */
html[data-theme="dark"] .flow-project-select {
  background: var(--surface-strong) !important;
  border-color: var(--border) !important;
  color: var(--notion-text) !important;
}

/* ── Edit tab: bar chart ─────────────────────────────────────── */
html[data-theme="dark"] .edit-bar__fill {
  background: rgba(255,255,255,0.12) !important;
}
html[data-theme="dark"] .edit-bar__fill--neutral {
  background: rgba(255,255,255,0.12) !important;
}
html[data-theme="dark"] .edit-bar__fill.is-negative {
  background: rgba(255,80,80,0.25) !important;
}
html[data-theme="dark"] .edit-bar__value {
  color: var(--notion-text) !important;
}
html[data-theme="dark"] .edit-bar__label {
  color: var(--notion-muted) !important;
}

/* ── Edit tab: calendar swap select ──────────────────────────── */
html[data-theme="dark"] .edit-calendar-swap select {
  background: var(--surface-soft) !important;
  color: var(--notion-text) !important;
  border-color: var(--border) !important;
}

/* ── Edit tab: overview panel header ─────────────────────────── */
html[data-theme="dark"] .overview-panel__header {
  color: var(--notion-muted) !important;
}

/* ── Tracking tab: table rows ────────────────────────────────── */
html[data-theme="dark"] .line-item-row {
  background: var(--surface-strong) !important;
  border-color: rgba(255,255,255,0.07) !important;
}
html[data-theme="dark"] .line-item-row.is-done {
  background: rgba(199,243,60,0.06) !important;
  border-color: rgba(199,243,60,0.3) !important;
}
html[data-theme="dark"] .invoice-row {
  background: var(--surface-strong) !important;
  border-color: rgba(255,255,255,0.07) !important;
}
html[data-theme="dark"] .data-grid__row {
  background: var(--surface-strong) !important;
  border-color: rgba(255,255,255,0.07) !important;
}
html[data-theme="dark"] .line-item-status {
  background: var(--surface-strong) !important;
  border-color: var(--border) !important;
}
html[data-theme="dark"] .line-item-status img {
  filter: invert(1) brightness(0.88);
}
html[data-theme="dark"] .line-item-status.is-active img {
  filter: none;
}
html[data-theme="dark"] .line-item-remove:hover,
html[data-theme="dark"] .tracking-item__remove:hover {
  color: var(--notion-text) !important;
  border-color: rgba(255,255,255,0.55) !important;
}
html[data-theme="dark"] .tracking-item.is-done .tracking-item__title {
  color: var(--notion-text) !important;
}
html[data-theme="dark"] .line-item-cell input,
html[data-theme="dark"] .line-item-cell select {
  color: var(--notion-text) !important;
  border-color: rgba(255,255,255,0.12) !important;
}

/* ── Subtab panels (used inside flow section) ────────────────── */
html[data-theme="dark"] .subtab-panel {
  background: var(--surface-soft) !important;
  border-color: var(--border) !important;
}
