/* ============================================================================
   Clotho — Apple Human Interface Guidelines (macOS Sequoia / iOS 18) Design System
   (Pure Black #191919 & Pure White #FFFFFF Canvas + Pale-Gold Starry Backdrop)
   ============================================================================ */

:root {
  --bg: #ffffff;
  --sidebar-bg: rgba(245, 245, 247, 0.76);
  --surface: #ffffff;
  --surface-subtle: #f5f5f7;
  --surface-hover: rgba(0, 0, 0, 0.042);
  --surface-active: rgba(0, 0, 0, 0.075);
  --callout-bg: rgba(245, 245, 247, 0.85);
  --callout-yellow-bg: rgba(255, 149, 0, 0.09);
  --callout-yellow-border: rgba(255, 149, 0, 0.28);
  --callout-blue-bg: rgba(0, 122, 255, 0.075);
  --callout-blue-border: rgba(0, 122, 255, 0.24);

  --text: #1d1d1f;
  --text-strong: #111113;
  --text-muted: rgba(60, 60, 67, 0.66);
  --text-faint: rgba(60, 60, 67, 0.42);
  --border: rgba(60, 60, 67, 0.12);
  --border-secondary: rgba(60, 60, 67, 0.08);
  --border-strong: rgba(60, 60, 67, 0.22);
  --border-hover: rgba(60, 60, 67, 0.36);

  /* Apple HIG System Colors & Restrained Monochrome Primary */
  --sidebar-width: 252px;
  --btn-primary-bg: #1d1d1f;
  --btn-primary-hover: #333336;
  --btn-primary-text: #ffffff;
  --blue: #007aff;
  --blue-hover: #0066d6;
  --focus-ring: rgba(0, 122, 255, 0.24);

  --pill-red-bg: rgba(255, 59, 48, 0.11);
  --pill-red-border: rgba(255, 59, 48, 0.26);
  --pill-red-text: #d70015;
  --pill-amber-bg: rgba(255, 149, 0, 0.12);
  --pill-amber-border: rgba(255, 149, 0, 0.28);
  --pill-amber-text: #b25000;
  --pill-gray-bg: rgba(142, 142, 147, 0.12);
  --pill-gray-border: rgba(142, 142, 147, 0.24);
  --pill-gray-text: rgba(60, 60, 67, 0.72);
  --pill-green-bg: rgba(52, 199, 89, 0.12);
  --pill-green-border: rgba(52, 199, 89, 0.28);
  --pill-green-text: #248a3d;
  --pill-blue-bg: rgba(0, 122, 255, 0.1);
  --pill-blue-border: rgba(0, 122, 255, 0.24);
  --pill-blue-text: #0062cc;
  --pill-purple-bg: rgba(175, 82, 222, 0.11);
  --pill-purple-border: rgba(175, 82, 222, 0.25);
  --pill-purple-text: #8944ab;

  --danger: #ff3b30;
  --success: #34c759;
  --gold: #c9a452;
  --gold-ink: #ffffff;
  --gold-bg: rgba(212, 180, 104, 0.14);
  --gold-border: rgba(201, 164, 82, 0.5);
  --gold-glow: rgba(212, 180, 104, 0.36);

  /* Apple Liquid Glass Material (Flat Translucent — Zero Gradient, Dynamic Blur) */
  --glass-alpha: 0.58;
  --glass-alpha-strong: 0.76;
  --glass-blur-px: 9.5px;
  --glass-blur-strong-px: 13.5px;
  --glass-bg: rgba(255, 255, 255, var(--glass-alpha));
  --glass-bg-strong: rgba(255, 255, 255, var(--glass-alpha-strong));
  --glass-bg-subtle: rgba(255, 255, 255, 0.42);
  --glass-border: rgba(255, 255, 255, 0.78);
  --glass-blur: saturate(145%) blur(var(--glass-blur-px));
  --glass-shadow: 0 10px 32px rgba(15, 23, 42, 0.075), 0 1px 3px rgba(15, 23, 42, 0.05), 0 0 0 0.5px rgba(15, 23, 42, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.94), inset 0 -1px 0 rgba(255, 255, 255, 0.36);
  --glass-shadow-hover: 0 16px 42px rgba(15, 23, 42, 0.11), 0 2px 6px rgba(15, 23, 42, 0.06), 0 0 0 0.5px rgba(15, 23, 42, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.98), inset 0 -1px 0 rgba(255, 255, 255, 0.42);
  --glass-shadow-float: 0 22px 56px rgba(15, 23, 42, 0.14), 0 4px 14px rgba(15, 23, 42, 0.07), 0 0 0 0.5px rgba(15, 23, 42, 0.09), inset 0 1.5px 0 rgba(255, 255, 255, 0.96), inset 0 -1px 0 rgba(255, 255, 255, 0.36);

  --shadow-card: var(--glass-shadow);
  --shadow-card-hover: var(--glass-shadow-hover);
  --shadow-popover: var(--glass-shadow-float);
  --shadow-modal: var(--glass-shadow-float);
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 22px;
  --control-height: 34px;
  --control-height-sm: 28px;
  --control-height-lg: 42px;
}

[data-theme="dark"] {
  --bg: #191919;
  --sidebar-bg: rgba(30, 30, 30, 0.76);
  --surface: #222224;
  --surface-subtle: #2a2a2c;
  --surface-hover: rgba(255, 255, 255, 0.065);
  --surface-active: rgba(255, 255, 255, 0.11);
  --callout-bg: rgba(38, 38, 40, 0.82);
  --callout-yellow-bg: rgba(255, 159, 10, 0.13);
  --callout-yellow-border: rgba(255, 159, 10, 0.3);
  --callout-blue-bg: rgba(10, 132, 255, 0.13);
  --callout-blue-border: rgba(10, 132, 255, 0.3);

  --text: #f5f5f7;
  --text-strong: #ffffff;
  --text-muted: rgba(235, 235, 245, 0.62);
  --text-faint: rgba(235, 235, 245, 0.38);
  --border: rgba(255, 255, 255, 0.12);
  --border-secondary: rgba(255, 255, 255, 0.075);
  --border-strong: rgba(255, 255, 255, 0.22);
  --border-hover: rgba(255, 255, 255, 0.34);

  --btn-primary-bg: #f5f5f7;
  --btn-primary-hover: #ffffff;
  --btn-primary-text: #191919;
  --blue: #0a84ff;
  --blue-hover: #409cff;
  --focus-ring: rgba(10, 132, 255, 0.32);

  --pill-red-bg: rgba(255, 69, 58, 0.16);
  --pill-red-border: rgba(255, 69, 58, 0.34);
  --pill-red-text: #ff6961;
  --pill-amber-bg: rgba(255, 159, 10, 0.16);
  --pill-amber-border: rgba(255, 159, 10, 0.34);
  --pill-amber-text: #ffb340;
  --pill-gray-bg: rgba(142, 142, 147, 0.18);
  --pill-gray-border: rgba(255, 255, 255, 0.16);
  --pill-gray-text: rgba(235, 235, 245, 0.76);
  --pill-green-bg: rgba(48, 209, 88, 0.16);
  --pill-green-border: rgba(48, 209, 88, 0.32);
  --pill-green-text: #30d158;
  --pill-blue-bg: rgba(10, 132, 255, 0.16);
  --pill-blue-border: rgba(10, 132, 255, 0.34);
  --pill-blue-text: #64d2ff;
  --pill-purple-bg: rgba(191, 90, 242, 0.18);
  --pill-purple-border: rgba(191, 90, 242, 0.35);
  --pill-purple-text: #da8fff;

  --danger: #ff453a;
  --success: #30d158;
  --gold: #e2c574;
  --gold-ink: #191919;
  --gold-bg: rgba(226, 197, 116, 0.14);
  --gold-border: rgba(226, 197, 116, 0.45);
  --gold-glow: rgba(226, 197, 116, 0.34);

  --glass-bg: rgba(30, 30, 34, var(--glass-alpha));
  --glass-bg-strong: rgba(30, 30, 34, var(--glass-alpha-strong));
  --glass-bg-subtle: rgba(255, 255, 255, 0.065);
  --glass-border: rgba(255, 255, 255, 0.16);
  --glass-blur: saturate(145%) blur(var(--glass-blur-px));
  --glass-shadow: 0 12px 38px rgba(0, 0, 0, 0.46), 0 1px 3px rgba(0, 0, 0, 0.32), 0 0 0 0.5px rgba(255, 255, 255, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.22), inset 0 -1px 0 rgba(255, 255, 255, 0.05);
  --glass-shadow-hover: 0 18px 48px rgba(0, 0, 0, 0.56), 0 2px 6px rgba(0, 0, 0, 0.38), 0 0 0 0.5px rgba(255, 255, 255, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.28), inset 0 -1px 0 rgba(255, 255, 255, 0.07);
  --glass-shadow-float: 0 24px 64px rgba(0, 0, 0, 0.62), 0 4px 16px rgba(0, 0, 0, 0.42), 0 0 0 0.5px rgba(255, 255, 255, 0.12), inset 0 1.5px 0 rgba(255, 255, 255, 0.28), inset 0 -1px 0 rgba(255, 255, 255, 0.06);

  --shadow-card: var(--glass-shadow);
  --shadow-card-hover: var(--glass-shadow-hover);
  --shadow-popover: var(--glass-shadow-float);
  --shadow-modal: var(--glass-shadow-float);
}

body.sidebar-collapsed {
  --sidebar-width: 0px;
}

/* Smooth Theme Switch Transition */
html.theme-transitioning,
html.theme-transitioning *,
html.theme-transitioning *::before,
html.theme-transitioning *::after {
  transition: background-color 0.28s ease, color 0.28s ease, border-color 0.28s ease, fill 0.28s ease, stroke 0.28s ease, box-shadow 0.28s ease !important;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Helvetica Neue", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: -0.008em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
}
.hidden { display: none !important; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  word-break: break-word;
  background: var(--surface-hover);
  color: var(--pill-red-text);
  padding: 2px 5px;
  border-radius: 4px;
}

