:root {
  --intel-blue: #0054ae;
  --intel-blue-dark: #00377a;
  --intel-blue-light: #eaf3fb;
  --intel-energy: #00c7fd;
  --intel-teal: #00a3a1;
  --ink: #15202b;
  --muted: #647582;
  --line: #e6eaee;
  --bg: #f5f7f9;
  --surface: #ffffff;
  --green: #2bb673;
  --amber: #f5a623;
  --red: #e34850;
  --purple: #8b5cf6;
  /* Workfront-style dark navigation rail */
  --nav-bg: #15243b;
  --nav-bg-2: #1f3251;
  --nav-text: #9fb0c3;
  --nav-section: #6b7d92;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(21, 36, 59, 0.06), 0 1px 3px rgba(21, 36, 59, 0.05);
  --shadow-md: 0 4px 14px rgba(21, 36, 59, 0.09);
  --shadow-lg: 0 18px 42px rgba(21, 36, 59, 0.22);
  --chevron-right: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='9 18 15 12 9 6'/%3E%3C/svg%3E");
  /* Chrome heights feed several calc()s, so they live here and scale with the root size. */
  --topbar-h: 4.5714rem;
  --footer-h: 3rem;
}

/* Every font size and spacing is in rem, so this one value sizes the whole UI to the screen:
   ~13px on small laptops, 14px around 1440px (the design size), up to 17px on 2K/4K monitors.
   Bounds are rem-based so a user's browser text-size preference still scales everything. */
html { font-size: clamp(0.8125rem, 0.469vw + 0.4375rem, 1.0625rem); }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; overflow-x: hidden; }
/* `hidden` made <body> a scroll container, which silently disabled every position: sticky. */
body { overflow-x: clip; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 1rem;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Static copy is read-only, so keep the arrow and reserve the I-beam for real inputs. */
  cursor: default;
}
input, textarea, [contenteditable="true"] { cursor: text; }
select, input[type="checkbox"], input[type="radio"], input[type="file"], input[type="color"], input[type="range"] { cursor: pointer; }
input:disabled, textarea:disabled, select:disabled { cursor: not-allowed; }
a { color: inherit; text-decoration: none; cursor: pointer; }
button { font-family: inherit; cursor: pointer; }
.hidden { display: none !important; }

/* ---------------- Top bar ---------------- */
/* ============ ACCESSIBILITY (ADA Compliance) ============ */
/* Skip link - visible on keyboard focus */
.skip-link {
  position: absolute; top: -40px; left: 0;
  background: var(--intel-blue); color: white; padding: 0.5714rem 1.1429rem;
  text-decoration: none; font-weight: 600; z-index: 100;
  border-radius: 0 0 8px 0;
}
.skip-link:focus { top: 0; }

/* Focus indicator for keyboard navigation (WCAG 2.1 Level AA) */
:focus-visible {
  outline: 3px solid var(--intel-blue);
  outline-offset: 2px;
}

/* High contrast mode */
@media (prefers-contrast: more) {
  a { text-decoration: underline; }
  .btn, .btn-ghost { border-width: 2px; }
}

/* Reduced motion (respect user preferences) */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* Screen reader only content */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
/* ============ END ACCESSIBILITY ============ */

.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 1.7143rem;
  padding: 0 1.5714rem;
  position: sticky;
  top: 0;
  z-index: 40;
}
.brand { display: flex; align-items: center; gap: 1rem; min-width: 236px; }
.intel-logo { height: 34px; width: auto; display: block; }
.product { display: flex; flex-direction: column; line-height: 1.15; border-left: 1px solid var(--line); padding-left: 1rem; }
.product-name { font-weight: 700; font-size: 1.0714rem; letter-spacing: -.2px; }
.product-tag { font-size: 0.7143rem; color: var(--intel-blue); font-weight: 800; letter-spacing: 1.5px; }

