/* GU Strategy Matrix — styling.
   Palette and layout sourced from the GUEd app brand guide (07/2025):
   Dark Navy #1E1A37 chrome, Bright Blue #008AF0 accent, slate neutrals,
   fixed left sidebar with the GU hex logo. */

:root {
  /* GU brand */
  --gu-navy: #1e1a37;        /* Dark Navy — sidebar, headers */
  --gu-navy-700: #2b2843;
  --gu-navy-900: #15122a;
  --gu-blue: #008af0;        /* Bright Blue — links, CTAs, focus */
  --gu-blue-dark: #0072c6;
  --gu-blue-soft: #e6f3fe;

  /* Surfaces (slate) */
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;

  /* Text */
  --ink: #0f172a;
  --ink-2: #475569;
  --ink-3: #94a3b8;

  /* Status */
  --track: #15803d;
  --track-bg: #dcfce7;
  --watch: #b45309;
  --watch-bg: #fef3c7;
  --risk: #b91c1c;
  --risk-bg: #fee2e2;
  --blocked: #475569;
  --blocked-bg: #e2e8f0;

  --sidebar-w: 256px;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.18);

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1 { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.015em; margin: 0; }
h3, h4 { margin: 0; }
a { color: inherit; text-decoration: none; }

/* ---------- Sidebar (GUEd layout) ---------- */

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  z-index: 40;
  display: flex;
  flex-direction: column;
  background: var(--gu-navy);
  color: #fff;
  overflow-y: auto;
}