/* ---------- Interactive Starry Poster Canvas & Glass Surfaces ---------- */
.starfield-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  display: block;
}
.sidebar-starlight-hud {
  padding: 5px 10px 2px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- Login Screen (Minimalist Notion Gate) ---------- */
.login-screen {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: transparent;
}
.login-card {
  width: 100%;
  max-width: 360px;
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px 24px;
  box-shadow: var(--shadow-modal);
}
[data-theme="dark"] .login-card {
  background: rgba(25, 25, 25, 0.82);
}
.login-header {
  text-align: center;
  margin-bottom: 28px;
}
.login-logo {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  margin-bottom: 12px;
}
.login-header h1 {
  margin: 0 0 6px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-strong);
}
.login-header p {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}

/* ---------- App Shell ---------- */
.app-shell {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 100vh;
  background: transparent;
}

/* Floating Liquid Glass Left Navigation & Collapsed Top-Left Orb */
.liquid-nav-orb {
  position: fixed;
  top: 14px;
  left: 16px;
  z-index: 125;
  width: 44px;
  height: 44px;
  border-radius: 15px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-shadow-float);
  color: var(--text-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.36s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.26s ease, box-shadow 0.5s ease, background-color 0.5s ease;
}
.liquid-nav-orb:hover {
  transform: scale(1.06) translateY(-1px);
  box-shadow: var(--glass-shadow-hover);
}
.liquid-nav-orb:active {
  transform: scale(0.96);
}
.liquid-orb-glyph {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.orb-notif-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.8);
  z-index: 2;
}
[data-theme="dark"] .orb-notif-dot {
  box-shadow: 0 0 0 2px rgba(25, 25, 25, 0.85);
}

/* Desktop default: hide orb when floating sidebar is expanded */
body:not(.sidebar-collapsed) .liquid-nav-orb {
  opacity: 0;
  transform: scale(0.72);
  pointer-events: none;
}
body.sidebar-collapsed .liquid-nav-orb {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 110;
  background: rgba(15, 23, 42, 0.16);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}
[data-theme="dark"] .sidebar-backdrop {
  background: rgba(0, 0, 0, 0.38);
}

.left-nav-cluster {
  position: fixed;
  top: 14px;
  left: 16px;
  bottom: 14px;
  width: 248px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.sidebar {
  position: relative;
  flex: 1;
  min-height: 0;
  width: 248px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow-float);
  display: flex;
  flex-direction: column;
  padding: 12px 10px;
  user-select: none;
  overflow-y: auto;
  overflow-x: hidden;
  pointer-events: auto;
  transform-origin: 22px 22px;
  transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.26s ease, filter 0.3s ease, box-shadow 0.5s ease;
}
.sidebar > * {
  position: relative;
  z-index: 1;
}

/* Independent Liquid Glass Rounded-Square Action Icons (4 icons: Horizontal under expanded nav / Vertical under collapsed orb) */
.left-quick-dock {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 248px;
  flex-shrink: 0;
  pointer-events: auto;
  transition: transform 0.36s cubic-bezier(0.22, 1, 0.36, 1), margin-top 0.36s cubic-bezier(0.22, 1, 0.36, 1), width 0.32s ease;
}
.liquid-quick-btn {
  position: relative;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-shadow);
  color: var(--text-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.5s ease, box-shadow 0.5s ease, color 0.5s ease, border-color 0.5s ease, background-color 0.5s ease;
}
.liquid-quick-btn:hover {
  transform: translateY(-1.5px) scale(1.04);
  box-shadow: var(--glass-shadow-hover);
}
.liquid-quick-btn:active {
  transform: scale(0.95);
}
.liquid-quick-btn.active {
  color: var(--blue);
  border-color: var(--pill-blue-border);
  background: var(--pill-blue-bg);
}
.liquid-quick-btn-danger:hover {
  color: var(--danger);
  border-color: var(--pill-red-border);
}

/* Desktop Collapsed State: sidebar folds into orb, 3 quick icons stack vertically below orb */
body.sidebar-collapsed .left-nav-cluster {
  bottom: auto;
  width: 44px;
}
body.sidebar-collapsed .sidebar {
  position: absolute;
  top: 0;
  left: 0;
  width: 248px;
  height: calc(100vh - 86px);
  opacity: 0;
  transform: scale(0.18, 0.09) translateY(-10px);
  filter: blur(6px);
  pointer-events: none;
}
body.sidebar-collapsed .left-quick-dock {
  margin-top: 54px;
  width: 44px;
  flex-direction: column;
  gap: 10px;
}
body.sidebar-collapsed .liquid-quick-btn {
  flex: none;
  width: 44px;
  height: 44px;
}

.workspace-switcher {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}
.workspace-meta {
  flex: 1;
  min-width: 0;
}
#sidebar-collapse-btn {
  opacity: 0.7;
  flex-shrink: 0;
}
#sidebar-collapse-btn:hover {
  opacity: 1;
}
.workspace-avatar {
  width: 24px;
  height: 24px;
  border-radius: 5px;
  background: var(--text);
  color: var(--bg);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.workspace-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-strong);
  line-height: 1.2;
}
.workspace-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.sidebar-section-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-faint);
  padding: 10px 10px 4px;
  letter-spacing: 0.02em;
}

.sidebar-nav, .sidebar-secondary {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sidebar-nav {
  flex: 1;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 36px;
  padding: 0 12px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.5s ease, color 0.5s ease;
  text-align: left;
}
.nav-svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.72;
  transition: opacity 0.5s ease;
}
.nav-item:hover {
  background: var(--surface-hover);
  color: var(--text-strong);
}
.nav-item.active {
  background: var(--surface-active);
  color: var(--text-strong);
  font-weight: 600;
}
.nav-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--text-strong);
}
.nav-item.active .nav-svg {
  opacity: 1;
}
.nav-badge {
  margin-left: auto;
  background: var(--pill-blue-bg);
  color: var(--pill-blue-text);
  border: 1px solid var(--pill-blue-border);
  font-size: 11px;
  font-weight: 600;
  padding: 0 6px;
  line-height: 18px;
  border-radius: 10px;
  font-variant-numeric: tabular-nums;
}

.sidebar-footer {
  padding-top: 8px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.sidebar-status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 10px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  text-align: left;
  overflow: hidden;
}
.sidebar-status-row:hover {
  background: var(--surface-hover);
  color: var(--text);
}
.status-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.status-dot, .status-dot-inline {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-faint);
  flex-shrink: 0;
  display: inline-block;
}
.sidebar-status-row.ok .status-dot, .status-dot-inline.ok { background: var(--success); }
.sidebar-status-row.warn .status-dot, .status-dot-inline.warn { background: #d97706; }

.sidebar-bottom-bar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px 4px 0;
}
.ghost-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}
.ghost-icon-btn:hover {
  background: var(--surface-hover);
  color: var(--text);
}

/* ---------- Main Area & Modular Liquid Glass Topbar ---------- */
.main-area {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: transparent;
  padding-left: calc(var(--sidebar-width) + 28px);
  transition: padding-left 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}
body.sidebar-collapsed .main-area {
  padding-left: 72px;
}

.topbar {
  height: 44px;
  overflow: visible;
  margin: 14px 24px 0;
  padding: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  position: sticky;
  top: 14px;
  z-index: 80;
  background: transparent;
  border: none;
  box-shadow: none;
  pointer-events: none;
  transition: margin-left 0.36s cubic-bezier(0.22, 1, 0.36, 1);
}
body.sidebar-collapsed .topbar {
  margin-left: 8px;
}

.topbar-module {
  pointer-events: auto;
  height: 44px;
  border-radius: 15px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  color: var(--text-strong);
  display: inline-flex;
  align-items: center;
  font-family: inherit;
  transition: box-shadow 0.5s ease, transform 0.5s ease, border-color 0.5s ease, background-color 0.5s ease;
}
.topbar-breadcrumb-module {
  padding: 0 16px;
  gap: 7px;
  font-size: 13px;
  min-width: 0;
  flex-shrink: 1;
}
.topbar-modules-right {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
  flex-shrink: 0;
}
.topbar-icon-pill {
  width: 44px;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.topbar-jobs-module {
  padding: 0 14px;
  gap: 7px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}
.topbar-jobs-module:hover,
.topbar-icon-pill:hover,
.topbar-user-module:hover {
  box-shadow: var(--glass-shadow-hover);
  transform: translateY(-1px);
}
.topbar-jobs-module.jobs-active {
  border-color: var(--callout-blue-border);
  color: var(--blue);
}
.topbar-jobs-idle-icon {
  color: var(--text-muted);
  flex-shrink: 0;
}

/* Independent Flow-Expanding Model Switcher (Auto-Width, Pushes Jobs Pill Left on Expand) */
.model-switcher-module {
  position: relative;
  width: auto;
  min-width: 0;
  height: auto;
  min-height: 44px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  flex-shrink: 0;
  overflow: hidden;
  z-index: 95;
  outline: none;
  transition: min-width 0.34s cubic-bezier(0.22, 1, 0.36, 1), border-radius 0.3s ease, box-shadow 0.45s ease, background-color 0.35s ease;
}
.model-switcher-module.is-open {
  min-width: 272px;
  border-radius: 18px;
  background: var(--glass-bg-strong);
  box-shadow: var(--glass-shadow-float);
}
.model-switcher-trigger {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  border: none;
  background: transparent;
  color: var(--text-strong);
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}
.model-switcher-trigger #topbar-model-label {
  flex: 1;
  text-align: left;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
}
.model-switcher-chevron {
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.model-switcher-module.is-open .model-switcher-chevron {
  transform: rotate(180deg);
}
.model-switcher-dropdown {
  max-height: 0;
  opacity: 0;
  padding: 0 8px;
  overflow: hidden;
  transition: max-height 0.34s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.24s ease, padding 0.28s ease;
}
.model-switcher-module.is-open .model-switcher-dropdown {
  max-height: 360px;
  opacity: 1;
  padding: 6px 8px 8px;
  border-top: 1px solid var(--border-secondary);
  overflow-y: auto;
}
.ms-list-header {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-faint);
  padding: 2px 8px 6px;
}
.ms-items {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.ms-item {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: background-color 0.35s ease, border-color 0.35s ease;
}
.ms-item:hover {
  background: var(--surface-hover);
}
.ms-item.active {
  background: var(--pill-blue-bg);
  border-color: var(--pill-blue-border);
}
.ms-item-main {
  min-width: 0;
  flex: 1;
}
.ms-item-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-strong);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ms-item-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}
.ms-item-check {
  font-size: 13px;
  font-weight: 700;
  color: var(--blue);
  flex-shrink: 0;
}
.ms-empty {
  padding: 12px 8px;
  font-size: 12.5px;
  color: var(--text-muted);
  text-align: center;
}
.ms-footer-btn {
  margin-top: 6px;
  width: 100%;
  height: 32px;
  border-radius: 10px;
  border: 1px solid var(--border-secondary);
  background: var(--surface-subtle);
  color: var(--text-strong);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: background-color 0.35s ease;
}
.ms-footer-btn:hover {
  background: var(--surface-hover);
}

