@font-face {
  font-family: 'Stack Sans Notch';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('/fonts/StackSansNotch-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Stack Sans Notch';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('/fonts/StackSansNotch-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* FieldWork operations UI — shared visual language with Clouder Connect. */
:root {
  --canvas: #f4f5f6;
  --surface: #ffffff;
  --surface-subtle: #f7f7f7;
  --ink: #151515;
  --ink-secondary: #4f4f4f;
  --ink-muted: #747474;
  --line: #e2e2e2;
  --line-strong: #c9c9c9;
  --brand: #111111;
  --brand-hover: #292929;
  --brand-soft: #eeeeee;
  --success: #087f5b;
  --success-soft: #eaf7f2;
  --warning: #a15c00;
  --warning-soft: #fff5e4;
  --danger: #d92d35;
  --danger-soft: #fff0f1;
  --rail: #ffffff;
  --rail-muted: #737373;
  --rail-active: #f0f0f0;
  --sidebar-width: 232px;
  --radius: 12px;
  --shadow-popover: 0 18px 48px rgb(0 0 0 / .16);
}

body { background: var(--canvas); }
.demo-banner { flex-wrap: wrap; }
.demo-banner > div { flex: 1 1 260px; min-width: 0; }
.demo-banner > div > .small { white-space: normal; overflow-wrap: anywhere; }
.sidebar { padding: 22px 14px 14px; border-right: 1px solid var(--line); color: var(--ink); }
.brand { padding: 0 10px; font-family: 'Stack Sans Notch', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; font-size: 31px; font-weight: 800; letter-spacing: -0.04em; line-height: 1; }
.brand-mark { border-color: var(--line-strong); color: var(--ink); }
.workspace-label { margin: 7px 10px 25px; color: var(--ink-muted); }
.nav-label { display: none; }
.nav { gap: 2px; }
.nav-link { min-height: 40px; padding: 9px 10px; border-radius: 7px; color: var(--ink-secondary); }
.nav-link:hover { background: var(--surface-subtle); color: var(--ink); }
.nav-link[aria-current="page"] { color: var(--ink); background: var(--rail-active); box-shadow: inset 2px 0 var(--ink); font-weight: 600; }

.toast {
  background: #0f172a !important;
  color: #ffffff !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.24) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  border-radius: 8px !important;
  font-weight: 500 !important;
  z-index: 99999 !important;
}
.nav-count { background: var(--ink); border-radius: 10px; }
.sidebar-bottom { padding-top: 14px; }
.account-dock { display: flex; align-items: center; gap: 6px; margin-top: 10px; width: calc(100% + 8px); margin-left: -4px; margin-right: -4px; box-sizing: border-box; }
.account-pill-wrap { position: relative; flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; background: #ffffff !important; border: 1px solid rgba(0, 0, 0, 0.08) !important; border-radius: 12px !important; padding: 6px 10px !important; min-height: 42px !important; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important; cursor: pointer; transition: all 140ms ease; box-sizing: border-box; }
.account-pill-wrap:hover { border-color: #cbd5e1 !important; background: #fafbfc !important; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06) !important; }
.account-pill-avatar { width: 30px; height: 30px; border-radius: 50%; overflow: hidden; flex-shrink: 0; display: flex; align-items: center; justify-content: center; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
.account-pill-avatar svg { width: 100%; height: 100%; display: block; border-radius: 50%; }
.account-pill-info { display: flex; flex-direction: column; min-width: 0; flex: 1; text-align: left; }
.account-pill-user { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important; font-size: 13px !important; font-weight: 700 !important; color: #0f172a !important; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -0.01em; }
.account-pill-tenant { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important; font-size: 11px !important; font-weight: 500; color: #64748b !important; line-height: 1.2; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-pill-chevron { width: 12px; height: 12px; color: #64748b !important; flex-shrink: 0; margin-left: 2px; }
.account-pill-select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; z-index: 10; }
.account-dock-btn { width: 36px; height: 42px; flex: 0 0 36px; background: #ffffff !important; border: 1px solid rgba(0, 0, 0, 0.08) !important; border-radius: 12px !important; display: flex; align-items: center; justify-content: center; color: #64748b !important; cursor: pointer; padding: 0; transition: all 140ms ease; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important; box-sizing: border-box; }
.account-dock-btn:hover { background: #fafbfc !important; border-color: #cbd5e1 !important; color: #0f172a !important; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06) !important; }
.account-dock-btn svg { width: 16px; height: 16px; stroke-width: 2; }
.avatar-wrap { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; flex-shrink: 0; vertical-align: middle; overflow: hidden; }
.avatar-wrap svg, .avatar-wrap img { width: 100%; height: 100%; display: block; border-radius: 50%; object-fit: cover; }
.avatar { overflow: hidden !important; }
.avatar svg, .avatar img { width: 100% !important; height: 100% !important; display: block !important; border-radius: 50% !important; object-fit: cover; }

.topbar { height: 58px; padding: 0 28px; }
.topbar-search-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.topbar-search-icon {
  position: absolute;
  left: 10px;
  color: var(--ink-muted);
  pointer-events: none;
  width: 14px;
  height: 14px;
}
.topbar-search-wrap input#project-search {
  width: 250px;
  height: 32px;
  padding: 0 12px 0 30px;
  font-size: 12px;
  background: var(--surface-subtle, #f8fafc);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  transition: all 0.15s ease;
}
.topbar-search-wrap input#project-search:focus {
  outline: none;
  background: var(--surface);
  border-color: var(--primary, #2563eb);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
  width: 290px;
}
.content { max-width: 1460px; padding: 28px; }
.btn { border-radius: 8px; box-shadow: none; }
.btn--primary { background: var(--ink); border-color: var(--ink); }
.btn--primary:hover { background: #303030; }
.panel { border-radius: 12px; }
.panel-head { padding: 16px 18px; }
.toolbar { padding: 12px 16px; }
.badge { border-radius: 999px; padding: 4px 8px; background: #f1f1f1; }
.badge::before { display: none; }
.badge .icon { width: 13px; height: 13px; }
.badge-project {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #f0f4ff;
  color: #1e40af;
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  max-width: 190px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.badge-project .icon {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  color: #2563eb;
}
.badge-independent {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #f8fafc;
  color: #475569;
  border: 1px dashed #cbd5e1;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-independent .icon {
  width: 11px;
  height: 11px;
  flex-shrink: 0;
  color: #94a3b8;
}
.project-drop--independent {
  border-left: 3px solid #94a3b8;
  background: #fafbfe;
}
.stats { margin-bottom: 20px; border-radius: 12px; }
.stat { padding: 17px 20px; }
.stat-value { font-size: 25px; margin: 4px 0 0; }
.stat-note { display: none; }
.data-table th { text-transform: none; letter-spacing: 0; font-size: 11px; }
.data-table td { height: 58px; }
.data-table th, .data-table td { padding: 8px 10px; }

/* Projects are a work feed: status, update, evidence and owner in one scan. */
.project-workspace .toolbar input { width: min(420px, 100%); }
.project-worklist { display: grid; }
.project-drop { border-bottom: 1px solid var(--line); }
.project-drop > summary { display: grid; grid-template-columns: minmax(220px, 1fr) auto auto; align-items: center; gap: 18px; min-height: 70px; padding: 12px 18px; cursor: grab; user-select: none; list-style: none; }
.project-drop > summary:active { cursor: grabbing; }
.project-drop > summary::-webkit-details-marker { display: none; }
.project-drop > summary::before { content: "›"; grid-column: 1; position: absolute; font-size: 20px; color: var(--ink-muted); transform: translateX(-2px); }
.project-drop[open] > summary::before { transform: translateX(-2px) rotate(90deg); }
.project-drop-name { display: grid; gap: 2px; padding-left: 22px; }
.project-drop-name small, .project-drop-count { color: var(--ink-muted); font-size: 11px; }
.project-task-list { border-top: 1px solid var(--line); background: var(--surface-subtle); padding: 0 18px 12px 40px; }
.service-worklist-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding: 12px 10px; border-bottom: 1px solid var(--line); color: var(--ink-muted); font-size: 12px; }
.service-worklist-meta .feature-action-row { margin-left: auto; }
.workspace-lifecycle-actions { flex-wrap: wrap; gap: 6px; padding: 8px 0; }
.project-task-card { position: relative; border-bottom: 1px solid var(--line); }
.project-task-card:last-child { border-bottom: 0; }
.project-task-item {
  position: relative;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 130px 185px 290px 110px;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 8px 10px;
  border-radius: 6px;
  transition: background 0.15s ease;
}
.project-task-item:hover {
  background: rgba(0, 0, 0, 0.02);
}
.project-task-item:focus-visible { outline-offset: -2px; }

.project-task-header-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 130px 185px 290px 110px;
  align-items: center;
  gap: 12px;
  padding: 10px 10px 6px 10px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ink-muted);
  border-bottom: 1px solid var(--line);
}

.project-completed-section {
  margin-top: 14px;
  padding-top: 6px;
}

.project-completed-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 0 8px 0;
}

.project-completed-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #047857;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  padding: 3px 10px;
  border-radius: 999px;
  box-shadow: 0 1px 2px rgba(16, 185, 129, 0.08);
}

.project-completed-badge svg {
  width: 12px;
  height: 12px;
  stroke: #059669;
  stroke-width: 2.5;
}

.project-completed-line {
  flex: 1;
  height: 1px;
  background: var(--line);
  opacity: 0.85;
}

.project-tasks-completed-list .project-task-item {
  opacity: 0.88;
  transition: opacity 0.15s ease, background 0.15s ease;
}

.project-tasks-completed-list .project-task-item:hover {
  opacity: 1;
}

.task-tree-caret-btn {
  width: 22px;
  height: 22px;
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  padding: 0;
  transition: transform 0.18s ease, color 0.15s ease, background 0.15s ease;
}
.task-tree-caret-btn:hover { background: var(--surface); color: var(--ink); }
.task-tree-caret-btn svg { transition: transform 0.18s ease; }
.task-tree-caret-btn.is-expanded svg { transform: rotate(90deg); }

.project-task-copy {
  display: grid;
  gap: 3px;
  border: 0;
  padding: 0;
  background: transparent;
  text-align: left;
  min-width: 0;
  cursor: pointer;
}
.project-task-copy strong, .project-task-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.project-task-copy strong { font-size: 13px; }
.project-task-copy span { color: var(--ink-muted); font-size: 11px; }

.project-task-files {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 5px;
  min-width: 0;
  max-width: 100%;
}

.task-row-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.task-row-attachments {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  max-width: 100%;
}

.task-row-attachments .task-file-chip-wrap,
.task-row-attachments .task-audio-chip-wrap {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
}

.task-row-attachments .file-chip {
  max-width: 220px;
}

.task-row-attachments .file-chip-name {
  max-width: 160px;
}

.task-col-assigned {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  min-width: 0;
}
.task-col-assigned span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.task-col-status {
  display: flex;
  align-items: center;
}
.task-col-priority {
  display: flex;
  align-items: center;
}
.task-col-date {
  display: flex;
  align-items: center;
  font-size: 12px;
  color: var(--ink-secondary);
}
.task-col-status-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  justify-content: center;
}
.task-status-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.task-status-date {
  display: flex;
  align-items: center;
  font-size: 11px;
}
.task-status-date .task-date-badge {
  font-size: 11px;
}
.task-date-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  white-space: nowrap;
}
.task-date--completed {
  color: var(--success, #16a34a);
  font-weight: 600;
}
.task-file-chips-group, .task-audio-chips-group {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-wrap: nowrap;
}

.task-tree-audio-box {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  max-width: 380px;
}
.task-tree-audio-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #7c3aed;
}
.task-tree-audio-player {
  width: 100%;
  height: 36px;
  outline: none;
}
.task-manager-drop-td {
  padding: 0 16px 14px 44px !important;
  background: var(--surface-subtle);
  border-bottom: 2px solid var(--line);
}
.task-row-main.is-expanded td {
  border-bottom-color: transparent !important;
}

.file-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 26px;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 500;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  transition: all 0.15s ease;
  user-select: none;
  max-width: 120px;
  overflow: hidden;
  white-space: nowrap;
  cursor: pointer;
  margin: 0;
  flex-shrink: 0;
}
.file-chip:hover {
  background: var(--surface-subtle);
  border-color: var(--line-strong, #cbd5e1);
}
.file-chip .icon, .file-chip svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}
.file-chip-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 70px;
}

/* Add file button in task row */
.file-chip--add {
  border-style: dashed;
  color: var(--ink-muted);
  background: transparent;
  cursor: pointer;
}
.file-chip--add:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--primary-subtle, rgba(37,99,235,0.06));
}

/* Direct Voice Recording button in task row */
.file-chip--record {
  border-style: dashed;
  color: #7c3aed;
  background: transparent;
  cursor: pointer;
}
.file-chip--record:hover {
  color: #6d28d9;
  border-color: #7c3aed;
  background: rgba(124, 58, 237, 0.06);
}
.file-chip--recording.is-recording {
  border-color: #ef4444 !important;
  color: #dc2626 !important;
  background: #fef2f2 !important;
  font-weight: 600;
  cursor: pointer;
}
.recording-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #dc2626;
  animation: pulseDot 1s infinite alternate ease-in-out;
  flex-shrink: 0;
}
@keyframes pulseDot {
  from { opacity: 0.3; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1.15); }
}

