:root {
  --sidebar-width: 76px;
  color-scheme: light;
  --ink: #18283f;
  --muted: #738198;
  --muted-2: #96a2b3;
  --line: #e5eaf1;
  --surface: #fff;
  --canvas: #f5f7fa;
  --nav: #173F35;
  --blue: #347fce;
  --blue-dark: #246bb8;
  --blue-soft: #eef6ff;
  --green: #23996b;
  --shadow: 0 2px 5px rgba(22, 42, 68, .045), 0 12px 30px rgba(22, 42, 68, .035);
  font-family: "DM Sans", "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid #9bc9f3; outline-offset: 2px;
}
.app-shell { min-height: 100vh; }
.sidebar {
  width: var(--sidebar-width, 76px); background: var(--nav); position: fixed; inset: 0 auto 0 0; z-index: 5;
  display: flex; align-items: center; flex-direction: column; padding: 20px 0 14px; color: #c6d3e4;
  transition: width .2s ease;
}
.brand {
  width: 43px; height: 43px; border-radius: 13px; background: #fff; display: grid; place-items: center;
  padding: 0 0 4px; text-decoration: none; color: #007256;
  font: 700 36px/1 "Work Sans", sans-serif; letter-spacing: -2px;
  font-style: italic;
}
.sidebar-rule { width: 36px; height: 1px; flex: 0 0 1px; background: rgba(219, 230, 245, .12); margin: 25px 0 13px; }
.sidebar-section-label, .rail-phase-name, .rail-icon-label { display: none; }
.sidebar-toggle {
  position: absolute; top: 78px; right: -14px; z-index: 1; width: 28px; height: 28px;
  display: grid; place-items: center; padding: 0; border: 1px solid #dce3eb; border-radius: 50%;
  background: #fff; color: #53667b; box-shadow: 0 2px 7px rgba(20,40,63,.14);
  cursor: pointer; font: 700 20px/1 "Work Sans", sans-serif; transition: transform .2s ease, color .16s ease;
}
.sidebar-toggle:hover { color: #007256; transform: scale(1.06); }
.phase-rail { display: flex; flex-direction: column; gap: 9px; }
.rail-phase, .rail-icon {
  width: 44px; height: 44px; border: 0; border-radius: 12px; background: transparent; color: #c7d3e3;
  cursor: pointer; display: grid; place-items: center; font: 700 17px "Work Sans", sans-serif; transition: .18s ease;
}
.rail-phase:hover, .rail-icon:hover { background: rgba(255,255,255,.1); color: #fff; }
.workspace-button { margin-bottom: 9px; }
.workspace-icon { display: grid; place-items: center; }
.workspace-icon svg { width: 22px; height: 22px; fill: currentColor; }
.rail-phase.active { background: #007256; border: 3px solid #039647; color: #fff; box-shadow: 0 6px 16px rgba(3, 14, 32, .23); }
.sidebar-bottom { margin-top: auto; display: flex; align-items: center; flex-direction: column; gap: 7px; }
.rail-icon { height: 37px; font-size: 17px; }
.settings-link.active { background: rgba(255,255,255,.12); color: #fff; }
.storage-indicator { display: none; }
.main-area { margin-left: var(--sidebar-width); min-height: 100vh; transition: margin-left .2s ease; }
body.sidebar-expanded { --sidebar-width: 220px; }
body.sidebar-expanded .sidebar-section-label {
  display: block; align-self: stretch; margin: 0 20px 12px; color: #a9c1b8;
  font-size: 10px; font-weight: 700; letter-spacing: .7px; text-transform: uppercase;
}
body.sidebar-expanded .phase-rail { align-self: stretch; margin: 0 14px; }
body.sidebar-expanded .rail-phase {
  width: 100%; height: 48px; display: flex; justify-content: flex-start; gap: 10px;
  padding: 0 8px; border-radius: 8px; text-align: left;
}
body.sidebar-expanded .rail-phase-letter {
  width: 28px; height: 28px; flex: 0 0 28px; display: grid; place-items: center;
  border-radius: 6px; background: rgba(255,255,255,.08);
}
body.sidebar-expanded .workspace-icon svg { width: 17px; height: 17px; }
body.sidebar-expanded .rail-phase-name { display: inline; font-size: 12px; }
body.sidebar-expanded .rail-phase.active .rail-phase-letter { background: rgba(255,255,255,.17); }
body.sidebar-expanded .sidebar-bottom { width: 100%; align-items: stretch; padding: 0 14px; }
body.sidebar-expanded .rail-icon { width: 100%; display: flex; align-items: center; justify-content: flex-start; gap: 12px; padding: 0 10px; border-radius: 7px; }
body.sidebar-expanded .rail-icon-label { display: inline; font-size: 11px; font-weight: 600; }
body.settings-active .sidebar-section-label { display: none; }
body.sidebar-expanded.settings-active .sidebar-section-label { display: block; }
.topbar {
  height: 68px; padding: 0 34px; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 4;
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 17px; }
.wordmark { font: 700 15px "Work Sans", sans-serif; letter-spacing: 1px; color: var(--ink); text-decoration: none; }
.wordmark span { color: #93a0b3; font-size: 9px; letter-spacing: 1.7px; margin-left: 3px; }
.topbar-divider { height: 25px; width: 1px; background: var(--line); }
.project-switcher { border: 0; background: none; padding: 8px; cursor: pointer; display: flex; align-items: center; gap: 9px; color: #51617a; font-size: 13px; }
.switcher-mark { color: var(--blue); font-size: 16px; }
.chevron { color: #95a2b4; font-size: 16px; }
.topbar-right { gap: 14px; }
.save-status { display: inline-flex; gap: 8px; align-items: center; color: var(--muted); font-size: 11px; }
.save-status i, .storage-indicator i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #36a97a; }
.save-status.saving i { background: #e4a337; }
.icon-button { width: 36px; height: 36px; border: 1px solid var(--line); background: #fff; border-radius: 10px; font-size: 16px; cursor: pointer; color: #63728a; }
.avatar { width: 34px; height: 34px; border: 0; border-radius: 50%; background: #007256; color: #fff; font: 700 17px "Work Sans",sans-serif; }
.mobile-menu { display: none; background: none; border: 0; font-size: 20px; cursor: pointer; }
.view-container { max-width: 1560px; margin: 0 auto; padding: 31px 34px 60px; }
.eyebrow { color: var(--blue); font-size: 10px; font-weight: 700; letter-spacing: 1.35px; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: "Manrope", "Segoe UI", sans-serif; letter-spacing: -.45px; }
h1 { font-size: 25px; margin: 7px 0; line-height: 1.24; }
h2 { font-size: 17px; margin: 0; }
h3 { font-size: 13px; margin: 0; }
.subtitle { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 24px; }
.heading-actions, .filter-row, .button-row { display: flex; align-items: center; gap: 10px; }
.button {
  min-height: 38px; padding: 0 15px; border: 1px solid var(--line); border-radius: 9px; background: #fff;
  font-size: 12px; font-weight: 700; cursor: pointer; transition: .16s ease; white-space: nowrap;
}
.button:hover { border-color: #bad5ef; background: #f8fbff; transform: translateY(-1px); }
.button-primary { background: var(--blue); color: #fff; border-color: var(--blue); box-shadow: 0 3px 8px rgba(52,127,206,.15); }
.button-primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.button-quiet { background: transparent; }
.button-danger { color: #c05252; border-color: #f0d8d8; }
.button-small { min-height: 31px; padding: 0 11px; font-size: 11px; }
.metrics-plan-workspace { background: linear-gradient(180deg, rgba(245,249,255,0.94), rgba(236,244,252,0.95)); }
.metrics-workspace-head { margin-bottom: 18px; }
.metrics-subtabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.metrics-subtab { border: 1px solid #dfe6ef; background: rgba(255,255,255,.45); color: #48627f; border-radius: 8px; padding: 9px 14px; font-size: 12px; font-weight: 700; cursor: pointer; }
.metrics-subtab.active { background: #edf5ff; border-color: #bfd9f4; color: #1d4984; box-shadow: inset 0 0 0 1px rgba(78,125,185,.12); }
.metrics-ai-button { background: linear-gradient(180deg, #f5f1ff 0%, #efe7ff 100%); border-color: #dfe2ff; color: #663ab8; }
.metrics-layout, .metrics-sampling-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(320px, .9fr); gap: 18px; margin-bottom: 18px; }
.metrics-sampling-layout { grid-template-columns: minmax(0, 1fr); }
.metrics-card { background: rgba(255,255,255,.7); border: 1px solid #dfe6ef; border-radius: 12px; overflow: hidden; }
.metrics-card-header { background: rgba(227, 240, 255, 0.7); border-bottom: 1px solid #dfe6ef; padding: 12px 16px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #2d5b8b; }
.metrics-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; padding: 16px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-size: 11px; color: #5b6d87; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid #dfe6ef; border-radius: 8px; background: rgba(255,255,255,.8); padding: 10px 12px; color: var(--ink); font-size: 12px; }
.field textarea { min-height: 86px; resize: vertical; }
.field-full { grid-column: 1 / -1; }
.metrics-calc-card { padding: 16px 18px 18px; background: rgba(238, 247, 255, 0.85); }
.metrics-calc-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.metrics-calc-head h3 { margin: 0; font-size: 18px; color: #1c2d44; }
.metrics-calc-head select { width: 180px; border: 1px solid #dfe6ef; background: #fff; border-radius: 8px; padding: 8px 10px; color: #586d88; font-size: 11px; }
.metrics-subtext { margin: 0 0 12px; color: var(--muted); font-size: 12px; }
.metrics-range { display: flex; flex-direction: column; gap: 6px; margin: 14px 0; }
.metrics-range-label { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: #4b627c; font-size: 12px; }
.metrics-range-label strong { font-size: 12px; color: #213d5c; }
.metrics-range input[type="range"] { width: 100%; accent-color: #2f73d3; }
.metrics-result { background: rgba(255,255,255,.35); border: 1px solid #b9d5ef; border-radius: 12px; padding: 18px 16px; margin-top: 22px; }
.metrics-result-label { text-transform: uppercase; letter-spacing: .08em; font-size: 11px; color: #4b6987; font-weight: 700; }
.metrics-result-value { margin-top: 10px; font-size: 54px; line-height: 1; font-weight: 800; color: #1c314d; }
.metrics-result-value small { font-size: 16px; }
.metrics-info { background: linear-gradient(180deg, #dfeefb 0%, #d5ebff 100%); border: 1px solid #bdd7f0; border-radius: 12px; padding: 14px 16px; margin-top: 18px; display: flex; align-items: flex-start; gap: 12px; color: #1d3c5e; }
.metrics-info-icon { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.5); color: #2a6ecf; font-weight: 800; }
.metrics-info strong { display: block; margin-bottom: 4px; }
.metrics-impact-box { border: 1px solid #bfe1d1; border-radius: 12px; background: rgba(224, 250, 233, 0.8); overflow: hidden; }
.metrics-impact-header { border-bottom: 1px solid #cfe9d8; background: rgba(236, 255, 245, .7); padding: 12px 14px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: #295d49; }
.metrics-impact-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding: 16px; }
.metrics-modal-backdrop { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(19, 29, 43, 0.45); z-index: 40; }
.metrics-modal-backdrop[data-modal-visible="false"] { display: none; }
.metrics-modal { width: min(700px, 78vw); background: #fff; border-radius: 16px; border: 1px solid #dfe6ef; box-shadow: 0 18px 42px rgba(17,30,50,.2); overflow: hidden; }
.metrics-modal-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 12px; border-bottom: 1px solid #eaf0f5; }
.metrics-modal-header h3 { margin: 0; font-size: 20px; color: #1d2d44; }
.metrics-modal-close { border: 1px solid #dfe6ef; background: #fff; border-radius: 50%; width: 30px; height: 30px; font-size: 20px; color: #546987; cursor: pointer; }
.metrics-modal-body { padding: 18px 20px 12px; }
.metrics-modal-metric { display: inline-block; font-size: 12px; color: #587099; font-weight: 700; margin-bottom: 10px; }
.metrics-modal-body p { margin: 0 0 15px; color: #5c7288; font-size: 12px; line-height: 1.6; }
.metrics-field-list { border: 1px solid #dfe6ef; border-radius: 10px; overflow: hidden; }
.metrics-field-row { display: grid; grid-template-columns: 30px 110px minmax(120px, 1fr) 120px 32px; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid #edf0f4; background: rgba(255,255,255,0.4); }
.metrics-field-row:last-child { border-bottom: 0; }
.metrics-field-drag { color: #8392a7; letter-spacing: 2px; font-size: 16px; }
.metrics-chip { display: inline-flex; align-items: center; justify-content: center; padding: 4px 8px; border-radius: 5px; font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; width: fit-content; }
.metrics-chip.required { background: rgba(201, 62, 62, .08); border: 1px solid rgba(201, 62, 62, .2); color: #bc3c46; }
.metrics-chip.optional { background: rgba(62, 113, 181, .08); border: 1px solid rgba(62, 113, 181, .2); color: #3e6fb3; }
.metrics-field-name { font-size: 13px; font-weight: 700; color: #243b5c; }
.metrics-field-star { display: inline-flex; justify-self: end; width: 28px; height: 28px; align-items: center; justify-content: center; border-radius: 8px; border: 1px solid #dfe6ef; color: #f1645a; background: rgba(255,255,255,.6); }
.metrics-field-star.empty { color: #73839a; }
.metrics-add-field { width: 100%; border: 1px dashed #b8c8dc; border-radius: 10px; background: rgba(247,250,253,.9); color: #4981c3; font-weight: 700; padding: 12px; margin-top: 16px; cursor: pointer; }
.metrics-modal-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px 18px; border-top: 1px solid #eaf0f5; }
.metrics-modal-footer .heading-actions { margin-left: auto; }

.filters { display: flex; gap: 10px; margin: 0 0 20px; flex-wrap: wrap; }
.input, .select, .textarea {
  width: 100%; border: 1px solid #dfe6ef; border-radius: 8px; padding: 10px 12px; background: #fff;
  color: var(--ink); font-size: 12px; transition: border-color .16s;
}
.input:focus, .select:focus, .textarea:focus { border-color: #75abe0; outline: none; box-shadow: 0 0 0 3px rgba(86,154,218,.11); }
.input::placeholder, .textarea::placeholder { color: #a3adbb; }
.search-wrap { position: relative; width: min(340px, 100%); }
.search-wrap .input { padding-left: 34px; }
.search-icon { position: absolute; top: 9px; left: 12px; color: #8997aa; font-size: 14px; }
.filter-select { width: auto; min-width: 146px; }
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 17px; }
.project-card, .panel, .phase-card, .tool-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
}
.project-card { padding: 19px; cursor: pointer; transition: .18s ease; display: flex; flex-direction: column; min-height: 240px; }
.project-card:hover { transform: translateY(-2px); border-color: #c6dced; box-shadow: 0 7px 24px rgba(22,42,68,.09); }
.project-card-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.project-title { font: 700 15px "Manrope",sans-serif; line-height: 1.45; margin: 0 0 10px; }
.project-desc { font-size: 12px; color: #65748b; line-height: 1.7; margin: 13px 0 18px; }
.project-card-footer { margin-top: auto; padding-top: 12px; border-top: 1px solid #edf0f4; display: flex; align-items: center; justify-content: space-between; color: var(--muted-2); font-size: 10px; }
.project-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { border-radius: 5px; padding: 4px 8px; background: #eef3f8; color: #60718a; font-size: 9px; font-weight: 700; letter-spacing: .25px; text-transform: uppercase; }
.badge-status { background: #e8f6ef; color: #218357; }
.badge-phase { background: #f0ebfb; color: #7453bc; }
.card-open { color: var(--blue); font-size: 11px; font-weight: 700; }
.empty-state { padding: 56px 20px; text-align: center; border: 1px dashed #d6e0eb; border-radius: 12px; background: rgba(255,255,255,.55); }
.empty-icon { display: block; font-size: 27px; margin-bottom: 12px; }
.empty-state h3 { margin-bottom: 7px; }
.empty-state p { color: var(--muted); font-size: 12px; margin-bottom: 17px; }
.overview-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(260px, .55fr); gap: 15px; margin-bottom: 29px; }
.overview-summary { padding: 21px 23px; display: grid; grid-template-columns: 1.5fr 1fr; gap: 30px; align-items: center; }
.field-label { display: block; color: #8693a5; font-size: 9px; font-weight: 700; letter-spacing: .7px; text-transform: uppercase; margin-bottom: 8px; }
.overview-summary p { margin: 0; font-size: 12px; color: #52627a; line-height: 1.75; }
.status-card { padding: 19px 21px; display: flex; flex-direction: column; justify-content: center; }
.status-title { font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.status-dot { display: inline-block; width: 8px; height: 8px; background: var(--blue); border-radius: 50%; margin-right: 7px; }
.status-date { color: var(--muted-2); font-size: 10px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; margin: 0 0 13px; }
.phase-grid { display: grid; grid-template-columns: repeat(5, minmax(140px, 1fr)); gap: 11px; margin-bottom: 29px; }
.phase-card { padding: 15px; min-height: 177px; display: flex; flex-direction: column; transition: .16s; cursor: pointer; }
.phase-card:hover, .phase-card.active { border-color: #84b6e5; box-shadow: 0 0 0 1px #84b6e5, var(--shadow); }
.phase-card.active { border-top: 3px solid var(--phase-color); }
.phase-card-header { display: flex; justify-content: space-between; align-items: center; }
.phase-card-title { font: 700 14px "Manrope", sans-serif; }
.phase-check { color: var(--green); font-size: 13px; }
.phase-card-desc { color: var(--muted); font-size: 10px; line-height: 1.5; margin: 11px 0 13px; min-height: 29px; }
.phase-card-meta { margin-top: auto; display: flex; justify-content: space-between; align-items: center; color: #91a0b2; font-size: 10px; }
.phase-card .button { margin-top: 12px; width: 100%; }
.tool-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; }
.tool-card { min-height: 135px; padding: 18px; }
.tool-card h3 { margin-bottom: 8px; }
.tool-card p { color: var(--muted); font-size: 11px; line-height: 1.6; margin: 0; }
.phase-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 19px; }
.phase-title-wrap { display: flex; align-items: center; gap: 12px; }
.phase-swatch { width: 44px; height: 44px; flex: 0 0 44px; display: grid; place-items: center; border: 3px solid var(--phase-color); border-radius: 10px; background: var(--phase-soft); color: var(--phase-color); font: 700 20px "Work Sans",sans-serif; }
.phase-head h1 { margin: 0 0 4px; font-size: 22px; }
.phase-head .subtitle { font-size: 11px; }
.project-active-tag { border-radius: 20px; padding: 5px 9px; background: #e6f5eb; color: #2a8e5b; font-size: 9px; font-weight: 700; letter-spacing: .35px; text-transform: uppercase; }
.tabs-scroll { border-bottom: 3px solid var(--phase-color); overflow: visible; margin-bottom: 19px; }
.tabs { display: flex; flex-wrap: wrap; min-width: 0; gap: 3px; }
.tab {
  border: 1px solid transparent; border-bottom: 0; background: none; padding: 11px 13px 12px; color: #5d6b80;
  font-size: 11px; cursor: pointer; border-radius: 8px 8px 0 0; white-space: nowrap;
}
.tab:hover { color: var(--blue); background: #f8fbfe; }
.tab.active { border: 1px solid var(--phase-color); border-bottom: 0; background: #fff; color: var(--phase-color); font-weight: 700; position: relative; }
.tab.active::after { content: ""; position: absolute; bottom: -3px; left: 0; right: 0; height: 3px; background: var(--phase-color); }
.workspace { min-height: 375px; padding: 22px; }
.process-map-workspace { display: grid; gap: 12px; padding: 17px; }
.process-map-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.process-map-toolbar h2 { margin: 0 0 4px; font-size: 15px; }
.process-map-toolbar p { margin: 0; color: var(--muted); font-size: 11px; }
.bpmn-editor { width: 100%; height: min(68vh, 760px); min-height: 500px; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
#bpmn-editor-status { min-height: 14px; }
.process-map-workspace .autosave-hint { margin: 0; }
.workspace-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 19px; }
.workspace-head h2 { margin-bottom: 5px; font-size: 15px; }
.workspace-head p { margin: 0; color: var(--muted); font-size: 11px; }
.record-count { color: var(--muted); font-size: 10px; background: #f1f4f8; padding: 5px 8px; border-radius: 6px; white-space: nowrap; }
.records-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.records-table th { text-align: left; padding: 10px 11px; background: #f5f8fb; color: #75849a; font-size: 9px; letter-spacing: .4px; text-transform: uppercase; }
.records-table th:first-child { border-radius: 6px 0 0 6px; }
.records-table th:last-child { border-radius: 0 6px 6px 0; }
.records-table td { border-bottom: 1px solid #edf0f4; padding: 12px 11px; vertical-align: top; color: #42536a; line-height: 1.55; }
.records-table tr:last-child td { border-bottom: 0; }
.record-title { color: #21344d; font-weight: 700; }
.record-detail { display: block; color: #8a97a8; font-size: 10px; margin-top: 3px; max-width: 540px; }
.record-actions { text-align: right; white-space: nowrap; }
.text-action { border: 0; background: none; color: var(--blue); font-size: 10px; font-weight: 700; cursor: pointer; padding: 4px; }
.text-action.delete { color: #bf6870; }
.records-empty { border: 1px dashed #dbe3ec; border-radius: 9px; margin-top: 4px; padding: 38px 15px; text-align: center; color: var(--muted); font-size: 11px; }
.records-empty strong { display: block; color: #4e6077; margin-bottom: 5px; }
.tab-notes { border-top: 1px solid #edf0f4; margin-top: 19px; padding-top: 16px; }
.tab-notes label { display: block; margin-bottom: 8px; color: #75849a; font-size: 10px; font-weight: 700; }
.tab-notes .textarea { min-height: 68px; resize: vertical; font-size: 11px; }
.autosave-hint { font-size: 9px; color: #99a5b4; margin-top: 6px; }
.progress-track { height: 5px; background: #eef1f5; border-radius: 8px; overflow: hidden; margin-top: 7px; }
.progress-track span { height: 100%; display: block; border-radius: inherit; background: var(--phase-color); }
.define-workspace { min-height: 475px; padding: 25px 27px 29px; }
.define-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.define-heading h2 { margin: 0 0 4px; font-size: 16px; }
.define-heading p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.charter-sheet { border: 1px solid var(--line); border-radius: 8px; padding: 17px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.charter-field { padding: 14px 13px; border-bottom: 1px solid #edf0f4; min-width: 0; font-size: 12px; line-height: 1.65; }
.charter-field:nth-last-child(-n+3) { border-bottom: 0; }
.charter-field > div { color: #31445d; white-space: pre-wrap; overflow-wrap: anywhere; }
.charter-wide { grid-column: 1 / -1; }
.charter-wide:nth-child(3) { background: #eef7ff; border-left: 3px solid #55a2e5; border-radius: 5px; margin: 5px 0; }
.stakeholder-layout { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(250px, .8fr); gap: 18px; align-items: start; }
.stakeholder-matrix { min-height: 426px; padding: 12px; border: 1px solid var(--line); border-radius: 9px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(180px, auto)); gap: 12px; }
.stakeholder-quadrant { border: 1px dashed #d6e1eb; border-radius: 8px; padding: 14px; min-width: 0; transition: border-color .16s ease, box-shadow .16s ease; }
.stakeholder-quadrant.drop-active, .stakeholder-bench.drop-active { border-color: #438fd0; box-shadow: inset 0 0 0 2px rgba(67,143,208,.17); }
.quadrant-title { color: #36516d; font-size: 10px; font-weight: 800; letter-spacing: .55px; text-transform: uppercase; }
.quadrant-subtitle { margin: 4px 0 12px; font-size: 9px; color: #8996a7; }
.quadrant-satisfied { background: #fff9ee; border-color: #f2d59f; }
.quadrant-satisfied .quadrant-title { color: #ac6725; }
.quadrant-manage { background: #effcf4; border-color: #a1dfb6; }
.quadrant-manage .quadrant-title { color: #27845a; }
.quadrant-informed { background: #eef8ff; border-color: #a8d7fa; }
.quadrant-informed .quadrant-title { color: #3379b3; }
.quadrant-monitor { background: #f6f8fa; }
.stakeholder-cards { display: grid; align-content: start; gap: 8px; }
.stakeholder-card { display: flex; justify-content: space-between; align-items: flex-start; gap: 6px; background: #fff; padding: 10px; border: 1px solid #e6ebf0; border-radius: 7px; box-shadow: 0 2px 4px rgba(20,40,63,.04); }
.stakeholder-card[draggable="true"] { cursor: grab; }
.stakeholder-card[draggable="true"]:active { cursor: grabbing; }
.stakeholder-card strong, .stakeholder-card span, .stakeholder-card small { display: block; }
.stakeholder-card strong { font-size: 10px; line-height: 1.5; }
.stakeholder-card span, .stakeholder-card small { font-size: 9px; color: var(--muted); margin-top: 3px; line-height: 1.5; }
.stakeholder-actions { display: flex; }
.stakeholder-actions .text-action { padding: 2px; }
.quadrant-empty { display: block; margin-top: 30px; text-align: center; color: #a2adba; font-size: 9px; pointer-events: none; }
.stakeholder-side { display: grid; gap: 12px; }
.stakeholder-bench { min-height: 150px; border: 1px dashed #c8d5e2; transition: border-color .16s ease, box-shadow .16s ease; }
.stakeholder-bench .stakeholder-cards { margin-top: 12px; min-height: 44px; }
.side-card, .define-subpanel { border: 1px solid var(--line); border-radius: 8px; padding: 15px; background: #fff; box-shadow: 0 2px 4px rgba(20,40,63,.035); }
.side-card > h3 { margin-bottom: 6px; }
.side-card > p { margin: 0 0 12px; color: var(--muted); font-size: 10px; }
.side-card .section-heading { gap: 8px; margin-bottom: 12px; }
.communication-list { display: grid; gap: 7px; }
.communication-row { display: grid; grid-template-columns: minmax(0,1fr) auto auto; gap: 4px; align-items: start; padding: 9px 0; border-top: 1px solid #edf0f4; }
.communication-row strong, .communication-row span { display: block; }
.communication-row strong { font-size: 10px; }
.communication-row span { margin-top: 3px; color: var(--muted); font-size: 9px; }
.muted-small { font-size: 10px; color: var(--muted); }
.sipoc-board { display: grid; grid-template-columns: repeat(5, minmax(130px, 1fr)); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.sipoc-column { min-height: 286px; display: flex; flex-direction: column; padding: 9px; border-right: 1px solid var(--line); background: #fff; }
.sipoc-column:last-child { border-right: 0; }
.sipoc-column header { text-align: center; margin: -9px -9px 9px; padding: 14px 7px 11px; background: #f5f8fb; }
.sipoc-column header strong, .sipoc-column header span { display: block; }
.sipoc-column header strong { color: #3879ba; font-size: 10px; text-transform: uppercase; }
.sipoc-column header span { color: #94a0b0; font-size: 9px; margin-top: 4px; }
.sipoc-process header { background: #edf8ff; }
.sipoc-process header strong { color: #288060; }
.sipoc-outputs header strong { color: #ca6837; }
.sipoc-customers header strong { color: #b54848; }
.sipoc-items { display: grid; align-content: start; gap: 6px; }
.sipoc-item { min-height: 37px; display: flex; align-items: center; justify-content: space-between; gap: 4px; padding: 8px; background: #fff; border: 1px solid #e7ecf2; border-radius: 6px; box-shadow: 0 1px 3px rgba(20,40,63,.04); font-size: 10px; line-height: 1.5; }
.sipoc-item .text-action { flex: 0 0 auto; }
.sipoc-add { margin-top: auto; border: 0; background: #f5f8fb; padding: 8px 5px; color: #79899e; text-align: left; font-size: 9px; cursor: pointer; }
.sipoc-add:hover { color: var(--blue); background: #eef6ff; }
.define-subpanel { margin-bottom: 15px; }
.define-subpanel .section-heading { margin-bottom: 11px; }
.define-subpanel .section-heading h3 { margin-bottom: 4px; }
.segment-chips { display: flex; gap: 7px; flex-wrap: wrap; }
.segment-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; color: #6651a0; border-radius: 18px; background: #f0ebff; font-size: 9px; font-weight: 700; }
.segment-chip button { border: 0; background: transparent; color: #73618e; cursor: pointer; font-size: 14px; line-height: 1; }
.define-table-wrap { border: 1px solid var(--line); border-radius: 7px; overflow-x: auto; }
.define-wide-table { min-width: 760px; }
.define-wide-table th { white-space: nowrap; }
.define-wide-table td { font-size: 10px; }
.affinity-toolbar { display: grid; grid-template-columns: 1.7fr 1fr; gap: 16px; margin-bottom: 17px; padding: 14px; background: #eef8ff; border: 1px solid #b8daf5; border-radius: 7px; }
.inline-add-form label { display: block; margin-bottom: 7px; font-size: 10px; font-weight: 700; }
.inline-add-form > div { display: flex; gap: 7px; }
.inline-add-form .input { min-width: 0; }
.affinity-board { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; align-items: stretch; }
.affinity-column { min-height: 235px; padding: 12px; border: 1px solid var(--line); border-radius: 7px; background: #fff; box-shadow: 0 2px 4px rgba(20,40,63,.04); transition: border-color .15s, background .15s; }
.affinity-uncategorized { background: #f6f8fa; }
.affinity-column.drop-active { border: 2px dashed #72aee2; background: #eff7ff; }
.affinity-column header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; color: #3a6fa9; font-size: 10px; font-weight: 700; }
.affinity-column header i { font-style: normal; color: #8292a5; font-weight: 500; }
.affinity-card { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 9px; margin-bottom: 7px; border: 1px solid #e4ebf3; border-radius: 6px; background: #fff; color: #45566d; font-size: 10px; line-height: 1.55; cursor: grab; box-shadow: 0 1px 3px rgba(20,40,63,.035); }
.affinity-card:active { cursor: grabbing; }
.affinity-card .text-action { flex: 0 0 auto; padding: 0 3px; }
.affinity-drop-hint { display: grid; min-height: 150px; place-items: center; color: #a0adbb; font-size: 9px; }
.ctq-canvas { min-height: 390px; overflow: auto; display: grid; place-items: center; padding: 28px 15px; background-color: #f7fafc; background-image: radial-gradient(#dfe7ef .8px, transparent .8px); background-size: 16px 16px; border: 1px dashed #dce5ee; border-radius: 7px; }
.ctq-tree, .ctq-tree ul { --ctq-gap: 26px; display: flex; justify-content: center; position: relative; gap: var(--ctq-gap); list-style: none; margin: 0; padding: 24px 0 0; }
.ctq-tree { padding-top: 0; }
.ctq-tree ul::before { content: ""; position: absolute; top: 0; left: 50%; height: 24px; border-left: 2px solid #9aabbd; }
.ctq-tree-node { position: relative; display: flex; flex-direction: column; align-items: center; padding: 24px 5px 0; }
.ctq-tree > .ctq-tree-node { padding-top: 0; }
.ctq-tree-node::before, .ctq-tree-node::after { content: ""; position: absolute; top: 0; right: 50%; width: calc(50% + var(--ctq-gap) / 2); border-top: 2px solid #9aabbd; }
.ctq-tree-node::after { right: auto; left: 50%; height: 24px; border-left: 2px solid #9aabbd; }
.ctq-tree-node:first-child::before, .ctq-tree-node:last-child::after { border-top: 0; }
.ctq-tree > .ctq-tree-node::before, .ctq-tree > .ctq-tree-node::after { display: none; }
.ctq-tree-node > ul > .ctq-tree-node:only-child::before { display: none; }
.ctq-node { width: 215px; min-height: 78px; padding: 10px; border: 1px solid #76b7f0; border-top: 3px solid #398bd0; border-radius: 4px; background: #fff; box-shadow: 0 1px 3px rgba(20,40,63,.04); }
.ctq-driver { border-color: #cbb7ef; border-top-color: #8d61d5; }
.ctq-ctq { border-color: #a6dfb8; border-top-color: #38a765; }
.ctq-node-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; }
.ctq-kind { display: inline-block; padding: 2px 5px; border-radius: 2px; background: #e2f2ff; color: #347cb9; font-size: 8px; font-weight: 800; }
.ctq-driver .ctq-kind { background: #f0eaff; color: #7853bd; }
.ctq-ctq .ctq-kind { background: #e7f8ec; color: #338451; }
.ctq-node-actions { display: flex; }
.ctq-node-actions .text-action { padding: 1px 3px; }
.ctq-node strong { display: block; color: #29394f; font-size: 10px; line-height: 1.5; overflow-wrap: anywhere; }
.ctq-form-level { display: flex; align-items: center; justify-content: space-between; padding: 9px 10px; border-radius: 6px; background: #f3f7fb; color: #61738a; font-size: 10px; text-transform: uppercase; }
.ctq-form-level strong { color: #7957c8; font-size: 10px; }
.risk-score { display: inline-block; padding: 4px 6px; border-radius: 4px; font-size: 9px; font-weight: 800; white-space: nowrap; }
.risk-low { background: #e7f5ec; color: #32734c; }
.risk-medium { background: #fff0d7; color: #9d6520; }
.risk-high { background: #ffdfcf; color: #ab4f28; }
.risk-critical { background: #fae0e3; color: #b13e4b; }
.evidence-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.evidence-card { overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: #fff; box-shadow: 0 2px 5px rgba(20,40,63,.05); }
.evidence-card-open { cursor: pointer; transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
.evidence-card-open:hover, .evidence-card-open:focus-visible { transform: translateY(-2px); border-color: #a9cdec; box-shadow: 0 7px 18px rgba(20,40,63,.1); }
.evidence-preview { height: 105px; position: relative; display: grid; place-items: center; background: #edf2f7; color: #9aaabd; font-size: 30px; }
.evidence-preview span { position: absolute; right: 9px; bottom: 8px; padding: 5px 7px; border-radius: 5px; background: rgba(255,255,255,.92); color: #467caf; font-size: 9px; font-weight: 700; opacity: 0; transition: opacity .16s ease; }
.evidence-card-open:hover .evidence-preview span, .evidence-card-open:focus-visible .evidence-preview span { opacity: 1; }
.evidence-card-content { padding: 12px; }
.evidence-card-content h3 { margin-bottom: 5px; font-size: 11px; }
.evidence-card-content p { min-height: 30px; margin: 0 0 7px; color: var(--muted); font-size: 9px; line-height: 1.5; }
.evidence-actions { display: flex; gap: 8px; margin-top: 8px; }
.evidence-detail-body { gap: 0; padding: 0; }
.evidence-detail-image { display: block; max-width: 100%; max-height: min(58vh, 600px); margin: 0 auto; object-fit: contain; background: #f4f7fa; }
.evidence-detail-pdf { display: block; width: 100%; height: min(64vh, 720px); min-height: 280px; border: 0; background: #f4f7fa; }
.evidence-detail-file, .evidence-detail-empty { min-height: 160px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 22px; background: #f4f7fa; text-align: center; }
.evidence-detail-file > span { color: #8fa2b8; font-size: 32px; }
.evidence-detail-file > strong { color: #40536b; font-size: 12px; overflow-wrap: anywhere; }
.evidence-detail-file > p { margin: 0; color: var(--muted); font-size: 10px; }
.evidence-detail-empty { color: var(--muted); font-size: 11px; }
.evidence-detail-meta { padding: 18px 22px; }
.evidence-detail-meta p { margin: 0 0 13px; color: #455770; font-size: 11px; line-height: 1.65; overflow-wrap: anywhere; }
.report-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.report-toolbar h2 { margin: 4px 0; font-size: 20px; }
.report-toolbar p { margin: 0; color: var(--muted); font-size: 10px; }
.define-report { width: min(820px, 100%); margin: 0 auto; padding: 35px 42px; border: 1px solid var(--line); background: #fff; box-shadow: var(--shadow); }
.report-title { padding-bottom: 17px; border-bottom: 2px solid #4088c8; text-align: center; }
.report-title h1 { margin: 8px 0 4px; font-size: 23px; }
.report-title p { margin: 0; color: #63738b; font-size: 11px; }
.report-section { margin-top: 21px; }
.report-section h3 { margin: 0 0 10px; padding-left: 9px; border-left: 3px solid #4088c8; font-size: 12px; }
.report-section p, .report-section li { color: #465970; font-size: 10px; line-height: 1.6; }
.report-section ul { padding-left: 19px; }
.report-definitions { display: grid; gap: 0; margin: 0; }
.report-definitions > div { display: grid; grid-template-columns: 150px 1fr; padding: 7px 8px; border-bottom: 1px solid #edf0f3; font-size: 9px; line-height: 1.5; }
.report-definitions dt { color: #738198; font-weight: 700; }
.report-definitions dd { margin: 0; color: #394d65; white-space: pre-wrap; }
.report-sipoc { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); border: 1px solid var(--line); }
.report-sipoc > div { padding: 8px; border-right: 1px solid var(--line); font-size: 9px; }
.report-sipoc > div:last-child { border: 0; }
.report-sipoc strong { color: #467caf; text-transform: uppercase; }
.report-sipoc ul { padding-left: 13px; }
.report-sipoc li { font-size: 8px; }
.settings-page { min-height: calc(100vh - 130px); }
.settings-title { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.settings-title h1 { margin: 0; font-size: 22px; }
.settings-active-badge { padding: 4px 8px; border-radius: 5px; background: #e5f6ec; color: #258454; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.settings-tabs { display: flex; flex-wrap: wrap; gap: 3px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.settings-tab { flex: 0 0 auto; padding: 10px 13px; border: 1px solid transparent; border-bottom: 0; border-radius: 7px 7px 0 0; background: transparent; color: #53647a; cursor: pointer; font-size: 11px; }
.settings-tab:hover { color: #007256; background: #f8fbf9; }
.settings-tab.active { position: relative; bottom: -1px; border-color: var(--line); background: #fff; color: #007256; }
.settings-content { min-height: 480px; padding: 0 13px 30px; }
.settings-form { display: grid; gap: 18px; width: min(530px, 100%); padding: 0; }
.settings-form .form-field { display: grid; gap: 6px; }
.settings-form .form-field label, .settings-field-label { margin: 0; color: #34455b; font-size: 11px; font-weight: 700; }
.settings-form .input, .settings-form .select { min-height: 39px; }
.phase-color-settings { display: grid; gap: 10px; }
.phase-color-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.phase-color-field { display: grid; gap: 6px; }
.phase-color-field label { color: #34455b; font-size: 10px; font-weight: 700; }
.phase-color-field input[type="color"] { width: 100%; height: 38px; padding: 3px; border: 1px solid var(--line); border-radius: 6px; background: #fff; cursor: pointer; }
.settings-help, .profile-photo-row p, .settings-section-heading p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.profile-photo-field { display: grid; gap: 9px; margin-bottom: 1px; }
.profile-photo-row { display: flex; align-items: center; gap: 13px; }
.profile-photo-row > div:last-child { display: grid; gap: 6px; justify-items: start; }
.profile-photo { width: 72px; height: 72px; display: grid; place-items: center; overflow: hidden; border-radius: 50%; background: #007256; color: #fff; font: 700 25px "Work Sans", sans-serif; }
.profile-photo img, .avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.settings-form > .button { justify-self: start; }
.settings-section-heading { display: grid; gap: 5px; margin: 0 0 5px; }
.settings-section-heading h2, .settings-coming-soon h2 { font-size: 16px; }
.settings-coming-soon { display: grid; justify-items: start; gap: 10px; width: min(530px, 100%); padding: 24px 0; }
.settings-coming-soon p { max-width: 420px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.settings-coming-icon { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 10px; background: #eaf4f0; color: #007256; font-size: 20px; }
.modal { border: 0; border-radius: 14px; padding: 0; width: min(540px, calc(100vw - 28px)); max-height: min(88vh, 760px); box-shadow: 0 20px 80px rgba(13,27,48,.25); color: var(--ink); }
.modal-evidence-pdf { width: min(1100px, calc(100vw - 28px)); max-height: 94vh; }
.modal::backdrop { background: rgba(15,29,49,.48); backdrop-filter: blur(2px); }
.modal-header { padding: 21px 23px 15px; border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; justify-content: space-between; }
.modal-header h2 { font-size: 16px; margin-bottom: 5px; }
.modal-header p { margin: 0; color: var(--muted); font-size: 11px; }
.modal-close { background: none; border: 0; color: #8190a2; font-size: 21px; cursor: pointer; }
.modal-body { padding: 18px 23px; display: grid; gap: 14px; }
.form-field label { display: block; margin-bottom: 6px; color: #62728a; font-size: 10px; font-weight: 700; }
.form-field .textarea { min-height: 83px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 9px; padding: 14px 23px 20px; }
.toast-region { position: fixed; right: 20px; bottom: 20px; z-index: 10; display: grid; gap: 8px; }
.toast { max-width: min(380px, calc(100vw - 40px)); padding: 12px 15px; border-radius: 10px; color: #fff; background: #1e3856; box-shadow: 0 8px 24px rgba(14,34,57,.23); font-size: 11px; animation: toast-in .18s ease-out; }
.toast.error { background: #a74747; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

@media (max-width: 980px) {
  .view-container { padding: 25px 22px 45px; }
  .phase-grid { grid-template-columns: repeat(3, minmax(140px, 1fr)); }
  .overview-grid { grid-template-columns: 1fr; }
  .stakeholder-layout { grid-template-columns: 1fr; }
  .sipoc-board { overflow-x: auto; }
  .sipoc-column { min-width: 138px; }
}
@media (max-width: 680px) {
  :root { --sidebar-width: 60px; }
  body.sidebar-expanded { --sidebar-width: 210px; }
  .sidebar { padding-top: 13px; }
  .brand { width: 40px; height: 40px; font-size: 34px; }
  .rail-phase, .rail-icon { width: 38px; height: 38px; border-radius: 10px; }
  .main-area { margin-left: var(--sidebar-width); }
  .topbar { height: 58px; padding: 0 12px; }
  .topbar-left { gap: 8px; }
  .topbar-right { gap: 8px; }
  .phase-color-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .wordmark { font-size: 13px; }
  .wordmark span, .topbar-divider, .save-status, .avatar { display: none; }
  .project-switcher { padding: 6px; gap: 5px; font-size: 11px; max-width: 160px; }
  #top-project-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-menu { display: none; }
  .view-container { padding: 21px 14px 35px; }
  .settings-content { padding: 0 4px 24px; }
  .page-heading { align-items: flex-start; flex-direction: column; margin-bottom: 18px; }
  .heading-actions { width: 100%; }
  .heading-actions .button { flex: 1; }
  .project-grid { grid-template-columns: 1fr; }
  .filters { display: grid; grid-template-columns: 1fr 1fr; }
  .search-wrap { width: 100%; grid-column: 1 / -1; }
  .filter-select { width: 100%; min-width: 0; }
  .overview-summary { grid-template-columns: 1fr; gap: 16px; }
  .phase-grid { grid-template-columns: 1fr 1fr; }
  .phase-card { min-height: 158px; padding: 12px; }
  .tool-grid { grid-template-columns: 1fr; }
  .phase-head { align-items: flex-start; }
  .phase-head .heading-actions { width: auto; }
  .phase-title-wrap { gap: 9px; }
  .phase-head h1 { font-size: 18px; }
  .phase-swatch { width: 38px; height: 38px; flex-basis: 38px; font-size: 18px; }
  .workspace { padding: 15px; min-height: 330px; }
  .process-map-workspace { padding: 11px; }
  .process-map-toolbar { align-items: flex-start; flex-direction: column; }
  .process-map-toolbar .heading-actions { flex-wrap: wrap; }
  .bpmn-editor { height: 62vh; min-height: 400px; }
  .workspace-head { align-items: flex-start; }
  .records-table, .records-table tbody, .records-table tr, .records-table td { display: block; width: 100%; }
  .records-table thead { display: none; }
  .records-table tr { border: 1px solid #e9edf2; border-radius: 8px; margin-bottom: 9px; padding: 7px 10px; }
  .records-table td { border: 0; padding: 5px 0; }
  .records-table td:not(:first-child):not(.record-actions) { font-size: 10px; }
  .record-actions { text-align: left; padding-top: 5px !important; }
}
@media (max-width: 420px) {
  :root { --sidebar-width: 52px; }
  body.sidebar-expanded { --sidebar-width: 200px; }
  .main-area { margin-left: var(--sidebar-width); }
  .sidebar-rule { margin-top: 17px; }
  .rail-phase, .rail-icon { width: 34px; height: 34px; }
  .phase-grid { grid-template-columns: 1fr; }
  .phase-card { min-height: 140px; }
  .form-grid { grid-template-columns: 1fr; }
  .filters { grid-template-columns: 1fr; }
  .search-wrap { grid-column: auto; }
  .define-workspace { padding: 16px 13px; }
  .define-heading, .report-toolbar { align-items: flex-start; flex-direction: column; }
  .define-heading .heading-actions, .report-toolbar .heading-actions { width: 100%; flex-wrap: wrap; }
  .charter-sheet { grid-template-columns: 1fr; padding: 10px; }
  .charter-field, .charter-wide { grid-column: auto; }
  .charter-field:nth-last-child(-n+3) { border-bottom: 1px solid #edf0f4; }
  .stakeholder-matrix { grid-template-columns: 1fr 1fr; grid-template-rows: auto; padding: 7px; }
  .stakeholder-quadrant { min-height: 150px; padding: 10px; }
  .affinity-toolbar { grid-template-columns: 1fr; }
  .affinity-board { grid-template-columns: 1fr; }
  .affinity-column { min-height: 135px; }
  .ctq-tree, .ctq-tree ul { --ctq-gap: 10px; }
  .ctq-node { width: 165px; }
  .report-toolbar .heading-actions { width: auto; }
  .define-report { padding: 22px 15px; }
  .report-sipoc { overflow-x: auto; grid-template-columns: repeat(5, minmax(95px, 1fr)); }
}
@media print {
  body { background: #fff; }
  .sidebar, .topbar, .phase-head, .tabs-scroll, .report-toolbar, .toast-region { display: none !important; }
  .main-area { margin: 0; }
  .view-container { max-width: none; padding: 0; }
  .workspace, .define-report { border: 0; box-shadow: none; width: 100%; padding: 0; }
  .report-section { break-inside: avoid; }
}

/* Sign-in screen */
.auth-screen { display: none; }
body.auth-required .app-shell { display: none; }
body.auth-required .auth-screen {
  display: grid; place-items: center; min-height: 100vh; padding: 24px 16px;
  background: radial-gradient(circle at 20% 0%, #e3efe9 0, transparent 45%), var(--canvas);
}
.auth-card {
  width: min(400px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow); padding: 30px 28px 24px;
}
.auth-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 24px; }
.auth-mark {
  width: 38px; height: 38px; border-radius: 11px; background: var(--nav); color: #fff; display: grid; place-items: center;
  padding-bottom: 3px; font: italic 700 30px/1 "Work Sans", sans-serif; letter-spacing: -2px;
}
.auth-card h1 { margin: 0 0 6px; font-size: 22px; }
.auth-card .subtitle { margin: 0 0 20px; }
.auth-form { display: grid; gap: 14px; }
.auth-form .input { width: 100%; min-height: 40px; }
.auth-submit { width: 100%; min-height: 41px; justify-content: center; }
.auth-error { margin: 0; min-height: 1em; color: #c23b3b; font-size: 12px; font-weight: 600; }
.auth-error:empty { min-height: 0; }
.auth-notice { margin: 0 0 16px; padding: 10px 12px; border-radius: 8px; background: var(--blue-soft); color: #2a5d93; font-size: 12px; }
.auth-switch { margin: 18px 0 0; color: var(--muted); font-size: 12px; text-align: center; }
.auth-switch .text-action { font-size: 12px; }

/* Project sharing */
.badge-shared { background: #e6f3f8; color: #23708f; }
.project-team { display: grid; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.project-team-head p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.team-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.team-list li { display: flex; align-items: center; gap: 9px; font-size: 13px; }
.team-avatar {
  width: 26px; height: 26px; flex: 0 0 26px; border-radius: 50%; background: #e8eef5; color: #43566e;
  display: grid; place-items: center; font-size: 11px; font-weight: 700;
}
.team-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.team-add { display: flex; gap: 8px; }
.team-add .input { flex: 1; min-width: 0; }
.account-password-form { margin-top: 28px; }

/* Administration */
.rail-icon[hidden] { display: none; }
.rail-icon.admin-link.active { background: rgba(255,255,255,.14); color: #fff; }
.admin-section { margin-bottom: 30px; }
.admin-badges { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-left: 8px; vertical-align: middle; }
.badge-disabled { background: #fdecec; color: #b43c3c; }
.admin-users-table .record-actions .text-action { margin-left: 8px; }
.checkbox-row { display: flex; align-items: center; gap: 9px; color: #34455b; font-size: 12px; cursor: pointer; }
.checkbox-row input { width: 16px; height: 16px; accent-color: var(--blue); }
.password-reveal { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: #f7f9fb; }
.password-reveal code { flex: 1; font: 600 16px/1.3 ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: .5px; overflow-wrap: anywhere; user-select: all; }