/* Independent Top-Right User Avatar & Username Liquid Glass Module */
.topbar-user-module {
  padding: 0 13px 0 8px;
  gap: 8px;
  cursor: pointer;
  max-width: 176px;
}
.topbar-user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--blue);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.16);
}
.avatar-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  line-height: 1;
  text-align: center;
}
.topbar-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-strong);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Auth Segmented Control, Theme Settings & User Profile Page */
.auth-mode-tabs {
  display: flex;
  width: 100%;
  margin-bottom: 16px;
}
.auth-mode-tabs .apple-seg-btn {
  flex: 1;
}

.theme-mode-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.theme-mode-card {
  border: 1.5px solid var(--border);
  border-radius: 14px;
  background: var(--surface-subtle);
  padding: 12px;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.4s ease, box-shadow 0.4s ease, transform 0.4s ease, background-color 0.4s ease;
}
.theme-mode-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-1px);
}
.theme-mode-card.active {
  border-color: var(--blue);
  background: var(--callout-blue-bg);
  box-shadow: 0 0 0 2px var(--focus-ring);
}
.theme-preview-swatch {
  height: 44px;
  border-radius: 10px;
  margin-bottom: 10px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
}
.swatch-light { background: linear-gradient(135deg, #ffffff, #f2f4f8); }
.swatch-dark { background: linear-gradient(135deg, #191919, #2b2b30); }
.swatch-system { background: linear-gradient(120deg, #ffffff 50%, #191919 50%); }
.swatch-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #e2c574;
  box-shadow: 0 0 8px rgba(226, 197, 116, 0.7);
}
.swatch-bar {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: rgba(128, 128, 140, 0.28);
}
.theme-mode-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-strong);
}
.theme-mode-desc {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 3px;
}

.glass-slider-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.glass-slider-end {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}
.glass-range-input {
  flex: 1;
  accent-color: var(--blue);
  height: 6px;
  cursor: pointer;
}

.profile-avatar-editor {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.profile-avatar-large {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 28px;
  font-weight: 700;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  border: 2px solid var(--glass-border);
}
.profile-avatar-controls {
  flex: 1;
  min-width: 200px;
}
.profile-swatch-row {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.color-swatch-btn {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.color-swatch-btn:hover { transform: scale(1.12); }
.color-swatch-btn.active {
  border-color: var(--surface);
  box-shadow: 0 0 0 2px var(--blue);
}
.emoji-swatch-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  cursor: pointer;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease, border-color 0.3s ease;
}
.emoji-swatch-btn:hover { transform: scale(1.08); }
.emoji-swatch-btn.active {
  border-color: var(--blue);
  background: var(--callout-blue-bg);
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  min-width: 0;
}
.breadcrumb-ws {
  color: var(--text-muted);
  font-weight: 500;
}
.breadcrumb-sep {
  color: var(--text-faint);
}
.breadcrumb-page {
  color: var(--text-strong);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 4px;
}
.topbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background-color 0.5s ease, color 0.5s ease, border-color 0.5s ease;
}
.topbar-btn:hover {
  background: var(--surface-hover);
  color: var(--text-strong);
}

/* Document Page Canvas (Ant Design 8px Grid × Notion Editorial Canvas) */
.view-container {
  max-width: 1024px;
  width: 100%;
  margin: 0 auto;
  padding: 28px 40px 80px;
}
.view-container.wide {
  max-width: 1180px;
}

/* Ant Design PageHeader × Notion Editorial Header */
.notion-page-header {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-secondary);
}
.notion-page-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}
.notion-page-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}
.notion-page-icon {
  font-size: 26px;
  line-height: 1;
}
.page-title {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.028em;
  color: var(--text-strong);
  line-height: 1.22;
}
.page-sub {
  margin: 6px 0 0;
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.57;
}

/* Ant Design Alert × Notion Callout */
.notion-callout {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--callout-bg);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
}
.notion-callout.yellow {
  background: var(--callout-yellow-bg);
  border-color: var(--callout-yellow-border);
}
.notion-callout.blue {
  background: var(--callout-blue-bg);
  border-color: var(--callout-blue-border);
}
.callout-icon {
  font-size: 16px;
  line-height: 1.55;
  flex-shrink: 0;
}
.callout-content {
  flex: 1;
  min-width: 0;
}

.section-block {
  margin-bottom: 24px;
}
.section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-secondary);
}
.section-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-strong);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Ant Design Card × Notion Restrained Surface */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.5s ease, border-color 0.5s ease;
}
.card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-secondary);
}
.card-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-strong);
  line-height: 1.4;
}

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.split-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 24px; align-items: start; }

/* ---------- Ant Design 5 × Notion Buttons, Tabs & Form Controls ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: var(--control-height);
  padding: 0 15px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.02);
  transition: background-color 0.5s ease, border-color 0.5s ease, color 0.5s ease, box-shadow 0.5s ease;
  white-space: nowrap;
}
.btn:hover:not(:disabled) {
  background: var(--surface-hover);
  border-color: var(--border-hover);
  color: var(--text-strong);
}
.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--focus-ring);
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
.btn-primary {
  background: var(--btn-primary-bg);
  border-color: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.06);
}
.btn-primary:hover:not(:disabled) {
  background: var(--btn-primary-hover);
  border-color: var(--btn-primary-hover);
  color: var(--btn-primary-text);
}
.modal-close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 0.5s ease, color 0.5s ease;
}
.modal-close-btn:hover {
  background: var(--surface-hover);
  color: var(--text-strong);
}
.btn-success {
  background: var(--success);
  border-color: var(--success);
  color: #ffffff;
}
.btn-success:hover:not(:disabled) { opacity: 0.9; color: #ffffff; }
.btn-ghost {
  border-color: transparent;
  background: transparent;
  color: var(--text-muted);
  box-shadow: none;
}
.btn-ghost:hover:not(:disabled) {
  border-color: transparent;
  background: var(--surface-hover);
  color: var(--text-strong);
}
.btn-danger {
  border-color: transparent;
  background: transparent;
  color: var(--danger);
  box-shadow: none;
}
.btn-danger:hover:not(:disabled) {
  border-color: var(--pill-red-border);
  background: var(--pill-red-bg);
  color: var(--danger);
}
.btn-sm { height: 28px; padding: 0 11px; font-size: 13px; }
.btn-block { width: 100%; height: var(--control-height-lg); font-size: 14px; }

/* Ant Design 5 Tabs × Notion Underline */
.notion-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  border-bottom: 1px solid var(--border-secondary);
  margin-bottom: 20px;
}
.notion-tab {
  padding: 10px 2px;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  margin-bottom: -1px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color 0.5s ease, border-color 0.5s ease;
}
.notion-tab:hover { color: var(--text-strong); }
.notion-tab.active {
  color: var(--text-strong);
  font-weight: 600;
  border-bottom-color: var(--text-strong);
}

.chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.5s ease, color 0.5s ease, border-color 0.5s ease, box-shadow 0.5s ease;
  white-space: nowrap;
}
.chip-btn:hover:not(:disabled) {
  background: var(--surface-hover);
  border-color: var(--border-strong);
  color: var(--text-strong);
}
.chip-btn.active {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  border-color: var(--btn-primary-bg);
  font-weight: 600;
}

/* Apple Segmented Control (macOS / iOS) */
.apple-segmented {
  display: inline-flex;
  align-items: center;
  padding: 2.5px;
  border-radius: 9px;
  background: rgba(118, 118, 128, 0.12);
  border: 0.5px solid var(--border-secondary);
  gap: 2px;
}
[data-theme="dark"] .apple-segmented {
  background: rgba(118, 118, 128, 0.24);
}
.apple-seg-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 500;
  height: 24px;
  padding: 0 12px;
  border-radius: 7px;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.5s ease, color 0.5s ease, box-shadow 0.5s ease;
}
.apple-seg-btn:hover:not(.active) {
  color: var(--text-strong);
}
.apple-seg-btn.active {
  background: var(--surface);
  color: var(--text-strong);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 0.5px 1px rgba(0, 0, 0, 0.06);
}
[data-theme="dark"] .apple-seg-btn.active {
  background: rgba(255, 255, 255, 0.16);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.field-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
}
.input, .select, .textarea {
  width: 100%;
  min-height: var(--control-height);
  padding: 5px 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5715;
  font-family: inherit;
  transition: border-color 0.5s ease, box-shadow 0.5s ease, background-color 0.5s ease;
}
.input, .select {
  height: var(--control-height);
}
.input:hover, .select:hover, .textarea:hover {
  border-color: var(--border-hover);
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  background: var(--surface);
  border-color: var(--text-strong);
  box-shadow: 0 0 0 2px var(--focus-ring);
}
.textarea { min-height: 84px; padding: 8px 11px; resize: vertical; line-height: 1.6; }
.form-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.form-row:has(> .form-group),
.form-row-fields {
  align-items: flex-end;
  gap: 12px;
}
.form-group { margin-bottom: 16px; flex: 1; min-width: 140px; }
.form-row > .form-group > .field-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.form-error { color: var(--danger); font-size: 13px; margin-top: 8px; }