/* Voice memo recording pill in task row */
.file-chip--recording-pill, .file-chip--audio {
  background: #f5f3ff;
  border-color: #ddd6fe;
  color: #6d28d9;
}
.file-chip--recording-pill:hover, .file-chip--audio:hover {
  background: #ede9fe;
  border-color: #c4b5fd;
}
.file-chip--recording-pill.is-playing, .file-chip--audio.is-playing {
  background: #7c3aed;
  color: #ffffff;
  border-color: #6d28d9;
}
.file-chip--audio.is-playing svg {
  stroke: #ffffff;
}

/* Updates counter chip in task row */
.file-chip--updates {
  max-width: none;
  min-width: 82px;
  justify-content: center;
  flex-shrink: 0;
  background: var(--surface-subtle);
  color: var(--ink-secondary);
}
.file-chip--updates:hover {
  background: var(--surface);
  border-color: var(--line-strong, #cbd5e1);
  color: var(--ink);
}

/* Task file chip wrapper and quick actions */
.task-file-chip-wrap, .task-audio-chip-wrap {
  display: inline-flex;
  align-items: center;
  position: relative;
  gap: 3px;
}
.file-chip-actions {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.file-chip-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-muted);
  cursor: pointer;
  padding: 0;
  transition: all 0.15s ease;
}
.file-chip-action-btn:hover {
  background: var(--surface-subtle);
  color: var(--ink);
  border-color: var(--line);
}
.file-chip-action-btn.btn-delete-file:hover, .file-chip-action-btn.btn-delete-audio:hover {
  color: #ef4444;
  background: #fee2e2;
  border-color: #fca5a5;
}
.file-count-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 4px;
  background: var(--surface-subtle);
  color: var(--ink-muted);
  border: 1px solid var(--line);
}