.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 20px; }
.sidebar-brand img { display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-over { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.12em; color: rgba(255, 255, 255, 0.6); }
.brand-text strong { font-size: 1.05rem; font-weight: 600; letter-spacing: -0.01em; margin-top: 2px; }

.sidebar-nav { flex: 1; padding: 8px 12px; display: flex; flex-direction: column; gap: 22px; }
.nav-section { display: flex; flex-direction: column; gap: 3px; }
.nav-title {
  padding: 0 10px 4px;
  font-size: 0.64rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.45);
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.78);
  transition: background 0.15s, color 0.15s;
}
.nav-item .ico { font-size: 1.05rem; color: rgba(255, 255, 255, 0.6); }
.nav-item:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.nav-item.is-active { background: rgba(255, 255, 255, 0.14); color: #fff; }
.nav-item.is-active .ico { color: var(--gu-blue); }

.sidebar-foot { border-top: 1px solid rgba(255, 255, 255, 0.1); padding: 16px; }
.role-field { display: flex; flex-direction: column; gap: 6px; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: rgba(255, 255, 255, 0.55); }
.role-field select {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  padding: 8px 10px;
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
}
.role-field select option { color: #0f172a; }

/* Mobile chrome */
.mobile-toggle {
  position: fixed;
  left: 12px;
  top: 12px;
  z-index: 50;
  width: 38px;
  height: 38px;
  display: none;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--surface);
  cursor: pointer;
}
.mobile-toggle .bar { width: 16px; height: 2px; background: var(--ink); border-radius: 2px; }
.backdrop { position: fixed; inset: 0; z-index: 30; background: rgba(15, 23, 42, 0.35); }

/* ---------- Content ---------- */

.content-shift { padding-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.root { width: 100%; max-width: 1180px; margin: 0 auto; padding: 30px 28px 56px; flex: 1; }
.site-foot { border-top: 1px solid var(--line); padding: 18px; text-align: center; font-size: 0.74rem; color: var(--ink-3); }

.page-head { margin-bottom: 18px; }
.overline {
  margin: 0 0 5px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* ---------- Metrics ---------- */

.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.metric {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.metric span { display: block; font-size: 0.74rem; color: var(--ink-3); font-weight: 500; }
.metric strong { font-size: 1.7rem; font-weight: 700; letter-spacing: -0.02em; }
.metric-alert { border-color: #fbc4c4; background: var(--risk-bg); }
.metric-alert strong { color: var(--risk); }

/* ---------- Controls ---------- */

.controls { margin-bottom: 18px; }

/* Faceted multi-select search */
.facet-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 12px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  min-height: 46px;
}
.facet-search:focus-within { outline: 2px solid var(--gu-blue); outline-offset: -1px; border-color: var(--gu-blue); }
.facet-search > .ico { color: var(--ink-3); flex: 0 0 auto; }

.facet-tokens { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; flex: 1; min-width: 0; }
.facet-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px 4px 10px;
  border-radius: 7px;
  background: var(--gu-blue-soft);
  border: 1px solid #bfe3fc;
  color: var(--gu-blue-dark);
  font-size: 0.78rem;
  font-weight: 500;
  white-space: nowrap;
}
.facet-chip em { font-style: normal; font-weight: 600; opacity: 0.7; margin-right: 2px; }
.facet-x {
  border: none;
  background: rgba(0, 138, 240, 0.14);
  color: var(--gu-blue-dark);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.8rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.facet-x:hover { background: var(--gu-blue); color: #fff; }

.facet-input {
  flex: 1;
  min-width: 160px;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font);
  font-size: 0.88rem;
  color: var(--ink);
  padding: 4px 2px;
}
.facet-reset {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-3);
  cursor: pointer;
}
.facet-reset:hover { background: var(--surface-2); color: var(--ink); }

.facet-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 30;
  max-height: 320px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 6px;
}
.facet-group { padding: 4px 0; }
.facet-group + .facet-group { border-top: 1px solid var(--line); margin-top: 2px; }
.facet-group-title {
  display: block;
  padding: 4px 10px;
  font-size: 0.66rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-3);
}
.facet-option {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  text-align: left;
  padding: 7px 10px;
  border: none;
  border-radius: 7px;
  background: transparent;
  font-family: var(--font);
  font-size: 0.85rem;
  color: var(--ink);
  cursor: pointer;
}
.facet-option:hover { background: var(--gu-blue-soft); color: var(--gu-blue-dark); }
.facet-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; background: var(--ink-3); }
.dot-status { background: #6366f1; }
.dot-department { background: #0ea5e9; }
.dot-brand { background: var(--gu-blue); }
.dot-tag { background: #14b8a6; }

/* ---------- Matrix ---------- */

.matrix-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.matrix { display: flex; flex-direction: column; }
.matrix-head, .matrix-row { display: grid; grid-template-columns: 248px 270px minmax(0, 1fr); }
.matrix-head {
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.matrix-head .head { padding: 12px 16px; }
.cell-init-track.head { display: flex; align-items: center; justify-content: space-between; }
.head-hint { font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--ink-3); }

.matrix-row { border-bottom: 1px solid var(--line); }
.matrix-row:last-child { border-bottom: none; }
.matrix-row:hover { background: #fcfdff; }

.cell-strategy {
  padding: 16px;
  border-right: 1px solid var(--line);
  border-left: 4px solid var(--accent, var(--gu-navy));
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.strategy-top { display: flex; align-items: center; gap: 8px; }
.strategy-num { font-size: 0.78rem; font-weight: 700; color: var(--accent, var(--ink-3)); }
.type-tag {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-3);
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding: 2px 7px;
  border-radius: 20px;
}
.cell-strategy h3 { font-size: 1.05rem; font-weight: 700; letter-spacing: -0.01em; }
.meta-line { font-size: 0.76rem; color: var(--ink-2); }

.tag-row { display: flex; flex-wrap: wrap; gap: 4px; }
.chip {
  font-size: 0.68rem;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink-2);
}
.chip-brand { background: var(--gu-blue-soft); border-color: #bfe3fc; color: var(--gu-blue-dark); }

.progress { height: 5px; border-radius: 20px; background: var(--line); overflow: hidden; margin-top: 2px; }
.progress-bar { height: 100%; border-radius: 20px; background: var(--accent, var(--gu-blue)); }
.progress-label { font-size: 0.68rem; color: var(--ink-3); }

/* Strategic imperatives column */
.cell-imperatives {
  padding: 14px;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}
.imp-list { display: flex; flex-direction: column; gap: 8px; }
.imp-card {
  display: flex;
  gap: 9px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent, var(--gu-navy));
  border-radius: var(--radius);
  padding: 10px 11px;
}
.imp-num {
  flex: 0 0 auto;
  width: 19px;
  height: 19px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--ink-2);
}
.imp-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.imp-card p { margin: 0; font-size: 0.78rem; line-height: 1.45; color: var(--ink); }
.imp-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.imp-tools { display: flex; flex-direction: column; align-items: center; gap: 3px; flex: 0 0 auto; }
.imp-tools .handle-btn { width: 22px; height: 14px; }
.imp-tools .icon-btn { width: 24px; height: 24px; margin-top: 2px; }
.imp-empty { color: var(--ink-3); font-size: 0.8rem; padding: 6px 2px; }
.imp-add {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink-2);
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
}
.imp-add:hover { border-color: var(--gu-blue); color: var(--gu-blue); background: var(--gu-blue-soft); }
.form-hint { font-size: 0.82rem; color: var(--ink-3); margin: 4px 0 0; }

.wwh-row { display: flex; flex-wrap: wrap; gap: 5px; margin: 1px 0 1px; }
.wwh-btn {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: var(--surface);
  font-family: var(--font);
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.wwh-btn:hover { border-color: var(--gu-blue); background: var(--gu-blue-soft); color: var(--gu-blue-dark); }
.wwh-btn.subtle { font-weight: 500; color: var(--ink-2); }

.cell-init-track { padding: 14px; }
.init-strip { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 12px; }

.init-card {
  flex: 1 1 210px;
  max-width: 280px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.init-card-top { display: flex; align-items: center; justify-content: space-between; }
.init-card h4 { font-size: 0.88rem; font-weight: 600; line-height: 1.25; }
.init-card p { margin: 0; font-size: 0.76rem; color: var(--ink-2); line-height: 1.45; }
.init-meta { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.init-custom { margin: 4px 0 0; display: flex; flex-direction: column; gap: 3px; }
.init-custom div { display: flex; justify-content: space-between; gap: 8px; font-size: 0.7rem; }
.init-custom dt { color: var(--ink-3); margin: 0; }
.init-custom dd { margin: 0; color: var(--ink); font-weight: 500; text-align: right; }

.status-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.status-dot.is-track { background: var(--track); }
.status-dot.is-watch { background: var(--watch); }
.status-dot.is-risk { background: var(--risk); }
.status-dot.is-blocked { background: var(--blocked); }

.init-add {
  flex: 1 1 150px;
  max-width: 200px;
  min-height: 88px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink-2);
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.init-add:hover { border-color: var(--gu-blue); color: var(--gu-blue); background: var(--gu-blue-soft); }
.init-empty { color: var(--ink-3); font-size: 0.8rem; align-self: center; padding: 12px; }

.status-pill {
  display: inline-flex;
  align-items: center;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 20px;
  align-self: flex-start;
}
.status-pill.is-track { background: var(--track-bg); color: var(--track); }
.status-pill.is-watch { background: var(--watch-bg); color: var(--watch); }
.status-pill.is-risk { background: var(--risk-bg); color: var(--risk); }
.status-pill.is-blocked { background: var(--blocked-bg); color: var(--blocked); }

.empty { padding: 48px; text-align: center; color: var(--ink-2); }
.empty strong { display: block; margin-bottom: 4px; }
.empty p { margin: 0; color: var(--ink-3); font-size: 0.85rem; }

/* ---------- Icon buttons ---------- */

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
  transition: all 0.15s;
}
.icon-btn:hover { border-color: var(--gu-blue); color: var(--gu-blue); background: var(--gu-blue-soft); }
.strategy-top .icon-btn { margin-left: auto; }

/* ---------- Popover ---------- */

.popover-layer { position: absolute; inset: 0; z-index: 60; pointer-events: none; }
.popover {
  position: absolute;
  width: 320px;
  max-width: calc(100vw - 24px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  overflow: hidden;
}
.popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  border-left: 4px solid var(--accent, var(--gu-navy));
}
.popover-head strong { font-size: 0.85rem; font-weight: 600; }
.popover-body { padding: 14px; font-size: 0.85rem; color: var(--ink); line-height: 1.55; max-height: 60vh; overflow-y: auto; }
.popover-body p { margin: 0; }
.popover-body ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.pop-custom { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.pop-custom div { display: flex; flex-direction: column; }
.pop-custom dt { font-size: 0.7rem; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.04em; }
.pop-custom dd { margin: 0; }

/* ---------- Forms ---------- */

.form-page { max-width: 860px; }
.form-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: 0.78rem; font-weight: 500; color: var(--ink-3); margin-bottom: 8px; }
.back-link:hover { color: var(--gu-blue); }
.form-sub { margin: 6px 0 0; font-size: 0.85rem; color: var(--ink-2); }
.form-head-actions { display: flex; gap: 10px; flex: 0 0 auto; }

.btn-primary {
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius);
  background: var(--gu-blue);
  color: #fff;
  font-family: var(--font);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.btn-primary:hover { background: var(--gu-blue-dark); }
.btn-danger {
  padding: 10px 18px;
  border: 1px solid #fbc4c4;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--risk);
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}
.btn-danger:hover { background: var(--risk-bg); }

.form-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 0.78rem; font-weight: 600; color: var(--ink-2); }
.field.span-2 { grid-column: span 2; }
.field.full { display: block; margin-bottom: 18px; }
.field.full textarea { margin-top: 6px; }
.field input, .field select, .field textarea, .form-page input[type="text"] {
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--ink);
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  width: 100%;
}
.field input[type="color"] { height: 40px; padding: 4px; cursor: pointer; }
.field textarea { resize: vertical; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus,
.form-page input:focus { outline: 2px solid var(--gu-blue); outline-offset: -1px; border-color: var(--gu-blue); }

.field-block { margin-bottom: 18px; }
.block-label { display: block; font-size: 0.78rem; font-weight: 600; color: var(--ink-2); margin-bottom: 8px; }

.btn-mini {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: transparent;
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
}
.btn-mini:hover { border-color: var(--gu-blue); color: var(--gu-blue); }

.chip-editor { display: flex; flex-direction: column; gap: 8px; }
.chip-list { display: flex; flex-wrap: wrap; gap: 6px; }
.edit-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px 4px 11px;
  border-radius: 20px;
  background: var(--gu-blue-soft);
  border: 1px solid #bfe3fc;
  color: var(--gu-blue-dark);
  font-size: 0.78rem;
  font-weight: 500;
}
.chip-x {
  border: none;
  background: rgba(0, 138, 240, 0.14);
  color: var(--gu-blue-dark);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.chip-x:hover { background: var(--gu-blue); color: #fff; }
.chip-add { display: flex; gap: 8px; max-width: 360px; }
.chip-input { flex: 1; }

.list-rows, .custom-rows { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.list-row { display: flex; gap: 8px; align-items: center; }
.list-row .list-input { flex: 1; }
.custom-row { display: grid; grid-template-columns: 200px 1fr auto; gap: 8px; align-items: center; }

/* ---------- Icons (SVG masks, no external deps) ---------- */

.ico {
  display: inline-block;
  width: 1em;
  height: 1em;
  font-size: 1rem;
  background-color: currentColor;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
  vertical-align: -0.15em;
  flex: 0 0 auto;
}
.ico-search { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E"); }
.ico-grid { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='7' height='7' rx='1'/%3E%3Crect x='14' y='3' width='7' height='7' rx='1'/%3E%3Crect x='3' y='14' width='7' height='7' rx='1'/%3E%3Crect x='14' y='14' width='7' height='7' rx='1'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='7' height='7' rx='1'/%3E%3Crect x='14' y='3' width='7' height='7' rx='1'/%3E%3Crect x='3' y='14' width='7' height='7' rx='1'/%3E%3Crect x='14' y='14' width='7' height='7' rx='1'/%3E%3C/svg%3E"); }
.ico-pencil { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 20h9'/%3E%3Cpath d='M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 20h9'/%3E%3Cpath d='M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z'/%3E%3C/svg%3E"); }
.ico-plus { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E"); }
.ico-plus-min { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 18l6-6-6-6'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 18l6-6-6-6'/%3E%3C/svg%3E"); }
.ico-x { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 6 6 18M6 6l12 12'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 6 6 18M6 6l12 12'/%3E%3C/svg%3E"); }
.ico-arrow-left { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 12H5M12 19l-7-7 7-7'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 12H5M12 19l-7-7 7-7'/%3E%3C/svg%3E"); }
.ico-chevron-up { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 15l-6-6-6 6'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 15l-6-6-6 6'/%3E%3C/svg%3E"); }
.ico-chevron-down { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); }
.ico-chevron-left { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 18l-6-6 6-6'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 18l-6-6 6-6'/%3E%3C/svg%3E"); }
.ico-chevron-right { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 18l6-6-6-6'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 18l6-6-6-6'/%3E%3C/svg%3E"); }

/* Reorder controls */
.row-handle { display: flex; flex-direction: column; gap: 2px; flex: 0 0 auto; }
.handle-btn {
  width: 22px;
  height: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  color: var(--ink-3);
  cursor: pointer;
}
.handle-btn:hover { border-color: var(--gu-blue); color: var(--gu-blue); background: var(--gu-blue-soft); }
.handle-btn .ico { font-size: 0.72rem; }

.card-tools { display: flex; align-items: center; gap: 3px; }
.card-tools .icon-btn { width: 24px; height: 24px; }
.priority-tag {
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
}

/* ---------- Responsive ---------- */

@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.2s ease; box-shadow: var(--shadow-lg); }
  .sidebar.is-open { transform: translateX(0); }
  .content-shift { padding-left: 0; }
  .mobile-toggle { display: flex; }
  .root { padding: 64px 20px 48px; }
}
@media (min-width: 1025px) { .backdrop { display: none; } }

@media (max-width: 1100px) {
  .matrix-head, .matrix-row { grid-template-columns: 210px 230px minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: repeat(2, 1fr); }
  .matrix-head, .matrix-row { grid-template-columns: 1fr; }
  .matrix-head { display: none; }
  .cell-strategy, .cell-imperatives { border-right: none; border-bottom: 1px solid var(--line); }
}
@media (max-width: 640px) {
  .custom-row { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .field.span-2 { grid-column: span 1; }
}