/* ---------- Apple HIG Capsule Tag Pills ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 9px;
  height: 22px;
  border-radius: 999px;
  border: 0.5px solid transparent;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 20px;
  white-space: nowrap;
}
.badge-P0 { background: var(--pill-red-bg); border-color: var(--pill-red-border); color: var(--pill-red-text); }
.badge-P1 { background: var(--pill-amber-bg); border-color: var(--pill-amber-border); color: var(--pill-amber-text); }
.badge-P2 { background: var(--pill-gray-bg); border-color: var(--pill-gray-border); color: var(--pill-gray-text); }
.badge-done, .badge-approved { background: var(--pill-green-bg); border-color: var(--pill-green-border); color: var(--pill-green-text); }
.badge-draft { background: var(--pill-blue-bg); border-color: var(--pill-blue-border); color: var(--pill-blue-text); }
.badge-deferred { background: var(--pill-amber-bg); border-color: var(--pill-amber-border); color: var(--pill-amber-text); }
.badge-ai { background: var(--pill-purple-bg); border-color: var(--pill-purple-border); color: var(--pill-purple-text); }

/* ---------- Notion Database Table / List View (Tasks) ---------- */
/* ---------- Apple Calendar-Inspired Schedule Timeline Mode ---------- */
.timeline-shell {
  padding: 14px 16px 10px;
}
.tl-allday-group {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-secondary);
}
.tl-section-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.tl-allday-list .task-item {
  border: 1px solid var(--border-secondary);
  border-radius: 10px;
  margin-bottom: 6px;
  background: var(--surface-subtle);
}
.tl-track {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tl-track.has-now-rail {
  padding-right: 124px;
}
.tl-item,
.tl-gap-row,
.tl-now-row {
  display: grid;
  grid-template-columns: 74px 24px minmax(0, 1fr);
  column-gap: 10px;
  align-items: stretch;
}
.tl-time-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding-top: 12px;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
}
.tl-start {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-strong);
}
.tl-end {
  font-size: 11.5px;
  color: var(--text-faint);
  margin-top: 2px;
}
.tl-dur {
  margin-top: 4px;
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--surface-hover);
  padding: 1px 6px;
  border-radius: 999px;
}
.tl-axis-col {
  position: relative;
  display: flex;
  justify-content: center;
}
.tl-axis-col::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  background: var(--border);
}
.tl-item:first-child .tl-axis-col::before {
  top: 18px;
}
.tl-item:last-child .tl-axis-col::before {
  bottom: calc(100% - 20px);
}
.tl-node {
  position: relative;
  z-index: 2;
  width: 16px;
  height: 16px;
  margin-top: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--border-strong);
  transition: transform 0.5s ease, color 0.5s ease, filter 0.5s ease;
}
.tl-node.status-in_progress,
.tl-item.is-now-slot .tl-node {
  color: var(--gold);
  filter: drop-shadow(0 0 6px var(--gold-glow));
}
.tl-node.status-done {
  color: var(--success);
}
.tl-node.status-deferred_done {
  color: var(--gold);
}
.tl-node.status-interrupted {
  color: #ff9500;
}
.tl-node.status-deferred {
  color: #d48806;
}
.tl-node.is-pulsing {
  transform: scale(1.12);
  filter: drop-shadow(0 0 8px var(--gold-glow));
}
.tl-card-col {
  padding: 4px 0 10px;
  min-width: 0;
}
.tl-card-col .task-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px 12px;
  background: var(--surface);
  box-shadow: var(--shadow-card);
}
.tl-item.is-now-slot .tl-card-col .task-item,
.tl-item.status-in_progress .tl-card-col .task-item,
.tl-item .task-item.is-in-progress {
  position: relative;
  background: var(--gold-bg);
  border-color: var(--gold-border);
  overflow: hidden;
}
.tl-item.is-now-slot .tl-card-col .task-item::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 3px;
  height: var(--now-pct, 0%);
  background: var(--gold);
  border-radius: 0 12px 2px 0;
  opacity: 0.85;
  pointer-events: none;
  transition: height 0.6s ease;
}
.tl-card-col .task-time-btn {
  display: none;
}

/* Live Pale-Gold Right-Edge Percentage Pointer */
.tl-now-floating {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 0;
  z-index: 8;
  pointer-events: none;
  opacity: 0;
  transition: top 0.6s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.25s ease;
}
.tl-now-floating.is-ready {
  opacity: 1;
}
.tl-now-axis-dot {
  position: absolute;
  left: calc(74px + 10px + 12px);
  top: 0;
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: translate(-50%, -50%);
  color: var(--gold);
  filter: drop-shadow(0 0 6px var(--gold-glow));
}
.tl-now-hairline {
  position: absolute;
  left: calc(74px + 10px + 12px);
  right: 118px;
  top: 0;
  height: 1.5px;
  transform: translateY(-50%);
  background: var(--gold-border);
}
.tl-now-right-tag {
  position: absolute;
  right: 0;
  top: 0;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
}
.tl-now-arrow {
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-right: 6px solid var(--gold);
  margin-right: -1px;
}
.tl-now-badge {
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--gold-ink);
  background: var(--gold);
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
  box-shadow: 0 2px 10px var(--gold-glow);
}

/* Free Gap / Lunch Break Row */
.tl-gap-row {
  align-items: center;
}
.tl-gap-time {
  padding-top: 0;
  font-size: 10.5px;
  color: var(--text-faint);
}
.tl-gap-dot {
  position: relative;
  z-index: 2;
  width: 10px;
  height: 10px;
  margin: 10px 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--text-faint);
}
.tl-gap-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 3px 0;
  padding: 5px 12px;
  border-radius: 9px;
  border: 1px dashed var(--border);
  font-size: 12px;
  color: var(--text-faint);
  transition: border-color 0.5s ease, background-color 0.5s ease, color 0.5s ease;
}
.tl-gap-card:hover {
  border-color: var(--border-strong);
  background: var(--surface-hover);
  color: var(--text-muted);
}
.tl-gap-btn {
  border: none;
  background: transparent;
  color: var(--blue);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  transition: background-color 0.5s ease;
}
.tl-gap-btn:hover {
  background: var(--pill-blue-bg);
}
.tl-add-row {
  margin-top: 10px;
  border-top: 1px dashed var(--border);
  border-bottom: none;
  border-radius: 10px;
  justify-content: center;
}