.topbar-search { flex: 1; position: relative; max-width: 40rem; }
.topbar-search input {
  width: 100%; height: 2.8571rem; border: 1px solid var(--line); border-radius: 10px;
  padding: 0 1rem; font-size: 1rem; background: var(--bg); transition: border-color .12s, background .12s, box-shadow .12s;
}
.topbar-search input:focus { outline: none; border-color: var(--intel-blue); background: #fff; box-shadow: 0 0 0 3px var(--intel-blue-light); }
/* Ensure focus is also shown with :focus-visible for keyboard users */
.topbar-search input:focus-visible {
  outline: 2px solid var(--intel-blue);
  outline-offset: 1px;
  box-shadow: 0 0 0 3px var(--intel-blue-light);
}
.search-results {
  position: absolute; top: 44px; left: 0; right: 0; background: #fff;
  border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg);
  max-height: 420px; overflow: auto; z-index: 50; padding: 0.4286rem;
  /* The top bar sets white text, which the panel must not inherit. */
  color: var(--ink); text-align: left;
}
.search-group-title { font-size: 0.7857rem; text-transform: uppercase; color: var(--muted); padding: 0.5714rem 0.7143rem 0.2857rem; font-weight: 700; }
.search-item { padding: 0.5rem 0.7143rem; border-radius: 6px; cursor: pointer; }
.search-item:hover { background: var(--intel-blue-light); }
.search-item-title { font-size: 0.9286rem; font-weight: 600; color: var(--ink); line-height: 1.35; overflow-wrap: anywhere; }
.search-item-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4286rem; margin-top: 0.2143rem; font-size: 0.7857rem; color: var(--muted); }
.search-item-meta > span + span:not(.search-ref)::before { content: '· '; color: #b8c2cc; }
.search-ref { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.75rem; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 4px; padding: 1px 0.3571rem; }
.search-tag { background: var(--intel-blue-light); color: var(--intel-blue); border-radius: 4px; padding: 1px 0.3571rem; font-weight: 600; }
.search-why { font-style: italic; }
.search-empty { padding: 0.8571rem 0.7143rem; font-size: 0.9286rem; color: var(--muted); }
.search-results mark { background: #ffeaa7; color: inherit; border-radius: 2px; padding: 0 1px; }

.topbar-right { display: flex; align-items: center; gap: 1.2857rem; }
.notif-btn {
  position: relative; background: transparent; border: 1px solid var(--line); color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; border-radius: 8px;
}
.notif-btn:hover { border-color: var(--intel-blue); color: var(--intel-blue); }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; background: transparent; border: 1px solid transparent; border-radius: 8px; color: var(--muted); cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.icon-btn:hover { background: var(--intel-blue-light); border-color: var(--intel-blue); color: var(--intel-blue); }
.breadcrumb {
  display: flex; align-items: center; flex-wrap: wrap; gap: 0.1429rem;
  margin: 0 0 0.8571rem; padding: 0;
  color: var(--muted); font-size: 0.8929rem; line-height: 1.4;
}
.breadcrumb .crumb-home {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; margin-right: 0.1429rem; flex: none;
  color: #8a9bab; border-radius: 6px; cursor: pointer;
  transition: background .12s ease, color .12s ease;
}
.breadcrumb .crumb-home:hover { background: var(--intel-blue-light); color: var(--intel-blue); }
.breadcrumb .crumb-home svg { width: 15px; height: 15px; }
.breadcrumb .crumb-link,
.breadcrumb .crumb-current {
  min-width: 0; max-width: min(34vw, 320px); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.breadcrumb .crumb-link {
  color: var(--muted); font-weight: 600; cursor: pointer;
  padding: 0.2143rem 0.4286rem; border-radius: 5px; text-decoration: none;
  transition: background .12s ease, color .12s ease;
}
.breadcrumb .crumb-link:hover { color: var(--intel-blue); background: var(--intel-blue-light); text-decoration: none; }
.breadcrumb .crumb-sep {
  display: inline-flex; align-items: center; justify-content: center;
  width: 14px; color: #c3ced8; font-size: 1.0714rem; line-height: 1;
  user-select: none;
}
.breadcrumb .crumb-current {
  color: var(--ink); font-weight: 700; padding: 0.2143rem 0.4286rem;
}
.breadcrumb .crumb-muted {
  color: #93a3b2; font-weight: 700; padding: 0.2143rem 0.4286rem;
  text-transform: uppercase; font-size: 0.75rem; letter-spacing: .7px;
}
.breadcrumb .crumb-home:focus-visible,
.breadcrumb .crumb-link:focus-visible { outline: 2px solid var(--intel-blue); outline-offset: 1px; }
@media (max-width: 640px) {
  .breadcrumb { gap: 0; }
  .breadcrumb .crumb-link, .breadcrumb .crumb-current { max-width: calc(100vw - 110px); }
}
.badge {
  position: absolute; top: -7px; right: -7px; background: var(--red); color: #fff;
  font-size: 0.7143rem; font-weight: 700; border-radius: 10px; padding: 1px 0.3571rem; min-width: 16px; text-align: center;
}
.user-switch { display: flex; flex-direction: column; line-height: 1; }
.user-switch label { font-size: 0.7143rem; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 0.1429rem; }
.user-switch select { border: 1px solid var(--line); border-radius: 8px; padding: 0.4286rem 0.5714rem; font-size: 0.9286rem; background: #fff; }.user-menu { display: flex; align-items: center; gap: 0.7143rem; }
.current-user { font-size: 0.9286rem; font-weight: 600; color: var(--text, #1a1a1a); white-space: nowrap; }

/* ---------------- Status workflow builder ---------------- */
.wf-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 0.4286rem; vertical-align: middle; flex: none; }

.wf-editor { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.wf-toolbar {
  display: flex; align-items: center; gap: 1.1429rem; flex-wrap: wrap;
  padding: 0.7143rem 1rem; border-bottom: 1px solid var(--line); background: #fafbfc;
}
.wf-toolbar-title { display: flex; flex-direction: column; line-height: 1.25; margin-right: auto; }
.wf-toolbar-title .sub { font-size: 0.8571rem; }
.wf-toolbar-actions { display: flex; align-items: center; gap: 0.5714rem; flex-wrap: wrap; }
.wf-tool {
  display: inline-flex; align-items: center; gap: 0.4286rem; background: transparent;
  border: 1px solid transparent; border-radius: 8px; padding: 0.4286rem 0.7143rem;
  font-size: 0.8929rem; font-weight: 600; color: var(--muted);
  transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.wf-tool span { font-size: 1.0714rem; line-height: 1; color: var(--intel-blue); }
.wf-tool:hover { background: var(--intel-blue-light); border-color: var(--intel-blue); color: var(--intel-blue-dark); }
.wf-tool-sep { width: 1px; height: 22px; background: var(--line); }

.wf-body { display: flex; align-items: stretch; min-height: 600px; }
.wf-canvas {
  position: relative; flex: 1; min-width: 0; overflow: auto;
  background-color: #fbfcfd;
  background-image: radial-gradient(#e3e8ee 1px, transparent 1px);
  background-size: 20px 20px;
}
.wf-stage { position: relative; width: 100%; height: 100%; }
.wf-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.wf-start-dot { fill: #157a49; }
.wf-start-text { fill: #fff; font-size: 0.5rem; font-weight: 700; letter-spacing: .3px; }
.wf-edge-line {
  stroke: #aab4c2; stroke-width: 1.5; fill: none;
  stroke-linecap: round; stroke-linejoin: round;
  transition: stroke .12s ease;
}
.wf-edge-hit { stroke: transparent; stroke-width: 16px; cursor: pointer; fill: none; }
.wf-edge-text { fill: var(--muted); font-size: 0.8571rem; font-weight: 600; paint-order: stroke; stroke: #fbfcfd; stroke-width: 4px; }
.wf-edge-g { cursor: pointer; }
.wf-edge-g:hover .wf-edge-line { stroke: var(--intel-blue); }
.wf-edge-g:hover .wf-edge-text { fill: var(--intel-blue-dark); }
.wf-edge-g.selected .wf-edge-line { stroke: var(--intel-blue); stroke-width: 2; }
.wf-edge-g.selected .wf-edge-text { fill: var(--intel-blue-dark); }

.wf-node {
  position: absolute; display: flex; align-items: center; gap: 0.1429rem;
  padding: 0 1.1429rem; border-radius: 10px; cursor: grab; user-select: none;
  background: #f1f2f4; border: 1.5px solid #dfe1e6; color: var(--ink);
  font-size: 1rem; font-weight: 600; box-shadow: 0 1px 2px rgba(21, 36, 59, .08);
  transition: box-shadow .12s ease, border-color .12s ease;
}
.wf-node:hover { box-shadow: var(--shadow-md); }
.wf-node.dragging { cursor: grabbing; box-shadow: var(--shadow-lg); }
.wf-node.cat-inprogress { background: #deebff; border-color: #b3d4ff; }
.wf-node.cat-done { background: #e3fcef; border-color: #abf5d1; }
.wf-node.selected { border-color: var(--intel-blue); box-shadow: 0 0 0 3px var(--intel-blue-light); }
.wf-node.connectable { cursor: crosshair; }
.wf-node-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.wf-panel { width: 320px; flex: none; border-left: 1px solid var(--line); background: var(--surface); overflow-y: auto; }
.wf-panel-head { padding: 1rem 1.1429rem; border-bottom: 1px solid var(--line); }
.wf-panel-head h3 { margin: 0 0 0.1429rem; font-size: 1.0714rem; }
.wf-panel-head .sub { font-size: 0.8571rem; }
.wf-panel-body { padding: 1rem 1.1429rem; }
.wf-panel-body .field { margin-bottom: 0.8571rem; }
.wf-panel-body button { width: 100%; }
.wf-panel-section {
  margin: 1.1429rem 0 0.2857rem; font-size: 0.7857rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .7px; color: var(--muted);
}
.wf-chip {
  display: inline-block; padding: 0.3571rem 0.7143rem; border-radius: 6px;
  background: var(--intel-blue-light); color: var(--intel-blue-dark); font-size: 0.8929rem;
}
.wf-legend { margin-top: 1.2857rem; display: flex; flex-direction: column; gap: 0.4286rem; font-size: 0.8929rem; color: var(--muted); }
.wf-cond {
  display: grid; grid-template-columns: 1fr auto; gap: 0.4286rem; align-items: center;
  padding: 0.5714rem; margin-bottom: 0.5714rem; border: 1px solid var(--line); border-radius: 8px; background: #fafbfc;
}
.wf-cond select, .wf-cond input { width: 100%; min-width: 0; }
.wf-cond .wf-cond-field { grid-column: 1 / -1; }
.wf-cond .wf-cond-del { justify-self: end; }

@media (max-width: 1100px) {
  .wf-body { flex-direction: column; }
  .wf-panel { width: auto; border-left: none; border-top: 1px solid var(--line); }
}

/* ---------------- Layout ---------------- */
.layout { display: flex; min-height: calc(100vh - var(--topbar-h) - var(--footer-h)); }
.app-footer { min-height: var(--footer-h); text-align: center; padding: 1rem 1.1429rem; color: var(--muted); font-size: 0.8571rem; border-top: 1px solid var(--line); background: var(--surface); }
.sidebar {
  width: 17.8571rem; background: var(--surface); border-right: 1px solid var(--line);
  padding: 1rem 0.8571rem 0.8571rem; display: flex; flex-direction: column; gap: 0.1429rem;
  transition: width .18s ease;
}
/* The sidebar spans the page; the menu pins under the top bar and the toggle to the viewport bottom. */
.nav-scroll {
  flex: 0 1 auto; display: flex; flex-direction: column; gap: 0.1429rem; overflow-y: auto; overflow-x: hidden;
  position: sticky; top: calc(var(--topbar-h) + 0.8571rem); margin-bottom: auto;
  max-height: calc(100vh - var(--topbar-h) - var(--footer-h) - 40px - 2.5714rem);
}
.nav-item {
  display: flex; align-items: center; gap: 0.8571rem; padding: 0.6429rem 0.8571rem; border-radius: 8px;
  color: var(--muted); font-weight: 500; font-size: 1rem; letter-spacing: .1px; white-space: nowrap;
  transition: background .12s ease, color .12s ease;
}
.nav-ico { display: inline-flex; flex: none; width: 22px; height: 22px; align-items: center; justify-content: center; color: inherit; }
.nav-ico svg { width: 18px; height: 18px; }
.nav-label { overflow: hidden; text-overflow: ellipsis; }
.nav-item:hover { background: var(--bg); color: var(--ink); }
.nav-item:hover .nav-ico { color: var(--intel-blue); }
.nav-item.active { background: var(--intel-blue-light); color: var(--intel-blue-dark); font-weight: 600; }
.nav-item.active .nav-ico { color: var(--intel-blue); }
.nav-section { display: flex; align-items: center; gap: 0.8571rem; font-size: 0.75rem; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 1rem 0.8571rem 0.4286rem; letter-spacing: .8px; white-space: nowrap; margin-top: 0.4286rem; border-top: 1px solid var(--line); }
.nav-section .nav-ico { flex: none; width: 22px; height: 22px; }
.nav-section .nav-ico svg { width: 16px; height: 16px; }
.nav-section:first-child { margin-top: 0; border-top: none; }
.nav-section:empty { display: block; padding: 0.5714rem 0; margin-top: 0; border-top: none; }

.sidebar-toggle {
  display: flex; align-items: center; gap: 0.8571rem; width: 100%; height: 40px;
  margin: 0.4286rem 0 0; padding: 0 0.8571rem; border: none; border-top: 1px solid var(--line);
  background: transparent; color: var(--muted); border-radius: 8px;
  position: sticky; bottom: 0.5714rem;
  transition: background .12s ease, color .12s ease;
}
.sidebar-toggle:hover { background: var(--bg); color: var(--ink); }
.sidebar-toggle-ico {
  display: inline-flex; flex: none; width: 22px; height: 22px; align-items: center;
  justify-content: center; font-size: 1.2143rem; line-height: 1; font-weight: 700;
}
.sidebar-toggle-label { font-size: 0.9286rem; font-weight: 500; }

.sidebar::-webkit-scrollbar, .nav-scroll::-webkit-scrollbar { width: 8px; }
.nav-scroll::-webkit-scrollbar-thumb { background: #d3dae0; border-radius: 8px; }
.nav-scroll::-webkit-scrollbar-track { background: transparent; }

/* Collapsed icon-rail state */
.sidebar.collapsed { width: 72px; }
.sidebar.collapsed .nav-label { display: none; }
.sidebar.collapsed .nav-section { justify-content: center; padding: 0.8571rem 0 0.4286rem; }
.sidebar.collapsed .nav-section:empty { height: 1px; padding: 0; margin: 0.4286rem; background: var(--line); }
.sidebar.collapsed .nav-item { justify-content: center; padding: 0.6429rem 0; gap: 0; }
.sidebar.collapsed .sidebar-toggle { justify-content: center; padding-left: 0; padding-right: 0; gap: 0; }

.content { flex: 1; min-width: 0; padding: 2rem 2.2857rem; }

/* ---------------- Announcements ---------------- */
.ann-banner {
  padding: 0.7143rem 1.5714rem; text-align: center; font-size: 1rem; font-weight: 700; line-height: 1.35;
  letter-spacing: .1px;
  background: #fff8dc; color: #7a5a00;
  border-bottom: 2px solid #e6b800;
  box-shadow: 0 2px 8px rgba(122, 90, 0, .12);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  position: relative; z-index: 30;
}
.ann-banner::before {
  content: '\26A0'; margin-right: 0.6429rem; font-size: 0.9286rem; vertical-align: 1px;
}
.ann-banner.sev-info::before { content: '\2139'; }
.ann-banner.sev-critical::before { content: '\26D4'; }
.ann-banner.sev-warning {
  background: #fffaf0; color: #8a5a00; border-bottom-color: var(--amber);
  box-shadow: 0 2px 8px rgba(217, 130, 0, .12);
}
.ann-banner.sev-critical {
  background: #fef4f4; color: #a11229; border-bottom-color: var(--red);
  box-shadow: 0 2px 8px rgba(161, 18, 41, .14);
}
.ann-list { border-bottom: 1px solid var(--line); }
.ann-list:empty { border-bottom: none; }
.ann-list-head {
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: .8px; font-weight: 700;
  color: var(--muted); padding: 0.8571rem 1.1429rem 0.4286rem;
}
.ann-row { display: flex; gap: 0.7143rem; padding: 0.7143rem 1.1429rem; cursor: pointer; }
.ann-row:hover { background: var(--bg); }
.ann-row.unread { background: #f2f8fd; }
.ann-row .n-rail { width: 3px; border-radius: 3px; flex: none; background: #0071c5; }
.ann-row.sev-warning .n-rail { background: #fdab3d; }
.ann-row.sev-critical .n-rail { background: #e2445c; }
.ann-chip {
  display: inline-block; padding: 0.1429rem 0.5714rem; border-radius: 999px; font-size: 0.7857rem;
  font-weight: 700; background: var(--intel-blue-light); color: var(--intel-blue-dark);
}
.ann-modal.sev-warning .ann-chip { background: #fff2dd; color: #8a5a00; }
.ann-modal.sev-critical .ann-chip { background: #fde8eb; color: #a11229; }
.ann-modal-meta { display: flex; align-items: center; gap: 0.7143rem; margin-bottom: 0.8571rem; }
.ann-modal-body { line-height: 1.55; }
.ann-modal-body :first-child { margin-top: 0; }
.ann-modal-count { margin-right: auto; }

/* ---------------- Help center ---------------- */
.help-hero {
  background: linear-gradient(135deg, #f3f8fd 0%, #eaf3fb 100%);
  border: 1px solid var(--line-soft); border-radius: 14px;
  padding: 1.5714rem 1.7143rem 1.2857rem; margin-bottom: 1.4286rem;
}
.help-hero-title { font-size: 1.2143rem; font-weight: 800; margin: 0 0 0.8571rem; color: var(--intel-blue-dark); }
.help-search-box { position: relative; max-width: 720px; }
.help-search-box input {
  width: 100%; height: 46px; padding: 0 1.1429rem 0 3.1429rem; font-size: 1.0714rem;
  border: 1px solid var(--line); border-radius: 12px; background: #fff;
  box-shadow: 0 1px 2px rgba(11, 26, 43, .05);
}
.help-search-box input:focus { border-color: var(--intel-blue); box-shadow: 0 0 0 3px rgba(0, 113, 197, .15); outline: none; }
.help-search-ico { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.help-chips { display: flex; flex-wrap: wrap; gap: 0.5714rem; margin-top: 1rem; }
.help-chip {
  appearance: none; -webkit-appearance: none; display: inline-flex; align-items: center; gap: 0.4286rem;
  border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 999px;
  padding: 0.4286rem 0.8571rem; font: inherit; font-size: 0.8929rem; font-weight: 600; cursor: pointer;
  transition: border-color .12s ease, background .12s ease, color .12s ease;
}
.help-chip:hover { border-color: var(--intel-blue); color: var(--intel-blue); }
.help-chip:focus-visible { outline: 2px solid var(--intel-energy); outline-offset: 2px; }
.help-chip.active { background: var(--intel-blue); border-color: var(--intel-blue); color: #fff; }
.help-chip-count { font-size: 0.7857rem; font-weight: 700; opacity: .75; }

.help-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 1.7143rem; align-items: start; }
.help-cats { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 0.1429rem; }
.help-cats-title { font-size: 0.7857rem; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--muted); padding: 0 0.7143rem 0.5714rem; }
.help-cat {
  appearance: none; -webkit-appearance: none; display: flex; align-items: center; justify-content: space-between; gap: 0.5714rem;
  width: 100%; text-align: left; background: transparent; border: none; border-radius: 8px;
  padding: 0.5714rem 0.7143rem; font: inherit; font-size: 0.9643rem; color: var(--ink); cursor: pointer;
}
.help-cat:hover { background: #f2f7fc; color: var(--intel-blue); }
.help-cat:focus-visible { outline: 2px solid var(--intel-energy); outline-offset: -2px; }
.help-cat.active { background: var(--intel-blue-light); color: var(--intel-blue-dark); font-weight: 700; }
.help-cat-count { font-size: 0.8214rem; color: var(--muted); font-weight: 600; }
.help-main { min-width: 0; }
.help-results-bar { display: flex; align-items: center; gap: 0.4286rem; margin-bottom: 0.8571rem; }
.help-results-bar .spacer { flex: 1; }

.help-group { margin-bottom: 1.8571rem; }
.help-group-title {
  display: flex; align-items: center; gap: 0.5714rem;
  font-size: 0.8571rem; text-transform: uppercase; letter-spacing: .8px; font-weight: 700;
  color: var(--muted); margin: 0 0 0.7143rem;
}
.help-group-count { font-size: 0.7857rem; background: #e8eef5; color: var(--muted); border-radius: 999px; padding: 1px 0.5rem; letter-spacing: 0; }
.help-article {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); margin-bottom: 0.5714rem; overflow: hidden;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.help-article:hover { border-color: #c9d8e8; }
.help-article[open] { border-color: #c9d8e8; box-shadow: 0 4px 14px rgba(11, 26, 43, .06); }
.help-article.help-article-linked { border-color: var(--intel-blue); box-shadow: 0 0 0 3px rgba(0, 113, 197, .15); }
.help-article > summary {
  list-style: none; cursor: pointer; padding: 1rem 1.1429rem 1rem 2.8571rem; position: relative;
  display: flex; flex-direction: column; gap: 0.2857rem;
}
.help-article > summary::-webkit-details-marker { display: none; }
/* Chevron rotates with the disclosure state so the control reads as a toggle. */
.help-article > summary::before {
  content: '\203a'; position: absolute; left: 16px; top: 12px; width: 14px;
  font-size: 1.4286rem; line-height: 1; color: var(--muted); transition: transform .15s ease;
}
.help-article[open] > summary::before { transform: rotate(90deg); color: var(--intel-blue); }
.help-article > summary:hover { background: #f8fbfe; }
.help-article > summary:focus-visible { outline: 2px solid var(--intel-blue); outline-offset: -2px; }
.help-article-head { display: flex; align-items: center; gap: 0.5714rem; flex-wrap: wrap; }
.help-article-title { font-weight: 700; font-size: 1.0357rem; color: var(--ink); }
.help-article-tag { font-size: 0.75rem; }
.help-article-summary { color: var(--muted); font-size: 0.9286rem; }
.help-article-body { padding: 1rem 1.2857rem 0.8571rem 2.8571rem; border-top: 1px solid var(--line-soft); line-height: 1.6; }
.help-article-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.7143rem; margin-top: 1rem; padding-top: 0.7143rem; border-top: 1px dashed var(--line-soft); }
.help-empty { padding: 2.8571rem 1.4286rem; }
.help-dir-search { max-width: 460px; }

.help-contact { margin-top: 1.7143rem; display: flex; align-items: center; gap: 1.2857rem; flex-wrap: wrap; }
.help-contact-ico { flex: 0 0 44px; height: 44px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: var(--intel-blue-light); color: var(--intel-blue); }
.help-contact-text { flex: 1 1 320px; min-width: 0; }
.help-contact-text h2 { margin: 0 0 0.2857rem; font-size: 1.1429rem; }
.help-contact-text .sub { margin: 0 0 0.4286rem; }
.help-contact-actions { display: flex; gap: 0.5714rem; flex-wrap: wrap; }

@media (max-width: 900px) {
  .help-layout { grid-template-columns: 1fr; }
  .help-cats { position: static; flex-direction: row; flex-wrap: wrap; gap: 0.4286rem; }
  .help-cats-title { display: none; }
  .help-cat { width: auto; border: 1px solid var(--line); border-radius: 999px; padding: 0.3571rem 0.8571rem; }
}

/* ---------------- Common ---------------- */
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.7143rem; gap: 1.1429rem; flex-wrap: wrap; }
.page-head h1 { font-size: 1.7143rem; margin: 0; font-weight: 800; letter-spacing: -.4px; }
.page-head p { margin: 0.3571rem 0 0; color: var(--muted); font-size: 1rem; }
.sub { color: var(--muted); font-size: 0.9286rem; }

.btn {
  background: var(--intel-blue); color: #fff; border: none; border-radius: 8px;
  padding: 0.7143rem 1.2857rem; font-weight: 600; font-size: 1rem; box-shadow: 0 1px 2px rgba(0,55,122,.18);
  transition: background .12s ease, box-shadow .12s ease, transform .04s ease;
}
.btn:hover { background: var(--intel-blue-dark); box-shadow: 0 2px 8px rgba(0,55,122,.24); }
.btn:active { transform: translateY(1px); }
.btn.is-busy, button.is-busy { opacity: .6; cursor: progress; pointer-events: none; }
.draft-badge { display: inline-block; padding: 1px 0.5714rem; border-radius: 999px; font-size: 0.7857rem; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; background: #fff4d6; color: #8a6d00; border: 1px solid #f0b429; vertical-align: middle; }
.btn-ghost { background: #fff; color: var(--intel-blue); border: 1px solid var(--line); border-radius: 8px; padding: 0.6429rem 1.1429rem; font-weight: 600; transition: border-color .12s, background .12s; }
.btn-ghost:hover { border-color: var(--intel-blue); background: var(--intel-blue-light); }
.btn-ghost.small, .btn.small, .btn-danger.small { padding: 0.4286rem 0.8571rem; font-size: 0.8571rem; }
.btn-danger { background: var(--red); color: #fff; border: none; border-radius: 8px; padding: 0.6429rem 1.1429rem; font-weight: 600; }
.btn-danger:hover { filter: brightness(.94); }
.btn-ghost-danger { background: #fff; color: var(--red); border: 1px solid var(--line); border-radius: 8px; padding: 0.6429rem 1.1429rem; font-weight: 600; transition: border-color .12s, background .12s; }
.btn-ghost-danger:hover { border-color: var(--red); background: rgba(220,53,69,.06); }
.btn-ghost-success { background: #fff; color: var(--green); border: 1px solid var(--line); border-radius: 8px; padding: 0.6429rem 1.1429rem; font-weight: 600; transition: border-color .12s, background .12s; }
.btn-ghost-success:hover { border-color: var(--green); background: rgba(43,182,115,.08); }

.mention-pop {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 40;
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,.12); max-height: 240px; overflow-y: auto; padding: 0.2857rem;
}
.mention-item {
  display: flex; align-items: center; gap: 0.5714rem; padding: 0.5rem 0.6429rem; border-radius: 6px; cursor: pointer; font-size: 1rem;
}
.mention-item:hover, .mention-item.active { background: var(--intel-blue-light); }

.mention-tag { color: var(--intel-blue); font-weight: 600; cursor: pointer; }
.mention-tag:hover { text-decoration: underline; }
.mention-bubble {
  position: absolute; z-index: 60; display: inline-flex; align-items: center; gap: 0.4286rem;
  background: #fff; color: var(--intel-blue); border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,.15); padding: 0.5rem 0.7857rem; font-size: 0.9286rem; white-space: nowrap;
}
.mention-bubble a { color: var(--intel-blue); text-decoration: none; }
.mention-bubble a:hover { text-decoration: underline; }

.tabs { display: flex; gap: 0.2857rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; }
.tab {
  background: none; border: none; border-bottom: 2px solid transparent; margin-bottom: -1px;
  padding: 0.6429rem 1rem; font-weight: 600; font-size: 1rem; color: var(--muted); cursor: pointer;
}
.tab:hover { color: var(--intel-blue); }
.tab.active { color: var(--intel-blue); border-bottom-color: var(--intel-blue); }
.hist-changes { margin: 0.4286rem 0 0; padding-left: 1.2857rem; }
.hist-changes li { font-size: 0.9286rem; margin: 0.1429rem 0; }

.assignee-pop {
  position: absolute; left: 0; top: calc(100% + 6px); z-index: 45; width: 280px;
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,.14); padding: 0.7143rem;
}
.assignee-search {
  width: 100%; margin-bottom: 0.5714rem; padding: 0.5rem 0.6429rem; border: 1px solid var(--line);
  border-radius: 8px; font-size: 0.9286rem;
}
.assignee-list { max-height: 220px; overflow-y: auto; display: flex; flex-direction: column; gap: 0.1429rem; }
.assignee-row {
  display: flex; align-items: center; gap: 0.5714rem; padding: 0.4286rem 0.5714rem; border-radius: 6px;
  cursor: pointer; font-size: 1rem;
}
.assignee-row:hover { background: var(--intel-blue-light); }
.assignee-row input[type=checkbox] { width: auto; margin: 0; }
.assignee-actions { display: flex; gap: 0.4286rem; justify-content: flex-end; margin-top: 0.7143rem; }

.collapse-summary,
.collapse-section > summary {
  cursor: pointer; list-style: none;
  display: flex; align-items: center; gap: 0.5714rem;
}
.collapse-summary::-webkit-details-marker,
.collapse-section > summary::-webkit-details-marker { display: none; }
/* Masked SVG so the marker matches the rounded stroke icons used elsewhere
   and still inherits colour from the surrounding text. */
.collapse-summary::before,
.collapse-section > summary::before,
.tree-toggle::before {
  content: '';
  flex: none;
  display: block;
  width: 16px; height: 16px;
  background-color: var(--muted);
  -webkit-mask: var(--chevron-right) center / 16px 16px no-repeat;
  mask: var(--chevron-right) center / 16px 16px no-repeat;
  transition: transform .15s ease, background-color .15s ease;
}
details[open] > .collapse-summary::before,
.collapse-section[open] > summary::before,
.tree-toggle.is-open::before { transform: rotate(90deg); }
.collapse-summary:hover::before,
.collapse-section > summary:hover::before,
.tree-toggle:hover::before { background-color: var(--intel-blue); }

/* Sub-request tree expander — same marker in a fixed-width row slot. */
.tree-toggle {
  flex: none; display: inline-flex;
  margin-right: 0.1429rem; cursor: pointer; user-select: none;
}

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 1.4286rem; }
.grid { display: grid; gap: 1.2857rem; }
.grid-5 { grid-template-columns: repeat(5, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 1000px) { .grid-5 { grid-template-columns: repeat(2, 1fr); } .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: 1fr; } .grid-2 { grid-template-columns: 1fr; } }

/* KPI cards */
.kpi { padding: 1.4286rem; display: flex; flex-direction: column; gap: 0.5714rem; position: relative; overflow: hidden; transition: box-shadow .14s ease, transform .14s ease; }
.kpi::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--intel-blue); }
.kpi:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.kpi .value { font-size: 2.2857rem; font-weight: 800; line-height: 1; letter-spacing: -1px; }
.kpi .label { color: var(--muted); font-size: 0.9286rem; font-weight: 500; }
.kpi.warn::before { background: var(--amber); }
.kpi.bad::before { background: var(--red); }
.kpi.good::before { background: var(--green); }

/* Tables */
table { width: 100%; border-collapse: collapse; background: #fff; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
th { text-align: left; font-size: 0.7857rem; text-transform: uppercase; color: var(--muted); padding: 0.8571rem 1.1429rem; border-bottom: 1px solid var(--line); background: #fafbfc; letter-spacing: .5px; white-space: nowrap; font-weight: 700; }
th[data-sortkey]:hover { color: var(--intel-blue); background: #f2f7fc; }
.fav-col { width: 40px; }
.fav-cell { width: 40px; text-align: center; }
.fav-star { background: none; border: none; cursor: pointer; padding: 0.1429rem 0.2857rem; font-size: 1.2857rem; line-height: 1; color: var(--muted); border-radius: 6px; transition: color .12s, transform .12s; }
.fav-star:hover { color: #f5a623; transform: scale(1.15); }
.fav-star.is-fav { color: #f5a623; }
.fav-star:disabled { opacity: .5; cursor: default; }
.pa-tabs { display: flex; gap: 0.2857rem; border-bottom: 1px solid var(--line); margin: 0.2857rem 0 1.2857rem; }
.pa-tab { appearance: none; -webkit-appearance: none; background: none; border: none; padding: 0.7143rem 1.2857rem; font-size: 1rem; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.pa-tab:hover { color: var(--intel-blue); }
.pa-tab.active { color: var(--intel-blue); border-bottom-color: var(--intel-blue); }
.pa-notif-row { display: flex; align-items: center; justify-content: space-between; gap: 1.1429rem; padding: 0.8571rem 0; border-bottom: 1px solid var(--line); }
.pa-notif-row:last-of-type { border-bottom: none; }
.pa-notif-row input[type=checkbox] { width: 18px; height: 18px; flex: none; }
.sort-ind { font-weight: 700; }
td { padding: 0.9286rem 1.1429rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #f7fafd; }

/* Pills */
.pill { display: inline-flex; align-items: center; gap: 0.3571rem; padding: 0.2143rem 0.7143rem; border-radius: 20px; font-size: 0.8571rem; font-weight: 600; color: #fff; }
.pill-soft { padding: 0.2143rem 0.7143rem; border-radius: 6px; font-size: 0.8571rem; font-weight: 600; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.avatar { width: 26px; height: 26px; border-radius: 50%; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 0.7857rem; font-weight: 700; }
.avatars { display: flex; }
.avatars .avatar { margin-left: -0.4286rem; border: 2px solid #fff; }
.avatars .avatar:first-child { margin-left: 0; }

/* Forms */
.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 600; font-size: 0.9286rem; margin-bottom: 0.4286rem; }
.field .help { color: var(--muted); font-size: 0.8571rem; margin-top: 0.2857rem; }
.form-note-wrap { margin-bottom: 0.8571rem; }
/* Repeatable step: one bordered block per copy the requester asked for. */
.ff-rep-block { border: 1px solid var(--line); border-left: 3px solid var(--intel-blue); border-radius: 8px; padding: 0.7143rem 0.8571rem; margin-bottom: 0.7143rem; background: var(--surface); }
.ff-rep-head { display: flex; align-items: center; justify-content: space-between; gap: 0.7143rem; margin-bottom: 0.5714rem; }
.ff-rep-title { font-weight: 700; font-size: 0.9286rem; color: var(--ink); }
.ff-rep-block .field:last-child { margin-bottom: 0; }
.form-note { background: var(--intel-blue-light); border-left: 3px solid var(--intel-blue); border-radius: 6px; padding: 0.7143rem 0.8571rem; color: #2a3f52; font-size: 0.9286rem; line-height: 1.5; white-space: pre-wrap; }
.field-tip-text { margin: 0.1429rem 0 0.4286rem; font-size: 0.7857rem; line-height: 1.4; color: #55606b; white-space: normal; overflow-wrap: anywhere; }
.field-tip-text p { display: inline; margin: 0; }
.field-tip-text a { color: var(--intel-blue); }
/* Hint for the option currently selected in a picklist. */
.option-tip-text { margin: 0.2857rem 0 0; padding-left: 0.5714rem; border-left: 2px solid var(--intel-blue); font-size: 0.7857rem; line-height: 1.4; color: #55606b; overflow-wrap: anywhere; }
.option-tip-text div + div { margin-top: 0.1429rem; }
.req { color: var(--red); }
input[type=text], input[type=email], input[type=url], input[type=tel], input[type=number],
input[type=date], input[type=datetime-local], input[type=search], select, textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 0.6429rem 0.7857rem; font-size: 1rem; font-family: inherit; background: #fff;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--intel-blue); box-shadow: 0 0 0 3px var(--intel-blue-light); }
/* Hide the browser's datalist dropdown arrow on typeahead fields. */
.sm-part-key::-webkit-calendar-picker-indicator { display: none !important; }
.sm-part-key { appearance: none; -webkit-appearance: none; }
.row { display: flex; gap: 0.8571rem; }
.row > * { flex: 1; }
.chk { display: flex; align-items: center; gap: 0.5714rem; }
.chk input { width: auto; }

/* Rich text editor (Quill) */
.rte { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.rte:focus-within { border-color: var(--intel-blue); box-shadow: 0 0 0 3px var(--intel-blue-light); }
.rte .ql-toolbar.ql-snow { border: none; border-bottom: 1px solid var(--line); background: var(--intel-blue-light); }
.rte .ql-container.ql-snow { border: none; font-family: inherit; font-size: 1rem; }
.rte .ql-editor { min-height: 120px; max-height: 320px; }
.rte .ql-editor a { color: var(--intel-blue); }
.rte-view { font-size: 1rem; line-height: 1.5; }
.rte-view p { margin: 0 0 0.5714rem; }
.rte-view h1, .rte-view h2, .rte-view h3 { margin: 0 0 0.5714rem; }
.rte-view ul, .rte-view ol { margin: 0 0 0.5714rem; padding-left: 1.5714rem; }
.rte-view a { color: var(--intel-blue); }
.rte-view blockquote { margin: 0 0 0.5714rem; padding-left: 0.8571rem; border-left: 3px solid var(--line); color: var(--muted); }

/* Inline-editable task table cells */
table .inline-edit { padding: 0.3571rem 0.5714rem; font-size: 0.8571rem; max-width: 170px; min-width: 90px; }
table .inline-edit:disabled { opacity: .5; }

/* Sortable table headers */
th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortable:hover { color: var(--intel-blue); }
th.sortable::after { content: '\2195'; opacity: .35; margin-left: 0.3571rem; font-size: 0.7857rem; }
th.sortable.sorted { color: var(--intel-blue); }
th.sortable.sorted[data-dir="asc"]::after { content: '\2191'; opacity: 1; }
th.sortable.sorted[data-dir="desc"]::after { content: '\2193'; opacity: 1; }

/* Modal */
body.modal-open { overflow: hidden; }
.modal-overlay { position: fixed; inset: 0; background: rgba(16,24,40,.5); display: flex; align-items: center; justify-content: center; z-index: 1300; padding: 1.4286rem; }
.modal { background: #fff; border-radius: 14px; width: 44.2857rem; max-width: 96vw; max-height: 96vh; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); resize: both; overflow: hidden; min-width: 320px; min-height: 220px; }
.modal.wide { max-width: min(61.4286rem, 96vw); }
.modal.project-modal { width: clamp(320px, 70vw, 58.5714rem); max-width: 94vw; max-height: 90vh; }
.modal.project-modal .modal-body { flex: 1; }
.modal.project-modal .project-name-field { width: 100%; max-width: none; margin: 0 0 1rem; }
.modal.project-modal .project-name-input { font-size: 1rem; min-width:60%; }

/* Task create modal — refined look */
.modal.task-modal { width: clamp(320px, 70vw, 58.5714rem); max-width: 94vw; max-height: 90vh; }
.modal.task-modal .modal-body { flex: 1; padding: 1.7143rem; background: #f7f9fc; }
.modal.task-modal .field { margin-bottom: 1.1429rem; }
.modal.task-modal .field label { color: #475467; }
.modal.task-modal .project-name-field { width: 100%; max-width: none; margin: 0 0 1.1429rem; }
.modal.task-modal input, .modal.task-modal select, .modal.task-modal textarea { border-radius: 10px; background: #fff; border: none; }
.modal.task-modal .section-title { margin: 1rem 0 0.7143rem; font-size: 0.9286rem; text-transform: uppercase; letter-spacing: .5px; color: var(--intel-blue); }
.modal.task-modal .modal-foot { background: #fff; }

/* One canvas for every create/edit dialog (data-entry modals are persistent),
   so the form builder, request, project and team editors line up identically.
   Height still follows the content up to the shared ceiling. */
.modal.wide,
.modal.project-modal,
.modal.task-modal,
.modal.form-builder-modal,
.modal-overlay[data-persistent="1"] .modal {
  width: clamp(320px, 94vw, 1280px);
  max-width: 96vw;
  max-height: 94vh;
}
.modal.wide > .modal-body,
.modal-overlay[data-persistent="1"] .modal > .modal-body { flex: 1; }

.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 1.2857rem 1.5714rem; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 1.2143rem; }
.modal-body { padding: 1.4286rem 1.5714rem; overflow-y: auto; flex: 1 1 auto; }
.modal-foot { padding: 1rem 1.5714rem; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 0.7143rem; }

/* Drawer */
.drawer { position: fixed; top: 0; right: 0; width: 380px; max-width: 92vw; height: 100vh; background: #fff; box-shadow: var(--shadow-lg); z-index: 90; display: flex; flex-direction: column; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 0.8571rem; padding: 1.2857rem; border-bottom: 1px solid var(--line); }
.drawer-head h3 { margin: 0; }
.drawer-head h2 { margin: 0; font-size: 1.2857rem; white-space: nowrap; }
.drawer-actions { display: flex; align-items: center; gap: 0.2857rem; flex: none; }
.icon-btn.danger:hover { background: rgba(226, 68, 92, .12); border-color: var(--red); color: var(--red); }
.notif-list { overflow-y: auto; flex: 1; }
.notif { padding: 1rem 1.2857rem; border-bottom: 1px solid var(--line); display: flex; gap: 0.8571rem; }
.notif.unread { background: var(--intel-blue-light); }
.notif.has-link { cursor: pointer; }
.notif .n-rail { width: 3px; border-radius: 3px; background: var(--intel-blue); flex-shrink: 0; }
.notif .n-body { flex: 1; }
.notif .n-sub { font-weight: 600; font-size: 0.9286rem; }
.notif .n-meta { color: var(--muted); font-size: 0.7857rem; margin-top: 0.2143rem; text-transform: uppercase; letter-spacing: .4px; }
.notif .n-dismiss { flex: none; align-self: flex-start; width: 24px; height: 24px; padding: 0; line-height: 1; font-size: 1.2857rem; border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: pointer; opacity: .6; transition: opacity .12s ease, background .12s ease, color .12s ease; }
.notif:hover .n-dismiss, .notif .n-dismiss:focus-visible { opacity: 1; }
.notif .n-dismiss:hover { background: rgba(226, 68, 92, .12); color: var(--red); opacity: 1; }

/* Toast */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 0.8571rem 1.4286rem; border-radius: 10px; box-shadow: var(--shadow-lg); z-index: 1400; font-weight: 500; }
.toast.err { background: var(--red); }
.toast.ok { background: var(--green); }

/* Board / Kanban */
.board { display: flex; gap: 1.1429rem; overflow-x: auto; padding-bottom: 0.5714rem; align-items: flex-start; }
.board-col { background: #eef1f5; border-radius: var(--radius); min-width: 288px; width: 288px; padding: 0.8571rem; }
.board-col h4 { margin: 0.2857rem 0.4286rem 0.8571rem; font-size: 0.9286rem; display: flex; justify-content: space-between; }
.board-card { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 1rem; margin-bottom: 0.7143rem; box-shadow: var(--shadow); transition: box-shadow .12s ease, transform .12s ease; }
.board-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.board-card .title { font-weight: 600; margin-bottom: 0.7143rem; }
.board-card .meta { display: flex; align-items: center; justify-content: space-between; gap: 0.5714rem; }

/* Tabs */
.tabs { display: flex; gap: 0.2857rem; border-bottom: 1px solid var(--line); margin-bottom: 1.4286rem; }
.tab { padding: 0.7143rem 1.1429rem; border-radius: 8px 8px 0 0; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .12s, border-color .12s, background .12s; }
.tab:hover { color: var(--ink); background: var(--bg); }
.tab.active { color: var(--intel-blue); border-bottom-color: var(--intel-blue); }

/* Misc */
.toolbar { display: flex; gap: 0.7143rem; align-items: center; margin-bottom: 1.1429rem; flex-wrap: wrap; }
.spacer { flex: 1; }
.sort-group { display: flex; align-items: center; gap: 0.5714rem; flex: none; }
.sort-group .sub { white-space: nowrap; }
/* Keep filter controls on a single line; the search box shrinks instead of wrapping. */
.toolbar-nowrap { flex-wrap: nowrap; }
.toolbar-nowrap > * { flex: none; }
.toolbar-nowrap .spacer { flex: 1 1 0; min-width: 0; }
.toolbar-nowrap .tb-search { flex: 1 1 auto; min-width: 120px; }
.toolbar-nowrap .chk, .toolbar-nowrap .check, .toolbar-nowrap label { white-space: nowrap; }
.empty { text-align: center; padding: 4rem 1.4286rem; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); background: var(--surface); }
.empty .big { font-size: 1.0714rem; font-weight: 600; color: var(--ink); margin-bottom: 0.4286rem; }
.progress { height: 6px; background: var(--line); border-radius: 6px; overflow: hidden; min-width: 70px; }
.progress > span { display: block; height: 100%; background: var(--intel-blue); }
.tag { display: inline-flex; align-items: center; background: var(--bg); border: 1px solid var(--line); border-radius: 20px; padding: 0.1429rem 0.7143rem; font-size: 0.7857rem; font-weight: 500; color: var(--muted); }
.section-title { font-weight: 700; font-size: 1.0714rem; margin: 1.8571rem 0 1rem; letter-spacing: -.2px; }
.mono { font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; font-size: 0.8571rem; }
.errbox { background: #fdecef; border: 1px solid var(--red); border-radius: 8px; padding: 0.7143rem 0.8571rem; color: #9a1c2e; font-size: 0.9286rem; margin-top: 0.7143rem; }
.okbox { background: #e7f9f0; border: 1px solid var(--green); border-radius: 8px; padding: 0.7143rem 0.8571rem; color: #06623b; font-size: 0.9286rem; margin-top: 0.7143rem; }
.list-reset { list-style: none; padding: 0; margin: 0; }
.fb-field { border: 1px solid var(--line); border-radius: 8px; padding: 0.8571rem; margin-bottom: 0.7143rem; background: #fff; display: flex; gap: 0.8571rem; align-items: flex-start; }
.fb-field .grip { color: var(--muted); cursor: grab; }
.fb-field .fb-num { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 6px; background: var(--intel-blue-light); color: var(--intel-blue-dark); font-size: 0.8571rem; font-weight: 700; cursor: grab; }
.fb-field .fb-main { flex: 1; }
.kbd { background: var(--bg); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 1px 0.4286rem; font-size: 0.7857rem; font-family: ui-monospace, monospace; }
.link-btn { background: none; border: none; padding: 0; margin-left: 0.5714rem; color: var(--intel-blue); font: inherit; font-size: 0.7857rem; font-weight: 600; cursor: pointer; }
.link-btn:hover { color: var(--intel-blue-dark); text-decoration: underline; }
.check-inline { display: inline-flex; align-items: center; gap: 0.5714rem; cursor: pointer; }
.check-inline input[type=checkbox] { width: auto; margin: 0; }

/* AI Agent floating chat bubble */
.agent-launcher { position: fixed; right: 26px; bottom: 26px; z-index: 1200; width: 60px; height: 60px; border-radius: 50%; border: none; cursor: pointer; color: #fff; display: grid; place-items: center; background: linear-gradient(135deg, var(--intel-blue), var(--intel-energy)); box-shadow: 0 10px 26px rgba(0,84,174,.42); transition: transform .15s ease, box-shadow .15s ease; }
.agent-launcher:hover { transform: translateY(-2px) scale(1.04); box-shadow: 0 14px 32px rgba(0,84,174,.5); }
.agent-launcher.active { background: var(--intel-blue-dark); }
.agent-launcher .wand-icon { display: block; }

.agent-widget { position: fixed; right: 26px; bottom: 96px; z-index: 1200; width: 384px; max-width: calc(100vw - 32px); height: 600px; max-height: calc(100vh - 130px); display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: 0 20px 50px rgba(15,32,43,.28); animation: agentPop .16s ease; }
.agent-widget.hidden { display: none; }
@keyframes agentPop { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.agent-widget-head { display: flex; align-items: center; justify-content: space-between; gap: 0.7143rem; padding: 0.8571rem 1rem; color: #fff; background: linear-gradient(135deg, var(--intel-blue-dark), var(--intel-blue)); }
.aw-title { display: flex; align-items: center; gap: 0.7143rem; }
.aw-avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 0.9286rem; background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.35); }
.aw-meta { display: flex; flex-direction: column; line-height: 1.25; }
.aw-meta strong { font-size: 1rem; }
.aw-sub { font-size: 0.8214rem; opacity: .8; }
.aw-actions { display: flex; gap: 0.4286rem; }
.aw-icon-btn { background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.28); color: #fff; border-radius: 7px; padding: 0.3571rem 0.6429rem; font-size: 0.8571rem; font-weight: 600; cursor: pointer; }
.aw-icon-btn:hover { background: rgba(255,255,255,.28); }

.agent-draft-bar { padding: 0.8571rem 1rem; border-bottom: 1px solid var(--line); background: var(--bg); font-size: 0.9286rem; }
.agent-draft-bar:empty { display: none; }
.adb-head { display: flex; align-items: baseline; gap: 0.5714rem; }
.adb-label { font-size: 0.7143rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.adb-title { font-weight: 600; color: var(--ink); word-break: break-word; }
.adb-chips { display: flex; flex-wrap: wrap; gap: 0.4286rem; margin-top: 0.5714rem; }
.adb-actions { display: flex; align-items: center; gap: 0.8571rem; margin-top: 0.7143rem; }
.adb-actions:empty { display: none; }
.adb-created { padding: 0.4286rem 0.7143rem; background: #e7f9f0; border: 1px solid var(--green); border-radius: 8px; font-size: 0.8929rem; color: #06623b; }
.adb-created a { color: var(--intel-blue-dark); font-weight: 600; }
.chat-log { flex: 1; overflow-y: auto; padding: 1.1429rem; display: flex; flex-direction: column; gap: 0.8571rem; }
.chat-row { display: flex; }
.chat-row.user { justify-content: flex-end; }
.chat-row.agent { justify-content: flex-start; }
.chat-msg { max-width: 78%; padding: 0.7857rem 1rem; border-radius: 12px; font-size: 1rem; line-height: 1.5; }
.chat-row.agent .chat-msg { background: var(--bg); border: 1px solid var(--line); border-top-left-radius: 3px; color: var(--ink); }

/* Toggle switch */
.switch { display: inline-flex; align-items: center; gap: 0.5714rem; cursor: pointer; font-size: 0.9286rem; color: var(--ink); user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .switch-track { position: relative; width: 38px; height: 22px; background: var(--line); border-radius: 999px; transition: background .15s ease; flex: 0 0 auto; }
.switch .switch-track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s ease; }
.switch input:checked + .switch-track { background: var(--green, #2fa36b); }
.switch input:checked + .switch-track::after { transform: translateX(16px); }
.switch input:focus-visible + .switch-track { box-shadow: 0 0 0 3px rgba(0,120,212,.35); }

/* Form Builder field picker (Available / Added) */
.modal.form-builder-modal .modal-body { flex: 1; padding: 1.5714rem 1.8571rem; }
.fb-picker { display: flex; gap: 0.8571rem; align-items: stretch; }
.fb-picker-col { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.fb-picker-col label { font-weight: 600; font-size: 0.9286rem; margin-bottom: 0.4286rem; }
.fb-picker-count { font-weight: 500; }
.fb-picker-search { width: 100%; margin-bottom: 0.5714rem; }
.fb-picker-hint { margin-top: 0.4286rem; font-size: 0.8571rem; }
.fb-picker-col select[multiple] { width: 100%; min-height: 320px; flex: 1; padding: 0.2857rem; border: 1px solid var(--line); border-radius: 8px; overflow-y: auto; }
.fb-picker-col select[multiple] option { padding: 0.5rem 0.6429rem; border-radius: 6px; }
.fb-picker-actions { display: flex; flex-direction: column; justify-content: center; gap: 0.5714rem; align-self: center; }
.fb-picker-actions .btn-ghost { white-space: nowrap; }

/* Form Builder drag-and-drop reordering */
.fb-field .grip { cursor: grab; }
.fb-field .grip:active { cursor: grabbing; }
.fb-field.fb-dragging { opacity: .5; }
.fb-field.fb-drop-before { box-shadow: inset 0 3px 0 0 var(--intel-blue); }
.fb-field.fb-drop-after { box-shadow: inset 0 -3px 0 0 var(--intel-blue); }
.fb-field.fb-just-moved { box-shadow: 0 0 0 2px var(--intel-blue); transition: box-shadow .3s ease; }
.fb-pos-box { display: flex; align-items: center; gap: 0.2857rem; margin-top: 0.1429rem; }
.fb-pos-box input { width: 46px; padding: 0.2857rem 0.1429rem; text-align: center; }
.fb-pos-box .sub { font-size: 0.7857rem; white-space: nowrap; }
.chat-row.user .chat-msg { background: var(--intel-blue); color: #fff; border-top-right-radius: 3px; }
.chat-who { font-size: 0.7143rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; opacity: .65; margin-bottom: 0.2857rem; }
.chat-refs { display: flex; flex-direction: column; gap: 0.4286rem; margin-top: 0.7143rem; }
.chat-ref { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.7143rem; background: #fff; border: 1px solid var(--line); border-radius: 8px; font-size: 0.9286rem; font-weight: 600; color: var(--intel-blue-dark); text-decoration: none; transition: background .15s, border-color .15s; }
.chat-ref:hover { background: var(--intel-blue-light); border-color: var(--intel-blue); }
.chat-ref svg { color: var(--green); flex: none; }
.chat-msg.typing { display: inline-flex; gap: 0.2857rem; align-items: center; padding: 1rem; }
.chat-msg.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); opacity: .5; animation: chatdot 1s infinite; }
.chat-msg.typing span:nth-child(2) { animation-delay: .15s; }
.chat-msg.typing span:nth-child(3) { animation-delay: .3s; }
@keyframes chatdot { 0%, 60%, 100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-4px); opacity: 1; } }
.chat-quick { display: flex; flex-wrap: wrap; gap: 0.5714rem; padding: 0 1.2857rem; }
.chat-quick:empty { padding: 0; }
.chip { background: var(--intel-blue-light); color: var(--intel-blue-dark); border: 1px solid #cfe4f7; border-radius: 16px; padding: 0.4286rem 1rem; font-size: 0.9286rem; font-weight: 600; cursor: pointer; }
.chip:hover { background: #d8ecfb; border-color: var(--intel-blue); }
.chat-input { display: flex; gap: 0.7143rem; padding: 1rem 1.2857rem; border-top: 1px solid var(--line); align-items: flex-end; }
.chat-input textarea { flex: 1; resize: none; max-height: 120px; min-height: 40px; padding: 0.7143rem 0.8571rem; border: 1px solid var(--line); border-radius: 10px; font: inherit; font-size: 1rem; }
.chat-input textarea:focus { outline: none; border-color: var(--intel-blue); box-shadow: 0 0 0 3px var(--intel-blue-light); }
.chat-input .btn { white-space: nowrap; }
@media (max-width: 480px) {
  .modal.project-modal { width: 96vw; max-width: 96vw; max-height: 92vh; }
  .modal.project-modal .project-name-field { width: 100%; margin: 0 0 0.8571rem; }
  .modal.project-modal .row { flex-direction: column; gap: 0; }
  .modal.task-modal { width: 96vw; max-width: 96vw; max-height: 92vh; }
  .modal.task-modal .modal-body { padding: 1.1429rem; }
  .modal.task-modal .row { flex-direction: column; gap: 0; }
  .agent-widget { right: 12px; left: 12px; width: auto; bottom: 88px; height: calc(100vh - 110px); }
  .agent-launcher { right: 16px; bottom: 16px; }
}

/* Typeahead multiselect (advanced filters) */
.ta-multi { position: relative; }
.ta-control {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.4286rem;
  min-height: 40px; padding: 0.3571rem 0.5714rem; background: #fff;
  border: 1px solid var(--line); border-radius: 8px;
}
.ta-control:focus-within { border-color: var(--intel-blue); box-shadow: 0 0 0 3px var(--intel-blue-light); }
.ta-chips { display: flex; flex-wrap: wrap; gap: 0.4286rem; }
.ta-chip {
  display: inline-flex; align-items: center; gap: 0.4286rem;
  background: var(--intel-blue-light); color: var(--intel-blue-dark);
  border-radius: 6px; padding: 0.2143rem 0.4286rem 0.2143rem 0.5714rem; font-size: 0.8929rem; font-weight: 600;
}
.ta-chip-x {
  border: none; background: transparent; color: inherit; cursor: pointer;
  font-size: 1.0714rem; line-height: 1; padding: 0 0.1429rem;
}
.ta-input { flex: 1; min-width: 90px; border: none; outline: none; padding: 0.2857rem 0.1429rem; font-size: 1rem; background: transparent; }
.ta-control input.ta-input { width: auto; border: none; border-radius: 0; padding: 0.2857rem 0.1429rem; background: transparent; box-shadow: none; }
.ta-control input.ta-input:focus { border: none; box-shadow: none; }
.ta-pop {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 40;
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,.12); max-height: 240px; overflow-y: auto; padding: 0.2857rem;
}
.ta-item {
  display: flex; align-items: center; gap: 0.5714rem; padding: 0.5rem 0.6429rem; border-radius: 6px; cursor: pointer; font-size: 1rem;
}

/* Suggestion rows are committed on pointerdown; this drops the tap delay a
   double-tap-to-zoom gesture would otherwise impose, and stops a stray drag
   from being read as a text selection instead of a pick. */
.ta-item, .ta-suggest, .team-suggest, .user-suggest, .project-suggest, .fb-proj-opt, .mention-item {
  touch-action: manipulation; user-select: none;
}
.ta-item:hover, .ta-item.active { background: var(--intel-blue-light); }
.ta-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; }
/* Task picker field: search box + results popup + the chosen request. */
.task-picker { position: relative; }
/* The results list is anchored to the viewport in script so the scrolling modal
   body cannot clip it; z-index clears the modal (1300). */
.task-picker .tp-pop { z-index: 1400; }
.task-picker .tp-chosen {
  display: flex; align-items: center; gap: 0.5714rem; flex-wrap: wrap;
  padding: 0.5714rem 0.7143rem; border: 1px solid var(--line); border-radius: 8px; background: #fff;
}
.task-picker .tp-chosen-label { flex: 1; min-width: 0; }
.task-picker .tp-hint { margin-top: 0.2857rem; }
.task-picker .tp-hint-err { color: var(--red, #c4314b); }
.task-picker .tp-search[aria-invalid="true"] { border-color: var(--red, #c4314b); }
/* A value owned by a task picker: readable, clearly not editable. */
.tp-copy-target { background: #f3f5f8; color: #475467; cursor: default; }
/* A calculated (smart) field: updates itself as the form is filled in. */
.smart-target { background: #f3f5f8; color: #475467; cursor: default; font-family: var(--mono, ui-monospace, SFMono-Regular, Menlo, monospace); }
/* Searchable picklist combobox: a text input styled like a native select (caret included). */
.ta-combo-input {
  width: 100%; cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat; background-position: right 10px center; padding-right: 2.1429rem;
}

/* Request progress stepper (task detail) */
.stimeline-wrap { margin: 0.1429rem 0 0.2857rem; }
.stimeline {
  display: flex; align-items: flex-start; list-style: none; margin: 0; padding: 0;
}
.stimeline li {
  flex: 1; position: relative; text-align: center; padding-top: 1.4286rem; min-width: 64px;
  font-size: 0.8929rem; font-weight: 600; color: var(--muted, #6b7683);
}
/* Connector runs between dots, so it stops short of the first and last centres. */
.stimeline li::before {
  content: ""; position: absolute; top: 6px; left: -50%; width: 100%; height: 2px;
  background: var(--line, #e3e7ec);
}
.stimeline li:first-child::before { display: none; }
.stimeline li.done::before, .stimeline li.current::before, .stimeline li.blocked::before { background: var(--intel-blue, #0071c5); }
.stimeline .st-dot {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 14px; height: 14px; border-radius: 50%;
  background: #fff; border: 2px solid var(--line, #e3e7ec); box-sizing: border-box;
}
.stimeline li.done .st-dot { background: var(--intel-blue, #0071c5); border-color: var(--intel-blue, #0071c5); }
.stimeline li.current .st-dot { border-color: var(--intel-blue, #0071c5); box-shadow: 0 0 0 4px rgba(0, 113, 197, .16); }
.stimeline li.blocked .st-dot { border-color: #e2445c; box-shadow: 0 0 0 4px rgba(226, 68, 92, .16); }
.stimeline li.done, .stimeline li.current { color: var(--intel-blue-dark, #00447c); }
.stimeline li.blocked { color: #e2445c; }
.stimeline-note { margin-top: 0.5714rem; font-size: 0.8929rem; font-weight: 600; }
.stimeline-note.blocked { color: #e2445c; }
.stimeline-note.cancelled { color: var(--muted, #6b7683); font-style: italic; }
@media (max-width: 560px) {
  .stimeline li { font-size: 0.7857rem; min-width: 0; }
}

/* Home / Landing page */
body.home-mode #sidebar { display: none; }
body.home-mode .topbar-search,
body.home-mode #notifBtn,
body.home-mode #notifDrawer,
body.home-mode #sandboxTag,
body.home-mode .user-switch,
body.home-mode #agentLauncher,
body.home-mode #agentWidget { display: none; }
body.home-mode .content {
  max-width: none; padding: 0;
  background:
    radial-gradient(920px 520px at 12% -5%, rgba(0,84,174,.12), transparent 60%),
    radial-gradient(820px 520px at 105% 108%, rgba(18,179,166,.12), transparent 55%),
    var(--bg);
}
.home {
  min-height: calc(100vh - var(--topbar-h) - var(--footer-h));
  display: flex; flex-direction: column; justify-content: center; gap: 2.7143rem;
  max-width: 1120px; margin: 0 auto; padding: 3.1429rem 2.8571rem 3.7143rem;
}
.home-top { display: grid; grid-template-columns: 360px 1fr; gap: 4rem; align-items: center; }
.hexstage { position: relative; width: 100%; max-width: 360px; aspect-ratio: 560 / 480; margin: 0 auto; justify-self: center; }
.hexlinks { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.hexlinks .hex-ring { fill: none; stroke: #cfe0f0; stroke-width: 2; stroke-dasharray: 2 7; stroke-linecap: round; }
.hexlinks .hex-spokes line { stroke: #cfe0f0; stroke-width: 2; stroke-dasharray: 2 7; stroke-linecap: round; }
.hexhub {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 26%; aspect-ratio: 1 / .92; display: grid; place-items: center;
  clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
  background: linear-gradient(135deg, #0054ae, #12b3a6);
  box-shadow: 0 14px 30px rgba(0,84,174,.28);
}
.hexnode {
  position: absolute; width: 19.5%; aspect-ratio: 1 / .92; cursor: pointer; z-index: 2;
  clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
  background: var(--intel-blue); padding: 0.1429rem;
  transition: transform .18s cubic-bezier(.34, 1.56, .64, 1), filter .18s ease;
}
.hexnode-inner {
  width: 100%; height: 100%; clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
  background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.1429rem;
}
.hexnode-ico { color: var(--intel-blue); line-height: 0; }
.hexnode-ico svg { width: 17px; height: 17px; }
.hexnode-label {
  font-size: 0.5357rem; font-weight: 700; letter-spacing: 0; line-height: 1;
  color: var(--intel-blue-dark); text-transform: uppercase;
  max-width: 78%; text-align: center; white-space: nowrap;
}
.hexnode:hover {
  transform: scale(1.2); z-index: 6;
  filter: drop-shadow(0 10px 18px rgba(0, 113, 197, .38));
  animation: hexpop .38s cubic-bezier(.34, 1.56, .64, 1);
}
.hexnode:hover .hexnode-ico svg { transform: scale(1.08); transition: transform .18s ease; }
@keyframes hexpop {
  0% { transform: scale(1); }
  55% { transform: scale(1.28); }
  100% { transform: scale(1.2); }
}
@media (prefers-reduced-motion: reduce) {
  .hexnode:hover { animation: none; transform: scale(1.12); }
}

/* Home intro: each node swells and settles, travelling clockwise around the ring. */
@keyframes hexIntroPop {
  0%, 100% { transform: scale(1); filter: none; }
  45% { transform: scale(1.26); filter: drop-shadow(0 12px 20px rgba(0, 113, 197, .45)); }
}
@keyframes hexHubPulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  45% { transform: translate(-50%, -50%) scale(1.12); }
}
.hexstage.hex-intro .hexnode { animation: hexIntroPop .72s cubic-bezier(.34, 1.56, .64, 1); z-index: 4; }
.hexstage.hex-intro .hexnode.n-top { animation-delay: .25s; }
.hexstage.hex-intro .hexnode.n-tr { animation-delay: .55s; }
.hexstage.hex-intro .hexnode.n-br { animation-delay: .85s; }
.hexstage.hex-intro .hexnode.n-bottom { animation-delay: 1.15s; }
.hexstage.hex-intro .hexnode.n-bl { animation-delay: 1.45s; }
.hexstage.hex-intro .hexnode.n-tl { animation-delay: 1.75s; }
.hexstage.hex-intro .hexhub { animation: hexHubPulse .8s cubic-bezier(.34, 1.56, .64, 1) 2.05s; }
.hexnode.n-top { left: 40.25%; top: 4%; }
.hexnode.n-bottom { left: 40.25%; bottom: 4%; }
.hexnode.n-tl { left: 11%; top: 24%; }
.hexnode.n-tr { right: 11%; top: 24%; }
.hexnode.n-bl { left: 11%; bottom: 24%; }
.hexnode.n-br { right: 11%; bottom: 24%; }
.home-intro { text-align: left; }
.home-eyebrow { font-size: 0.8571rem; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase; color: var(--intel-blue); margin-bottom: 0.7143rem; }
.home-word { font-size: 5.4286rem; line-height: .95; font-weight: 800; letter-spacing: -2.5px; color: var(--intel-blue-dark); }
.home-plus { color: #12b3a6; }
.home-tag { display: flex; align-items: center; justify-content: flex-start; gap: 0.8571rem; margin-top: 0.5714rem; font-size: 1.2143rem; font-weight: 600; color: #3a5a74; }
.home-tag .home-rule:first-child { display: none; }
.home-rule { height: 2px; width: 46px; background: linear-gradient(90deg, var(--intel-blue), transparent); }
.home-lead { font-size: 1.1071rem; line-height: 1.6; color: var(--muted); max-width: 480px; margin: 1.1429rem 0 0; }

/* Home AI assistant search */
.home-ask { width: 100%; max-width: 560px; margin: 1.7143rem 0 0; }
.home-ask-box {
  display: flex; align-items: center; gap: 0.5714rem; padding: 0.4286rem 0.4286rem 0.4286rem 1rem;
  background: #fff; border: 1px solid var(--line); border-radius: 999px;
  box-shadow: 0 10px 26px rgba(15,32,43,.10);
}
.home-ask-box:focus-within { border-color: var(--intel-blue); box-shadow: 0 0 0 3px var(--intel-blue-light); }
.home-ask-ico { color: var(--intel-blue); line-height: 0; flex: none; }
.home-ask-box input { flex: 1; border: none; outline: none; font-size: 1.0714rem; background: transparent; padding: 0.5714rem 0; }
.home-ask-box .btn { border-radius: 999px; white-space: nowrap; }
.home-ask-hints { display: flex; flex-wrap: wrap; gap: 0.5714rem; justify-content: flex-start; margin-top: 0.8571rem; }
.home-ask-result { margin-top: 1rem; display: none; }
.home-ask-result.show { display: block; }
.home-ask-answer {
  display: flex; gap: 0.7143rem; text-align: left; padding: 1rem 1.1429rem;
  background: #fff; border: 1px solid #cfe4f7; border-radius: 12px; box-shadow: var(--shadow-md);
}
.home-ask-answer-ico {
  flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--intel-blue-light); color: var(--intel-blue); border: 1px solid #cfe4f7;
}
.home-ask-text { font-size: 1rem; color: var(--ink); line-height: 1.5; }
.home-ask-actions { display: flex; flex-wrap: wrap; gap: 0.5714rem; margin-top: 0.7143rem; }
.home-ask-actions a { text-decoration: none; }

/* Home resource links */
.home-links-wrap { border-top: 1px solid var(--line); padding-top: 1.8571rem; }
.home-links-label { font-size: 0.8571rem; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); margin-bottom: 1rem; }
.home-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1429rem; width: 100%; }
.home-link {
  display: flex; align-items: center; gap: 1rem; text-align: left; cursor: pointer;
  padding: 1.2857rem; background: #fff; border: 1px solid var(--line); border-radius: 14px;
  text-decoration: none; color: inherit; transition: border-color .15s, box-shadow .15s, transform .15s;
  font: inherit;
}
.home-link:hover { border-color: var(--intel-blue); box-shadow: 0 10px 26px rgba(0,84,174,.14); transform: translateY(-3px); }
.home-link-ico {
  flex: none; width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  background: var(--intel-blue-light); color: var(--intel-blue);
}
.home-link-primary { background: linear-gradient(135deg, var(--intel-blue-dark), var(--intel-blue)); border-color: transparent; color: #fff; }
.home-link-primary .home-link-ico { background: rgba(255,255,255,.18); color: #fff; }
.home-link-primary:hover { box-shadow: 0 12px 30px rgba(0,84,174,.34); }
.home-link-title { font-size: 1.0714rem; font-weight: 700; color: var(--intel-blue-dark); }
.home-link-primary .home-link-title { color: #fff; }
.home-link-ext { font-size: 0.8571rem; opacity: .7; }
.home-link-desc { font-size: 0.8929rem; color: var(--muted); margin-top: 0.2143rem; }
.home-link-primary .home-link-desc { color: rgba(255,255,255,.85); }
@media (max-width: 860px) {
  .home { padding: 2rem 1.4286rem 2.8571rem; gap: 2.1429rem; }
  .home-top { grid-template-columns: 1fr; gap: 1.4286rem; }
  .hexstage { max-width: 280px; }
  .home-intro { text-align: center; }
  .home-word { font-size: 3.8571rem; }
  .home-tag { justify-content: center; font-size: 1.0714rem; }
  .home-tag .home-rule:first-child { display: block; }
  .home-lead { margin-left: auto; margin-right: auto; }
  .home-ask { margin-left: auto; margin-right: auto; }
  .home-ask-hints { justify-content: center; }
  .home-links { grid-template-columns: 1fr; }
}

/* Typeahead (members / project pickers) */
.ta-field { position: relative; }
.ta-chips { display: flex; flex-wrap: wrap; gap: 0.4286rem; margin-bottom: 0.5714rem; }
.ta-chip { display: inline-flex; align-items: center; gap: 0.4286rem; padding: 0.2857rem 0.4286rem 0.2857rem 0.7143rem; background: var(--intel-blue-light); color: var(--intel-blue-dark); border: 1px solid #cfe4f7; border-radius: 999px; font-size: 0.9286rem; font-weight: 600; }
.ta-chip-x { border: none; background: transparent; color: var(--intel-blue-dark); font-size: 1.0714rem; line-height: 1; cursor: pointer; padding: 0 0.1429rem; border-radius: 50%; }
.ta-chip-x:hover { background: rgba(0,84,174,.18); }
.ta-dd { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-md); max-height: 240px; overflow: auto; z-index: 40; }
.ta-suggest { display: block; width: 100%; text-align: left; padding: 0.6429rem 0.8571rem; border: none; background: #fff; cursor: pointer; font: inherit; }
.ta-suggest:hover, .ta-suggest.active { background: var(--intel-blue-light); }
.ta-suggest .sub { font-size: 0.8571rem; color: var(--muted); margin-left: 0.4286rem; }


/* ============================================================================
   Responsive / adaptive layout — adjusts chrome, navigation and dialogs as the
   viewport shrinks so the tool stays usable from wide desktops down to phones.
   ========================================================================== */

/* Wide desktops: content fills the width; gutters grow so it doesn't hug the chrome. */
@media (min-width: 1600px) {
  .content { padding: 2.1429rem 2.5714rem; }
}

/* Laptops / small desktops: trim padding so more content fits. */
@media (max-width: 1200px) {
  .content { padding: 1.7143rem 1.7143rem; }
  .sidebar { width: 15.7143rem; }
}

/* Tablets: collapse the sidebar to an icon rail and tighten the top bar. */
@media (max-width: 960px) {
  .content { padding: 1.4286rem 1.2857rem; }
  .topbar { gap: 1rem; padding: 0 1rem; }
  .brand { min-width: 0; gap: 0.7143rem; }
  .product-tag { display: none; }
  .topbar-search { max-width: none; }
  .topbar-right { gap: 0.8571rem; }
  .sidebar { width: 72px; }
  .sidebar .nav-label { display: none; }
  .sidebar .nav-section { justify-content: center; padding: 0.8571rem 0 0.4286rem; }
  .sidebar .nav-section:empty { height: 1px; padding: 0; margin: 0.4286rem; background: var(--line); }
  .sidebar .nav-item { justify-content: center; padding: 0.6429rem 0; gap: 0; }
  .sidebar .sidebar-toggle { justify-content: center; padding-left: 0; padding-right: 0; gap: 0; }
}

/* Phones / narrow windows: stack the shell vertically, wrap the top bar and
   turn the sidebar into a horizontal, scrollable icon strip above the content. */
@media (max-width: 640px) {
  .topbar { height: auto; flex-wrap: wrap; padding: 0.7143rem 0.8571rem; gap: 0.7143rem; position: static; }
  .brand { flex: 1 1 auto; }
  .product { padding-left: 0.7143rem; }
  .topbar-search { order: 3; flex-basis: 100%; max-width: none; }
  .search-results { top: 44px; }
  .user-switch select { max-width: 130px; }

  .layout { flex-direction: column; min-height: 0; }
  .sidebar {
    position: static; top: 0; width: 100%; height: auto; flex-direction: row;
    gap: 0.2857rem; padding: 0.5714rem; border-right: none; border-bottom: 1px solid var(--line);
    overflow-x: auto; overflow-y: hidden;
  }
  .sidebar .nav-scroll { flex-direction: row; overflow-x: auto; overflow-y: hidden; gap: 0.2857rem; }
  .sidebar .nav-item { flex: none; }
  .sidebar .nav-section { display: none; }
  .sidebar .sidebar-toggle { display: none; }

  .content { padding: 1.1429rem 1rem; max-width: none; }
  .page-head h1 { font-size: 1.4286rem; }
  .row { flex-direction: column; gap: 0; }

  /* Dialogs and drawers go (near) full-screen for touch use. */
  .modal, .modal.wide, .modal.project-modal, .modal.task-modal {
    width: 96vw; max-width: 96vw; max-height: 94vh; resize: none;
  }
  .modal-head { padding: 1rem 1.1429rem; }
  .modal-body { padding: 1.1429rem; }
  .modal-foot { padding: 0.8571rem 1.1429rem; }
  .drawer { width: 100vw; max-width: 100vw; }
}

/* ============================================================================
   Intel theme refresh — scoped to navigation + projects/tasks surfaces.
   Purely visual: no markup or class-name changes required.
   ========================================================================== */
:root {
  --intel-classic: #0071c5;
  --intel-energy-soft: #7fe3fe;
  --intel-ink-900: #0b1a2b;
  --nav-active-bg: linear-gradient(90deg, rgba(0,84,174,.10) 0%, rgba(0,199,253,.06) 100%);
  --brand-gradient: linear-gradient(90deg, var(--intel-blue-dark) 0%, var(--intel-blue) 45%, var(--intel-energy) 100%);
  --surface-raised: #ffffff;
  --line-soft: #edf1f5;
  --ring: 0 0 0 3px rgba(0, 199, 253, .28);
  /* Dark Intel header */
  --header-navy: #00285a;
  --header-navy-2: #003c71;
  --header-fg: #ffffff;
  --header-fg-dim: rgba(255, 255, 255, .68);
  --header-line: rgba(255, 255, 255, .16);
}

/* ---------- Top bar (Intel flat blue) ---------- */
.topbar {
  background: var(--intel-blue);
  border-bottom: none;
  box-shadow: 0 1px 3px rgba(0, 30, 60, .28);
  color: var(--header-fg);
}
.topbar::after { content: none; }
.topbar { position: sticky; }

.brand .product {
  border-left-color: rgba(255, 255, 255, .22);
  padding-left: 0.9286rem;
  gap: 0.1429rem;
  line-height: 1.1;
}
.product-name {
  color: var(--header-fg);
  font-size: 1.1429rem;
  font-weight: 700;
  letter-spacing: -.35px;
}
/* Supporting line: quieter than the product name so the lockup reads as one unit. */
.product-tag {
  color: var(--intel-energy-soft);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: .1px;
  text-transform: none;
  white-space: nowrap;
}
/* Drop the tagline before the search box starts to crowd it. */
@media (max-width: 1200px) {
  .product-tag { display: none; }
}

.topbar-search .search-ico {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  color: var(--intel-blue);
  pointer-events: none;
}
.topbar-search input {
  background: #fff;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--ink);
  padding: 0 1.1429rem 0 2.9286rem;
  box-shadow: 0 1px 3px rgba(0, 30, 60, .18);
}
.topbar-search input::placeholder { color: #7c8b99; }
.topbar-search input:hover { box-shadow: 0 2px 6px rgba(0, 30, 60, .24); }
.topbar-search input:focus {
  border-color: var(--intel-energy);
  box-shadow: 0 0 0 3px rgba(0, 199, 253, .38);
}
/* Drop the native WebKit clear button so the pill keeps a clean right edge. */
.topbar-search input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }

.notif-btn {
  border-radius: 10px;
  border-color: var(--header-line);
  color: var(--header-fg);
  background: rgba(255, 255, 255, .08);
}
.notif-btn:hover { background: rgba(255, 255, 255, .18); border-color: var(--intel-energy); color: #fff; }

.user-switch label { color: var(--header-fg-dim); }

.env-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4286rem;
  background: var(--red);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: .8px;
  text-transform: uppercase;
  white-space: nowrap;
  padding: 0.4286rem 0.8571rem;
  border-radius: 999px;
  box-shadow: 0 1px 3px rgba(0, 30, 60, .28);
}
.env-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  opacity: .9;
}

.danger-zone { border-color: #f3c2c9; background: linear-gradient(180deg, #fffafb 0%, #fff5f6 100%); }
.danger-zone-row { display: flex; align-items: center; justify-content: space-between; gap: 1.4286rem; flex-wrap: wrap; }
.tag-inactive { background: #fdecef; border-color: #f3c2c9; color: #9a1c2e; font-weight: 700; }

/* Segmented Table / Board switch on the project page. */
.view-toggle { display: inline-flex; background: #eef2f7; border: 1px solid var(--line-soft); border-radius: 999px; padding: 0.2143rem; gap: 0.1429rem; }
.view-toggle button {
  appearance: none; -webkit-appearance: none; border: none; background: transparent; color: var(--muted);
  font-family: inherit; font-size: 0.9286rem; font-weight: 600; padding: 0.4286rem 1.1429rem; border-radius: 999px;
  transition: background .12s ease, color .12s ease, box-shadow .12s ease;
}
.view-toggle button:hover { color: var(--intel-blue); }
.view-toggle button.active { background: #fff; color: var(--intel-blue-dark); box-shadow: 0 1px 3px rgba(11, 26, 43, .14); }

/* Saved views on the project task list. */
.tview-bar { display: flex; align-items: center; gap: 0.7143rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; }
.tview-tabs { display: flex; align-items: flex-end; gap: 0.1429rem; overflow-x: auto; flex: 1; min-width: 0; scrollbar-width: thin; }
.tview-tab {
  appearance: none; -webkit-appearance: none; background: transparent; border: none; border-bottom: 3px solid transparent;
  font-family: inherit; font-size: 0.9286rem; font-weight: 600; color: var(--muted); padding: 0.6429rem 0.8571rem 0.5rem; cursor: pointer;
  white-space: nowrap; display: inline-flex; align-items: center; gap: 0.4286rem; max-width: 240px;
}
.tview-tab .tview-name { overflow: hidden; text-overflow: ellipsis; }
.tview-tab:hover { color: var(--intel-blue); }
.tview-tab.active { color: var(--intel-blue-dark); border-bottom-color: var(--intel-blue); }
.tview-tab:focus-visible { outline: 2px solid var(--intel-energy); outline-offset: -2px; }
.tview-tab .tview-ico { font-size: 0.7857rem; opacity: .75; }
.tview-group { font-size: 0.75rem; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); padding: 0 0.4286rem 0.7143rem 0.8571rem; white-space: nowrap; border-left: 1px solid var(--line); margin-left: 0.4286rem; }
.tview-actions { display: flex; align-items: center; gap: 0.4286rem; padding-bottom: 0.3571rem; position: relative; flex-shrink: 0; }
.tview-modified { font-size: 0.8571rem; font-weight: 700; color: #b3541e; white-space: nowrap; }
.tview-menu { position: absolute; right: 0; top: 100%; z-index: 40; margin-top: 0.2857rem; min-width: 220px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 22px rgba(0, 0, 0, .14); padding: 0.4286rem; }
.tview-menu button { display: block; width: 100%; text-align: left; background: transparent; border: none; font-family: inherit; font-size: 0.9286rem; padding: 0.5714rem 0.7143rem; border-radius: 6px; cursor: pointer; color: var(--ink); }
.tview-menu button:hover, .tview-menu button:focus-visible { background: #eef4fb; outline: none; }
.tview-menu button.danger { color: var(--red); }
.tview-menu hr { border: none; border-top: 1px solid var(--line); margin: 0.2857rem 0; }

/* Approvals page. */
.tab-count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 0.4286rem; margin-left: 0.4286rem; border-radius: 999px; background: #e8eef5; color: var(--muted); font-size: 0.8214rem; font-weight: 700; }
.tab.active .tab-count { background: var(--intel-blue-light); color: var(--intel-blue-dark); }
.tab-count.tab-count-alert { background: var(--red); color: #fff; }
.apr-stale { color: var(--red); font-weight: 600; }
.apr-actions { text-align: right; white-space: nowrap; }
.apr-actions .btn, .apr-actions .btn-ghost, .apr-actions .btn-danger { margin-left: 0.2857rem; }
.apr-comment { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* My Work page. */
.mw-approvals { display: flex; align-items: center; justify-content: space-between; gap: 0.8571rem; flex-wrap: wrap; padding: 0.7143rem 1rem; margin-bottom: 1rem; border: 1px solid #f5d39a; background: #fff8ec; color: #7a5200; border-radius: 12px; }
.mw-tiles { margin-bottom: 1.1429rem; }
.mw-tile { appearance: none; -webkit-appearance: none; font: inherit; text-align: left; cursor: pointer; border: 1px solid var(--line); background: #fff; color: inherit; }
.mw-tile:focus-visible { outline: 2px solid var(--intel-energy); outline-offset: 2px; }
.mw-tile.active { border-color: var(--intel-blue); box-shadow: inset 0 0 0 1px var(--intel-blue), 0 6px 18px rgba(0, 84, 174, .10); }
.mw-tile .value { font-size: 2rem; }
.mw-filters { display: grid; grid-template-columns: minmax(220px, 1.4fr) repeat(3, minmax(160px, 1fr)) minmax(170px, .8fr); gap: 0.8571rem; align-items: end; margin-bottom: 0.7143rem; }
.mw-filter { display: flex; flex-direction: column; gap: 0.2857rem; min-width: 0; }
.mw-filter > label { font-size: 0.8571rem; font-weight: 600; color: var(--muted); }
.mw-search { max-width: none; width: 100%; }
.mw-search input { width: 100%; }
.mw-bar { display: flex; align-items: center; gap: 0.8571rem; flex-wrap: wrap; padding: 0.5714rem 0 0.8571rem; border-bottom: 1px solid var(--line-soft); margin-bottom: 1rem; }
.mw-bar .spacer { flex: 1; }
.mw-group { margin-bottom: 1.5714rem; }
.mw-group-title { display: flex; align-items: center; gap: 0.4286rem; margin: 0 0 0.5714rem; font-size: 0.8929rem; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); }
.mw-group-overdue .mw-group-title { color: var(--red); }
.mw-group-overdue .table-wrap { border-color: #f3c2c9; }
@media (max-width: 1100px) {
  .mw-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mw-filters .mw-search { grid-column: 1 / -1; }
}

/* Reports page. */
.rep-savedbar { display: flex; align-items: center; gap: 0.5714rem; flex-wrap: wrap; padding: 0.7143rem 1rem; margin-bottom: 1rem; background: #f6f9fc; border: 1px solid var(--line-soft); border-radius: 12px; }
.rep-types { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.7143rem; margin-bottom: 1rem; }
.rep-type {
  appearance: none; -webkit-appearance: none; display: flex; align-items: flex-start; gap: 0.7143rem; text-align: left;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 0.7857rem 0.8571rem; cursor: pointer;
  font-family: inherit; color: var(--ink); transition: border-color .12s ease, box-shadow .12s ease, background .12s ease;
}
.rep-type:hover { border-color: var(--intel-blue); box-shadow: 0 2px 10px rgba(0, 84, 174, .08); }
.rep-type:focus-visible { outline: 2px solid var(--intel-energy); outline-offset: 2px; }
.rep-type.active { border-color: var(--intel-blue); background: var(--intel-blue-light); box-shadow: inset 0 0 0 1px var(--intel-blue); }
.rep-type-ico { flex: 0 0 32px; height: 32px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; background: #eef4fb; color: var(--intel-blue); }
.rep-type.active .rep-type-ico { background: var(--intel-blue); color: #fff; }
.rep-type-name { display: block; font-size: 0.9643rem; font-weight: 700; }
.rep-type-desc { display: block; font-size: 0.8571rem; color: var(--muted); margin-top: 0.1429rem; line-height: 1.35; }
.rep-step { border-top: 1px solid var(--line-soft); padding: 0.4286rem 0 0.8571rem; }
.rep-step > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 0.5714rem; font-weight: 700; font-size: 1rem; padding: 0.5714rem 0 0.7143rem; }
.rep-step > summary::-webkit-details-marker { display: none; }
.rep-step > summary::after { content: '\25B8'; margin-left: auto; color: var(--muted); transition: transform .12s ease; }
.rep-step[open] > summary::after { transform: rotate(90deg); }
.rep-step > summary:focus-visible { outline: 2px solid var(--intel-energy); outline-offset: 2px; border-radius: 6px; }
.rep-step > summary .sub { font-weight: 500; }
.rep-step-num { width: 22px; height: 22px; border-radius: 50%; background: var(--intel-blue); color: #fff; font-size: 0.8571rem; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
/* Resizable report tables: fixed layout so dragged widths hold; long values wrap instead of stretching. */
table.rep-resizable { table-layout: fixed; }
table.rep-resizable th { position: relative; overflow: hidden; text-overflow: ellipsis; }
table.rep-resizable td { overflow-wrap: anywhere; }
table.rep-resizable.is-resizing, table.rep-resizable.is-resizing * { cursor: col-resize !important; user-select: none; }
.col-resizer { position: absolute; top: 0; right: 0; width: 10px; height: 100%; cursor: col-resize; touch-action: none; z-index: 2; }
.col-resizer::after { content: ''; position: absolute; top: 22%; bottom: 22%; right: 4px; width: 2px; border-radius: 2px; background: var(--line); transition: background .12s ease; }
table.rep-resizable th:hover .col-resizer::after { background: #9fb3c8; }
.col-resizer:hover::after, .col-resizer:focus-visible::after, .is-resizing .col-resizer::after { background: var(--intel-blue); top: 10%; bottom: 10%; }
.col-resizer:focus-visible { outline: none; }
@media (max-width: 640px) {
  .rep-types { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rep-type-desc { display: none; }
}

/* Drag and drop on the kanban board. */
.board-col { min-height: 120px; }
.board-card[draggable="true"] { cursor: grab; }
.board-card[draggable="true"]:active { cursor: grabbing; }
.board-card.dragging { opacity: .45; transform: none; }
.board-col.drop-target {
  background: linear-gradient(180deg, #e8f3fd 0%, #dfeefb 100%);
  border-color: var(--intel-energy);
  box-shadow: inset 0 0 0 2px rgba(0, 199, 253, .45);
}
.user-switch select {
  background: rgba(255, 255, 255, .95);
  border-color: var(--header-line);
  color: var(--ink);
  border-radius: 8px;
}
.current-user { color: var(--header-fg); }

/* ---------- Side navigation ---------- */
@media (min-width: 861px) {
  .sidebar {
    background: linear-gradient(180deg, #ffffff 0%, #f7fafd 100%);
    border-right: 1px solid var(--line-soft);
    padding: 0.8571rem 0.7143rem;
  }
  .nav-item {
    position: relative;
    border-radius: 10px;
    padding: 0.7143rem 0.8571rem;
    font-weight: 500;
    color: #5a6b7b;
  }
  .nav-item::before {
    content: '';
    position: absolute; left: 0; top: 50%; transform: translateY(-50%);
    width: 3px; height: 0; border-radius: 0 3px 3px 0;
    background: var(--brand-gradient);
    transition: height .16s ease;
  }
  .nav-item:hover { background: #eef4fa; color: var(--intel-ink-900); }
  .nav-item:hover::before { height: 16px; }
  .nav-item.active {
    background: var(--nav-active-bg);
    color: var(--intel-blue-dark);
    font-weight: 650;
    box-shadow: inset 0 0 0 1px rgba(0, 84, 174, .10);
  }
  .nav-item.active::before { height: 22px; }
  .nav-item.active .nav-ico { color: var(--intel-blue); }
  .nav-section {
    color: #8494a4;
    font-size: 0.7143rem;
    letter-spacing: 1px;
    border-top: 1px solid var(--line-soft);
  }
  .sidebar-toggle { border-radius: 10px; }
  .sidebar-toggle:hover { background: #eef4fa; color: var(--intel-blue); }
  .sidebar.collapsed .nav-item::before { border-radius: 3px; }
}

/* ---------- Page header ---------- */
.page-head h1 {
  font-weight: 800;
  letter-spacing: -.5px;
  color: var(--intel-ink-900);
}

/* ---------- Toolbar / filters ---------- */
.toolbar .btn-ghost { border-radius: 10px; border-color: var(--line-soft); }
.toolbar select, .toolbar input[type=search] { border-radius: 10px; border-color: var(--line-soft); }
.toolbar input[type=search]:focus, .toolbar select:focus { box-shadow: var(--ring); }

/* ---------- Data tables (projects + tasks) ---------- */
.table-wrap {
  border-color: var(--line-soft);
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(11, 26, 43, .04), 0 8px 24px rgba(11, 26, 43, .05);
  background: var(--surface-raised);
}
.table-wrap thead th {
  position: sticky; top: 0; z-index: 2;
  background: linear-gradient(180deg, #f7fafd 0%, #f2f6fa 100%);
  border-bottom: 1px solid var(--line-soft);
  color: #61707f;
  font-size: 0.75rem;
  letter-spacing: .7px;
}
.table-wrap td { border-bottom: 1px solid var(--line-soft); padding: 0.8571rem 1.1429rem; }
.table-wrap tbody tr { transition: background .12s ease, box-shadow .12s ease; }
.table-wrap tbody tr:hover td { background: #f4f9ff; }
.table-wrap tbody tr:hover td:first-child { box-shadow: inset 3px 0 0 var(--intel-energy); }
.project-open, .task-open { transition: color .12s ease; }
.project-open:hover, .task-open:hover { color: var(--intel-blue-dark) !important; text-decoration: underline; }
.mono { color: #7c8b99; letter-spacing: .3px; }

/* ---------- Pills / status chips ---------- */
.pill {
  border-radius: 999px;
  padding: 0.2857rem 0.7857rem;
  font-size: 0.8214rem;
  font-weight: 700;
  letter-spacing: .2px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18);
}
.pill-soft { border-radius: 999px; padding: 0.2857rem 0.7857rem; font-weight: 700; }
.tag {
  border-radius: 999px;
  background: #f2f6fa;
  border-color: var(--line-soft);
  color: #61707f;
  font-weight: 600;
}
.progress { border-radius: 999px; background: #e8eef4; height: 7px; }
.progress > span { border-radius: 999px; }
.avatars .avatar { box-shadow: 0 1px 2px rgba(11, 26, 43, .18); }

/* ---------- Inline edit controls in task rows ---------- */
table .inline-edit {
  border-radius: 8px;
  border-color: var(--line-soft);
  background: #fbfdff;
  transition: border-color .12s ease, box-shadow .12s ease, background .12s ease;
}
table .inline-edit:hover { background: #fff; border-color: #cfdbe6; }
table .inline-edit:focus { background: #fff; border-color: var(--intel-blue); box-shadow: var(--ring); }

/* ---------- Kanban board ---------- */
.board { gap: 1.2857rem; }
.board-col {
  background: linear-gradient(180deg, #f4f7fa 0%, #eef2f7 100%);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  padding: 1rem 0.8571rem;
  position: relative;
  overflow: hidden;
}
.board-col::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--brand-gradient);
  opacity: .55;
}
.board-col h4 { align-items: center; margin: 0.4286rem 0.2857rem 1rem; }
.board-card {
  border-color: var(--line-soft);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 1px 2px rgba(11, 26, 43, .05);
}
.board-card:hover {
  box-shadow: 0 8px 20px rgba(11, 26, 43, .10);
  border-color: #cfe3f5;
  transform: translateY(-2px);
}
.board-card .title { font-weight: 650; line-height: 1.35; }
.board-card .meta { margin-top: 0.2857rem; }

/* ---------- Favorites ---------- */
.fav-star:hover { color: var(--intel-energy); }
.fav-star.is-fav { color: #f5a623; }

/* ---------- Empty states ---------- */
.empty {
  border-radius: 14px;
  border-color: #dfe7ef;
  background: linear-gradient(180deg, #ffffff 0%, #fafcfe 100%);
}

/* ---------- Buttons ---------- */
.btn {
  border-radius: 10px;
  background: linear-gradient(180deg, var(--intel-blue) 0%, #004a99 100%);
  box-shadow: 0 1px 2px rgba(0, 55, 122, .22);
}
.btn:hover { background: linear-gradient(180deg, #0060c4 0%, var(--intel-blue-dark) 100%); }
.btn-ghost { border-radius: 10px; }
.btn-ghost:hover { border-color: var(--intel-blue); background: var(--intel-blue-light); }

/* ---------- Cards (dashboard, reports, my work, approvals) ---------- */
.card {
  border-color: var(--line-soft);
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(11, 26, 43, .04), 0 8px 24px rgba(11, 26, 43, .04);
}
.card-pad { padding: 1.5714rem; }

/* ---------- KPI tiles ---------- */
.kpi { border-radius: 14px; padding: 1.5714rem; }
.kpi::before { width: 100%; height: 3px; bottom: auto; background: var(--brand-gradient); }
.kpi.warn::before { background: linear-gradient(90deg, #d98200 0%, var(--amber) 100%); }
.kpi.bad::before { background: linear-gradient(90deg, #b32430 0%, var(--red) 100%); }
.kpi.good::before { background: linear-gradient(90deg, #0e8a53 0%, var(--green) 100%); }
.kpi .value { font-size: 2.4286rem; color: var(--intel-ink-900); }
.kpi .label { font-weight: 600; letter-spacing: .2px; }
.kpi:hover { box-shadow: 0 10px 26px rgba(11, 26, 43, .10); transform: translateY(-2px); }

/* ---------- Section headings ---------- */
.section-title {
  display: flex; align-items: center; gap: 0.6429rem;
  color: var(--intel-ink-900);
  font-weight: 750;
}
.section-title::before {
  content: '';
  width: 3px; height: 15px; border-radius: 3px;
  background: var(--brand-gradient);
}
.card-pad > .section-title:first-child { margin-top: 0; }

/* ---------- Bar charts (dashboard + reports) ---------- */
.card-pad .progress { height: 9px; background: #eef2f7; }
.card-pad .progress > span { transition: width .3s ease; }

/* ---------- Tabs ---------- */
.tabs, .pa-tabs { border-bottom: 1px solid var(--line-soft); gap: 0.1429rem; }
.tab, .pa-tab { border-radius: 8px 8px 0 0; transition: color .12s ease, background .12s ease; }
.tab:hover, .pa-tab:hover { background: #f2f7fc; color: var(--intel-blue); }
.tab.active, .pa-tab.active {
  color: var(--intel-blue-dark);
  border-bottom-color: var(--intel-blue);
  background: linear-gradient(180deg, rgba(0,199,253,.07) 0%, rgba(0,84,174,.02) 100%);
}

/* ---------- Callout boxes ---------- */
.okbox, .errbox, .form-note {
  border-radius: 12px;
  padding: 0.8571rem 1rem;
  line-height: 1.5;
}
.okbox { background: #eefaf3; border-color: #b6e6cd; color: #0a5c3a; }
.errbox { background: #fdf0f2; border-color: #f3c2c9; color: #8f1c2c; }
.form-note { border-left-width: 3px; }

/* ---------- Forms ---------- */
.field label { color: #47566a; letter-spacing: .1px; }
input[type=text], input[type=email], input[type=url], input[type=tel], input[type=number],
input[type=date], input[type=datetime-local], input[type=search], select, textarea {
  border-radius: 10px;
  border-color: #dde5ed;
  transition: border-color .12s ease, box-shadow .12s ease, background .12s ease;
}
input:hover:not(:disabled), select:hover:not(:disabled), textarea:hover:not(:disabled) { border-color: #c6d4e2; }
input:focus, select:focus, textarea:focus { border-color: var(--intel-blue); box-shadow: var(--ring); }
.chip { border-radius: 999px; border-color: #cfe4f7; transition: background .12s ease, border-color .12s ease; }
.chip:hover { background: #ddecfa; border-color: var(--intel-blue); }

/* ---------- Modals ---------- */
.modal-overlay { background: rgba(11, 26, 43, .52); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.modal {
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(11, 26, 43, .28);
  border: 1px solid var(--line-soft);
}
.modal-head {
  position: relative;
  padding: 1.4286rem 1.7143rem;
  border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(180deg, #ffffff 0%, #f9fcff 100%);
}
.modal-head::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: var(--brand-gradient);
  opacity: .8;
}
.modal-head h3 { font-weight: 750; letter-spacing: -.2px; color: var(--intel-ink-900); }
#modalTitle .modal-crumb { font-weight: 650; color: var(--intel-blue-dark); overflow-wrap: anywhere; }
#modalTitle .modal-crumb-sep { margin: 0 .75rem; color: #c3ced8; font-weight: 400; user-select: none; }
.modal-foot { border-top: 1px solid var(--line-soft); padding: 1.1429rem 1.7143rem; background: #fbfdff; }
.modal.task-modal input, .modal.task-modal select, .modal.task-modal textarea {
  box-shadow: inset 0 0 0 1px #e3eaf2;
}
.modal.task-modal .section-title { color: var(--intel-blue-dark); }

/* ---------- Notifications drawer ---------- */
.drawer { border-left: 1px solid var(--line-soft); box-shadow: -18px 0 48px rgba(11, 26, 43, .16); }
.drawer-head {
  position: relative;
  border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(180deg, #ffffff 0%, #f9fcff 100%);
}
.drawer-head::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: var(--brand-gradient);
  opacity: .8;
}
.notif { border-bottom: 1px solid var(--line-soft); transition: background .12s ease; }
.notif:hover { background: #f7fbff; }
.notif.unread { background: linear-gradient(90deg, rgba(0,199,253,.09) 0%, rgba(0,84,174,.03) 100%); }
.notif .n-rail { background: var(--brand-gradient); }

/* ---------- Toast ---------- */
.toast { border-radius: 12px; box-shadow: 0 14px 34px rgba(11, 26, 43, .28); }

@media (prefers-reduced-motion: reduce) {
  .nav-item::before, .board-card, .table-wrap tbody tr,
  .kpi, .card-pad .progress > span, .notif { transition: none; }
  .board-card:hover, .kpi:hover { transform: none; }
}

/* ============================================================================
   Cross-browser + resolution compatibility (Chrome, Edge, Firefox, Safari)
   ========================================================================== */

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* Reserve the scrollbar so opening a dialog can't shift the layout. */
  scrollbar-gutter: stable;
}

/* Firefox scrollbars (WebKit/Blink use the ::-webkit-scrollbar rules above). */
html, .nav-scroll, .sidebar, .table-wrap, .modal-body, .notif-list, .drawer, .agent-body {
  scrollbar-width: thin;
  scrollbar-color: #c7d2dd transparent;
}
.table-wrap, .modal-body, .nav-scroll, .notif-list { -webkit-overflow-scrolling: touch; }

/* Flex/grid children default to min-width:auto, which lets long values (IDs,
   URLs, wide tables) push a row past the viewport in every engine. */
.row > *, .field, .fb-main, .page-head > div, .toolbar > * { min-width: 0; }
.card, .field, td, th, .kpi, .notif { overflow-wrap: break-word; }
.mono, .breadcrumb, .crumb-current { overflow-wrap: anywhere; }

img, svg, video, canvas { max-width: 100%; }
img { height: auto; }

/* Firefox sizes date/number inputs from their content; force the field width. */
input[type=date], input[type=datetime-local], input[type=time], input[type=number] { min-width: 0; }
select[multiple] option:checked { background: var(--intel-blue-light); color: var(--intel-blue-dark); }

/* Consistent keyboard focus ring; browsers disagree on the default outline. */
a:focus-visible, button:focus-visible, [tabindex]:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 2px solid var(--intel-blue);
  outline-offset: 2px;
}

/* Mobile browsers shrink the viewport as the URL bar hides — dvh tracks it.
   Kept behind @supports so older engines keep the vh values. */
@supports (height: 100dvh) {
  .layout { min-height: calc(100dvh - var(--topbar-h) - var(--footer-h)); }
  .nav-scroll { max-height: calc(100dvh - var(--topbar-h) - var(--footer-h) - 40px - 2.5714rem); }
  .drawer { height: 100dvh; }
  .agent-widget { max-height: calc(100dvh - 130px); }
}

/* ---------- Resolution steps ----------
   Very wide screens: content keeps filling the width, and KPI rows flow into as many
   columns as fit rather than stretching a handful of cards across the whole monitor.
   auto-fit keeps the row full whether a view shows four cards or six. */
@media (min-width: 1800px) {
  .content { padding: 2.2857rem 3.1429rem; }
  .grid-4, .grid-5 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
}

/* Laptops at 125–150% Windows scaling land here: keep dialogs on screen. */
@media (max-height: 800px) {
  .modal, .modal.wide, .modal.project-modal, .modal.task-modal, .modal.form-builder-modal,
  .modal-overlay[data-persistent="1"] .modal { max-height: 92vh; }
  .fb-picker-col select[multiple] { min-height: 220px; }
}

/* Narrow laptops / split-screen windows. */
@media (max-width: 1100px) {
  .modal.project-modal, .modal.task-modal, .modal.form-builder-modal,
  .modal-overlay[data-persistent="1"] .modal { width: 94vw; max-width: 94vw; }
  .fb-picker { flex-wrap: wrap; }
  .fb-picker-actions { flex-direction: row; width: 100%; justify-content: center; }
}

/* Tablets: stack multi-column form rows so fields keep a usable width.
   Below 641px the shell already switches .row to a single column. */
@media (min-width: 641px) and (max-width: 860px) {
  .row { flex-wrap: wrap; }
  .row > * { flex: 1 1 240px; }
  .page-head { align-items: flex-start; }
  .toolbar { flex-wrap: wrap; }
}

@media (max-width: 640px) {
  .fb-picker-col select[multiple] { min-height: 200px; }
  .modal.form-builder-modal, .modal-overlay[data-persistent="1"] .modal { width: 96vw; max-width: 96vw; }
  .grid-5, .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .kpi .value { font-size: 1.8571rem; }
  /* Touch targets stay tappable at phone widths. */
  .btn, .btn-ghost, .btn-danger { padding: 0.7143rem 1rem; }
}

@media print {
  .topbar, .sidebar, .app-footer, .agent-launcher, .agent-widget, .drawer, .toolbar { display: none !important; }
  .content { max-width: none; padding: 0; }
  .card, .table-wrap { box-shadow: none; border-color: #ccc; }
}

/* ---------------- Task detail layout ---------------- */
.task-head { align-items: flex-start; gap: 0.8571rem; flex-wrap: wrap; }
.task-head-title { display: flex; align-items: center; gap: 0.7143rem; flex-wrap: wrap; min-width: 0; }
.task-ref {
  font-size: 0.8571rem; font-weight: 700; color: var(--intel-blue-dark, #00457c);
  background: var(--intel-blue-light, #eaf3fb); border-radius: 6px; padding: 0.2143rem 0.5714rem;
}
.task-actions { flex-wrap: wrap; justify-content: flex-end; }

.task-summary { margin-bottom: 1.1429rem; }.task-summary-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1.1429rem 1.7143rem; margin: 0;
}
/* Fixed column count keeps the summary fields in even rows instead of one long line. */
.task-summary > .task-summary-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.task-summary-grid > div { min-width: 0; }
/* Starts a new row so each group stays together when optional fields are hidden. */
.task-summary > .task-summary-grid > .sum-row-start { grid-column-start: 1; }
.task-summary-grid dt { font-size: 0.8571rem; font-weight: 600; margin-bottom: 0.3571rem; }
.task-summary-grid dd { margin: 0; font-weight: 600; }
.task-summary-people { position: relative; }
.task-assignees { display: flex; align-items: center; gap: 0.4286rem; flex-wrap: wrap; }

.task-stack { display: flex; flex-direction: column; gap: 1.1429rem; }
/* Approvals and linked request sit side by side; everything else runs full width. */
.task-context { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.1429rem; align-items: stretch; }
.task-context > .card { height: 100%; }
.task-main { display: flex; flex-direction: column; gap: 1.1429rem; min-width: 0; }

.comment-composer { margin-top: 1rem; border-top: 1px solid var(--line-soft, var(--line)); padding-top: 1rem; }
.comment-composer textarea { width: 100%; resize: vertical; min-height: 76px; }
.comment-composer-actions { display: flex; justify-content: flex-end; gap: 0.5714rem; margin-top: 0.5714rem; }
/* Wizard step tabs that are not reachable yet. */
.pa-tab:disabled { opacity: .45; cursor: default; }
.pa-tab:disabled:hover { background: none; color: var(--muted); }

/* Required/invalid field highlight on a blocked submit. */
.field.is-invalid > label { color: var(--red); }
.modal .field.is-invalid input,
.modal .field.is-invalid select,
.modal .field.is-invalid textarea,
.field.is-invalid input,
.field.is-invalid select,
.field.is-invalid textarea {
  border: 1px solid var(--red);
  box-shadow: 0 0 0 3px rgba(226, 68, 92, .16);
}

/* Pasted screenshots: composer previews and the thumbnails shown on a posted comment. */
.cmt-img-strip { display: flex; flex-wrap: wrap; gap: 0.5714rem; margin-top: 0.5714rem; }
.cmt-img-thumb { position: relative; display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.cmt-img-thumb img { display: block; max-width: 240px; max-height: 170px; object-fit: contain; }
a.cmt-img-thumb:hover { border-color: var(--intel-blue); }
.cmt-img-del {
  position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; padding: 0;
  border: none; border-radius: 50%; background: rgba(15,32,43,.72); color: #fff;
  font-size: 1rem; line-height: 1; cursor: pointer;
}
.cmt-img-del:hover { background: var(--red); }
.comment-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.7143rem; }
.collapse-summary > .btn { margin-left: auto; }
.comment-tools { display: flex; gap: 0.2857rem; flex-shrink: 0; opacity: 0; transition: opacity .12s; }
.comment-row:hover .comment-tools, .comment-row:focus-within .comment-tools { opacity: 1; }
@media (hover: none) { .comment-tools { opacity: 1; } }
.cmt-editor textarea { width: 100%; resize: vertical; min-height: 70px; }

@media (max-width: 1100px) {
  .task-context { grid-template-columns: 1fr; }
  .task-summary > .task-summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .task-summary > .task-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .task-actions { justify-content: flex-start; }
  .task-summary-grid { gap: 1rem 1.1429rem; }
}

/* Unique ("lookup") custom fields: duplicate feedback on the input itself. */
.cf-dupe { border-color: var(--red, #c81326) !important; }
.cf-dupe-msg { color: var(--red, #c81326); font-weight: 600; }

/* Calendar / timeline report — one scrollable column per month. */
/* The board and each column are user-resizable via the native resize handles. */
.cal-board {
  display: flex; gap: 1rem; overflow: auto; padding-bottom: 0.7143rem; align-items: flex-start;
  resize: vertical; min-height: 320px; max-height: 80vh;
}
.cal-col {
  flex: 0 0 268px; display: flex; flex-direction: column; border: 1px solid var(--line);
  border-radius: 10px; overflow: hidden; background: #f6f8fa;
  resize: horizontal; min-width: 200px; max-width: 560px;
}
.cal-col.drop-target { outline: 2px dashed var(--intel-blue); outline-offset: 2px; }
.cal-col-head {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5714rem;
  padding: 0.7143rem 0.8571rem; background: var(--intel-blue-dark, #00457c); color: #fff; font-weight: 700;
}
.cal-count { background: rgba(255, 255, 255, .22); border-radius: 999px; padding: 1px 0.6429rem; font-size: 0.8571rem; }
.cal-col-body { display: flex; flex-direction: column; gap: 0.7143rem; padding: 0.7143rem; overflow-y: auto; flex: 1 1 auto; min-height: 120px; }
.cal-card { background: #fff; border: 1px solid var(--line); border-left: 4px solid #9aa7b2; border-radius: 8px; padding: 0.7143rem; }
.cal-card[draggable="true"] { cursor: grab; }
.cal-card.dragging { opacity: .5; cursor: grabbing; }
.cal-card-top { display: flex; align-items: center; justify-content: space-between; gap: 0.4286rem; min-height: 20px; }
.cal-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.cal-title { display: block; font-weight: 700; color: var(--intel-blue); cursor: pointer; margin: 0.4286rem 0; }
.cal-title:hover { text-decoration: underline; }
.cal-meta { font-size: 0.8571rem; color: #5b6b7a; }
.cal-overdue { color: var(--red, #c81326); font-weight: 600; }
.cal-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.5714rem; margin-top: 0.5714rem; flex-wrap: wrap; }

/* ---------------- Dashboard ---------------- */
.dash-head { margin-bottom: 1.1429rem; }
.dash-filters { display: flex; align-items: center; gap: 0.5714rem; flex-wrap: wrap; }
.dash-filters select { min-width: 12rem; max-width: 18rem; border-radius: 10px; }
.dash-seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 2px; }
.dash-seg button { background: transparent; border: none; border-radius: 8px; padding: 0.4286rem 0.9286rem; font-weight: 600; font-size: 0.9286rem; color: #4b5b69; transition: background .12s, color .12s; }
.dash-seg button:hover { color: var(--intel-blue); }
.dash-seg button[aria-pressed="true"] { background: var(--intel-blue); color: #fff; }
.dash-refresh { display: inline-flex; align-items: center; padding: 0.5rem 0.6429rem; }
.dash-updated { font-size: 0.7857rem; white-space: nowrap; }
.dash-custom { display: inline-flex; align-items: center; gap: 0.3571rem; }
.dash-custom input[type="date"] { border: 1px solid var(--line); border-radius: 10px; padding: 0.3571rem 0.5714rem; font: inherit; font-size: 0.9286rem; }
#dash_body { transition: opacity .15s ease; }
#dash_body.is-loading { opacity: .55; pointer-events: none; }

.dash-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(11.5rem, 1fr)); gap: 1rem; margin-bottom: 1.2857rem; }
.dash-kpi {
  position: relative; overflow: hidden; display: flex; align-items: flex-start; gap: 0.8571rem; text-align: left;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 1.1429rem; box-shadow: var(--shadow);
  color: var(--ink); transition: box-shadow .14s ease, transform .14s ease, border-color .14s ease;
}
.dash-kpi::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--brand-gradient); }
.dash-kpi:hover { box-shadow: 0 10px 26px rgba(11, 26, 43, .10); transform: translateY(-2px); border-color: #cfe0f0; }
.dash-kpi[aria-current="true"] { border-color: var(--intel-blue); box-shadow: 0 0 0 2px rgba(0, 84, 174, .25); }
.dash-kpi-ico { flex: none; width: 2.5714rem; height: 2.5714rem; border-radius: 10px; display: grid; place-items: center; background: var(--intel-blue-light); color: var(--intel-blue); }
.dash-kpi-body { display: flex; flex-direction: column; min-width: 0; }
.dash-kpi-value { font-size: 1.8571rem; font-weight: 800; line-height: 1.05; letter-spacing: -.5px; }
.dash-kpi-label { font-size: 0.9286rem; font-weight: 700; margin-top: 0.2143rem; }
.dash-kpi-hint { font-size: 0.7857rem; color: var(--muted); margin-top: 0.1429rem; }
.dash-kpi.tone-bad::before { background: linear-gradient(90deg, #b32430 0%, var(--red) 100%); }
.dash-kpi.tone-bad .dash-kpi-ico { background: #fdecef; color: #c81326; }
.dash-kpi.tone-warn::before { background: linear-gradient(90deg, #d98200 0%, var(--amber) 100%); }
.dash-kpi.tone-warn .dash-kpi-ico { background: #fff4e0; color: #a86200; }
.dash-kpi.tone-good::before { background: linear-gradient(90deg, #0e8a53 0%, var(--green) 100%); }
.dash-kpi.tone-good .dash-kpi-ico { background: #e6f7ee; color: #0e8a53; }

.dash-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.2857rem; }
.dash-card { display: flex; flex-direction: column; min-width: 0; container-type: inline-size; }
.dash-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.8571rem; margin-bottom: 0.8571rem; }
.dash-card-head h2 { margin: 0; font-size: 1.0714rem; font-weight: 700; letter-spacing: -.2px; }
.dash-card-head .sub { font-size: 0.8571rem; }

.dash-stack { display: flex; gap: 2px; height: 14px; border-radius: 999px; overflow: hidden; margin: 0 0 0.8571rem; }
.dash-stack > span { min-width: 4px; cursor: pointer; transition: filter .12s; }
.dash-stack > span:hover { filter: brightness(.9); }
.dash-bars { display: flex; flex-direction: column; gap: 0.1429rem; }
.dash-bar { display: block; width: 100%; text-align: left; background: transparent; border: 1px solid transparent; border-radius: 8px; padding: 0.5rem 0.5714rem; color: var(--ink); transition: background .12s, border-color .12s; }
.dash-bar:hover { background: #f4f9ff; border-color: var(--line-soft); }
.dash-bar[aria-current="true"] { background: var(--intel-blue-light); border-color: var(--intel-blue); }
.dash-bar.is-extra { display: none; }
.dash-card.show-all .dash-bar.is-extra { display: block; }
.dash-bar.is-other { color: var(--muted); cursor: default; }
.dash-bar.is-other:hover { background: transparent; border-color: transparent; }
.dash-card-wide { grid-column: 1 / -1; }
.dash-trend { display: grid; grid-template-columns: minmax(13rem, 17rem) 1fr; gap: 1.7143rem; align-items: center; padding: 1.1429rem 1.4286rem; }
.dash-trend-summary { display: flex; flex-direction: column; align-items: flex-start; gap: 0.2857rem; min-width: 0; }
.dash-trend-title { margin: 0; font-size: 0.9286rem; font-weight: 700; color: var(--muted); letter-spacing: .2px; }
.dash-trend-total { background: none; border: none; padding: 0; font: inherit; font-size: 2.2857rem; font-weight: 800; line-height: 1.05; letter-spacing: -.5px; color: var(--ink); border-radius: 6px; }
.dash-trend-total:hover { color: var(--intel-blue); }
.dash-trend-delta { display: inline-flex; align-items: center; gap: 0.2857rem; font-size: 0.8571rem; font-weight: 700; border-radius: 999px; padding: 0.1429rem 0.6429rem; background: #eef2f7; color: #4b5b69; }
.dash-trend-delta.is-up { background: #e8f1fb; color: var(--intel-blue-dark); }
.dash-trend-delta.is-down { background: #fff4e0; color: #8a5300; }
.dash-trend-facts { font-size: 0.8571rem; color: var(--muted); }
.dash-trend-chart { min-width: 0; }
.dash-trend-plot { position: relative; height: 5.4286rem; margin-top: 1.2857rem; }
.dash-trend-plot svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.dash-trend-hits { position: absolute; inset: 0; display: flex; }
.dash-trend-hit { position: relative; flex: 1 1 0; min-width: 0; background: transparent; border: none; padding: 0; border-radius: 4px; }
.dash-trend-hit::before { content: ''; position: absolute; top: 0; bottom: 0; left: 50%; width: 1px; background: var(--intel-blue); opacity: 0; }
.dash-trend-hit::after { content: ''; position: absolute; left: 50%; bottom: var(--y); width: 9px; height: 9px; margin: 0 0 -4.5px -4.5px; border-radius: 50%; background: #fff; border: 2px solid var(--intel-blue); opacity: 0; }
.dash-trend-hit:hover::before, .dash-trend-hit:focus-visible::before, .dash-trend-hit[aria-current="true"]::before { opacity: .35; }
.dash-trend-hit:hover::after, .dash-trend-hit:focus-visible::after, .dash-trend-hit[aria-current="true"]::after { opacity: 1; }
.dash-trend-tip { position: absolute; top: -0.4286rem; transform: translate(-50%, -100%); background: var(--ink); color: #fff; font-size: 0.7857rem; font-weight: 600; padding: 0.2857rem 0.5714rem; border-radius: 6px; white-space: nowrap; pointer-events: none; z-index: 2; }
.dash-trend-axis { display: flex; justify-content: space-between; margin-top: 0.3571rem; font-size: 0.7143rem; color: var(--muted); }
@media (max-width: 760px) { .dash-trend { grid-template-columns: 1fr; gap: 0.8571rem; } }
.dash-bar-top { display: flex; align-items: center; justify-content: space-between; gap: 0.8571rem; font-size: 0.9286rem; margin-bottom: 0.3571rem; }
.dash-bar-label { display: flex; align-items: center; gap: 0.5rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-bar-label .dot { flex: none; }
.dash-bar-val { font-weight: 700; white-space: nowrap; }
.dash-bar-track { display: block; height: 8px; border-radius: 999px; background: #eef2f7; overflow: hidden; }
.dash-bar-track > span { display: block; height: 100%; border-radius: 999px; transition: width .3s ease; }
.dash-more { margin: 0.5714rem 0 0 0.5714rem; font-size: 0.8571rem; align-self: flex-start; }

.dash-list { display: flex; flex-direction: column; }
.dash-row { display: flex; align-items: center; justify-content: space-between; gap: 0.8571rem; padding: 0.7143rem 0.5714rem; border-bottom: 1px solid var(--line-soft); border-radius: 8px; color: var(--ink); }
.dash-row:last-child { border-bottom: none; }
.dash-row:hover { background: #f4f9ff; }
.dash-row-main { display: flex; flex-direction: column; gap: 0.2143rem; min-width: 0; }
.dash-row-title { font-weight: 600; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
.dash-ref { color: var(--muted); font-weight: 700; font-size: 0.8571rem; margin-right: 0.4286rem; white-space: nowrap; }
.dash-row-meta { font-size: 0.7857rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-row-side { display: flex; align-items: center; gap: 0.4286rem; flex: none; }
.dash-due { font-size: 0.7857rem; font-weight: 600; color: var(--muted); white-space: nowrap; min-width: 4.5rem; text-align: right; }
.dash-due.is-soon { color: #8a5300; }
.dash-due.is-late { color: #b3121f; }
.dash-empty { padding: 1.4286rem; text-align: center; color: var(--muted); font-size: 0.9286rem; }
.dash-empty-good { color: #0e7a4a; }

.dash-drawer {
  position: fixed; top: var(--topbar-h); right: 0; bottom: 0; z-index: 85; width: min(36rem, 100vw);
  display: flex; flex-direction: column; background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--shadow-lg);
  animation: dashSlide .18s ease;
}
.dash-drawer[hidden] { display: none; }
.dash-drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.8571rem; padding: 1.1429rem 1.2857rem; border-bottom: 1px solid var(--line); }
.dash-drawer-head h2 { margin: 0 0 0.2143rem; font-size: 1.1429rem; font-weight: 700; }
.dash-drawer-head h2:focus { outline: none; }
.dash-drawer-body { flex: 1 1 auto; overflow: auto; padding: 0.5714rem 0.8571rem 1.1429rem; container-type: inline-size; }
@container (max-width: 30rem) {
  .dash-row { flex-wrap: wrap; row-gap: 0.4286rem; }
  .dash-row-side { width: 100%; }
  .dash-row-side .dash-due { margin-left: auto; }
}
@keyframes dashSlide { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .dash-drawer { animation: none; } .dash-kpi:hover { transform: none; } }

@media (max-width: 1000px) { .dash-grid { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .dash-drawer { top: 0; width: 100vw; }
  .dash-row { flex-wrap: wrap; }
  .dash-row-side { flex-wrap: wrap; }
  .dash-filters select { min-width: 0; flex: 1 1 100%; max-width: none; }
}

/* ============================================================================
   Phone layout. Everything below is scoped to phone widths / touch input, so
   desktop and tablet rendering is unchanged.
   ========================================================================== */
.mobile-nav-btn, .nav-backdrop { display: none; }

@media (max-width: 640px) {
  /* Two-row header scrolls away instead of eating the small viewport. */
  .topbar { position: relative; }
  .mobile-nav-btn {
    display: inline-flex; align-items: center; justify-content: center; flex: none;
    width: 40px; height: 40px; padding: 0; border-radius: 10px;
    background: rgba(255, 255, 255, .08); border: 1px solid var(--header-line); color: var(--header-fg);
  }
  .mobile-nav-btn:hover { background: rgba(255, 255, 255, .18); border-color: var(--intel-energy); }
  body.home-mode .mobile-nav-btn { display: none; }
  .brand { min-width: 0; }
  .product-name { white-space: nowrap; }
  .search-results { max-height: 60vh; }

  /* Sidebar becomes a labelled slide-out drawer opened from the menu button. */
  .sidebar, .sidebar.collapsed {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 1250;
    width: min(300px, 84vw); height: auto; flex-direction: column; gap: 0.1429rem;
    padding: 1rem 0.7143rem; background: var(--surface);
    border-right: 1px solid var(--line); border-bottom: none; box-shadow: var(--shadow-lg);
    overflow: hidden; transform: translateX(-105%); visibility: hidden;
    transition: transform .2s ease, visibility 0s linear .2s;
  }
  body.mobile-nav-open .sidebar { transform: none; visibility: visible; transition: transform .2s ease; }
  body.mobile-nav-open { overflow: hidden; }
  body.mobile-nav-open .nav-backdrop {
    display: block; position: fixed; inset: 0; z-index: 1240; background: rgba(11, 26, 43, .45);
  }
  .sidebar .nav-scroll { flex-direction: column; overflow-x: hidden; overflow-y: auto; gap: 0.1429rem; position: static; flex: 1; max-height: none; margin-bottom: 0; }
  .sidebar .nav-label, .sidebar.collapsed .nav-label { display: inline; }
  .sidebar .nav-item, .sidebar.collapsed .nav-item {
    justify-content: flex-start; gap: 0.8571rem; padding: 0.7143rem 0.8571rem; min-height: 44px;
  }
  .sidebar .nav-section, .sidebar.collapsed .nav-section { display: flex; justify-content: flex-start; padding: 1rem 0.8571rem 0.4286rem; }
  .sidebar .nav-section:empty, .sidebar.collapsed .nav-section:empty { display: none; }
  .sidebar .sidebar-toggle { display: none; }

  /* Keep the last rows clear of the floating assistant button. */
  .content { padding-bottom: 6rem; }
  .card-pad, .kpi { padding: 1.1429rem; }
  .help-hero { padding: 1.1429rem; }

  /* Tab strips scroll sideways instead of being clipped. */
  .tabs, .pa-tabs { overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
  .tabs::-webkit-scrollbar, .pa-tabs::-webkit-scrollbar { display: none; }
  .tab, .pa-tab { flex: none; white-space: nowrap; margin-bottom: 0; }

  .toolbar-nowrap { flex-wrap: wrap; }
  .toolbar-nowrap .tb-search { flex: 1 1 100%; }
  .mw-filters { grid-template-columns: 1fr; }
  .fb-picker { flex-direction: column; }
  .fb-picker-actions { flex-direction: row; flex-wrap: wrap; }

  .modal-overlay { padding: 0.5714rem; }
  .modal { min-width: 0; min-height: 0; }
  .modal-foot { flex-wrap: wrap; }
  .assignee-pop { max-width: calc(100vw - 2rem); }
  .toast { max-width: calc(100vw - 2rem); width: max-content; text-align: center; }
}

@media (max-width: 480px) {
  .home-word { font-size: 3rem; letter-spacing: -1.5px; }
  .home-ask-box .btn { padding: 0.5714rem 0.8571rem; }
}

@media (max-width: 380px) {
  .intel-logo { height: 28px; }
  .product { padding-left: 0.5714rem; }
}

@media (max-width: 640px) and (pointer: coarse) {
  /* iOS zooms the page when a focused field's text is under 16px. */
  input, select, textarea, .ql-editor { font-size: max(16px, 1rem) !important; }
  .icon-btn { width: 40px; height: 40px; }
  .notif .n-dismiss { width: 32px; height: 32px; opacity: 1; }
  /* No hover on phones, so lift effects would stick after a tap. */
  .kpi:hover, .dash-kpi:hover, .board-card:hover, .home-link:hover { transform: none; }
}
