:root{--bg:#0b1020;--panel:#111a33;--text:#e8edff;--muted:#9aa8cf;--line:#24345f;--font-ui:'Helvetica Neue','HelveticaNeue',Helvetica,Arial,sans-serif;--font-code:'JetBrains Mono','SF Mono',Menlo,Consolas,'Liberation Mono',monospace;--font-weight-base:300}*{box-sizing:border-box}html,body{width:100%;max-width:100%;overflow-x:hidden}body{margin:0;background:#0a1022;color:var(--text);font-family:var(--font-ui);font-weight:var(--font-weight-base);letter-spacing:.005em;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}strong,b,h1,h2,h3,h4,h5,h6{font-weight:600}code,pre,.md-code,.md-table,kbd,samp,tt,.doc-notes-textarea{font-family:var(--font-code)}.light{--bg:#f4f7ff;--panel:#ffffff;--text:#0b1b3f;--muted:#51607f;--line:#cdd8f0;background:#edf2ff;}
.canvas-app{height:100vh;width:100%;display:flex;flex-direction:column}
/* Project tabs always get their own full-width row beneath the action
   buttons (order:10 + 100% basis forces a line break). Previously the tab
   strip was the only flexible item in a single-row toolbar, so a crowded
   toolbar (many icons + the credits pill) shrank it to ZERO width and the
   project tabs vanished entirely. A dedicated row guarantees they're always
   visible and scrollable at every window size. */
.tabbar-area{display:flex;align-items:center;order:10;flex:1 1 100%;width:100%;min-width:0;gap:.2rem;padding-top:.3rem;border-top:1px solid var(--line)}
/* On wide screens (>=1440px) there's genuine room, so keep the tabs inline
   beside the action buttons (no dedicated row). The min-width floor means
   they still can't be squeezed to zero the way they were before. */
@media (min-width:1440px){
  .tabbar-area{order:0;flex:1 1 auto;width:auto;min-width:180px;padding-top:0;border-top:none}
}
/* Doc view shows a single project, so the project tabs bar is redundant there —
   hide it to declutter and reclaim vertical space. */
body.view-doc .tabbar-area{display:none}
/* Mobile/narrow Map view: let the user collapse the tabs row (toggle button in
   the toolbar) to reclaim vertical space. */
@media (max-width:1100px){
  body.tabbar-collapsed .tabbar-area{display:none}
}
#tabbarToggleBtn.active{background:rgba(168,85,247,.18);color:#d8b4fe}
.light #tabbarToggleBtn.active{background:rgba(168,85,247,.12);color:#7c3aed}
.tabbar{display:flex;gap:.3rem;overflow-x:auto;overflow-y:hidden;white-space:nowrap;flex:1;min-width:0;scrollbar-width:none;-ms-overflow-style:none;scroll-behavior:smooth}
.tabbar::-webkit-scrollbar{display:none}
.tabbar-scroll{flex:0 0 auto;width:26px;height:30px;border:1px solid transparent;background:rgba(99,131,236,.1);color:#a8b3d4;border-radius:7px;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;padding:0;font-family:inherit;transition:background .12s,color .12s,opacity .12s}
.tabbar-scroll:hover{background:rgba(99,131,236,.22);color:#f3f6ff}
.tabbar-scroll svg{width:14px;height:14px;display:block}
.tabbar-scroll[hidden]{display:none}
.light .tabbar-scroll{background:#eef2ff;color:#475569}
.light .tabbar-scroll:hover{background:#dbeafe;color:#0f172a}.tab{padding:.4rem .65rem .4rem .8rem;border-radius:9px;border:1px solid transparent;background:transparent;color:#a8b3d4;cursor:pointer;font-size:.85rem;font-weight:500;letter-spacing:.005em;transition:background .12s,color .12s,border-color .12s}.tab:hover{background:rgba(99,131,236,.1);color:#dbe5ff}.light .tab{color:#64748b}.light .tab:hover{background:rgba(99,131,236,.08);color:#0f172a}
.map-layout{display:grid;grid-template-columns:1fr 280px;height:calc(100vh - 50px);position:relative}.fullh{height:100%}.map-viewport{position:relative;overflow:hidden;background-image:linear-gradient(rgba(255,255,255,.05) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.05) 1px,transparent 1px);background-size:20px 20px;touch-action:none;-ms-touch-action:none;user-select:none;-webkit-user-select:none}
.map-svg{position:absolute;inset:0;width:100%;height:100%}
.map-node{position:absolute;width:300px;background:linear-gradient(180deg,rgba(28,34,62,.92),rgba(20,25,48,.92));color:#e6ecff;border:1.5px solid rgba(99,131,236,.4);border-radius:18px;padding:.85rem 1rem;cursor:grab;box-shadow:0 6px 22px rgba(0,8,40,.55),inset 0 1px 0 rgba(255,255,255,.04)}
.map-node:hover{border-color:rgba(99,131,236,.7)}
.map-node.subtask{width:300px;padding:.7rem .9rem;border-width:1.5px;font-size:.95rem;cursor:default}
.map-node.subtask .badge{min-width:36px;height:36px;font-size:.85rem}
.node-head{display:flex;gap:.75rem;align-items:center}
.node-head strong{flex:1;font-weight:700;font-size:1rem;line-height:1.3;color:#f3f6ff}
.badge{min-width:40px;height:40px;border-radius:99px;background:linear-gradient(135deg,#3b82f6,#2563eb);color:#fff;display:inline-flex;align-items:center;justify-content:center;font-size:.95rem;font-weight:800;flex-shrink:0;box-shadow:0 4px 14px rgba(37,99,235,.4)}
.badge.project{background:linear-gradient(135deg,#475569,#334155)}
.node-assignee{font-size:.82rem;color:#a8b3d4;margin-top:.35rem;font-weight:500;display:flex;align-items:center;gap:.35rem}
.node-recurrence{display:inline-flex;align-items:center;gap:.25rem;margin-top:.3rem;padding:.12rem .45rem;border-radius:99px;background:rgba(168,85,247,.18);border:1px solid rgba(168,85,247,.42);color:#d8b4fe;font-size:.72rem;font-weight:600;letter-spacing:.01em;width:fit-content}
.light .node-recurrence{background:#f5f3ff;border-color:#ddd6fe;color:#6d28d9}
.map-node.parent{width:340px;background:linear-gradient(180deg,rgba(54,32,98,.92),rgba(35,22,72,.95));border:1.5px solid rgba(168,85,247,.55);border-radius:20px;padding:1rem 1.1rem;box-shadow:0 0 0 1px rgba(168,85,247,.25),0 10px 38px rgba(120,60,220,.32),inset 0 1px 0 rgba(255,255,255,.04)}
.map-node.parent strong{font-size:1.18rem;font-weight:800}
.map-node.parent .badge{min-width:46px;height:46px;font-size:1.05rem;background:linear-gradient(135deg,#a855f7,#7c3aed);box-shadow:0 6px 18px rgba(168,85,247,.5)}
.map-node.parent .parent-tag{display:inline-flex;align-items:center;gap:.35rem;margin-top:.45rem;padding:.28rem .7rem;font-size:.7rem;font-weight:700;color:#d8c2ff;background:rgba(168,85,247,.18);border:1px solid rgba(168,85,247,.45);border-radius:99px;letter-spacing:.08em;text-transform:uppercase}
.light .map-node{background:linear-gradient(180deg,#ffffff,#f3f6ff)!important;color:#0b1b3f!important;border-color:rgba(59,130,246,.45)!important;box-shadow:0 4px 16px rgba(15,23,60,.12),inset 0 1px 0 rgba(255,255,255,.5)!important}
.light .map-node:hover{border-color:rgba(59,130,246,.7)!important}
.light .map-node .node-head strong, .light .map-node strong{color:#0b1b3f!important}
.light .map-node.subtask{color:#0b1b3f!important;background:linear-gradient(180deg,#ffffff,#eef2ff)!important}
.light .map-node.parent{background:linear-gradient(180deg,#faf5ff,#ede9fe)!important;color:#1e1b4b!important;border-color:rgba(168,85,247,.5)!important;box-shadow:0 0 0 1px rgba(168,85,247,.18),0 8px 22px rgba(120,60,220,.18),inset 0 1px 0 rgba(255,255,255,.6)!important}
.light .map-node.parent strong{color:#1e1b4b!important}
.light .map-node.parent .parent-tag{color:#5b21b6!important;background:rgba(168,85,247,.16)!important;border-color:rgba(168,85,247,.35)!important}
.light .node-assignee{color:#475569!important}
.light .map-node.pending{box-shadow:inset 5px 0 0 #f59e0b,0 4px 16px rgba(15,23,60,.12),0 0 18px rgba(245,158,11,.18)!important}
.light .map-node.uncompleted{box-shadow:inset 5px 0 0 #ef4444,0 4px 16px rgba(15,23,60,.12),0 0 18px rgba(239,68,68,.16)!important}
.light .map-node.completed{box-shadow:inset 5px 0 0 #22c55e,0 4px 16px rgba(15,23,60,.12),0 0 18px rgba(34,197,94,.16)!important}
.light .doc-view{background:#f6f8ff;color:#0f172a}
.light .doc-section, .light .doc-step, .light .doc-cmp-card, .light .doc-flow-step, .light .doc-plan-step, .light .doc-issue-row, .light .doc-issue-card, .light .doc-side-card{color:#0f172a}
.light .doc-section-body, .light .doc-step-body, .light .doc-cmp-notes, .light .doc-flow-notes, .light .doc-issue-row-body, .light .doc-issue-body{color:#1e293b}
.light .doc-section-body .md-h, .light .doc-step-body .md-h{color:#0f172a}
.light .doc-section-body .md-p, .light .doc-step-body .md-p, .light .doc-section-body .md-list li, .light .doc-step-body .md-list li{color:#1e293b}
.light .doc-editable, .light .doc-editable:focus{color:#0f172a}
.light .doc-notes-empty{color:#64748b}
.light .doc-notes-rendered{color:#1e293b}
.light .doc-status-bar{color:#1e293b}
.light .doc-status-item{color:#334155}
.light .doc-status-item strong{color:#0f172a}
.light .doc-title-row h1{color:#0f172a}
.light .doc-status-bar{background:#fff;border-color:#e2e8f0;color:#475569}
.light .doc-status-item strong{color:#0f172a}
.light .doc-section{background:linear-gradient(180deg,#ffffff,#f3f6ff);border-color:#e2e8f0;color:#0f172a;box-shadow:0 4px 14px rgba(15,23,60,.08)}
.light .doc-section-title h2{color:#0f172a}
.light .doc-section-meta{color:#64748b}
.light .doc-section-body{color:#334155}
.light .doc-section-body .md-h{color:#0f172a}
.light .doc-section-body .md-code, .light .doc-step-body .md-code{background:#0f172a;color:#e2e8f0;border-color:#1e293b}
.light .doc-section-body .md-table th, .light .doc-step-body .md-table th{background:#f1f5f9;color:#0f172a;border-color:#cbd5e1}
.light .doc-section-body .md-table td, .light .doc-step-body .md-table td{color:#334155;border-color:#e2e8f0}
.light .doc-section-body code, .light .doc-step-body code{background:#e2e8f0;color:#0f172a}
.light .doc-step{background:#f8fafc;border-color:#e2e8f0}
.light .doc-step-head strong{color:#0f172a}
.light .doc-step-body{color:#475569}
.light .doc-side-card{background:#ffffff;border-color:#e2e8f0;color:#0f172a}
.light .doc-side-card h3{color:#0f172a}
.light .doc-side-row{color:#475569;border-color:#e2e8f0}
.light .doc-side-row strong{color:#0f172a}
.light .doc-issue-card{background:#fff5f5;border-color:#fecaca}
.light .doc-issue-card strong{color:#991b1b}
.light .doc-issue-body{color:#334155}
.light .doc-empty{color:#64748b}
.light .doc-map-shell{color:#0f172a}
.light .doc-map-head h4{color:#0f172a}
.light .doc-map-project{color:#5b21b6;background:rgba(168,85,247,.10);border-color:rgba(168,85,247,.30)}
.light .doc-map-divider{color:#64748b;border-color:#e2e8f0}
.light .doc-map-link{color:#334155}
.light .doc-map-link:hover{background:rgba(59,130,246,.08);color:#0f172a;border-color:rgba(59,130,246,.30)}
.light .doc-map-link.active{background:rgba(168,85,247,.10);color:#1e1b4b;border-color:rgba(168,85,247,.45)}
.light .doc-map-count{color:#475569;background:rgba(99,131,236,.10);border-color:rgba(99,131,236,.25)}.map-node.selected{border-color:#f59e0b;border-width:3px;box-shadow:0 0 0 10px rgba(245,158,11,.55),0 0 32px rgba(245,158,11,.4)}.node-head{display:flex;gap:.5rem;align-items:center}.badge{min-width:22px;height:22px;border-radius:99px;background:#2563eb;color:#fff;display:inline-flex;align-items:center;justify-content:center;font-size:.72rem;flex-shrink:0}.badge.project{background:#334155}.badge.subtask{background:#7c3aed}
.map-node.pending{border-color:rgba(245,158,11,.6);box-shadow:inset 5px 0 0 #f59e0b,0 6px 22px rgba(0,8,40,.55),0 0 22px rgba(245,158,11,.18)}
.map-node.uncompleted{border-color:rgba(239,68,68,.6);box-shadow:inset 5px 0 0 #ef4444,0 6px 22px rgba(0,8,40,.55),0 0 22px rgba(239,68,68,.2)}
.map-node.completed{border-color:rgba(34,197,94,.55);box-shadow:inset 5px 0 0 #22c55e,0 6px 22px rgba(0,8,40,.55),0 0 22px rgba(34,197,94,.18)}
.map-node.stale::after{content:'';position:absolute;inset:-3px;border-radius:inherit;border:2px solid rgba(245,158,11,.85);box-shadow:0 0 14px rgba(245,158,11,.35);pointer-events:none;animation:staleGlow 2.4s ease-in-out infinite}
@keyframes staleGlow{0%,100%{opacity:.55}50%{opacity:1}}
/* While any modal is open, its translucent backdrop (rgba(0,0,0,.55)) lets the
   infinitely-pulsing .stale node halos shimmer through behind the dialog, which
   reads as a flicker (e.g. in the icon picker). Freeze the glow at a steady
   opacity while a modal is visible so nothing animates behind the scrim. */
body:has(#modal:not(.hidden)) .map-node.stale::after{animation:none;opacity:.7}
.unread-comment-dot{position:absolute;top:-5px;right:-5px;width:11px;height:11px;border-radius:50%;background:#a855f7;box-shadow:0 0 8px rgba(168,85,247,.8),0 0 0 2px #0e1632;pointer-events:none;animation:unreadCommentPulse 1.6s ease-in-out infinite}
.doc-unread-dot{display:inline-block;width:9px;height:9px;border-radius:50%;background:#a855f7;margin:0 .35rem;vertical-align:middle;box-shadow:0 0 6px rgba(168,85,247,.65);cursor:pointer;flex-shrink:0;animation:unreadCommentPulse 1.6s ease-in-out infinite}
.doc-unread-dot:hover{transform:scale(1.25)}
@keyframes unreadCommentPulse{0%,100%{transform:scale(1)}50%{transform:scale(1.15)}}
.light .unread-comment-dot{box-shadow:0 0 8px rgba(168,85,247,.55),0 0 0 2px #fff}
#staleBellBtn{color:#f59e0b}
/* Shared badge sizing/positioning for every icon-button "bell-count"
   pill in the toolbar. Per-button rules below override only the
   background + foreground colors so all bells (agenda, stale,
   notifications, comments) read as a consistent set. */
.icon-btn .bell-count{
  position:absolute;
  top:-4px;
  right:-4px;
  min-width:15px;
  height:15px;
  padding:0 4px;
  border-radius:8px;
  font-size:.6rem;
  font-weight:700;
  line-height:1;
  display:flex;
  align-items:center;
  justify-content:center;
  box-sizing:border-box;
  box-shadow:0 0 0 2px var(--bell-ring, #0b1024), 0 1px 3px rgba(0,0,0,.32);
  pointer-events:none;
  letter-spacing:.01em;
}
#staleBellBtn .bell-count{background:#f59e0b;color:#0b1024}
.stale-list{display:flex;flex-direction:column;gap:.45rem;max-height:50vh;overflow-y:auto;margin:.4rem 0}
.stale-item{display:flex;align-items:center;gap:.6rem;padding:.55rem .7rem;border-radius:10px;background:rgba(245,158,11,.08);border:1px solid rgba(245,158,11,.3)}
.stale-item .stale-meta{flex:1;min-width:0}
.stale-item .stale-title{font-weight:600;color:#e6ecff;font-size:.92rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.stale-item .stale-sub{font-size:.74rem;color:#a5b4d6;margin-top:.1rem}
.stale-item .stale-visit{padding:.32rem .65rem;font-size:.78rem;border-radius:7px;background:#22c55e;color:#0b1024;border:none;font-weight:600;cursor:pointer;flex-shrink:0}
.stale-item .stale-visit:hover{background:#16a34a;color:#fff}
.stale-item .stale-open{padding:.32rem .55rem;font-size:.78rem;border-radius:7px;background:transparent;color:#cbd5ff;border:1px solid rgba(99,131,236,.4);cursor:pointer;flex-shrink:0}
.stale-item .stale-open:hover{background:rgba(99,131,236,.15)}
.light .stale-item{background:#fff7ed;border-color:#fed7aa}
.light .stale-item .stale-title{color:#0f172a}
.light .stale-item .stale-sub{color:#64748b}
#agendaBtn .bell-count{background:#60a5fa;color:#0b1024}
#agendaBtn .bell-count.bell-count-red{background:#ef4444;color:#fff}
.map-node.due-overdue::before,.map-node.due-today::before,.map-node.due-soon::before{content:'';position:absolute;inset:-2px;border-radius:inherit;border:2px solid transparent;pointer-events:none}
.map-node.due-overdue::before{border-color:rgba(239,68,68,.85);box-shadow:0 0 12px rgba(239,68,68,.4)}
.map-node.due-today::before{border-color:rgba(245,158,11,.8);box-shadow:0 0 10px rgba(245,158,11,.3)}
.map-node.due-soon::before{border-color:rgba(96,165,250,.65)}
.agenda-section{margin:1rem 0 1.3rem}
.agenda-section:first-child{margin-top:.3rem}
.agenda-section h4{margin:.4rem 0 .55rem;font-size:.7rem;text-transform:uppercase;letter-spacing:.08em;color:#7e8db1;font-weight:600;display:flex;align-items:center;gap:.45rem}
.agenda-section h4 .agenda-count{font-size:.68rem;background:rgba(126,141,177,.18);color:#a5b4d6;padding:.05rem .5rem;border-radius:10px;text-transform:none;letter-spacing:0;font-weight:500;line-height:1.4}
.agenda-section.overdue h4{color:#ef4444}
.agenda-section.overdue h4 .agenda-count{background:rgba(239,68,68,.16);color:#fca5a5}
.agenda-section.today   h4{color:#f59e0b}
.agenda-section.today   h4 .agenda-count{background:rgba(245,158,11,.16);color:#fcd34d}
.agenda-section.week    h4{color:#60a5fa}
.agenda-section.week    h4 .agenda-count{background:rgba(96,165,250,.16);color:#93c5fd}

/* Rows: subtle slate background so the page reads calmly; a thin
 * left accent bar carries the bucket color instead of tinting the
 * whole pill. Hover lifts the background, not the chroma. */
.agenda-item{position:relative;display:flex;align-items:center;gap:.7rem;padding:.7rem .85rem .7rem 1.05rem;margin-bottom:.4rem;border-radius:10px;background:rgba(20,28,55,.45);border:1px solid rgba(99,131,236,.15);transition:background .12s,border-color .12s}
.agenda-item:hover{background:rgba(20,28,55,.7);border-color:rgba(99,131,236,.3)}
.agenda-item::before{content:'';position:absolute;left:0;top:.55rem;bottom:.55rem;width:3px;border-radius:2px;background:rgba(126,141,177,.55)}
.agenda-section.overdue .agenda-item::before{background:#ef4444}
.agenda-section.today   .agenda-item::before{background:#f59e0b}
.agenda-section.week    .agenda-item::before{background:#60a5fa}
.agenda-section.later   .agenda-item::before{background:#94a3b8}

.agenda-meta{flex:1;min-width:0;display:flex;flex-direction:column;gap:.15rem}
.agenda-title{font-weight:600;color:#f3f6ff;font-size:.92rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;letter-spacing:-.005em}
.agenda-sub{font-size:.74rem;color:#94a3b8;line-height:1.35}

/* Actions: complete is a ghost button that fills green on hover.
 * Open is now the primary look since it's the more common click. */
.agenda-item .agenda-complete{width:30px;height:30px;border-radius:8px;background:transparent;color:#86efac;border:1px solid rgba(34,197,94,.4);font-weight:700;cursor:pointer;flex-shrink:0;font-size:.9rem;display:inline-flex;align-items:center;justify-content:center;transition:background .12s,color .12s,border-color .12s}
.agenda-item .agenda-complete:hover{background:rgba(34,197,94,.18);color:#fff;border-color:#22c55e}
.agenda-item .agenda-open{padding:.4rem .9rem;font-size:.8rem;font-weight:600;border-radius:8px;background:linear-gradient(135deg,#6366f1,#4f46e5);color:#fff;border:none;cursor:pointer;flex-shrink:0;transition:filter .12s}
.agenda-item .agenda-open:hover{filter:brightness(1.08)}

.light .agenda-item{background:#fff;border-color:#e2e8f0}
.light .agenda-item:hover{background:#f8fafc;border-color:#cbd5e1}
.light .agenda-section h4{color:#64748b}
.light .agenda-section h4 .agenda-count{background:#e2e8f0;color:#475569}
.light .agenda-title{color:#0f172a}
.light .agenda-sub{color:#64748b}
.light .agenda-item .agenda-complete{color:#16a34a;border-color:#bbf7d0;background:#f0fdf4}
.light .agenda-item .agenda-complete:hover{background:#22c55e;color:#fff;border-color:#22c55e}
.tpl-list{display:flex;flex-direction:column;gap:.45rem;max-height:55vh;overflow-y:auto;margin:.4rem 0}
.tpl-item{display:flex;align-items:center;gap:.6rem;padding:.55rem .7rem;border-radius:10px;background:rgba(99,131,236,.1);border:1px solid rgba(99,131,236,.25)}
.tpl-meta{flex:1;min-width:0}
.tpl-name{font-weight:600;color:#e6ecff;font-size:.92rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tpl-sub{font-size:.74rem;color:#a5b4d6;margin-top:.1rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tpl-var-btn{padding:.3rem .55rem;font-size:.76rem;background:rgba(168,85,247,.15);color:#c7a8ff;border:1px solid rgba(168,85,247,.4);border-radius:7px;cursor:pointer;font-family:inherit;line-height:1}
.tpl-var-btn:hover{background:rgba(168,85,247,.25)}
.light .tpl-var-btn{background:rgba(124,58,237,.1);color:#7c3aed;border-color:rgba(124,58,237,.45)}
.light .tpl-var-btn:hover{background:rgba(124,58,237,.18)}
.tpl-item .tpl-use{height:30px;padding:0 .85rem;font-size:.78rem;border-radius:7px;background:#a855f7;color:#fff;border:none;font-weight:600;cursor:pointer;flex-shrink:0;display:inline-flex;align-items:center;justify-content:center}
.tpl-item .tpl-use:hover{background:#9333ea}
.tpl-item .tpl-del{width:30px;height:30px;border-radius:6px;background:transparent;color:#ef4444;border:1px solid rgba(239,68,68,.4);cursor:pointer;flex-shrink:0;font-size:1.05rem;line-height:1}
.tpl-item .tpl-del:hover{background:rgba(239,68,68,.15)}
.tpl-item .tpl-edit{width:30px;height:30px;border-radius:6px;background:transparent;color:#a855f7;border:1px solid rgba(168,85,247,.4);cursor:pointer;flex-shrink:0;font-size:.95rem;line-height:1}
.tpl-item .tpl-edit:hover{background:rgba(168,85,247,.15)}
.modal-card .tpl-item button.tpl-use,
.modal-card .tpl-item button.tpl-edit,
.modal-card .tpl-item button.tpl-del{box-sizing:border-box;height:30px;min-height:30px;line-height:1;padding-top:0;padding-bottom:0;display:inline-flex;align-items:center;justify-content:center}
.tpl-item .tpl-meta{flex:1;min-width:0}
.light .tpl-item{background:#eef2ff;border-color:#c7d2fe}
.light .tpl-name{color:#0f172a}
.light .tpl-sub{color:#475569}
.light .tpl-item .tpl-edit{color:#7c3aed;border-color:rgba(124,58,237,.45)}
.light .tpl-item .tpl-edit:hover{background:rgba(124,58,237,.12)}
.light .tpl-item .tpl-del{color:#dc2626;border-color:rgba(220,38,38,.45)}
.light .tpl-sub{color:#64748b}
.doc-rec-pill{margin-left:.25rem}
.doc-img-strip{display:flex;flex-wrap:wrap;gap:.5rem;margin:.5rem 0}
.doc-img-tile{display:block;border-radius:8px;overflow:hidden;border:1px solid rgba(99,131,236,.25);background:rgba(10,18,38,.4);max-width:220px;max-height:160px;flex:0 0 auto}
.doc-img-tile img{display:block;width:100%;height:100%;object-fit:cover;max-height:160px}
.doc-img-tile:hover{border-color:rgba(168,85,247,.55)}
.task-img-gallery{display:flex;flex-wrap:wrap;gap:.45rem;margin:.25rem 0;min-height:40px}
.task-img-empty{font-size:.78rem;margin:.3rem 0;width:100%}
.task-img-tile{position:relative;width:96px;height:96px;border-radius:8px;overflow:hidden;border:1px solid rgba(99,131,236,.3);background:rgba(10,18,38,.4)}
.task-img-tile img{display:block;width:100%;height:100%;object-fit:cover}
.task-img-tile .task-img-del{position:absolute;top:2px;right:2px;width:22px;height:22px;border-radius:50%;border:none;background:rgba(0,0,0,.65);color:#fff;font-size:1rem;line-height:1;cursor:pointer;display:flex;align-items:center;justify-content:center}
.task-img-tile .task-img-del:hover{background:#ef4444}
.task-img-controls{display:flex;align-items:center;gap:.6rem;margin-top:.3rem}
.task-img-add{display:inline-flex;align-items:center;padding:.35rem .65rem;background:rgba(99,131,236,.12);border:1px dashed rgba(99,131,236,.45);color:#cbd5ff;border-radius:8px;cursor:pointer;font-size:.8rem;font-weight:500}
.task-img-add:hover{background:rgba(99,131,236,.22);border-color:rgba(99,131,236,.7)}
.task-img-status{font-size:.75rem;color:#9aa8cf}
.task-comments{margin:.85rem 0 0;padding:.7rem .8rem;border-radius:11px;background:rgba(20,28,55,.45);border:1px solid rgba(99,131,236,.18)}
.task-comments-head{font-size:.7rem;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:#8a9bc4;margin:0 0 .45rem}
.task-comments-empty{font-size:.82rem;margin:.2rem 0 .55rem}
.task-comments-list{list-style:none;margin:0 0 .55rem;padding:0;display:flex;flex-direction:column;gap:.55rem;max-height:260px;overflow-y:auto}
.task-comment{display:flex;gap:.55rem;align-items:flex-start;padding:.45rem .55rem;background:rgba(8,12,28,.35);border-radius:9px;border:1px solid rgba(99,131,236,.12)}
.task-comment-avatar{width:26px;height:26px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:linear-gradient(135deg,#7c3aed,#a855f7);color:#fff;font-size:.78rem;font-weight:700;flex-shrink:0}
.task-comment-body{flex:1;min-width:0;display:flex;flex-direction:column;gap:.18rem}
.task-comment-head{display:flex;align-items:baseline;gap:.45rem;font-size:.78rem;color:#cbd5e1}
.task-comment-head strong{color:#e6ecff;font-weight:600;font-size:.82rem}
.task-comment-time{color:#7e8db1;font-size:.7rem;flex:1}
.task-comment-delete{background:transparent;border:none;color:#7e8db1;font:inherit;font-size:1.1rem;line-height:1;cursor:pointer;padding:0 .25rem;border-radius:5px}
.task-comment-delete:hover{color:#ef4444;background:rgba(239,68,68,.08)}
.task-comment-text{font-size:.86rem;line-height:1.45;color:#e6ecff;white-space:pre-wrap;word-wrap:break-word}
.comment-mention{color:#c4b5fd;background:rgba(168,85,247,.16);padding:.05rem .25rem;border-radius:4px;font-weight:600}
.mention-picker{position:fixed;z-index:9999;background:#0e1632;border:1px solid rgba(99,131,236,.32);border-radius:9px;box-shadow:0 12px 40px rgba(8,12,28,.55);padding:.25rem;display:flex;flex-direction:column;gap:.1rem;max-height:230px;overflow-y:auto}
.mention-picker-row{display:flex;align-items:center;gap:.5rem;width:100%;padding:.4rem .55rem;background:transparent;border:none;color:#e6ecff;font:inherit;font-size:.82rem;text-align:left;border-radius:6px;cursor:pointer}
.mention-picker-row:hover,.mention-picker-row.is-selected{background:rgba(168,85,247,.18)}
.mention-picker-avatar{width:22px;height:22px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:linear-gradient(135deg,#7c3aed,#a855f7);color:#fff;font-size:.7rem;font-weight:700;flex-shrink:0}
.mention-picker-text{display:flex;flex-direction:column;gap:.05rem;min-width:0}
.mention-picker-text strong{color:#f3f6ff;font-weight:600;font-size:.84rem}
.mention-picker-email{color:#94a3b8;font-size:.72rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.mention-picker-empty{padding:.5rem .65rem;font-size:.78rem;color:#94a3b8}
.light .mention-picker{background:#fff;border-color:#e2e8f0;box-shadow:0 12px 40px rgba(15,23,42,.16)}
.light .mention-picker-row{color:#0f172a}
.light .mention-picker-row:hover,.light .mention-picker-row.is-selected{background:#ede9fe}
.light .mention-picker-text strong{color:#0f172a}
.light .mention-picker-email{color:#64748b}
.task-comment-composer{display:flex;flex-direction:column;gap:.4rem;margin-top:.3rem}
.task-comment-composer textarea{width:100%;min-height:54px;max-height:160px;padding:.5rem .65rem;background:#0a1226;color:#fff;border:1px solid #384b75;border-radius:8px;font:inherit;font-size:.86rem;line-height:1.45;resize:vertical;box-sizing:border-box}
.task-comment-post{align-self:flex-end;padding:.4rem 1.1rem;border-radius:8px;background:linear-gradient(135deg,#a855f7,#7c3aed);color:#fff;border:none;font:inherit;font-weight:700;font-size:.82rem;cursor:pointer}
.task-comment-post:hover{filter:brightness(1.07)}
.task-comment-post:disabled{opacity:.55;cursor:default;filter:none}
.light .task-comments{background:#f8fafc;border-color:#e2e8f0}
.light .task-comments-head{color:#475569}
.light .task-comment{background:#fff;border-color:#e2e8f0}
.light .task-comment-head strong{color:#0f172a}
.light .task-comment-time{color:#64748b}
.light .task-comment-text{color:#0f172a}
.light .comment-mention{color:#7c3aed;background:#ede9fe}
.light .task-comment-composer textarea{background:#fff;color:#0f172a;border-color:#cbd5e1}
.light .doc-img-tile{background:#f8fafc;border-color:#e2e8f0}
.light .task-img-tile{background:#f1f5f9;border-color:#cbd5e1}
.light .task-img-add{background:#eef2ff;color:#4338ca;border-color:#c7d2fe}
.light .task-img-add:hover{background:#e0e7ff}
.gmail-status{font-size:.75rem;margin:.2rem 0 0}
.gmail-thread-card{background:rgba(234,67,53,.06);border:1px solid rgba(234,67,53,.28);border-radius:12px;padding:.85rem 1rem;margin:.55rem 0}
.gmail-thread-card.hidden{display:none}
.gmail-card-row{display:flex;gap:.6rem;align-items:flex-start}
.gmail-thread-head{display:flex;gap:.7rem;align-items:flex-start;padding-bottom:.7rem;border-bottom:1px solid rgba(234,67,53,.18);margin-bottom:.85rem}
.gmail-thread-head-body{flex:1;min-width:0;display:flex;flex-direction:column;gap:.35rem}
.gmail-thread-head-meta{display:flex;align-items:center;gap:.65rem;flex-wrap:wrap;font-size:.74rem;color:#94a3b8}
.gmail-thread-messages{display:flex;flex-direction:column;gap:1rem;max-height:520px;overflow-y:auto;padding-right:.25rem}
.gmail-msg{padding:.85rem .95rem;background:rgba(8,12,28,.55);border:1px solid rgba(99,131,236,.16);border-radius:10px;display:flex;flex-direction:column;gap:.55rem}
.gmail-msg.is-mine{background:rgba(168,85,247,.06);border-color:rgba(168,85,247,.22)}
.gmail-msg-head{display:flex;justify-content:space-between;align-items:baseline;gap:1rem;flex-wrap:wrap;line-height:1.3}
.gmail-msg-from{font-weight:600;font-size:.86rem;color:#f3f6ff;letter-spacing:-.005em}
.gmail-msg-email{font-weight:400;font-size:.74rem;color:#94a3b8;margin-left:.25rem}
.gmail-msg-date{font-size:.72rem;color:#94a3b8;white-space:nowrap;flex-shrink:0}
.gmail-msg-body{font-size:.85rem;line-height:1.55;color:#e6ecff;white-space:pre-wrap;word-wrap:break-word;overflow-wrap:break-word}
.gmail-msg-empty{font-style:italic;color:#94a3b8}
.gmail-refresh{appearance:none;background:transparent;color:#94a3b8;border:1px solid rgba(99,131,236,.22);width:24px;height:24px;padding:0;border-radius:50%;cursor:pointer;font-size:.9rem;line-height:1;display:inline-flex;align-items:center;justify-content:center;transition:color .12s,border-color .12s,background .12s}
.gmail-refresh:hover{color:#a5b4fc;border-color:rgba(99,131,236,.5);background:rgba(99,131,236,.1)}
.gmail-refresh:disabled{opacity:.6;cursor:default}
.gmail-refresh.is-spinning{animation:gmailSpin 1s linear infinite;pointer-events:none}
@keyframes gmailSpin{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}
.modal-card button.gmail-refresh{padding:0}
.light .gmail-refresh{color:#64748b;border-color:#e2e8f0}
.light .gmail-refresh:hover{color:#4338ca;border-color:#c7d2fe;background:#eef2ff}
.gmail-msg-attachments{display:flex;flex-wrap:wrap;gap:.4rem;margin-top:.15rem}
.gmail-msg-attachment{display:inline-flex;align-items:center;gap:.45rem;padding:.4rem .65rem;background:rgba(99,131,236,.08);border:1px solid rgba(99,131,236,.22);border-radius:8px;font-size:.78rem;max-width:100%;min-width:0}
.gmail-msg-attachment-icon{flex-shrink:0;font-size:.95rem;line-height:1}
.gmail-msg-attachment-name{color:#f3f6ff;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:18rem}
.gmail-msg-attachment-meta{color:#94a3b8;font-size:.72rem;white-space:nowrap;flex-shrink:0}
.light .gmail-msg-attachment{background:#eef2ff;border-color:#c7d2fe}
.light .gmail-msg-attachment-name{color:#0f172a}
.light .gmail-msg-attachment-meta{color:#64748b}
.light .gmail-thread-card{background:#fef2f2;border-color:#fecaca}
.light .gmail-thread-head{border-color:#fecaca}
.light .gmail-thread-head-meta{color:#64748b}
.light .gmail-msg{background:#fff;border-color:#e2e8f0}
.light .gmail-msg.is-mine{background:#faf5ff;border-color:#e9d5ff}
.light .gmail-msg-from{color:#0f172a}
.light .gmail-msg-email{color:#64748b}
.light .gmail-msg-date{color:#64748b}
.light .gmail-msg-body{color:#0f172a}
.gmail-card-icon{width:32px;height:32px;border-radius:50%;background:#ea4335;color:#fff;display:flex;align-items:center;justify-content:center;font-size:1rem;flex-shrink:0}
.gmail-card-body{flex:1;min-width:0}
.gmail-card-subject{font-weight:600;font-size:.92rem;color:#f3f6ff;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.gmail-card-meta{font-size:.74rem;color:#a5b4d6;margin-top:.1rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.gmail-card-snippet{font-size:.78rem;color:#cdd5ed;margin-top:.35rem;line-height:1.45;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.gmail-card-pills{display:flex;flex-wrap:wrap;gap:.35rem;margin-top:.4rem}
.gmail-turn{display:inline-flex;align-items:center;font-size:.7rem;font-weight:600;padding:.18rem .55rem;border-radius:6px;letter-spacing:.02em;line-height:1.2}
.gmail-turn-mine{background:rgba(168,85,247,.18);color:#c4b5fd;border:1px solid rgba(168,85,247,.45)}
.gmail-turn-theirs{background:rgba(99,131,236,.14);color:#a5b4fc;border:1px solid rgba(99,131,236,.32)}
.gmail-new-reply{display:inline-flex;align-items:center;gap:.25rem;font:inherit;font-size:.7rem;font-weight:600;padding:.18rem .5rem;border-radius:6px;background:#f43f5e;color:#fff;border:none;cursor:pointer;letter-spacing:.02em;line-height:1.2}
.gmail-new-reply:hover{filter:brightness(1.08)}
.light .gmail-turn-mine{background:#ede9fe;color:#6d28d9;border-color:#c4b5fd}
.light .gmail-turn-theirs{background:#eef2ff;color:#3730a3;border-color:#c7d2fe}
.gmail-card-actions{display:flex;justify-content:space-between;align-items:center;margin-top:.4rem;gap:.5rem}
.gmail-search-card{margin:.55rem 0 .25rem;padding:.85rem .9rem;background:linear-gradient(180deg,rgba(20,28,55,.55) 0%,rgba(14,20,42,.6) 100%);border:1px solid rgba(99,131,236,.22);border-radius:12px;box-shadow:0 1px 0 rgba(255,255,255,.02) inset}
.gmail-search-head{display:flex;align-items:flex-start;gap:.65rem;margin-bottom:.65rem}
.gmail-search-icon{width:30px;height:30px;flex-shrink:0;border-radius:8px;background:linear-gradient(135deg,#ea4335,#d33324);color:#fff;display:flex;align-items:center;justify-content:center;font-size:1rem;box-shadow:0 1px 4px rgba(234,67,53,.35)}
.gmail-search-heading{display:flex;flex-direction:column;gap:.1rem;min-width:0}
.gmail-search-title{font-weight:600;font-size:.92rem;color:#f3f6ff;letter-spacing:-.01em}
.gmail-search-sub{font-size:.74rem;color:#94a3b8;line-height:1.35}
.gmail-search-row{display:flex;gap:.45rem;align-items:stretch}
.gmail-search-row input{flex:1;min-width:0;padding:.55rem .7rem;background:#0a1226;color:#fff;border:1px solid #384b75;border-radius:9px;font:inherit;font-size:.85rem;transition:border-color .15s ease, box-shadow .15s ease}
.gmail-search-row input:focus{outline:none;border-color:rgba(99,131,236,.6);box-shadow:0 0 0 3px rgba(99,131,236,.18)}
.gmail-search-btn{flex:0 0 auto;padding:.5rem 1rem;font-size:.85rem;font-weight:600;border-radius:9px}
.gmail-search-hint{font-size:.72rem;color:#7e8db1;margin:.45rem 0 .15rem}
.gmail-search-results{display:flex;flex-direction:column;gap:.35rem;max-height:280px;overflow-y:auto;margin-top:.4rem}
.gmail-search-results:empty{margin-top:0}
.gmail-search-result{display:flex;flex-direction:column;align-items:flex-start;gap:.18rem;padding:.55rem .7rem;background:rgba(8,12,28,.55);border:1px solid rgba(99,131,236,.18);border-radius:9px;color:#e6ecff;font:inherit;text-align:left;cursor:pointer;transition:background .12s ease,border-color .12s ease,transform .08s ease}
.gmail-search-result:hover{background:rgba(99,131,236,.14);border-color:rgba(99,131,236,.4)}
.gmail-search-result:active{transform:translateY(1px)}
.gmail-search-result.is-loading{opacity:.6;pointer-events:none}
.gmail-search-subject{font-weight:600;font-size:.88rem;color:#f3f6ff;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%}
.gmail-search-meta{font-size:.72rem;color:#94a3b8;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%}
.gmail-search-snippet{font-size:.76rem;color:#cdd5ed;line-height:1.4;width:100%;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.light .gmail-search-card{background:linear-gradient(180deg,#f8fafc 0%,#f1f5f9 100%);border-color:#e2e8f0;box-shadow:none}
.light .gmail-search-title{color:#0f172a}
.light .gmail-search-sub{color:#64748b}
.light .gmail-search-hint{color:#64748b}
.light .gmail-search-row input{background:#fff;color:#0f172a;border-color:#cbd5e1}
.light .gmail-search-row input:focus{border-color:#6366f1;box-shadow:0 0 0 3px rgba(99,102,241,.18)}
.light .gmail-search-result{background:#fff;border-color:#e2e8f0;color:#0f172a}
.light .gmail-search-result:hover{background:#f1f5f9;border-color:#cbd5e1}
.light .gmail-search-subject{color:#0f172a}
.light .gmail-search-meta{color:#64748b}
.light .gmail-search-snippet{color:#334155}
.gmail-open{color:#60a5fa;font-size:.78rem;text-decoration:none}
.gmail-open:hover{text-decoration:underline}
.gmail-card-date{font-size:.7rem;color:#94a3b8}
.modal-card button.gmail-disc,
.gmail-disc{width:26px;height:26px;padding:0;border-radius:50%;background:transparent;color:#94a3b8;border:none;cursor:pointer;font-size:1.05rem;line-height:1;flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;align-self:center}
.modal-card button.gmail-disc:hover,
.gmail-disc:hover{background:rgba(239,68,68,.18);color:#ef4444}
.doc-gmail-wrap{margin-top:.45rem}
.light .gmail-card-subject{color:#0f172a}
.light .gmail-card-snippet{color:#334155}
.outlook-status{font-size:.75rem;margin:.2rem 0 0}
.outlook-thread-card{background:rgba(0,120,212,.05);border:1px solid rgba(0,120,212,.28);border-radius:12px;padding:.85rem 1rem;margin:.55rem 0}
.outlook-thread-card.hidden{display:none}
.outlook-card-icon{width:32px;height:32px;border-radius:50%;background:#0078d4;color:#fff;display:flex;align-items:center;justify-content:center;font-size:1rem;flex-shrink:0}
.outlook-card-subject{font-weight:600;font-size:.92rem;color:#f3f6ff;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.outlook-card-pills{display:flex;flex-wrap:wrap;gap:.35rem;margin-top:.4rem}
.outlook-turn{display:inline-flex;align-items:center;font-size:.7rem;font-weight:600;padding:.18rem .55rem;border-radius:6px;letter-spacing:.02em;line-height:1.2}
.outlook-turn-mine{background:rgba(168,85,247,.18);color:#c4b5fd;border:1px solid rgba(168,85,247,.45)}
.outlook-turn-theirs{background:rgba(99,131,236,.14);color:#a5b4fc;border:1px solid rgba(99,131,236,.32)}
.outlook-thread-head{display:flex;gap:.7rem;align-items:flex-start;padding-bottom:.7rem;border-bottom:1px solid rgba(0,120,212,.18);margin-bottom:.85rem}
.outlook-thread-head-body{flex:1;min-width:0;display:flex;flex-direction:column;gap:.35rem}
.outlook-thread-head-meta{display:flex;align-items:center;gap:.65rem;flex-wrap:wrap;font-size:.74rem;color:#94a3b8}
.outlook-thread-messages{display:flex;flex-direction:column;gap:1rem;max-height:520px;overflow-y:auto;padding-right:.25rem}
.outlook-msg{padding:.85rem .95rem;background:rgba(8,12,28,.55);border:1px solid rgba(0,120,212,.18);border-radius:10px;display:flex;flex-direction:column;gap:.55rem}
.outlook-msg.is-mine{background:rgba(168,85,247,.06);border-color:rgba(168,85,247,.22)}
.outlook-msg-head{display:flex;justify-content:space-between;align-items:baseline;gap:1rem;flex-wrap:wrap;line-height:1.3}
.outlook-msg-from{font-weight:600;font-size:.86rem;color:#f3f6ff;letter-spacing:-.005em}
.outlook-msg-email{font-weight:400;font-size:.74rem;color:#94a3b8;margin-left:.25rem}
.outlook-msg-date{font-size:.72rem;color:#94a3b8;white-space:nowrap;flex-shrink:0}
.outlook-msg-body{font-size:.85rem;line-height:1.55;color:#e6ecff;white-space:pre-wrap;word-wrap:break-word;overflow-wrap:break-word}
.outlook-msg-empty{font-style:italic;color:#94a3b8}
.outlook-msg-attachments{display:flex;flex-wrap:wrap;gap:.4rem;margin-top:.15rem}
.outlook-msg-attachment{display:inline-flex;align-items:center;gap:.45rem;padding:.4rem .65rem;background:rgba(0,120,212,.1);border:1px solid rgba(0,120,212,.25);border-radius:8px;font-size:.78rem;max-width:100%;min-width:0}
.outlook-msg-attachment-icon{flex-shrink:0;font-size:.95rem;line-height:1}
.outlook-msg-attachment-name{color:#f3f6ff;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:18rem}
.outlook-msg-attachment-meta{color:#94a3b8;font-size:.72rem;white-space:nowrap;flex-shrink:0}
.outlook-open{color:#60a5fa;font-size:.78rem;text-decoration:none}
.outlook-open:hover{text-decoration:underline}
.outlook-refresh{appearance:none;background:transparent;color:#94a3b8;border:1px solid rgba(0,120,212,.25);width:24px;height:24px;padding:0;border-radius:50%;cursor:pointer;font-size:.9rem;line-height:1;display:inline-flex;align-items:center;justify-content:center;transition:color .12s,border-color .12s,background .12s}
.outlook-refresh:hover{color:#7dd3fc;border-color:rgba(0,120,212,.5);background:rgba(0,120,212,.12)}
.outlook-refresh:disabled{opacity:.6;cursor:default}
.outlook-refresh.is-spinning{animation:gmailSpin 1s linear infinite;pointer-events:none}
.modal-card button.outlook-refresh{padding:0}
.modal-card button.outlook-disc,
.outlook-disc{width:26px;height:26px;padding:0;border-radius:50%;background:transparent;color:#94a3b8;border:none;cursor:pointer;font-size:1.05rem;line-height:1;flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;align-self:center}
.modal-card button.outlook-disc:hover,
.outlook-disc:hover{background:rgba(239,68,68,.18);color:#ef4444}
.doc-outlook-wrap{margin-top:.45rem}
.outlook-search-card{margin:.55rem 0 .25rem;padding:.85rem .9rem;background:linear-gradient(180deg,rgba(20,28,55,.55) 0%,rgba(14,20,42,.6) 100%);border:1px solid rgba(0,120,212,.22);border-radius:12px;box-shadow:0 1px 0 rgba(255,255,255,.02) inset}
.outlook-search-head{display:flex;align-items:flex-start;gap:.65rem;margin-bottom:.65rem}
.outlook-search-icon{width:30px;height:30px;flex-shrink:0;border-radius:8px;background:linear-gradient(135deg,#0078d4,#005a9e);color:#fff;display:flex;align-items:center;justify-content:center;font-size:1rem;box-shadow:0 1px 4px rgba(0,120,212,.35)}
.outlook-search-heading{display:flex;flex-direction:column;gap:.1rem;min-width:0}
.outlook-search-title{font-weight:600;font-size:.92rem;color:#f3f6ff;letter-spacing:-.01em}
.outlook-search-sub{font-size:.74rem;color:#94a3b8;line-height:1.35}
.outlook-search-row{display:flex;gap:.45rem;align-items:stretch}
.outlook-search-row input{flex:1;min-width:0;padding:.55rem .7rem;background:#0a1226;color:#fff;border:1px solid #384b75;border-radius:9px;font:inherit;font-size:.85rem;transition:border-color .15s ease, box-shadow .15s ease}
.outlook-search-row input:focus{outline:none;border-color:rgba(0,120,212,.6);box-shadow:0 0 0 3px rgba(0,120,212,.18)}
.outlook-search-btn{flex:0 0 auto;padding:.5rem 1rem;font-size:.85rem;font-weight:600;border-radius:9px}
.outlook-search-hint{font-size:.72rem;color:#7e8db1;margin:.45rem 0 .15rem}
.outlook-search-results{display:flex;flex-direction:column;gap:.35rem;max-height:280px;overflow-y:auto;margin-top:.4rem}
.outlook-search-results:empty{margin-top:0}
.outlook-search-result{display:flex;flex-direction:column;align-items:flex-start;gap:.18rem;padding:.55rem .7rem;background:rgba(8,12,28,.55);border:1px solid rgba(0,120,212,.2);border-radius:9px;color:#e6ecff;font:inherit;text-align:left;cursor:pointer;transition:background .12s ease,border-color .12s ease,transform .08s ease}
.outlook-search-result:hover{background:rgba(0,120,212,.12);border-color:rgba(0,120,212,.4)}
.outlook-search-result:active{transform:translateY(1px)}
.outlook-search-result.is-loading{opacity:.6;pointer-events:none}
.outlook-search-subject{font-weight:600;font-size:.88rem;color:#f3f6ff;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%}
.outlook-search-meta{font-size:.72rem;color:#94a3b8;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%}
.outlook-search-snippet{font-size:.76rem;color:#cdd5ed;line-height:1.4;width:100%;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.light .outlook-thread-card{background:#eff6ff;border-color:#bfdbfe}
.light .outlook-thread-head{border-color:#bfdbfe}
.light .outlook-thread-head-meta{color:#64748b}
.light .outlook-msg{background:#fff;border-color:#e2e8f0}
.light .outlook-msg.is-mine{background:#faf5ff;border-color:#e9d5ff}
.light .outlook-msg-from{color:#0f172a}
.light .outlook-msg-email{color:#64748b}
.light .outlook-msg-date{color:#64748b}
.light .outlook-msg-body{color:#0f172a}
.light .outlook-msg-attachment{background:#eff6ff;border-color:#bfdbfe}
.light .outlook-msg-attachment-name{color:#0f172a}
.light .outlook-msg-attachment-meta{color:#64748b}
.light .outlook-refresh{color:#64748b;border-color:#bfdbfe}
.light .outlook-refresh:hover{color:#0369a1;border-color:#7dd3fc;background:#eff6ff}
.light .outlook-search-card{background:linear-gradient(180deg,#f8fafc 0%,#f1f5f9 100%);border-color:#e2e8f0;box-shadow:none}
.light .outlook-search-title{color:#0f172a}
.light .outlook-search-sub{color:#64748b}
.light .outlook-search-hint{color:#64748b}
.light .outlook-search-row input{background:#fff;color:#0f172a;border-color:#cbd5e1}
.light .outlook-search-row input:focus{border-color:#0078d4;box-shadow:0 0 0 3px rgba(0,120,212,.18)}
.light .outlook-search-result{background:#fff;border-color:#e2e8f0;color:#0f172a}
.light .outlook-search-result:hover{background:#eff6ff;border-color:#bfdbfe}
.light .outlook-search-subject{color:#0f172a}
.light .outlook-search-meta{color:#64748b}
.light .outlook-search-snippet{color:#334155}
.light .outlook-card-subject{color:#0f172a}
.light .outlook-turn-mine{background:#ede9fe;color:#6d28d9;border-color:#c4b5fd}
.light .outlook-turn-theirs{background:#eef2ff;color:#3730a3;border-color:#c7d2fe}
.bulk-bar{position:fixed;bottom:18px;left:50%;transform:translateX(-50%);z-index:90;display:flex;align-items:center;gap:.4rem;padding:.45rem .55rem;background:rgba(15,22,42,.96);border:1px solid rgba(99,131,236,.4);border-radius:14px;box-shadow:0 10px 32px rgba(0,0,0,.4);backdrop-filter:blur(10px);max-width:calc(100vw - 24px);overflow-x:auto}
.bulk-bar.hidden{display:none}
.bulk-bar .bulk-count{font-size:.8rem;color:#cbd5ff;padding:0 .45rem 0 .25rem;font-weight:600;flex-shrink:0;white-space:nowrap}
.bulk-bar button{display:inline-flex;align-items:center;gap:.32rem;padding:.4rem .65rem;font-size:.78rem;border:1px solid rgba(99,131,236,.3);background:rgba(99,131,236,.08);color:#e6ecff;border-radius:8px;cursor:pointer;font:inherit;font-weight:500;flex-shrink:0;white-space:nowrap}
.bulk-bar button:hover{background:rgba(99,131,236,.2);border-color:rgba(99,131,236,.55)}
.bulk-bar button.bulk-danger{color:#ef4444;border-color:rgba(239,68,68,.4)}
.bulk-bar button.bulk-danger:hover{background:rgba(239,68,68,.15)}
.bulk-bar button.bulk-clear{color:#94a3b8;border-color:transparent;background:transparent}
.bulk-bar button.bulk-clear:hover{background:rgba(148,163,184,.15)}
.bulk-dot{width:9px;height:9px;border-radius:50%;display:inline-block}
.bulk-dot-green{background:#22c55e}
.bulk-dot-amber{background:#f59e0b}
.bulk-dot-gray{background:#64748b}
.light .bulk-bar{background:rgba(255,255,255,.96);border-color:#cbd5e1}
.light .bulk-bar .bulk-count{color:#0f172a}
.light .bulk-bar button{color:#0f172a;background:#f1f5f9;border-color:#cbd5e1}
.light .bulk-bar button:hover{background:#e2e8f0}
@media (max-width: 640px){
  .bulk-bar{bottom:8px;padding:.35rem .4rem;gap:.25rem}
  .bulk-bar button{padding:.32rem .5rem;font-size:.72rem}
  .bulk-bar .bulk-count{font-size:.72rem;padding:0 .25rem}
}
.project-cluster{position:absolute;border:2px dashed rgba(148,163,184,.7);border-radius:14px;background:rgba(15,23,42,.06);pointer-events:none;z-index:0}
.cluster-label{position:absolute;top:-12px;left:10px;background:var(--panel);padding:.1rem .55rem;font-size:.8rem;color:var(--muted);pointer-events:auto;cursor:grab;border-radius:6px;border:1px solid rgba(148,163,184,.35);user-select:none}.cluster-label:hover{background:#1a2440;color:#cdd8ff}.cluster-label:active{cursor:grabbing}
.map-details{background:var(--panel);color:var(--text);border-left:1px solid var(--line);display:flex;flex-direction:column;overflow:hidden;padding:0}.muted{color:var(--muted)}
.details-toolbar{padding:.6rem .8rem;border-bottom:1px solid var(--line);flex-shrink:0}
.pdf-btn{width:100%;padding:.55rem .85rem;background:linear-gradient(135deg,rgba(191,219,254,.42),rgba(147,197,253,.14));backdrop-filter:blur(10px) saturate(1.5);-webkit-backdrop-filter:blur(10px) saturate(1.5);color:#fff;border:1px solid rgba(255,255,255,.28);border-radius:11px;font-size:.92rem;font-weight:500;cursor:pointer;letter-spacing:.01em;font-family:inherit;box-shadow:inset 0 1px 0 rgba(255,255,255,.5),0 6px 18px rgba(59,130,246,.18);transition:filter .15s}
.pdf-btn:hover{filter:brightness(1.06)}
.light .pdf-btn{color:#1e3a8a;background:linear-gradient(135deg,rgba(191,219,254,.6),rgba(147,197,253,.25));border-color:rgba(59,130,246,.3);box-shadow:inset 0 1px 0 rgba(255,255,255,.7),0 4px 12px rgba(59,130,246,.12)}
#mapDetailsContent{flex:1;overflow-y:auto;padding:1rem}
.ctx{position:fixed;z-index:40;background:#1a2440;border:1px solid #2c3a64;border-radius:12px;padding:.4rem .3rem;display:flex;flex-direction:column;min-width:240px;max-width:min(340px,calc(100vw - 24px));max-height:calc(100vh - 24px);overflow-y:auto;box-shadow:0 14px 38px rgba(0,0,0,.55)}
.ctx-section-label{font-size:.65rem;letter-spacing:.08em;color:#7e8db1;padding:.55rem .75rem .22rem;font-weight:600;text-transform:uppercase}
.ctx-divider{height:1px;background:rgba(120,140,180,.18);margin:.25rem .65rem}
/* Lightweight toast for transient confirmations (e.g. "Layout applied · Undo"). */
.toast{position:fixed;left:50%;bottom:max(24px, env(safe-area-inset-bottom, 24px));transform:translateX(-50%);z-index:80;background:#1a2440;color:#e6ecff;border:1px solid #2c3a64;border-radius:999px;padding:.55rem .85rem .55rem 1rem;display:inline-flex;align-items:center;gap:.75rem;font-size:.88rem;box-shadow:0 12px 32px rgba(0,0,0,.45);max-width:calc(100vw - 32px);animation:toastIn 160ms ease-out}
.toast-action{background:transparent;border:1px solid rgba(124,58,237,.55);color:#c4b5fd;border-radius:999px;padding:.28rem .7rem;font:inherit;font-weight:600;cursor:pointer;letter-spacing:.01em}
.toast-action:hover{background:rgba(124,58,237,.18);color:#ddd6fe}
.light .toast{background:#0f172a;color:#f1f5f9;border-color:#334155}
.light .toast-action{color:#a78bfa;border-color:rgba(167,139,250,.6)}
@keyframes toastIn{from{opacity:0;transform:translate(-50%,8px)}to{opacity:1;transform:translate(-50%,0)}}
.ctx button{background:none;border:none;color:#e6ecff;text-align:left;padding:.45rem .75rem;cursor:pointer;display:grid;grid-template-columns:22px 1fr auto;align-items:center;gap:.65rem;border-radius:8px;font-size:.88rem;font-family:inherit}
.ctx button:hover{background:rgba(120,140,200,.12)}
.ctx button .icon{display:inline-flex;align-items:center;justify-content:center;color:#a5b4d6;font-size:.95rem}
.ctx button .label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ctx button .shortcut{color:#7e8db1;font-size:.72rem;letter-spacing:.04em;padding-left:.4rem}
.ctx button .icon.green{color:#22c55e}
.ctx button .icon.amber{color:#f59e0b}
.ctx button .icon.red{color:#ef4444}
.ctx button.danger{color:#f87171}
.ctx button.danger .icon{color:#f87171}
.ctx button.disabled,.ctx button:disabled{opacity:.42;cursor:not-allowed}
.ctx button.disabled:hover,.ctx button:disabled:hover{background:none}
.modal{position:fixed;inset:0;background:rgba(0,0,0,.55);display:flex;align-items:center;justify-content:center;z-index:50}.modal-card{width:min(560px,94vw);max-height:88vh;overflow-y:auto;background:#121b34;padding:1.25rem;border-radius:14px;border:1px solid #354a78;box-shadow:0 18px 50px rgba(0,0,0,.55)}.modal-card input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=range]):not([type=color]),.modal-card textarea{width:100%;padding:.6rem;margin:.35rem 0;background:#0a1226;color:#fff;border:1px solid #384b75;border-radius:8px}
.modal-card h3{margin:0 0 .85rem;font-size:1.05rem;font-weight:600}
.modal-card button{padding:.55rem 1rem;border-radius:9px;border:1px solid transparent;font-family:inherit;font-size:.86rem;font-weight:500;cursor:pointer;background:linear-gradient(135deg,#3b82f6,#2563eb);color:#fff;letter-spacing:.01em;transition:filter .12s,border-color .12s,background .12s}
.modal-card button:hover{filter:brightness(1.08)}
.modal-card button.secondary{background:transparent;border-color:rgba(120,140,200,.3);color:#cdd5ed}
.modal-card button.secondary:hover{background:rgba(120,140,200,.1);border-color:rgba(120,140,200,.5);filter:none}
.modal-card .row{margin-top:.85rem}
.settings-section{background:rgba(20,28,55,.5);border:1px solid rgba(99,131,236,.18);border-radius:11px;padding:.85rem 1rem;margin:.6rem 0}
.settings-section-label{font-size:.7rem;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:#8a9bc4;margin:0 0 .55rem}
.settings-section p.muted{margin:.2rem 0 .55rem;font-size:.82rem;line-height:1.45}
.settings-section .row{display:flex;gap:.5rem;flex-wrap:wrap;margin-top:.55rem}

/* --- Email-notifications redesign ------------------------------------- */
.email-pref-card{display:flex;flex-direction:column;gap:0;margin-top:.4rem}
.email-pref-intro{margin:0 0 .9rem;font-size:.84rem;color:#9aa8cf;line-height:1.5}
.email-pref-row{display:flex;align-items:center;gap:.75rem;padding:.8rem .3rem;cursor:pointer;border-top:1px solid rgba(99,131,236,.14);color:#e6ecff;font-size:.92rem;line-height:1.3}
.email-pref-row:first-of-type{border-top:1px solid rgba(99,131,236,.22)}
.email-pref-list{display:flex;flex-direction:column}
.email-pref-list .email-pref-row{padding:.65rem .3rem;font-size:.88rem;color:#cbd5e1}
.email-pref-icon{flex-shrink:0;width:24px;height:24px;display:flex;align-items:center;justify-content:center;color:#9aa8cf}
.email-pref-icon svg{width:20px;height:20px}
.email-pref-icon-accent{width:32px;height:32px;border-radius:8px;background:rgba(168,85,247,.16);color:#c4b5fd}
.email-pref-icon-accent svg{width:18px;height:18px}
.email-pref-label{flex:1;min-width:0}
.email-pref-label-strong{color:#e6ecff;font-weight:600;font-size:.95rem}
.email-pref-check{appearance:none;-webkit-appearance:none;width:20px;height:20px;border-radius:5px;border:1.5px solid rgba(120,140,200,.4);background:transparent;cursor:pointer;flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;transition:background .12s ease,border-color .12s ease}
.email-pref-check:checked{background:#a855f7;border-color:#a855f7}
.email-pref-check:checked::after{content:'';width:6px;height:11px;border:solid #fff;border-width:0 2px 2px 0;transform:rotate(45deg);margin-top:-2px}
.email-pref-check:hover{border-color:rgba(168,85,247,.7)}
.email-pref-check:disabled{cursor:default;opacity:.55}
.email-pref-select{flex-shrink:0;min-width:240px;padding:.5rem .75rem;background:#0a1226;color:#e6ecff;border:1px solid rgba(120,140,200,.35);border-radius:9px;font:inherit;font-size:.86rem;cursor:pointer}
.email-pref-select:hover{border-color:rgba(168,85,247,.55)}
.email-pref-footnote{display:flex;align-items:flex-start;gap:.55rem;margin:1rem 0 0;padding-top:.85rem;border-top:1px solid rgba(99,131,236,.14);font-size:.78rem;color:#8a99c2;line-height:1.45}
.email-pref-footnote-icon{flex-shrink:0;width:18px;height:18px;display:flex;align-items:center;justify-content:center;color:#7e8db1}
.email-pref-footnote-icon svg{width:16px;height:16px}
.light .email-pref-intro{color:#475569}
.light .email-pref-row{color:#0f172a;border-top-color:#e2e8f0}
.light .email-pref-list .email-pref-row{color:#334155}
.light .email-pref-label-strong{color:#0f172a}
.light .email-pref-icon{color:#64748b}
.light .email-pref-icon-accent{background:#ede9fe;color:#7c3aed}
.light .email-pref-check{border-color:#cbd5e1}
.light .email-pref-check:hover{border-color:#a855f7}
.light .email-pref-select{background:#fff;color:#0f172a;border-color:#cbd5e1}
.light .email-pref-footnote{color:#64748b;border-top-color:#e2e8f0}
.icon-gallery{display:grid;grid-template-columns:repeat(auto-fill,minmax(72px,1fr));gap:.5rem;margin:.4rem 0 .2rem;max-height:200px;overflow-y:auto;padding:.2rem}
.icon-gallery-tile{display:flex;flex-direction:column;align-items:center;gap:.3rem;padding:.5rem .25rem;border-radius:9px;background:rgba(10,18,38,.4);border:1px solid rgba(99,131,236,.12)}
.icon-gallery-tile .glass-ico{width:32px;height:32px;border-radius:8px}
.icon-gallery-tile .glass-ico svg{width:18px;height:18px;stroke-width:2}
.vocab-grid{display:flex;flex-direction:column;gap:.45rem;max-height:380px;overflow-y:auto;padding:.2rem .2rem .4rem;margin-top:.4rem}
.vocab-category-head{display:flex;align-items:center;justify-content:space-between;padding:.4rem .25rem .15rem;font-size:.7rem;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:#7e8db1;position:sticky;top:0;background:linear-gradient(180deg,#121b34 0%,#121b34 70%,rgba(18,27,52,0));z-index:1}
.vocab-category-name{}
.vocab-category-count{font-weight:500;color:#94a3b8;letter-spacing:.04em}
.vocab-category-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:.5rem}
.light .vocab-category-head{color:#475569;background:linear-gradient(180deg,#fff 0%,#fff 70%,rgba(255,255,255,0))}
.light .vocab-category-count{color:#64748b}
.vocab-tile{position:relative;display:flex;flex-direction:column;align-items:center;gap:.35rem;padding:.65rem .4rem .55rem;border-radius:10px;background:rgba(10,18,38,.45);border:1px solid rgba(99,131,236,.15)}
.vocab-tile.vocab-ai{border-color:rgba(59,130,246,.5)}
.vocab-tile.vocab-missing{opacity:.7}
.vocab-tile-ico{width:38px;height:38px;border-radius:9px}
.vocab-tile-ico svg{width:22px;height:22px;stroke-width:2.4}
.vocab-tile-name{font-size:.78rem;font-weight:600;color:#e6ecff;text-align:center;word-break:break-word}
.vocab-tile-badge{font-size:.6rem;font-weight:600;letter-spacing:.06em;text-transform:uppercase;padding:.1rem .4rem;border-radius:99px}
.vocab-badge-ai{background:rgba(59,130,246,.18);color:#93c5fd;border:1px solid rgba(59,130,246,.4)}
.vocab-badge-curated{background:rgba(34,197,94,.14);color:#86efac;border:1px solid rgba(34,197,94,.35)}
.vocab-badge-missing{background:rgba(120,140,200,.14);color:#94a3b8;border:1px solid rgba(120,140,200,.3)}
.vocab-tile-actions{display:flex;gap:.3rem;margin-top:.15rem}
.modal-card .vocab-tile-btn{width:26px;height:26px;padding:0;border-radius:7px;background:rgba(99,131,236,.14);border:1px solid rgba(99,131,236,.3);color:#cbd5ff;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;font-weight:500;letter-spacing:0;transition:filter .12s,background .12s,border-color .12s;flex:0 0 auto}
.modal-card .vocab-tile-btn svg{width:14px;height:14px;stroke-width:2;display:block}
.modal-card .vocab-tile-btn:hover{background:rgba(99,131,236,.3);border-color:rgba(99,131,236,.55);filter:none}
.modal-card .vocab-tile-btn.vocab-tile-del{background:rgba(239,68,68,.14);border-color:rgba(239,68,68,.32);color:#fca5a5}
.modal-card .vocab-tile-btn.vocab-tile-del:hover{background:rgba(239,68,68,.28);border-color:rgba(239,68,68,.55)}
.modal-card .vocab-tile-btn:disabled{opacity:.45;cursor:not-allowed}
.light .modal-card .vocab-tile-btn{background:#eff6ff;border-color:#bfdbfe;color:#1d4ed8}
.light .modal-card .vocab-tile-btn:hover{background:#dbeafe}
.light .modal-card .vocab-tile-btn.vocab-tile-del{background:#fef2f2;border-color:#fecaca;color:#b91c1c}
.light .modal-card .vocab-tile-btn.vocab-tile-del:hover{background:#fee2e2}
.light .vocab-tile{background:#fff;border-color:#e2e8f0}
.light .vocab-tile.vocab-ai{border-color:#3b82f6}
.light .vocab-tile-name{color:#0f172a}
.light .vocab-badge-ai{background:#dbeafe;color:#1d4ed8;border-color:#bfdbfe}
.light .vocab-badge-curated{background:#dcfce7;color:#15803d;border-color:#bbf7d0}
.light .vocab-badge-missing{background:#f1f5f9;color:#64748b;border-color:#cbd5e1}
.ai-gallery-thumb{width:48px;height:48px;border-radius:9px;background:#fff;border:1px solid rgba(99,131,236,.15);display:flex;align-items:center;justify-content:center;overflow:hidden}
.ai-gallery-thumb img{width:100%;height:100%;object-fit:contain}
.light .ai-gallery-thumb{background:#f8fafc;border-color:#e2e8f0}
.icon-gallery-label{font-size:.7rem;color:#94a3b8;font-weight:500;text-align:center;word-break:break-word}
.icon-gallery-name{font-size:.72rem;color:#e6ecff;font-weight:600;text-align:center;word-break:break-word}
.icon-gallery-sublabel{font-size:.62rem;color:#7e8db1;text-align:center;word-break:break-word;line-height:1.2;margin-top:.05rem}
.light .icon-gallery-name{color:#0f172a}
.light .icon-gallery-sublabel{color:#64748b}
.light .icon-gallery-tile{background:#fff;border-color:#e2e8f0}
.light .icon-gallery-label{color:#475569}
.icon-progress-list{display:flex;flex-direction:column;gap:.3rem;margin:.5rem 0;max-height:180px;overflow-y:auto}
.icon-progress-row{display:grid;grid-template-columns:18px 1fr auto;gap:.5rem;align-items:center;padding:.35rem .5rem;border-radius:7px;background:rgba(10,18,38,.4);border:1px solid rgba(99,131,236,.1);font-size:.82rem}
.icon-progress-row.active{background:rgba(59,130,246,.12);border-color:rgba(59,130,246,.45)}
.icon-progress-row.done{opacity:.78}
.icon-progress-status{font-size:.7rem;font-weight:600;color:#94a3b8;letter-spacing:.04em;text-transform:uppercase}
.icon-progress-row.active .icon-progress-status{color:#93c5fd}
.icon-progress-row.done .icon-progress-status{color:#86efac}
.icon-progress-row.reused .icon-progress-status{color:#cbd5ff}
.icon-progress-row.failed .icon-progress-status{color:#fca5a5}
.icon-progress-dot{width:8px;height:8px;border-radius:50%;background:#475569;justify-self:center}
.icon-progress-row.active .icon-progress-dot{background:#3b82f6;animation:pulseDot 1s ease-in-out infinite}
.icon-progress-row.done .icon-progress-dot{background:#22c55e}
.icon-progress-row.reused .icon-progress-dot{background:#a78bfa}
.icon-progress-row.failed .icon-progress-dot{background:#ef4444}
@keyframes pulseDot{0%,100%{opacity:1;transform:scale(1)}50%{opacity:.5;transform:scale(1.4)}}
.mic-wrap{position:relative;display:flex;align-items:stretch}
.mic-wrap > input,.mic-wrap > textarea{flex:1;width:100%;padding-right:36px}
.mic-btn,.modal-card .mic-btn{position:absolute;top:50%;right:.4rem;transform:translateY(-50%);width:26px;height:26px;min-width:0;min-height:0;padding:0;margin:0;border-radius:7px;border:1px solid rgba(99,131,236,.3);background:rgba(99,131,236,.14);color:#cbd5ff;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;flex-shrink:0;box-sizing:border-box;font-family:inherit;font-size:0;line-height:1;letter-spacing:0;font-weight:500;transition:filter .12s,background .12s,border-color .12s}
.mic-btn svg,.modal-card .mic-btn svg{width:14px;height:14px;display:block;color:inherit}
.mic-btn:hover,.modal-card .mic-btn:hover{background:rgba(99,131,236,.28);filter:none}
.mic-wrap > textarea + .mic-btn,.modal-card .mic-wrap > textarea + .mic-btn{top:.5rem;transform:none}
.mic-btn.mic-recording,.modal-card .mic-btn.mic-recording{background:#ef4444;border-color:#dc2626;color:#fff;animation:micPulse 1s ease-in-out infinite}
.mic-btn.mic-busy,.modal-card .mic-btn.mic-busy{background:rgba(168,85,247,.32);border-color:rgba(168,85,247,.55);color:#fff;animation:micSpin 1s linear infinite}
@keyframes micPulse{0%,100%{box-shadow:0 0 0 0 rgba(239,68,68,.55)}50%{box-shadow:0 0 0 6px rgba(239,68,68,0)}}
@keyframes micSpin{to{transform:translateY(-50%) rotate(360deg)}}
.mic-wrap > textarea + .mic-btn.mic-busy,.modal-card .mic-wrap > textarea + .mic-btn.mic-busy{animation:micSpinTextarea 1s linear infinite}
@keyframes micSpinTextarea{to{transform:rotate(360deg)}}
.light .mic-btn,.light .modal-card .mic-btn{background:#eff6ff;border-color:#bfdbfe;color:#1d4ed8}
.light .mic-btn:hover,.light .modal-card .mic-btn:hover{background:#dbeafe}
.light .mic-btn.mic-recording,.light .modal-card .mic-btn.mic-recording{background:#ef4444;border-color:#dc2626;color:#fff}
.ai-transcript{display:flex;flex-direction:column;gap:.5rem;max-height:48vh;min-height:200px;overflow-y:auto;padding:.85rem 1rem;border-radius:12px;background:rgba(10,18,38,.55);border:1px solid rgba(99,131,236,.18);margin-bottom:.7rem}
.ai-transcript-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;color:#7e8db1;font-size:.85rem;padding:1.5rem 1rem;gap:.5rem;flex:1}
.ai-transcript-empty .ai-empty-ico{width:42px;height:42px;border-radius:11px;background:rgba(168,85,247,.18);border:1px solid rgba(168,85,247,.35);color:#c4b5fd;display:flex;align-items:center;justify-content:center}
.ai-transcript-empty .ai-empty-ico svg{width:22px;height:22px}
.ai-transcript-empty h4{margin:.2rem 0 0;font-size:.95rem;font-weight:600;color:#dde6ff}
.ai-transcript-empty p{margin:0;max-width:340px;line-height:1.45}
.ai-msg{padding:.55rem .85rem;border-radius:12px;font-size:.88rem;line-height:1.45;max-width:100%;white-space:pre-wrap;word-wrap:break-word}
.ai-msg-user{align-self:flex-end;background:rgba(59,130,246,.22);border:1px solid rgba(59,130,246,.4);color:#e6ecff;max-width:80%}
.ai-msg-assistant{align-self:flex-start;background:rgba(168,85,247,.16);border:1px solid rgba(168,85,247,.32);color:#f3f6ff;max-width:90%}
.ai-msg-pulse{opacity:.7;animation:micPulse 1.2s ease-in-out infinite}
.ai-msg-tool{align-self:flex-start;display:inline-flex;align-items:baseline;gap:.5rem;padding:.3rem .6rem;border-radius:7px;background:rgba(20,28,55,.6);border:1px dashed rgba(99,131,236,.3);font-size:.74rem;color:#a5b4d6;font-family:var(--font-base);max-width:100%}
.ai-tool-label{color:#cbd5ff;font-style:italic;letter-spacing:.01em}
.ai-input-row{display:flex;gap:.5rem;align-items:stretch}
.ai-input-row > .mic-wrap{flex:1;min-width:0;display:flex;align-items:stretch}
.ai-input-row textarea{flex:1;width:100%;padding:.6rem .8rem;padding-right:36px;border-radius:10px;background:#0a1226;color:#fff;border:1px solid #384b75;font-family:inherit;font-size:.9rem;resize:none;min-height:60px;max-height:160px;outline:none;line-height:1.4;box-sizing:border-box}
.ai-input-row textarea:focus{border-color:#a855f7;box-shadow:0 0 0 2px rgba(168,85,247,.18)}
.modal-card #aiSendBtn{flex:0 0 auto;width:auto;padding:0 1.1rem;min-height:60px;border-radius:10px;background:linear-gradient(135deg,#a855f7,#7c3aed);border-color:transparent;color:#fff;font-weight:600;font-size:.88rem;cursor:pointer;letter-spacing:.01em;font-family:inherit}
.modal-card #aiSendBtn:hover{filter:brightness(1.08)}
.modal-card #aiSendBtn:disabled{opacity:.5;cursor:not-allowed;filter:none}
.ai-input-row > .mic-wrap > textarea + .mic-btn{top:.55rem;right:.45rem;transform:none}
.ai-hint{font-size:.74rem;margin-top:.45rem;color:#7e8db1}
.ai-hint a{color:#c4b5fd}
.ai-prompt-label{margin:.4rem 0 .15rem;font-size:.72rem;text-transform:uppercase;letter-spacing:.06em;color:#7e8db1}
.ai-prompt-chips{display:flex;flex-wrap:wrap;gap:.4rem;justify-content:center;max-width:420px}
.ai-prompt-chip{padding:.35rem .7rem;border-radius:999px;background:rgba(99,131,236,.12);border:1px solid rgba(99,131,236,.3);color:#cbd5ff;font-size:.78rem;cursor:pointer;font-family:inherit}
.ai-prompt-chip:hover{background:rgba(168,85,247,.18);border-color:rgba(168,85,247,.45);color:#f3f6ff}
.light .ai-prompt-chip{background:#eef2ff;border-color:#c7d2fe;color:#1e293b}
.light .ai-prompt-chip:hover{background:#e0e7ff;border-color:#a5b4fc}
.modal-card.ai-modal-card{width:min(720px,94vw)}
.light .ai-transcript{background:#f8fafc;border-color:#e2e8f0}
.light .ai-transcript-empty{color:#64748b}
.light .ai-transcript-empty .ai-empty-ico{background:#ede9fe;border-color:#ddd6fe;color:#6d28d9}
.light .ai-transcript-empty h4{color:#0f172a}
.light .ai-msg-user{background:#dbeafe;border-color:#bfdbfe;color:#0f172a}
.light .ai-msg-assistant{background:#ede9fe;border-color:#ddd6fe;color:#0f172a}
.light .ai-msg-tool{background:#f1f5f9;border-color:#cbd5e1;color:#475569}
.light .ai-tool-label{color:#1d4ed8}
.light .ai-input-row textarea{background:#fff;color:#0f172a;border-color:#cbd5e1}
.light .ai-hint{color:#64748b}
.ai-export-overlay{position:fixed;inset:0;background:rgba(0,0,0,.6);display:flex;align-items:center;justify-content:center;z-index:60}
.ai-export-card{background:#121b34;border:1px solid #354a78;border-radius:14px;padding:1.5rem 2rem;text-align:center;min-width:300px;box-shadow:0 18px 50px rgba(0,0,0,.55)}
.ai-export-spin{width:42px;height:42px;border:3px solid rgba(99,131,236,.18);border-top-color:#3b82f6;border-radius:50%;margin:0 auto .85rem;animation:aiSpin 1s linear infinite}
.ai-export-msg{font-weight:500;font-size:.95rem;color:#e6ecff;margin:.4rem 0}
.ai-export-sub{font-size:.78rem;color:#94a3b8}
@keyframes aiSpin{to{transform:rotate(360deg)}}
.light .ai-export-card{background:#fff;border-color:#e2e8f0;color:#0f172a}
.light .ai-export-msg{color:#0f172a}
.light .ai-export-sub{color:#64748b}
.light .modal-card{background:#fff;border-color:#e2e8f0;color:#0f172a}
.light .modal-card input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=range]):not([type=color]),.light .modal-card textarea{background:#f8fafc;color:#0f172a;border-color:#cbd5e1}
.light .settings-section{background:#f8fafc;border-color:#e2e8f0}
.light .settings-section-label{color:#64748b}
.light .icon-progress-row{background:#fff;border-color:#e2e8f0}
.light .modal-card button.secondary{color:#475569;border-color:#cbd5e1}
.light .modal-card button.secondary:hover{background:#f1f5f9}
.search-palette{position:fixed;inset:0;background:rgba(0,0,0,.55);display:flex;align-items:flex-start;justify-content:center;padding-top:10vh;z-index:60}
.search-palette.hidden{display:none}
.search-palette-card{width:min(620px,94vw);max-height:70vh;display:flex;flex-direction:column;background:#1a2440;border:1px solid #2c3a64;border-radius:14px;box-shadow:0 18px 50px rgba(0,0,0,.55);overflow:hidden}
.search-palette-card #searchInput{padding:.85rem 1rem;background:transparent;color:#e6ecff;border:none;border-bottom:1px solid rgba(99,131,236,.15);font-size:1rem;outline:none;border-radius:0;margin:0}
.search-filters{display:flex;gap:.35rem;padding:.5rem 1rem;border-bottom:1px solid rgba(99,131,236,.15)}
.search-filter{padding:.28rem .7rem;border-radius:999px;border:1px solid rgba(99,131,236,.28);background:transparent;color:#a8b3d4;font:inherit;font-size:.78rem;font-weight:600;cursor:pointer;transition:background .12s,color .12s,border-color .12s}
.search-filter:hover{background:rgba(99,131,236,.12);color:#e6ecff}
.search-filter.active{background:linear-gradient(135deg,#a855f7,#7c3aed);border-color:transparent;color:#fff}
.light .search-filter{color:#64748b;border-color:#cbd5e1}
.light .search-filter:hover{background:#f1f5f9;color:#0f172a}
.light .search-filter.active{color:#fff}
.search-results{overflow-y:auto;flex:1;min-height:0;padding:.35rem 0}
.search-result{padding:.6rem 1rem;cursor:pointer;display:flex;flex-direction:column;gap:.18rem;border-left:3px solid transparent}
.search-result:hover, .search-result.active{background:rgba(168,85,247,.10);border-left-color:#a855f7}
.search-row1{display:flex;align-items:center;gap:.55rem;font-size:.92rem;color:#eef2ff}
.search-row2{font-size:.74rem;color:#8a99c2;padding-left:1.4rem}
.search-dot{width:8px;height:8px;border-radius:50%;display:inline-block;flex-shrink:0}
.search-kind{font-size:.65rem;letter-spacing:.08em;color:#7e8db1;font-weight:700;text-transform:uppercase;padding:.05rem .35rem;background:rgba(99,131,236,.12);border-radius:4px}
.search-title{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:600}
.search-empty{padding:1.5rem 1rem;color:#7e8db1;font-size:.88rem;text-align:center}
.search-hint{padding:.5rem 1rem;border-top:1px solid rgba(99,131,236,.15);font-size:.72rem;color:#7e8db1;background:rgba(10,18,38,.4)}
.doc-section-flash{outline:2px solid #a855f7;outline-offset:4px;animation:secflash 1.2s ease-out}
@keyframes secflash{0%{outline-color:#a855f7}100%{outline-color:transparent}}
.light .search-palette-card{background:#fff;border-color:#cbd5e1}
.light .search-palette-card #searchInput{color:#0f172a;border-bottom-color:#e2e8f0}
.light .search-result:hover, .light .search-result.active{background:rgba(168,85,247,.08)}
.light .search-row1{color:#0f172a}
.light .search-row2{color:#64748b}
.light .search-kind{color:#475569;background:rgba(99,131,236,.1)}
.light .search-empty{color:#64748b}
.light .search-hint{color:#64748b;background:#f8fafc;border-top-color:#e2e8f0}
.row{display:flex;gap:.5rem}.hidden{display:none !important}.card{background:#121b34;padding:1rem;border-radius:10px}.stack input{width:100%;margin:.35rem 0;padding:.6rem}.secondary{background:transparent;border:1px solid #4a6299;color:#dce6ff}.danger-btn{background:#b91c1c !important;border-color:#dc2626 !important;color:#fff !important}.danger-btn:hover{background:#dc2626 !important}
@media(max-width:600px){.map-layout{grid-template-columns:1fr}.map-details{display:none}.map-node{width:170px}}

.empty-state{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.75rem;text-align:center;background:radial-gradient(ellipse at 50% 30%,rgba(168,85,247,.10),rgba(8,12,28,.55) 65%);padding:1.5rem;overflow-y:auto}
.empty-state .empty-illustration{width:96px;height:96px;display:flex;align-items:center;justify-content:center;margin-bottom:.3rem}
.empty-state .empty-illustration svg{width:100%;height:100%}
.empty-state h2{margin:0;font-size:1.55rem;font-weight:700;color:#f3f6ff;letter-spacing:-.01em}
.empty-state .empty-tagline{max-width:520px;margin:0;color:#a8b3d4;font-size:.95rem;line-height:1.5}
.empty-state .empty-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:.75rem;width:min(720px,92%);margin:.4rem 0 .2rem}
.empty-state .empty-card{display:flex;align-items:flex-start;gap:.7rem;padding:.85rem .9rem;border-radius:11px;border:1px solid rgba(99,131,236,.28);background:rgba(20,28,55,.6);color:#e6ecff;text-align:left;cursor:pointer;font:inherit;transition:transform .12s ease,border-color .12s ease,background .12s ease;backdrop-filter:blur(8px);min-height:0}
.empty-state .empty-card:hover{transform:translateY(-2px);border-color:rgba(168,85,247,.55);background:rgba(28,38,72,.75)}
.empty-state .empty-card-ico{flex:0 0 36px;width:36px;height:36px;border-radius:9px;background:rgba(168,85,247,.18);color:#c4b5fd;display:flex;align-items:center;justify-content:center}
.empty-state .empty-card-ico svg{width:20px;height:20px}
.empty-state .empty-card-body{display:flex;flex-direction:column;gap:.15rem;min-width:0}
.empty-state .empty-card-body strong{color:#f3f6ff;font-size:.95rem;font-weight:700}
.empty-state .empty-card-body span{color:#9aa8cf;font-size:.8rem;line-height:1.4}
.empty-state .empty-card-primary{background:linear-gradient(135deg,rgba(168,85,247,.22),rgba(124,58,237,.18));border-color:rgba(168,85,247,.55)}
.empty-state .empty-card-primary .empty-card-ico{background:rgba(168,85,247,.32);color:#fff}
.empty-state small.muted{font-size:.78rem;color:#7e8db1}
.empty-pending-invites{width:min(560px,92%);margin:0 0 .9rem;padding:1rem 1.1rem;border-radius:12px;border:1px solid rgba(168,85,247,.45);background:linear-gradient(135deg,rgba(168,85,247,.16),rgba(124,58,237,.10));text-align:left;backdrop-filter:blur(8px)}
.empty-pending-invites h3{margin:0 0 .25rem;font-size:1rem;font-weight:700;color:#f3f6ff}
.empty-pending-invites .muted{margin:0 0 .65rem;font-size:.82rem;color:#cbd5e1}
.empty-invite-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.45rem}
.empty-invite-row{display:flex;align-items:center;gap:.6rem;padding:.6rem .75rem;border-radius:9px;background:rgba(8,12,28,.55);border:1px solid rgba(99,131,236,.24)}
.empty-invite-meta{flex:1;min-width:0;display:flex;flex-direction:column;gap:.1rem}
.empty-invite-name{color:#f3f6ff;font-size:.9rem;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.empty-invite-role{font-size:.74rem;color:#9aa8cf;text-transform:uppercase;letter-spacing:.04em}
.empty-invite-actions{display:flex;gap:.4rem;flex-shrink:0}
.empty-invite-accept,.empty-invite-decline{padding:.35rem .85rem;border-radius:7px;font:inherit;font-size:.8rem;font-weight:600;cursor:pointer;border:1px solid transparent}
.empty-invite-accept{background:linear-gradient(135deg,#a855f7,#7c3aed);color:#fff}
.empty-invite-accept:hover{filter:brightness(1.08)}
.empty-invite-accept:disabled{opacity:.55;cursor:default}
.empty-invite-decline{background:transparent;color:#cbd5e1;border-color:rgba(120,140,200,.35)}
.empty-invite-decline:hover{background:rgba(154,168,207,.1);color:#fff}
.empty-invite-decline:disabled{opacity:.55;cursor:default}
.light .empty-pending-invites{background:linear-gradient(135deg,#f5f3ff,#ede9fe);border-color:#c4b5fd}
.light .empty-pending-invites h3{color:#0f172a}
.light .empty-pending-invites .muted{color:#475569}
.light .empty-invite-row{background:#fff;border-color:#e2e8f0}
.light .empty-invite-name{color:#0f172a}
.light .empty-invite-role{color:#64748b}
.light .empty-invite-decline{color:#475569;border-color:#cbd5e1}
.light .empty-invite-decline:hover{background:#f8fafc;color:#0f172a}
.empty-state small.muted strong{color:#dde6ff;font-weight:700;background:rgba(99,131,236,.18);padding:.05em .35em;border-radius:4px}
.light .empty-state{background:radial-gradient(ellipse at 50% 30%,rgba(168,85,247,.10),rgba(248,250,252,.85) 65%)}
.light .empty-state .empty-illustration{background:none;box-shadow:none}
.light .empty-state h2{color:#0f172a}
.light .empty-state .empty-tagline{color:#475569}
.light .empty-state .empty-card{background:#ffffff;border-color:#e2e8f0;color:#0f172a}
.light .empty-state .empty-card:hover{border-color:#a855f7;background:#fafafa}
.light .empty-state .empty-card-ico{background:#ede9fe;color:#6d28d9}
.light .empty-state .empty-card-body strong{color:#0f172a}
.light .empty-state .empty-card-body span{color:#64748b}
.light .empty-state .empty-card-primary{background:linear-gradient(135deg,#ede9fe,#f5f3ff);border-color:#a855f7}
.light .empty-state .empty-card-primary .empty-card-ico{background:#7c3aed;color:#fff}
.light .empty-state small.muted{color:#64748b}
.light .empty-state small.muted strong{color:#0f172a;background:#e2e8f0}

/* Doc-view empty states */
.doc-empty{padding:3rem 1.2rem;text-align:center;color:#cbd5ff;display:flex;flex-direction:column;align-items:center;gap:.65rem}
.doc-empty .doc-empty-ico{width:60px;height:60px;color:#a855f7;opacity:.8;margin-bottom:.4rem}
.doc-empty h2{margin:0;font-size:1.25rem;font-weight:700;color:#f3f6ff}
.doc-empty p{margin:0;max-width:480px;color:#9aa8cf;font-size:.92rem;line-height:1.5}
.doc-empty-actions{display:flex;flex-wrap:wrap;gap:.5rem;justify-content:center;margin-top:.6rem}
.doc-empty-cta{font:inherit;font-size:.86rem;font-weight:500;padding:.5rem .95rem;border-radius:8px;border:1px solid rgba(99,131,236,.32);background:rgba(20,28,55,.6);color:#e6ecff;cursor:pointer;transition:background .12s ease,border-color .12s ease}
.doc-empty-cta:hover{background:rgba(28,38,72,.85);border-color:rgba(168,85,247,.5)}
.doc-empty-cta.primary{background:linear-gradient(135deg,#a855f7,#7c3aed);color:#fff;border-color:transparent;font-weight:600;box-shadow:0 6px 16px rgba(168,85,247,.28)}
.doc-empty-cta.primary:hover{filter:brightness(1.07)}
.light .doc-empty h2{color:#0f172a}
.light .doc-empty p{color:#64748b}
.light .doc-empty .doc-empty-ico{color:#7c3aed}
.light .doc-empty-cta{background:#fff;color:#334155;border-color:#cbd5e1}
.light .doc-empty-cta:hover{background:#f8fafc;border-color:#a855f7}
.light .doc-empty-cta.primary{background:linear-gradient(135deg,#a855f7,#7c3aed);color:#fff;border-color:transparent}

.doc-section-empty{margin:1rem 0 1.5rem;padding:1.6rem 1.2rem;border:1px dashed rgba(99,131,236,.32);border-radius:14px;background:rgba(20,28,55,.35);display:flex;flex-direction:column;align-items:center;gap:.55rem;text-align:center}
.doc-section-empty .doc-section-empty-ico{width:48px;height:48px;color:#a855f7;opacity:.7}
.doc-section-empty strong{color:#f3f6ff;font-size:1.02rem;font-weight:700}
.doc-section-empty p{margin:0;max-width:460px;color:#9aa8cf;font-size:.88rem;line-height:1.5}
.light .doc-section-empty{background:#fafafa;border-color:#cbd5e1}
.light .doc-section-empty strong{color:#0f172a}
.light .doc-section-empty p{color:#64748b}
.light .doc-section-empty .doc-section-empty-ico{color:#7c3aed}

/* Search palette empty / no-results */
.search-empty.search-empty-hint{padding:1.4rem 1rem 1.6rem;text-align:center;color:#cbd5ff}
.search-empty-title{font-size:.95rem;font-weight:600;color:#f3f6ff;margin-bottom:.3rem}
.search-empty-sub{font-size:.82rem;color:#9aa8cf;line-height:1.45;max-width:380px;margin:0 auto}
.light .search-empty-title{color:#0f172a}
.light .search-empty-sub{color:#64748b}
.tab{font-weight:600}

#app{flex:1;min-height:0;}
.map-layout{height:100% !important;min-height:0;}
.map-viewport{height:100%;}
.map-details{height:100%;}

/* position:relative + z-index + its own compositing layer (translateZ) keep the
   toolbar painted ONCE on a stable layer. Without this the Android WebView
   re-rasters it into the scrolling Doc layer beneath, leaving ghost copies of
   the bar (and its "17" badge) smeared down the page while scrolling. */
.tabbar-wrap{display:flex;align-items:center;flex-wrap:wrap;row-gap:.4rem;gap:.45rem;padding:.5rem .65rem;background:var(--panel);border-bottom:1px solid var(--line);min-height:52px;position:relative;z-index:5;transform:translateZ(0)}
.tabbar-wrap > .toolbar-divider{width:1px;align-self:stretch;margin:.3rem .15rem;background:rgba(99,131,236,.2)}
.light .tabbar-wrap > .toolbar-divider{background:#e2e8f0}
.view-toggle{display:inline-flex;gap:0;background:rgba(99,131,236,.1);border:1px solid rgba(99,131,236,.2);border-radius:9px;padding:2px;flex:0 0 auto}
.view-toggle button{background:transparent;border:none;color:#a8b3d4;padding:.32rem .75rem;font-size:.82rem;border-radius:7px;cursor:pointer;font-weight:500;font-family:inherit;transition:background .12s,color .12s}
.view-toggle button.active{background:linear-gradient(135deg,#a855f7,#7c3aed);color:#fff;box-shadow:0 1px 3px rgba(168,85,247,.32)}
.view-toggle button:hover:not(.active){color:#f3f6ff;background:rgba(99,131,236,.1)}
.light .view-toggle{background:#f1f5f9;border-color:#e2e8f0}
.light .view-toggle button{color:#64748b}
.light .view-toggle button.active{background:linear-gradient(135deg,#a855f7,#7c3aed);color:#fff}
.light .view-toggle button:hover:not(.active){color:#0f172a;background:rgba(168,85,247,.08)}
.doc-view{position:absolute;inset:0;overflow-y:auto;padding:1.5rem 1.8rem;background:var(--bg);color:#e6ecff}
.doc-view.hidden{display:none}
.doc-page{display:grid;grid-template-columns:1fr 280px;gap:1.5rem;align-items:start;max-width:1400px;margin:0 auto}
@media(max-width:900px){.doc-page{grid-template-columns:1fr}}
.doc-page-head{margin:0 0 1.4rem;padding:0 0 1rem;border-bottom:1px solid rgba(120,140,200,.15)}
.doc-title-row{display:flex;align-items:center;gap:1rem;flex-wrap:wrap}
.doc-title-icon{width:54px;height:54px;border-radius:16px;display:flex;align-items:center;justify-content:center;font-size:1.6rem;flex-shrink:0;background:#dbeafe;border:1px solid #bfdbfe;color:#1d4ed8;box-shadow:0 2px 4px rgba(15,23,60,.08)}
.doc-title-icon.violet{background:#ede9fe;border-color:#ddd6fe;color:#6d28d9}
.doc-title-icon.green{background:#dcfce7;border-color:#bbf7d0;color:#15803d}
.doc-title-icon.amber{background:#fef3c7;border-color:#fde68a;color:#b45309}
.doc-title-icon.red{background:#fee2e2;border-color:#fecaca;color:#b91c1c}
.doc-title-icon.blue{background:#dbeafe;border-color:#bfdbfe;color:#1d4ed8}
.doc-title-row h1{margin:0;font-size:1.85rem;font-weight:800;color:#f3f6ff;line-height:1.15}
.doc-status-bar{display:flex;flex-wrap:wrap;gap:1.25rem;margin-top:1rem;padding:.7rem 1rem;background:rgba(20,28,55,.55);border:1px solid rgba(99,131,236,.18);border-radius:12px;font-size:.88rem;color:#bfc8e2}
.doc-status-item{display:inline-flex;align-items:center;gap:.45rem}
.doc-status-item strong{color:#eef2ff;font-weight:700}
.doc-dot{display:inline-block;width:9px;height:9px;border-radius:50%;box-shadow:0 0 8px currentColor}
.doc-pill{display:inline-block;padding:.22rem .65rem;border-radius:99px;font-size:.7rem;font-weight:700;letter-spacing:.04em;text-transform:uppercase}
.doc-main{display:flex;flex-direction:column;gap:1rem}
.doc-section{background:linear-gradient(180deg,rgba(28,34,62,.85),rgba(20,25,48,.92));border:1.5px solid rgba(99,131,236,.25);border-radius:14px;padding:1rem 1.2rem;box-shadow:0 6px 22px rgba(0,8,40,.4)}
.doc-section.status-completed{border-left:5px solid #22c55e}
.doc-section.status-pending{border-left:5px solid #f59e0b}
.doc-section.status-uncompleted{border-left:5px solid #ef4444}
.doc-section-bar{display:grid;grid-template-columns:18px 42px 1fr auto;align-items:center;gap:.6rem;margin:-.4rem -.4rem .8rem;padding:.65rem .8rem;border-radius:10px}
.doc-drag-handle{cursor:grab;color:#7e8db1;display:inline-flex;align-items:center;justify-content:center;width:18px;height:24px;padding:0;border-radius:5px;line-height:1;user-select:none;transition:color .12s,background .12s}
.doc-drag-handle svg{width:14px;height:14px;display:block}
.doc-drag-handle:hover{color:#c4b5fd;background:rgba(168,85,247,.1)}
.doc-drag-handle:active{cursor:grabbing}
.doc-section.doc-dragging{opacity:.4}
.doc-section.doc-drop-target{box-shadow:0 -3px 0 0 #a855f7,0 4px 22px rgba(0,8,40,.55)}
.light .doc-drag-handle{color:#64748b}
.light .doc-drag-handle:hover{color:#5b21b6;background:rgba(168,85,247,.08)}
.doc-section-bar.bar-violet{background:linear-gradient(90deg,rgba(168,85,247,.18),rgba(168,85,247,.04))}
.doc-section-bar.bar-blue{background:linear-gradient(90deg,rgba(59,130,246,.18),rgba(59,130,246,.04))}
.doc-section-bar.bar-green{background:linear-gradient(90deg,rgba(34,197,94,.18),rgba(34,197,94,.04))}
.doc-section-bar.bar-amber{background:linear-gradient(90deg,rgba(245,158,11,.18),rgba(245,158,11,.04))}
.doc-section-bar.bar-red{background:linear-gradient(90deg,rgba(239,68,68,.18),rgba(239,68,68,.04))}
.light .doc-section-bar.bar-violet{background:linear-gradient(90deg,rgba(168,85,247,.22),rgba(168,85,247,.06))}
.light .doc-section-bar.bar-blue{background:linear-gradient(90deg,rgba(59,130,246,.22),rgba(59,130,246,.06))}
.light .doc-section-bar.bar-green{background:linear-gradient(90deg,rgba(34,197,94,.22),rgba(34,197,94,.06))}
.light .doc-section-bar.bar-amber{background:linear-gradient(90deg,rgba(245,158,11,.22),rgba(245,158,11,.06))}
.light .doc-section-bar.bar-red{background:linear-gradient(90deg,rgba(239,68,68,.22),rgba(239,68,68,.06))}
.light .doc-section-bar{border:1px solid rgba(15,23,60,.08)}
.light .doc-section-bar.bar-violet{border-color:rgba(168,85,247,.32)}
.light .doc-section-bar.bar-blue{border-color:rgba(59,130,246,.32)}
.light .doc-section-bar.bar-green{border-color:rgba(34,197,94,.32)}
.light .doc-section-bar.bar-amber{border-color:rgba(245,158,11,.32)}
.light .doc-section-bar.bar-red{border-color:rgba(239,68,68,.35)}
.light .doc-section{background:#fff;border:1px solid #e2e8f0;border-radius:14px;padding:1rem 1.1rem;margin-bottom:1rem;box-shadow:0 1px 2px rgba(15,23,60,.04)}
.light .doc-section-title h2{color:#0f172a}
.light .doc-section-meta{color:#475569}
.doc-flow{display:flex;align-items:stretch;gap:.6rem;margin-top:.8rem;flex-wrap:wrap}
.doc-flow-step{flex:1 1 140px;min-width:130px;display:flex;flex-direction:column;gap:.4rem;padding:.7rem .8rem;background:rgba(15,21,46,.65);border:1.5px solid rgba(99,131,236,.2);border-radius:10px;align-items:center;text-align:center;position:relative}
.doc-flow-step.status-completed{border-color:rgba(34,197,94,.5);background:rgba(34,197,94,.05)}
.doc-flow-step.status-pending{border-color:rgba(245,158,11,.5);background:rgba(245,158,11,.05)}
.doc-flow-step.status-uncompleted{border-color:rgba(239,68,68,.5);background:rgba(239,68,68,.05)}
.doc-flow-icon{width:36px;height:36px;border-radius:50%;background:linear-gradient(135deg,#3b82f6,#2563eb);display:flex;align-items:center;justify-content:center;font-size:1.05rem;color:#fff;flex-shrink:0;box-shadow:0 4px 12px rgba(59,130,246,.3)}
.doc-flow-step.status-completed .doc-flow-icon{background:linear-gradient(135deg,#22c55e,#16a34a);box-shadow:0 4px 12px rgba(34,197,94,.3)}
.doc-flow-step.status-pending .doc-flow-icon{background:linear-gradient(135deg,#f59e0b,#d97706);box-shadow:0 4px 12px rgba(245,158,11,.3)}
.doc-flow-step.status-uncompleted .doc-flow-icon{background:linear-gradient(135deg,#ef4444,#dc2626);box-shadow:0 4px 12px rgba(239,68,68,.3)}
.doc-flow-step strong{font-size:.82rem;line-height:1.3;color:#eef2ff}
.doc-flow-meta{font-size:.65rem}
.doc-flow-notes{font-size:.72rem;color:#a8b3d4;line-height:1.4;margin-top:.25rem}
.doc-flow-arrow{display:flex;align-items:center;color:#7e8db1;font-size:1.4rem;font-weight:700;flex:0 0 auto}
.doc-plan{display:flex;flex-wrap:wrap;align-items:center;gap:.45rem;margin-top:.8rem;padding:.85rem 1rem;background:linear-gradient(180deg,rgba(245,158,11,.05),rgba(245,158,11,.02));border:1px solid rgba(245,158,11,.25);border-radius:12px}
.doc-plan-step{flex:1 1 120px;min-width:110px;display:flex;flex-direction:column;align-items:center;text-align:center;gap:.3rem;padding:.5rem .55rem;background:rgba(20,28,55,.5);border:1px solid rgba(99,131,236,.2);border-radius:9px}
.doc-plan-step .doc-flow-icon{width:34px;height:34px;font-size:1rem;background:linear-gradient(135deg,#f59e0b,#d97706)}
.doc-plan-step strong{font-size:.78rem;line-height:1.3}
.doc-plan-step.status-completed{border-color:rgba(34,197,94,.4);background:rgba(34,197,94,.05)}
.doc-plan-step.status-completed .doc-flow-icon{background:linear-gradient(135deg,#22c55e,#16a34a)}
.doc-plan-arrow{color:#a8b3d4;font-size:1.1rem;flex:0 0 auto}
.layout-callout .doc-section-body{background:rgba(99,131,236,.06);border:1px solid rgba(99,131,236,.2);border-radius:10px;padding:.85rem 1rem}
.doc-icon-img{width:100%;height:100%;object-fit:contain;border-radius:inherit;display:block;mix-blend-mode:screen;filter:contrast(1.05) brightness(1.04)}
.light .doc-icon-img{mix-blend-mode:multiply;filter:contrast(1.05)}
.doc-section-icon, .doc-title-icon{overflow:hidden}
.doc-section-icon svg{width:62%;height:62%;color:inherit;stroke-width:2.4}
.doc-title-icon svg{width:60%;height:60%;color:inherit;stroke-width:2.4}
.ai-icon-img{width:82%;height:82%;object-fit:contain;display:block;mix-blend-mode:multiply;filter:contrast(1.25) brightness(.92)}
.light .ai-icon-img{mix-blend-mode:multiply}
.glass-ico .ai-icon-img,.doc-map-ico .ai-icon-img{width:80%;height:80%}
.doc-map-ico svg{width:62%;height:62%;color:inherit;stroke-width:2.4}
.doc-flow-icon svg{width:55%;height:55%;color:#fff}
.doc-cmp-icon svg{width:60%;height:60%;color:inherit}
.doc-status-bar svg{width:14px;height:14px;color:currentColor;vertical-align:middle}
.doc-status-svg{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;border-radius:6px;background:#dbeafe;border:1px solid #bfdbfe;color:#1d4ed8;flex-shrink:0;margin-right:.15rem;overflow:hidden}
.doc-status-svg svg{width:14px;height:14px;stroke-width:2}
.doc-status-svg .ai-icon-img{width:80%;height:80%}
.doc-status-item:nth-child(2) .doc-status-svg{background:#dbeafe;border-color:#bfdbfe;color:#1d4ed8}
.doc-status-item:nth-child(3) .doc-status-svg{background:#dcfce7;border-color:#bbf7d0;color:#15803d}
.doc-status-item:nth-child(4) .doc-status-svg{background:#ede9fe;border-color:#ddd6fe;color:#6d28d9}
.doc-side-h-ico{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;margin-right:.4rem;color:#cbd5e1;vertical-align:middle}
.doc-side-h-ico svg{width:100%;height:100%}
.doc-filter-dot{display:inline-block;width:9px;height:9px;border-radius:50%;margin-right:.4rem;box-shadow:0 0 6px currentColor}
.icon-btn svg{width:16px;height:16px;display:block}
.icon-btn.ic-only{padding:.42rem;width:32px;height:32px;display:inline-flex;align-items:center;justify-content:center}
.icon-btn.primary svg{margin-right:.35rem;vertical-align:-2px}
.icon-btn.primary{display:inline-flex;align-items:center;gap:.3rem}
.doc-gen-icon-btn{margin-left:.25rem}
.doc-section-actions{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap;justify-content:flex-end}
.doc-action-group{display:inline-flex;gap:.2rem;margin-left:.25rem}
.doc-action-group-sm{margin-left:.4rem;opacity:.5;transition:opacity .12s}
.doc-step:hover .doc-action-group-sm,.doc-cmp-card:hover .doc-action-group-sm,.doc-flow-step:hover .doc-action-group-sm,.doc-plan-step:hover .doc-action-group-sm,.doc-issue-row:hover .doc-action-group-sm{opacity:1}
.doc-action-btn{background:rgba(20,28,55,.6);border:1px solid rgba(99,131,236,.25);color:#a8b3d4;padding:.22rem .5rem;border-radius:7px;font-size:.78rem;cursor:pointer;line-height:1;font-weight:600;font-family:inherit}
.doc-icon-btn{display:inline-flex;align-items:center;justify-content:center;padding:.3rem;width:28px;height:28px}
.doc-icon-btn svg{width:14px;height:14px;display:block}
.doc-action-group-sm .doc-icon-btn{width:22px;height:22px;padding:.2rem}
.doc-action-group-sm .doc-icon-btn svg{width:11px;height:11px}
.tab .close{display:inline-flex;align-items:center;justify-content:center;width:14px;height:14px;margin-left:.4rem;opacity:.7;border-radius:4px}
.tab .close:hover{opacity:1;background:rgba(239,68,68,.18);color:#fca5a5}
.tab .close svg{width:11px;height:11px;display:block}
.tree-grip{display:inline-flex;align-items:center;justify-content:center}
.tree-grip svg{width:14px;height:14px;display:block;opacity:.7}
.inline-ico{display:inline-flex;align-items:center;justify-content:center;width:14px;height:14px;vertical-align:middle;margin-right:.3rem;flex-shrink:0;overflow:hidden}
.inline-ico svg,.inline-ico img{width:14px;height:14px;display:block;object-fit:contain}
.doc-action-btn:hover{background:rgba(99,131,236,.18);color:#eef2ff;border-color:rgba(99,131,236,.5)}
.doc-action-btn.doc-action-danger:hover{background:rgba(239,68,68,.18);color:#fca5a5;border-color:rgba(239,68,68,.55)}
.doc-action-group-sm .doc-action-btn{padding:.12rem .38rem;font-size:.7rem}
.light .doc-action-btn{background:#fff;border-color:#cbd5e1;color:#475569}
.light .doc-action-btn:hover{background:rgba(59,130,246,.08);color:#0f172a}
.doc-cmp-head{display:flex;justify-content:space-between;align-items:flex-start;gap:.4rem}
.doc-layout-picker{background:rgba(20,28,55,.85);color:#cdd5ed;border:1px solid rgba(99,131,236,.3);border-radius:8px;padding:.3rem .5rem;font-size:.74rem;cursor:pointer;font-family:inherit;outline:none}
.doc-layout-picker:hover{border-color:rgba(168,85,247,.55)}
.doc-layout-picker:focus{border-color:#a855f7;box-shadow:0 0 0 2px rgba(168,85,247,.2)}
.doc-comparison{display:grid;grid-template-columns:1fr 32px 1fr;gap:.55rem;margin-top:.8rem;align-items:center}
@media(max-width:900px){.doc-comparison{grid-template-columns:1fr;gap:.5rem}.doc-comparison-arrow{display:none}}
.doc-comparison-col{display:flex;flex-direction:column;gap:.55rem}
.doc-comparison-arrow{display:flex;align-items:center;justify-content:center;color:#7e8db1;font-size:1.6rem;font-weight:700}
.doc-cmp-card{display:grid;grid-template-columns:36px 1fr;gap:.6rem;align-items:start;padding:.7rem .85rem;background:rgba(15,21,46,.65);border:1.5px solid rgba(99,131,236,.2);border-radius:10px}
.doc-cmp-card.status-completed{border-color:rgba(34,197,94,.45);background:rgba(34,197,94,.06)}
.doc-cmp-card.status-pending{border-color:rgba(245,158,11,.45);background:rgba(245,158,11,.06)}
.doc-cmp-card.status-uncompleted{border-color:rgba(239,68,68,.45);background:rgba(239,68,68,.06)}
.doc-cmp-icon{width:32px;height:32px;border-radius:8px;background:rgba(59,130,246,.18);border:1px solid rgba(59,130,246,.35);display:flex;align-items:center;justify-content:center;font-size:.95rem;color:#93c5fd}
.doc-cmp-body strong{display:block;color:#eef2ff;font-size:.88rem;line-height:1.3}
.doc-cmp-meta{margin-top:.25rem}
.doc-cmp-notes{margin-top:.35rem;font-size:.78rem;color:#a8b3d4;line-height:1.5}
.doc-issue-layout{display:flex;flex-direction:column;gap:.5rem;margin-top:.7rem}
.doc-issue-row{padding:.7rem .9rem;background:rgba(239,68,68,.07);border:1px solid rgba(239,68,68,.3);border-left:5px solid #ef4444;border-radius:10px}
.doc-issue-row.status-completed{background:rgba(34,197,94,.07);border-color:rgba(34,197,94,.4);border-left-color:#22c55e}
.doc-issue-row.status-pending{background:rgba(245,158,11,.07);border-color:rgba(245,158,11,.4);border-left-color:#f59e0b}
.doc-issue-row-head{display:flex;align-items:center;justify-content:space-between;gap:.5rem}
.doc-issue-row-head strong{color:#f3f6ff;font-size:.95rem;font-weight:700}
.doc-issue-row-body{margin-top:.4rem;font-size:.85rem;color:#cdd5ed;line-height:1.55}
.light .doc-layout-picker{background:#fff;color:#0f172a;border-color:#cbd5e1}
.light .doc-cmp-card{background:#fff;border-color:#e2e8f0}
.light .doc-cmp-card.status-completed{background:#f0fdf4;border-color:rgba(34,197,94,.45)}
.light .doc-cmp-card.status-pending{background:#fffbeb;border-color:rgba(245,158,11,.45)}
.light .doc-cmp-card.status-uncompleted{background:#fef2f2;border-color:rgba(239,68,68,.45)}
.light .doc-cmp-body strong{color:#0f172a}
.light .doc-cmp-notes{color:#475569}
.light .doc-comparison-arrow{color:#475569}
.light .doc-issue-row{background:#fef2f2;border-color:#fecaca}
.light .doc-issue-row.status-completed{background:#f0fdf4;border-color:rgba(34,197,94,.4)}
.light .doc-issue-row.status-pending{background:#fffbeb;border-color:rgba(245,158,11,.4)}
.light .doc-issue-row-head strong{color:#0f172a}
.light .doc-issue-row-body{color:#1e293b}
.light .doc-issue-row-body .md-p, .light .doc-issue-row-body .md-list li, .light .doc-issue-row-body .md-h{color:#1e293b}
.light .doc-issue-card{background:#fff5f5;border-color:#fecaca;color:#1e293b}
.light .doc-issue-card strong{color:#991b1b}
.light .doc-issue-body{color:#1e293b}
.light .doc-issue-body .md-p, .light .doc-issue-body .md-list li, .light .doc-issue-body .md-h{color:#1e293b}
.light .doc-issues-rail h3{color:#991b1b}
.light .doc-issue-mini{background:#fff5f5;border-color:#fecaca;color:#1e293b}
.light .doc-issue-mini.muted{background:transparent;color:#64748b;border-color:transparent}
.light .doc-issues-bar .doc-section-icon{background:#fee2e2;border-color:#fca5a5;color:#991b1b}
.light .doc-issues-section{border-color:#fca5a5}
.light .doc-flow-step{background:#fff;border-color:#cbd5e1}
.light .doc-flow-step.status-completed{border-color:rgba(34,197,94,.5);background:#f0fdf4}
.light .doc-flow-step.status-pending{border-color:rgba(245,158,11,.5);background:#fffbeb}
.light .doc-flow-step.status-uncompleted{border-color:rgba(239,68,68,.5);background:#fef2f2}
.light .doc-flow-step strong{color:#0f172a}
.light .doc-flow-notes{color:#475569}
.light .doc-flow-arrow{color:#475569}
.light .doc-plan{background:#fffbeb;border-color:#fcd34d}
.light .doc-plan-step{background:#fff;border-color:#cbd5e1}
.light .doc-plan-step strong{color:#0f172a}
.light .doc-plan-step.status-completed{background:#f0fdf4;border-color:rgba(34,197,94,.5)}
.light .doc-plan-arrow{color:#475569}
.light .layout-callout .doc-section-body{background:#eff6ff;border-color:#bfdbfe}
.doc-section-icon{width:42px;height:42px;border-radius:12px;display:flex;align-items:center;justify-content:center;font-size:1.2rem;background:#dbeafe;border:1px solid #bfdbfe;color:#1d4ed8;box-shadow:0 1px 2px rgba(15,23,60,.06)}
.doc-section-icon.violet{background:#ede9fe;border-color:#ddd6fe;color:#6d28d9}
.doc-section-icon.green{background:#dcfce7;border-color:#bbf7d0;color:#15803d}
.doc-section-icon.amber{background:#fef3c7;border-color:#fde68a;color:#b45309}
.doc-section-icon.red{background:#fee2e2;border-color:#fecaca;color:#b91c1c}
.doc-section-icon.blue{background:#dbeafe;border-color:#bfdbfe;color:#1d4ed8}
.doc-section-title h2{margin:0;font-size:1.15rem;font-weight:800;color:#f3f6ff;line-height:1.2}
.doc-section-meta{font-size:.78rem;color:#8a99c2;margin-top:.15rem}
.doc-assignee{color:#a8b3d4;font-size:.82rem;margin:.1rem 0 .6rem}
.doc-issues-section{border-color:rgba(239,68,68,.4)}
.doc-issues-bar{grid-template-columns:42px 1fr}
.doc-issues-bar .doc-section-icon{background:rgba(239,68,68,.18);border-color:rgba(239,68,68,.45)}
.doc-issues-list{display:flex;flex-direction:column;gap:.55rem;margin-top:.4rem}
.doc-issue-card{padding:.7rem .85rem;background:rgba(239,68,68,.07);border:1px solid rgba(239,68,68,.25);border-radius:10px}
.doc-issue-card strong{display:block;color:#fff;margin-bottom:.25rem;font-weight:700}
.doc-issue-body{font-size:.85rem;color:#dde6ff}
.doc-side-key{display:inline-flex;align-items:center;gap:.55rem}
.doc-side-ico{display:inline-flex;width:18px;justify-content:center;font-size:.85rem}
.glass-ico{width:24px;height:24px;border-radius:7px;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;background:#dbeafe;border:1px solid #bfdbfe;color:#1d4ed8}
.glass-ico svg{width:15px;height:15px;color:inherit;stroke-width:2.4}
.glass-ico.violet{background:#ede9fe;border-color:#ddd6fe;color:#6d28d9}
.glass-ico.green{background:#dcfce7;border-color:#bbf7d0;color:#15803d}
.glass-ico.amber{background:#fef3c7;border-color:#fde68a;color:#b45309}
.glass-ico.red{background:#fee2e2;border-color:#fecaca;color:#b91c1c}
.glass-ico.blue{background:#dbeafe;border-color:#bfdbfe;color:#1d4ed8}
.light .glass-ico{box-shadow:inset 0 1px 0 rgba(255,255,255,.5),0 3px 8px rgba(15,23,60,.08);border-color:rgba(15,23,60,.08)}
.light .glass-ico svg{color:inherit}
.doc-issue-mini{padding:.45rem .6rem;border-radius:8px;background:rgba(239,68,68,.08);border:1px solid rgba(239,68,68,.18);font-size:.82rem;color:#dde6ff;margin-top:.4rem}
.doc-issue-mini.muted{background:transparent;border:none;color:#8a99c2;font-style:italic;padding:.25rem .6rem}
.doc-section-body{color:#cdd5ed;font-size:.92rem;line-height:1.55}
.doc-section-body .md-p{margin:.4rem 0}
.doc-section-body .md-list{margin:.4rem 0 .4rem 1.1rem;padding:0}
.doc-section-body .md-list li{margin:.2rem 0}
.doc-section-body .md-h{margin:.7rem 0 .35rem;font-size:1rem;color:#eef2ff}
.doc-section-body .md-code, .doc-step-body .md-code{display:block;background:rgba(10,18,38,.75);border:1px solid rgba(99,131,236,.2);border-radius:8px;padding:.7rem .9rem;font-family:Menlo,Consolas,monospace;font-size:.82rem;color:#cbd5e1;overflow-x:auto;margin:.5rem 0;white-space:pre-wrap}
.doc-section-body .md-table, .doc-step-body .md-table{width:100%;border-collapse:collapse;margin:.5rem 0;font-size:.85rem}
.doc-section-body .md-table th, .doc-step-body .md-table th{background:rgba(99,131,236,.12);text-align:left;padding:.5rem .6rem;border:1px solid rgba(99,131,236,.25);font-weight:700;color:#dde6ff}
.doc-section-body .md-table td, .doc-step-body .md-table td{padding:.45rem .6rem;border:1px solid rgba(99,131,236,.18);color:#c7d0eb}
.doc-section-body code, .doc-step-body code{background:rgba(99,131,236,.16);padding:.1rem .35rem;border-radius:4px;font-size:.85em;font-family:Menlo,Consolas,monospace}
.md-img{max-width:100%;height:auto;border-radius:8px;margin:.5rem 0;border:1px solid rgba(99,131,236,.2);display:block;box-shadow:0 4px 14px rgba(0,8,40,.4)}
.light .md-img{border-color:#e2e8f0;box-shadow:0 4px 14px rgba(15,23,60,.08)}
.doc-steps{margin:.7rem 0 0;padding:0;list-style:none;counter-reset:step}
.doc-step{counter-increment:step;background:rgba(15,21,46,.65);border:1px solid rgba(99,131,236,.18);border-radius:10px;padding:.7rem .9rem .8rem 2.6rem;margin-top:.55rem;position:relative}
.doc-step::before{content:counter(step);position:absolute;left:.7rem;top:.65rem;width:1.5rem;height:1.5rem;background:linear-gradient(135deg,#3b82f6,#2563eb);color:#fff;border-radius:50%;display:flex;align-items:center;justify-content:center;font-weight:800;font-size:.78rem}
.doc-step.status-completed::before{background:linear-gradient(135deg,#22c55e,#16a34a)}
.doc-step.status-pending::before{background:linear-gradient(135deg,#f59e0b,#d97706)}
.doc-step.status-uncompleted::before{background:linear-gradient(135deg,#ef4444,#dc2626)}
.doc-step-head{display:flex;align-items:center;gap:.6rem;flex-wrap:wrap}
.doc-step-head strong{color:#f3f6ff;font-size:.95rem;font-weight:700;flex:1;min-width:0}
.doc-step-head .doc-pill{flex:0 0 auto}
.doc-step-head .doc-action-group{margin-left:auto}
.doc-pill{display:inline-flex;align-items:center;line-height:1;vertical-align:middle}
.doc-step-body{color:#bfc8e2;font-size:.86rem;line-height:1.5;margin-top:.35rem}
.doc-side{display:flex;flex-direction:column;gap:1rem;position:sticky;top:0}
.doc-side-card{background:linear-gradient(180deg,rgba(28,34,62,.85),rgba(20,25,48,.92));border:1.5px solid rgba(99,131,236,.2);border-radius:14px;padding:.95rem 1rem}
.doc-side-card h3{margin:0 0 .55rem;font-size:.95rem;color:#dde6ff}
.doc-side-row{display:flex;justify-content:space-between;align-items:center;padding:.4rem 0;border-bottom:1px solid rgba(120,140,200,.1);font-size:.85rem;color:#a8b3d4}
.doc-side-row:last-child{border-bottom:none}
.doc-side-row strong{font-size:.95rem;color:#eef2ff}
.doc-issues{border-color:rgba(239,68,68,.35)}
.doc-issues h3{color:#fda4af}
.doc-issue{margin-top:.55rem;padding:.55rem .65rem;background:rgba(239,68,68,.07);border:1px solid rgba(239,68,68,.18);border-radius:8px;font-size:.85rem;color:#dde6ff}
.doc-issue strong{display:block;margin-bottom:.25rem;color:#fff}
.doc-filter-bar{display:flex;flex-wrap:wrap;gap:.6rem;margin-top:.85rem;align-items:center;padding:.55rem .7rem;background:rgba(20,28,55,.45);border:1px solid rgba(99,131,236,.15);border-radius:10px}
.doc-filter-search-wrap{flex:1 1 200px;min-width:160px;display:flex;align-items:center;gap:.5rem;background:rgba(10,18,38,.7);border:1px solid rgba(99,131,236,.25);border-radius:8px;padding:0 .7rem}
.doc-filter-search-wrap:focus-within{border-color:#a855f7;box-shadow:0 0 0 2px rgba(168,85,247,.18)}
.doc-filter-search-ico{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;border-radius:7px;background:#dbeafe;border:1px solid #bfdbfe;color:#1d4ed8;flex-shrink:0;overflow:hidden}
.doc-filter-search-ico svg{width:14px;height:14px;stroke-width:2;display:block}
.doc-filter-search-ico .ai-icon-img{width:80%;height:80%}
.doc-filter-search{flex:1;background:transparent;border:none;color:#e6ecff;padding:.5rem 0;font-size:.85rem;font-family:inherit;outline:none}
.doc-filter-search-wrap .mic-wrap{flex:1;display:flex;align-items:center;position:relative}
.doc-filter-search-wrap .mic-wrap > input{padding-right:32px}
.doc-filter-search-wrap .mic-btn{right:0}
.light .doc-filter-search-ico{color:#1d4ed8}
.light .doc-status-svg{background:#dbeafe;border-color:#bfdbfe;color:#1d4ed8}
.light .doc-status-item:nth-child(3) .doc-status-svg{background:#dcfce7;border-color:#bbf7d0;color:#15803d}
.light .doc-status-item:nth-child(4) .doc-status-svg{background:#ede9fe;border-color:#ddd6fe;color:#6d28d9}
.doc-filter-chips{display:flex;gap:.35rem;flex-wrap:wrap}
.doc-filter-chip{background:rgba(20,28,55,.6);border:1px solid rgba(99,131,236,.25);color:#a8b3d4;padding:.36rem .7rem;border-radius:99px;font-size:.78rem;cursor:pointer;font-weight:600;font-family:inherit;transition:all .12s}
.doc-filter-chip:hover{color:#eef2ff;border-color:rgba(99,131,236,.5)}
.doc-filter-chip.active{background:rgba(168,85,247,.18);border-color:rgba(168,85,247,.55);color:#fff}
.light .doc-filter-bar{background:#fff;border-color:#e2e8f0}
.light .doc-filter-search-wrap{background:#f8fafc;border-color:#cbd5e1}
.light .doc-filter-search{color:#0f172a}
.light .doc-filter-chip{background:#fff;border-color:#cbd5e1;color:#475569}
.light .doc-filter-chip:hover{color:#0f172a;border-color:#64748b}
.light .doc-filter-chip.active{background:rgba(168,85,247,.12);border-color:rgba(168,85,247,.5);color:#5b21b6}
.doc-editable{outline:none;border-radius:4px;padding:.05rem .25rem;margin:0 -.25rem;transition:background .15s}
.doc-editable:hover{background:rgba(99,131,236,.08)}
.doc-editable:focus{background:rgba(168,85,247,.10);box-shadow:0 0 0 2px rgba(168,85,247,.4)}
.doc-assignee-edit{outline:none;border-radius:4px;padding:.05rem .3rem;margin:0 -.3rem;transition:background .15s;display:inline-block;min-width:80px;color:#a8b3d4;font-size:.82rem}
.doc-assignee-edit:hover{background:rgba(99,131,236,.08)}
.doc-assignee-edit:focus{background:rgba(168,85,247,.10);box-shadow:0 0 0 2px rgba(168,85,247,.4);min-height:1.1em}
.doc-assignee-edit:empty:before{content:attr(data-placeholder);color:#7e8db1;font-style:italic;opacity:.7}
.doc-notes-block{margin-top:.6rem;border-radius:8px;cursor:text;transition:background .15s;padding:.2rem .35rem;margin-left:-.35rem;margin-right:-.35rem}
.doc-notes-block:hover:not(.editing){background:rgba(99,131,236,.06)}
.doc-notes-rendered{color:#cdd5ed;font-size:.92rem;line-height:1.55}
.doc-notes-empty{color:#7e8db1;font-style:italic;margin:.2rem 0;font-size:.85rem}
.doc-notes-textarea{width:100%;min-height:120px;padding:.65rem .8rem;background:#0a1226;color:#e6ecff;border:1.5px solid rgba(168,85,247,.45);border-radius:10px;resize:none;font-family:inherit;font-size:.9rem;line-height:1.55;box-sizing:border-box;outline:none}
.doc-notes-textarea:focus{border-color:#a855f7;box-shadow:0 0 0 2px rgba(168,85,247,.25)}
.doc-notes-actions{display:flex;gap:.5rem;margin-top:.5rem;justify-content:flex-end}
.doc-notes-actions button{padding:.4rem .9rem;border-radius:8px;font-weight:600;font-size:.8rem;cursor:pointer;border:1px solid rgba(120,140,200,.3);background:transparent;color:#cdd5ed}
.doc-notes-actions .doc-notes-save{background:linear-gradient(135deg,#a855f7,#7c3aed);border:none;color:#fff}
.doc-notes-actions .doc-notes-save:hover{filter:brightness(1.08)}
.doc-notes-actions .doc-notes-cancel:hover{background:rgba(120,140,200,.08)}
.doc-pill[data-cycle-status]:hover{filter:brightness(1.15);transform:scale(1.04)}
.doc-due-pill{margin-left:.25rem}
.doc-due-pill:hover{filter:brightness(1.15)}
.doc-due-input{background:rgba(10,18,38,.85);color:#e6ecff;border:1.5px solid rgba(168,85,247,.5);border-radius:99px;padding:.18rem .55rem;font-size:.72rem;font-family:inherit;outline:none}
.doc-due-input:focus{box-shadow:0 0 0 2px rgba(168,85,247,.25)}
.light .doc-due-input{background:#fff;color:#0f172a;border-color:rgba(168,85,247,.4)}
.doc-add-sub, .doc-add-section{display:inline-block;margin-top:.6rem;padding:.4rem .8rem;background:transparent;border:1.5px dashed rgba(99,131,236,.4);border-radius:8px;color:#8a99c2;cursor:pointer;font-size:.82rem;font-weight:600}
.doc-add-sub:hover, .doc-add-section:hover{border-color:rgba(168,85,247,.55);color:#c4b5fd;background:rgba(168,85,247,.05)}
.doc-add-section{display:block;width:100%;text-align:center;margin-top:1rem;padding:.7rem;font-size:.9rem}
.light .doc-editable:hover{background:rgba(59,130,246,.08)}
.light .doc-editable:focus{background:rgba(168,85,247,.10);box-shadow:0 0 0 2px rgba(168,85,247,.4)}
.light .doc-assignee-edit{color:#475569}
.light .doc-assignee-edit:hover{background:rgba(59,130,246,.08)}
.light .doc-notes-block:hover:not(.editing){background:rgba(59,130,246,.06)}
.light .doc-notes-textarea{background:#fff;color:#0f172a;border-color:rgba(168,85,247,.4)}
.light .doc-notes-empty{color:#64748b}
.light .doc-add-sub, .light .doc-add-section{color:#64748b;border-color:rgba(99,131,236,.35)}
.light .doc-add-sub:hover, .light .doc-add-section:hover{color:#5b21b6;background:rgba(168,85,247,.06)}
.doc-map-shell{padding:.85rem .85rem .25rem;color:#dde6ff;height:100%;display:flex;flex-direction:column;min-height:0}
.doc-map-head{margin-bottom:.4rem;flex-shrink:0}
.doc-map-head h4{margin:0;font-size:.78rem;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:#7e8db1}
.doc-map-list{list-style:none;padding:0 .15rem 1rem 0;margin:0;display:flex;flex-direction:column;gap:.25rem;overflow-y:auto;flex:1;min-height:0}
.doc-map-list::-webkit-scrollbar{width:8px}
.doc-map-list::-webkit-scrollbar-thumb{background:rgba(99,131,236,.25);border-radius:99px}
.doc-map-list::-webkit-scrollbar-track{background:transparent}
.doc-map-project{padding:.55rem .65rem;font-weight:700;color:#c4b5fd;background:rgba(168,85,247,.08);border:1px solid rgba(168,85,247,.25);border-radius:8px;margin-bottom:.4rem;font-size:.9rem}
.doc-map-divider{padding:.55rem .35rem .25rem;font-size:.7rem;letter-spacing:.08em;text-transform:uppercase;color:#7e8db1;font-weight:600;margin-top:.4rem;border-top:1px solid rgba(120,140,200,.15)}
.doc-map-link{display:grid;grid-template-columns:24px 1fr auto;align-items:center;gap:.55rem;padding:.5rem .55rem;border-radius:8px;cursor:pointer;color:#cdd5ed;font-size:.86rem;text-decoration:none;border:1px solid transparent}
.doc-map-link:hover{background:rgba(99,131,236,.08);color:#eef2ff;border-color:rgba(99,131,236,.18)}
.doc-map-link.active{background:rgba(168,85,247,.12);color:#fff;border-color:rgba(168,85,247,.45)}
.doc-map-ico{display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;border-radius:7px;background:#dbeafe;border:1px solid #bfdbfe;color:#1d4ed8;font-size:.85rem;overflow:hidden}
.doc-map-ico.violet{background:#ede9fe;border-color:#ddd6fe;color:#6d28d9}
.doc-map-ico.green{background:#dcfce7;border-color:#bbf7d0;color:#15803d}
.doc-map-ico.amber{background:#fef3c7;border-color:#fde68a;color:#b45309}
.doc-map-ico.red{background:#fee2e2;border-color:#fecaca;color:#b91c1c}
.doc-map-ico.blue{background:#dbeafe;border-color:#bfdbfe;color:#1d4ed8}
.doc-map-ico img.doc-icon-img{width:100%;height:100%;object-fit:contain}
.doc-map-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.doc-map-count{font-size:.7rem;font-weight:700;padding:.18rem .5rem;border-radius:99px;background:rgba(99,131,236,.13);color:#a5b4d6;border:1px solid rgba(99,131,236,.25)}
.icon-btn{border:1px solid transparent;background:transparent;color:#a8b3d4;border-radius:9px;padding:.38rem .6rem;cursor:pointer;flex:0 0 auto;font-family:inherit;font-size:.84rem;font-weight:500;transition:background .12s,color .12s,border-color .12s}
.icon-btn:hover{background:rgba(99,131,236,.12);color:#f3f6ff;border-color:transparent}
.icon-btn.primary{font-weight:600;background:linear-gradient(135deg,#a855f7,#7c3aed);border-color:transparent;color:#fff;box-shadow:0 2px 8px rgba(168,85,247,.28)}
.icon-btn.primary:hover{filter:brightness(1.08);background:linear-gradient(135deg,#a855f7,#7c3aed)}
.light .icon-btn{color:#64748b}
.light .icon-btn:hover{background:rgba(99,131,236,.08);color:#0f172a}
.light .icon-btn.primary{color:#fff}

.tab-with-close{display:inline-flex;align-items:center;gap:.4rem}.tab-with-close .close{opacity:0;transition:opacity .12s}.tab-with-close:hover .close,.tab.active .close{opacity:.8}.tab.active{background:linear-gradient(135deg,rgba(168,85,247,.2),rgba(124,58,237,.08));border-color:rgba(168,85,247,.4);color:#f3f6ff;box-shadow:inset 0 1px 0 rgba(255,255,255,.12),0 2px 8px rgba(168,85,247,.16)}.light .tab.active{background:linear-gradient(135deg,rgba(168,85,247,.16),rgba(124,58,237,.04));border-color:rgba(168,85,247,.45);color:#5b21b6;box-shadow:inset 0 1px 0 rgba(255,255,255,.6),0 1px 3px rgba(168,85,247,.1)}

.tree-root{list-style:none;padding:0 .15rem 1rem 0;margin:0;display:flex;flex-direction:column;gap:.25rem;overflow-y:auto;flex:1;min-height:0}
.tree-root::-webkit-scrollbar{width:8px}.tree-root::-webkit-scrollbar-thumb{background:rgba(99,131,236,.25);border-radius:99px}.tree-root::-webkit-scrollbar-track{background:transparent}
.tree-item{padding:.3rem .45rem;border-radius:6px;cursor:grab;color:var(--text) !important;opacity:1}.tree-item:hover{background:rgba(96,165,250,.15)}.tree-item.project{font-weight:700}
.tree-shell{padding:.85rem .85rem .25rem;color:#dde6ff;height:100%;display:flex;flex-direction:column;min-height:0}
.tree-head{display:flex;align-items:center;justify-content:space-between;flex-shrink:0;margin-bottom:.15rem}
.tree-head h4{margin:0;font-size:.78rem;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:#7e8db1}
.tree-head .muted,.tree-shell>.muted{color:#7e8db1;font-size:.76rem;margin:0 0 .35rem}
.tree-head-actions{display:flex;gap:.25rem}
.modal-card .tree-icon,.tree-icon{border:1px solid rgba(99,131,236,.3);background:rgba(20,28,55,.55);color:#cdd5ed;border-radius:7px;padding:0;width:24px;height:24px;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;font-size:0;transition:background .12s,border-color .12s}
.tree-icon:hover{background:rgba(99,131,236,.2);border-color:rgba(99,131,236,.5)}
.tree-icon svg{width:13px;height:13px;display:block}
.tree-icon:hover{border-color:rgba(168,85,247,.55);background:rgba(168,85,247,.1);color:#fff}
.doc-map-mini-btn{border:1px solid rgba(168,85,247,.45);background:rgba(168,85,247,.12);color:#c4b5fd;border-radius:99px;padding:.26rem .65rem;cursor:pointer;font-size:.74rem;font-weight:600;font-family:inherit}
.doc-map-mini-btn:hover{background:rgba(168,85,247,.22);color:#fff}
.light .tree-shell{color:#0f172a}
.light .tree-head h4{color:#64748b}
.light .tree-head .muted, .light .tree-shell>.muted{color:#64748b}
.light .doc-map-head h4{color:#64748b}
.light .tree-icon{background:#fff;border-color:#cbd5e1;color:#475569}
.light .tree-icon:hover{background:rgba(168,85,247,.08);color:#5b21b6;border-color:rgba(168,85,247,.4)}
.light .tree-row, .light .tree-project{color:#475569}
.light .tree-row .tree-title, .light .tree-project .tree-title{color:#0f172a}
.light .tree-project{font-weight:600;color:#0f172a}
.light .tree-row:hover, .light .tree-project:hover{background:rgba(99,131,236,.08);color:#0f172a}
.light .tree-row.active, .light .tree-project.active{background:linear-gradient(135deg,rgba(168,85,247,.14),rgba(124,58,237,.04));border-color:rgba(168,85,247,.45);color:#0f172a}
.light .tree-root:before{background:#e2e8f0}
.light .tree-drop-root{color:#64748b;border-color:#cbd5e1;background:rgba(99,131,236,.04)}
.light .tree-grip, .light .tree-toggle{color:#64748b}
.light .tree-orphans{color:#475569;border-top-color:#e2e8f0}
.light .tree-row.orphan{background:rgba(99,131,236,.06)}
.light .tree-line{background:rgba(168,85,247,.45)}
.light .tree-root:before{background:rgba(168,85,247,.35)}
.light .doc-map-mini-btn{background:rgba(168,85,247,.10);color:#5b21b6;border-color:rgba(168,85,247,.4)}
.light .doc-map-mini-btn:hover{background:rgba(168,85,247,.18)}
.tree-root{list-style:none;padding:0;margin:.5rem 0 0;position:relative;overflow-y:auto;flex:1;min-height:0}
.tree-root::-webkit-scrollbar{width:8px}
.tree-root::-webkit-scrollbar-thumb{background:rgba(99,131,236,.25);border-radius:99px}
.tree-root::-webkit-scrollbar-track{background:transparent}
.tree-root:before{content:'';position:absolute;left:13px;top:.4rem;bottom:.4rem;width:1px;background:rgba(99,131,236,.18)}
.tree-project,.tree-row{display:grid;grid-template-columns:10px 18px 12px 1fr 22px;align-items:center;gap:.5rem;padding:.45rem .5rem;border-radius:8px;color:#cdd5ed;cursor:pointer;font-size:.86rem;transition:background .12s,color .12s,border-color .12s,box-shadow .12s;border:1px solid transparent}
.tree-project{font-weight:600;color:#eef2ff;font-size:.92rem;margin-bottom:.15rem}
.tree-row{margin-left:0}
.tree-row:hover,.tree-project:hover{background:rgba(99,131,236,.1);color:#f3f6ff}
.tree-row.active,.tree-project.active{background:linear-gradient(135deg,rgba(168,85,247,.18),rgba(124,58,237,.06));color:#f3f6ff;border-color:rgba(168,85,247,.4)}
.tree-row.drop-target,.tree-project.drop-target{box-shadow:inset 0 2px 0 #a855f7;background:rgba(168,85,247,.12)}
.tree-line{width:10px;height:1px;background:rgba(99,131,236,.28)}
.tree-title{font-size:.86rem;line-height:1.3;color:inherit;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tree-project .tree-title{font-size:.92rem}
.tree-grip{opacity:0;cursor:grab;color:#7e8db1;transition:opacity .12s}
.tree-row:hover .tree-grip,.tree-project:hover .tree-grip{opacity:.7}

@media(min-width:601px){.map-layout{grid-template-columns:1fr 8px 320px}}.pane-resize{cursor:col-resize;background:linear-gradient(180deg,transparent,#2a3b66,transparent);position:relative}@media(max-width:600px){.pane-resize{display:none}.pane-collapse-btn{display:none}}
.pane-collapse-btn{position:absolute;top:50%;right:calc(var(--pane-w, 320px) - 4px);transform:translate(50%,-50%);z-index:5;width:24px;height:48px;background:#1a2440;border:1px solid #2c3a64;border-radius:8px;color:#a5b4d6;font-size:1rem;cursor:pointer;display:flex;align-items:center;justify-content:center;box-shadow:0 4px 12px rgba(0,0,0,.4)}
.pane-collapse-btn:hover{background:#243057;color:#eef2ff}
.pane-collapsed .pane-collapse-btn{right:0}
.pane-collapsed .pane-resize, .pane-collapsed #mapDetails{display:none}
.light .pane-collapse-btn{background:#fff;border-color:#cbd5e1;color:#475569;box-shadow:0 4px 10px rgba(15,23,60,.10)}
.light .pane-collapse-btn:hover{background:#f1f5f9;color:#0f172a}
.tree-toggle{background:none;border:none;color:#7e8db1;font-size:.78rem;cursor:pointer;padding:0;width:18px;height:18px;display:inline-flex;align-items:center;justify-content:center;border-radius:4px;transition:background .12s}
.tree-toggle:hover{background:rgba(99,131,236,.12);color:#cdd5ed}
.tree-drop-root{margin:.25rem 0 .25rem 18px;border:1px dashed rgba(99,131,236,.25);padding:.35rem .55rem;border-radius:7px;color:#7e8db1;font-size:.78rem;letter-spacing:.01em}

.map-node.tree-focus{border-color:#a855f7 !important;box-shadow:0 0 0 8px rgba(168,85,247,.45),0 0 28px rgba(168,85,247,.7);transform:scale(1.14)!important;z-index:8;transition:transform .15s ease, box-shadow .15s ease;}
.tree-orphans{margin:.8rem .2rem .3rem;padding:.4rem .6rem;border-top:1px dashed rgba(99,131,236,.18);color:#7e8db1;font-weight:600;font-size:.74rem;letter-spacing:.06em;text-transform:uppercase}
.tree-row.orphan{background:rgba(99,131,236,.05)}
.tree-dot{width:8px;height:8px;border-radius:999px;background:#a855f7;display:inline-block;flex-shrink:0;justify-self:center}
.level-1 .tree-dot{background:#a855f7}
.level-2 .tree-dot{background:#7c3aed}
.level-3 .tree-dot{background:#6d28d9}
.tree-row.completed .tree-dot{background:#22c55e}
.tree-row.pending .tree-dot{background:#f59e0b}
.tree-row.uncompleted .tree-dot{background:#ef4444}
.marquee{position:absolute;border:1px dashed #a855f7;background:rgba(168,85,247,.14);pointer-events:none;z-index:20}
.tree-row.pending{}
.tree-row.uncompleted{}
.tree-row.completed{}

.tree-map-selected{outline:2px solid #a855f7 !important;background:rgba(168,85,247,.22) !important;}
.modal-card.modal-card-wide{width:min(680px,94vw);max-height:90vh;overflow-y:auto;padding:1.1rem 1.2rem}
/* ───── Help & tutorials (redesigned) ───── */
/* Reset the global .modal-card button blue-gradient inside the help modal,
   then re-assert the iris-themed colors the help shell expects. Specificity
   bumped via the .modal-card-help prefix so it beats the global rule on
   line 474. */
.modal-card.modal-card-help button{
  appearance:none;
  background:transparent;
  border:none;
  color:inherit;
  padding:0;
  font:inherit;
  letter-spacing:inherit;
}
.modal-card.modal-card-help .hc-btn{background:var(--accent);color:#F5F4F0;padding:7px 14px;border-radius:7px;font-size:13px;font-weight:500;letter-spacing:-.005em;cursor:pointer}
.modal-card.modal-card-help .hc-btn:hover{filter:brightness(1.08)}
.modal-card.modal-card-help .hc-btn-ghost{background:transparent;border:1px solid var(--line-strong);color:var(--ink)}
.modal-card.modal-card-help .hc-tour-fab{background:var(--accent);color:#F5F4F0}
.modal-card.modal-card-help .hc-ai-send{background:var(--accent);color:#F5F4F0}
.modal-card.modal-card-help .hc-ai-send:disabled{background:rgba(255,255,255,.08);color:#F5F4F0}
.light .modal-card.modal-card-help .hc-ai-send:disabled{background:rgba(15,17,21,.08)}
.modal-card.modal-card-help .hc-tab-active{background:rgba(124,58,237,.15);color:#C4B5FD;font-weight:500}
.modal-card.modal-card-help .hc-link-active{background:rgba(124,58,237,.15);color:#C4B5FD;font-weight:500}
.light .modal-card.modal-card-help .hc-tab-active,
.light .modal-card.modal-card-help .hc-link-active{background:rgba(124,58,237,.08);color:var(--accent)}
.modal-card.modal-card-help .hc-tab,
.modal-card.modal-card-help .hc-link{padding:7px 10px;border-radius:7px;text-align:left;font-size:13px;letter-spacing:-.005em;cursor:pointer}
.modal-card.modal-card-help .hc-tab{display:flex;align-items:center;gap:10px}
.modal-card.modal-card-help .hc-link{display:flex;align-items:center;gap:10px;width:100%}
.modal-card.modal-card-help .hc-tab:hover,
.modal-card.modal-card-help .hc-link:hover{background:rgba(124,58,237,.06)}
.modal-card.modal-card-help .hc-ai-chip{padding:6px 11px;border-radius:999px;background:rgba(255,255,255,.04);border:1px solid var(--line);color:var(--muted);font-size:12px;letter-spacing:-.005em;cursor:pointer}
.light .modal-card.modal-card-help .hc-ai-chip{background:#F5F4F0}
.modal-card.modal-card-help .hc-pager-card{background:var(--surface);border:1px solid var(--line-strong);padding:14px;border-radius:10px;cursor:pointer;text-align:left}
.modal-card.modal-card-help .hc-faq-q{display:flex;align-items:center;gap:12px;width:100%;text-align:left;padding:13px 0;font-size:14px;font-weight:500;color:var(--ink);cursor:pointer}
.modal-card.modal-card-help .hc-tour-skip{color:var(--muted);font-size:12px;font-weight:500;padding:6px 8px;cursor:pointer}
.modal-card.modal-card-help .hc-hamburger{padding:6px;border-radius:6px;cursor:pointer;color:var(--ink)}
.modal-card.modal-card-help .task-submap-preset{cursor:pointer;color:#c7d2fe}
.modal-card.modal-card-help{width:min(1080px,96vw);height:90vh;max-height:90vh;padding:0;overflow:hidden;display:flex;flex-direction:column;background:#0a1022;border:1px solid rgba(255,255,255,.06)}
.modal-card.modal-card-help #modalBody{flex:1;min-height:0;display:flex;width:100%}
.modal-card.modal-card-help #hcHost{flex:1;min-height:0;display:flex;width:100%}
.modal-card.modal-card-help .modal-title{display:none}
.modal-card.modal-card-help .modal-body{flex:1 1 auto;overflow:hidden;min-height:0;padding:0;display:flex;flex-direction:column}
.modal-card.modal-card-help #hcHost{flex:1 1 auto;min-height:0;display:flex}
.modal-card.modal-card-help .row{display:none}
.light .modal-card.modal-card-help{background:#F5F4F0;border-color:rgba(15,17,21,.08)}
.modal-card-helpc{--ink:#E8EDFF;--muted:#9AA8CF;--subtle:#7E8DB1;--line:rgba(255,255,255,0.06);--line-strong:rgba(255,255,255,0.1);--surface:#111a33;--bg:#0a1022;--user-bg:rgba(124,58,237,0.15);--user-fg:#C4B5FD;--accent:#7C3AED;--sans:'Geist','Inter','Helvetica Neue',system-ui,sans-serif;--mono:'JetBrains Mono','SF Mono',Menlo,Consolas,monospace}
.light .modal-card-helpc{--ink:#0F1115;--muted:rgba(15,17,21,0.55);--subtle:rgba(15,17,21,0.4);--line:rgba(15,17,21,0.06);--line-strong:rgba(15,17,21,0.1);--surface:#FFFFFF;--bg:#F5F4F0;--user-bg:rgba(124,58,237,0.08);--user-fg:#7C3AED}

.hc-shell{flex:1;display:flex;flex-direction:column;min-height:0;width:100%;background:var(--bg);color:var(--ink);font-family:var(--sans);font-weight:400;letter-spacing:-.005em}
.hc-topbar{display:flex;align-items:center;gap:12px;padding:14px 20px;border-bottom:1px solid var(--line);background:var(--surface)}
.hc-mark{color:var(--ink);flex-shrink:0;display:block}
.hc-brand{font-size:14px;font-weight:600;letter-spacing:-.01em;color:var(--ink)}
.hc-search{margin-left:24px;display:flex;align-items:center;gap:10px;padding:7px 12px;min-width:280px;background:rgba(255,255,255,.04);border:1px solid var(--line);border-radius:8px;font-size:13px;color:var(--muted);cursor:pointer}
.light .hc-search{background:#F5F4F0}
.hc-search-text{flex:1}
.hc-kbd{display:inline-flex;align-items:center;justify-content:center;min-width:22px;height:22px;padding:0 7px;font-family:var(--mono);font-size:11px;font-weight:500;color:var(--ink);background:rgba(255,255,255,.06);border:1px solid rgba(255,255,255,.12);border-radius:5px;box-shadow:inset 0 -1px 0 rgba(0,0,0,.3);line-height:1}
.light .hc-kbd{background:#FFFFFF;color:#0F1115;border-color:rgba(15,17,21,.12);box-shadow:inset 0 -1px 0 rgba(15,17,21,.08)}
.hc-hamburger{appearance:none;border:none;background:transparent;color:var(--ink);padding:6px;border-radius:6px;cursor:pointer;display:none;align-items:center}

.hc-main{flex:1;display:flex;overflow:hidden;position:relative;min-height:0}
.hc-sidebar{width:268px;flex-shrink:0;border-right:1px solid var(--line);background:var(--surface);display:flex;flex-direction:column;overflow:hidden}
.hc-tabs{padding:14px 12px 12px;display:flex;flex-direction:column;gap:2px}
.hc-tab{appearance:none;border:none;background:transparent;color:var(--ink);padding:8px 10px;border-radius:7px;cursor:pointer;display:flex;align-items:center;gap:10px;font-family:var(--sans);font-size:13px;font-weight:400;letter-spacing:-.005em;text-align:left}
.hc-tab:hover{background:rgba(124,58,237,.06)}
.hc-tab-active{background:rgba(124,58,237,.15);color:#C4B5FD;font-weight:500}
.light .hc-tab-active{background:rgba(124,58,237,.08);color:var(--accent)}
.hc-tab-ico{width:18px;font-family:var(--mono);font-size:12px;text-align:center;color:var(--subtle)}
.hc-tab-active .hc-tab-ico{color:var(--accent)}
.hc-topics{flex:1;overflow:auto;padding:4px 12px 16px;border-top:1px solid var(--line)}
.hc-group{margin-top:16px}
.hc-group-title{font-family:var(--mono);font-size:10px;font-weight:500;letter-spacing:.12em;text-transform:uppercase;color:var(--subtle);padding:4px 10px 6px}
.hc-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:1px}
.hc-link{display:flex;width:100%;text-align:left;align-items:center;gap:10px;padding:7px 10px;border-radius:6px;cursor:pointer;background:transparent;border:none;color:var(--ink);font:inherit;font-size:13px;font-weight:400;letter-spacing:-.005em;position:relative}
.hc-link:hover{background:rgba(124,58,237,.06)}
.hc-link-active{background:rgba(124,58,237,.15);color:#C4B5FD;font-weight:500}
.light .hc-link-active{background:rgba(124,58,237,.08);color:var(--accent)}
.hc-link-active::before{content:'';position:absolute;left:0;top:8px;bottom:8px;width:2px;background:var(--accent);border-radius:2px}
.hc-link-ico{width:18px;font-family:var(--mono);font-size:12px;text-align:center;color:var(--subtle);line-height:1;flex-shrink:0}
.hc-link-active .hc-link-ico{color:var(--accent)}
.hc-link-text{flex:1;overflow:hidden;text-overflow:ellipsis}
.hc-tag{font-family:var(--mono);font-size:9px;letter-spacing:.08em;padding:2px 5px;border-radius:3px;background:rgba(124,58,237,.2);color:var(--accent)}
.light .hc-tag{background:rgba(124,58,237,.1)}

.hc-content{flex:1;display:flex;flex-direction:column;min-width:0;min-height:0;position:relative;overflow:hidden}
.hc-article{flex:1;min-height:0;overflow:auto;padding:32px 44px 48px;font-family:var(--sans)}
.hc-meta{display:flex;align-items:center;gap:8px;font-family:var(--mono);font-size:10px;font-weight:500;letter-spacing:.12em;text-transform:uppercase;color:var(--subtle);margin-bottom:18px}
.hc-meta-spacer{flex:1}
.hc-title{margin:0 0 8px;font-size:36px;font-weight:600;letter-spacing:-.025em;line-height:1.1;color:var(--ink);font-family:var(--sans)}
.hc-lede{margin:0 0 28px;font-size:18px;line-height:1.5;color:var(--muted);letter-spacing:-.01em;max-width:620px}
.hc-body{max-width:680px}
.hc-p{margin:0 0 16px;font-size:15px;line-height:1.7;color:var(--muted);letter-spacing:-.003em}
.hc-h{margin:28px 0 12px;font-size:18px;font-weight:600;color:var(--ink);letter-spacing:-.015em}
.hc-steps{margin:0 0 16px;padding-left:0;list-style:none;display:flex;flex-direction:column;gap:10px}
.hc-steps li{display:flex;gap:14px;align-items:flex-start}
.hc-step-num{flex:0 0 24px;height:24px;border-radius:24px;background:rgba(124,58,237,.18);color:var(--accent);display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:600;font-family:var(--mono);margin-top:2px}
.light .hc-step-num{background:rgba(124,58,237,.1)}
.hc-step-text{flex:1;font-size:15px;line-height:1.55;color:var(--muted);letter-spacing:-.003em}
.hc-callout{margin:20px 0;padding:14px 16px;background:rgba(124,58,237,.08);border:1px solid rgba(124,58,237,.22);border-radius:10px;display:flex;gap:10px;align-items:flex-start}
.light .hc-callout{background:rgba(124,58,237,.05);border-color:rgba(124,58,237,.18)}
.hc-callout-kicker{color:var(--accent);font-family:var(--mono);font-size:12px;margin-top:1px}
.hc-callout-body{flex:1;font-size:14px;color:var(--ink);line-height:1.55;letter-spacing:-.003em}
.hc-md{font-size:15px;line-height:1.7;color:var(--muted);max-width:680px}
.hc-md h2{margin:28px 0 12px;font-size:18px;font-weight:600;color:var(--ink);letter-spacing:-.015em}
.hc-md p{margin:0 0 14px}
.hc-md ul,.hc-md ol{margin:.5rem 0 1rem;padding-left:1.4rem}
.hc-md li{margin:.2rem 0}
.hc-md strong{color:var(--ink)}
.hc-md em{color:var(--accent)}
.hc-md code{background:rgba(124,58,237,.15);color:var(--accent);border:1px solid rgba(124,58,237,.22);border-radius:4px;padding:.05em .35em;font-family:var(--mono);font-size:.85em}
.hc-md .md-table{width:100%;border-collapse:collapse;margin:.5rem 0 1rem;font-size:13px;table-layout:fixed}
.hc-md .md-table th{background:rgba(255,255,255,.04);text-align:left;padding:8px 10px;border:1px solid var(--line-strong);font-weight:600;color:var(--ink);font-family:var(--sans)}
.hc-md .md-table td{padding:7px 10px;border:1px solid var(--line);color:var(--muted);vertical-align:top}
.light .hc-md .md-table th{background:#F5F4F0}

.hc-pager{margin-top:40px;padding-top:22px;border-top:1px solid var(--line);display:flex;gap:12px;flex-wrap:wrap}
.hc-pager-card{flex:1;min-width:200px;padding:14px;background:var(--surface);border-radius:10px;border:1px solid var(--line-strong);cursor:pointer;text-align:left;font:inherit;color:inherit}
.hc-pager-card:hover{border-color:rgba(124,58,237,.5)}
.hc-pager-card-r{text-align:right}
.hc-pager-kicker{font-family:var(--mono);font-size:9px;letter-spacing:.12em;text-transform:uppercase;color:var(--subtle)}
.hc-pager-title{font-size:13px;font-weight:500;color:var(--ink);margin-top:4px;letter-spacing:-.005em}

.hc-tour-fab{position:absolute;right:28px;bottom:24px;appearance:none;border:none;background:var(--accent);color:#F5F4F0;font-size:13px;font-weight:500;cursor:pointer;padding:11px 18px;border-radius:999px;box-shadow:0 14px 30px -10px rgba(124,58,237,.55);display:flex;align-items:center;gap:8px;font-family:var(--sans);letter-spacing:-.005em;z-index:5}
.hc-tour-fab-ico{font-family:var(--mono);font-size:13px}

.hc-shortcuts{flex:1;overflow:auto;padding:32px 36px;display:grid;grid-template-columns:repeat(3,1fr);gap:28px;align-content:flex-start}
.hc-sc-col{display:flex;flex-direction:column;gap:12px}
.hc-sc-head{font-family:var(--mono);font-size:10px;font-weight:500;letter-spacing:.14em;text-transform:uppercase;color:var(--subtle);padding-bottom:8px;border-bottom:1px solid var(--line)}
.hc-sc-row{display:flex;align-items:center;justify-content:space-between;padding:9px 4px;border-bottom:1px dashed rgba(255,255,255,.04);font-size:13px;color:var(--ink);letter-spacing:-.005em}
.light .hc-sc-row{border-bottom-color:rgba(15,17,21,.05)}
.hc-sc-keys{display:flex;gap:4px;align-items:center}
.hc-sc-plus{color:var(--subtle);font-size:11px}

.hc-faq-wrap{flex:1;min-height:0;overflow:auto;padding:32px 36px;display:grid;grid-template-columns:1fr 320px;gap:32px;align-content:flex-start}
.hc-faq-col{display:flex;flex-direction:column;gap:12px}
.hc-eyebrow{font-family:var(--mono);font-size:10px;font-weight:500;letter-spacing:.14em;text-transform:uppercase;color:var(--subtle)}
.hc-faq-item{border-bottom:1px solid var(--line)}
.hc-faq-q{appearance:none;border:none;background:transparent;cursor:pointer;padding:13px 0;display:flex;align-items:center;gap:12px;width:100%;text-align:left;font:inherit;color:var(--ink);font-size:14px;font-weight:500;letter-spacing:-.005em}
.hc-faq-mark{width:16px;color:var(--subtle);font-family:var(--mono);font-size:14px}
.hc-faq-a{padding:0 0 14px 28px;font-size:13.5px;color:var(--muted);line-height:1.6;letter-spacing:-.005em}
.hc-faq-cta{margin-top:14px;padding:14px 16px;background:rgba(124,58,237,.08);border:1px solid rgba(124,58,237,.22);border-radius:10px;display:flex;align-items:center;gap:14px}
.light .hc-faq-cta{background:rgba(124,58,237,.05);border-color:rgba(124,58,237,.18)}
.hc-faq-cta-ico{width:36px;height:36px;border-radius:8px;background:var(--accent);color:#F5F4F0;display:flex;align-items:center;justify-content:center;font-family:var(--mono);font-size:16px}
.hc-faq-cta-body{flex:1}
.hc-faq-cta-title{font-size:13px;font-weight:500;color:var(--ink);letter-spacing:-.005em}
.hc-faq-cta-sub{font-size:12px;color:var(--muted);margin-top:2px}
.hc-contact{padding:22px;background:var(--surface);border:1px solid var(--line);border-radius:12px;display:flex;flex-direction:column;gap:14px;align-self:flex-start}
.hc-contact-title{font-size:15px;font-weight:600;letter-spacing:-.015em}
.hc-contact-sub{font-size:12px;color:var(--muted);line-height:1.5;margin-top:-8px}
.hc-input{appearance:none;padding:8px 10px;background:var(--bg);color:var(--ink);border:1px solid var(--line-strong);border-radius:6px;font-family:var(--sans);font-size:13px;letter-spacing:-.005em}
.hc-textarea{min-height:100px;resize:vertical}
.hc-contact-foot{font-size:11px;color:var(--subtle);line-height:1.5;padding-top:10px;border-top:1px solid var(--line)}
.hc-mono{color:var(--ink);font-family:var(--mono)}

.hc-btn{appearance:none;border:none;background:var(--accent);color:#F5F4F0;font-size:13px;font-weight:500;cursor:pointer;padding:7px 14px;border-radius:7px;font-family:var(--sans);letter-spacing:-.005em}
.hc-btn:hover{filter:brightness(1.08)}
.hc-btn-ghost{background:transparent;border:1px solid var(--line-strong);color:var(--ink)}

.hc-ai{flex:1;display:flex;flex-direction:column;min-width:0;min-height:0}
.hc-ai-head{padding:14px 24px;border-bottom:1px solid var(--line);background:var(--surface);display:flex;align-items:center;gap:10px}
.hc-ai-icon{width:28px;height:28px;border-radius:7px;background:var(--accent);color:#F5F4F0;display:flex;align-items:center;justify-content:center;font-family:var(--mono);font-size:14px;flex-shrink:0}
.hc-ai-title{font-size:13px;font-weight:600;letter-spacing:-.01em;color:var(--ink)}
.hc-ai-sub{font-size:11px;color:var(--muted);margin-top:1px}
.hc-ai-scroll{flex:1;min-height:0;overflow:auto;padding:28px 32px;display:flex;flex-direction:column;gap:16px}
.hc-ai-row{display:flex;gap:10px;align-items:flex-start}
.hc-ai-row-user{justify-content:flex-end}
.hc-ai-avatar{width:26px;height:26px;border-radius:6px;flex-shrink:0;background:var(--accent);color:#F5F4F0;display:flex;align-items:center;justify-content:center;font-family:var(--mono);font-size:13px}
.hc-ai-bubble{flex:1;max-width:82%;padding:13px 16px;background:var(--surface);border:1px solid var(--line);border-radius:14px;font-size:14px;line-height:1.55;color:var(--ink);letter-spacing:-.005em;white-space:pre-wrap}
.hc-ai-bubble-user{max-width:78%;background:var(--user-bg);color:var(--user-fg);border:none;flex:0 0 auto;padding:11px 15px;border-radius:14px;font-size:14px;line-height:1.5}
.hc-ai-thinking{color:var(--muted);font-style:italic}
.hc-ai-foot{padding:14px 24px 18px;border-top:1px solid var(--line);background:var(--surface);display:flex;flex-direction:column;gap:10px}
.hc-ai-chips{display:flex;gap:6px;flex-wrap:wrap}
.hc-ai-chip{appearance:none;border:1px solid var(--line);cursor:pointer;padding:6px 11px;border-radius:999px;background:rgba(255,255,255,.04);color:var(--muted);font-size:12px;letter-spacing:-.005em;font-family:var(--sans)}
.light .hc-ai-chip{background:#F5F4F0}
.hc-ai-input{display:flex;align-items:center;gap:10px;padding:10px 14px;background:var(--bg);border:1px solid var(--line-strong);border-radius:999px}
.hc-ai-input input{flex:1;appearance:none;border:none;background:transparent;outline:none;font-size:14px;color:var(--ink);font-family:var(--sans);letter-spacing:-.005em}
.hc-ai-send{appearance:none;border:none;cursor:pointer;width:30px;height:30px;border-radius:50%;background:var(--accent);color:#F5F4F0;font-size:14px;display:flex;align-items:center;justify-content:center}
.hc-ai-send:disabled{background:rgba(255,255,255,.08);cursor:default}
.light .hc-ai-send:disabled{background:rgba(15,17,21,.08)}

.hc-tour-backdrop{position:fixed;inset:0;z-index:9999;background:rgba(15,17,21,.55);backdrop-filter:blur(4px);display:flex;align-items:center;justify-content:center;padding:24px;font-family:var(--sans)}
.hc-tour-card{width:380px;max-width:100%;background:var(--surface);color:var(--ink);border-radius:14px;padding:22px;border:1px solid var(--line-strong);box-shadow:0 28px 70px -20px rgba(0,0,0,.5);display:flex;flex-direction:column;gap:14px}
.hc-tour-head{display:flex;align-items:center;gap:8px}
.hc-tour-step{color:var(--accent)}
.hc-tour-bars{flex:1;display:flex;gap:3px}
.hc-tour-bar{flex:1;height:3px;border-radius:2px;background:rgba(255,255,255,.08)}
.light .hc-tour-bar{background:rgba(15,17,21,.08)}
.hc-tour-bar-on{background:var(--accent)}
.hc-tour-title{font-size:17px;font-weight:600;letter-spacing:-.015em;color:var(--ink)}
.hc-tour-body{font-size:13.5px;color:var(--muted);line-height:1.55;margin-top:-4px}
.hc-tour-foot{display:flex;gap:8px;padding-top:10px;border-top:1px solid var(--line);align-items:center}
.hc-tour-skip{appearance:none;border:none;background:transparent;color:var(--muted);font-size:12px;font-weight:500;cursor:pointer;padding:6px 8px;font-family:var(--sans)}
.hc-flex{flex:1}

@media (max-width:760px){
  .modal-card.modal-card-help{width:100%;max-width:100%;height:100vh;max-height:100vh;border-radius:0}
  .hc-hamburger{display:flex}
  .hc-search{display:none}
  .hc-topbar{padding:12px 14px}
  .hc-sidebar{position:absolute;inset:0 auto 0 0;z-index:100;transform:translateX(-100%);transition:transform .2s ease}
  .hc-main.hc-mobile-open .hc-sidebar{transform:translateX(0)}
  .hc-mobile-scrim{position:absolute;inset:0;z-index:90;background:rgba(15,17,21,.5)}
  .hc-article{padding:20px 18px 28px}
  .hc-title{font-size:26px}
  .hc-lede{font-size:15px}
  .hc-shortcuts{grid-template-columns:1fr;padding:22px 18px;gap:22px}
  .hc-faq-wrap{grid-template-columns:1fr;padding:22px 18px;gap:24px}
  .hc-ai-scroll{padding:20px 16px}
  .hc-ai-head{padding:14px 16px}
  .hc-ai-foot{padding:12px 16px 16px}
  .hc-tour-fab{right:16px;bottom:16px}
  .hc-tour-card{width:100%}
  .hc-tour-backdrop{align-items:flex-end;padding:14px}
}
.pdf-modal-header{display:flex;align-items:center;gap:.85rem;margin:0 0 1.1rem}
.pdf-modal-header .pdf-large-icon{width:42px;height:42px;border-radius:12px;background:linear-gradient(135deg,rgba(232,213,255,.42),rgba(167,139,250,.14));backdrop-filter:blur(10px) saturate(1.6);-webkit-backdrop-filter:blur(10px) saturate(1.6);border:1px solid rgba(255,255,255,.32);display:flex;align-items:center;justify-content:center;font-weight:800;color:#fff;font-size:.7rem;box-shadow:inset 0 1px 0 rgba(255,255,255,.55),0 8px 22px rgba(168,85,247,.22);flex-shrink:0}
.pdf-modal-header h2{margin:0 0 .1rem;font-size:1.2rem;font-weight:800;color:#f3f6ff;line-height:1.2}
.pdf-modal-header p{margin:0;color:#8a99c2;font-size:.85rem}
.pdf-section{margin:0 0 1.1rem}
.pdf-section-label{display:flex;align-items:center;gap:.55rem;margin:0 0 .55rem;font-size:.85rem;font-weight:600;color:#d3dbf6}
.pdf-section-label .ico{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;border-radius:6px;font-size:.78rem;background:linear-gradient(135deg,rgba(232,213,255,.4),rgba(167,139,250,.12));backdrop-filter:blur(6px) saturate(1.4);-webkit-backdrop-filter:blur(6px) saturate(1.4);border:1px solid rgba(255,255,255,.25);color:#fff;box-shadow:inset 0 1px 0 rgba(255,255,255,.4),0 2px 6px rgba(168,85,247,.16)}
.pdf-projects{display:flex;flex-direction:column;gap:.4rem;max-height:180px;overflow-y:auto;padding-right:.2rem}
.pdf-project{display:grid;grid-template-columns:22px 30px 1fr auto;align-items:center;gap:.7rem;padding:.6rem .8rem;background:rgba(20,28,55,.55);border:1.5px solid rgba(99,131,236,.15);border-radius:10px;cursor:pointer;transition:border-color .15s,background .15s}
.pdf-project:hover{border-color:rgba(99,131,236,.45);background:rgba(28,40,75,.7)}
.pdf-project.selected{border-color:#3b82f6;background:rgba(59,130,246,.08);box-shadow:0 0 0 1px rgba(59,130,246,.4)}
.pdf-project input[type=checkbox]{appearance:none;-webkit-appearance:none;width:20px;height:20px;border:1.5px solid rgba(120,140,200,.55);border-radius:5px;background:rgba(10,18,38,.7);cursor:pointer;position:relative;margin:0;transition:all .12s}
.pdf-project input[type=checkbox]:checked{background:linear-gradient(135deg,#3b82f6,#2563eb);border-color:transparent}
.pdf-project input[type=checkbox]:checked::after{content:'';position:absolute;top:50%;left:50%;transform:translate(-50%,-55%) rotate(45deg);width:5px;height:10px;border:solid #fff;border-width:0 2px 2px 0}
.pdf-project .pdf-proj-icon{width:28px;height:28px;border-radius:8px;display:flex;align-items:center;justify-content:center;background:#dbeafe;border:1px solid #bfdbfe;color:#1d4ed8}
.pdf-project .pdf-proj-icon svg{width:16px;height:16px;color:inherit;stroke-width:2}
.pdf-project .pdf-proj-icon.blue{background:#dbeafe;border-color:#bfdbfe;color:#1d4ed8}
.pdf-project .pdf-proj-icon.violet{background:#ede9fe;border-color:#ddd6fe;color:#6d28d9}
.pdf-project .pdf-proj-icon.green{background:#dcfce7;border-color:#bbf7d0;color:#15803d}
.pdf-project .pdf-proj-icon.amber{background:#fef3c7;border-color:#fde68a;color:#b45309}
.pdf-project .pdf-proj-icon.red{background:#fee2e2;border-color:#fecaca;color:#b91c1c}
.pdf-project .pdf-proj-icon.pink{background:#fce7f3;border-color:#fbcfe8;color:#be185d}
.pdf-project .pdf-proj-name{font-weight:600;color:#eef2ff;font-size:.88rem}
.pdf-project .pdf-task-count{font-size:.72rem;font-weight:600;padding:.22rem .55rem;border-radius:99px;background:rgba(99,131,236,.13);color:#a5b4d6;border:1px solid rgba(99,131,236,.25)}
.pdf-style-grid{display:grid;grid-template-columns:1fr 1fr;gap:.55rem}
.modal-card .pdf-style-card{position:relative;display:grid;grid-template-columns:42px 1fr;align-items:center;gap:.7rem;text-align:left;padding:.7rem .8rem;background:rgba(20,28,55,.55);border:1.5px solid rgba(99,131,236,.15);border-radius:11px;cursor:pointer;transition:border-color .15s,background .15s;color:#e6ecff;font-weight:500;letter-spacing:0;font-family:inherit}
.modal-card .pdf-style-card:hover{border-color:rgba(168,85,247,.55);background:rgba(40,28,72,.55);filter:none}
.modal-card .pdf-style-card.selected{border-color:#a855f7;background:rgba(60,30,100,.35);box-shadow:0 0 0 1px rgba(168,85,247,.5),0 6px 18px rgba(120,60,220,.18)}
.pdf-style-card .pdf-style-icon{width:42px;height:42px;border-radius:11px;display:flex;align-items:center;justify-content:center;font-size:1.15rem;background:rgba(167,139,250,.18);border:1px solid rgba(167,139,250,.35);color:#c4b5fd}
.pdf-style-card[data-pdfstyle=table] .pdf-style-icon{background:rgba(34,197,94,.18);border-color:rgba(34,197,94,.35);color:#86efac}
.pdf-style-card[data-pdfstyle=formal] .pdf-style-icon{background:rgba(245,158,11,.18);border-color:rgba(245,158,11,.35);color:#fcd34d}
.pdf-style-card[data-pdfstyle=schedule] .pdf-style-icon{background:rgba(59,130,246,.18);border-color:rgba(59,130,246,.35);color:#93c5fd}
.pdf-style-card[data-pdfstyle=image] .pdf-style-icon{background:rgba(236,72,153,.18);border-color:rgba(236,72,153,.35);color:#f9a8d4}
.pdf-style-card[data-pdfstyle=docview] .pdf-style-icon{background:rgba(59,130,246,.18);border-color:rgba(59,130,246,.35);color:#93c5fd}
.pdf-style-card[data-pdfstyle=visual] .pdf-style-icon{background:rgba(34,197,94,.18);border-color:rgba(34,197,94,.35);color:#86efac}
.pdf-style-card[data-pdfstyle=aidashboard] .pdf-style-icon{background:rgba(168,85,247,.22);border-color:rgba(168,85,247,.4);color:#d8b4fe}
.pdf-style-card[data-pdfstyle=word] .pdf-style-icon{background:rgba(37,99,235,.22);border-color:rgba(37,99,235,.45);color:#93c5fd}
.pdf-style-card[data-pdfstyle=jpeg] .pdf-style-icon{background:rgba(236,72,153,.18);border-color:rgba(236,72,153,.35);color:#f9a8d4}
/* Small format badge in the top-right of each card. Replaced when selected by the check. */
.pdf-style-format{position:absolute;top:.45rem;right:.45rem;padding:.1rem .45rem;border-radius:5px;font-size:.62rem;font-weight:800;letter-spacing:.06em;background:rgba(99,131,236,.18);color:#cbd5ff;border:1px solid rgba(99,131,236,.32);font-family:var(--font-code,'JetBrains Mono',Menlo,monospace);text-transform:uppercase}
.pdf-style-card[data-fmt=pdf]  .pdf-style-format{background:rgba(239,68,68,.18);color:#fca5a5;border-color:rgba(239,68,68,.32)}
.pdf-style-card[data-fmt=word] .pdf-style-format{background:rgba(37,99,235,.22);color:#93c5fd;border-color:rgba(37,99,235,.42)}
.pdf-style-card[data-fmt=png]  .pdf-style-format{background:rgba(168,85,247,.22);color:#d8b4fe;border-color:rgba(168,85,247,.42)}
.pdf-style-card[data-fmt=jpg]  .pdf-style-format{background:rgba(236,72,153,.18);color:#f9a8d4;border-color:rgba(236,72,153,.32)}
.pdf-style-card[data-fmt=ai]   .pdf-style-format{background:rgba(168,85,247,.22);color:#d8b4fe;border-color:rgba(168,85,247,.42)}
.pdf-style-card.selected .pdf-style-format{display:none}
.light .pdf-style-format{background:#eef2ff;color:#4f46e5;border-color:#c7d2fe}
.light .pdf-style-card[data-fmt=pdf]  .pdf-style-format{background:#fee2e2;color:#b91c1c;border-color:#fecaca}
.light .pdf-style-card[data-fmt=word] .pdf-style-format{background:#dbeafe;color:#1d4ed8;border-color:#bfdbfe}
.light .pdf-style-card[data-fmt=png]  .pdf-style-format{background:#f5f3ff;color:#6d28d9;border-color:#ddd6fe}
.light .pdf-style-card[data-fmt=jpg]  .pdf-style-format{background:#fce7f3;color:#be185d;border-color:#fbcfe8}
.light .pdf-style-card[data-fmt=ai]   .pdf-style-format{background:#f5f3ff;color:#6d28d9;border-color:#ddd6fe}
/* The export modal's large icon is now an SVG arrow instead of "PDF" text. */
.pdf-large-icon-export svg{width:22px;height:22px}
.pdf-style-title{font-size:.88rem;font-weight:700;margin:0 0 .15rem;color:#eef2ff;line-height:1.25}
.pdf-style-desc{font-size:.73rem;color:#8a99c2;line-height:1.35;margin:0}
.pdf-style-check{position:absolute;top:.4rem;right:.4rem;width:20px;height:20px;border-radius:50%;background:linear-gradient(135deg,#a855f7,#7c3aed);color:#fff;display:none;align-items:center;justify-content:center;font-size:.7rem;box-shadow:0 4px 10px rgba(168,85,247,.4)}
.pdf-style-card.selected .pdf-style-check{display:flex}
/* Step-number chip in section labels — visual ordering cue for the multi-step modal. */
.pdf-step-num{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;border-radius:50%;background:linear-gradient(135deg,#a855f7,#7c3aed);color:#fff;font-weight:800;font-size:.7rem;margin-right:.45rem;box-shadow:0 3px 10px rgba(168,85,247,.32)}
/* Format chip row — picks PDF / Word / PNG / JPEG / AI before the template grid renders. */
.pdf-fmt-row{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:.5rem}
.pdf-fmt-chip{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.25rem;padding:.7rem .65rem;border-radius:11px;border:1.5px solid rgba(99,131,236,.18);background:rgba(20,28,55,.55);color:#e6ecff;cursor:pointer;font:inherit;text-align:center;transition:border-color .12s,background .12s}
.pdf-fmt-chip:hover{border-color:rgba(168,85,247,.55);background:rgba(40,28,72,.55)}
.pdf-fmt-chip.selected{border-color:#a855f7;background:rgba(60,30,100,.4);box-shadow:0 0 0 1px rgba(168,85,247,.5),0 6px 16px rgba(120,60,220,.18)}
.pdf-fmt-chip-ico{width:30px;height:30px;border-radius:8px;display:flex;align-items:center;justify-content:center;background:rgba(168,85,247,.22);color:#c4b5fd;font-size:1rem}
.pdf-fmt-chip.selected .pdf-fmt-chip-ico{background:rgba(168,85,247,.4);color:#fff}
.pdf-fmt-chip-name{font-weight:700;font-size:.86rem;color:#eef2ff}
.pdf-fmt-chip-sub{font-size:.68rem;color:#9aa8cf;line-height:1.25}
.pdf-style-card.pdf-style-card-custom .pdf-style-icon{background:rgba(168,85,247,.22);border-color:rgba(168,85,247,.4);color:#d8b4fe}
/* Customize panel for the Custom Table template. */
.pdf-custom-grid{display:grid;grid-template-columns:1fr 1fr;gap:.55rem .85rem;padding:.7rem .85rem;background:rgba(20,28,55,.45);border:1px solid rgba(99,131,236,.18);border-radius:11px}
.pdf-custom-row{display:flex;flex-direction:column;gap:.3rem;min-width:0}
.pdf-custom-row-full{grid-column:1 / -1}
.pdf-custom-label{font-size:.74rem;font-weight:700;color:#9aa8cf;letter-spacing:.04em;text-transform:uppercase}
.pdf-custom-chips{display:flex;flex-wrap:wrap;gap:.3rem}
.pdf-custom-chip{display:inline-flex;align-items:center;gap:.35rem;padding:.32rem .6rem;border-radius:99px;border:1.5px solid rgba(99,131,236,.22);background:rgba(10,18,38,.55);color:#cbd5ff;font-size:.78rem;cursor:pointer;user-select:none;transition:border-color .1s,background .1s,color .1s}
.pdf-custom-chip:hover{border-color:rgba(168,85,247,.5);color:#e6ecff}
.pdf-custom-chip input{accent-color:#a855f7;cursor:pointer}
.pdf-custom-chip:has(input:checked){border-color:#a855f7;background:rgba(168,85,247,.18);color:#f3f6ff}
.pdf-custom-chip-locked{opacity:.7;cursor:not-allowed}
.pdf-custom-chip-locked input{cursor:not-allowed}
.pdf-custom-select{padding:.42rem .6rem;border-radius:8px;background:rgba(10,18,38,.7);color:#e6ecff;border:1.5px solid rgba(99,131,236,.25);font:inherit;font-size:.84rem;cursor:pointer}
.pdf-custom-select:focus{outline:none;border-color:#a855f7}
.light .pdf-step-num{box-shadow:0 3px 10px rgba(124,58,237,.28)}
.light .pdf-fmt-chip{background:#fff;border-color:#e2e8f0;color:#0f172a}
.light .pdf-fmt-chip:hover{border-color:#a855f7;background:#fafafa}
.light .pdf-fmt-chip.selected{background:#f5f3ff;border-color:#a855f7}
.light .pdf-fmt-chip-ico{background:#ede9fe;color:#6d28d9}
.light .pdf-fmt-chip.selected .pdf-fmt-chip-ico{background:#7c3aed;color:#fff}
.light .pdf-fmt-chip-name{color:#0f172a}
.light .pdf-fmt-chip-sub{color:#64748b}
.light .pdf-custom-grid{background:#f8fafc;border-color:#e2e8f0}
.light .pdf-custom-label{color:#64748b}
.light .pdf-custom-chip{background:#fff;border-color:#cbd5e1;color:#334155}
.light .pdf-custom-chip:hover{border-color:#a855f7;color:#0f172a}
.light .pdf-custom-chip:has(input:checked){background:#ede9fe;border-color:#7c3aed;color:#4c1d95}
.light .pdf-custom-select{background:#fff;border-color:#cbd5e1;color:#0f172a}
.light .pdf-custom-select:focus{border-color:#7c3aed}
.pdf-export-btn{background:linear-gradient(135deg,#a855f7,#7c3aed);border:none;color:#fff;padding:.6rem 1.2rem;border-radius:10px;font-weight:700;cursor:pointer;display:flex;align-items:center;gap:.45rem;font-size:.88rem;box-shadow:0 6px 18px rgba(168,85,247,.4)}
.pdf-export-btn:hover{filter:brightness(1.08)}
.modal-card-wide .row{justify-content:space-between;flex-direction:row-reverse;align-items:center}
.modal-card-wide #modalCancel{background:transparent;border:1.5px solid rgba(120,140,200,.3);color:#d3dbf6;padding:.55rem 1.2rem;border-radius:10px;font-size:.88rem;font-weight:600;cursor:pointer}
.modal-card-wide #modalCancel:hover{background:rgba(120,140,200,.08);border-color:rgba(120,140,200,.5)}
.pdf-modal-divider{border-top:1px solid rgba(120,140,200,.18);margin:.85rem 0 .7rem}
.modal-card .pdf-style-card .pdf-style-icon{color:#fff}
.modal-card .pdf-style-card .pdf-style-icon svg{stroke-width:1.8;width:60%;height:60%}
.modal-card .pdf-style-card .pdf-style-title{font-size:.95rem;font-weight:700;color:#f3f6ff}
.modal-card .pdf-style-card .pdf-style-desc{margin:.18rem 0 0;font-size:.78rem;color:#9aa8cf;line-height:1.35;font-weight:400}
.modal-card .pdf-style-check{position:absolute;top:.55rem;right:.55rem;display:none;width:22px;height:22px;border-radius:50%;background:#a855f7;color:#fff;align-items:center;justify-content:center;font-size:.75rem;font-weight:700}
.light .pdf-modal-header .pdf-large-icon{background:#ede9fe;border-color:#ddd6fe;color:#6d28d9;box-shadow:0 1px 2px rgba(15,23,60,.06)}
.light .pdf-modal-header h2{color:#0f172a}
.light .pdf-modal-header p{color:#475569}
.light .pdf-section-label{color:#0f172a}
.light .pdf-section-label .ico{background:#ede9fe;border-color:#ddd6fe;color:#6d28d9;box-shadow:none}
.light .pdf-section-label .ico svg{stroke-width:2}
.light .pdf-project{background:#fff;border-color:#e2e8f0;color:#0f172a}
.light .pdf-project:hover{background:#f8fafc;border-color:#cbd5e1}
.light .pdf-project.selected{background:#eff6ff;border-color:#3b82f6;box-shadow:0 0 0 1px rgba(59,130,246,.35)}
.light .pdf-project .pdf-proj-name{color:#0f172a}
.light .pdf-project input[type=checkbox]{background:#fff;border-color:#cbd5e1}
/* Without this, the generic light rule above (no :checked) overrode the checked
   fill, leaving a white box with a white checkmark = invisible selection. */
.light .pdf-project input[type=checkbox]:checked{background:linear-gradient(135deg,#3b82f6,#2563eb);border-color:transparent}
.light .pdf-project .pdf-task-count{background:#eff6ff;color:#1e3a8a;border-color:#bfdbfe}
.light .modal-card .pdf-style-card{background:#fff;border-color:#e2e8f0;color:#0f172a;box-shadow:0 1px 2px rgba(15,23,60,.04)}
.light .modal-card .pdf-style-card:hover{background:#faf5ff;border-color:#c4b5fd}
.light .modal-card .pdf-style-card.selected{background:#faf5ff;border-color:#a855f7;box-shadow:0 0 0 1px rgba(168,85,247,.4),0 4px 10px rgba(168,85,247,.12)}
.light .modal-card .pdf-style-card .pdf-style-title{color:#0f172a}
.light .modal-card .pdf-style-card .pdf-style-desc{color:#475569}
.light .modal-card .pdf-style-card .pdf-style-icon{background:#ede9fe;border-color:#ddd6fe;color:#6d28d9;box-shadow:none}
.light .pdf-style-card[data-pdfstyle=table] .pdf-style-icon{background:#dcfce7;border-color:#bbf7d0;color:#15803d}
.light .pdf-style-card[data-pdfstyle=formal] .pdf-style-icon{background:#fef3c7;border-color:#fde68a;color:#b45309}
.light .pdf-style-card[data-pdfstyle=schedule] .pdf-style-icon{background:#dbeafe;border-color:#bfdbfe;color:#1d4ed8}
.light .pdf-style-card[data-pdfstyle=image] .pdf-style-icon{background:#fce7f3;border-color:#fbcfe8;color:#be185d}
.light .pdf-style-card[data-pdfstyle=aidashboard] .pdf-style-icon{background:#ede9fe;border-color:#ddd6fe;color:#6d28d9}
.light .pdf-style-card[data-pdfstyle=docview] .pdf-style-icon{background:#dbeafe;border-color:#bfdbfe;color:#1d4ed8}
.light .pdf-style-card[data-pdfstyle=visual] .pdf-style-icon{background:#dcfce7;border-color:#bbf7d0;color:#15803d}
.light .pdf-modal-divider{border-top-color:#e2e8f0}
@media(max-width:600px){.pdf-style-grid{grid-template-columns:1fr}}

.ai-loading{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:40px 20px}.spinner{width:36px;height:36px;border:3px solid rgba(139,92,246,.25);border-top-color:#8b5cf6;border-radius:50%;animation:spin 0.8s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}
.ai-import-target{display:grid;grid-template-columns:1fr;gap:.4rem;margin-bottom:.6rem}
.ai-import-target select,.ai-import-target input{padding:.45rem .6rem;background:#0a1226;color:#fff;border:1px solid #384b75;border-radius:8px;font:inherit}
.ai-import-tree{max-height:46vh;overflow-y:auto;border:1px solid rgba(99,131,236,.18);border-radius:10px;padding:.5rem .65rem;background:rgba(10,18,38,.45)}
.ai-import-section{padding:.4rem 0;border-bottom:1px dashed rgba(99,131,236,.15)}
.ai-import-section:last-child{border-bottom:none}
.ai-import-sub{padding:.18rem 0 .18rem 1.65rem}
.ai-import-row{display:flex;align-items:center;gap:.55rem;cursor:default}
.ai-import-row input[type=checkbox]{width:16px;height:16px;cursor:pointer;flex-shrink:0;accent-color:#a855f7}
.ai-import-title{flex:1;min-width:0;padding:.3rem .5rem;background:transparent;color:#e6ecff;border:1px solid transparent;border-radius:6px;font:inherit;font-size:.88rem}
.ai-import-title:hover{border-color:rgba(99,131,236,.3)}
.ai-import-title:focus{outline:none;border-color:rgba(168,85,247,.6);background:rgba(10,18,38,.55)}
.ai-import-title-strong{font-weight:600;font-size:.95rem;color:#f3f6ff}
.ai-import-actions-row{display:flex;justify-content:space-between;align-items:center;margin-top:.55rem}
.ai-import-back{color:#c4b5fd;font-size:.78rem;text-decoration:none}
.ai-import-back:hover{text-decoration:underline}
.light .ai-import-target select,.light .ai-import-target input{background:#fff;color:#0f172a;border-color:#cbd5e1}
.light .ai-import-tree{background:#f8fafc;border-color:#e2e8f0}
.light .ai-import-section{border-bottom-color:#e2e8f0}
.light .ai-import-title{color:#0f172a}
.light .ai-import-title:hover{border-color:#cbd5e1}
.light .ai-import-title:focus{background:#fff;border-color:#a855f7}

.map-node.selected,.map-node.pending.selected,.map-node.uncompleted.selected,.map-node.completed.selected{border-color:#f59e0b!important;border-width:3px!important;box-shadow:inset 6px 0 0 #f59e0b,0 0 0 6px rgba(245,158,11,.55),0 0 28px rgba(245,158,11,.55)!important}

/* ========================================================================
   MOBILE RESPONSIVE PASS
   Targets phones and narrow windows. Grouped here so the rest of the file
   stays focused on the desktop / shared layout. Two breakpoints:
     - <= 900px : tablet-ish; doc-page goes single column (already set above).
     - <= 640px : phone; the bigger reflow happens here.
   ======================================================================== */

/* Prevent iOS Safari (incl. iPad in the phone-layout range) from auto-zooming
   when the user focuses an input */
@media (max-width: 1100px) {
  input, textarea, select { font-size: 16px !important; }
}

/* The app's mobile/phone layout now applies up to 1100px (not just 640px), so
   narrow desktop / split-screen windows get the full phone experience —
   compact toolbar (overflow actions in the ⋯ menu), single-column map, etc. —
   instead of a cramped half-desktop layout. The desktop-restoring rules below
   move to min-width:1101px to match. */
@media (max-width: 1100px) {

  /* --- Toolbar -------------------------------------------------------- */
  .tabbar-wrap{padding:.4rem .45rem;gap:.3rem;min-height:auto;flex-wrap:wrap;row-gap:.4rem}
  /* Tabs get their own full-width row below the action buttons */
  .tabbar-area{order:10;flex:0 0 100%;width:100%;min-width:0;padding-top:.15rem;border-top:1px solid var(--line)}
  .tabbar-area > .tabbar{padding:0}
  .icon-btn{padding:.42rem;font-size:.8rem}
  .icon-btn.ic-only{width:36px;height:36px;padding:.4rem}
  .icon-btn.primary span{display:none}      /* "+ New Project" → "+" only */
  .icon-btn.primary{width:36px;height:36px;padding:.4rem;display:inline-flex;align-items:center;justify-content:center}
  .icon-btn.primary svg{margin-right:0}
  .view-toggle button{padding:.32rem .55rem;font-size:.78rem}
  .tab{padding:.42rem .55rem;font-size:.82rem}
  .tab span:first-child{max-width:200px;overflow:hidden;text-overflow:ellipsis;display:inline-block;vertical-align:middle}
  .tabbar-scroll{width:30px;height:34px}
  /* On phones the toolbar wraps to two rows fast. Collapse the
     lower-priority buttons; they remain reachable from the `…` quick-
     actions menu, Settings, or via keyboard on tablets with one. */
  .tabbar-wrap #searchBtn,
  .tabbar-wrap #themeToggleBtn,
  .tabbar-wrap #magnifierBtn,
  .tabbar-wrap #undoBtn,
  .tabbar-wrap #redoBtn,
  .tabbar-wrap #helpBtn,
  .tabbar-wrap #usageChip{display:none}

  /* --- Map view: nodes / sidebar ------------------------------------- */
  .map-layout{grid-template-columns:1fr}
  .map-details{display:none}                /* already hidden, keep */
  .map-node{width:240px;padding:.7rem .85rem}
  .map-node.parent{width:280px;padding:.85rem .9rem}
  .map-node.subtask{width:240px}
  .map-node strong{font-size:.95rem}
  .pane-resize, .pane-collapse-btn{display:none !important}

  /* --- Doc view ------------------------------------------------------- */
  .doc-page{padding:1rem .8rem;grid-template-columns:1fr}
  .doc-side{order:2;padding:0;margin-top:1rem}
  .doc-title-row h1{font-size:1.4rem;line-height:1.2}
  .doc-title-icon{width:44px;height:44px;border-radius:13px}
  .doc-status-bar{padding:.55rem .7rem;gap:.6rem;font-size:.82rem}
  .doc-status-item{flex:1 0 calc(50% - .3rem)}     /* 2-up grid feel */
  .doc-section{padding:.8rem .7rem;margin-bottom:.85rem}
  .doc-section-bar{
    grid-template-columns:18px 38px 1fr;        /* drag, icon, title only */
    grid-template-rows:auto auto;
    grid-template-areas:
      "drag icon title"
      ".    .    actions";
    row-gap:.4rem;
    padding:.55rem .65rem;
    margin:-.3rem -.3rem .65rem;
  }
  .doc-section-bar > .doc-drag-handle{grid-area:drag}
  .doc-section-bar > .doc-section-icon{grid-area:icon;width:38px;height:38px}
  .doc-section-bar > .doc-section-title{grid-area:title;min-width:0}
  .doc-section-bar > .doc-section-title h2{font-size:1rem}
  .doc-section-bar > .doc-section-actions{grid-area:actions;justify-content:flex-start;flex-wrap:wrap;gap:.4rem}
  .doc-section-bar select.doc-layout-picker{font-size:.78rem;padding:.22rem .4rem}

  /* Larger tap targets on action buttons */
  .doc-action-btn.doc-icon-btn{width:34px;height:34px}
  .doc-action-group-sm .doc-icon-btn{width:30px;height:30px}
  .doc-action-group-sm{opacity:1}            /* always visible on touch — no hover */

  /* Drag grips don't make sense on touch; hide them */
  .doc-drag-handle, .tree-grip{opacity:0 !important;pointer-events:none}

  /* Step rows: keep the left padding that clears the counter circle
     (::before sits absolutely at left:.7rem with width 1.5rem).
     Tighten only the right/top/bottom. */
  .doc-step{padding:.65rem .7rem .75rem 2.55rem}
  .doc-step::before{left:.55rem;top:.6rem;width:1.4rem;height:1.4rem;font-size:.74rem}
  .doc-step-head strong{font-size:.92rem}

  /* Notes editor */
  .doc-notes-textarea{min-height:140px}

  /* --- Modals: full-screen sheet ------------------------------------- */
  .modal{align-items:flex-end}
  .modal-card,
  .modal-card.modal-card-wide,
  .modal-card.ai-modal-card{
    width:100% !important;
    max-width:100%;
    max-height:88vh;
    max-height:88dvh;            /* respects iOS Safari URL bar */
    overflow-y:auto;
    -webkit-overflow-scrolling:touch;
    border-radius:16px 16px 0 0;
    padding:.85rem .85rem 1.1rem;
    padding-bottom:max(1.1rem, env(safe-area-inset-bottom));
    margin:0;
  }
  .modal-card h3{font-size:1.05rem;margin:0 0 .85rem}
  .modal-card .row{flex-wrap:wrap;gap:.4rem}
  .modal-card .row > button{flex:1 0 auto;min-height:42px}
  .settings-section{padding:.7rem .8rem;margin:.5rem 0}
  .icon-gallery{max-height:160px}
  .vocab-grid{max-height:300px}
  .vocab-category-grid{grid-template-columns:repeat(auto-fill,minmax(96px,1fr));gap:.4rem}
  .vocab-tile{padding:.55rem .35rem .5rem}

  /* --- AI Assistant modal -------------------------------------------- */
  .ai-transcript{max-height:54vh;min-height:160px}
  .ai-msg{font-size:.9rem;line-height:1.45}
  .ai-input-row{flex-direction:column;align-items:stretch;gap:.45rem}
  .ai-input-row textarea{min-height:64px;max-height:140px}
  .modal-card #aiSendBtn{width:100%;min-height:44px}

  /* --- Share modal --------------------------------------------------- */
  /* Below ~640px the avatar + email + role-select + Remove button no
     longer fit on one line. Let the row wrap so role and Remove drop
     under the email; the email column stays full-width on top. */
  .share-member, .share-owner{flex-wrap:wrap;gap:.45rem .55rem;padding:.55rem .65rem}
  .share-member .share-email, .share-owner .share-email{flex:1 1 60%;min-width:0}
  .share-member .share-role-select{min-height:34px}
  .share-member .share-remove,
  .share-member .share-resend{min-height:34px;padding:.35rem .65rem}
  /* Invite form: stack input above the role + button so the email
     field has full width and the buttons stay tappable. */
  .share-invite{flex-direction:column;align-items:stretch;gap:.45rem}
  .share-invite > textarea{width:100%;min-height:72px}
  .share-invite-row{flex-wrap:wrap;gap:.4rem}
  .share-invite-row > select{flex:0 0 auto;min-height:42px}
  .share-invite-btn{min-height:42px;flex:1 1 100%}
  /* Activity log: tighter row + timestamp under the text on narrow. */
  .share-activity{padding:.4rem .55rem}
  .share-activity-row{flex-wrap:wrap;gap:.15rem .5rem}
  .share-activity-time{flex-basis:100%}
  .empty-invite-row{flex-wrap:wrap;gap:.45rem}
  .empty-invite-meta{flex-basis:100%}

  /* --- Outline (sidebars) -------------------------------------------- */
  .tree-shell, .doc-map-shell{padding:.6rem .65rem .25rem}
  .tree-project, .tree-row{padding:.55rem .5rem;font-size:.92rem}
  .doc-map-link{padding:.55rem .55rem;font-size:.9rem}
  .doc-map-link .doc-map-text{font-size:.9rem}

  /* --- Search palette ------------------------------------------------ */
  .search-palette{padding-top:5vh}
  .search-palette-card{width:100%;max-height:80vh;border-radius:0;border-left:none;border-right:none}

  /* --- PDF modal ----------------------------------------------------- */
  .pdf-modal-header{margin:0 0 .65rem;gap:.6rem}
  .pdf-modal-header .pdf-large-icon{width:34px;height:34px;border-radius:9px}
  .pdf-modal-header h2{font-size:1rem;line-height:1.2}
  .pdf-modal-header p{font-size:.78rem;line-height:1.3}
  .pdf-section{margin:0 0 .7rem}
  .pdf-section-label{font-size:.78rem;margin:0 0 .35rem}
  .pdf-section-label .ico{width:20px;height:20px}
  .pdf-style-grid{grid-template-columns:1fr;gap:.4rem}
  .pdf-projects{max-height:160px;padding-right:.1rem}
  .pdf-project{padding:.5rem .65rem;grid-template-columns:20px 26px 1fr auto;gap:.55rem}
  .pdf-project .pdf-proj-icon{width:26px;height:26px}
  .pdf-project .pdf-proj-name{font-size:.85rem}
  .pdf-project .pdf-task-count{font-size:.68rem;padding:.18rem .45rem}
  .modal-card .pdf-style-card{padding:.55rem .65rem;grid-template-columns:36px 1fr;gap:.6rem}
  .modal-card .pdf-style-card .pdf-style-icon{width:36px;height:36px;border-radius:9px}
  .modal-card .pdf-style-card .pdf-style-title{font-size:.88rem;line-height:1.2}
  .modal-card .pdf-style-card .pdf-style-desc{font-size:.72rem;margin:.1rem 0 0;line-height:1.3}
  .pdf-modal-divider{margin:.6rem 0 .5rem}

  /* --- Filter bar ---------------------------------------------------- */
  .doc-filter-bar{gap:.4rem;padding:.45rem .55rem}
  .doc-filter-search-wrap{padding:0 .55rem}

  /* --- Mic buttons need larger tap targets on touch ------------------ */
  .modal-card .mic-btn{width:32px;height:32px;right:.35rem}
  .modal-card .mic-btn svg{width:16px;height:16px}
  .mic-wrap > input,
  .mic-wrap > textarea{padding-right:42px}

  /* --- Context menu (touch-friendly) --------------------------------- */
  .ctx{min-width:200px}
  .ctx button{padding:.6rem .85rem;font-size:.92rem}
}

/* Even-narrower phones (iPhone SE / 360px) */
@media (max-width: 380px) {
  .tab span:first-child{max-width:90px}
  .doc-status-item{flex:1 0 100%}
  .doc-title-row h1{font-size:1.25rem}
}

/* Hover-only states should not stick on touch devices */
@media (hover: none) {
  .doc-action-group-sm{opacity:1}
  .tab-with-close .close{opacity:.7}
  .tree-row .tree-grip,
  .tree-project .tree-grip{opacity:0}
}

/* iOS safe-area insets — keeps the toolbar below the notch and bottom UI
   above the home indicator when running fullscreen (PWA / Capacitor). */
@supports (padding: env(safe-area-inset-top)) {
  .tabbar-wrap{padding-top:max(.5rem, env(safe-area-inset-top));padding-left:max(.65rem, env(safe-area-inset-left));padding-right:max(.65rem, env(safe-area-inset-right))}
  .modal{padding-bottom:env(safe-area-inset-bottom)}
  .map-viewport{padding-bottom:env(safe-area-inset-bottom)}
}

/* Mobile outline drawer ----------------------------------------------- */
.mobile-only{display:none !important}
.outline-backdrop{position:fixed;inset:0;background:rgba(0,0,0,.5);z-index:55;backdrop-filter:blur(2px);-webkit-backdrop-filter:blur(2px);animation:fadeIn .15s ease}
.outline-backdrop.hidden{display:none}
@keyframes fadeIn{from{opacity:0}to{opacity:1}}
@keyframes slideInRight{from{transform:translateX(100%)}to{transform:translateX(0)}}

@media (max-width: 1100px) {
  .mobile-only{display:inline-flex !important}
  /* Override the older .map-details{display:none} when the drawer is open */
  body.outline-drawer-open #mapDetails{
    display:flex !important;
    flex-direction:column;
    position:fixed;
    top:0;right:0;bottom:0;
    width:min(340px, 88vw);
    z-index:60;
    background:var(--panel);
    border-left:1px solid var(--line);
    box-shadow:-12px 0 36px rgba(0,0,0,.55);
    overflow-y:auto;
    overflow-x:hidden;
    padding:max(.5rem, env(safe-area-inset-top)) 0 max(.5rem, env(safe-area-inset-bottom));
    animation:slideInRight .18s ease;
  }
  body.outline-drawer-open #mapDetails .details-toolbar{
    position:sticky;top:0;background:var(--panel);padding:.4rem .85rem;border-bottom:1px solid var(--line);z-index:1
  }
}
@media (min-width: 1101px) {
  .outline-backdrop{display:none !important}
}

/* Theme picker buttons in Settings */
.modal-card #themeDarkBtn,
.modal-card #themeLightBtn{flex:1;padding:.55rem 1rem}
.modal-card #themeDarkBtn.active,
.modal-card #themeLightBtn.active{background:linear-gradient(135deg,#a855f7,#7c3aed);border-color:transparent;color:#fff}

/* =========================================================
   AUTH SCREEN — full-page sign in / sign up
   ========================================================= */
.auth-screen{position:fixed;inset:0;display:grid;grid-template-columns:1fr 1fr;background:linear-gradient(135deg,#0a1022 0%,#181f3f 60%,#221a3f 100%);color:#e6ecff;z-index:40;overflow:auto}
.auth-screen.hidden{display:none}
.auth-pane{display:flex;flex-direction:column;justify-content:center;padding:max(2.4rem,env(safe-area-inset-top)) 3rem max(2.4rem,env(safe-area-inset-bottom))}
.auth-pane-hero{position:relative;background:radial-gradient(ellipse at top left,rgba(168,85,247,.22) 0%,rgba(168,85,247,0) 55%),radial-gradient(ellipse at bottom right,rgba(59,130,246,.22) 0%,rgba(59,130,246,0) 55%)}
.auth-pane-hero::before{content:'';position:absolute;inset:0;background-image:linear-gradient(rgba(255,255,255,.04) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.04) 1px,transparent 1px);background-size:32px 32px;mask-image:radial-gradient(ellipse at center,#000 0%,transparent 75%);pointer-events:none}
.auth-logo{width:88px;height:88px;border-radius:20px;background:linear-gradient(135deg,#a855f7,#7c3aed);display:flex;align-items:center;justify-content:center;margin-bottom:1.5rem;box-shadow:0 12px 36px rgba(168,85,247,.4)}
.auth-pane-hero .auth-wordmark{margin:0 0 .8rem;font-size:3rem;font-weight:800;letter-spacing:-.02em;line-height:1.05;color:#fff}
.auth-tagline{margin:0 0 2rem;font-size:1.1rem;line-height:1.5;color:#cbd5ff;max-width:440px}
.auth-bullets{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:.7rem}
.auth-bullets li{display:flex;align-items:center;gap:.7rem;font-size:.95rem;color:#dde6ff}
.auth-dot{width:8px;height:8px;border-radius:50%;background:linear-gradient(135deg,#a855f7,#7c3aed);box-shadow:0 0 12px rgba(168,85,247,.6);flex-shrink:0}
.auth-pane-form{align-items:center}
.auth-form-card{width:100%;max-width:400px;background:rgba(20,28,55,.7);border:1px solid rgba(99,131,236,.22);backdrop-filter:blur(20px) saturate(1.4);-webkit-backdrop-filter:blur(20px) saturate(1.4);border-radius:18px;padding:2rem 2rem 1.5rem;box-shadow:0 24px 60px rgba(0,0,0,.45)}
.auth-form-card h2{margin:0 0 .35rem;font-size:1.5rem;font-weight:700;color:#fff;letter-spacing:-.01em}
.auth-sub{margin:0 0 1.5rem;font-size:.88rem;color:#9aa8cf}
.auth-form{display:flex;flex-direction:column;gap:.85rem}
.auth-field{display:flex;flex-direction:column;gap:.3rem}
.auth-field span{font-size:.78rem;font-weight:600;color:#cbd5ff;letter-spacing:.01em}
.auth-field input{width:100%;padding:.7rem .85rem;border-radius:10px;background:rgba(10,18,38,.6);border:1.5px solid rgba(99,131,236,.25);color:#fff;font-family:inherit;font-size:.95rem;outline:none;transition:border-color .15s,box-shadow .15s}
.auth-field input:focus{border-color:#a855f7;box-shadow:0 0 0 3px rgba(168,85,247,.18)}
.auth-primary{margin-top:.4rem;padding:.75rem 1rem;border-radius:10px;border:none;background:linear-gradient(135deg,#a855f7,#7c3aed);color:#fff;font-weight:600;font-size:.95rem;cursor:pointer;font-family:inherit;letter-spacing:.005em;transition:filter .12s,transform .08s;box-shadow:0 6px 18px rgba(168,85,247,.32)}
.auth-primary:hover{filter:brightness(1.08)}
.auth-primary:active{transform:translateY(1px)}
.auth-secondary{padding:.65rem 1rem;border-radius:10px;background:transparent;border:1.5px solid rgba(99,131,236,.32);color:#dde6ff;font-weight:500;font-size:.9rem;cursor:pointer;font-family:inherit;transition:background .12s,border-color .12s}
.auth-secondary:hover{background:rgba(99,131,236,.1);border-color:rgba(99,131,236,.5)}
.auth-divider{position:relative;text-align:center;margin:.4rem 0;color:#7e8db1;font-size:.78rem;letter-spacing:.08em;text-transform:uppercase}
.auth-divider::before,.auth-divider::after{content:'';position:absolute;top:50%;width:calc(50% - 1.4rem);height:1px;background:rgba(99,131,236,.18)}
.auth-divider::before{left:0}.auth-divider::after{right:0}
.auth-divider span{position:relative;background:rgba(20,28,55,.7);padding:0 .55rem;display:inline-block}
.auth-google{padding:.7rem 1rem;border-radius:10px;background:#fff;color:#202124;border:1px solid rgba(0,0,0,.08);font-weight:500;font-size:.92rem;cursor:pointer;font-family:inherit;display:inline-flex;align-items:center;justify-content:center;gap:.6rem;transition:filter .12s,box-shadow .12s}
.auth-google:hover{filter:brightness(.98);box-shadow:0 2px 8px rgba(0,0,0,.12)}
/* Sign in with Apple — Apple's guidelines: black button, white logo + text. */
.auth-apple{margin-top:.5rem;padding:.7rem 1rem;border-radius:10px;background:#000;color:#fff;border:1px solid #000;font-weight:500;font-size:.92rem;cursor:pointer;font-family:inherit;display:inline-flex;align-items:center;justify-content:center;gap:.5rem;transition:filter .12s,box-shadow .12s}
.auth-apple:hover{filter:brightness(1.25);box-shadow:0 2px 8px rgba(0,0,0,.3)}
.auth-apple[hidden]{display:none}
.auth-message{margin:.85rem 0 0;font-size:.85rem;color:#fca5a5;min-height:1.1em;text-align:center}
.auth-fineprint{margin:1rem 0 0;font-size:.72rem;color:#7e8db1;text-align:center}

/* Light mode auth screen */
.light .auth-screen{background:linear-gradient(135deg,#f4f7ff 0%,#e8ecff 60%,#f4ecff 100%);color:#0f172a}
.light .auth-pane-hero{background:radial-gradient(ellipse at top left,rgba(168,85,247,.18) 0%,rgba(168,85,247,0) 55%),radial-gradient(ellipse at bottom right,rgba(59,130,246,.18) 0%,rgba(59,130,246,0) 55%)}
.light .auth-pane-hero .auth-wordmark{color:#0f172a}
.light .auth-tagline{color:#475569}
.light .auth-bullets li{color:#334155}
.light .auth-form-card{background:#fff;border-color:#e2e8f0;box-shadow:0 24px 60px rgba(15,23,60,.12)}
.light .auth-form-card h2{color:#0f172a}
.light .auth-sub{color:#64748b}
.light .auth-field span{color:#475569}
.light .auth-field input{background:#f8fafc;border-color:#cbd5e1;color:#0f172a}
.light .auth-secondary{color:#475569;border-color:#cbd5e1}
.light .auth-secondary:hover{background:#f1f5f9;border-color:#64748b}
.light .auth-divider{color:#64748b}
.light .auth-divider::before,.light .auth-divider::after{background:#e2e8f0}
.light .auth-divider span{background:#fff}
.light .auth-fineprint{color:#64748b}

/* Stack to single column on phones */
@media (max-width: 880px){
  .auth-screen{grid-template-columns:1fr}
  .auth-pane{padding:1.6rem 1.4rem}
  .auth-pane-hero{padding-bottom:.8rem;text-align:center;align-items:center}
  .auth-pane-hero .auth-wordmark{font-size:2.2rem}
  .auth-tagline{font-size:.95rem;margin-bottom:1rem}
  .auth-bullets{display:none}
  .auth-form-card{padding:1.5rem 1.4rem 1.2rem}
}
@media (max-width: 480px){
  .auth-pane-hero .auth-wordmark{font-size:1.8rem}
  .auth-logo{width:52px;height:52px;border-radius:14px;margin-bottom:1rem}
  .auth-form-card{border-radius:14px}
}

/* Help center welcome nudge — first-run callout anchored to ? button. */
.help-welcome{
  position:fixed;z-index:1200;width:300px;max-width:calc(100vw - 16px);
  background:rgba(20,28,55,.96);
  color:#e6ecff;
  border:1px solid rgba(168,85,247,.35);
  border-radius:12px;
  padding:.85rem .95rem .8rem;
  box-shadow:0 18px 44px rgba(0,0,0,.45),0 0 0 1px rgba(168,85,247,.18);
  font-size:.86rem;line-height:1.45;
  backdrop-filter:blur(14px) saturate(1.4);
  -webkit-backdrop-filter:blur(14px) saturate(1.4);
  animation:helpWelcomeIn .22s ease-out;
}
@keyframes helpWelcomeIn{
  from{opacity:0;transform:translateY(-6px) scale(.97)}
  to{opacity:1;transform:translateY(0) scale(1)}
}
.help-welcome-arrow{
  position:absolute;top:-7px;left:var(--arrow-x,50%);transform:translateX(-50%) rotate(45deg);
  width:14px;height:14px;
  background:rgba(20,28,55,.96);
  border-left:1px solid rgba(168,85,247,.35);
  border-top:1px solid rgba(168,85,247,.35);
  border-top-left-radius:3px;
}
.help-welcome-title{font-weight:700;color:#f3f6ff;margin-bottom:.3rem;font-size:.95rem}
.help-welcome-body{color:#c8d0f0;margin-bottom:.75rem}
.help-welcome-body strong{color:#f3f6ff}
.help-welcome-actions{display:flex;gap:.5rem;justify-content:flex-end}
.help-welcome-primary,.help-welcome-secondary{
  font:inherit;font-size:.8rem;padding:.4rem .8rem;border-radius:7px;cursor:pointer;border:1px solid transparent;
}
.help-welcome-primary{
  background:linear-gradient(135deg,#a855f7,#7c3aed);color:#fff;font-weight:600;
  box-shadow:0 4px 12px rgba(168,85,247,.32);
}
.help-welcome-primary:hover{filter:brightness(1.08)}
.help-welcome-secondary{background:transparent;color:#9aa8cf;border-color:rgba(154,168,207,.3)}
.help-welcome-secondary:hover{background:rgba(154,168,207,.1);color:#e6ecff}
.light .help-welcome{background:#fff;color:#0f172a;border-color:#ddd6fe;box-shadow:0 18px 44px rgba(15,23,42,.18),0 0 0 1px #ede9fe}
.light .help-welcome-arrow{background:#fff;border-color:#ddd6fe}
.light .help-welcome-title{color:#0f172a}
.light .help-welcome-body{color:#475569}
.light .help-welcome-body strong{color:#0f172a}
.light .help-welcome-secondary{color:#64748b;border-color:#cbd5e1}
.light .help-welcome-secondary:hover{background:#f1f5f9;color:#0f172a}

/* Per-node icon picker modal --------------------------------------------- */
.modal-card.modal-card-icon-picker{width:min(820px,96vw);max-height:88vh;display:flex;flex-direction:column;padding:1rem 1.1rem 0;overflow:hidden}
.modal-card-icon-picker .modal-body{flex:1 1 auto;min-height:0;overflow:hidden;padding:0}
/* Don't try to fill the modal-card's height — modal-card doesn't have
 * a fixed height for the picker's height:100% to resolve against, so
 * the grid grew unbounded and overflowed the dialog. Cap the scroll
 * area on .icon-picker-body instead. */
.icon-picker{display:flex;flex-direction:column;min-height:0}
.icon-picker-header{display:flex;justify-content:space-between;align-items:flex-start;gap:1rem;margin-bottom:.7rem;flex-wrap:wrap}
.icon-picker-current{display:flex;align-items:center;gap:.7rem;min-width:0}
.icon-picker-current-ico{width:48px;height:48px;border-radius:12px;display:flex;align-items:center;justify-content:center}
.icon-picker-current-ico svg{width:24px;height:24px}
.icon-picker-current-title{font-weight:700;font-size:.95rem;color:#f3f6ff;line-height:1.2;max-width:280px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.icon-picker-current-sub{font-size:.75rem;color:#9aa8cf;margin-top:.15rem;font-family:var(--font-code,Menlo,monospace)}
.icon-picker-controls{display:flex;flex-direction:column;gap:.25rem}
.icon-picker-section-label{font-size:.66rem;font-weight:700;color:#9aa8cf;letter-spacing:.06em;text-transform:uppercase}
.icon-picker-colors{display:flex;gap:.3rem;flex-wrap:wrap}
.icon-picker-color{width:24px;height:24px;border-radius:50%;border:2px solid transparent;cursor:pointer;padding:0;outline:none}
.icon-picker-color:hover{transform:scale(1.1)}
.icon-picker-color.selected{border-color:#fff;box-shadow:0 0 0 2px #a855f7,0 4px 12px rgba(0,0,0,.25)}
.icon-picker-actions-row{display:flex;gap:.5rem;align-items:center;margin-bottom:.55rem}
.icon-picker-actions-row #iconPickerSearch{flex:1;padding:.42rem .6rem;background:rgba(10,18,38,.55);color:#e6ecff;border:1px solid rgba(99,131,236,.28);border-radius:7px;font:inherit;font-size:.82rem}
.icon-picker-actions-row #iconPickerSearch:focus{outline:none;border-color:rgba(168,85,247,.6)}
.icon-picker-body{max-height:55vh;overflow-y:auto;padding:.4rem .55rem .8rem;border-top:1px solid rgba(99,131,236,.18);background:rgba(10,18,38,.25);border-radius:8px}
.icon-picker-cat{margin:.6rem 0 .8rem}
.icon-picker-cat-name{font-size:.7rem;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:#9aa8cf;padding:.4rem .5rem .3rem}
.icon-picker-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(86px,1fr));gap:.4rem;padding:0 .3rem}
.icon-picker-tile{display:flex;flex-direction:column;align-items:center;gap:.3rem;padding:.55rem .35rem .45rem;border-radius:9px;background:rgba(20,28,55,.55);border:1.5px solid transparent;color:#cbd5ff;cursor:pointer;font:inherit;font-size:.7rem;text-align:center;transition:border-color .1s,background .1s,transform .1s}
.icon-picker-tile:hover{background:rgba(28,38,72,.75);border-color:rgba(168,85,247,.4)}
.icon-picker-tile.selected{background:rgba(168,85,247,.18);border-color:#a855f7;color:#f3f6ff}
.icon-picker-tile-ico{width:44px;height:44px;border-radius:10px;display:flex;align-items:center;justify-content:center;pointer-events:none}
.icon-picker-tile-ico svg,
.icon-picker-tile-ico img{width:28px;height:28px;pointer-events:none}
.icon-picker-tile-name{font-size:.72rem;color:inherit;opacity:.9;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%}
/* Clickable icon tiles in Doc view */
.doc-icon-clickable{border:none;padding:0;cursor:pointer;background:inherit;color:inherit;display:flex;align-items:center;justify-content:center;transition:transform .1s,box-shadow .12s}
.doc-icon-clickable:hover{transform:scale(1.05);box-shadow:0 0 0 2px rgba(168,85,247,.5)}
.doc-icon-clickable:focus-visible{outline:2px solid #a855f7;outline-offset:2px}
.light .icon-picker-current-title{color:#0f172a}
.light .icon-picker-current-sub{color:#64748b}
.light .icon-picker-section-label{color:#64748b}
.light .icon-picker-actions-row #iconPickerSearch{background:#fff;color:#0f172a;border-color:#cbd5e1}
.light .icon-picker-actions-row #iconPickerSearch:focus{border-color:#a855f7}
.light .icon-picker-body{background:#f8fafc;border-color:#e2e8f0}
.light .icon-picker-cat-name{color:#64748b}
.light .icon-picker-tile{background:#fff;color:#334155}
.light .icon-picker-tile:hover{background:#fafafa;border-color:#a855f7}
.light .icon-picker-tile.selected{background:#ede9fe;border-color:#7c3aed;color:#4c1d95}
.light .icon-picker-color.selected{border-color:#0f172a;box-shadow:0 0 0 2px #a855f7}

/* --- Subscription chip + panel + pricing modal -------------------------- */
.usage-chip{display:inline-flex;align-items:center;gap:.35rem;padding:.28rem .55rem .28rem .45rem;border-radius:99px;background:rgba(34,197,94,.16);border:1px solid rgba(34,197,94,.34);color:#86efac;font:inherit;font-size:.74rem;font-weight:600;cursor:pointer;letter-spacing:.01em;transition:background .12s,border-color .12s,color .12s,transform .12s;height:30px;white-space:nowrap}
.usage-chip:hover{transform:translateY(-1px)}
.usage-chip-spark{font-size:.85em;opacity:.9}
.usage-chip-text{font-variant-numeric:tabular-nums}
.usage-chip.low {background:rgba(168,85,247,.16);border-color:rgba(168,85,247,.38);color:#d8b4fe}
.usage-chip.warn{background:rgba(245,158,11,.18);border-color:rgba(245,158,11,.4);color:#fcd34d}
.usage-chip.out {background:rgba(239,68,68,.18);border-color:rgba(239,68,68,.42);color:#fca5a5}
.usage-chip.paid::after{content:'';display:inline-block;width:5px;height:5px;border-radius:50%;background:#a855f7;margin-left:.15rem;box-shadow:0 0 6px rgba(168,85,247,.7)}
@media (max-width:1100px){.usage-chip-text{display:none}.usage-chip{padding:.3rem .4rem;width:30px;justify-content:center}}
.light .usage-chip{background:#dcfce7;border-color:#86efac;color:#166534}
.light .usage-chip.low {background:#f3e8ff;border-color:#d8b4fe;color:#6b21a8}
.light .usage-chip.warn{background:#fef3c7;border-color:#fcd34d;color:#92400e}
.light .usage-chip.out {background:#fee2e2;border-color:#fca5a5;color:#991b1b}

.sub-panel{display:flex;flex-direction:column;gap:1.1rem;padding:.3rem .15rem .25rem}
.sub-scheduled{padding:.55rem .75rem;border-radius:9px;background:rgba(245,158,11,.12);border:1px solid rgba(245,158,11,.32);color:#fcd34d;font-size:.84rem}
.sub-scheduled a{color:#fcd34d;font-weight:700;text-decoration:underline}
.sub-current{display:flex;flex-direction:column;gap:.35rem;padding:1.1rem 1.25rem;border-radius:12px;background:rgba(20,28,55,.5);border:1px solid rgba(99,131,236,.2)}
.sub-tier-name{display:flex;align-items:center;justify-content:space-between;gap:.7rem}
.sub-tier-badge{display:inline-flex;align-items:center;padding:.18rem .55rem;border-radius:99px;font-size:.74rem;font-weight:800;letter-spacing:.04em;text-transform:uppercase}
.sub-tier-free   {background:rgba(154,168,207,.18);border:1px solid rgba(154,168,207,.32);color:#cbd5ff}
.sub-tier-starter{background:rgba(59,130,246,.2);border:1px solid rgba(59,130,246,.4);color:#93c5fd}
.sub-tier-pro    {background:linear-gradient(135deg,rgba(168,85,247,.28),rgba(124,58,237,.22));border:1px solid rgba(168,85,247,.5);color:#f3f6ff}
.sub-tier-price{font-size:.92rem;font-weight:800;color:#f3f6ff}
.sub-tier-cadence{font-size:.78rem;color:#9aa8cf}
.sub-section{padding:1.1rem 1.25rem;border-radius:12px;background:rgba(20,28,55,.4);border:1px solid rgba(99,131,236,.2)}
.sub-section-head{display:flex;align-items:baseline;justify-content:space-between;gap:.7rem}
.sub-section-label{font-size:.72rem;font-weight:700;color:#9aa8cf;letter-spacing:.06em;text-transform:uppercase}
.sub-section-value{font-size:.92rem;font-weight:700;color:#f3f6ff;font-variant-numeric:tabular-nums}
.sub-topup{font-size:.72rem;font-weight:600;color:#c4b5fd;margin-left:.3rem}
.sub-section-sub{font-size:.76rem;color:#9aa8cf;margin-top:.35rem}
.sub-meter{height:8px;border-radius:99px;background:rgba(10,18,38,.6);overflow:hidden;margin-top:.55rem;border:1px solid rgba(99,131,236,.15)}
.sub-meter-fill{height:100%;border-radius:99px;transition:width .3s ease}
.sub-meter-ok  {background:linear-gradient(90deg,#22c55e,#16a34a)}
.sub-meter-low {background:linear-gradient(90deg,#a855f7,#7c3aed)}
.sub-meter-warn{background:linear-gradient(90deg,#f59e0b,#d97706)}
.sub-meter-out {background:linear-gradient(90deg,#ef4444,#dc2626)}
.sub-actions{display:flex;flex-wrap:wrap;gap:.5rem}
.sub-btn-primary{padding:.55rem 1.1rem;border-radius:9px;background:linear-gradient(135deg,#a855f7,#7c3aed);color:#fff;font:inherit;font-weight:700;font-size:.86rem;border:none;cursor:pointer;box-shadow:0 6px 16px rgba(168,85,247,.32)}
.sub-btn-primary:hover{filter:brightness(1.07)}
.sub-btn-secondary{padding:.55rem 1rem;border-radius:9px;background:transparent;border:1.5px solid rgba(120,140,200,.35);color:#d3dbf6;font:inherit;font-size:.85rem;font-weight:600;cursor:pointer}
.sub-btn-secondary:hover{background:rgba(154,168,207,.1);color:#fff}
.sub-btn-quiet{color:#9aa8cf;border-color:rgba(120,140,200,.22)}
.sub-note{font-size:.74rem;margin-top:.2rem;line-height:1.5}
.light .sub-scheduled{background:#fef3c7;border-color:#fcd34d;color:#92400e}
.light .sub-scheduled a{color:#92400e}
.light .sub-current,.light .sub-section{background:#fff;border-color:#e2e8f0}
.light .sub-tier-price,.light .sub-section-value{color:#0f172a}
.light .sub-tier-cadence,.light .sub-section-sub,.light .sub-section-label{color:#64748b}
.light .sub-meter{background:#f1f5f9;border-color:#e2e8f0}
.light .sub-btn-secondary{color:#334155;border-color:#cbd5e1}
.light .sub-btn-secondary:hover{background:#f8fafc;color:#0f172a}

/* Pricing modal */
.pricing-modal{display:flex;flex-direction:column;gap:1rem}
.pricing-cadence{display:inline-flex;align-self:center;padding:.25rem;border-radius:99px;background:rgba(10,18,38,.5);border:1px solid rgba(99,131,236,.2)}
.pricing-cadence-btn{padding:.4rem 1rem;border-radius:99px;border:none;background:transparent;color:#cbd5ff;font:inherit;font-size:.82rem;font-weight:700;cursor:pointer;display:inline-flex;align-items:center;gap:.45rem}
.pricing-cadence-btn:hover{color:#fff}
.pricing-cadence-btn.active{background:linear-gradient(135deg,#a855f7,#7c3aed);color:#fff;box-shadow:0 4px 12px rgba(168,85,247,.32)}
.pricing-cadence-savings{font-size:.66rem;font-weight:800;letter-spacing:.04em;padding:.1rem .4rem;border-radius:5px;background:rgba(34,197,94,.22);color:#86efac}
.pricing-cadence-btn.active .pricing-cadence-savings{background:rgba(255,255,255,.22);color:#fff}
.pricing-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:.7rem}
.pricing-card{display:flex;flex-direction:column;gap:.5rem;padding:1rem .95rem 1rem;border-radius:13px;background:rgba(20,28,55,.55);border:1.5px solid rgba(99,131,236,.22);position:relative;transition:transform .15s,border-color .15s}
.pricing-card.has-badge{padding-top:1.35rem}
.pricing-card:hover{transform:translateY(-2px);border-color:rgba(168,85,247,.45)}
.pricing-card.is-current{border-color:rgba(34,197,94,.45);background:rgba(34,197,94,.08)}
.pricing-badge{position:absolute;top:-10px;left:50%;transform:translateX(-50%);padding:.2rem .65rem;border-radius:99px;font-size:.66rem;font-weight:800;letter-spacing:.05em;text-transform:uppercase;background:linear-gradient(135deg,#a855f7,#7c3aed);color:#fff;box-shadow:0 4px 12px rgba(168,85,247,.35)}
.pricing-tier{font-size:.78rem;font-weight:800;color:#9aa8cf;letter-spacing:.08em;text-transform:uppercase}
.pricing-price{font-size:1.7rem;font-weight:800;color:#f3f6ff;letter-spacing:-.02em;line-height:1.1}
.pricing-price-sub{font-size:.72rem;color:#9aa8cf;margin-top:-.15rem}
.pricing-features{list-style:none;padding:0;margin:.4rem 0 .6rem;display:flex;flex-direction:column;gap:.32rem;flex:1}
.pricing-features li{position:relative;padding-left:1.1rem;font-size:.83rem;line-height:1.4;color:#cbd5ff}
.pricing-features li::before{content:'';position:absolute;left:0;top:.2em;width:14px;height:14px;background:no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a855f7' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7'/%3E%3C/svg%3E")}
.pricing-features strong{color:#f3f6ff}
.pricing-cta{padding:.6rem 1rem;border-radius:9px;font:inherit;font-weight:700;font-size:.86rem;cursor:pointer;border:none;text-align:center;width:100%}
.pricing-cta-current{background:rgba(34,197,94,.22);color:#86efac;border:1px solid rgba(34,197,94,.4);cursor:default}
.pricing-cta-free   {background:transparent;color:#9aa8cf;border:1.5px solid rgba(120,140,200,.32)}
.pricing-cta-starter{background:linear-gradient(135deg,#3b82f6,#2563eb);color:#fff;box-shadow:0 6px 16px rgba(59,130,246,.32)}
.pricing-cta-pro    {background:linear-gradient(135deg,#a855f7,#7c3aed);color:#fff;box-shadow:0 6px 16px rgba(168,85,247,.32)}
.pricing-cta:not(.pricing-cta-current):hover{filter:brightness(1.07)}
.pricing-note{font-size:.74rem;text-align:center;margin:.2rem 0 0;line-height:1.5}
.light .pricing-cadence{background:#f8fafc;border-color:#e2e8f0}
.light .pricing-cadence-btn{color:#475569}
.light .pricing-cadence-btn.active{color:#fff}
.light .pricing-cadence-savings{background:#dcfce7;color:#166534}
.light .pricing-card{background:#fff;border-color:#e2e8f0}
.light .pricing-card.is-current{background:#f0fdf4;border-color:#86efac}
.light .pricing-tier{color:#64748b}
.light .pricing-price{color:#0f172a}
.light .pricing-price-sub,.light .pricing-features li{color:#475569}
.light .pricing-features strong{color:#0f172a}
.light .pricing-cta-current{background:#dcfce7;color:#166534;border-color:#86efac}
.light .pricing-cta-free{color:#475569;border-color:#cbd5e1}

/* Out-of-runs hard gate modal -------------------------------------------- */
.modal-card.modal-card-credits-gate{width:min(560px,94vw);padding:1.1rem 1.2rem .9rem}
.credits-gate{display:flex;flex-direction:column;gap:.85rem}
.credits-gate-head{display:flex;align-items:flex-start;gap:.85rem}
.credits-gate-ico{width:42px;height:42px;border-radius:12px;display:flex;align-items:center;justify-content:center;background:linear-gradient(135deg,rgba(168,85,247,.32),rgba(124,58,237,.22));color:#fff;font-size:1.5rem;font-weight:700;flex-shrink:0;box-shadow:0 6px 18px rgba(168,85,247,.32)}
.credits-gate-title{font-size:1.05rem;font-weight:800;color:#f3f6ff;margin-bottom:.15rem}
.credits-gate-sub{font-size:.86rem;color:#9aa8cf;line-height:1.5}
.credits-gate-sub strong{color:#e6ecff}
.credits-gate-options{display:grid;grid-template-columns:1fr;gap:.5rem}
@media (min-width:520px){.credits-gate-options:has(>:nth-child(2)){grid-template-columns:1fr 1fr}}
.credits-gate-card{display:flex;flex-direction:column;gap:.25rem;padding:.85rem .95rem;border-radius:11px;background:rgba(20,28,55,.55);border:1.5px solid rgba(99,131,236,.25);color:#e6ecff;text-align:left;cursor:pointer;font:inherit;transition:transform .12s,border-color .12s,background .12s}
.credits-gate-card:hover{transform:translateY(-1px);border-color:rgba(168,85,247,.5);background:rgba(28,38,72,.7)}
.credits-gate-card-primary{background:linear-gradient(135deg,rgba(168,85,247,.22),rgba(124,58,237,.16));border-color:rgba(168,85,247,.55)}
.credits-gate-card-primary:hover{border-color:#a855f7}
.credits-gate-card-title{font-size:.92rem;font-weight:700;color:#f3f6ff}
.credits-gate-card-price{font-size:1.05rem;font-weight:800;color:#c4b5fd;letter-spacing:-.01em}
.credits-gate-card-sub{font-size:.74rem;color:#9aa8cf;line-height:1.35}
.credits-gate-foot{display:flex;align-items:center;justify-content:space-between;gap:.5rem;padding-top:.2rem}
.credits-gate-foot a{font-size:.82rem;font-weight:600;color:#c4b5fd;text-decoration:none}
.credits-gate-foot a:hover{text-decoration:underline}
.credits-gate-quiet{background:transparent;border:none;color:#9aa8cf;font:inherit;font-size:.82rem;cursor:pointer;padding:.4rem .65rem;border-radius:7px}
.credits-gate-quiet:hover{background:rgba(154,168,207,.1);color:#e6ecff}
.light .credits-gate-title{color:#0f172a}
.light .credits-gate-sub{color:#475569}
.light .credits-gate-sub strong{color:#0f172a}
.light .credits-gate-card{background:#fff;border-color:#e2e8f0;color:#0f172a}
.light .credits-gate-card:hover{background:#fafafa;border-color:#a855f7}
.light .credits-gate-card-primary{background:#f5f3ff;border-color:#a855f7}
.light .credits-gate-card-title{color:#0f172a}
.light .credits-gate-card-price{color:#6d28d9}
.light .credits-gate-card-sub{color:#64748b}
.light .credits-gate-foot a{color:#7c3aed}
.light .credits-gate-quiet{color:#64748b}
.light .credits-gate-quiet:hover{background:#f1f5f9;color:#0f172a}

/* Feature-gate modal (lighter than the runs gate) ------------------------ */
.modal-card.modal-card-feature-gate{width:min(440px,94vw);padding:1rem 1.1rem .85rem}
.feature-gate{display:flex;flex-direction:column;gap:.7rem}
.feature-gate-head{display:flex;align-items:flex-start;gap:.7rem}
.feature-gate-ico{width:42px;height:42px;border-radius:11px;display:flex;align-items:center;justify-content:center;background:linear-gradient(135deg,rgba(168,85,247,.32),rgba(124,58,237,.18));color:#fff;flex-shrink:0;box-shadow:0 4px 14px rgba(168,85,247,.28)}
.feature-gate-ico svg{width:20px;height:20px}
.feature-gate-title{font-size:1.02rem;font-weight:800;color:#f3f6ff;margin-bottom:.1rem;line-height:1.2}
.feature-gate-tier{font-size:.74rem;font-weight:700;color:#c4b5fd;letter-spacing:.04em;text-transform:uppercase}
.feature-gate-desc{margin:0;font-size:.86rem;color:#9aa8cf;line-height:1.5}
.feature-gate-actions{display:flex;align-items:center;justify-content:space-between;gap:.8rem;padding-top:.25rem;flex-wrap:wrap}
.feature-gate-primary{padding:.55rem 1.05rem;border-radius:9px;background:linear-gradient(135deg,#a855f7,#7c3aed);color:#fff;font:inherit;font-weight:700;font-size:.84rem;border:none;cursor:pointer;box-shadow:0 5px 14px rgba(168,85,247,.32)}
.feature-gate-primary:hover{filter:brightness(1.07)}
.feature-gate-actions a{font-size:.82rem;font-weight:600;color:#c4b5fd;text-decoration:none}
.feature-gate-actions a:hover{text-decoration:underline}
.light .feature-gate-title{color:#0f172a}
.light .feature-gate-tier{color:#7c3aed}
.light .feature-gate-desc{color:#475569}
.light .feature-gate-actions a{color:#7c3aed}

/* Persistent subscription banner ---------------------------------------- */
.sub-banner{display:flex;align-items:center;gap:.65rem;padding:.5rem .9rem;font-size:.85rem;line-height:1.4;border-bottom:1px solid transparent;flex-wrap:wrap}
.sub-banner.hidden{display:none}
.sub-banner-ico{font-size:1rem;flex-shrink:0;font-weight:700}
.sub-banner-text{flex:1;min-width:200px}
.sub-banner-text strong{font-weight:700}
.sub-banner-actions{display:flex;align-items:center;gap:.35rem;flex-shrink:0}
.sub-banner-cta{padding:.32rem .75rem;border-radius:7px;border:1.5px solid currentColor;background:transparent;color:inherit;font:inherit;font-size:.78rem;font-weight:700;cursor:pointer;letter-spacing:.01em;transition:background .12s}
.sub-banner-cta:hover{background:rgba(255,255,255,.12)}
.sub-banner-dismiss{width:24px;height:24px;border-radius:6px;border:none;background:transparent;color:inherit;font-size:1.05rem;line-height:1;cursor:pointer;opacity:.7;padding:0}
.sub-banner-dismiss:hover{opacity:1;background:rgba(255,255,255,.12)}
.sub-banner-warn{background:linear-gradient(90deg,rgba(245,158,11,.16),rgba(245,158,11,.1));color:#fcd34d;border-bottom-color:rgba(245,158,11,.32)}
.sub-banner-danger{background:linear-gradient(90deg,rgba(239,68,68,.2),rgba(239,68,68,.14));color:#fca5a5;border-bottom-color:rgba(239,68,68,.4)}
.sub-banner-info{background:linear-gradient(90deg,rgba(168,85,247,.2),rgba(168,85,247,.12));color:#d8b4fe;border-bottom-color:rgba(168,85,247,.35)}
.sub-banner-danger .sub-banner-cta{background:rgba(239,68,68,.18)}
.sub-banner-danger .sub-banner-cta:hover{background:rgba(239,68,68,.28)}
.light .sub-banner-warn  {background:#fef3c7;color:#92400e;border-bottom-color:#fcd34d}
.light .sub-banner-danger{background:#fee2e2;color:#991b1b;border-bottom-color:#fca5a5}
.light .sub-banner-info  {background:#f5f3ff;color:#6d28d9;border-bottom-color:#ddd6fe}
.light .sub-banner-cta:hover{background:rgba(15,23,42,.06)}
.light .sub-banner-dismiss:hover{background:rgba(15,23,42,.08)}
@media (max-width:540px){.sub-banner{padding:.5rem .65rem;font-size:.78rem}.sub-banner-cta{font-size:.72rem;padding:.28rem .55rem}}

/* Success banner variant — post-checkout welcome. */
.sub-banner-success{background:linear-gradient(90deg,rgba(34,197,94,.22),rgba(34,197,94,.12));color:#86efac;border-bottom-color:rgba(34,197,94,.42)}
.sub-banner-success .sub-banner-cta{background:rgba(34,197,94,.18)}
.sub-banner-success .sub-banner-cta:hover{background:rgba(34,197,94,.3)}
.light .sub-banner-success{background:#dcfce7;color:#166534;border-bottom-color:#86efac}
.light .sub-banner-success .sub-banner-cta{background:rgba(22,101,52,.12)}

/* Quick-capture modal --------------------------------------------------- */
.modal-card.modal-card-quick-capture{width:min(480px,94vw);padding:1rem 1.1rem .9rem}
.quick-capture{display:flex;flex-direction:column;gap:.65rem}
.quick-capture #qcTitle{width:100%;padding:.65rem .8rem;font-size:1rem;background:rgba(10,18,38,.7);color:#f3f6ff;border:1.5px solid rgba(168,85,247,.4);border-radius:9px;font:inherit;font-weight:500}
.quick-capture #qcTitle:focus{outline:none;border-color:#a855f7;box-shadow:0 0 0 3px rgba(168,85,247,.18)}
.quick-capture-row{display:flex;align-items:center;gap:.6rem}
.quick-capture-label{font-size:.74rem;font-weight:700;color:#9aa8cf;letter-spacing:.06em;text-transform:uppercase}
.quick-capture-select{flex:1;padding:.42rem .55rem;background:rgba(10,18,38,.55);color:#e6ecff;border:1px solid rgba(99,131,236,.28);border-radius:7px;font:inherit;font-size:.84rem;cursor:pointer}
.quick-capture-select:focus{outline:none;border-color:#a855f7}
.quick-capture-hint{font-size:.76rem;color:#9aa8cf;line-height:1.4}
.quick-capture-hint strong{color:#86efac}
.quick-capture-hint kbd{font-family:var(--font-code,Menlo,monospace);font-size:.74rem;padding:.05em .35em;border-radius:4px;background:rgba(99,131,236,.22);border:1px solid rgba(99,131,236,.35);color:#e6ecff}
.light .quick-capture #qcTitle{background:#fff;color:#0f172a;border-color:#a855f7}
.light .quick-capture #qcTitle:focus{box-shadow:0 0 0 3px rgba(124,58,237,.16)}
.light .quick-capture-label{color:#64748b}
.light .quick-capture-select{background:#fff;color:#0f172a;border-color:#cbd5e1}
.light .quick-capture-select:focus{border-color:#7c3aed}
.light .quick-capture-hint{color:#64748b}
.light .quick-capture-hint strong{color:#166534}
.light .quick-capture-hint kbd{background:#eef2ff;border-color:#c7d2fe;color:#0f172a}

/* ---- Collab phase 3a: share modal ---- */
.share-modal{display:flex;flex-direction:column;gap:.85rem}
.share-project{font-size:1rem;color:#e6ecff}
.share-owner{display:flex;align-items:center;gap:.6rem;padding:.6rem .75rem;background:rgba(20,28,55,.55);border:1px solid rgba(99,131,236,.25);border-radius:9px;font-size:.86rem;color:#e6ecff}
.share-members{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.35rem}
.share-member{display:flex;align-items:center;gap:.6rem;padding:.55rem .75rem;background:rgba(20,28,55,.4);border:1px solid rgba(99,131,236,.18);border-radius:9px;font-size:.85rem;color:#e6ecff}
.share-member.is-pending{opacity:.78;border-style:dashed}
.share-empty{padding:.6rem .75rem;font-size:.84rem}
.share-avatar{width:30px;height:30px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:linear-gradient(135deg,#7c3aed,#a855f7);color:#fff;font-size:.86rem;font-weight:700;flex-shrink:0}
.share-email{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.share-role{font-size:.74rem;text-transform:uppercase;letter-spacing:.04em;color:#9aa8cf;padding:.15rem .5rem;border-radius:6px;background:rgba(99,131,236,.15)}
.share-role-select{font:inherit;font-size:.74rem;font-weight:600;text-transform:uppercase;letter-spacing:.04em;color:#cbd5e1;padding:.18rem .35rem;border-radius:6px;background:rgba(99,131,236,.15);border:1px solid rgba(120,140,200,.25);cursor:pointer}
.share-role-select:hover{background:rgba(99,131,236,.22);color:#fff}
.share-role-select:disabled{opacity:.55;cursor:default}
.light .share-role-select{color:#334155;background:#eef2ff;border-color:#cbd5e1}
.light .share-role-select:hover{background:#e0e7ff;color:#0f172a}
.share-pending-tag{font-size:.7rem;color:#a855f7;margin-left:.35rem}
.share-remove{background:transparent;border:none;color:#9aa8cf;font:inherit;font-size:.78rem;cursor:pointer;padding:.25rem .5rem;border-radius:6px}
.share-remove:hover{color:#ef4444;background:rgba(239,68,68,.08)}
.share-resend{background:transparent;border:1px solid rgba(168,85,247,.45);color:#c4b5fd;font:inherit;font-size:.74rem;font-weight:600;cursor:pointer;padding:.22rem .55rem;border-radius:6px;letter-spacing:.02em}
.share-resend:hover{background:rgba(168,85,247,.12);color:#fff;border-color:rgba(168,85,247,.7)}
.share-resend:disabled{opacity:.55;cursor:default}
.light .share-resend{color:#7c3aed;border-color:#c4b5fd}
.light .share-resend:hover{background:#ede9fe;color:#6d28d9}
.share-invite{display:flex;flex-direction:column;gap:.5rem}
.share-invite textarea{width:100%;min-height:60px;max-height:200px;padding:.55rem .7rem;background:#0a1226;color:#fff;border:1px solid #384b75;border-radius:8px;font:inherit;font-size:.85rem;line-height:1.45;resize:vertical;box-sizing:border-box}
.share-invite-row{display:flex;gap:.5rem;align-items:center}
.share-invite select{padding:.55rem .7rem;background:#0a1226;color:#fff;border:1px solid #384b75;border-radius:8px;font:inherit;font-size:.85rem;flex:0 0 auto}
.share-invite-btn{flex:1 0 auto;padding:.55rem 1rem;border-radius:8px;background:linear-gradient(135deg,#a855f7,#7c3aed);color:#fff;border:none;font:inherit;font-weight:700;font-size:.85rem;cursor:pointer}
.share-invite-btn:hover{filter:brightness(1.07)}
.share-invite-btn:disabled{opacity:.55;cursor:default;filter:none}
.share-leave-btn{align-self:flex-start;padding:.55rem 1rem;border-radius:8px;background:transparent;border:1.5px solid rgba(239,68,68,.4);color:#fca5a5;font:inherit;font-weight:600;font-size:.85rem;cursor:pointer}
.share-leave-btn:hover{background:rgba(239,68,68,.08);color:#ef4444}
.share-hint{font-size:.74rem;margin:.1rem 0 0;line-height:1.5}
.share-status{font-size:.82rem;min-height:1.1rem}
.share-status-ok{color:#10b981}
.share-status-err{color:#ef4444}
.share-activity{margin:.6rem 0 .1rem;padding:.45rem .7rem;border-radius:9px;background:rgba(20,28,55,.5);border:1px solid rgba(99,131,236,.18)}
.share-activity > summary{cursor:pointer;font-size:.78rem;font-weight:600;color:#a8b3d4;letter-spacing:.04em;text-transform:uppercase;list-style:none;padding:.15rem 0;outline:none}
.share-activity > summary::-webkit-details-marker{display:none}
.share-activity > summary::before{content:'▸';display:inline-block;margin-right:.4rem;color:#7e8db1;transition:transform .15s ease}
.share-activity[open] > summary::before{transform:rotate(90deg)}
.share-activity-list{list-style:none;padding:0;margin:.5rem 0 .15rem;display:flex;flex-direction:column;gap:.35rem;max-height:240px;overflow-y:auto}
.share-activity-row{display:flex;align-items:baseline;gap:.6rem;padding:.35rem .5rem;border-radius:7px;background:rgba(8,12,28,.4);font-size:.8rem;color:#cbd5e1}
.share-activity-row strong{color:#e6ecff;font-weight:600}
.share-activity-text{flex:1;min-width:0;line-height:1.4}
.share-activity-time{flex-shrink:0;font-size:.7rem;color:#7e8db1}
.share-activity-row.share-activity-removed,.share-activity-row.share-activity-declined{border-left:2px solid rgba(239,68,68,.5)}
.share-activity-row.share-activity-accepted{border-left:2px solid rgba(16,185,129,.55)}
.share-activity-row.share-activity-invited{border-left:2px solid rgba(168,85,247,.55)}
.share-activity-row.share-activity-role_changed{border-left:2px solid rgba(245,158,11,.55)}
.share-activity-row.share-activity-left{border-left:2px solid rgba(120,140,200,.45)}
.light .share-activity{background:#f8fafc;border-color:#e2e8f0}
.light .share-activity > summary{color:#475569}
.light .share-activity > summary::before{color:#64748b}
.light .share-activity-row{background:#fff;color:#334155}
.light .share-activity-row strong{color:#0f172a}
.light .share-activity-time{color:#64748b}
.light .share-owner,.light .share-member{background:#fff;border-color:#e2e8f0;color:#0f172a}
.light .share-role{color:#475569;background:#eef2ff}
.light .share-empty{color:#64748b}
.light .share-invite textarea,.light .share-invite select{background:#fff;color:#0f172a;border-color:#cbd5e1}

/* ---- Collab phase 3b: viewer UI ---- */
.tab-role-badge{font-size:.62rem;font-weight:700;text-transform:uppercase;letter-spacing:.05em;padding:.1rem .35rem;border-radius:5px;margin-left:.4rem;line-height:1.2;vertical-align:middle}
.tab-role-viewer{background:rgba(148,163,184,.22);color:#cbd5e1;border:1px solid rgba(148,163,184,.35)}
.tab-role-editor{background:rgba(168,85,247,.18);color:#c4b5fd;border:1px solid rgba(168,85,247,.32)}
.tab-shared{padding-right:.85rem}
.tab-viewer{opacity:.92}
.light .tab-role-viewer{background:#e2e8f0;color:#475569;border-color:#cbd5e1}
.light .tab-role-editor{background:#ede9fe;color:#6d28d9;border-color:#c4b5fd}
.readonly-toast{position:fixed;bottom:24px;left:50%;transform:translateX(-50%) translateY(20px);padding:.6rem 1rem;background:rgba(20,28,55,.96);color:#e6ecff;border:1px solid rgba(99,131,236,.35);border-radius:10px;font-size:.85rem;font-weight:600;box-shadow:0 12px 32px rgba(0,0,0,.42);opacity:0;pointer-events:none;transition:opacity .18s,transform .18s;z-index:2000}
.readonly-toast.show{opacity:1;transform:translateX(-50%) translateY(0)}
.light .readonly-toast{background:#1e293b;color:#fff;border-color:#475569}

/* ---- Collab phase 5: presence avatars ---- */
.presence-pile{display:inline-flex;align-items:center;margin-left:.35rem;vertical-align:middle}
.presence-pile .presence-dot+.presence-dot{margin-left:-7px}
.presence-dot{width:18px;height:18px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;font-size:.62rem;font-weight:700;color:#fff;border:1.5px solid #0a1226;box-shadow:0 1px 3px rgba(0,0,0,.45);line-height:1}
.presence-more{background:rgba(148,163,184,.5)!important;font-size:.6rem}
.light .presence-dot{border-color:#fff;box-shadow:0 1px 3px rgba(15,23,42,.18)}

/* ---- Collab phase 6: live cursors ---- */
.cursor-overlay{position:absolute;inset:0;pointer-events:none;overflow:hidden;z-index:5}
.live-cursor{position:absolute;top:0;left:0;will-change:transform;transition:transform .08s linear;display:flex;align-items:flex-start;gap:.25rem;pointer-events:none}
.live-cursor-arrow{filter:drop-shadow(0 1px 2px rgba(0,0,0,.35));flex-shrink:0}
.live-cursor-label{font-size:.7rem;font-weight:700;color:#fff;padding:.12rem .42rem;border-radius:6px;line-height:1.15;white-space:nowrap;transform:translate(-2px,12px);box-shadow:0 2px 6px rgba(0,0,0,.3)}
.light .live-cursor-label{color:#fff}

/* ---- Notifications: bell + dropdown ---- */
#notificationsBtn.has-unread{color:#fbbf24}
#notificationsBtn .bell-count{background:#f43f5e;color:#fff}
#commentsUnreadBtn .bell-count{background:#a855f7;color:#fff}
.light .icon-btn .bell-count{box-shadow:0 0 0 2px #fff,0 1px 3px rgba(15,23,42,.18)}
.notif-dropdown{position:fixed;width:340px;max-height:70vh;background:rgba(14,21,46,.98);border:1px solid rgba(99,131,236,.32);border-radius:12px;box-shadow:0 18px 50px rgba(0,0,0,.55);z-index:1500;opacity:0;transform:translateY(-6px);pointer-events:none;transition:opacity .15s,transform .15s;overflow:hidden;display:flex;flex-direction:column}
.notif-dropdown.open{opacity:1;transform:translateY(0);pointer-events:auto}
.notif-head{display:flex;justify-content:space-between;align-items:center;padding:.7rem .85rem;border-bottom:1px solid rgba(99,131,236,.22);color:#e6ecff;font-weight:700;font-size:.92rem}
.notif-mark-all{background:transparent;border:none;color:#a5b4fc;font:inherit;font-size:.78rem;cursor:pointer;padding:.25rem .5rem;border-radius:6px}
.notif-mark-all:hover{background:rgba(165,180,252,.08);color:#c7d2fe}
.notif-head-actions{display:flex;gap:.15rem;margin-left:auto}
.notif-row{position:relative}
.notif-delete{position:absolute;top:.4rem;right:.45rem;background:transparent;border:none;color:#7e8db1;font:inherit;font-size:1rem;line-height:1;width:22px;height:22px;border-radius:5px;cursor:pointer;opacity:0;transition:opacity .12s ease}
.notif-row:hover .notif-delete{opacity:1}
.notif-delete:hover{color:#ef4444;background:rgba(239,68,68,.1)}
.light .notif-delete{color:#64748b}
.light .notif-delete:hover{color:#ef4444;background:#fef2f2}
.notif-list{overflow-y:auto;flex:1}
.notif-empty{padding:1.3rem .85rem;color:#9aa8cf;font-size:.86rem;text-align:center}
.notif-row{display:flex;gap:.55rem;align-items:flex-start;width:100%;padding:.65rem .85rem;background:transparent;border:none;border-bottom:1px solid rgba(99,131,236,.12);color:#e6ecff;font:inherit;text-align:left;cursor:pointer;line-height:1.4}
.notif-row:last-child{border-bottom:none}
.notif-row:hover{background:rgba(99,131,236,.08)}
.notif-row.is-unread{background:rgba(168,85,247,.08)}
.notif-row.is-unread:hover{background:rgba(168,85,247,.13)}
.notif-dot{width:8px;height:8px;border-radius:50%;background:#a855f7;margin-top:.4rem;flex-shrink:0;opacity:0}
.notif-row.is-unread .notif-dot{opacity:1}
.notif-body{display:flex;flex-direction:column;gap:.18rem;flex:1;min-width:0}
.notif-text{font-size:.84rem;color:#e6ecff;white-space:normal}
.notif-time{font-size:.72rem;color:#94a3b8}
.notif-row-pending{flex-wrap:wrap}
.notif-actions{display:flex;gap:.4rem;width:100%;padding:.35rem 0 .1rem 1.3rem}
.notif-accept,.notif-decline{padding:.32rem .8rem;border-radius:7px;font:inherit;font-size:.78rem;font-weight:600;cursor:pointer;border:1px solid transparent}
.notif-accept{background:linear-gradient(135deg,#a855f7,#7c3aed);color:#fff;border-color:transparent}
.notif-accept:hover{filter:brightness(1.08)}
.notif-accept:disabled{opacity:.55;cursor:default}
.notif-decline{background:transparent;color:#cbd5e1;border-color:rgba(120,140,200,.35)}
.notif-decline:hover{background:rgba(154,168,207,.1);color:#fff}
.notif-decline:disabled{opacity:.55;cursor:default}
.light .notif-decline{color:#475569;border-color:#cbd5e1}
.light .notif-decline:hover{background:#f8fafc;color:#0f172a}
.light .notif-dropdown{background:#fff;border-color:#e2e8f0;box-shadow:0 18px 50px rgba(15,23,42,.16)}
.light .notif-head{color:#0f172a;border-bottom-color:#e2e8f0}
.light .notif-row{color:#0f172a;border-bottom-color:#eef2f7}
.light .notif-row:hover{background:#f8fafc}
.light .notif-row.is-unread{background:#f5f3ff}
.light .notif-row.is-unread:hover{background:#ede9fe}
.light .notif-text{color:#0f172a}
.light .notif-time{color:#64748b}
.light .notif-empty{color:#64748b}
/* ---------------------------------------------------------------------------
 * Accessibility — Phase 1: visible focus indicators + skip link.
 * Uses :focus-visible so the ring only shows for keyboard users, not for
 * pointer clicks. Two rings:
 *  - default purple (matches the primary accent), 2px outline + 2px offset
 *  - inset variant on buttons that live inside narrow rows where an outline
 *    would get clipped (e.g. .ctx, .tree-toggle)
 * --------------------------------------------------------------------------- */
.icon-btn:focus-visible,
.modal-card button:focus-visible,
.bulk-bar button:focus-visible,
.pdf-btn:focus-visible,
.auth-primary:focus-visible,
.auth-secondary:focus-visible,
.auth-google:focus-visible,
.auth-apple:focus-visible,
.pane-collapse-btn:focus-visible,
.doc-map-mini-btn:focus-visible,
.view-toggle button:focus-visible,
.gmail-refresh:focus-visible,
.outlook-refresh:focus-visible,
.gmail-search-btn:focus-visible,
.outlook-search-btn:focus-visible,
.tab:focus-visible,
.tabbar-scroll:focus-visible,
button.gmail-disc:focus-visible,
button.outlook-disc:focus-visible{
  outline:2px solid #a855f7;
  outline-offset:2px;
}
.ctx button:focus-visible,
.tree-toggle:focus-visible,
.email-pref-check:focus-visible,
.gmail-search-result:focus-visible,
.outlook-search-result:focus-visible{
  outline:2px solid #a855f7;
  outline-offset:1px;
}
/* Form controls + plain text inputs get a softer focus ring with a glow */
input:focus-visible,
textarea:focus-visible,
select:focus-visible{
  outline:2px solid #a855f7;
  outline-offset:1px;
}
.light .icon-btn:focus-visible,
.light .modal-card button:focus-visible,
.light .ctx button:focus-visible,
.light .tab:focus-visible,
.light input:focus-visible,
.light textarea:focus-visible,
.light select:focus-visible,
.light .gmail-search-result:focus-visible,
.light .outlook-search-result:focus-visible{
  outline-color:#7c3aed;
}

/* Skip link: visually hidden until focused, then floats to top-left. Allows
 * keyboard users to jump past the toolbar into the canvas. */
.skip-link{
  position:fixed;top:-100px;left:.5rem;z-index:1000;
  padding:.55rem .9rem;border-radius:8px;
  background:#a855f7;color:#fff;font-weight:600;text-decoration:none;
  transition:top .15s ease;
}
.skip-link:focus{top:.5rem;outline:2px solid #fff;outline-offset:2px}

/* ---------------------------------------------------------------------------
 * Accessibility — Phase 4: respect prefers-reduced-motion.
 * Some users get vertigo or nausea from animation. When they've set the OS
 * preference, kill spinners + transitions + animations. We keep instantaneous
 * state changes (focus rings, hover backgrounds) but strip the motion.
 * --------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce){
  *, *::before, *::after{
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  /* The Gmail / Outlook refresh button spinner becomes a static ↻ —
   * visually communicates "in flight" via disabled state + opacity. */
  .gmail-refresh.is-spinning,
  .outlook-refresh.is-spinning{
    animation: none !important;
    opacity: .7;
  }
}

/* a11y utility: visible to screen readers, invisible to sighted users.
 * Lets us label form-group <fieldset>s with a <legend> that doesn't take
 * up layout space. */
.visually-hidden{
  position:absolute !important;
  width:1px;height:1px;
  padding:0;margin:-1px;
  overflow:hidden;clip:rect(0 0 0 0);
  white-space:nowrap;border:0;
}

/* Reset fieldset chrome — the .email-pref-list visual is unchanged. */
fieldset.email-pref-list{
  border:0;margin:0;padding:0;min-width:0;
}

/* Legal acceptance checkbox shown only on the Create Account / Google
 * Sign In paths. Hidden by default; .auth-form.show-terms reveals it. */
.auth-terms{display:flex;gap:.55rem;align-items:flex-start;padding:.55rem .15rem;font-size:.85rem;color:#cdd5ed;line-height:1.4}
.auth-terms input[type=checkbox]{margin-top:.2rem;flex-shrink:0}
.auth-terms a{color:#a5b4fc;text-decoration:underline}
.light .auth-terms{color:#1e293b}
.light .auth-terms a{color:#4f46e5}

/* Settings → Legal: subtle text-link list instead of chunky buttons.
 * These are reference links to read-only pages, not actions; they shouldn't
 * compete with Sign Out / Delete Account for visual weight. */
.legal-links{list-style:none;margin:.4rem 0 0;padding:0;display:flex;flex-direction:column;gap:.15rem}
.legal-links a{display:inline-flex;align-items:center;gap:.4rem;color:#a5b4fc;text-decoration:none;font-size:.88rem;padding:.35rem .1rem;border-radius:4px;transition:color .12s, background .12s}
.legal-links a:hover{color:#c4b5fd;background:rgba(168,85,247,.08);padding-left:.4rem;padding-right:.4rem}
.legal-links a:focus-visible{outline:2px solid #a855f7;outline-offset:2px}
.legal-link-arrow{font-size:.78rem;opacity:.7}
.light .legal-links a{color:#4338ca}
.light .legal-links a:hover{color:#3730a3;background:#eef2ff}

/* Per-user AI kill switch. Body gets .ai-disabled when state.aiOptOut
 * is true; hide every AI affordance so the user isn't tempted to click
 * something we'd just have to refuse anyway. */
body.ai-disabled #aiAssistantBtn,
body.ai-disabled #emptyImport,
body.ai-disabled #usageChip{
  display:none !important;
}

/* When the right-click context menu is open, hide the bottom bulk-bar
 * so the two popovers don't overlap (the menu's lower items were
 * getting covered by the bulk bar — see the screenshot user pasted).
 * :has() ships in all modern engines from 2023 onward. */
body:has(#ctxMenu:not(.hidden)) #bulkBar{
  display:none !important;
}

/* Icon picker scroll containment. .modal-card-wide ships
 * overflow-y:auto, so when the picker grew tall the WHOLE dialog
 * scrolled and the header disappeared above the viewport. Simpler
 * than threading flex sizing through modal-card → modalBody →
 * .icon-picker: disable outer scroll for this variant and let the
 * .icon-picker-body's max-height + overflow:auto be the only
 * scroller. */
.modal-card.modal-card-wide:has(.icon-picker){overflow:hidden}
.modal-card.modal-card-wide:has(.icon-picker) .icon-picker-body{max-height:50vh;overflow-y:auto}

/* Magnifier loupe: 1.75x zoom of the map under the cursor. */
.magnifier{position:absolute;width:260px;height:260px;border-radius:50%;border:2px solid rgba(255,255,255,.7);box-shadow:0 10px 36px rgba(0,8,40,.55),inset 0 0 0 1px rgba(0,0,0,.35);overflow:hidden;pointer-events:none;background-image:linear-gradient(rgba(255,255,255,.05) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.05) 1px,transparent 1px);background-size:20px 20px;background-color:#0a1022;z-index:60;will-change:left,top,transform;contain:strict}
.light .magnifier{background-color:#edf2ff;border-color:rgba(15,23,60,.45);box-shadow:0 10px 28px rgba(15,23,60,.22),inset 0 0 0 1px rgba(15,23,60,.18)}
.magnifier.hidden{display:none}
.magnifier-inner{position:absolute;left:0;top:0;width:100%;height:100%;transform-origin:0 0;pointer-events:none}
.magnifier-inner > svg,.magnifier-inner > div{position:absolute;left:0;top:0;pointer-events:none !important}
.magnifier-inner .map-node{cursor:default !important}
.magnifier-crosshair{position:absolute;left:50%;top:50%;width:14px;height:14px;margin:-7px 0 0 -7px;pointer-events:none;border-radius:50%;border:1.5px solid rgba(255,255,255,.85);box-shadow:0 0 0 1px rgba(0,0,0,.35)}
.light .magnifier-crosshair{border-color:rgba(15,23,60,.85);box-shadow:0 0 0 1px rgba(255,255,255,.7)}
#magnifierBtn[aria-pressed="true"]{color:#a5b4fc;background:rgba(99,102,241,.18);border-color:rgba(99,102,241,.55)}

/* Reminders section inside the Notifications dropdown. */
.notif-section{padding:.35rem 0}
.notif-reminders{border-bottom:1px solid rgba(99,131,236,.18);padding-bottom:.5rem;margin-bottom:.25rem}
.notif-subhead{display:flex;align-items:center;gap:.45rem;padding:.55rem .85rem .35rem;font-size:.66rem;font-weight:700;text-transform:uppercase;letter-spacing:.09em;color:#9aa8cf}
.notif-subhead-count{font-size:.65rem;background:rgba(126,141,177,.18);color:#a5b4d6;padding:.05rem .5rem;border-radius:10px;text-transform:none;letter-spacing:0;font-weight:500;line-height:1.4}
.reminder-sub{padding:.1rem 0 .25rem}
.reminder-sub h5{margin:.4rem .85rem .3rem;font-size:.66rem;font-weight:600;text-transform:uppercase;letter-spacing:.08em;color:#7e8db1;display:flex;align-items:center;gap:.4rem}
.reminder-sub.overdue h5{color:#fca5a5}
.reminder-sub.today   h5{color:#fcd34d}
.reminder-sub.stale   h5{color:#93c5fd}
.reminder-sub-count{font-size:.62rem;background:rgba(126,141,177,.18);color:#a5b4d6;padding:.02rem .42rem;border-radius:10px;font-weight:500;letter-spacing:0}
.reminder-sub.overdue .reminder-sub-count{background:rgba(239,68,68,.16);color:#fca5a5}
.reminder-sub.today   .reminder-sub-count{background:rgba(245,158,11,.16);color:#fcd34d}
.reminder-sub.stale   .reminder-sub-count{background:rgba(96,165,250,.16);color:#93c5fd}
.reminder-row{position:relative;display:flex;align-items:center;gap:.55rem;padding:.5rem .85rem .5rem 1rem;border-bottom:1px solid rgba(99,131,236,.1);cursor:pointer;line-height:1.35}
.reminder-row:last-child{border-bottom:none}
.reminder-row:hover{background:rgba(99,131,236,.08)}
.reminder-row::before{content:'';position:absolute;left:.35rem;top:.6rem;bottom:.6rem;width:2px;border-radius:2px;background:rgba(126,141,177,.5)}
.reminder-row.reminder-overdue::before{background:#ef4444}
.reminder-row.reminder-today::before{background:#f59e0b}
.reminder-row.reminder-stale::before{background:#60a5fa}
.reminder-dot{display:none}
.reminder-body{flex:1;min-width:0;display:flex;flex-direction:column;gap:.1rem}
.reminder-title{font-size:.85rem;color:#e6ecff;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.reminder-meta{font-size:.72rem;color:#9aa8cf}
.reminder-action{width:26px;height:26px;border-radius:7px;background:transparent;color:#9aa8cf;border:1px solid rgba(99,131,236,.32);font-size:.85rem;line-height:1;cursor:pointer;flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;transition:background .12s,color .12s,border-color .12s}
.reminder-action:hover{background:rgba(99,131,236,.18);color:#fff;border-color:rgba(99,131,236,.55)}
.reminder-row.reminder-overdue .reminder-action:hover,.reminder-row.reminder-today .reminder-action:hover{color:#86efac;background:rgba(34,197,94,.18);border-color:rgba(34,197,94,.5)}
.light .notif-subhead{color:#51607f}
.light .reminder-title{color:#0b1b3f}
.light .reminder-meta{color:#51607f}
.light .reminder-row:hover{background:rgba(99,131,236,.12)}
.light .reminder-action{color:#51607f;border-color:rgba(15,23,60,.2)}

/* Sub-task layout mini-map inside the Edit Task modal. */
.task-submap-wrap{margin:.9rem 0 .6rem;padding:.7rem;background:rgba(10,18,38,.55);border:1px solid #2a3a64;border-radius:8px}
.task-submap-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:.45rem}
.task-submap-title{font-size:.8rem;font-weight:600;color:#c7d2fe;letter-spacing:.02em}
.task-submap-presets{display:inline-flex;gap:.25rem;background:rgba(99,131,236,.08);border:1px solid rgba(99,131,236,.25);border-radius:7px;padding:.18rem}
.task-submap-preset{background:transparent;color:#c7d2fe;border:1px solid transparent;border-radius:5px;padding:.28rem .35rem;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;transition:background .12s,color .12s,border-color .12s}
.task-submap-preset:hover{background:rgba(99,131,236,.22);color:#fff;border-color:rgba(99,131,236,.45)}
.task-submap-preset:active{background:rgba(99,131,236,.35)}
.light .task-submap-presets{background:rgba(99,131,236,.08);border-color:rgba(99,131,236,.22)}
.light .task-submap-preset{color:#3730a3}
.light .task-submap-preset:hover{background:rgba(99,131,236,.18);color:#1e1b4b}
.task-submap-canvas{position:relative;width:100%;height:240px;background:#0a1226;border:1px solid #384b75;border-radius:6px;overflow:hidden;touch-action:none}
.task-submap-node{position:absolute;background:linear-gradient(180deg,rgba(99,131,236,.55),rgba(79,70,229,.55));color:#fff;border:1px solid rgba(99,131,236,.85);border-radius:4px;padding:2px 5px;font-size:10px;line-height:1.15;cursor:grab;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;user-select:none;-webkit-user-select:none;box-sizing:border-box;display:flex;align-items:center;transition:transform .08s,box-shadow .08s}
.task-submap-node:hover{transform:translateY(-1px);box-shadow:0 4px 10px rgba(99,131,236,.35)}
.task-submap-node.parent{background:linear-gradient(180deg,rgba(168,85,247,.55),rgba(124,58,237,.55));border-color:rgba(168,85,247,.85);cursor:default}
.task-submap-node.parent:hover{transform:none;box-shadow:none}
.task-submap-node.dragging{cursor:grabbing;opacity:.9;z-index:10;box-shadow:0 6px 16px rgba(99,131,236,.5)}
.task-submap-hint{font-size:.7rem;margin:.45rem 0 0;color:#7e8db1}
.light .task-submap-wrap{background:rgba(99,131,236,.06);border-color:rgba(99,131,236,.25)}
.light .task-submap-title{color:#3730a3}
.light .task-submap-canvas{background:#f5f7ff;border-color:rgba(99,131,236,.3)}

/* Brand mark on the always-purple auth-logo card: stays cream in both themes. */
.auth-logo svg {
  color: #F5F4F0;
  --brand-stroke: #7C3AED;              /* ring matches the iris card */
}
/* Empty-state mark sits on the app bg, so it follows the theme. */
.empty-illustration svg {
  color: #F5F4F0;
  --brand-stroke: #0a1022;
}
.light .empty-illustration svg {
  color: #0F1115;
  --brand-stroke: #FFFFFF;
}

/* --- SVG icons that replaced former emoji/dingbat glyphs --- */
/* Most of these containers are flex-centred or were sized for a text glyph,
   so the inline SVG just needs explicit dimensions to match the old footprint. */
.ctx button .icon svg{width:16px;height:16px}
.slash-icon svg{width:16px;height:16px}
.sub-banner-ico svg{width:18px;height:18px}
.gmail-card-icon svg,.outlook-card-icon svg{width:18px;height:18px}
.gmail-search-icon svg,.outlook-search-icon svg{width:17px;height:17px}
.gmail-msg-attachment-icon svg,.outlook-msg-attachment-icon svg{width:15px;height:15px;display:block}
.hc-tab-ico svg,.hc-link-ico svg{width:15px;height:15px}
.hc-faq-cta-ico svg{width:20px;height:20px}
.hc-ai-icon svg{width:16px;height:16px}
.hc-ai-avatar svg{width:15px;height:15px}
.pdf-style-check svg,.modal-card .pdf-style-check svg{width:13px;height:13px}
.usage-chip-spark svg{width:13px;height:13px;display:block}
.credits-gate-ico svg{width:22px;height:22px}
.agenda-item .agenda-complete svg{width:16px;height:16px}
.tpl-item .tpl-edit svg{width:14px;height:14px}
.hc-tour-fab-ico svg{width:14px;height:14px;vertical-align:-2px}
.legal-link-arrow svg{width:13px;height:13px;vertical-align:-2px}
/* Assignee icon precedes the editable name; hide it while the field is empty
   so the "+ Add assignee" placeholder reads cleanly. */
.doc-assignee-ico{display:inline-flex;align-items:center;justify-content:center;color:#a8b3d4;vertical-align:middle;margin-right:.3rem}
.doc-assignee-ico svg{width:14px;height:14px}
.doc-assignee:has(.doc-assignee-edit:empty) .doc-assignee-ico{display:none}
.light .doc-assignee-ico{color:#475569}