.db-table {
  border-top: 1px solid var(--border);
}
.task-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 11px 10px;
  border-bottom: 1px solid var(--border);
  border-radius: 6px;
  transition: background-color 0.5s ease, border-color 0.5s ease, box-shadow 0.5s ease;
}
.task-item:hover {
  background: var(--surface-hover);
}
.task-item.done .task-title {
  text-decoration: line-through;
  color: var(--text-faint);
}
.task-item.is-in-progress {
  background: var(--callout-blue-bg);
}
.task-item.is-interrupted {
  background: var(--callout-yellow-bg);
}
.badge-deferred_done {
  background: var(--pill-purple-bg);
  border-color: var(--pill-purple-border);
  color: var(--pill-purple-text);
}
.resched-del-panel {
  background: var(--pill-red-bg);
  border: 1px solid var(--pill-red-border);
  border-radius: 14px;
  padding: 12px 14px;
  margin-top: 10px;
  margin-bottom: 12px;
}
.task-status-select {
  appearance: none;
  -webkit-appearance: none;
  height: 28px;
  min-width: 84px;
  padding: 0 24px 0 10px;
  border-radius: 7px;
  border: 1.5px solid var(--border-strong);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  background-color: var(--surface);
  color: var(--text-strong);
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 12px) 11px, calc(100% - 8px) 11px;
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: background-color 0.5s ease, border-color 0.5s ease, color 0.5s ease, box-shadow 0.5s ease;
}
.task-status-select:hover {
  box-shadow: 0 0 0 2px var(--surface-active);
}
.task-status-select.status-todo {
  background-color: var(--surface-subtle);
  border-color: var(--border-strong);
  color: var(--text-strong);
}
.task-status-select.status-in_progress {
  background-color: rgba(35, 131, 226, 0.14);
  border-color: rgba(35, 131, 226, 0.55);
  color: var(--blue);
}
.task-status-select.status-interrupted {
  background-color: rgba(217, 119, 6, 0.15);
  border-color: rgba(217, 119, 6, 0.55);
  color: #b45309;
}
[data-theme="dark"] .task-status-select.status-interrupted {
  color: #fbbf24;
}
.task-status-select.status-deferred {
  background-color: rgba(203, 145, 47, 0.14);
  border-color: rgba(203, 145, 47, 0.52);
  color: var(--pill-yellow-text, #9a6700);
}
[data-theme="dark"] .task-status-select.status-deferred {
  color: #f0b849;
}
.task-status-select.status-deferred_done {
  background-color: rgba(180, 145, 58, 0.18);
  border-color: rgba(180, 145, 58, 0.58);
  color: #8c6a1f;
}
[data-theme="dark"] .task-status-select.status-deferred_done {
  color: #e6cd95;
}
.task-status-select.status-done {
  background-color: rgba(46, 170, 127, 0.15);
  border-color: rgba(46, 170, 127, 0.55);
  color: #1f8a65;
}
[data-theme="dark"] .task-status-select.status-done {
  color: #4ade80;
}
.badge-deferred_done {
  background: rgba(180, 145, 58, 0.15);
  color: #8c6a1f;
}
[data-theme="dark"] .badge-deferred_done {
  color: #e6cd95;
}
.badge-interrupted {
  background: rgba(217, 119, 6, 0.14);
  color: #b45309;
}
[data-theme="dark"] .badge-interrupted {
  color: #fbbf24;
}
.badge-in_progress {
  background: var(--callout-blue-bg);
  color: var(--blue);
}
.task-check {
  width: 16px;
  height: 16px;
  accent-color: var(--blue);
  cursor: pointer;
  flex-shrink: 0;
  margin: 0;
}
.task-time {
  min-width: 96px;
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--text-muted);
  flex-shrink: 0;
}
.task-time-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 28px;
  padding: 0 7px;
  margin-left: -4px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: background-color 0.5s ease, border-color 0.5s ease, color 0.5s ease;
}
.task-time-btn:hover {
  background: var(--surface-active);
  border-color: var(--border);
  color: var(--text-strong);
}
.task-time-btn .time-edit-hint {
  opacity: 0;
  font-size: 11px;
  transition: opacity 0.5s ease;
}
.task-time-btn:hover .time-edit-hint {
  opacity: 0.75;
}
.resched-edit-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.resched-draggable {
  cursor: grab;
  transition: border-color 0.14s ease, transform 0.14s ease, opacity 0.14s ease, background 0.14s ease;
}
.resched-draggable:active { cursor: grabbing; }
.resched-draggable.is-dragging {
  opacity: 0.48;
  border-style: dashed;
}
.resched-draggable.is-drag-over {
  border-color: var(--blue);
  box-shadow: 0 -2px 0 0 var(--blue);
}
.drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-faint);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -1px;
  cursor: grab;
  user-select: none;
  padding: 0 2px;
}
.resched-move-btns {
  display: inline-flex;
  gap: 2px;
}
.mini-move-btn {
  width: 22px;
  height: 22px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.mini-move-btn:hover:not(:disabled) {
  background: var(--surface-hover);
  color: var(--text-strong);
  border-color: var(--border-strong);
}
.mini-move-btn:disabled {
  opacity: 0.32;
  cursor: not-allowed;
}
.resched-time-controls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.resched-time-slot {
  width: 96px;
}
.task-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
  padding-top: 3px;
  cursor: pointer;
}
.task-head-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.task-body:hover .task-title {
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 3px;
}
.task-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-strong);
  word-break: break-word;
}
.task-clamp-box {
  width: 100%;
  min-width: 0;
}
.clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
  white-space: pre-wrap;
}
.clamp-3.is-expanded {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
}
.btn-toggle-clamp {
  display: inline-flex;
  align-items: center;
  margin-top: 3px;
  padding: 1px 6px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.5s ease, color 0.5s ease;
}
.btn-toggle-clamp:hover {
  background: var(--surface-active);
  color: var(--text-strong);
}
.task-desc-inline {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-muted);
}
.task-progress-note {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 2px;
  padding: 6px 10px;
  border-radius: 10px;
  background: var(--surface-hover);
  border: 1px solid var(--border-secondary);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-normal);
  cursor: default;
  transition: background-color 0.5s ease;
}
.task-progress-note:hover {
  background: var(--surface-active);
}
.task-progress-note-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.task-progress-note-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  flex-shrink: 0;
}
.task-progress-edit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background-color 0.5s ease, color 0.5s ease;
}
.task-progress-edit-btn:hover {
  background: var(--surface-hover);
  color: var(--text-strong);
}
.task-progress-note-text {
  word-break: break-word;
  white-space: pre-wrap;
}
.btn-backfill-progress {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px dashed var(--border-strong);
  background: transparent;
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.5s ease, border-color 0.5s ease, color 0.5s ease;
}
.btn-backfill-progress:hover {
  border-style: solid;
  border-color: var(--text-strong);
  color: var(--text-strong);
  background: var(--surface-hover);
}
.resched-applied-wrap {
  margin-top: 8px;
}
.resched-applied-toggle {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  border: 1px dashed var(--border-strong);
  border-radius: 8px;
  background: var(--surface-subtle);
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background-color 0.5s ease, border-color 0.5s ease, color 0.5s ease;
}
.resched-applied-toggle:hover {
  background: var(--surface-hover);
  border-color: var(--text-muted);
  color: var(--text-strong);
}
.resched-applied-list {
  margin-top: 8px;
}
.resched-progress-wrap {
  flex-basis: 100%;
  margin-top: 6px;
}
.resched-progress-input {
  width: 100%;
  padding: 5px 9px;
  font-size: 12.5px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-strong);
}
.resched-progress-input:focus {
  outline: none;
  border-color: var(--border-strong);
}
.task-props {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}
.task-actions {
  display: flex;
  align-items: center;
  gap: 3px;
  opacity: 0.48;
  transition: opacity 0.5s ease;
  flex-shrink: 0;
}
.task-item:hover .task-actions {
  opacity: 1;
}
.task-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background-color 0.5s ease, color 0.5s ease, border-color 0.5s ease;
}
.task-icon-btn:hover {
  background: var(--surface-active);
  color: var(--text-strong);
}
.task-icon-btn.is-active {
  color: var(--text-strong);
  background: var(--surface-hover);
  border-color: var(--border);
}
.task-icon-btn.is-highlight {
  color: #b45309;
  border-color: rgba(217, 119, 6, 0.4);
  background: rgba(217, 119, 6, 0.08);
}
[data-theme="dark"] .task-icon-btn.is-highlight {
  color: #e6cd95;
  border-color: rgba(230, 205, 149, 0.45);
  background: rgba(230, 205, 149, 0.1);
}
.task-icon-btn.danger {
  color: var(--text-muted);
}
.task-icon-btn.danger:hover {
  background: var(--pill-red-bg);
  color: var(--danger);
}

.db-add-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 8px;
  border: none;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text-faint);
  font-size: 13px;
  cursor: pointer;
  text-align: left;
  transition: background-color 0.5s ease, color 0.5s ease;
}
.db-add-row:hover {
  background: var(--surface-hover);
  color: var(--text-muted);
}

/* ---------- Ant Design Statistic KPI Cards & Progress ---------- */
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.5s ease, border-color 0.5s ease;
}
.kpi-card:hover {
  box-shadow: var(--shadow-card-hover);
  border-color: var(--border-strong);
}
.dash-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border-secondary);
  margin-bottom: 20px;
}
.dash-period-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-bottom: 8px;
  flex-wrap: wrap;
}
.dash-step-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  font-size: 16px;
  line-height: 1;
}
.dash-period-picker {
  min-width: 152px;
}
.dash-period-select {
  width: auto;
  min-height: 28px;
  min-width: 176px;
  height: 28px;
  padding: 0 10px;
  font-size: 13px;
}

/* ---------- Dashboard Waterfall Masonry & Trend Panel (Apple HIG) ---------- */
.dash-masonry {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
  margin-bottom: 24px;
}
.dash-masonry.is-single-col {
  grid-template-columns: 1fr;
  gap: 14px;
}
.dash-masonry-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
.dash-waterfall-card {
  margin-bottom: 0;
}
.dash-rs-mini-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.dash-mid-grid {
  align-items: start;
}
.dash-trend-card,
.dash-priority-card {
  display: flex;
  flex-direction: column;
}
.trend-legend {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.trend-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--text-muted);
}
.tl-swatch {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 3px;
}
.tl-swatch-done { background: var(--blue); }
.tl-swatch-total { background: var(--surface-active); border: 1px solid var(--border); }
.tl-swatch-rate {
  width: 12px;
  height: 2px;
  border-radius: 999px;
  background: var(--success);
}
.trend-chart-svg {
  margin-bottom: 12px;
}
.trend-bar-group rect {
  transition: opacity 0.5s ease;
}
.trend-bar-group:hover rect {
  opacity: 0.85;
}
.trend-kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}
.trend-kpi-pill {
  background: var(--surface-subtle);
  border: 0.5px solid var(--border-secondary);
  border-radius: 10px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.trend-kpi-label {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.trend-kpi-val {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-strong);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.trend-tone-green { color: var(--pill-green-text); }
.trend-tone-blue { color: var(--blue); }
.trend-tone-purple { color: var(--pill-purple-text); }
.trend-tone-amber { color: var(--pill-amber-text); }
.trend-tone-neutral { color: var(--text-strong); }

.status-mix-section {
  padding-top: 12px;
  border-top: 1px solid var(--border-secondary);
  margin-bottom: 12px;
}
.status-mix-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.status-mix-sub {
  font-size: 11.5px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}
.status-mix-bar {
  display: flex;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  gap: 2px;
  background: var(--surface-subtle);
  margin-bottom: 8px;
}
.status-mix-seg {
  display: block;
  height: 100%;
  border-radius: 999px;
  transition: width 0.5s ease;
}
.status-mix-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
}
.status-mix-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--text-muted);
}
.status-mix-chip i {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  display: inline-block;
}
.status-mix-chip strong {
  color: var(--text-strong);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.trend-breakdown-wrap {
  padding-top: 12px;
  border-top: 1px solid var(--border-secondary);
}
.trend-breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.trend-day-row {
  display: grid;
  grid-template-columns: minmax(82px, 128px) 1fr 42px 44px 40px;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  padding: 5px 8px;
  border-radius: 8px;
  background: var(--surface-subtle);
  border: 0.5px solid var(--border-secondary);
}
.trend-day-date {
  color: var(--text-strong);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.trend-day-date small {
  color: var(--text-faint);
  font-weight: 400;
  margin-left: 3px;
}
.trend-day-bar {
  height: 6px;
  border-radius: 999px;
  background: var(--surface-active);
  overflow: hidden;
}
.trend-day-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.5s ease;
}
.trend-fill-green { background: var(--success); }
.trend-fill-blue { background: var(--blue); }
.trend-fill-amber { background: var(--pill-amber-text); }
.trend-day-meta {
  text-align: right;
  font-size: 11.5px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.trend-day-count {
  text-align: right;
  font-size: 11.5px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.trend-day-pct {
  text-align: right;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.kpi-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.kpi-value {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-strong);
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
}
.kpi-sub {
  font-size: 12.5px;
  color: var(--text-faint);
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}
.progress-track {
  height: 6px;
  background: var(--surface-active);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 12px;
}
.progress-fill {
  height: 100%;
  background: var(--text-strong);
  border-radius: 999px;
  transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Drafts Workspace (Page Tree + Document + Comments) ---------- */
.draft-list-pane {
  border-right: 1px solid var(--border);
  padding-right: 16px;
}
.draft-card-item {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  margin-bottom: 4px;
  transition: background-color 0.5s ease, border-color 0.5s ease;
  border: 1px solid transparent;
}
.draft-card-item:hover {
  background: var(--surface-hover);
}
.draft-card-item.active {
  background: var(--surface-active);
  border-color: var(--border);
}

.diff-box {
  background: var(--callout-yellow-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 13px;
  margin-bottom: 16px;
  white-space: pre-wrap;
  line-height: 1.6;
}

/* Editorial Markdown Typography */
.md-body {
  font-size: 14.5px;
  line-height: 1.75;
  color: var(--text);
  overflow-wrap: anywhere;
  word-break: break-word;
}
.md-body h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 20px 0 8px;
  color: var(--text-strong);
}
.md-body h2 {
  font-size: 17px;
  font-weight: 600;
  margin: 18px 0 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
  color: var(--text-strong);
}
.md-body h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 14px 0 4px;
  color: var(--text-strong);
}
.md-body ul { padding-left: 20px; margin: 6px 0 10px; }
.md-body li { margin: 4px 0; }
.md-body p { margin: 6px 0; }
.md-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 14px 0 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}
.md-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  line-height: 1.57;
}
.md-table th,
.md-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border-secondary);
  border-right: 1px solid var(--border-secondary);
  word-break: break-word;
}
.md-table th:last-child,
.md-table td:last-child {
  border-right: none;
}
.md-table tr:last-child td {
  border-bottom: none;
}
.md-table th {
  background: var(--surface-subtle);
  font-weight: 600;
  color: var(--text-strong);
  white-space: nowrap;
}
.md-table tbody tr {
  transition: background-color 0.5s ease;
}
.md-table tbody tr:hover {
  background: var(--surface-hover);
}