/* File type icon visual distinction */
.file-type-icon {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}
.file-type-excel { stroke: #16a34a; }
.file-type-ppt { stroke: #ea580c; }
.file-type-pdf { stroke: #dc2626; }
.file-type-word { stroke: #2563eb; }
.file-type-audio { stroke: #8b5cf6; }
.file-type-image { stroke: #0284c7; }
.file-type-archive { stroke: #d97706; }
.file-type-cad { stroke: #0d9488; }
.file-type-generic { stroke: #64748b; }

/* Modal Attachments & Audio styling */
.config-modal-section {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface-subtle, #f8f9fa);
}
.config-modal-section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
}
.config-modal-files-list, .config-modal-audio-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}
.config-file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: var(--surface, #ffffff);
  border: 1px solid var(--line);
  border-radius: 6px;
  gap: 8px;
}
.config-file-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.config-file-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.config-file-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 260px;
}
.config-file-title:hover {
  text-decoration: underline;
  color: var(--primary);
}
.config-file-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.config-modal-upload-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 6px;
  border-top: 1px dashed var(--line);
}
.config-empty-files {
  padding: 6px 0;
}
.project-add-task { display: inline-flex; align-items: center; gap: 7px; margin: 12px 0 0; padding: 7px 10px; border: 0; background: transparent; color: var(--ink-secondary); font-size: 12px; }
.empty.compact { padding: 20px 0 8px; text-align: left; }

/* Interactive Rubber Stamp Slot & Button */
.project-task-stamp-slot { display: flex; align-items: center; justify-content: center; width: 100%; min-width: 0; }
.task-stamp-toggle {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.18s ease, color 0.18s ease, filter 0.18s ease;
  transform-origin: center center;
  user-select: none;
  flex-shrink: 0;
}
.task-stamp-toggle .stamp-svg {
  width: 106px;
  height: 35px;
  display: block;
}

/* UNAPPROVED: Grey stamp (subtle, clean) */
.task-stamp-toggle.is-unapproved {
  color: #94a3b8;
  opacity: 0.35;
  transform: rotate(0deg);
}
.task-stamp-toggle.is-unapproved:hover {
  opacity: 0.95;
  color: #ef4444; /* Turns red when you hover over it */
  transform: rotate(-3deg) scale(1.05);
  filter: drop-shadow(0 2px 5px rgba(239, 68, 68, 0.22));
}

/* APPROVED: Red stamp */
.task-stamp-toggle.is-approved {
  color: #d32f2f;
  opacity: 0.96;
  transform: rotate(-6deg);
  filter: drop-shadow(0 2px 6px rgba(211, 47, 47, 0.22));
}
.task-stamp-toggle.is-approved:hover {
  opacity: 1;
  transform: rotate(-3deg) scale(1.06);
  color: #b71c1c;
  filter: drop-shadow(0 3px 8px rgba(211, 47, 47, 0.35));
}

/* Task Updates Tree Dropdown & Branches */
.task-tree-dropdown { display: none; padding: 4px 10px 14px 28px; background: var(--surface-subtle); border-top: 1px dashed var(--line); }
.task-tree-dropdown.is-open { display: block; }
.task-tree-spine { position: relative; padding-left: 20px; }
.task-tree-spine::before { content: ""; position: absolute; left: 8px; top: 12px; bottom: 20px; width: 2px; background: #cbd5e1; }
.task-tree-branch { position: relative; display: flex; align-items: flex-start; margin-bottom: 9px; }
.task-tree-branch:last-child { margin-bottom: 0; }
.task-tree-branch::before { content: ""; position: absolute; left: -12px; top: 18px; width: 12px; height: 2px; background: #cbd5e1; }
.task-tree-node { flex: 1; min-width: 0; background: #ffffff; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03); }
.task-tree-header { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; flex-wrap: wrap; }
.task-tree-header .avatar { width: 22px; height: 22px; font-size: 10px; }
.task-tree-author-info { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.task-tree-name { font-size: 12px; font-weight: 600; color: var(--ink); }
.task-tree-job { font-size: 11px; color: var(--ink-muted); }
.task-tree-time { margin-left: auto; font-size: 11px; color: var(--ink-muted); }
.task-tree-text { margin: 0; font-size: 12.5px; color: var(--ink-secondary); line-height: 1.45; }
.task-tree-audio-pill { margin-top: 7px; }
.audio-play-pill-btn { display: inline-flex; align-items: center; gap: 6px; background: #f1f5f9; border: 1px solid #cbd5e1; border-radius: 999px; padding: 4px 10px; font-size: 11px; font-weight: 600; color: #1e293b; cursor: pointer; transition: all 0.15s ease; }
.audio-play-pill-btn:hover { background: #e2e8f0; border-color: #94a3b8; color: #0f172a; }
.audio-play-pill-btn.is-playing { background: #fee2e2; border-color: #fca5a5; color: #b91c1c; }
.audio-play-icon { flex-shrink: 0; }
.task-tree-quick-add { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.task-tree-composer-box { display: flex; align-items: center; gap: 8px; width: 100%; }
.task-tree-input { flex: 1; min-height: 34px; font-size: 12.5px; padding: 5px 11px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface-subtle); color: var(--ink); }
.task-tree-input:focus { outline: none; border-color: var(--brand); background: #ffffff; }
.task-tree-tools { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.task-tree-tool-btn { display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px; min-height: 32px; border: 1px solid var(--line); border-radius: 6px; background: #ffffff; color: var(--ink-secondary); font-size: 11.5px; font-weight: 600; cursor: pointer; transition: all 0.15s ease; user-select: none; }
.task-tree-tool-btn:hover { background: var(--surface-subtle); border-color: var(--line-strong); color: var(--ink); }
.task-tree-tool-btn svg { width: 14px; height: 14px; stroke-width: 2; flex-shrink: 0; }
.task-tree-tool-btn.is-recording { background: #fee2e2; border-color: #fca5a5; color: #b91c1c; animation: pulse 1.2s infinite alternate; }
.task-tree-rec-panel { display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: #fef2f2; border: 1px solid #fecaca; border-radius: 6px; }
.task-tree-drafts-wrap { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 4px; border-top: 1px dashed var(--line); }
.task-tree-draft-pill { display: inline-flex; align-items: center; gap: 6px; background: #f1f5f9; border: 1px solid #cbd5e1; border-radius: 999px; padding: 3px 8px; font-size: 11px; font-weight: 500; color: #1e293b; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-tree-draft-pill.is-audio { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }
.task-tree-draft-remove { border: 0; background: transparent; color: #64748b; font-size: 14px; line-height: 1; cursor: pointer; padding: 0 2px; margin-left: 2px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; width: 14px; height: 14px; }
.task-tree-draft-remove:hover { color: #dc2626; background: rgba(0, 0, 0, 0.05); }
.task-tree-files-wrap { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.task-tree-file-pill { display: inline-flex; align-items: center; gap: 6px; background: #f8fafc; border: 1px solid #cbd5e1; border-radius: 6px; padding: 4px 8px; font-size: 11px; font-weight: 500; color: #1e293b; text-decoration: none; transition: all 0.15s ease; }
.task-tree-file-pill:hover { background: #f1f5f9; border-color: #94a3b8; color: #0f172a; text-decoration: none; }
.task-tree-file-pill svg { width: 13px; height: 13px; stroke-width: 2; flex-shrink: 0; color: #64748b; }

.task-tree-delete-btn {
  width: 24px;
  height: 24px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  border-radius: 4px;
  margin-left: 6px;
  cursor: pointer;
  background: transparent;
  border: none;
  transition: all 0.15s ease;
}
.task-tree-delete-btn:hover {
  color: #dc2626;
  background: #fee2e2;
}
.task-tree-delete-btn svg {
  width: 13px;
  height: 13px;
}

/* Context Menu & User Context Actions */
.task-context-menu { position: fixed; z-index: 200; width: 280px; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow-popover); }
.context-title { padding: 9px 10px; border-bottom: 1px solid var(--line); color: var(--ink-muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-context-menu > button { display: grid; grid-template-columns: 30px 1fr 18px; align-items: center; gap: 9px; width: 100%; padding: 8px; border: 0; border-radius: 7px; background: transparent; text-align: left; cursor: pointer; }
.task-context-menu > button:hover, .task-context-menu > button[aria-current="true"] { background: var(--surface-subtle); }
.task-context-menu > button span { display: grid; }
.task-context-menu > button small { color: var(--ink-muted); }
.context-approve-btn:hover { background: #fef2f2 !important; }
.context-divider { height: 1px; background: var(--line); margin: 4px 0; }
tr[data-user-context] { cursor: context-menu; transition: background 0.12s ease; }
tr[data-user-context]:hover { background: rgba(0, 0, 0, 0.02); }

/* Task details use a centered operational record instead of a page-height sidebar. */
.drawer { inset: 50% auto auto 50%; width: min(820px, calc(100% - 32px)); height: auto; max-height: calc(100% - 32px); transform: translate(-50%, -50%); border-width: 1px; border-radius: 14px; }
.drawer .dialog-body { max-height: calc(100vh - 170px); overflow-y: auto; }
.drawer .definition { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.drawer .definition dt { display: none; }
.drawer .definition dd { margin: 0; padding: 10px; background: var(--surface-subtle); text-align: left; }
.comment { display: grid; grid-template-columns: auto 1fr; gap: 0 8px; margin: 14px 0; }
.comment p { grid-column: 1 / -1; margin-top: 5px; }
.audio-preview { height: 34px; }

.notification-list { max-height: 520px; overflow-y: auto; padding: 0; }
.notification-item { display: grid; grid-template-columns: 26px 1fr; gap: 10px; padding: 15px 20px; border-bottom: 1px solid var(--line); }
.notification-item.is-read { opacity: .62; }
.notification-state { color: var(--ink-muted); padding-top: 1px; }
.notification-state .icon { width: 18px; height: 18px; }
.notification-title { display: flex; justify-content: space-between; gap: 12px; }
.notification-copy p { color: var(--ink-secondary); }

/* AI monitor — ported from Clouder Connect's monitor and voice rail. */
.content.content--assistant {
  width: auto;
  max-width: none;
  height: calc(100vh - var(--topbar-height, 58px));
  min-height: 580px;
  padding: 20px;
  overflow: hidden;
}

.ai-monitor-shell {
  width: min(1220px, 100%);
  height: 100%;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 10px 30px rgb(15 23 42 / .05);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ai-monitor-header {
  min-height: 58px;
  padding: 0 16px 0 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.ai-monitor-title,
.ai-monitor-tools { display: flex; align-items: center; gap: 9px; min-width: 0; }
.ai-monitor-title > div { display: grid; gap: 1px; }
.ai-monitor-title strong { font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.ai-monitor-title span:last-child { color: var(--ink-muted); font-size: 10px; }
.ai-status-dot { width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px var(--success-soft); }
.ai-status-dot[data-busy="true"] { background: var(--warning); box-shadow: 0 0 0 4px var(--warning-soft); }
.ai-monitor-tools label { color: var(--ink-muted); font-family: var(--mono, monospace); font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.ai-monitor-tools select { width: 220px; min-height: 34px; padding: 5px 30px 5px 10px; border-radius: 8px; background-color: var(--surface-subtle); font-size: 11px; }
.ai-header-button { min-height: 34px; padding: 0 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink-secondary); display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 650; cursor: pointer; }
.ai-header-button:hover { border-color: var(--line-strong); color: var(--ink); background: var(--surface-subtle); }
.ai-header-button .icon { width: 14px; height: 14px; }

.ai-monitor-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) clamp(300px, 30%, 360px); }
.ai-conversation { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.ai-chat-log { flex: 1; min-height: 0; padding: 28px 34px; overflow-y: auto; display: flex; flex-direction: column; gap: 20px; scroll-behavior: smooth; }
.ai-empty-state { flex: 1; min-height: 390px; padding: 30px 20px; display: grid; place-content: center; justify-items: center; text-align: center; }
.ai-empty-mark { width: 42px; height: 42px; margin-bottom: 18px; border: 1px solid var(--line); border-radius: 50%; color: var(--ink); display: grid; place-items: center; }
.ai-empty-mark .icon { width: 18px; height: 18px; }
.ai-empty-state h1 { margin: 0; color: var(--ink); font-size: clamp(20px, 2.1vw, 26px); font-weight: 750; letter-spacing: -.03em; }
.ai-empty-state > p { max-width: 430px; margin: 8px 0 24px; color: var(--ink-secondary); font-size: 12px; line-height: 1.5; }
.ai-starter-grid { width: min(620px, 100%); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; text-align: left; }
.ai-starter-grid .suggestion { min-height: 68px; margin: 0; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); display: grid; grid-template-columns: 28px minmax(0, 1fr); grid-template-rows: auto auto; align-items: center; column-gap: 10px; text-align: left; cursor: pointer; }
.ai-starter-grid .suggestion:hover { border-color: var(--line-strong); background: var(--surface-subtle); transform: translateY(-1px); }
.ai-starter-grid .suggestion > span { grid-row: 1 / 3; width: 28px; height: 28px; border-radius: 7px; background: var(--surface-subtle); color: var(--ink-secondary); display: grid; place-items: center; }
.ai-starter-grid .suggestion .icon { width: 14px; height: 14px; }
.ai-starter-grid .suggestion strong { align-self: end; font-size: 12px; }
.ai-starter-grid .suggestion small { align-self: start; color: var(--ink-muted); font-size: 10px; }

.ai-chat-log .chat-message { align-self: stretch; width: 100%; max-width: 820px; margin: 0; padding: 2px 0 2px 15px; border: 0; border-left: 3px solid var(--ink); border-radius: 0; background: transparent; color: var(--ink-secondary); font-size: 12.5px; line-height: 1.68; box-sizing: border-box; }
.ai-chat-log .chat-message--user { align-self: flex-end; width: fit-content; max-width: min(72%, 620px); padding: 12px 14px; border: 1px solid var(--line); border-left-width: 1px; border-radius: 10px; background: var(--surface-subtle); color: var(--ink); }
.ai-chat-log .chat-message--user p { margin: 3px 0 0; white-space: pre-wrap; }
.ai-message-role { color: var(--ink-muted); font-family: var(--mono, monospace); font-size: 9px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.ai-message-meta { margin-bottom: 7px; display: flex; align-items: center; gap: 9px; color: var(--ink-muted); font-size: 10px; }
.ai-message-meta .ai-message-role { color: var(--ink); }
.ai-response > :first-child { margin-top: 0; }
.ai-response > :last-child { margin-bottom: 0; }
.ai-chat-log .skeleton { height: 8px; margin-top: 10px; border-radius: 3px; }

.ai-composer { flex: 0 0 auto; margin: 0; padding: 10px 16px 12px; border-top: 1px solid var(--line); background: var(--surface); }
.ai-prompt-wrap { width: 100%; min-height: 56px; padding: 7px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface-subtle); display: grid; grid-template-columns: 32px minmax(0, 1fr) 36px; align-items: end; gap: 7px; box-sizing: border-box; transition: border-color .16s ease, box-shadow .16s ease; }
.ai-prompt-wrap:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px rgb(0 0 0 / .07); }
.ai-composer-mark { width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 50%; color: var(--ink-secondary); display: grid; place-items: center; }
.ai-composer-mark .icon { width: 15px; height: 15px; }
.ai-prompt-wrap textarea { width: 100%; min-height: 36px; max-height: 145px; padding: 9px 2px 6px; border: 0; border-radius: 0; outline: 0 !important; background: transparent; color: var(--ink); resize: vertical; font: 12.5px/1.4 inherit; box-shadow: none !important; }
.ai-send-button { width: 36px; height: 36px; padding: 0; border: 1px solid var(--ink); border-radius: 50%; background: var(--ink); color: white; display: grid; place-items: center; cursor: pointer; transition: transform .14s ease; }
.ai-send-button:hover { transform: translateY(-1px); }
.ai-send-button .icon { width: 16px; height: 16px; }

.ai-voice-rail { position: relative; min-height: 0; padding: 16px; border-left: 1px solid var(--line); background: color-mix(in srgb, var(--ink) 2.3%, var(--surface)); color: var(--ink); display: flex; flex-direction: column; align-items: center; overflow: hidden; }
.ai-voice-heading { width: 100%; display: flex; align-items: center; justify-content: space-between; color: var(--ink); font-family: var(--mono, monospace); font-size: 9px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.ai-voice-availability { color: var(--success); }
.ai-voice-availability::before { content: ''; display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: currentColor; }
.ai-voice-core { width: min(310px, 100%); aspect-ratio: 1; margin: auto 0 0; color: var(--ink); transition: color .2s ease; }
.ai-voice-core[data-state="listening"] { color: #2563eb; }
.ai-voice-core[data-state="thinking"] { color: var(--ink-muted); }
.ai-voice-core[data-state="error"] { color: var(--danger); }
.ai-voice-core canvas { display: block; width: 100%; height: 100%; }
.ai-voice-status { display: grid; gap: 3px; margin-top: -36px; text-align: center; position: relative; z-index: 1; }
.ai-voice-status strong { color: var(--ink); font-size: 12px; }
.ai-voice-status span { color: var(--ink-muted); font-size: 10px; }
.ai-voice-transcript { width: 100%; min-height: 42px; margin: 22px 0 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: rgb(255 255 255 / .68); color: var(--ink-secondary); font-size: 10.5px; line-height: 1.45; text-align: center; box-sizing: border-box; }
.ai-voice-controls { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.ai-voice-button { min-width: 86px; height: 36px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--surface); color: var(--ink-secondary); display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-size: 10px; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; cursor: pointer; }
.ai-voice-button:hover { border-color: var(--ink); color: var(--ink); }
.ai-voice-button.is-listening { border-color: var(--danger); color: var(--danger); background: var(--danger-soft); animation: aiVoicePulse 1.2s ease-in-out infinite; }
.ai-voice-button .icon { width: 15px; height: 15px; }
.ai-voice-stop { width: 36px; height: 36px; padding: 0; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink-muted); display: grid; place-items: center; cursor: pointer; }
.ai-voice-stop span { width: 10px; height: 10px; border-radius: 1px; background: currentColor; }
.ai-voice-stop:disabled { opacity: .35; cursor: default; }
.ai-voice-stop:hover:not(:disabled) { border-color: var(--danger); color: var(--danger); }
@keyframes aiVoicePulse { 50% { box-shadow: 0 0 0 5px rgb(217 45 53 / .08); } }

.ai-monitor-shell .ai-table-wrap { border-color: var(--line); border-radius: 7px; box-shadow: none; }
.ai-monitor-shell .ai-markdown-table th { background: var(--surface-subtle); color: var(--ink); border-color: var(--line); }
.ai-monitor-shell .ai-markdown-table td { color: var(--ink-secondary); border-color: var(--line); }
.ai-monitor-shell .ai-markdown-table tbody tr:nth-child(even) { background: var(--surface-subtle); }
.ai-monitor-shell .ai-heading { color: var(--ink); }

@media (max-width: 980px) {
  .content.content--assistant { height: auto; min-height: calc(100vh - var(--topbar-height, 58px)); overflow: visible; }
  .ai-monitor-shell { min-height: calc(100vh - var(--topbar-height, 58px) - 40px); }
  .ai-monitor-grid { grid-template-columns: minmax(0, 1fr) 280px; }
  .ai-chat-log { padding: 24px; }
}

@media (max-width: 760px) {
  .content.content--assistant { padding: 0; }
  .ai-monitor-shell { min-height: calc(100vh - var(--topbar-height, 58px)); border-width: 0; border-radius: 0; }
  .ai-monitor-header { min-height: 64px; padding: 8px 12px; align-items: flex-start; }
  .ai-monitor-title > div > span { display: none; }
  .ai-monitor-tools { flex: 1; justify-content: flex-end; }
  .ai-monitor-tools label { display: none; }
  .ai-monitor-tools select { width: min(185px, 48vw); }
  .ai-header-button span { display: none; }
  .ai-header-button { width: 34px; padding: 0; justify-content: center; }
  .ai-monitor-grid { display: block; }
  .ai-conversation { min-height: calc(100vh - var(--topbar-height, 58px) - 64px); }
  .ai-chat-log { padding: 20px 14px; }
  .ai-empty-state { min-height: 420px; padding: 20px 0; }
  .ai-starter-grid { grid-template-columns: 1fr; }
  .ai-chat-log .chat-message--user { max-width: 90%; }
  .ai-composer { padding: 9px 10px calc(10px + env(safe-area-inset-bottom)); }
  .ai-voice-rail { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .ai-starter-grid .suggestion,
  .ai-send-button,
  .ai-voice-core { transition: none; }
  .ai-voice-button.is-listening { animation: none; }
}

/* AI monitor conversation mode — intentionally quiet, like a modern chat UI. */
.content.content--assistant { padding: 0 28px; background: var(--surface); }
.ai-monitor-shell { width: 100%; max-width: none; border: 0; border-radius: 0; box-shadow: none; overflow: visible; }
.ai-monitor-header { width: min(900px, calc(100% - 40px)); min-height: 54px; margin: 0 auto; padding: 0; border: 0; }
.ai-monitor-tools select { width: auto; min-width: 198px; padding-left: 0; border: 0; background: transparent; color: var(--ink); font-size: 13px; font-weight: 650; }
.ai-header-button { border: 0; background: transparent; color: var(--ink-muted); }
.ai-header-button:hover { border: 0; background: var(--surface-subtle); }
.ai-monitor-grid { display: block; min-height: 0; }
.ai-conversation { position: relative; height: 100%; }
.ai-chat-log { width: min(800px, calc(100% - 32px)); margin: 0 auto; padding: 44px 0 158px; gap: 34px; box-sizing: border-box; }
.ai-empty-state { min-height: 420px; padding: 20px; }
.ai-empty-state h1 { font-size: clamp(25px, 3vw, 32px); font-weight: 650; letter-spacing: -.035em; }
.ai-empty-state > p,
.ai-empty-mark { display: none; }
.ai-starter-grid { width: auto; margin-top: 24px; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.ai-starter-grid .suggestion { min-height: 0; width: auto; padding: 9px 13px; border-radius: 999px; display: block; color: var(--ink-secondary); font-size: 11.5px; }
.ai-starter-grid .suggestion:hover { transform: none; }
.ai-chat-log .chat-message { max-width: 100%; padding: 0; border: 0; background: transparent; color: var(--ink); font-size: 14px; line-height: 1.7; }
.ai-chat-log .chat-message--user { width: fit-content; max-width: min(75%, 610px); padding: 11px 16px; border: 0; border-radius: 20px; background: #f1f1f1; }
.ai-chat-log .chat-message--user .ai-message-role { display: none; }
.ai-chat-log .chat-message--user p { margin: 0; }
.ai-message-meta { margin-bottom: 10px; }
.ai-message-meta > span:not(.ai-message-role) { display: none; }
.ai-message-meta .ai-message-role { color: var(--ink-muted); }
.ai-response .ai-p,
.ai-response .ai-ul,
.ai-response .ai-ol { font-size: 14px; line-height: 1.7; }
.ai-composer { position: absolute; left: 50%; bottom: 0; z-index: 5; width: min(800px, calc(100% - 32px)); padding: 32px 0 12px; border: 0; background: linear-gradient(to bottom, rgb(255 255 255 / 0), var(--surface) 25%); transform: translateX(-50%); }
.ai-prompt-wrap { min-height: 56px; padding: 7px 8px; border-color: #d6d6d6; border-radius: 28px; background: #f4f4f4; box-shadow: 0 2px 8px rgb(0 0 0 / .05); display: flex; align-items: center; gap: 6px; overflow: visible; }
.ai-prompt-wrap:focus-within { border-color: #b8b8b8; box-shadow: 0 2px 10px rgb(0 0 0 / .08); }
.ai-composer-mark { border: 0; background: transparent; }
.ai-prompt-wrap textarea { flex: 1 1 auto; align-self: center; min-width: 80px; min-height: 40px; height: 40px; padding: 9px 4px; resize: none; font-size: 14px; line-height: 22px; box-sizing: border-box; }
.ai-composer-toolbar { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.ai-picker { position: relative; }
.ai-picker > summary { height: 36px; padding: 0 10px; border: 0; border-radius: 18px; background: transparent; color: var(--ink-secondary); display: inline-flex; align-items: center; gap: 6px; list-style: none; font-size: 12px; cursor: pointer; user-select: none; }
.ai-picker > summary::-webkit-details-marker { display: none; }
.ai-picker > summary:hover,
.ai-picker[open] > summary { background: #e6e6e6; color: var(--ink); }
.ai-picker > summary .icon { width: 14px; height: 14px; }
.ai-model-picker > summary { max-width: 168px; }
.ai-model-picker > summary > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-picker-menu { position: absolute; right: 0; bottom: calc(100% + 10px); z-index: 30; padding: 10px; border: 0; border-radius: 22px; background: #303030; color: #f7f7f7; box-shadow: 0 16px 44px rgb(0 0 0 / .28); }
.ai-model-menu { width: 280px; }
.ai-picker-title { padding: 7px 8px 9px; color: #b7b7b7; font-size: 12px; }
.ai-model-menu button { width: 100%; min-height: 47px; padding: 7px 10px; border: 0; border-radius: 12px; background: transparent; color: #f5f5f5; display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: left; cursor: pointer; }
.ai-model-menu button:hover,
.ai-model-menu button.is-selected { background: #4a4a4a; }
.ai-model-menu button > span { display: grid; gap: 2px; }
.ai-model-menu button strong { font-size: 13px; font-weight: 520; }
.ai-model-menu button small { color: #aaa; font-size: 11px; }
.ai-model-menu button > .icon { width: 16px; height: 16px; flex: 0 0 auto; }
.ai-effort-menu { width: 250px; padding: 15px 14px 13px; }
.ai-effort-head { display: flex; align-items: center; gap: 8px; }
.ai-effort-head > span { color: #bdbdbd; display: grid; place-items: center; }
.ai-effort-head .icon { width: 15px; height: 15px; }
.ai-effort-head strong { color: #2f9cff; font-size: 14px; }
.ai-effort-menu > small { display: block; margin: 3px 0 10px 23px; color: #d5d5d5; font-size: 10px; }
.ai-effort-menu input[type="range"] { width: 100%; height: 24px; margin: 1px 0 0; padding: 0; border: 0; accent-color: #168cff; background: transparent; box-shadow: none; }
.ai-effort-scale { display: flex; justify-content: space-between; padding: 0 2px; color: #9f9f9f; font-size: 9px; }
.ai-mic-button { width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--ink-secondary); display: grid; place-items: center; cursor: pointer; }
.ai-mic-button:hover { background: #e7e7e7; color: var(--ink); }
.ai-mic-button.is-listening { background: var(--danger-soft); color: var(--danger); animation: aiVoicePulse 1.2s ease-in-out infinite; }
.ai-mic-button .icon { width: 17px; height: 17px; }
.ai-send-button { width: 38px; height: 38px; }
.ai-disclaimer { margin: 8px 0 0; color: var(--ink-muted); font-size: 9.5px; text-align: center; }

.ai-voice-rail { position: absolute; right: 20px; bottom: 88px; z-index: 8; width: 250px; min-height: 0; padding: 14px; border: 1px solid var(--line); border-radius: 18px; background: rgb(255 255 255 / .96); box-shadow: 0 18px 46px rgb(0 0 0 / .13); display: none; }
.ai-conversation:has(.ai-voice-core[data-state="listening"]) .ai-voice-rail,
.ai-conversation:has(.ai-voice-core[data-state="thinking"]) .ai-voice-rail,
.ai-conversation:has(.ai-voice-core[data-state="speaking"]) .ai-voice-rail,
.ai-conversation:has(.ai-voice-core[data-state="error"]) .ai-voice-rail { display: flex; }
.ai-voice-core { width: 160px; margin: -10px 0 -22px; }
.ai-voice-status { margin: 0; }
.ai-voice-transcript { margin: 12px 0 0; min-height: 0; border: 0; background: var(--surface-subtle); }
.ai-voice-stop { position: absolute; top: 12px; right: 12px; width: 28px; height: 28px; border-radius: 50%; }

@media (max-width: 760px) {
  .content.content--assistant { padding: 0; }
  .ai-monitor-header { width: calc(100% - 24px); }
  .ai-chat-log { width: calc(100% - 28px); padding-top: 28px; }
  .ai-empty-state { min-height: 440px; }
  .ai-starter-grid { max-width: 330px; }
  .ai-starter-grid .suggestion { display: block; }
  .ai-composer { width: calc(100% - 20px); padding-bottom: calc(9px + env(safe-area-inset-bottom)); }
  .ai-prompt-wrap { gap: 2px; }
  .ai-composer-mark { width: 28px; flex: 0 0 28px; }
  .ai-model-picker > summary { max-width: 108px; padding: 0 7px; }
  .ai-model-picker > summary > span { max-width: 76px; }
  .ai-effort-picker > summary { width: 36px; padding: 0; justify-content: center; }
  .ai-effort-picker > summary span,
  .ai-effort-picker > summary .icon:last-child { display: none; }
  .ai-picker-menu { position: fixed; left: 10px; right: 10px; bottom: 80px; width: auto; }
  .ai-voice-rail { right: 10px; bottom: 84px; width: min(250px, calc(100% - 20px)); }
}
.admin-log-link { margin: 14px 4px; color: var(--ink-muted); font-size: 12px; }

/* Activity follows the same grouped event rhythm as Clouder alarm history. */
.activity-day > header { display: flex; align-items: center; justify-content: space-between; height: 40px; padding: 0 18px; background: var(--surface-subtle); border-bottom: 1px solid var(--line); color: var(--ink-secondary); font-size: 11px; }
.activity-day > header span { color: var(--ink-muted); }
.activity-event { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 74px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.activity-event-icon { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid currentColor; border-radius: 50%; color: var(--ink-muted); }
.activity-event-icon.badge--completed { color: var(--success); background: var(--success-soft); }
.activity-event-icon.badge--blocked { color: var(--danger); background: var(--danger-soft); }
.activity-event-icon.badge--review { color: var(--warning); background: var(--warning-soft); }
.activity-event-icon .icon { width: 17px; height: 17px; }
.activity-event-main { min-width: 0; font-size: 12px; }
.activity-event-note { margin-top: 3px; color: var(--ink-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity-event-links { margin-top: 3px; font-size: 11px; }
.activity-event-side { display: grid; justify-items: end; gap: 5px; }
.activity-event-side time { color: var(--ink-muted); font-size: 10px; }

/* Tracker: Full-bleed edge-to-edge map studio layout */
.content:has(.tracker-workspace),
.content.content--tracker {
  padding: 0 !important;
  max-width: none !important;
  margin: 0 !important;
  height: calc(100vh - var(--topbar-height, 58px)) !important;
  min-height: calc(100vh - var(--topbar-height, 58px)) !important;
  max-height: calc(100vh - var(--topbar-height, 58px)) !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
}

.tracker-workspace {
  display: flex !important;
  flex: 1 1 auto !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  position: relative !important;
}

.tracker-viewport-wrap {
  position: relative !important;
  flex: 1 1 auto !important;
  height: 100% !important;
  min-width: 0 !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

#tracker-map {
  width: 100% !important;
  height: 100% !important;
  min-height: 100% !important;
  border: none !important;
  border-radius: 0 !important;
  margin: 0 !important;
  z-index: 1 !important;
}

.planner-sidebar {
  width: 360px !important;
  flex: 0 0 360px !important;
  height: 100% !important;
  max-height: 100% !important;
  background: var(--surface) !important;
  border: none !important;
  border-left: 1px solid var(--line) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 18px 16px !important;
  box-sizing: border-box !important;
  overflow-y: auto !important;
  z-index: 10 !important;
}

.tech-nametag { border-radius: 6px !important; background: var(--ink) !important; font-family: var(--font) !important; text-transform: none !important; letter-spacing: 0 !important; }
.sim-pill { border-radius: 7px !important; background: rgb(17 17 17 / .9) !important; font-family: var(--font) !important; }
.map-telemetry-badge { display: inline-flex; align-items: center; gap: 5px; }
.map-telemetry-badge .icon, .planner-remove .icon { width: 14px; height: 14px; }
.planner-subtitle { text-transform: none !important; letter-spacing: 0 !important; }

/* Technician Tracker - Sleek Modern Tech Cards & Layout */
.tech-cards-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.planner-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.tech-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease, background 140ms ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  position: relative;
  text-align: left;
}

.tech-card:hover {
  border-color: var(--brand);
  background: #fbfdff;
  box-shadow: 0 4px 14px rgba(36, 88, 211, 0.09);
  transform: translateY(-1px);
}

.tech-card.is-active {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(36, 88, 211, 0.25);
  background: #f8fbff;
}

.tech-card:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.tech-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.tech-card-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.tech-avatar-box {
  position: relative;
  flex-shrink: 0;
}

.tech-avatar-box .avatar {
  width: 34px;
  height: 34px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 8px;
}

.tech-status-dot {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--surface);
}

.tech-status-dot.status-arrived { background: #22c55e; box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.3); }
.tech-status-dot.status-enroute { background: #f59e0b; box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.3); }
.tech-status-dot.status-idle { background: #64748b; }
.tech-status-dot.status-offline { background: #cbd5e1; }

.beacon-pulse-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: beaconPulse 2s infinite cubic-bezier(0.4, 0, 0.6, 1);
  flex-shrink: 0;
}

@keyframes beaconPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

.beacon-idle-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #94a3b8;
  flex-shrink: 0;
}

.tech-card-text {
  min-width: 0;
}

.tech-card-name {
  font-size: 13px;
  font-weight: 650;
  color: var(--ink);
  margin: 0;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tech-card-role {
  font-size: 11px;
  color: var(--ink-secondary);
  line-height: 1.25;
  margin-top: 2px;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tech-telemetry-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.telemetry-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px 6px;
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 550;
  color: var(--ink-secondary);
  font-family: var(--mono);
}

.telemetry-item .icon {
  width: 13px;
  height: 13px;
  stroke-width: 2;
  flex-shrink: 0;
}

.telemetry-item.battery-good { color: #166534; background: #f0fdf4; border-color: #bbf7d0; }
.telemetry-item.battery-warn { color: #854d0e; background: #fefce8; border-color: #fef08a; }
.telemetry-item.battery-low { color: #991b1b; background: #fef2f2; border-color: #fecaca; }

.tech-destination-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 6px 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
}

.tech-destination-target {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  color: var(--ink);
  font-weight: 550;
}

.tech-destination-target .icon {
  width: 13px;
  height: 13px;
  color: var(--brand);
  flex-shrink: 0;
}

.tech-destination-target span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 155px;
}

.tech-destination-eta {
  color: var(--ink-muted);
  font-size: 10.5px;
  flex-shrink: 0;
  font-family: var(--mono);
}

.tech-card-footer {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 1px;
}

.tech-card-footer .btn {
  flex: 1;
  min-height: 28px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 550;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.tech-card-footer .btn .icon {
  width: 13px;
  height: 13px;
}

.tech-btn-locate {
  background: white;
  border: 1px solid var(--line-strong);
  color: var(--ink);
}

.tech-btn-locate:hover {
  background: #f0f4f9;
  border-color: var(--brand);
  color: var(--brand);
}

.tech-btn-trail {
  border: 1px solid var(--line);
  color: var(--ink-secondary);
}

.tech-btn-trail:hover {
  background: #f0f4f9;
  color: var(--ink);
  border-color: var(--line-strong);
}

@media (max-width: 900px) {
  .project-drop > summary { grid-template-columns: 1fr auto; }
  .project-drop-count { display: none; }
  .project-task-header-row { display: none; }
  .project-task-item { grid-template-columns: 24px 26px minmax(0, 1fr) auto auto; }
  .project-task-meta { display: none; }
  .project-task-files { justify-content: flex-start; }
  .tracker-workspace { flex-direction: column !important; }
  .tracker-viewport-wrap { height: 50vh !important; }
  #tracker-map { height: 100% !important; min-height: 280px !important; }
  .planner-sidebar { width: 100% !important; flex: 1 1 auto !important; height: auto !important; max-height: 50vh !important; border-left: none !important; border-top: 1px solid var(--line) !important; }
}

@media (max-width: 700px) {
  :root { --sidebar-width: 0px; }
  .sidebar { top: 58px; }
  .topbar { justify-content: flex-end; }
  .topbar > .inline { margin-right: auto; }
  .breadcrumb { display: none; }
  .topbar-right { width: calc(100% - 42px); justify-content: flex-end; }
  #topbar-actions .btn:not(.btn--primary) { display: none; }
  .content { padding: 18px 12px 32px; }
  .project-drop > summary { grid-template-columns: minmax(0, 1fr); padding: 12px; }
  .project-drop > summary > .badge { display: none; }
  .project-drop-name { min-width: 0; }
  .project-drop-name strong, .project-drop-name small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .project-task-list { padding-left: 18px; padding-right: 12px; }
  .project-task-item { grid-template-columns: 24px 26px minmax(0, 1fr) auto; }
  .project-task-files { display: none; }
  .project-task-copy { max-width: 100%; }
  .demo-banner { align-items: flex-start !important; }
  .drawer .definition { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ai-model-bar { align-items: flex-start; flex-direction: column; }
  .chat-message--user { max-width: 90%; }
  .activity-event { grid-template-columns: 30px minmax(0, 1fr); padding: 12px; }
  .activity-event-side { grid-column: 2; justify-items: start; grid-auto-flow: column; align-items: center; }
}

/* -------------------------------------------------------------
   Technician Tracker: Saved Routes & Road Measurement Styles
   ------------------------------------------------------------- */
.tracker-measure-banner {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(15, 23, 42, 0.92);
  color: #fff;
  padding: 8px 16px;
  border-radius: 9999px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  font-size: 12px;
  pointer-events: auto;
  animation: bannerSlideDown 200ms ease-out;
}

@keyframes bannerSlideDown {
  from { opacity: 0; transform: translate(-50%, -10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.measure-banner-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.4);
  animation: pulseDot 1.4s infinite;
}

@keyframes pulseDot {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 8px rgba(59, 130, 246, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
}

.measure-banner-sub {
  color: #94a3b8;
  font-size: 11px;
}

.measure-cancel-btn {
  padding: 2px 8px !important;
  font-size: 11px !important;
  color: #cbd5e1 !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
  background: rgba(255, 255, 255, 0.08) !important;
}
.measure-cancel-btn:hover {
  background: rgba(255, 255, 255, 0.18) !important;
  color: #fff !important;
}

/* Saved Routes Panel & Cards */
.routes-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.routes-tip-box {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 11px;
  line-height: 1.4;
  margin-bottom: 12px;
}

.routes-cards-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.route-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: box-shadow 140ms ease, transform 140ms ease, border-color 140ms ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  position: relative;
}

.route-card:hover {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

.route-card.is-hidden {
  opacity: 0.55;
  background: #f8fafc;
}

.route-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.route-card-check-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.route-card-check-wrap input[type="checkbox"] {
  cursor: pointer;
  width: 16px;
  height: 16px;
  accent-color: var(--brand);
}

.route-card-title {
  font-size: 13px;
  font-weight: 600;
  color: #1b2432;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.route-card-delete-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.route-card-delete-btn:hover {
  color: #ef4444;
  background: #fee2e2;
}

.route-endpoints {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #475569;
}

.route-endpoint-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #f1f5f9;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 500;
  max-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.route-metrics-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.route-metric-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 500;
  color: #334155;
}

.route-remaining-box {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 500;
  width: 100%;
  box-sizing: border-box;
}

.route-remaining-box.arrived {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
}

.remaining-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2563eb;
  animation: pulseDot 1.6s infinite;
}

.route-remaining-box.arrived .remaining-live-dot {
  background: #16a34a;
  animation: none;
}

/* Color configuration chips */
.route-color-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px dashed #e2e8f0;
}

.route-color-label {
  font-size: 11px;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 4px;
}

.route-color-swatches {
  display: flex;
  align-items: center;
  gap: 5px;
}

.route-color-chip {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px #cbd5e1;
  cursor: pointer;
  padding: 0;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.route-color-chip:hover {
  transform: scale(1.2);
}

.route-color-chip.is-active {
  box-shadow: 0 0 0 2px #0f172a;
  transform: scale(1.15);
}

.route-color-native {
  width: 20px;
  height: 20px;
  border: none;
  padding: 0;
  border-radius: 4px;
  cursor: pointer;
  background: transparent;
}

.route-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
}

/* -------------------------------------------------------------
   Project Reordering Controls & Drag-Drop States
------------------------------------------------------------- */
.project-drop > summary {
  grid-template-columns: minmax(220px, 1fr) auto auto auto;
}

.project-reorder-controls {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 2px 4px;
  margin-left: 8px;
  cursor: default;
}

.btn-reorder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: none;
  background: transparent;
  color: #64748b;
  border-radius: 4px;
  cursor: pointer;
  padding: 0;
  font-size: 11px;
  transition: all 120ms ease;
}

.btn-reorder:hover:not(:disabled) {
  background: #e2e8f0;
  color: #0f172a;
}

.btn-reorder:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

.btn-reorder svg {
  width: 12px;
  height: 12px;
}

.project-drag-grip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 13px;
  letter-spacing: -1px;
  cursor: grab;
  padding: 0 4px;
  user-select: none;
}

.project-drag-grip:hover {
  color: #475569;
}

.project-drag-grip:active {
  cursor: grabbing;
}

.project-drop.is-dragging {
  opacity: 0.4;
  background: #f1f5f9;
  outline: 2px dashed #3b82f6;
}

.project-drop.drop-target-above {
  border-top: 3px solid #2563eb !important;
}

.project-drop.drop-target-below {
  border-bottom: 3px solid #2563eb !important;
}

/* -------------------------------------------------------------
   Custom Status Select with Corresponding SVGs
------------------------------------------------------------- */
.custom-select-wrap {
  position: relative;
  width: 100%;
  user-select: none;
}

.custom-select-trigger {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  color: var(--ink);
  cursor: pointer;
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
  box-sizing: border-box;
}

.custom-select-trigger:focus,
.custom-select-trigger.is-open {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}

.custom-select-value {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
}

.custom-select-chevron {
  color: #64748b;
  transition: transform 150ms ease;
  flex-shrink: 0;
}

.custom-select-trigger.is-open .custom-select-chevron {
  transform: rotate(180deg);
}

.custom-select-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 1050;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.12), 0 8px 10px -6px rgba(0, 0, 0, 0.08);
  padding: 4px;
  display: none;
  max-height: 250px;
  overflow-y: auto;
}

.custom-select-menu.is-open {
  display: block;
}

.custom-select-option {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: var(--ink);
  transition: background 100ms ease;
}

.custom-select-option:hover {
  background: #f1f5f9;
}

.custom-select-option.is-selected {
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 600;
}

.status-icon-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.status-icon-dot svg {
  width: 16px;
  height: 16px;
}

.status-icon-dot.status-to_do { color: #64748b; }
.status-icon-dot.status-in_progress { color: #2563eb; }
.status-icon-dot.status-blocked { color: #dc2626; }
.status-icon-dot.status-awaiting_review { color: #d97706; }
.status-icon-dot.status-completed { color: #16a34a; }

/* -------------------------------------------------------------
   Template Blueprint Workspace (Matching Projects Theme)
------------------------------------------------------------- */
.template-workspace {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.template-drop {
  border-bottom: 1px solid var(--line);
}

.template-drop:last-child {
  border-bottom: 0;
}

.template-drop > summary {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto auto;
  align-items: center;
  gap: 16px;
  min-height: 70px;
  padding: 14px 18px;
  cursor: pointer;
  list-style: none;
  background: #fff;
  transition: background 120ms ease;
}

.template-drop > summary:hover {
  background: #f8fafc;
}

.template-drop > summary::-webkit-details-marker {
  display: none;
}

.template-drop > summary::before {
  content: "›";
  grid-column: 1;
  position: absolute;
  font-size: 20px;
  color: var(--ink-muted);
  transform: translateX(-2px);
  transition: transform 120ms ease;
}

.template-drop[open] > summary::before {
  transform: translateX(-2px) rotate(90deg);
}

.template-drop-name {
  display: grid;
  gap: 3px;
  padding-left: 22px;
}

.template-drop-name strong {
  font-size: 15px;
  color: var(--ink);
}

.template-drop-name small {
  color: var(--ink-muted);
  font-size: 12px;
}

.template-task-table {
  background: #fcfdfe;
  border-top: 1px solid var(--line);
  padding: 0;
}

.template-task-header {
  display: grid;
  grid-template-columns: minmax(200px, 2fr) 1.5fr 1.5fr 1fr 90px;
  gap: 12px;
  align-items: center;
  padding: 10px 16px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.template-task-row {
  display: grid;
  grid-template-columns: minmax(200px, 2fr) 1.5fr 1.5fr 1fr 90px;
  gap: 12px;
  align-items: center;
  padding: 11px 16px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13px;
  background: #fff;
  transition: background 120ms ease;
}

.template-task-row:hover {
  background: #f8fafc;
}

.template-task-row:last-child {
  border-bottom: none;
}

.template-task-title-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  color: var(--ink);
}

.template-assignee-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  font-size: 12px;
  color: #334155;
}

.template-assignee-chip.is-unassigned {
  background: #fff;
  border-style: dashed;
  color: #94a3b8;
}

.template-assignee-avatar {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #2563eb;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.template-footer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
}

/* -------------------------------------------------------------
   Template Task List & Tree Dropdown Styling (Matching Projects)
   ------------------------------------------------------------- */
.template-task-list {
  position: relative;
  border-top: 1px solid var(--line);
  background: var(--surface-subtle);
  padding: 0 18px 12px 42px;
}

/* Continuous tree guide spine running straight down from template summary chevron */
.template-task-list::before {
  content: "";
  position: absolute;
  left: 20px;
  top: 0;
  bottom: 24px;
  width: 2px;
  background: #cbd5e1;
}

.template-task-header-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 150px 160px 80px;
  align-items: center;
  gap: 12px;
  padding: 10px 10px 6px 10px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ink-muted);
  border-bottom: 1px solid var(--line);
}

.template-task-card {
  position: relative;
  border-bottom: 1px solid var(--line);
}

.template-task-card:last-child {
  border-bottom: 0;
}

/* Horizontal branch elbow connector from spine into each task row */
.template-task-card::before {
  content: "";
  position: absolute;
  left: -22px;
  top: 26px;
  width: 16px;
  height: 2px;
  background: #cbd5e1;
}

.template-task-item {
  position: relative;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 150px 160px 80px;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 8px 10px;
  border-radius: 6px;
  transition: background 0.15s ease;
}

.template-task-item:hover {
  background: rgba(0, 0, 0, 0.02);
}

.template-tree-bullet {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 2px solid #94a3b8;
  background: #ffffff;
  display: block;
  margin: 0 auto;
  box-shadow: 0 0 0 2px var(--surface-subtle);
  transition: all 0.15s ease;
}

.template-task-item:hover .template-tree-bullet {
  border-color: #2563eb;
  background: #2563eb;
  transform: scale(1.15);
}

.template-task-list .project-add-task {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 12px 0 0;
  padding: 7px 10px;
  border: 0;
  background: transparent;
  color: var(--ink-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 4px;
  transition: color 0.15s ease, background 0.15s ease;
}

.template-task-list .project-add-task:hover {
  color: var(--ink);
  background: rgba(0, 0, 0, 0.04);
}

/* Branch elbow connector to Add task at the bottom of the tree */
.template-task-list .project-add-task::before {
  content: "";
  position: absolute;
  left: -22px;
  top: 50%;
  width: 16px;
  height: 2px;
  background: #cbd5e1;
}

/* -------------------------------------------------------------
   AI Assistant Markdown & Table Formatting
   ------------------------------------------------------------- */
.ai-table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 14px 0;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.ai-markdown-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  text-align: left;
}

.ai-markdown-table th {
  background: #f8fafc;
  color: #334155;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 10px 14px;
  border-bottom: 2px solid #e2e8f0;
  white-space: nowrap;
}

.ai-markdown-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
  vertical-align: middle;
}

.ai-markdown-table tbody tr:nth-child(even) {
  background: #fafbfc;
}

.ai-markdown-table tbody tr:hover {
  background: #f1f5f9;
}

.ai-markdown-table .link-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 4px;
  color: #1d4ed8;
  font-size: 11.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.ai-markdown-table .link-button:hover {
  background: #dbeafe;
  border-color: #93c5fd;
}

.ai-heading {
  margin: 16px 0 8px;
  color: var(--ink);
  font-weight: 700;
  line-height: 1.3;
}

.ai-h2 {
  font-size: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 6px;
}

.ai-h3 {
  font-size: 14.5px;
}

.ai-h4 {
  font-size: 13.5px;
}

.ai-h5 {
  font-size: 12.5px;
}

.ai-p {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink);
}

.ai-ul, .ai-ol {
  margin: 8px 0 12px;
  padding-left: 20px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink);
}

.ai-ul li, .ai-ol li {
  margin-bottom: 4px;
}

.ai-blockquote {
  margin: 12px 0;
  padding: 8px 14px;
  background: #f8fafc;
  border-left: 3px solid #3b82f6;
  border-radius: 0 6px 6px 0;
  color: #475569;
  font-size: 12.5px;
  line-height: 1.5;
}

.ai-code-block {
  margin: 12px 0;
  padding: 12px 14px;
  background: #0f172a;
  color: #f8fafc;
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 12px;
  overflow-x: auto;
  line-height: 1.45;
}

.ai-inline-code {
  padding: 2px 6px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 12px;
  color: #0f172a;
}

.ai-divider {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 18px 0;
}

/* =============================================================
   ACTION BUTTON LABELS & COMPACT ICON-ONLY MODE
   ============================================================= */
.action-label {
  display: inline;
}

.hide-action-labels .action-label {
  display: none !important;
}

/* Compact icon-only styles for task row file and audio chips */
.hide-action-labels .file-chip--add,
.hide-action-labels .file-chip--record {
  width: 26px;
  height: 26px;
  min-width: 26px;
  max-width: 26px;
  padding: 0;
  justify-content: center;
  gap: 0;
}

.hide-action-labels .file-chip--add .icon,
.hide-action-labels .file-chip--add svg,
.hide-action-labels .file-chip--record .icon,
.hide-action-labels .file-chip--record svg {
  margin: 0;
}

/* Compact icon-only styles for task tree updates composer */
.hide-action-labels .task-tree-tool-btn {
  width: 32px;
  height: 32px;
  min-height: 32px;
  min-width: 32px;
  max-width: 32px;
  padding: 0;
  justify-content: center;
  gap: 0;
}

.hide-action-labels .task-tree-tool-btn .icon,
.hide-action-labels .task-tree-tool-btn svg {
  margin: 0;
}

/* Task drawer action buttons */
.hide-action-labels .actions #record-btn,
.hide-action-labels .actions label.btn--small:has(input#attachment-input) {
  padding: 5px 8px;
}

/* =============================================================
   SETTINGS PAGE STYLING
   ============================================================= */
.workspace-settings {
  max-width: 800px;
  margin: 0;
  padding: 0 0 40px;
}

.settings-layout {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 16px;
}

.settings-panel {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.settings-panel-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 2px;
}

.settings-panel-body {
  padding: 22px;
}

.settings-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.settings-option-info {
  flex: 1;
}

.settings-option-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  margin-bottom: 4px;
}

.settings-option-desc {
  font-size: 12.5px;
  color: var(--ink-muted);
  line-height: 1.45;
  margin: 0;
}

/* Modern Accessible Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
  flex-shrink: 0;
  cursor: pointer;
}

.toggle-switch input[type="checkbox"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.toggle-slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--line-strong, #cbd5e1);
  border-radius: 26px;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.toggle-slider::before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: #ffffff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.toggle-switch input:checked + .toggle-slider {
  background-color: var(--primary, #2563eb);
}

.toggle-switch input:focus-visible + .toggle-slider {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.3);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

/* Settings Preview Card */
.settings-preview-card {
  margin-top: 22px;
  background: var(--surface-subtle, #f8fafc);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px 20px;
}

.settings-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.settings-preview-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.settings-preview-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 9999px;
  background: #e0e7ff;
  color: #3730a3;
  transition: all 0.15s ease;
}

.hide-action-labels .settings-preview-badge {
  background: #f1f5f9;
  color: #475569;
}

.settings-preview-subtext {
  font-size: 12px;
  margin-bottom: 16px;
}

.settings-preview-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.settings-preview-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 14px;
  background: var(--surface, #ffffff);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.settings-preview-row-label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-secondary);
}

.settings-preview-row-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-footer-info {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 2px;
}

.settings-save-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-muted);
  font-size: 12px;
}

.settings-save-pill svg {
  width: 14px;
  height: 14px;
  color: #10b981;
}

/* Tracker side panel: primary actions stay visible; configuration stays quiet. */
.planner-sidebar {
  padding: 0 !important;
  overflow-x: hidden !important;
}

.tracker-panel-tabs {
  position: sticky;
  top: 0;
  z-index: 3;
  gap: 4px;
  margin: 0 !important;
  padding: 10px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.tracker-panel-tabs .panel-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  margin: 0;
  padding: 7px 8px;
  border: 0;
  border-radius: 7px;
  color: var(--ink-muted);
  font-size: 12px;
}

.tracker-panel-tabs .panel-tab.active {
  border: 0;
  background: var(--ink);
  color: #fff;
}

.planner-tab-count {
  display: grid;
  place-items: center;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 10px;
  background: var(--surface-subtle);
  color: var(--ink-secondary);
  font-size: 10px;
}

.tracker-panel-tabs .active .planner-tab-count {
  background: rgb(255 255 255 / .18);
  color: #fff;
}

.planner-sidebar > .planner-section {
  margin: 0;
  padding: 16px;
}

.planner-section-header { margin-bottom: 12px; }
.planner-title { font-size: 14px; font-weight: 650; }
.planner-hint { margin: 6px 0 9px; }
.tracker-action-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

.tracker-options {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--ink-secondary);
}

.tracker-options > summary,
.route-style-options > summary {
  padding: 10px 2px 0;
  cursor: pointer;
  list-style: none;
  font-size: 11px;
  font-weight: 600;
}

.tracker-options > summary::-webkit-details-marker,
.route-style-options > summary::-webkit-details-marker { display: none; }
.tracker-options > summary::after,
.route-style-options > summary::after { content: "›"; float: right; color: var(--ink-muted); }
.tracker-options[open] > summary::after,
.route-style-options[open] > summary::after { transform: rotate(90deg); }
.tracker-options-body { display: grid; gap: 9px; padding: 10px 2px 2px; }
.tracker-option-field { display: grid; gap: 5px; font-size: 11px; color: var(--ink-muted); }

.mode-switch { margin-bottom: 8px; }
.tracker-search-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
.tracker-search-row .planner-error { grid-column: 1 / -1; }
.tracker-list-label { margin: 14px 0 5px; font-family: var(--font); font-size: 11px; font-weight: 600; }

.planner-row {
  align-items: center;
  min-height: 50px;
  padding: 8px 2px;
}
.planner-name { padding: 1px 3px; }

.tech-cards-list { gap: 0; margin: 0; border-top: 1px solid var(--line); }
.tech-card {
  gap: 7px;
  padding: 11px 2px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
}
.tech-card:hover,
.tech-card.is-active {
  transform: none;
  background: var(--surface-subtle);
  box-shadow: none;
}
.tech-avatar-box .avatar { width: 30px; height: 30px; border-radius: 50%; }
.tech-telemetry-strip { display: flex; gap: 14px; padding-left: 40px; }
.telemetry-item {
  justify-content: flex-start;
  padding: 0;
  border: 0;
  background: transparent !important;
  font-family: var(--font);
}
.tech-destination-box {
  padding: 0 0 0 40px;
  border: 0;
  background: transparent;
}
.tech-card-footer { padding-left: 40px; }
.tech-card-footer .btn { flex: 0 0 auto; }

.routes-panel-header { margin-bottom: 8px; }
.routes-cards-list { gap: 0; border-top: 1px solid var(--line); }
.route-card {
  gap: 7px;
  padding: 12px 2px 12px 10px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-left: 3px solid;
  border-radius: 0;
  box-shadow: none;
}
.route-card:hover { transform: none; box-shadow: none; background: var(--surface-subtle); }
.route-card-title { color: var(--ink); }
.route-endpoints { min-width: 0; gap: 5px; }
.route-endpoints > .icon { width: 13px; height: 13px; flex: 0 0 auto; color: var(--ink-muted); }
.route-endpoint-badge {
  min-width: 0;
  max-width: 130px;
  padding: 0;
  background: transparent;
  color: var(--ink-secondary);
}
.route-status-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.route-metric-pill { padding: 2px 6px; background: var(--surface-subtle); }
.route-remaining-box {
  width: auto;
  min-width: 0;
  padding: 3px 7px;
  border: 0;
  background: transparent;
  color: var(--ink-secondary);
}
.route-card-actions { justify-content: flex-start; }
.route-style-options { position: relative; margin-left: auto; }
.route-style-options > summary { padding: 5px 7px; border-radius: 6px; }
.route-style-options[open] .route-color-swatches {
  display: flex;
  position: absolute;
  right: 0;
  bottom: 30px;
  z-index: 4;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-popover);
}
.tracker-empty-state {
  display: grid;
  justify-items: start;
  gap: 6px;
  padding: 22px 2px;
  color: var(--ink-secondary);
}
.tracker-empty-state > .icon { width: 22px; height: 22px; color: var(--ink-muted); }
.tracker-empty-state > span { font-size: 11px; color: var(--ink-muted); }

@media (max-width: 900px) {
  .planner-sidebar > .planner-section { padding: 14px; }
  .tracker-panel-tabs { padding: 8px; }
}


/* Activity log distinct badge and icon colors */
.activity-event-icon.badge--progress { color: #0284c7; background: #e0f2fe; }
.activity-event-icon.badge--purple { color: #8b5cf6; background: #f3e8ff; }
.activity-event-icon.badge--teal { color: #0d9488; background: #ccfbf1; }
.activity-event-icon.badge--neutral { color: #64748b; background: #f1f5f9; }
.badge.badge--purple { color: #8b5cf6; background: #f3e8ff; border-color: rgba(139, 92, 246, 0.2); }
.badge.badge--teal { color: #0d9488; background: #ccfbf1; border-color: rgba(13, 148, 136, 0.2); }

/* Prevent horizontal scrollbar on dialogs, modals, and sidebar */
.dialog,
.modal,
.drawer,
#form-dialog,
#task-dialog {
  overflow-x: hidden !important;
  box-sizing: border-box !important;
}

.dialog-head,
.dialog-body,
.dialog-footer {
  max-width: 100% !important;
  box-sizing: border-box !important;
  overflow-x: hidden !important;
}

.field {
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

.field-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  gap: 16px !important;
  min-width: 0 !important;
  max-width: 100% !important;
}

.field select,
.field input,
.field textarea {
  min-width: 0 !important;
  max-width: 100% !important;
  width: 100% !important;
  box-sizing: border-box !important;
  text-overflow: ellipsis;
}

/* Sidebar horizontal scrollbar prevention */
.sidebar {
  overflow-x: hidden !important;
  max-width: var(--sidebar-width) !important;
  box-sizing: border-box !important;
}

.account-dock,
.account-pill-wrap,
.account-pill-select {
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* AI conversation: exact centered start state and dark chat surface. */
.content.content--assistant {
  padding: 0;
  background: #000;
  color: #f5f5f5;
}
.ai-monitor-shell {
  height: 100%;
  min-height: 0;
  background: #000;
  color: #f5f5f5;
}
.ai-monitor-header {
  width: 100%;
  min-height: 56px;
  padding: 0 28px;
  border-bottom: 1px solid #202020;
  background: #000;
  box-sizing: border-box;
}
.ai-chat-nav { display: flex; align-items: center; gap: 6px; min-width: 0; }
.ai-monitor-header .ai-picker > summary,
.ai-monitor-header .ai-header-button {
  color: #b6b6b6;
}
.ai-monitor-header .ai-picker > summary:hover,
.ai-monitor-header .ai-picker[open] > summary,
.ai-monitor-header .ai-header-button:hover {
  background: #212121;
  color: #fff;
}
.ai-monitor-header .ai-picker-menu {
  top: calc(100% + 8px);
  bottom: auto;
  left: 0;
  right: auto;
}
.ai-header-model-picker > summary { max-width: 180px; }
.ai-history-picker > summary { max-width: 260px; }
.ai-history-picker > summary > span,
.ai-header-model-picker > summary > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-history-menu { width: 310px; max-height: min(430px, calc(100vh - 100px)); overflow-y: auto; }
.ai-history-menu button { width: 100%; min-height: 48px; padding: 8px 10px; border: 0; border-radius: 12px; background: transparent; color: #f4f4f4; display: grid; grid-template-columns: 22px minmax(0, 1fr); align-items: center; gap: 8px; text-align: left; cursor: pointer; }
.ai-history-menu button:hover,
.ai-history-menu button.is-selected { background: #4a4a4a; }
.ai-history-menu button > .icon { width: 15px; height: 15px; color: #bbb; }
.ai-history-menu button > span { min-width: 0; display: grid; gap: 2px; }
.ai-history-menu button strong { overflow: hidden; color: #f4f4f4; font-size: 12px; font-weight: 520; text-overflow: ellipsis; white-space: nowrap; }
.ai-history-menu button small { color: #aaa; font-size: 10px; }
.ai-history-label { margin: 7px 8px 3px; color: #8d8d8d; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.ai-history-empty { margin: 4px 8px 8px; color: #989898; font-size: 11px; }
.ai-monitor-grid {
  flex: 1 1 auto;
  height: 100%;
  min-height: 0;
  background: var(--surface);
  display: flex;
  flex-direction: row;
  overflow: hidden;
  position: relative;
}
.ai-conversation {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  overflow: hidden;
}
.ai-conversation:not(.has-messages) .ai-chat-log { display: none; }
.ai-start-layout {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 24px 60px;
  box-sizing: border-box;
}
.ai-hero-title,
.ai-start-layout > h1 {
  margin: 0 0 28px;
  color: var(--ink);
  font-size: clamp(24px, 2.3vw, 32px);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.25;
  text-align: center;
}
.ai-start-layout .ai-composer {
  position: static;
  width: min(720px, 100%);
  padding: 0;
  background: transparent;
  transform: none;
}
.ai-start-layout .ai-prompt-wrap {
  min-height: 52px;
  padding: 6px 8px 6px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 28px;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.ai-start-layout .ai-prompt-wrap:focus-within {
  border-color: #007aff;
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.12);
}
.ai-conversation:not(.has-messages) .ai-disclaimer { display: none; }

/* Vertically stacked action suggestions directly beneath prompt bar (Image 1 reference) */
.ai-starter-list {
  width: min(720px, 100%);
  margin: 20px 0 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
}
.ai-starter-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: #475569;
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  width: auto;
  text-align: left;
}
.ai-starter-item:hover {
  background: var(--surface-subtle, #f1f5f9);
  color: var(--ink, #0f172a);
}
.ai-starter-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-muted, #64748b);
  width: 18px;
  height: 18px;
}
.ai-starter-icon .icon {
  width: 17px;
  height: 17px;
}
.ai-starter-text {
  line-height: 1.4;
}

/* Right-hand Recent Conversations Sidebar (ChatGPT light mode aesthetic) */
.ai-history-sidebar {
  width: 260px;
  min-width: 260px;
  max-width: 260px;
  height: 100%;
  border-left: 1px solid rgba(0, 0, 0, 0.08);
  background: #f9f9f9;
  display: flex;
  flex-direction: column;
  padding: 12px 10px 16px 10px;
  box-sizing: border-box;
  flex-shrink: 0;
  z-index: 10;
}
.ai-sidebar-top {
  margin-bottom: 8px;
  padding: 0 4px;
}
.ai-new-chat-btn {
  width: 100%;
  height: 38px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border-radius: 8px;
  border: none;
  background: #ececec;
  color: #0d0d0d;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: none;
  transition: background 0.15s ease;
  box-sizing: border-box;
}
.ai-new-chat-btn:hover {
  background: #e3e3e3;
  transform: none;
}
.ai-new-chat-btn:active {
  background: #dbdbdb;
}
.ai-new-chat-btn .icon {
  width: 17px;
  height: 17px;
  color: #0d0d0d;
  flex-shrink: 0;
}
.ai-recents-heading {
  font-size: 12px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: normal;
  color: #676767;
  padding: 14px 10px 6px;
  user-select: none;
}
.ai-recents-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 4px;
  scrollbar-width: thin;
  scrollbar-color: #c5c5c5 transparent;
}
.ai-recents-list::-webkit-scrollbar {
  width: 6px;
}
.ai-recents-list::-webkit-scrollbar-track {
  background: transparent;
}
.ai-recents-list::-webkit-scrollbar-thumb {
  background: #c5c5c5;
  border-radius: 999px;
}
.ai-recents-list::-webkit-scrollbar-thumb:hover {
  background: #a6a6a6;
}
.ai-recent-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 36px;
  min-height: 36px;
  border-radius: 8px;
  padding: 0 6px 0 10px;
  transition: background 0.12s ease;
  position: relative;
  cursor: pointer;
  box-sizing: border-box;
}
.ai-recent-row:hover {
  background: #ececec;
}
.ai-recent-row.is-active {
  background: #e3e3e3;
}
.ai-recent-link {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #0d0d0d;
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  height: 100%;
}
.ai-recent-title {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.4;
  color: #0d0d0d;
  font-size: 13.5px;
  font-weight: 400;
}
.ai-recent-row.is-active .ai-recent-title {
  font-weight: 500;
  color: #0d0d0d;
}
.ai-recent-del {
  display: none;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 0;
  background: transparent;
  color: #676767;
  border-radius: 6px;
  cursor: pointer;
  padding: 0;
  margin-left: 4px;
  flex-shrink: 0;
  transition: all 0.12s ease;
}
.ai-recent-row:hover .ai-recent-del {
  display: flex;
}
.ai-recent-del:hover {
  background: rgba(0, 0, 0, 0.08);
  color: #ef4444;
}
.ai-recent-del .icon {
  width: 14px;
  height: 14px;
}
.ai-recents-empty {
  color: #8e8ea0;
  font-size: 13px;
  padding: 12px 10px;
  font-style: normal;
}

.ai-conversation.has-messages .ai-start-layout { display: contents; }
.ai-conversation.has-messages .ai-start-layout > h1,
.ai-conversation.has-messages .ai-hero-title,
.ai-conversation.has-messages .ai-starter-list,
.ai-conversation.has-messages .ai-starter-grid { display: none; }
.ai-conversation.has-messages .ai-chat-log {
  width: min(760px, calc(100% - 40px));
  margin: 0 auto;
  padding: 36px 0 150px;
  color: var(--ink);
}
.ai-conversation.has-messages .ai-composer {
  position: absolute;
  left: 50%;
  bottom: 0;
  z-index: 5;
  width: min(760px, calc(100% - 40px));
  padding: 24px 0 12px;
  background: linear-gradient(to bottom, transparent, var(--surface) 25%);
  transform: translateX(-50%);
}
@media (max-width: 860px) {
  .ai-history-sidebar {
    display: none;
  }
}
.ai-conversation.has-messages .ai-prompt-wrap { background: #212121; border: 0; box-shadow: none; }
.ai-conversation.has-messages .ai-prompt-wrap textarea { color: #f5f5f5; caret-color: #fff; }
.ai-conversation.has-messages .ai-prompt-wrap textarea::placeholder { color: #aaa; }
.ai-conversation.has-messages .ai-composer-mark,
.ai-conversation.has-messages .ai-mic-button,
.ai-conversation.has-messages .ai-effort-picker > summary { color: #ddd; }
.ai-conversation.has-messages .ai-disclaimer { color: #888; }
.ai-conversation.has-messages .chat-message { color: #f2f2f2; }
.ai-conversation.has-messages .chat-message--user { background: #194f8f; color: #fff; }
.ai-conversation.has-messages .ai-message-role,
.ai-conversation.has-messages .ai-message-meta .ai-message-role { color: #aaa; }
.ai-conversation.has-messages .ai-heading,
.ai-conversation.has-messages .ai-p,
.ai-conversation.has-messages .ai-ul,
.ai-conversation.has-messages .ai-ol { color: #f3f3f3; }
.ai-conversation.has-messages .ai-table-wrap { border-color: #333; background: #111; }
.ai-conversation.has-messages .ai-markdown-table th { border-color: #333; background: #1d1d1d; color: #fff; }
.ai-conversation.has-messages .ai-markdown-table td { border-color: #2b2b2b; background: #111; color: #eee; }
.ai-voice-rail { border-color: #3b3b3b; background: #212121; color: #fff; }
.ai-voice-status strong { color: #fff; }
.ai-voice-status span { color: #aaa; }
.ai-voice-transcript { background: #2d2d2d; color: #ddd; }

@media (max-width: 760px) {
  .ai-monitor-header { padding: 0 12px; }
  .ai-history-picker > summary { max-width: 140px; }
  .ai-header-model-picker > summary { max-width: 115px; }
  .ai-header-model-picker > summary > span { max-width: 84px; }
  .ai-start-layout { padding: 0 16px 40px; }
  .ai-start-layout > h1 { margin-bottom: 26px; font-size: 24px; }
  .ai-start-layout .ai-composer { width: calc(100% - 20px); }
  .ai-starter-grid { width: calc(100% - 36px); margin-top: 24px; }
  .ai-starter-grid .suggestion { font-size: 13px; }
  .ai-effort-picker > summary span { display: inline; }
  .ai-effort-picker > summary .icon:last-child { display: block; }
  .ai-conversation.has-messages .ai-chat-log,
  .ai-conversation.has-messages .ai-composer { width: calc(100% - 20px); }
}

/* Light theme override for the AI monitor.  The reference interaction stays
   intact, while all conversation and picker surfaces use FieldWork's light UI. */
.content.content--assistant,
.ai-monitor-shell,
.ai-monitor-grid,
.ai-conversation { background: var(--surface); color: var(--ink); }
.ai-monitor-header { background: var(--surface); border-bottom-color: var(--line); }
.ai-monitor-header .ai-picker > summary,
.ai-monitor-header .ai-header-button { color: var(--ink-secondary); }
.ai-monitor-header .ai-picker > summary:hover,
.ai-monitor-header .ai-picker[open] > summary,
.ai-monitor-header .ai-header-button:hover { background: var(--surface-subtle); color: var(--ink); }
.ai-picker-menu {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 18px 46px rgb(15 23 42 / .16);
}
.ai-picker-title { color: var(--ink-muted); }
.ai-model-menu button,
.ai-history-menu button { color: var(--ink); }
.ai-model-menu button:hover,
.ai-model-menu button.is-selected,
.ai-history-menu button:hover,
.ai-history-menu button.is-selected { background: var(--surface-subtle); }
.ai-model-menu button strong,
.ai-history-menu button strong { color: var(--ink); }
.ai-model-menu button small,
.ai-history-menu button small { color: var(--ink-muted); }
.ai-model-menu button > .icon,
.ai-history-menu button > .icon { color: var(--ink-muted); }
.ai-history-label { color: var(--ink-muted); }
.ai-history-empty { color: var(--ink-muted); }
.ai-start-layout > h1 { color: var(--ink); }
.ai-start-layout .ai-prompt-wrap,
.ai-conversation.has-messages .ai-prompt-wrap { background: #ffffff; border: 1px solid #e2e8f0; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05); }
.ai-start-layout .ai-prompt-wrap:focus-within,
.ai-conversation.has-messages .ai-prompt-wrap:focus-within { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12); }
.ai-start-layout .ai-composer-mark,
.ai-conversation.has-messages .ai-composer-mark { color: var(--ink-secondary); }
.ai-start-layout .ai-prompt-wrap textarea,
.ai-conversation.has-messages .ai-prompt-wrap textarea { color: var(--ink); caret-color: var(--ink); }
.ai-start-layout .ai-prompt-wrap textarea::placeholder,
.ai-conversation.has-messages .ai-prompt-wrap textarea::placeholder { color: var(--ink-muted); }
.ai-start-layout .ai-effort-picker > summary,
.ai-conversation.has-messages .ai-effort-picker > summary,
.ai-start-layout .ai-mic-button,
.ai-conversation.has-messages .ai-mic-button { color: var(--ink-secondary); }
.ai-start-layout .ai-effort-picker > summary:hover,
.ai-start-layout .ai-effort-picker[open] > summary,
.ai-conversation.has-messages .ai-effort-picker > summary:hover,
.ai-conversation.has-messages .ai-effort-picker[open] > summary,
.ai-start-layout .ai-mic-button:hover,
.ai-conversation.has-messages .ai-mic-button:hover { background: #f1f5f9; color: var(--ink); }
.ai-starter-list { width: min(720px, 100%); margin: 18px 0 0; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.ai-starter-item { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 8px; border: none; background: transparent; color: #475569; font-size: 14px; font-weight: 400; cursor: pointer; transition: background 0.15s ease, color 0.15s ease; width: auto; text-align: left; }
.ai-starter-item:hover { background: var(--surface-subtle, #f1f5f9); color: var(--ink, #0f172a); }
.ai-starter-icon { display: flex; align-items: center; justify-content: center; color: var(--ink-muted, #64748b); width: 18px; height: 18px; }
.ai-starter-icon .icon { width: 17px; height: 17px; }
.ai-starter-text { line-height: 1.4; }
.ai-starter-grid .suggestion { color: var(--ink-secondary); }
.ai-starter-grid .suggestion:hover { background: var(--surface-subtle); color: var(--ink); }
.ai-starter-grid .suggestion .icon { color: var(--ink-muted); }
.ai-conversation.has-messages .chat-message { color: var(--ink); }
.ai-conversation.has-messages .chat-message--user { background: #e4efff; color: #183b69; }
.ai-conversation.has-messages .ai-message-role,
.ai-conversation.has-messages .ai-message-meta .ai-message-role { color: var(--ink-muted); }
.ai-conversation.has-messages .ai-heading,
.ai-conversation.has-messages .ai-p,
.ai-conversation.has-messages .ai-ul,
.ai-conversation.has-messages .ai-ol { color: var(--ink); }
.ai-conversation.has-messages .ai-table-wrap { border-color: var(--line); background: var(--surface); }
.ai-conversation.has-messages .ai-markdown-table th { border-color: var(--line); background: var(--surface-subtle); color: var(--ink); }
.ai-conversation.has-messages .ai-markdown-table td { border-color: var(--line); background: var(--surface); color: var(--ink-secondary); }
.ai-conversation.has-messages .ai-composer { background: linear-gradient(to bottom, transparent, var(--surface) 25%); }
.ai-conversation.has-messages .ai-disclaimer { color: var(--ink-muted); }
.ai-effort-menu { background: var(--surface); border-color: var(--line); }
.ai-effort-head > span { color: var(--ink-muted); }
.ai-effort-head strong { color: #147fe3; }
.ai-effort-menu > small { color: var(--ink-secondary); }
.ai-effort-scale { color: var(--ink-muted); }
.ai-voice-rail { border-color: var(--line); background: var(--surface); color: var(--ink); }
.ai-voice-status strong { color: var(--ink); }
.ai-voice-status span { color: var(--ink-muted); }
.ai-voice-transcript { background: var(--surface-subtle); color: var(--ink-secondary); }

/* ChatGPT-style effort control.  The surface remains light in FieldWork, but
   the control keeps the same compact pill, anchored popover, and slider rhythm
   as the reference interaction. */
.ai-composer-toolbar { gap: 5px; }
.ai-effort-picker > summary {
  width: auto;
  min-width: 0;
  box-sizing: border-box;
}
.ai-effort-picker > summary:hover,
.ai-effort-picker[open] > summary { background: #e2e8f0; color: var(--ink); }
.ai-effort-menu {
  width: 280px;
  padding: 13px 14px 12px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 14px 32px rgb(15 23 42 / .18);
  box-sizing: border-box;
}
.ai-effort-head {
  position: relative;
  min-height: 22px;
  padding-right: 22px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.ai-effort-head > span { width: 16px; height: 20px; }
.ai-effort-head .icon { width: 16px; height: 16px; }
.ai-effort-head strong { color: #168cff; font-size: 16px; line-height: 1.1; }
.ai-effort-reset {
  position: absolute;
  top: 1px;
  right: 0;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-muted);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.ai-effort-reset:hover { background: var(--surface-subtle); color: var(--ink); }
.ai-effort-reset .icon { width: 15px; height: 15px; }
.ai-effort-menu > small {
  margin: 3px 0 10px 24px;
  color: var(--ink-secondary);
  font-size: 11px;
  line-height: 1.2;
}
.ai-effort-menu input[type="range"] {
  width: 100%;
  height: 24px;
  margin: 0;
  padding: 0;
  accent-color: #168cff;
  background: transparent;
  box-shadow: none;
}
.ai-effort-scale {
  padding: 0 2px;
  color: var(--ink-muted);
  font-size: 10px;
  line-height: 1;
}
.ai-mic-button { width: 36px; height: 36px; }
.ai-send-button { width: 38px; height: 38px; border-radius: 50%; background: #2f79dc; }

/* The model menu mirrors the same restrained picker proportions. */
.ai-model-menu { width: 280px; padding: 10px; border-radius: 20px; }
.ai-model-menu button { min-height: 43px; border-radius: 10px; }
.ai-model-menu button strong { font-size: 13px; }
.ai-model-menu button small { font-size: 10px; }
.ai-model-menu button.is-selected { background: var(--surface-subtle); }

@media (max-width: 760px) {
  .ai-effort-picker > summary {
    width: 150px;
    min-width: 150px;
    padding-inline: 12px;
  }
  .ai-effort-picker > summary span { display: inline; }
  .ai-effort-picker > summary .icon:last-child { display: block; }
  .ai-effort-menu { width: min(280px, calc(100vw - 20px)); }
}

/* Final geometry pass for the effort popover reference. */
.ai-effort-menu { height: 98px; }
.ai-effort-head {
  height: 22px;
  min-height: 22px;
  padding: 0;
  justify-content: center;
}
.ai-effort-head > .ai-effort-symbol {
  position: absolute;
  left: 0;
  width: 16px;
  height: 20px;
  color: var(--ink-muted);
  display: grid;
  place-items: center;
}
.ai-effort-head > .ai-effort-value {
  width: auto;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
}
.ai-effort-value strong { color: #168cff; font-size: 16px; line-height: 1; }
.ai-effort-value .icon { width: 12px; height: 12px; color: var(--ink-muted); }
.ai-effort-menu > small {
  margin: 2px 0 9px;
  color: var(--ink-secondary);
  font-size: 11px;
  line-height: 1.1;
  text-align: center;
}
.ai-effort-menu input[type="range"] {
  appearance: none;
  -webkit-appearance: none;
  height: 24px;
  margin: 0;
  background: transparent;
  cursor: pointer;
}
.ai-effort-menu input[type="range"]::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 99px;
  background: linear-gradient(to right, #168cff 0 var(--effort-progress, 50%), #d8d8d8 var(--effort-progress, 50%) 100%);
}
.ai-effort-menu input[type="range"]::-webkit-slider-thumb {
  width: 28px;
  height: 28px;
  margin-top: -10px;
  border: 1px solid #e5e5e5;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgb(15 23 42 / .15);
  -webkit-appearance: none;
}
.ai-effort-menu input[type="range"]::-moz-range-track {
  height: 8px;
  border-radius: 99px;
  background: #d8d8d8;
}
.ai-effort-menu input[type="range"]::-moz-range-progress {
  height: 8px;
  border-radius: 99px;
  background: #168cff;
}
.ai-effort-menu input[type="range"]::-moz-range-thumb {
  width: 28px;
  height: 28px;
  border: 1px solid #e5e5e5;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgb(15 23 42 / .15);
}
.ai-effort-scale { display: none; }

/* Pasted GPT-6 Astra control, adapted to the light FieldWork surface. */
/* Compact Effort / Model Pill in Composer Toolbar */
.ai-effort-picker {
  position: relative;
  flex: 0 0 auto;
}
.ai-effort-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 10px;
  border-radius: 17px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #334155;
  font-size: 12.5px;
  font-weight: 550;
  cursor: pointer;
  list-style: none;
  box-sizing: border-box;
  user-select: none;
  white-space: nowrap;
}
.ai-effort-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: #f4f4f4;
  border: none;
  color: #555555;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
  box-sizing: border-box;
  transition: background 0.15s ease, color 0.15s ease;
  user-select: none;
  white-space: nowrap;
}
.ai-effort-pill-btn::-webkit-details-marker { display: none; }
.ai-effort-pill-btn:hover,
.ai-effort-picker[open] > .ai-effort-pill-btn {
  background: #eaeaea;
  color: #111111;
}
.ai-effort-pill-label {
  font-size: 13px;
  font-weight: 500;
  color: inherit;
}
.ai-effort-pill-chevron {
  display: inline-flex;
  align-items: center;
  color: #737373;
  margin-left: 1px;
}
.ai-effort-pill-chevron .icon { width: 12px; height: 12px; }

/* Clean Minimal Popover Card (Matches Image 1) */
.ai-effort-popover-menu {
  position: absolute;
  bottom: calc(100% + 12px);
  right: 20px;
  width: 210px;
  padding: 16px 16px 18px;
  border-radius: 16px;
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.05);
  box-sizing: border-box;
  z-index: 1000;
}

/* In start layout (with whitespace below), open downward */
.ai-start-layout:not(.has-messages) .ai-effort-popover-menu {
  top: calc(100% + 10px);
  bottom: auto;
}

/* When chatting, open upwards above the input box */
.ai-conversation.has-messages .ai-effort-popover-menu,
.has-messages .ai-effort-popover-menu {
  bottom: calc(100% + 12px) !important;
  top: auto !important;
}

.ai-popover-tier-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 15px;
  font-weight: 600;
  color: #0d0d0d;
  line-height: 1.2;
  margin-bottom: 14px;
}
.ai-popover-arrow {
  color: #8e8ea0;
  font-weight: 400;
  font-size: 14px;
}

/* Slider matching Image 1: blue fill, white round thumb, grey track with dots */
.ai-control-slider {
  position: relative;
  width: 100%;
  height: 24px;
  border-radius: 999px;
  background: #ebebeb;
  touch-action: none;
  box-sizing: border-box;
}

.ai-control-slider-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 50%;
  border-radius: 999px 0 0 999px;
  background: #007aff;
  transition: width 0.15s ease;
  pointer-events: none;
  z-index: 1;
}

.ai-control-slider-dot {
  position: absolute;
  top: 50%;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #b0b0b0;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 2;
}
.ai-control-slider-dot.is-reached {
  background: #007aff;
}

.ai-control-slider-knob {
  position: absolute;
  top: 50%;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.22);
  transform: translate(-50%, -50%);
  transition: left 0.15s ease;
  pointer-events: none;
  z-index: 3;
}

.ai-effort-range-input {
  position: absolute;
  inset: 0;
  z-index: 4;
  width: 100%;
  height: 100%;
  min-height: 0 !important;
  margin: 0;
  padding: 0 !important;
  border: 0 !important;
  opacity: 0;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

/* Prompt Controls Layout */
.ai-prompt-main-controls {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 8px;
}
.ai-prompt-wrap.is-transcribing .ai-prompt-main-controls {
  display: none !important;
}

/* Mic & Send Buttons */
.ai-mic-button {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: #555555;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease, color 0.15s ease;
}
.ai-mic-button:hover {
  background: #f1f5f9;
  color: #0f172a;
}
.ai-mic-button .icon {
  width: 18px;
  height: 18px;
}

.ai-send-button {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: #007aff;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.9);
  transition: opacity 0.15s ease, transform 0.15s ease, background 0.15s ease;
  box-shadow: 0 2px 6px rgba(0, 122, 255, 0.3);
}
.ai-send-button:hover {
  background: #0062cc;
}
.ai-send-button .icon {
  width: 15px;
  height: 15px;
}
.ai-prompt-wrap.has-input .ai-send-button {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

/* Voice Transcriber Mode (ChatGPT Pixel-Perfect Match) */
.ai-prompt-wrap.is-transcribing {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.12) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05) !important;
  border-radius: 9999px !important;
  min-height: 54px !important;
  height: 54px !important;
  padding: 0 8px 0 10px !important;
  box-sizing: border-box !important;
  outline: none !important;
}
.ai-start-layout .ai-prompt-wrap.is-transcribing:focus-within,
.ai-conversation.has-messages .ai-prompt-wrap.is-transcribing:focus-within {
  border-color: rgba(0, 0, 0, 0.12) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05) !important;
}

.ai-transcriber-wrap {
  display: none;
  align-items: center;
  width: 100%;
  height: 100%;
  gap: 0;
  box-sizing: border-box;
}
.ai-prompt-wrap.is-transcribing .ai-transcriber-wrap {
  display: flex !important;
}

.ai-transcriber-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: #ffffff;
  color: #202124;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
  padding: 0;
}
.ai-transcriber-close:hover {
  background: #f7f7f8;
  border-color: rgba(0, 0, 0, 0.2);
}
.ai-transcriber-close .icon {
  width: 13px;
  height: 13px;
  stroke-width: 2.2px;
}

.ai-transcriber-center {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  height: 100%;
  margin: 0 12px;
  overflow: hidden;
}

.ai-transcriber-track {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 10px;
  height: 100%;
}

.ai-transcriber-dots {
  flex: 1 1 auto;
  height: 2px;
  background: radial-gradient(circle, #c4c7c5 1.2px, transparent 1.6px) repeat-x;
  background-size: 7px 2px;
}

.ai-transcriber-wave {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 32px;
  flex-shrink: 0;
}
.ai-transcriber-wave span {
  display: inline-block;
  width: 2px;
  min-height: 3px;
  height: 6px;
  border-radius: 1px;
  background: #5f6368;
  transition: height 0.05s ease, opacity 0.05s ease;
}

.ai-transcriber-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-right: 2px;
}

.ai-transcriber-stop {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: #ffffff;
  color: #0d0d0d;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
  padding: 0;
}
.ai-transcriber-stop:hover {
  background: #f7f7f8;
  border-color: rgba(0, 0, 0, 0.2);
}
.ai-transcriber-stop .icon {
  width: 11px;
  height: 11px;
}

.ai-transcriber-send {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: #007aff;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
  box-shadow: 0 1px 4px rgba(0, 122, 255, 0.25);
  padding: 0;
}
.ai-transcriber-send:hover {
  background: #0066d6;
}
.ai-transcriber-send .icon {
  width: 16px;
  height: 16px;
  stroke-width: 2.4px;
}

/* Pulse highlight animation for tasks */
@keyframes taskCardPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(22, 140, 255, 0.8);
  }
  40% {
    box-shadow: 0 0 0 6px rgba(22, 140, 255, 0.3);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(22, 140, 255, 0);
  }
}
.project-task-card.task-card--highlighted {
  animation: taskCardPulse 1.6s ease-in-out 3;
  outline: 2px solid #0084ff;
  outline-offset: 2px;
  border-radius: 12px;
}

@media (max-width: 760px) {
  .ai-effort-popover-menu { width: min(290px, calc(100vw - 24px)); right: -20px; }
}

/* -------------------------------------------------------------
   File Manager Panel Styling
------------------------------------------------------------- */
.file-badge--pdf { color: #dc2626; background: #fef2f2; border-color: #fca5a5; }
.file-badge--sheet { color: #16a34a; background: #f0fdf4; border-color: #86efac; }
.file-badge--doc { color: #2563eb; background: #eff6ff; border-color: #93c5fd; }
.file-badge--image { color: #d97706; background: #fffbeb; border-color: #fcd34d; }
.file-badge--audio { color: #7c3aed; background: #f5f3ff; border-color: #c4b5fd; }
.file-badge--neutral { color: #475569; background: #f1f5f9; border-color: #cbd5e1; }

.activity-event-icon.file-badge--pdf { color: #dc2626; background: #fef2f2; border-color: #fca5a5; }
.activity-event-icon.file-badge--sheet { color: #16a34a; background: #f0fdf4; border-color: #86efac; }
.activity-event-icon.file-badge--doc { color: #2563eb; background: #eff6ff; border-color: #93c5fd; }
.activity-event-icon.file-badge--image { color: #d97706; background: #fffbeb; border-color: #fcd34d; }
.activity-event-icon.file-badge--audio { color: #7c3aed; background: #f5f3ff; border-color: #c4b5fd; }
.activity-event-icon.file-badge--neutral { color: #64748b; background: #f8fafc; border-color: #cbd5e1; }

.file-row {
  transition: background-color 0.12s ease;
}
.file-row:hover {
  background-color: var(--surface-subtle, #f8fafc);
}
.file-row .activity-event-main strong {
  font-size: 13px;
  color: var(--ink, #0f172a);
}
.file-download-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  text-decoration: none;
}
.file-audio-player {
  height: 28px;
  max-width: 280px;
  margin-top: 6px;
  display: block;
}

/* ---- Settings: theme segmented control, meta rows, actions ---- */
.settings-option-col { display: flex; flex-direction: column; gap: 10px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.settings-option-col:first-child { padding-top: 0; }
.seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.seg-btn { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line-strong); background: var(--surface); border-radius: 8px; padding: 10px 12px; cursor: pointer; text-align: left; color: var(--ink); }
.seg-btn:hover { background: var(--surface-subtle); }
.seg-btn.is-active { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.seg-btn strong { display: block; font-size: var(--text-sm); }
.seg-btn small { display: block; font-size: 11px; color: var(--ink-muted); font-weight: 400; }
.seg-dot { width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0; border: 1px solid var(--line-strong); }
.seg-dot-light { background: linear-gradient(135deg, #fff 60%, #f0f2f5 60%); }
.seg-dot-dark { background: linear-gradient(135deg, #111b21 60%, #1f2c34 60%); }
.seg-dot-system { background: linear-gradient(135deg, #fff 50%, #111b21 50%); }
.settings-select { min-height: 38px; border-radius: 6px; }
.settings-meta { display: flex; flex-direction: column; margin: 0 0 14px; }
.settings-meta > div { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: var(--text-sm); }
.settings-meta > div:last-child { border-bottom: 0; }
.settings-meta dt { color: var(--ink-muted); }
.settings-meta dd { margin: 0; font-weight: 600; text-align: right; }
.settings-actions { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 700px) { .seg { grid-template-columns: 1fr; } }