/* Period Group Blocks for OKR Month/Week View */
.period-group {
  margin-bottom: 26px;
}
.period-group-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 0 8px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.period-group-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-strong);
  display: flex;
  align-items: center;
  gap: 8px;
}
.period-sub-weeks {
  margin-left: 16px;
  padding-left: 14px;
  border-left: 2px solid var(--border);
  margin-top: 10px;
}
.period-sub-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin: 10px 0 8px;
}

/* Ant Design List Item / Comment Card */
.comment-item {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-subtle);
  margin-bottom: 10px;
  font-size: 13.5px;
  transition: border-color 0.5s ease, background-color 0.5s ease;
}
.comment-item.resolved { opacity: 0.58; }

/* Provider Rows */
.provider-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  background: var(--surface);
  box-shadow: var(--shadow-card);
  transition: border-color 0.5s ease, box-shadow 0.5s ease;
}
.provider-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-card-hover);
}
.provider-card.is-default {
  background: var(--surface-subtle);
  border-color: var(--border-strong);
}

/* ---------- Ant Design 5 Modal & Notification Message ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 16px 16px calc(var(--sidebar-width) + 16px);
  transition: padding-left 0.22s ease;
  z-index: 1000;
}
.modal-dialog {
  width: 100%;
  max-width: 600px;
  max-height: 86vh;
  overflow-y: auto;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  box-shadow: var(--shadow-modal);
}
.modal-dialog.wide {
  max-width: 780px;
}

/* ---------- OKR Cards & Clean Notion Hierarchy ---------- */
.okr-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 14px;
  transition: border-color 0.5s ease, background-color 0.5s ease;
}
.okr-card:hover {
  border-color: var(--border-strong);
}
.okr-card.is-draft {
  background: var(--surface-subtle);
  border-style: dashed;
  border-color: var(--border-strong);
}
.mini-spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid var(--pill-blue-bg);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: clothoSpin 0.75s linear infinite;
  flex-shrink: 0;
}
@keyframes clothoSpin {
  to { transform: rotate(360deg); }
}
.topbar-btn.jobs-active {
  background: var(--pill-blue-bg);
  color: var(--pill-blue-text);
  font-weight: 600;
}
.extract-progress-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 8px;
}
.okr-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.okr-o-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--text-strong);
  color: var(--bg);
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}
.okr-title-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.okr-title {
  font-size: 16px;
  font-weight: 650;
  color: var(--text-strong);
  line-height: 1.35;
}
.okr-meta-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}
.okr-progress-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.okr-pct-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  color: var(--text-strong);
  font-size: 12.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  cursor: default;
}
.okr-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 12px;
  padding: 3px 6px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}
.okr-toggle-btn:hover {
  background: var(--surface-hover);
  color: var(--text-strong);
}
.kr-list {
  margin-top: 8px;
  border-top: 1px solid var(--border);
}
.kr-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 6px;
  border-bottom: 1px solid var(--border);
  transition: background-color 0.5s ease;
}
.kr-row:last-child {
  border-bottom: none;
  padding-bottom: 2px;
}
.kr-row:hover {
  background: var(--surface-hover);
  border-radius: 5px;
}
.kr-row-main {
  flex: 1;
  min-width: 220px;
}
.kr-row-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-strong);
}
.kr-index {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-faint);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.kr-weight-tag {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 500;
}
.kr-row-meta {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.45;
}
.kr-progress-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  color: var(--text-strong);
  font-size: 12px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  cursor: default;
  white-space: nowrap;
}
.kr-mini-bar {
  width: 44px;
  height: 4px;
  border-radius: 999px;
  background: var(--surface-active);
  overflow: hidden;
}
.kr-mini-bar > span {
  display: block;
  height: 100%;
  background: var(--blue);
  border-radius: 999px;
}
.draft-composer-bar {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 18px;
}
.kr-editor-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 10px;
  background: var(--surface-subtle);
}
.kr-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

/* ---------- Silky Notion Date & Time Pickers ---------- */
.np-trigger-wrap {
  display: inline-flex;
  width: 100%;
}
.np-trigger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  height: var(--control-height);
  padding: 0 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-strong);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.5s ease, border-color 0.5s ease, box-shadow 0.5s ease;
  text-align: left;
  white-space: nowrap;
}
.np-trigger:hover {
  background: var(--surface);
  border-color: var(--border-hover);
}
.np-trigger:focus-visible {
  outline: none;
  border-color: var(--text-strong);
  box-shadow: 0 0 0 2px var(--focus-ring);
}
.np-trigger.np-compact {
  height: 28px;
  padding: 0 10px;
  font-size: 13px;
  background: var(--surface);
  border-color: var(--border-strong);
}
.np-icon {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.np-val {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}
.np-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-variant-numeric: tabular-nums;
}
.np-chev {
  width: 11px;
  height: 11px;
  color: var(--text-faint);
  flex-shrink: 0;
}

.np-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2500;
  background: transparent;
}
.np-popover {
  position: fixed;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-popover);
  padding: 12px;
  animation: npFadeIn 0.14s ease-out;
}
@keyframes npFadeIn {
  from { opacity: 0; transform: translateY(-4px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Time Picker Panel */
.np-time-panel {
  width: 276px;
}
.np-panel-top {
  margin-bottom: 10px;
}
.np-inline-edit {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}
.np-direct-input {
  width: 82px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
  color: var(--text-strong);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
}
.np-direct-input:focus {
  outline: none;
  background: var(--bg);
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(35, 131, 226, 0.22);
}
.np-nudge-group {
  display: flex;
  gap: 4px;
  margin-left: auto;
}
.np-mini-btn {
  height: 26px;
  padding: 0 7px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
}
.np-mini-btn:hover {
  background: var(--surface-hover);
  color: var(--text-strong);
}

.np-quick-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.np-quick-chip {
  height: 24px;
  padding: 0 8px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  color: var(--text-muted);
  font-size: 11.5px;
  cursor: pointer;
  transition: all 0.1s ease;
}
.np-quick-chip:hover {
  background: var(--surface-hover);
  color: var(--text-strong);
}
.np-quick-chip.active {
  background: var(--pill-blue-bg);
  color: var(--pill-blue-text);
  border-color: transparent;
  font-weight: 600;
}

.np-time-cols {
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  gap: 8px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 8px 0;
}
.np-col-divider {
  background: var(--border);
}
.np-col-head {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-faint);
  margin-bottom: 4px;
}
.np-col-scroll {
  height: 186px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 4px;
  scrollbar-width: thin;
}
.np-col-item {
  width: 100%;
  height: 30px;
  flex-shrink: 0;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13.5px;
  cursor: pointer;
  transition: background 0.1s ease;
}
.np-col-item:hover {
  background: var(--surface-hover);
}
.np-col-item.selected {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  font-weight: 600;
}
.np-panel-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}
.np-footer-hint {
  font-size: 11px;
  color: var(--text-faint);
}

/* Date Picker Panel */
.np-date-panel {
  width: 274px;
}
.np-cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.np-cal-month {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-strong);
}
.np-cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-faint);
  margin-bottom: 4px;
}
.np-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.np-cal-day {
  height: 32px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font-size: 12.5px;
  cursor: pointer;
  position: relative;
  transition: background 0.1s ease;
}
.np-cal-day:hover {
  background: var(--surface-hover);
}
.np-cal-day.outside {
  color: var(--text-faint);
}
.np-cal-day.is-today {
  font-weight: 600;
  color: var(--text-strong);
  border: 1px solid var(--text-strong);
}
.np-cal-day.is-today::after {
  content: "";
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-strong);
}
.np-cal-day.selected {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  font-weight: 600;
  border-color: var(--btn-primary-bg);
}
.np-cal-day.selected::after {
  background: var(--btn-primary-text);
}

/* Mobile Bottom Sheet for Pickers */
@media (max-width: 640px) {
  .np-backdrop {
    background: rgba(15, 15, 15, 0.42);
    display: flex;
    align-items: flex-end;
  }
  .np-popover.np-sheet {
    position: relative;
    width: 100%;
    border-radius: 16px 16px 0 0;
    padding: 16px 16px calc(18px + env(safe-area-inset-bottom));
    border-bottom: none;
  }
  .np-sheet .np-time-panel,
  .np-sheet .np-date-panel {
    width: 100%;
  }
  .np-sheet .np-cal-day {
    height: 38px;
    font-size: 14px;
  }
  .np-sheet .np-col-item {
    height: 36px;
    font-size: 15px;
  }
}
.toast-container {
  position: fixed;
  top: 20px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 2000;
}
.toast {
  padding: 10px 16px;
  border-radius: var(--radius);
  background: var(--glass-bg-strong);
  backdrop-filter: saturate(155%) blur(var(--glass-blur-strong-px));
  -webkit-backdrop-filter: saturate(155%) blur(var(--glass-blur-strong-px));
  color: var(--text-strong);
  border: 1px solid var(--glass-border);
  font-size: 13.5px;
  line-height: 1.55;
  box-shadow: var(--shadow-popover);
  max-width: 390px;
  word-break: break-word;
  user-select: text;
}
.toast.success {
  border-color: var(--pill-green-border);
}
.toast.error {
  color: var(--text);
  border-color: var(--pill-red-border);
  max-width: 440px;
  padding: 12px 16px;
}
.toast-error-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--danger);
  margin-bottom: 6px;
}
.toast-error-msg {
  font-size: 12.5px;
  color: var(--text);
  max-height: 180px;
  overflow-y: auto;
  white-space: pre-wrap;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 8px 10px;
  margin-bottom: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.toast-error-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.quick-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.empty-state {
  text-align: center;
  padding: 36px 16px;
  color: var(--text-faint);
  font-size: 13.5px;
}

/* ============================================================================
   Unified Apple Liquid Glass Surface Layer (All Content Modules)
   ============================================================================ */
.glass-panel,
.card,
.okr-card,
.kpi-card,
.draft-composer-bar,
.draft-list-pane,
.draft-doc-panel,
.review-detail-pane,
.db-table,
.timeline-shell,
.provider-card,
.notion-callout,
.dash-toolbar {
  position: relative;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--glass-shadow);
  transition: box-shadow 0.5s ease, border-color 0.5s ease, transform 0.5s ease, background-color 0.5s ease;
}
.glass-panel,
.draft-doc-panel,
.review-detail-pane {
  padding: 20px 22px;
}
.draft-list-pane {
  padding: 14px;
  border-right: 1px solid var(--glass-border);
}
.dash-toolbar {
  padding: 8px 14px;
  border-bottom: 1px solid var(--glass-border);
  margin-bottom: 18px;
}
.dash-toolbar .dash-period-controls {
  padding-bottom: 0;
}
.db-table,
.timeline-shell {
  padding: 8px 12px;
}
.card:hover,
.okr-card:hover,
.kpi-card:hover,
.provider-card:hover {
  box-shadow: var(--glass-shadow-hover);
}

/* Subtle flat tinted Callouts & Nested Callouts (No Gradient) */
.notion-callout.blue {
  background: rgba(0, 122, 255, 0.09);
  border-color: var(--callout-blue-border);
}
.notion-callout.yellow {
  background: rgba(255, 149, 0, 0.1);
  border-color: var(--callout-yellow-border);
}
[data-theme="dark"] .notion-callout.blue {
  background: rgba(10, 132, 255, 0.14);
}
[data-theme="dark"] .notion-callout.yellow {
  background: rgba(255, 159, 10, 0.14);
}
.card .notion-callout,
.glass-panel .notion-callout {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* Elevated Liquid Glass Overlays (Modals, Login, Pickers — Dynamic Blur) */
.modal-dialog,
.login-card,
.np-popover {
  background: var(--glass-bg-strong);
  backdrop-filter: saturate(155%) blur(var(--glass-blur-strong-px));
  -webkit-backdrop-filter: saturate(155%) blur(var(--glass-blur-strong-px));
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow-float);
}

.mobile-tabbar { display: none; }

/* ---------- Mobile & iPhone PWA / Native App (Liquid Glass) ---------- */
@media (max-width: 860px) {
  * { -webkit-tap-highlight-color: transparent; }
  html, body, .app-shell, .main-area {
    max-width: 100%;
    overflow-x: clip;
  }
  .input, .textarea, .select {
    font-size: 16px;
    padding: 9px 11px;
  }
  :root, body.sidebar-collapsed { --sidebar-width: 0px; }
  .main-area,
  body.sidebar-collapsed .main-area {
    padding-left: 0 !important;
  }

  /* Top-Left Liquid Glass Nav Orb (Always available on mobile) */
  .liquid-nav-orb,
  body:not(.sidebar-collapsed) .liquid-nav-orb,
  body.sidebar-collapsed .liquid-nav-orb {
    display: inline-flex !important;
    top: calc(10px + env(safe-area-inset-top));
    left: 12px;
    width: 40px;
    height: 40px;
    border-radius: 14px;
    opacity: 1 !important;
    transform: scale(1) !important;
    pointer-events: auto !important;
    z-index: 130;
  }
  body.mobile-nav-open .liquid-nav-orb {
    background: var(--glass-bg-strong);
    box-shadow: var(--glass-shadow-hover);
  }
  body.mobile-nav-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  /* Mobile Dropdown Liquid Glass Navigation Cluster (Nav + Horizontal Quick Icons below it) */
  .left-nav-cluster,
  body.sidebar-collapsed .left-nav-cluster {
    position: fixed;
    top: calc(58px + env(safe-area-inset-top));
    left: 12px;
    bottom: auto;
    width: min(286px, calc(100vw - 24px));
    max-height: calc(100dvh - 152px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 125;
    transform-origin: 20px -10px;
    opacity: 0;
    transform: scale(0.24, 0.12) translateY(-14px);
    filter: blur(6px);
    pointer-events: none;
    transition: transform 0.36s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.24s ease, filter 0.28s ease;
  }
  body.mobile-nav-open .left-nav-cluster {
    opacity: 1;
    transform: scale(1) translateY(0);
    filter: blur(0);
    pointer-events: auto;
  }
  .sidebar,
  body.sidebar-collapsed .sidebar {
    position: relative;
    top: auto;
    left: auto;
    bottom: auto;
    width: 100%;
    height: auto;
    flex: 1;
    min-height: 0;
    opacity: 1;
    transform: none;
    filter: none;
    pointer-events: auto;
    border-radius: 22px;
    padding: 12px 10px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .left-quick-dock,
  body.sidebar-collapsed .left-quick-dock {
    margin-top: 0;
    width: 100%;
    flex-direction: row;
    justify-content: space-between;
    gap: 10px;
    pointer-events: auto;
  }
  .liquid-quick-btn,
  body.sidebar-collapsed .liquid-quick-btn {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
  }

  /* Modular Floating Liquid Glass Topbar beside Top-Left Orb */
  .topbar,
  body.sidebar-collapsed .topbar {
    position: sticky;
    top: calc(10px + env(safe-area-inset-top));
    height: auto;
    min-height: 40px;
    margin: calc(10px + env(safe-area-inset-top)) 12px 0 58px !important;
    gap: 6px;
    padding: 0;
  }
  .topbar-module {
    height: 40px;
    border-radius: 14px;
  }
  .topbar-breadcrumb-module {
    display: none;
  }
  .topbar-modules-right {
    flex: 1;
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
  }
  .topbar-icon-pill {
    width: 38px;
  }
  .topbar-jobs-module {
    padding: 0 10px;
    font-size: 12px;
    gap: 5px;
  }
  .model-switcher-module {
    height: auto;
    min-height: 40px;
    max-width: 100%;
  }
  .model-switcher-trigger {
    height: 38px;
    padding: 0 10px;
    font-size: 12px;
    gap: 5px;
  }
  .model-switcher-module.is-open {
    min-width: min(260px, calc(100vw - 74px));
    max-width: calc(100vw - 24px);
  }
  .topbar-user-module {
    padding: 0 9px 0 6px;
    gap: 6px;
    max-width: 124px;
    flex-shrink: 0;
  }
  .topbar-user-avatar {
    width: 24px;
    height: 24px;
  }
  .topbar-user-name {
    font-size: 12px;
    max-width: 64px;
  }
  .theme-mode-grid {
    grid-template-columns: 1fr;
  }
  .glass-slider-row {
    flex-wrap: wrap;
    gap: 6px;
  }

  /* Main Canvas & Editorial Header */
  .view-container {
    padding: 14px 12px calc(102px + env(safe-area-inset-bottom));
  }
  .glass-panel,
  .draft-doc-panel,
  .review-detail-pane {
    padding: 15px 14px;
    border-radius: 16px;
  }
  .notion-page-header {
    margin-bottom: 16px;
    padding-bottom: 14px;
  }
  .notion-page-top {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .notion-page-title-wrap { gap: 8px; }
  .notion-page-icon { font-size: 24px; }
  .page-title {
    font-size: 22px;
    line-height: 1.28;
  }
  .page-sub {
    font-size: 13px;
    line-height: 1.55;
    margin-top: 6px;
    word-break: break-word;
  }
  .notion-page-top > .form-row {
    width: 100%;
    gap: 8px;
  }
  #date-picker-slot {
    flex: 1 1 132px !important;
    min-width: 132px !important;
  }

  /* Short text protection: Tabs, Buttons, Chips, Badges */
  .notion-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 2px;
    margin-bottom: 14px;
  }
  .notion-tabs::-webkit-scrollbar { display: none; }
  .notion-tab {
    padding: 8px 11px;
    font-size: 13.5px;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .btn {
    min-height: 34px;
    padding: 0 11px;
    font-size: 13px;
    white-space: nowrap;
  }
  .btn-sm {
    min-height: 30px;
    height: 30px;
    padding: 0 10px;
    font-size: 12.5px;
  }
  .chip-btn {
    height: auto;
    min-height: 30px;
    padding: 4px 10px;
    font-size: 12.5px;
    line-height: 1.35;
    white-space: normal;
    text-align: left;
  }
  .badge {
    max-width: 100%;
    font-size: 11.5px;
    line-height: 1.4;
    white-space: normal;
    word-break: break-word;
  }
  .badge-P0,
  .badge-P1,
  .badge-P2,
  .badge-done,
  .badge-approved,
  .badge-in_progress,
  .badge-interrupted,
  .badge-deferred_done,
  .badge-ai {
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* Callouts & Dynamic Reschedule Panel */
  .notion-callout {
    padding: 12px 13px;
    gap: 9px;
    margin-bottom: 14px;
  }
  .callout-icon {
    font-size: 16px;
    line-height: 1.4;
  }
  .callout-content {
    min-width: 0;
    overflow-wrap: anywhere;
  }
  .callout-content > div:first-child {
    flex-wrap: wrap !important;
    row-gap: 6px;
  }
  .quick-chips {
    gap: 6px;
    margin-bottom: 10px;
  }
  .resched-input-wrap {
    flex: 1 1 100% !important;
    min-width: 0 !important;
  }
  #resched-start-slot {
    flex: 1 1 112px !important;
    width: auto !important;
    min-width: 104px;
  }
  #btn-run-reschedule {
    flex: 1 1 132px;
  }

  /* Mobile Task Cards & Timeline */
  .db-table,
  .timeline-shell {
    border: none;
    box-shadow: none;
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    padding: 0;
  }
  .tl-track.has-now-rail {
    padding-right: 0;
  }
  .tl-now-axis-dot {
    left: calc(50px + 6px + 8px);
  }
  .tl-now-hairline {
    left: calc(50px + 6px + 8px);
    right: 6px;
  }
  .tl-now-right-tag {
    right: 4px;
    opacity: 0.94;
  }
  .tl-now-badge {
    font-size: 10px;
    padding: 1px 6px;
  }
  .tl-item,
  .tl-gap-row,
  .tl-now-row {
    grid-template-columns: 50px 16px minmax(0, 1fr);
    column-gap: 6px;
  }
  .tl-start { font-size: 12.5px; }
  .tl-end { font-size: 10.5px; }
  .tl-dur { display: none; }
  .tl-gap-time { font-size: 9.5px; }
  .tl-card-col .task-time-btn { display: inline-flex; }
  .task-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: 8px;
    row-gap: 8px;
    align-items: center;
    padding: 13px 13px 10px;
    margin-bottom: 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.86);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }
  [data-theme="dark"] .task-item {
    background: rgba(30, 30, 30, 0.84);
  }
  .task-item.is-in-progress {
    background: var(--callout-blue-bg);
  }
  .task-item.is-interrupted {
    border-color: rgba(217, 119, 6, 0.4);
  }
  .task-item > .task-status-select {
    grid-column: 1;
    grid-row: 1;
    height: 30px;
    min-width: 88px;
    font-size: 12.5px;
    padding: 0 24px 0 10px;
    background-position: calc(100% - 12px) 12px, calc(100% - 8px) 12px;
    white-space: nowrap;
  }
  .task-time,
  .task-time-btn {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    min-width: 0;
    width: fit-content;
    max-width: 100%;
    height: 28px;
    margin-left: 0;
    padding: 0 9px;
    font-size: 12px;
    white-space: nowrap;
    background: var(--surface-subtle);
    border: 1px solid var(--border);
    border-radius: 6px;
  }
  .task-time-btn .time-edit-hint {
    opacity: 0.65;
  }
  .task-body {
    grid-column: 1 / -1;
    grid-row: 2;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding-top: 0;
    width: 100%;
  }
  .task-title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.45;
    word-break: break-word;
  }
  .task-desc-inline {
    font-size: 13px;
    line-height: 1.55;
    color: var(--text-muted);
    word-break: break-word;
  }
  .task-props {
    margin-left: 0;
    gap: 6px;
    margin-top: 2px;
  }
  .task-icon-btn {
    width: 34px;
    height: 34px;
  }
  .task-progress-note {
    margin-top: 4px;
    padding: 7px 10px;
    font-size: 12.5px;
    line-height: 1.5;
  }
  .btn-backfill-progress {
    padding: 4px 10px;
    font-size: 12px;
    white-space: nowrap;
  }
  .task-actions {
    grid-column: 1 / -1;
    grid-row: 3;
    opacity: 1;
    margin-left: 0;
    width: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 4px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
  }
  .db-add-row {
    border: 1px dashed var(--border-strong);
    border-radius: 10px;
    justify-content: center;
    padding: 11px 12px;
    font-size: 13.5px;
    margin-top: 2px;
  }

  /* Grids, Cards, Sections */
  .card {
    padding: 14px;
    margin-bottom: 12px;
  }
  .card-header {
    align-items: flex-start;
    gap: 8px;
  }
  .card-title {
    flex: 1;
    min-width: 0;
    font-size: 15px;
    line-height: 1.4;
    word-break: break-word;
  }
  .section-block { margin-bottom: 22px; }
  .section-header { gap: 8px; }
  .grid-2, .grid-3, .split-layout {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .kpi-card { padding: 12px 13px; }
  .dash-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    border-bottom: none;
    margin-bottom: 14px;
  }
  .dash-toolbar .notion-tabs {
    border-bottom: 1px solid var(--border) !important;
  }
  .dash-period-controls {
    width: 100%;
    padding-bottom: 0;
  }
  .dash-period-picker,
  .dash-period-select {
    flex: 1 1 150px;
    min-width: 0;
    width: 100%;
    height: 34px;
  }
  .kpi-label {
    font-size: 11.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .kpi-value { font-size: 21px; }
  .trend-kpi-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .trend-day-row {
    grid-template-columns: minmax(78px, 112px) 1fr 38px 36px;
    gap: 6px;
  }
  .trend-day-meta { display: none; }
  .kpi-sub { font-size: 11.5px; line-height: 1.4; }

  /* Drafts & Reviews */
  .draft-composer-bar { padding: 12px 13px; }
  .draft-composer-bar .form-row > div {
    min-width: 0 !important;
    max-width: none !important;
    flex: 1 1 100% !important;
  }
  #btn-composer-generate { width: 100%; }
  #draft-ver-select {
    width: 100% !important;
    max-width: 100%;
    height: 36px !important;
    font-size: 13.5px !important;
  }
  .draft-list-pane {
    border: 1px solid var(--glass-border);
    padding: 12px;
    max-height: 220px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* OKR Cards & KR Rows */
  .okr-card { padding: 14px; }
  .okr-header {
    flex-direction: column;
    gap: 10px;
  }
  .okr-header > div {
    min-width: 0 !important;
    width: 100%;
  }
  .okr-title {
    font-size: 15px;
    line-height: 1.45;
    word-break: break-word;
  }
  .okr-meta-line {
    gap: 6px;
    line-height: 1.45;
  }
  .okr-progress-summary {
    width: 100%;
    justify-content: flex-start;
    gap: 6px;
  }
  .kr-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 11px 2px;
  }
  .kr-row-main {
    min-width: 0;
    width: 100%;
  }
  .kr-row-title {
    font-size: 14.5px;
    line-height: 1.45;
    gap: 6px;
  }
  .kr-row-meta {
    font-size: 12px;
    line-height: 1.5;
    word-break: break-word;
  }
  .kr-progress-pill { align-self: flex-start; }
  .period-sub-weeks {
    margin-left: 6px;
    padding-left: 10px;
  }

  /* Settings, Provider Cards, Comments, Reschedule Preview */
  .provider-card {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px;
  }
  .provider-card > div {
    min-width: 0;
    word-break: break-word;
  }
  .comment-item {
    padding: 10px 11px;
    line-height: 1.55;
    word-break: break-word;
  }
  .resched-edit-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .resched-edit-row > div:first-child {
    min-width: 0 !important;
    width: 100%;
  }
  .resched-time-controls {
    width: 100%;
    justify-content: flex-start;
  }
  .resched-time-slot {
    flex: 1;
    width: auto;
    min-width: 0;
  }

  /* Markdown & Tables: prevent 1-char vertical column crush */
  .md-body {
    font-size: 14px;
    line-height: 1.7;
  }
  .md-body h1 { font-size: 19px; }
  .md-body h2 { font-size: 16px; }
  .md-body h3 { font-size: 14.5px; }
  .md-table {
    font-size: 12.5px;
    min-width: 420px;
  }
  .md-table th,
  .md-table td {
    padding: 7px 10px;
  }

  /* Forms & Bottom-Sheet Modals */
  .form-row > .form-group {
    min-width: 0 !important;
    flex: 1 1 135px;
  }
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal-dialog {
    border-radius: 16px 16px 0 0;
    max-height: 90vh;
    padding: 18px 16px calc(24px + env(safe-area-inset-bottom));
  }
  .modal-dialog .card-header {
    flex-wrap: nowrap;
    align-items: flex-start;
  }
  .toast-container {
    top: calc(56px + env(safe-area-inset-top));
    bottom: auto;
    right: 12px;
    left: 12px;
  }
  .toast { max-width: none; }

  /* iOS 26 Floating Liquid Glass Bottom Tab Dock */
  .mobile-tabbar {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    background: var(--glass-bg-strong);
    backdrop-filter: saturate(155%) blur(var(--glass-blur-strong-px));
    -webkit-backdrop-filter: saturate(155%) blur(var(--glass-blur-strong-px));
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: var(--glass-shadow-float);
    padding: 5px 6px;
    z-index: 100;
  }
  .tab-item {
    border: none;
    background: transparent;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    cursor: pointer;
    padding: 5px 2px;
    border-radius: 17px;
    min-width: 0;
    transition: background-color 0.5s ease, color 0.5s ease, box-shadow 0.5s ease;
  }
  .tab-item svg { width: 19px; height: 19px; }
  .tab-item small {
    font-size: 10.5px;
    font-weight: 500;
    white-space: nowrap;
  }
  .tab-item.active {
    color: var(--text-strong);
    background: var(--glass-bg-subtle);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
  }
  .tab-item.active small { font-weight: 600; }
}

@media (max-width: 420px) {
  .view-container {
    padding: 12px 10px calc(100px + env(safe-area-inset-bottom));
  }
  .page-title { font-size: 20px; }
  #topbar-model-label { max-width: 62px; }
  .topbar-btn { padding: 0 5px; }
}
