/* TaskFlow application styles — extracted from taskflow.html (P2 batch 8) */
/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
  /* Surfaces */
  --bg: #f5f6f7;
  --white: #fff;
  --hover: #f0f2f5;
  --active: #e8f0ff;
  --canvas-bg: #fafbfc;
  --shell-bg: #f4f6fb;
  --shell-bg-strong: #eef2f8;
  --shell-panel: rgba(255,255,255,0.86);
  --shell-panel-strong: rgba(255,255,255,0.96);
  --shell-border: rgba(214,221,232,0.92);
  --shell-border-soft: rgba(226,232,240,0.86);
  --shell-muted: #68758a;

  /* Primary */
  --primary: #3370ff;
  --primary-hover: #2860e1;
  --primary-light: #e8f0ff;
  --primary-gradient: linear-gradient(135deg, #3370ff 0%, #4f6ef7 100%);

  /* Text */
  --text: #1f2329;
  --text2: #646a73;
  --text3: #8f959e;

  /* Borders */
  --border: #e5e6eb;
  --border-light: #f0f0f0;

  /* Semantic */
  --red: #f53f3f;
  --red-light: #ffecec;
  --orange: #ff7a00;
  --orange-light: #fff7e6;
  --green: #00b578;
  --green-light: #e6f5e9;
  --cyan: #13c2c2;
  --cyan-light: #e6fffb;
  --indigo: #2f54eb;
  --indigo-light: #f0f5ff;
  --gold: #f5a623;
  --neutral: #a0a8c0;
  --neutral-light: #edf0f7;
  --critical: #ff4050;

  /* Status badges */
  --s-pending: #e5e6eb;
  --s-pending-text: #6b7280;
  --s-progress: #d6e4ff;
  --s-progress-text: #3370ff;
  --s-done: #c9f0dd;
  --s-done-text: #0a7e4a;
  --s-blocked: #ffe0e0;
  --s-blocked-text: #c70000;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(23,32,51,0.04);
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.04);
  --shadow-md: 0 2px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 4px 20px rgba(0,0,0,0.08);
  --shadow-xl: 0 12px 40px rgba(0,0,0,0.12);
  --shadow-glow: 0 8px 24px rgba(51,112,255,0.28);

  /* Border radius */
  --radius-sm: 2px;
  --radius-md: 4px;
  --radius-lg: 5px;
  --radius-xl: 6px;
  --radius-2xl: 8px;
  --radius-full: 999px;

  /* Motion */
  --ease-standard: cubic-bezier(.2,.8,.2,1);
  --dur-fast: .18s;
}

body { font-family: 'Segoe UI','Microsoft YaHei','PingFang SC',-apple-system,BlinkMacSystemFont,sans-serif; }

/* ============================================================
   RESET
   ============================================================ */
* { margin:0; padding:0; box-sizing:border-box; }
body {
  font-family: 'Segoe UI','Microsoft YaHei','PingFang SC',-apple-system,BlinkMacSystemFont,sans-serif;
  background: var(--bg); color: var(--text); height: 100vh; display: flex; overflow: hidden;
  font-size: 13px;
}

/* ============================================================
   BUTTON SYSTEM
   ============================================================ */
.btn {
  display:inline-flex; align-items:center; justify-content:center;
  border:1px solid var(--shell-border); background:var(--shell-panel);
  border-radius:var(--radius-md); cursor:pointer;
  font-family:inherit; color:var(--text2);
  transition:all var(--dur-fast) var(--ease-standard);
  gap:4px; white-space:nowrap;
  box-shadow:var(--shadow-xs);
}
.btn:hover { border-color:rgba(51,112,255,0.32); color:var(--primary); background:var(--shell-panel-strong); box-shadow:0 8px 18px rgba(23,32,51,0.06); }
.btn-sm { padding:3px 8px; font-size:11px; }
.btn-md { padding:5px 12px; font-size:12px; }
.btn-lg { padding:7px 16px; font-size:13px; }
/* Variants */
.btn-primary { background:var(--primary-gradient); color:#fff; border-color:transparent; font-weight:600; box-shadow:0 8px 18px rgba(51,112,255,0.18); }
.btn-primary:hover { background:var(--primary-gradient); border-color:transparent; color:#fff; box-shadow:var(--shadow-glow); }
.btn-outline { background:rgba(255,255,255,0.9); color:var(--text2); border-color:var(--shell-border); }
.btn-outline:hover { border-color:rgba(51,112,255,0.32); color:var(--primary); background:#fff; }
.btn-ghost { background:transparent; border-color:transparent; color:var(--text3); box-shadow:none; }
.btn-ghost:hover { background:rgba(239,243,249,0.86); border-color:transparent; color:var(--text); box-shadow:none; }
.btn-danger { color:var(--red); border-color:var(--red); }
.btn-danger:hover { background:var(--red-light); border-color:var(--red); color:var(--red); }
.btn-danger-solid { background:var(--red); color:#fff; border-color:var(--red); }
.btn-danger-solid:hover { background:#e03030; border-color:#e03030; }
.btn-dashed { border-style:dashed; }
.btn-dashed:hover { border-color:var(--primary); color:var(--primary); border-style:dashed; }

/* Unified nav toolbar buttons */
.btn-navtool, .btn-navtool-primary, .nav-sort {
  display:inline-flex; align-items:center; gap:4px;
  min-height:32px; padding:0 12px;
  border:1px solid rgba(210,218,230,0.9);
  border-radius:var(--radius-md);
  background:rgba(255,255,255,0.88);
  color:var(--text2); font-size:12px; font-weight:500;
  font-family:'Segoe UI','Microsoft YaHei','PingFang SC',sans-serif;
  cursor:pointer; white-space:nowrap;
  transition:all var(--dur-fast) var(--ease-standard);
}
.btn-navtool:hover, .nav-sort:hover { border-color:rgba(51,112,255,0.28); color:var(--primary); background:#fff; }
.btn-navtool:active { transform:translateY(0); }
.btn-navtool-primary {
  background:var(--primary); color:#fff; border-color:var(--primary);
}
.btn-navtool-primary:hover {
  background:var(--primary-hover); border-color:var(--primary-hover); color:#fff;
}
.nav-sort {
  -webkit-appearance:none; -moz-appearance:none; appearance:none;
  padding-right:28px;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23888'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right 10px center;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  width:296px;
  background:
    radial-gradient(circle at 20% 0%, rgba(51,112,255,0.08), transparent 32%),
    linear-gradient(180deg, var(--shell-bg) 0%, var(--shell-bg-strong) 100%);
  border-right:1px solid var(--shell-border);
  box-shadow:inset -1px 0 0 rgba(255,255,255,0.72), 12px 0 32px rgba(23,32,51,0.035);
  display:flex;
  flex-direction:column;
  flex-shrink:0;
  transition:width 0.2s ease, border 0.2s ease;
}
.sidebar.collapsed { width:0; min-width:0; border-right:none; overflow:hidden; padding:0; }
.sidebar-toggle {
  position:fixed; left:0; top:50%; transform:translateY(-50%);
  width:16px; height:56px; background:rgba(255,255,255,0.9); border:1px solid rgba(214,221,232,0.94);
  border-left:none; border-radius:0 var(--radius-md) var(--radius-md) 0; cursor:pointer; z-index:50;
  display:none; align-items:center; justify-content:center;
  color:var(--text3); font-size:9px; padding:0; transition:left 0.2s ease;
  box-shadow:0 8px 22px rgba(21,31,47,0.06);
}
.sidebar-toggle.visible { display:flex; }
.sidebar-header {
  padding:18px 16px 14px; font-size:15px; font-weight:800; color:#172033;
  border-bottom:1px solid var(--shell-border); display:flex; align-items:center;
  justify-content:space-between; background:rgba(255,255,255,0.78);
  letter-spacing:0.02em;
}
.sidebar-toolbar { display:flex; gap:4px; }
.sidebar-tree { flex:1; overflow-y:auto; padding:8px 6px 10px; font-family:'Segoe UI','Microsoft YaHei','PingFang SC',sans-serif; }
.tree-node { user-select:none; }
.tree-row {
  display:flex; align-items:center; gap:5px; padding:5px 9px; cursor:pointer;
  font-size:11px; color:#506072; transition:all var(--dur-fast) var(--ease-standard);
  border:1px solid transparent; border-left:3px solid transparent; border-radius:var(--radius-lg); line-height:1.35;
}
.tree-row:hover { background:rgba(255,255,255,0.82); border-color:rgba(226,232,240,0.82); box-shadow:0 4px 12px rgba(23,32,51,0.035); }
.tree-row.focused { background:linear-gradient(135deg, rgba(232,240,255,0.98), rgba(246,248,255,0.96)); color:#1f3d7a; font-weight:700; border-left-color:var(--primary); border-color:rgba(51,112,255,0.18); box-shadow:0 8px 18px rgba(51,112,255,0.08); }
.tree-row.dragging { opacity:0.3; }
.tree-row.drag-over-before { box-shadow:inset 0 3px 0 var(--primary); }
.tree-row.drag-over-after { box-shadow:inset 0 -3px 0 var(--primary); }
.tree-row .toggle {
  width:18px; height:18px; display:flex; align-items:center; justify-content:center;
  font-size:10px; flex-shrink:0; color:var(--text3); border-radius:var(--radius-sm);
}
.tree-row .toggle:hover { background:rgba(214,221,232,0.76); }
.tree-row .toggle.empty { visibility:hidden; }
.tree-row .label { flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.tree-row .badge {
  font-size:10px; padding:1px 6px; border-radius:var(--radius-lg); flex-shrink:0;
  background:rgba(255,255,255,0.8); color:var(--text3);
}
.tree-row .badge.critical { background:var(--red-light); color:var(--critical); }
.tree-row .tree-actions { display:none; gap:2px; }
.tree-row:hover .tree-actions { display:flex; }
.tree-row .status-dot { width:8px; height:8px; border-radius:50%; flex-shrink:0; }
.tree-children { overflow:hidden; transition:max-height 0.25s ease; }
.sidebar-footer {
  padding:14px 16px 18px;
  border-top:1px solid rgba(214,221,232,0.92);
  background:linear-gradient(180deg, rgba(255,255,255,0.74), rgba(244,247,252,0.92));
}

.workspace-bar { padding:10px 12px; border-bottom:1px solid var(--shell-border); background:rgba(255,255,255,0.62); }
.workspace-bar select {
  width:100%; padding:8px 10px; border:1px solid var(--shell-border);
  border-radius:var(--radius-lg); font-size:12px; background:rgba(255,255,255,0.94); cursor:pointer;
  box-shadow:inset 0 1px 0 rgba(255,255,255,0.72), var(--shadow-xs);
}
.workspace-bar select:focus { outline:none; border-color:var(--primary); }
.workspace-bar .ws-actions { display:flex; gap:4px; margin-top:6px; }

/* ============================================================
   MAIN + TOPBAR
   ============================================================ */
.main {
  flex:1;
  display:flex;
  flex-direction:column;
  min-width:0;
  background:
    radial-gradient(circle at 78% 0%, rgba(79,110,247,0.08), transparent 30%),
    linear-gradient(180deg, #f7f9fc 0%, #eef2f8 100%);
}
.topbar {
  display:flex;
  flex-direction:column;
  gap:0;
  min-height:48px;
  padding:0;
  background:linear-gradient(180deg, rgba(255,255,255,0.98), rgba(247,249,253,0.94));
  border-bottom:1px solid var(--shell-border);
  box-shadow:0 10px 30px rgba(20,30,48,0.055);
  flex-shrink:0;
  backdrop-filter:blur(14px);
  position:relative; z-index:10;
}
.topbar-mainline {
  display:flex;
  align-items:center;
  gap:8px;
  padding:6px 24px;
  min-height:40px;
  flex-wrap:nowrap;
}
.topbar-mainline .btn-back { flex-shrink:0; }
.topbar-mainline .toolbar-spacer { flex:1; }
.topbar-mainline .view-toggle { flex-shrink:1; min-width:0; overflow-x:auto; overflow-y:hidden; scrollbar-width:none; }
.topbar-mainline .view-toggle::-webkit-scrollbar { height:0; }
.topbar-mainline .view-toggle button { flex:0 0 auto; }
.topbar-mainline .btn-md { flex-shrink:0; min-height:30px; padding:0 10px; font-size:11px; }
.topbar-subline {
  display:flex;
  align-items:center;
  padding:0 24px 7px;
  min-height:22px;
  border-top:1px solid rgba(226,232,240,0.58);
}
.breadcrumb { display:flex; align-items:center; gap:6px; font-size:11px; }
.breadcrumb span { color:var(--text3); }
.breadcrumb a {
  color:var(--primary); text-decoration:none; cursor:pointer; padding:1px 6px;
  border-radius:var(--radius-lg);
}
.breadcrumb a:hover { background:rgba(232,240,255,0.9); }
.breadcrumb .current { color:#172033; font-weight:700; }
.toolbar-spacer { flex:1; }
.view-toggle {
  display:inline-flex;
  align-items:center;
  gap:2px;
  padding:3px;
  border-radius:var(--radius-lg);
  border:1px solid var(--shell-border);
  background:rgba(239,243,249,0.82);
  box-shadow:inset 0 1px 0 rgba(255,255,255,0.72);
}
.view-toggle button {
  min-height:28px;
  padding:0 10px;
  border:none;
  background:transparent;
  cursor:pointer;
  font-size:12px;
  color:#5d6a7d;
  border-radius:var(--radius-lg);
  font-weight:500;
  white-space:nowrap;
  line-height:28px;
  transition:all var(--dur-fast) var(--ease-standard);
}
.view-toggle button:hover { color:var(--text); }
.view-toggle button.active { background:linear-gradient(135deg, #3370ff 0%, #4f6ef7 100%); color:#fff; box-shadow:0 4px 10px rgba(51,112,255,0.16); }
.view-toggle-arrow {
  min-height:28px; width:16px; padding:0;
  border:none; border-left:1px solid rgba(210,218,230,0.86);
  background:transparent;
  cursor:pointer; font-size:8px; color:#5d6a7d;
  border-radius:0 var(--radius-lg) var(--radius-lg) 0; display:inline-flex;
  align-items:center; justify-content:center;
  white-space:nowrap; line-height:28px;
}
.view-toggle-arrow:hover { color:var(--text); background:rgba(255,255,255,0.5); }
.view-toggle-arrow.open { color:var(--primary); background:rgba(255,255,255,0.92); }
.btn-back {
  border:1px solid var(--shell-border); background:rgba(255,255,255,0.88); cursor:pointer; font-size:12px; padding:0 10px;
  min-height:30px; line-height:30px; border-radius:var(--radius-md); color:var(--text2); margin-right:4px; white-space:nowrap;
  box-shadow:var(--shadow-xs); transition:all var(--dur-fast) var(--ease-standard);
}
.btn-back:hover { background:#fff; color:var(--primary); border-color:rgba(51,112,255,0.28); box-shadow:0 8px 18px rgba(23,32,51,0.06); }

/* ============================================================
   FLOWCHART + PLAN TABLE
   ============================================================ */
.flowchart-wrap {
  flex:1;
  overflow:auto;
  position:relative;
  margin:0;
  background:transparent;
  border:none;
  border-radius:0;
  box-shadow:none;
}
.flowchart-wrap.dom-view { display:flex; flex-direction:column; overflow:hidden; }
.flowchart-wrap canvas { display:block; }
.flowchart-empty {
  position:absolute; inset:0; display:flex; align-items:center; justify-content:center;
  color:var(--text3); font-size:14px; flex-direction:column; gap:8px;
}
.plan-table-wrap { flex:1; overflow:auto; padding:0 14px 14px; max-width:100%; background:transparent; }
.plan-table-wrap > .plan-table { margin-top:14px; }
/* Plan view: the column bar stays fixed and the table wrapper itself is the
   scroll container, so the horizontal scrollbar stays visible at the bottom of
   the screen instead of sitting below the last row. */
.flowchart-wrap.plan-mode { display:flex; flex-direction:column; overflow:hidden; }
#flowchartWrap.plan-mode { overflow:hidden; }
.flowchart-wrap.plan-mode .plan-col-bar { flex:0 0 auto; }
.flowchart-wrap.plan-mode .plan-table-wrap { flex:1; min-height:0; overflow:auto; }
.plan-table { border-collapse:separate; border-spacing:0; font-size:11px; background:rgba(255,255,255,0.84); table-layout:fixed; border:1px solid var(--shell-border); border-radius:var(--radius-xl); overflow:visible; box-shadow:0 14px 32px rgba(23,32,51,0.055); }
.plan-table th {
  position:sticky; top:0; background:linear-gradient(180deg, rgba(247,249,253,0.98), rgba(239,243,249,0.96)); padding:5px 8px; text-align:center;
  vertical-align:middle;
  font-weight:700; color:#5d6a7d; border-bottom:1px solid rgba(214,221,232,0.92);
  border-right:1px solid rgba(217,223,233,0.92); white-space:nowrap; z-index:1;
  overflow:hidden; user-select:none;
}
.plan-table thead tr:first-child th:first-child { border-top-left-radius:var(--radius-xl); }
.plan-table thead tr:first-child th:last-child { border-top-right-radius:var(--radius-xl); }
.plan-table tbody tr:last-child td:first-child { border-bottom-left-radius:var(--radius-xl); }
.plan-table tbody tr:last-child td:last-child { border-bottom-right-radius:var(--radius-xl); }
.plan-table th.sticky-col { z-index:3; }
.plan-table td.sticky-col { position:sticky; z-index:1; background:rgba(255,255,255,0.88); }
.plan-table tr:hover td.sticky-col { background:rgba(232,240,255,0.78); }
.plan-table th .resize-handle {
  position:absolute; right:0; top:0; bottom:0; width:6px; cursor:col-resize;
  background:transparent; z-index:2;
}
.plan-table th .resize-handle:hover { background:var(--primary); opacity:0.3; }
.plan-table td {
  padding:2px 8px; border-bottom:1px solid var(--border-light);
  border-right:1px solid var(--border); vertical-align:middle;
  line-height:1.2;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.plan-table tr:hover td { background:var(--hover); }
.plan-table td[data-col="progress"]:hover, .plan-table td[data-col="status"]:hover { background:var(--active) !important; }
.plan-progress-text { display:block; max-height:none; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.plan-progress-text i { font-style:italic; }
.plan-table .col-num { color:var(--primary); font-weight:600; white-space:nowrap; }
.plan-table .col-title { font-weight:500; }
.plan-table .plan-title-num { color:var(--primary); font-weight:600; margin-right:6px; font-variant-numeric:tabular-nums; }
.plan-table .col-status { width:70px; }
.plan-table .col-rating { width:60px; text-align:center; }
.plan-table .status-dot-inline { display:inline-block;width:7px;height:7px;border-radius:50%;margin-right:4px; }
.plan-table .level-1 td:first-child { padding-left:24px; }
.plan-table .level-2 td:first-child { padding-left:38px; }
.plan-table .level-3 td:first-child { padding-left:52px; }
.plan-table .level-4 td:first-child { padding-left:66px; }
.plan-table .plan-toggle {
  display:inline-block; width:16px; height:16px; line-height:16px; text-align:center;
  cursor:pointer; color:var(--text3); font-size:10px; border-radius:var(--radius-sm);
  margin-right:2px; vertical-align:middle; user-select:none;
}
.plan-table .plan-toggle:hover { background:var(--border); color:var(--text); }
.plan-table .plan-toggle.empty { visibility:hidden; }
.plan-table tr.child-hidden { display:none; }
.plan-table th.drag-over-left { box-shadow:inset 3px 0 0 var(--primary); }
.plan-table th.drag-over-right { box-shadow:inset -3px 0 0 var(--primary); }
.plan-table th.dragging { opacity:0.4; }
.plan-col-btn {
  float:right; cursor:pointer; font-size:11px; padding:2px 6px; border-radius:var(--radius-sm);
  border:1px solid var(--border); background:var(--white); color:var(--text3); margin-left:8px;
}
.plan-col-btn:hover { background:var(--hover); color:var(--text); }
.plan-col-menu {
  position:absolute; z-index:100; background:var(--white); border:1px solid var(--border);
  border-radius:var(--radius-lg); box-shadow:var(--shadow-lg); padding:8px 0;
  min-width:160px; display:none; top:100%; left:0; margin-top:4px;
}
.plan-col-menu.show { display:block; }
.plan-col-menu label {
  display:flex; align-items:center; gap:6px; padding:6px 14px; cursor:pointer;
  font-size:12px; color:var(--text2);
}
.plan-col-menu label:hover { background:var(--hover); }
.plan-col-menu input[type="checkbox"] { accent-color:var(--primary); }

/* ============================================================
   COMMUNITY OVERLAY
   ============================================================ */
.comm-overlay {
  position:fixed; inset:0; background:rgba(15,23,42,0.38); backdrop-filter:blur(5px); display:none;
  align-items:center; justify-content:center; z-index:300;
}
.comm-overlay.show { display:flex; }
.comm-panel {
  background:var(--white); border-radius:var(--radius-2xl); width:780px;
  max-width:92vw; max-height:85vh; display:flex; flex-direction:column;
  box-shadow:var(--shadow-xl); overflow:hidden;
}
.comm-header {
  display:flex; align-items:center; justify-content:space-between;
  padding:12px 24px; border-bottom:1px solid var(--border); flex-shrink:0;
}
.comm-header h2 { font-size:17px; font-weight:700; margin:0; color:var(--text); }
.comm-close {
  width:32px; height:32px; border:none; background:none; font-size:18px;
  cursor:pointer; color:var(--text3); border-radius:var(--radius-lg); display:flex;
  align-items:center; justify-content:center;
}
.comm-close:hover { background:var(--hover); color:var(--text); }
.comm-body { flex:1; overflow-y:auto; padding:16px 24px 24px; }
.comm-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:12px; }
.comm-card {
  border:1px solid var(--border); border-radius:var(--radius-xl); padding:16px;
  cursor:pointer; transition:box-shadow 0.15s,border-color 0.15s; background:var(--white);
}
.comm-card:hover { box-shadow:var(--shadow-lg); border-color:var(--primary); }
.comm-card-title { font-size:14px; font-weight:600; color:var(--text); margin-bottom:4px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.comm-card-owner { font-size:11px; color:var(--text3); margin-bottom:4px; }
.comm-card-owner span { font-weight:500; color:var(--primary); }
.comm-card-desc { font-size:11px; color:var(--text3); line-height:1.4; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; margin-bottom:8px; min-height:16px; }
.comm-card-meta { display:flex; align-items:center; gap:8px; font-size:10px; color:var(--text3); border-top:1px solid var(--border-light); padding-top:8px; }
.comm-card-meta .meta-tag { padding:1px 6px; border-radius:var(--radius-sm); font-weight:500; }
.comm-card-actions { display:flex; align-items:center; gap:2px; border-top:1px solid var(--border-light); padding-top:8px; margin-top:6px; }
.comm-card-actions button { border:none; background:none; cursor:pointer; font-size:16px; padding:2px 6px; border-radius:var(--radius-sm); transition:transform 0.15s; line-height:1; }
.comm-card-actions button:hover { transform:scale(1.2); background:var(--hover); }
.comm-act-fav { color:var(--gold); }
.comm-act-like { color:var(--red); }
.comm-act-count { font-size:11px; color:var(--text3); margin-left:2px; min-width:16px; }
.comm-detail-back { font-size:11px; color:var(--primary); cursor:pointer; font-weight:500; padding:4px 8px; border-radius:var(--radius-sm); border:1px solid transparent; background:none; margin-right:12px; }
.comm-detail-back:hover { background:var(--active); }
.comm-detail-info { display:flex; align-items:center; gap:12px; padding:8px 0 16px; font-size:12px; color:var(--text2); }
.comm-detail-tree { border:1px solid var(--border); border-radius:var(--radius-lg); padding:12px 16px; max-height:50vh; overflow-y:auto; font-size:13px; }
.comm-tree-item { display:flex; align-items:center; gap:6px; padding:3px 0; }
.comm-tree-indent { display:inline-block; }
.comm-tree-num { font-size:10px; font-weight:600; color:var(--primary); min-width:28px; }
.comm-tree-title { flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.comm-tree-status { font-size:10px; padding:1px 6px; border-radius:var(--radius-sm); white-space:nowrap; }
.comm-import-btn { padding:7px 16px; background:var(--primary); color:#fff; border:none; border-radius:var(--radius-lg); font-size:13px; font-weight:600; cursor:pointer; }
.comm-import-btn:hover { background:var(--primary-hover); }
.comm-import-btn:disabled { opacity:0.5; cursor:default; }

/* ============================================================
   CONTEXT MENU
   ============================================================ */
.ctx-menu {
  position:fixed; z-index:10000; background:rgba(255,255,255,0.96); border:1px solid var(--shell-border);
  border-radius:var(--radius-lg); box-shadow:0 18px 42px rgba(23,32,51,0.13); padding:6px; min-width:188px;
  backdrop-filter:blur(12px);
}
.ctx-item { padding:6px 12px; font-size:11px; cursor:pointer; color:var(--text2); white-space:nowrap; position:relative; user-select:none; border-radius:var(--radius-md); transition:all var(--dur-fast) var(--ease-standard); }
.ctx-item:hover { background:rgba(232,240,255,0.86); color:var(--primary); }
.ctx-item-delete { color:var(--red); }
.ctx-item-delete:hover { background:rgba(245,63,63,0.09); color:var(--red); }
.ctx-sep { height:1px; background:rgba(226,232,240,0.9); margin:5px 4px; }
.ctx-has-sub { display:flex; align-items:center; justify-content:space-between; }
.ctx-arrow { color:var(--text3); font-size:10px; margin-left:16px; }
.ctx-submenu {
  display:none; position:absolute; left:100%; top:-7px;
  background:rgba(255,255,255,0.96); border:1px solid var(--shell-border);
  border-radius:var(--radius-lg); box-shadow:0 18px 42px rgba(23,32,51,0.13); padding:6px; min-width:188px;
  backdrop-filter:blur(12px);
}
.ctx-menu.flip-sub .ctx-submenu { left:auto; right:100%; }
.ctx-menu.flip-sub .ctx-submenu .ctx-submenu { left:auto; right:100%; }
.ctx-has-sub:hover > .ctx-submenu { display:block; }

/* Short screens: keep the long task menu compact so it fits the viewport. */
@media (max-height: 720px) {
  .ctx-menu { padding:4px; }
  .ctx-item { padding:4px 10px; }
  .ctx-sep { margin:3px 4px; }
}

/* ============================================================
   EVENT LIST
   ============================================================ */
.eventlist-wrap { flex:1; min-height:0; overflow:auto; padding:0 18px 18px; }
.eventlist-wrap > .event-table { margin-top:14px; }
.eventlist-wrap > .eventlist-empty { padding-top:14px; }
.eventlist-empty { display:flex; align-items:center; justify-content:center; height:100%; color:var(--text3); font-size:14px; }
.event-table {
  width:100%; min-width:760px; border-collapse:separate; border-spacing:0; table-layout:fixed;
  font-size:11px; background:rgba(255,255,255,0.88); border:1px solid rgba(188,198,212,0.96);
  border-radius:var(--radius-xl); overflow:visible; box-shadow:0 10px 24px rgba(23,32,51,0.045);
}
.event-table thead { position:static; }
.event-table thead tr:first-child th { position:sticky; top:0; z-index:7; height:28px; }
.event-table thead tr:last-child th { position:sticky; top:28px; z-index:6; height:28px; }
.event-table th {
  position:relative; padding:7px 9px; text-align:center; vertical-align:middle;
  background:linear-gradient(180deg, rgba(247,249,253,0.98), rgba(239,243,249,0.96));
  border-right:1px solid rgba(188,198,212,0.96); border-bottom:1px solid rgba(188,198,212,0.96);
  color:#5d6a7d; font-size:11px; font-weight:700; white-space:nowrap;
}
.event-table thead tr:first-child th:first-child { border-top-left-radius:var(--radius-xl); }
.event-table thead tr:first-child th:last-child { border-top-right-radius:var(--radius-xl); }
.event-table tbody tr:last-child td:first-child { border-bottom-left-radius:var(--radius-xl); }
.event-table tbody tr:last-child td:last-child { border-bottom-right-radius:var(--radius-xl); }
.event-table .event-group-head { background:linear-gradient(180deg, rgba(239,244,252,0.98), rgba(229,236,248,0.96)); }
.event-table th .resize-handle {
  position:absolute; right:0; top:0; bottom:0; width:6px; cursor:col-resize;
  background:transparent; z-index:2;
}
.event-table th .resize-handle:hover { background:var(--primary); opacity:0.3; }
.event-cell-line { line-height:1.2; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.event-data-cell { vertical-align:top; }
.event-cell-link { color:var(--primary); text-decoration:none; }
.event-cell-link:hover { text-decoration:underline; }
.event-table th:last-child, .event-table td:last-child { border-right:none; }
.event-table td {
  padding:2px 9px; height:26px; line-height:1.2;
  border-right:1px solid rgba(198,208,222,0.96); border-bottom:1px solid rgba(198,208,222,0.96);
  vertical-align:middle; background:rgba(255,255,255,0.72); color:var(--text2);
}
.event-table tr:last-child td { border-bottom:none; }
.event-table tr:hover td { background:rgba(232,240,255,0.42); }
.event-table .status-chip { font-size:11px; height:20px; }
.event-level-cell { min-width:150px; max-width:280px; cursor:pointer; }
.event-level-cell.event-empty-cell { background:rgba(248,250,252,0.58); cursor:default; }
.event-level-main { display:flex; align-items:center; gap:6px; min-width:0; }
.event-level-num { color:var(--primary); font-size:10px; font-weight:700; white-space:nowrap; flex-shrink:0; }
.event-level-title { color:var(--text); font-weight:600; line-height:1.35; word-break:break-word; }
.event-leaf-cell .event-level-title { font-weight:700; }
.event-attr-cell { white-space:nowrap; font-size:11px; color:var(--text2); text-align:center; vertical-align:middle; }
.event-owner-cell { min-width:88px; }
.event-status-badge { display:inline-block; padding:1px 6px; border-radius:var(--radius-sm); font-size:10px; font-weight:600; white-space:nowrap; }

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position:fixed; inset:0; background:rgba(15,23,42,0.38); display:none;
  align-items:center; justify-content:center; z-index:200;
  padding:24px; backdrop-filter:blur(5px);
}
.modal-overlay.show { display:flex; }
.modal {
  background:linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,254,0.96)); border:1px solid var(--shell-border); border-radius:var(--radius-2xl); width:520px;
  max-width:90vw; max-height:85vh; overflow:hidden;
  display:flex; flex-direction:column; box-shadow:0 28px 72px rgba(23,32,51,0.18);
}
.modal-header {
  flex-shrink:0; padding:16px 24px 14px; cursor:grab; user-select:none;
  border-bottom:1px solid var(--shell-border); background:rgba(255,255,255,0.78);
  border-radius:var(--radius-2xl) var(--radius-2xl) 0 0; position:sticky; top:0; z-index:10;
  backdrop-filter:blur(12px);
}
.modal-header:active { cursor:grabbing; }
.modal-header h3 { font-size:17px; margin:0 0 6px 0; font-weight:800; letter-spacing:-0.03em; color:#172033; }
.ctx-item { font-family:'Segoe UI Emoji','Apple Color Emoji','Noto Color Emoji',sans-serif; }
.modal-header .modal-btns { margin-bottom:0; }
.modal-body { flex:1; overflow-y:auto; padding:18px 24px 24px; min-height:0; }
.modal .field { margin-bottom:14px; }
.modal .field label { display:block; font-size:12px; color:var(--shell-muted); margin-bottom:6px; font-weight:600; }
.modal .field input, .modal .field textarea, .modal .field select {
  width:100%; padding:8px 11px; border:1px solid var(--shell-border); border-radius:var(--radius-lg);
  font-size:13px; outline:none; font-family:inherit; background:rgba(255,255,255,0.9);
  box-shadow:inset 0 1px 0 rgba(255,255,255,0.72);
}
.modal .field textarea { resize:vertical; min-height:54px; }
.modal .field input:focus, .modal .field textarea:focus, .modal .field select:focus {
  border-color:rgba(51,112,255,0.62); box-shadow:0 0 0 3px rgba(51,112,255,0.11), inset 0 1px 0 rgba(255,255,255,0.72); background:#fff;
}
.modal .date-link-field { margin: -4px 0 10px; }
.modal .date-link-toggle {
  display:flex; align-items:center; gap:6px; margin:0; font-size:11px; font-weight:400;
  color:var(--text2); cursor:pointer; line-height:1.4;
}
.modal .date-link-toggle input[type="checkbox"] {
  width:14px; height:14px; min-height:0; margin:0; padding:0; flex:0 0 auto; accent-color:var(--primary);
}
.modal .row { display:flex; gap:12px; }
.modal .row .field { flex:1; }
.deps-list { max-height:130px; overflow-y:auto; border:1px solid var(--border); border-radius:var(--radius-md); padding:4px 0; }
.deps-list label {
  display:flex; align-items:center; gap:8px; padding:4px 12px; cursor:pointer; font-size:12px;
  color:var(--text); font-weight:400 !important; margin:0 !important;
}
.deps-list label:hover { background:var(--hover); }
.deps-list input[type=checkbox] { width:auto !important; }
.dynamic-list { display:flex; flex-direction:column; gap:6px; }
.dynamic-item { display:flex; gap:6px; align-items:center; }
.dynamic-item input { flex:1; min-width:0; }
.method-item, .output-item { flex-direction:column; align-items:stretch; gap:4px; }
.dynamic-item .input-source { max-width:180px; flex-shrink:0; }
.btn-add-item { margin-top:4px; width:100%; }
.btn-remove-item { border:none; background:none; cursor:pointer; font-size:16px; color:var(--text3); padding:0 3px; line-height:1; flex-shrink:0; }
.btn-remove-item:hover { color:var(--red); }
.method-row { display:flex; gap:4px; align-items:center; width:100%; }
.method-row .method-value { flex:5; min-width:0; }
.method-row select { padding:4px 4px; border:1px solid var(--border); border-radius:var(--radius-sm); font-size:11px; background:var(--white); min-width:0; }
.method-row .method-avail { flex:2; min-width:0; }
.method-row .method-quality { flex:3; min-width:0; }
.method-row .method-location { flex:1; min-width:80px; }
.m-tag { display:inline-block; font-size:10px; padding:0 3px; border-radius:var(--radius-sm); vertical-align:middle; }
.m-avail { background:var(--cyan-light); color:var(--cyan); }
.m-qual { background:var(--orange-light); color:var(--orange); }
.m-dest { background:var(--indigo-light); color:var(--indigo); }
.m-link { text-decoration:none; font-size:11px; }
.output-row { display:flex; gap:6px; align-items:center; width:100%; }
.output-row .output-value { flex:6; min-width:0; }
.output-row .output-dest { flex:4; min-width:0; }
.modal-btns { display:flex; gap:8px; justify-content:flex-end; margin-top:18px; align-items:center; }
.dropdown { position:relative; }
.dropdown-menu {
  display:none; position:absolute; top:100%; left:0; min-width:150px;
  background:rgba(255,255,255,0.96); border:1px solid var(--shell-border); border-radius:var(--radius-lg);
  box-shadow:0 18px 42px rgba(23,32,51,0.13); z-index:100; padding:6px; backdrop-filter:blur(12px);
}
.dropdown-menu.show { display:block; }
.dropdown-menu button {
  display:block; width:100%; text-align:left; padding:7px 12px; border:none;
  background:transparent; font-size:12px; cursor:pointer; white-space:nowrap; color:var(--text2); border-radius:var(--radius-md);
}
.dropdown-menu button:hover { background:rgba(232,240,255,0.86); color:var(--primary); }

/* ============================================================
   LOGIN
   ============================================================ */
.login-overlay {
  position:fixed; inset:0; display:none; flex-direction:column;
  align-items:center; justify-content:center; z-index:300;
  overflow:hidden;
  animation: bgSlideShow 15s ease-in-out infinite;
  background-size:cover; background-position:center;
}
@keyframes bgSlideShow {
  0%   { background-image: linear-gradient(180deg, #0a1628 0%, #0d2137 20%, #153d5a 40%, #1a5c7a 55%, #0e3b52 65%, #0a2a3c 75%, #0d1f2f 85%, #0a1628 100%); }
  30%  { background-image: linear-gradient(180deg, #0a1628 0%, #0d2137 20%, #153d5a 40%, #1a5c7a 55%, #0e3b52 65%, #0a2a3c 75%, #0d1f2f 85%, #0a1628 100%); }
  33%  { background-image: linear-gradient(180deg, #1a0a0a 0%, #4a1a0a 20%, #d4783a 40%, #f5c882 55%, #2a6080 75%, #0a3050 100%); }
  63%  { background-image: linear-gradient(180deg, #1a0a0a 0%, #4a1a0a 20%, #d4783a 40%, #f5c882 55%, #2a6080 75%, #0a3050 100%); }
  66%  { background-image: linear-gradient(180deg, #1a3a2a 0%, #2a5a3a 15%, #5a9a6a 30%, #8ac4a0 45%, #3a7a9a 55%, #1a4a6a 65%, #2a6a8a 75%, #f5d8a0 80%, #e8c080 90%, #0a2a1a 100%); }
  96%  { background-image: linear-gradient(180deg, #1a3a2a 0%, #2a5a3a 15%, #5a9a6a 30%, #8ac4a0 45%, #3a7a9a 55%, #1a4a6a 65%, #2a6a8a 75%, #f5d8a0 80%, #e8c080 90%, #0a2a1a 100%); }
  100% { background-image: linear-gradient(180deg, #0a1628 0%, #0d2137 20%, #153d5a 40%, #1a5c7a 55%, #0e3b52 65%, #0a2a3c 75%, #0d1f2f 85%, #0a1628 100%); }
}
.login-overlay::after {
  content:''; position:absolute; inset:0;
  background: radial-gradient(2px 2px at 15% 10%, rgba(255,255,255,0.4), transparent),
    radial-gradient(1px 1px at 25% 8%, rgba(255,255,255,0.3), transparent),
    radial-gradient(2px 2px at 40% 5%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1px 1px at 60% 12%, rgba(255,255,255,0.3), transparent),
    radial-gradient(1px 1px at 75% 7%, rgba(255,255,255,0.4), transparent),
    radial-gradient(2px 2px at 85% 15%, rgba(255,255,255,0.3), transparent),
    radial-gradient(1px 1px at 10% 20%, rgba(255,255,255,0.2), transparent),
    radial-gradient(1px 1px at 50% 18%, rgba(255,255,255,0.3), transparent),
    radial-gradient(2px 2px at 92% 22%, rgba(255,255,255,0.2), transparent);
  animation:twinkle 4s ease-in-out infinite alternate;
}
@keyframes twinkle { 0% { opacity:0.6; } 100% { opacity:1; } }
.login-box {
  background:rgba(255,255,255,0.15); backdrop-filter:blur(12px);
  -webkit-backdrop-filter:blur(12px);
  border:1px solid var(--border);
  border-radius:var(--radius-2xl); padding:36px; width:380px;
  box-shadow:0 20px 60px rgba(0,0,40,0.6); text-align:center;
  position:relative; z-index:1;
}
.login-box h2 { font-size:18px; margin-bottom:4px; color:rgba(255,255,255,0.9); }
.login-box .sub { font-size:12px; color:rgba(255,255,255,0.6); margin-bottom:20px; }
.login-box input {
  width:100%; padding:8px 12px; border:1px solid var(--border); border-radius:var(--radius-md);
  font-size:13px; margin-bottom:12px; outline:none; background:rgba(255,255,255,0.1); color:#fff;
}
.login-box input::placeholder { color:rgba(255,255,255,0.5); }
.login-box input:focus { border-color:rgba(255,255,255,0.5); box-shadow:0 0 0 2px rgba(51,112,255,0.3); }
.login-box .link { font-size:12px; color:rgba(255,255,255,0.6); cursor:pointer; text-decoration:underline; }
.login-box .link:hover { color:rgba(255,255,255,0.9); }
.login-box .error { color:#ff6b6b; font-size:12px; margin-bottom:8px; min-height:18px; }
.landing-scene {
  position:absolute; bottom:0; left:0; right:0; height:65%; z-index:0;
  background: linear-gradient(175deg, transparent 40%, rgba(13,33,55,0.7) 40.5%, rgba(13,33,55,0.7) 41%, transparent 41.5%),
    linear-gradient(172deg, transparent 45%, rgba(15,42,63,0.5) 45.5%, rgba(15,42,63,0.5) 46%, transparent 46.5%),
    linear-gradient(178deg, transparent 55%, rgba(10,32,48,0.6) 55.5%, rgba(10,32,48,0.6) 56.5%, transparent 57%),
    linear-gradient(174deg, transparent 48%, rgba(21,47,66,0.5) 48.5%, rgba(21,47,66,0.5) 49%, transparent 49.5%),
    linear-gradient(176deg, transparent 65%, rgba(12,30,44,0.6) 65.5%, rgba(12,30,44,0.6) 67%, transparent 67.5%),
    linear-gradient(0deg, rgba(26,92,122,0.3) 0%, rgba(21,61,90,0.15) 15%, transparent 25%);
  pointer-events:none;
}
.landing-scene::after {
  content:''; position:absolute; inset:0;
  background: radial-gradient(1px 1px at 10% 8%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1px 1px at 25% 12%, rgba(255,255,255,0.3), transparent),
    radial-gradient(2px 2px at 40% 5%, rgba(255,255,255,0.4), transparent),
    radial-gradient(1px 1px at 60% 10%, rgba(255,255,255,0.3), transparent),
    radial-gradient(1px 1px at 75% 6%, rgba(255,255,255,0.4), transparent),
    radial-gradient(2px 2px at 85% 15%, rgba(255,255,255,0.3), transparent),
    radial-gradient(1px 1px at 15% 20%, rgba(255,255,255,0.2), transparent),
    radial-gradient(1px 1px at 50% 18%, rgba(255,255,255,0.3), transparent),
    radial-gradient(2px 2px at 92% 22%, rgba(255,255,255,0.2), transparent);
  animation:twinkle 4s ease-in-out infinite alternate;
}
@keyframes twinkle { 0% { opacity:0.5; } 100% { opacity:1; } }
.landing-hero { position:relative; z-index:1; text-align:center; margin-bottom:28px; }
.landing-hero h1 { font-size:42px; font-weight:700; color:#fff; margin-bottom:12px; font-family:'Microsoft YaHei','微软雅黑',sans-serif; letter-spacing:6px; text-shadow:0 4px 20px rgba(0,0,0,0.4); }
.landing-hero .slogan { font-size:16px; color:rgba(255,255,255,0.8); line-height:1.8; max-width:520px; margin:0 auto; font-family:'Microsoft YaHei','微软雅黑',sans-serif; text-shadow:0 2px 8px rgba(0,0,0,0.3); }

/* ============================================================
   USER BAR
   ============================================================ */
.user-bar { display:flex; align-items:center; gap:8px; font-size:12px; color:var(--text2); }
.user-bar .username { font-weight:600; color:var(--text); }
.user-bar .save-status { font-size:11px; color:var(--text3); margin-left:6px; transition:color 0.3s; white-space:nowrap; }
.user-bar .save-status.ok { color:var(--green); }
.user-bar .save-status.err { color:var(--red); }

/* ============================================================
   EVALUATION / COMPETENCY / DIVISION MODALS
   ============================================================ */
.eval-modal { width:960px; max-width:96vw; max-height:90vh; overflow-y:auto; }
.eval-top-bar, .comp-top-bar, .div-top-bar { position:sticky; top:0; z-index:10; background:var(--white); border-bottom:1px solid var(--border); border-radius:var(--radius-2xl) var(--radius-2xl) 0 0; }
.eval-top-row, .comp-top-row, .div-top-row { display:flex; align-items:center; padding:12px 24px; gap:12px; }
.eval-top-left, .comp-top-left, .div-top-left { flex:1; min-width:0; }
.eval-top-left .eval-subtitle, .comp-top-left .comp-subtitle, .div-top-left .div-subtitle { font-size:11px; color:var(--text3); margin-top:2px; }
.div-top-left { font-size:14px; font-weight:600; }
.div-top-left .div-subtitle { font-weight:400; display:block; }
.eval-top-actions, .comp-top-actions, .div-top-actions { display:flex; gap:6px; flex-shrink:0; }
.eval-guide { padding:0 24px 10px; font-size:11px; color:var(--text3); background:var(--white); line-height:1.5; }
.eval-body, .comp-body { padding:12px 24px 24px; }
.eval-aspect, .comp-section { margin-bottom:16px; border:1px solid var(--border); border-radius:var(--radius-lg); overflow:hidden; }
.eval-aspect-header, .comp-section-header { background:var(--bg); padding:8px 14px; font-size:13px; font-weight:600; color:var(--text); border-bottom:1px solid var(--border); display:flex; justify-content:space-between; align-items:center; }
.eval-aspect-header .eval-aspect-tag { font-size:10px; color:var(--text3); font-weight:400; }
.eval-aspect-body { padding:4px 0; }
.eval-item { display:flex; align-items:flex-start; gap:10px; padding:6px 14px; border-bottom:1px solid var(--border-light); font-size:12px; }
.eval-item:last-child { border-bottom:none; }
.eval-item-label { width:70px; flex-shrink:0; font-weight:500; color:var(--text); padding-top:4px; }
.eval-item-desc { width:280px; flex-shrink:0; color:var(--text3); font-size:11px; line-height:1.4; padding-top:4px; }
.eval-item-stars { display:flex; gap:2px; padding-top:2px; }
.eval-item-stars .ev-star { font-size:15px; cursor:pointer; color:var(--border); transition:color 0.1s; user-select:none; }
.eval-item-stars .ev-star.active, .eval-item-stars .ev-star:hover { color:var(--gold); }
.eval-item-note { flex:1; min-width:80px; }
.eval-item-note input { width:100%; padding:4px 6px; font-size:11px; border:1px solid var(--border); border-radius:var(--radius-sm); font-family:inherit; box-sizing:border-box; }
.eval-item-note input:focus { border-color:var(--primary); outline:none; }
.eval-aspect-score { font-size:11px; color:var(--text3); white-space:nowrap; }
.comp-section { margin-bottom:8px; border:1px solid var(--border); border-radius:var(--radius-md); overflow:hidden; }
.comp-section-header { background:var(--bg); padding:6px 14px; font-size:12px; font-weight:600; color:var(--text); border-bottom:1px solid var(--border); display:flex; justify-content:space-between; align-items:center; }
.comp-row input:focus { background:#f0f7ff !important; }
.div-modal { width:860px; max-width:96vw; max-height:90vh; overflow-y:auto; }
.div-body { display:flex; gap:0; padding:0; min-height:300px; }
.div-col { flex:1; border-right:1px solid var(--border); }
.div-col:last-child { border-right:none; }
.div-col-header { background:var(--bg); padding:8px 12px; font-size:13px; font-weight:600; border-bottom:1px solid var(--border); display:flex; justify-content:space-between; align-items:center; position:sticky; top:56px; z-index:5; }
.div-col-body { padding:8px; }
.div-card { border:1px solid var(--border); border-radius:var(--radius-md); padding:10px 12px; margin-bottom:8px; background:var(--canvas-bg); position:relative; }
.div-card .div-card-del { position:absolute; top:4px; right:6px; font-size:13px; color:var(--red); cursor:pointer; border:none; background:none; padding:2px 4px; border-radius:var(--radius-sm); }
.div-card .div-card-del:hover { background:var(--red-light); }
.div-card label { display:block; font-size:10px; color:var(--text3); margin-bottom:2px; margin-top:6px; }
.div-card label:first-child { margin-top:0; }
.div-card input { width:100%; padding:4px 6px; font-size:12px; border:1px solid var(--border); border-radius:var(--radius-sm); font-family:inherit; box-sizing:border-box; }
.div-card input:focus { border-color:var(--primary); outline:none; }

/* Unified input focus ring */
input:focus, select:focus, textarea:focus {
  outline:none; border-color:var(--primary);
}
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline:none; border-color:var(--primary);
}

@media (max-width:700px) {
  .eval-modal { width:100vw; }
  .eval-item { flex-wrap:wrap; gap:4px; }
  .eval-item-desc { width:100%; }
}

/* ============================================================
   ALIGNMENT TOOLBAR
   ============================================================ */
.align-toolbar {
  position:fixed; bottom:20px; left:50%; transform:translateX(-50%);
  background:rgba(255,255,255,0.9); border:1px solid var(--shell-border); border-radius:var(--radius-xl);
  box-shadow:0 18px 42px rgba(23,32,51,0.12); padding:7px 10px; display:flex; align-items:center;
  gap:6px; z-index:150; user-select:none; backdrop-filter:blur(12px);
}
.align-toolbar .align-count { font-size:11px; color:var(--shell-muted); margin-right:4px; font-weight:600; }

/* ============================================================
   PRACTICE TABLE
   ============================================================ */
.practice-table { width:100%; border-collapse:separate; border-spacing:0; font-size:12px; background:rgba(255,255,255,0.86); border:1px solid var(--shell-border); border-radius:var(--radius-xl); overflow:hidden; box-shadow:0 12px 28px rgba(23,32,51,0.055); }
.practice-table th, .practice-table td { border-right:1px solid rgba(226,232,240,0.92); border-bottom:1px solid rgba(226,232,240,0.92); padding:7px 8px; }
.practice-table th { background:linear-gradient(180deg, rgba(247,249,253,0.98), rgba(239,243,249,0.96)); font-weight:700; color:#5d6a7d; position:relative; min-width:60px; }
.practice-table tr:last-child td { border-bottom:none; }
.practice-table th:last-child, .practice-table td:last-child { border-right:none; }
.practice-table th input { width:100%; border:none; background:transparent; font-weight:700; font-size:12px; text-align:center; font-family:inherit; color:#5d6a7d; }
.practice-table th input:focus { outline:none; }
.practice-table td input, .practice-table td textarea { width:100%; border:1px solid transparent; background:transparent; border-radius:var(--radius-md); padding:5px 7px; font-size:12px; font-family:inherit; color:var(--text); }
.practice-table td input:focus, .practice-table td textarea:focus { outline:none; border-color:rgba(51,112,255,0.42); background:#fff; box-shadow:0 0 0 3px rgba(51,112,255,0.09); }
.practice-table .practice-num { width:50px; text-align:center; color:var(--text3); }
.practice-table tbody tr:hover td { background:rgba(232,240,255,0.42); }
.practice-table .practice-del-col { position:absolute; top:4px; right:4px; font-size:10px; cursor:pointer; color:var(--text3); width:16px; height:16px; line-height:16px; text-align:center; border-radius:var(--radius-lg); }
.practice-table .practice-del-col:hover { color:var(--red); background:rgba(245,63,63,0.09); }
.practice-table .practice-del-row { font-size:13px; cursor:pointer; color:var(--text3); text-align:center; border-radius:var(--radius-lg); }
.practice-table .practice-del-row:hover { color:var(--red); background:rgba(245,63,63,0.09); }

/* ============================================================
   CANVAS TOOLBAR
   ============================================================ */
.canvas-toolbar {
  display:flex; gap:8px; align-items:center;
  padding:10px 20px 0; background:transparent;
  border-bottom:none; flex-shrink:0;
  user-select:none;
}
.canvas-toolbar .tbar-btn {
  padding:6px 12px; border:1px solid rgba(214,221,232,0.92); background:rgba(255,255,255,0.86);
  border-radius:var(--radius-lg); cursor:pointer; font-size:11px; color:#5d6a7d;
  font-family:inherit; white-space:nowrap;
}
.canvas-toolbar .tbar-btn:hover { border-color:rgba(206,215,229,0.92); color:var(--text); background:rgba(255,255,255,0.98); }
.canvas-toolbar .tbar-btn.open { background:rgba(255,255,255,1); border-color:rgba(206,215,229,0.92); color:var(--primary); box-shadow:0 8px 18px rgba(21,31,47,0.06); }
.tbar-dropdown {
  display:none; position:absolute; top:100%; left:0; margin-top:6px;
  background:var(--shell-panel-strong); border:1px solid var(--shell-border); border-radius:var(--radius-lg);
  box-shadow:0 18px 42px rgba(23,32,51,0.12); padding:6px; min-width:158px; z-index:100;
  backdrop-filter:blur(12px);
}
.tbar-dropdown.show { display:block; }
.tbar-dropdown .tbar-item {
  display:block; width:100%; text-align:left; padding:7px 12px; border:none;
  background:transparent; font-size:12px; cursor:pointer; color:var(--text2); font-family:inherit;
  white-space:nowrap; border-radius:var(--radius-md);
}
.tbar-dropdown .tbar-item:hover { background:rgba(232,240,255,0.8); color:var(--primary); }
.tbar-dropdown .tbar-item .tbar-shortcut { float:right; color:var(--text3); font-size:10px; margin-left:12px; }
.tbar-dropdown.tbar-dropdown-right { left:auto; right:0; }
.tbar-menu-note {
  padding:5px 12px 6px; margin:-6px -6px 5px; border-bottom:1px solid var(--shell-border);
  font-size:10px; color:var(--text3); white-space:nowrap;
}
/* Nested submenu (third level) for view options that no longer get their own
   toolbar row: timeline scale, plan presets and column visibility. */
.tbar-submenu { position:relative; }
.tbar-submenu > .tbar-parent { padding-right:28px; }
.tbar-submenu > .tbar-parent::after {
  content:'▸'; position:absolute; right:11px; top:50%; transform:translateY(-50%);
  font-size:9px; color:var(--text3); pointer-events:none;
}
.tbar-submenu-panel {
  display:none; position:absolute; left:100%; top:-6px; margin-left:2px;
  background:var(--shell-panel-strong); border:1px solid var(--shell-border);
  border-radius:var(--radius-lg); box-shadow:0 18px 42px rgba(23,32,51,0.12);
  padding:6px; min-width:150px; z-index:101; backdrop-filter:blur(12px);
}
.tbar-dropdown.tbar-dropdown-right .tbar-submenu-panel {
  left:auto; right:100%; margin-left:0; margin-right:2px;
}
.tbar-submenu:hover > .tbar-submenu-panel,
.tbar-submenu.open > .tbar-submenu-panel { display:block; }
.tbar-item.is-checked { color:var(--primary); font-weight:600; }
.tbar-item.is-checked::after { content:'✓'; float:right; margin-left:14px; }
.tbar-col-panel { padding:0; min-width:190px; }
.tbar-col-panel .plan-col-menu {
  position:static; display:block; border:none; box-shadow:none; padding:7px 0;
  min-width:0; background:transparent; margin:0;
}

/* ============================================================
   BASELINE MODE (read-only)
   ============================================================ */
body.baseline-mode .modal-btns .btn-primary,
body.baseline-mode .modal-btns .btn-danger { display:none; }
body.baseline-mode .modal-btns .btn-dashed { display:none; }
body.baseline-mode .btn-add-item { display:none; }
body.baseline-mode .btn-remove-item { display:none; }
body.baseline-mode .modal .field input,
body.baseline-mode .modal .field textarea,
body.baseline-mode .modal .field select { pointer-events:none !important; background:#f5f5f5 !important; }
body.baseline-mode .deps-list input { pointer-events:none !important; }
body.baseline-mode .deps-list label { pointer-events:none !important; }
body.baseline-mode #practiceModal .btn-dashed { display:none; }
body.baseline-mode .plan-table input,
body.baseline-mode .plan-table select { pointer-events:none !important; background:transparent !important; border-color:transparent !important; }
body.baseline-mode #flowchart { cursor:default !important; }
body.baseline-mode .user-bar .btn-primary { display:none !important; }
body.baseline-mode .user-bar #btnUndo,
body.baseline-mode .user-bar #btnRedo { display:none !important; }
body.baseline-mode .sidebar-footer button { pointer-events:none !important; opacity:0.3; }
body.baseline-mode .ws-actions { display:none !important; }
body.baseline-mode .topbar .btn-primary { display:none !important; }
/* Edit modal: hide action buttons */
body.baseline-mode #btnAddTask { display:none !important; }
body.baseline-mode #btnDemote { display:none !important; }
body.baseline-mode #btnPromote { display:none !important; }
body.baseline-mode #btnDelete { display:none !important; }
body.baseline-mode .dropdown-menu { display:none !important; }
/* Eval/Competency/Division modals: disable all inputs */
body.baseline-mode .eval-item-note input,
body.baseline-mode .comp-row input,
body.baseline-mode .comp-row select,
body.baseline-mode .div-card input { pointer-events:none !important; background:#f5f5f5 !important; }
body.baseline-mode .comp-row button,
body.baseline-mode .div-card-del { display:none !important; }
body.baseline-mode .comp-section-header button,
body.baseline-mode .div-col-header button { display:none !important; }
body.baseline-mode .eval-top-actions .btn-primary,
body.baseline-mode .comp-top-actions .btn-primary,
body.baseline-mode .div-top-actions .btn-primary { display:none !important; }

/* ============================================================
   NAVIGATION SYSTEM
   ============================================================ */
#navContainer { display:flex; flex-direction:column; height:100vh; width:100%; background:linear-gradient(180deg, #f7f9fc 0%, #eef2f8 100%); }
#navContainer.hidden { display:none; }
.nav-topbar {
  display:flex; align-items:center; background:rgba(255,255,255,0.88); border-bottom:1px solid var(--shell-border);
  padding:0 24px; height:56px; flex-shrink:0; gap:0; backdrop-filter:blur(16px);
  box-shadow:0 10px 28px rgba(23,32,51,0.045);
}
.nav-logo { font-size:18px; font-weight:800; color:#172033; margin-right:34px; letter-spacing:0.03em; }
.nav-tabs { display:flex; gap:6px; padding:4px; background:rgba(239,243,249,0.72); border:1px solid var(--shell-border); border-radius:var(--radius-lg); }
.nav-tab {
  padding:7px 14px; font-size:12px; font-weight:600; cursor:pointer;
  color:var(--text2); border-bottom:none; border-radius:var(--radius-md); transition:all var(--dur-fast) var(--ease-standard); user-select:none;
}
.nav-tab:hover { color:var(--text); background:rgba(255,255,255,0.72); }
.nav-tab.active { color:#fff; border-bottom-color:transparent; background:var(--primary-gradient); box-shadow:0 8px 18px rgba(51,112,255,0.16); }
.nav-topbar .nav-spacer { flex:1; }
.nav-user { display:flex; align-items:center; gap:8px; font-size:12px; color:var(--text2); }
.nav-user .username { font-weight:500; color:var(--text); }
.nav-body { display:flex; flex:1; overflow:hidden; }
.nav-sidebar {
  width:220px; background:rgba(255,255,255,0.68); border-right:1px solid var(--shell-border);
  display:flex; flex-direction:column; flex-shrink:0; padding:12px 10px; overflow-y:auto;
  box-shadow:inset -1px 0 0 rgba(255,255,255,0.72);
}
.nav-sidebar-item {
  padding:8px 12px; font-size:12px; color:var(--text2); cursor:pointer;
  border-left:none; border-radius:var(--radius-lg); user-select:none; transition:all var(--dur-fast) var(--ease-standard);
}
.nav-sidebar-item:hover { background:rgba(255,255,255,0.86); color:var(--text); box-shadow:var(--shadow-xs); }
.nav-sidebar-item.active { background:linear-gradient(135deg, rgba(232,240,255,0.98), rgba(246,248,255,0.96)); color:var(--primary); font-weight:700; border-left:none; box-shadow:0 8px 18px rgba(51,112,255,0.08); }
.nav-sidebar-divider { margin:8px 16px; border-top:1px solid var(--border); }
.nav-folder-item { position:relative; }
.nav-folder-item.active-folder { background:var(--active); color:var(--primary); font-weight:600; border-left:3px solid var(--primary); }
.folder-children.folder-collapsed { display:none !important; }
.folder-toggle { cursor:pointer; font-size:9px; display:inline-block; width:14px; flex-shrink:0; }
.nav-folder-item { padding-top:2px !important; padding-bottom:2px !important; }
.nav-content { flex:1; overflow-y:auto; padding:20px 28px 28px; }
.nav-content-header { display:flex; align-items:center; justify-content:space-between; margin:0 auto 16px; max-width:1240px; }
.nav-content-header h2 { font-size:22px; font-weight:800; letter-spacing:-0.03em; color:#172033; }
.nav-content-header .nav-actions { display:flex; gap:8px; align-items:center; }
.nav-search {
  padding:7px 12px; border:1px solid var(--shell-border); border-radius:var(--radius-lg);
  font-size:12px; width:220px; font-family:inherit; background:rgba(255,255,255,0.9);
  box-shadow:var(--shadow-xs);
}
.card-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(238px,1fr)); gap:10px; max-width:1240px; margin:0 auto; }
.card {
  background:linear-gradient(180deg, rgba(255,255,255,0.94), rgba(248,250,254,0.92)); border:1px solid var(--shell-border); border-radius:var(--radius-xl);
  padding:13px 14px; cursor:pointer; transition:background var(--dur-fast) var(--ease-standard), border-color var(--dur-fast) var(--ease-standard), box-shadow var(--dur-fast) var(--ease-standard); box-shadow:0 8px 18px rgba(23,32,51,0.04);
}
.card:hover { box-shadow:0 12px 26px rgba(51,112,255,0.13); border-color:rgba(51,112,255,0.42); background:linear-gradient(180deg, rgba(255,255,255,0.98), rgba(242,246,255,0.96)); }
.card-title { font-size:14px; font-weight:700; margin-bottom:4px; color:#172033; letter-spacing:-0.02em; }
.card-desc { font-size:11px; color:var(--shell-muted); margin-bottom:8px; line-height:1.42; overflow:hidden; text-overflow:ellipsis; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; }
.card-meta { display:flex; align-items:center; gap:5px; font-size:10px; color:var(--text3); flex-wrap:wrap; }
.card-meta .meta-item { display:inline-flex; align-items:center; gap:3px; padding:1px 5px; border-radius:999px; background:rgba(239,243,249,0.86); }
.card-meta .status-badge { font-size:10px; padding:1px 6px; border-radius:999px; font-weight:600; }
.card-meta .status-badge.pending { background:var(--s-pending); color:var(--s-pending-text); }
.card-meta .status-badge.in-progress { background:var(--s-progress); color:var(--s-progress-text); }
.card-meta .status-badge.done, .card-meta .status-badge.completed { background:var(--s-done); color:var(--s-done-text); }
.card-meta .status-badge.blocked { background:var(--s-blocked); color:var(--s-blocked-text); }
.card-actions { display:flex; gap:3px; margin-top:7px; flex-wrap:nowrap; }
.card-actions .btn { border-color:#ddd; font-size:10px; padding-left:6px; padding-right:6px; }
.comm-tab-btn { border-radius:0 !important; }
.card-actions button.fav-active { color:var(--gold); border-color:var(--gold); }
.workspace-view-toggle { display:inline-flex; align-items:center; gap:2px; padding:2px; border:1px solid var(--shell-border); border-radius:var(--radius-lg); background:rgba(239,243,249,0.72); }
.workspace-view-toggle button { border:none; background:transparent; box-shadow:none; min-height:24px; padding:0 9px; color:var(--text3); font-size:11px; border-radius:var(--radius-md); cursor:pointer; }
.workspace-view-toggle button:hover { color:var(--primary); background:rgba(255,255,255,0.78); box-shadow:none; }
.workspace-view-toggle button.active { color:var(--primary); background:#fff; font-weight:700; box-shadow:0 4px 12px rgba(23,32,51,0.06); }
.workspace-list {
  display:block; max-width:1240px; margin:0 auto; overflow:hidden;
  background:rgba(255,255,255,0.86); border:1px solid rgba(218,224,234,0.96); border-radius:var(--radius-xl);
}
.workspace-list-header, .workspace-list-row {
  display:grid; grid-template-columns:minmax(180px,1.55fr) minmax(220px,2fr) 90px 92px 150px minmax(260px,auto);
  align-items:center; column-gap:12px;
}
.workspace-list-header {
  display:grid; grid-template-columns:minmax(180px,1.55fr) minmax(220px,2fr) 90px 92px 150px minmax(260px,auto); align-items:center; column-gap:12px;
  min-height:36px; padding:0 14px; background:rgba(247,249,253,0.96); text-align:center;
  border-bottom:1px solid rgba(218,224,234,0.96); color:#506072; font-size:11px; font-weight:700;
}
.workspace-list-body { display:block; padding:4px 0; }
.workspace-list-row {
  min-height:42px; padding:0 14px; cursor:pointer; background:transparent;
  transition:background var(--dur-fast) var(--ease-standard), color var(--dur-fast) var(--ease-standard);
}
.workspace-list-row:hover { background:rgba(232,240,255,0.72); }
.workspace-list-cell { min-width:0; font-size:12px; color:var(--text2); }
.workspace-list-cell-name { font-size:13px; font-weight:700; color:#172033; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.workspace-list-cell-desc { color:var(--shell-muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.workspace-list-cell-count, .workspace-list-cell-status, .workspace-list-cell-time { white-space:nowrap; color:var(--text3); }
.workspace-list-cell-actions { display:flex; align-items:center; justify-content:flex-end; gap:3px; min-width:0; }
.workspace-list-cell-actions .btn { border-color:#ddd; font-size:10px; padding-left:6px; padding-right:6px; }
.tpl-card .tpl-badge { display:inline-block; font-size:10px; padding:2px 8px; border-radius:var(--radius-sm); margin-bottom:8px; font-weight:500; }
.tpl-card .tpl-badge.official { background:var(--active); color:var(--primary); }
.tpl-card .tpl-badge.community { background:var(--hover); color:var(--text3); }
.nav-empty { text-align:center; padding:48px 20px; color:var(--text3); }
.nav-empty .icon { font-size:40px; margin-bottom:16px; }
.nav-empty p { font-size:13px; margin-bottom:8px; }
.friend-list { display:flex; flex-direction:column; gap:8px; }
.friend-row {
  display:flex; align-items:center; gap:12px; padding:10px 14px;
  background:var(--white); border:1px solid var(--border); border-radius:var(--radius-lg);
}
.friend-row .friend-name { flex:1; font-size:13px; font-weight:500; }
.friend-row .friend-status { font-size:11px; color:var(--text3); }
.search-results { margin-top:8px; }
.search-result-item {
  display:flex; align-items:center; gap:10px; padding:8px 12px;
  background:var(--white); border:1px solid var(--border); border-radius:var(--radius-md); margin-bottom:4px;
}
.search-result-item .name { flex:1; font-size:12px; }
.teams-placeholder { text-align:center; padding:80px 20px; }
.teams-placeholder .icon { font-size:48px; margin-bottom:20px; }
.teams-placeholder h3 { font-size:17px; color:var(--text); margin-bottom:8px; }
.teams-placeholder p { color:var(--text3); font-size:12px; }

/* ============================================================
   HOME PAGE (unauthenticated landing + login)
   ============================================================ */
.home-page {
  position: fixed;
  inset: 0;
  z-index: 300;
  overflow-y: auto;
  background:
    radial-gradient(circle at 12% 10%, rgba(79,110,247,0.18), transparent 28%),
    radial-gradient(circle at 82% 16%, rgba(83,207,255,0.14), transparent 24%),
    linear-gradient(180deg, #fcfdff 0%, #f6f8fc 46%, #ffffff 100%);
  color: var(--text);
}
.home-page.hidden { display: none; }
.home-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 28px;
  background: rgba(255,255,255,0.8);
  border-bottom: 1px solid rgba(229,230,235,0.72);
  backdrop-filter: blur(16px);
}
.home-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #172033;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.home-nav-pills {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-left: 16px;
}
.home-nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 4px 0;
  background: none;
  border: none;
  color: #172033;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-standard);
}
.home-nav-pill:hover {
  color: var(--primary);
}
.home-nav-pill-arrow {
  font-size: 7px;
  opacity: 0.4;
}
.home-brand img {
  width: 38px;
  height: 38px;
  border-radius:var(--radius-lg);
  object-fit: cover;
  box-shadow: 0 10px 24px rgba(51,112,255,0.18);
}
.home-hero.home-hero-centered {
  max-width: 1280px;
  margin: 0 auto;
  padding: 56px 28px 86px max(56px, 5vw);
  display: grid;
  grid-template-columns: 61.8fr 38.2fr;
  align-items: center;
  gap: min(5vw, 64px);
}
.home-hero-manifesto {
  max-width: 920px;
  display: grid;
  gap: 18px;
  align-items: start;
}
.home-hero-manifesto h1 {
  margin: 0;
  font-size: clamp(36px, 5vw, 62px);
  line-height: 0.98;
  letter-spacing: -0.07em;
  color: #172033;
  font-weight: 500;
}
.home-eyebrow {
  color: #68758a;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.home-hero-subtitle {
  max-width: 680px;
  margin: 0;
  color: #536277;
  font-size: clamp(15px, 1.7vw, 19px);
  line-height: 1.65;
  letter-spacing: -0.02em;
}
.home-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

.home-btn,
.home-card,
.home-login-card,
.home-view-pill,
.home-nav-pill,
.home-card-icon {
  transition: all var(--dur-fast) var(--ease-standard);
}
.home-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid rgba(222,226,235,0.9);
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.94);
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
}
.home-btn:hover {
  border-color: rgba(79,110,247,0.34);
  color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(23,32,51,0.08);
}
.home-btn:active { transform: translateY(0); }
.home-btn.home-btn-primary {
  background: var(--primary-gradient);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 12px 24px rgba(51,112,255,0.22);
}
.home-btn.home-btn-primary:hover {
  color: #fff;
  box-shadow: var(--shadow-glow);
}
.home-btn.home-btn-outline {
  background: rgba(255,255,255,0.84);
  border-color: rgba(179,192,219,0.9);
  color: #31456d;
}
.home-btn.home-btn-outline:hover {
  border-color: rgba(79,110,247,0.34);
  color: var(--primary);
  background: rgba(255,255,255,0.96);
}
.home-login-card {
  position: relative;
  background: linear-gradient(180deg, rgba(255,255,255,0.94), rgba(251,252,255,0.9));
  border: 1px solid rgba(226,232,240,0.9);
  border-radius:var(--radius-2xl);
  padding: 32px;
  box-shadow: 0 28px 72px rgba(23,32,51,0.14);
  backdrop-filter: blur(10px);
}
.home-login-card.home-login-secondary {
  width: min(420px, 100%);
  margin-top: 4px;
  background: rgba(255,255,255,0.78);
  border: 1px solid rgba(220,226,238,0.92);
  box-shadow: 0 18px 42px rgba(23,32,51,0.08);
}
.home-login-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.75);
}
.home-login-card h2 {
  margin: 0 0 10px;
  color: #172033;
  font-size: 24px;
  letter-spacing: -0.01em;
}
.home-login-card .sub {
  color: var(--text2);
  margin-bottom: 18px;
  font-size: 13px;
  line-height: 1.65;
}
.home-login-card .error {
  min-height: 18px;
  color: var(--red);
  font-size: 12px;
  margin-bottom: 8px;
}
.home-login-card input {
  width: 100%;
  height: 48px;
  margin-bottom: 12px;
  padding: 0 14px;
  border: 1px solid rgba(222,226,235,0.95);
  border-radius:var(--radius-md);
  background: rgba(249,251,255,0.96);
  color: var(--text);
  font-size: 14px;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.72);
}
.home-login-card input:focus {
  border-color: rgba(51,112,255,0.65);
  box-shadow: 0 0 0 3px rgba(79,110,247,0.11);
  background: #fff;
}
.home-login-card .link {
  margin-top: 14px;
  text-align: center;
  color: var(--primary);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}
.home-login-card .link:hover { color: var(--primary-hover); }

/* Login channel tabs + phone / WeChat panels */
.auth-inline-field {
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
}
.auth-inline-field .auth-inline-label {
  flex: 0 0 30px; text-align: right; font-size: 12px; color: var(--text2); white-space: nowrap;
}
.auth-inline-field .auth-inline-input-wrap {
  position: relative; flex: 1; min-width: 0; display: block;
}
.auth-inline-field input { width: 100%; margin-bottom: 0 !important; }
.auth-tabs {
  display: flex; gap: 4px; margin: 0 0 14px; padding: 3px;
  border: 1px solid rgba(220,226,238,0.92); border-radius: var(--radius-lg);
  background: rgba(239,243,249,0.78);
}
.auth-tab {
  flex: 1; min-height: 32px; border: none; border-radius: var(--radius-md);
  background: transparent; color: var(--text2); font: inherit; font-size: 12px;
  font-weight: 600; cursor: pointer; white-space: nowrap;
}
.auth-tab:hover { color: var(--text); }
.auth-tab.active { background: #fff; color: var(--primary); box-shadow: 0 3px 10px rgba(23,32,51,0.08); }
.auth-subtabs { display: flex; gap: 12px; margin: 0 0 12px; font-size: 12px; }
.auth-subtab {
  border: none; background: transparent; padding: 2px 0; font: inherit;
  color: var(--text3); cursor: pointer; border-bottom: 2px solid transparent;
}
.auth-subtab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 700; }
.phone-code-row { display: flex; gap: 8px; align-items: stretch; }
.phone-code-row input { flex: 1; min-width: 0; margin-bottom: 12px; }
.send-code-btn {
  flex: 0 0 auto; min-width: 96px; height: 48px; margin-bottom: 12px; padding: 0 10px;
  border: 1px solid rgba(51,112,255,0.35); border-radius: var(--radius-md);
  background: rgba(51,112,255,0.08); color: var(--primary); font: inherit; font-size: 12px;
  cursor: pointer; white-space: nowrap;
}
.send-code-btn:disabled { opacity: .55; cursor: default; }
.auth-hint { font-size: 11px; color: var(--text3); line-height: 1.6; margin: 6px 0 10px; }
.auth-consent {
  display: flex; align-items: flex-start; gap: 7px; margin: 2px 0 12px;
  font-size: 11px; color: var(--text2); line-height: 1.5; cursor: pointer;
}
.auth-consent input { width: 15px !important; height: 15px !important; margin: 1px 0 0 !important; padding: 0 !important; flex: 0 0 auto; }
.auth-choice { display: flex; flex-direction: column; gap: 9px; }
.auth-choice-btn {
  min-height: 44px; border: 1px solid rgba(51,112,255,0.28); border-radius: var(--radius-md);
  background: rgba(255,255,255,0.9); color: var(--primary); font: inherit; font-size: 13px;
  font-weight: 600; cursor: pointer;
}
.auth-choice-btn:hover { background: rgba(232,240,255,0.8); }
.wechat-login-panel { padding: 6px 0 2px; }
.wechat-login-icon { text-align: center; font-size: 42px; line-height: 1.1; margin-bottom: 4px; }
.wechat-login-btn { background: #07c160 !important; border-color: #07c160 !important; }
.wechat-login-btn:hover { background: #06ad56 !important; border-color: #06ad56 !important; }

/* Profile: login-method bindings */
.profile-login-methods {
  margin: 14px 0 4px; padding: 12px; border: 1px solid var(--border-light);
  border-radius: var(--radius-md); background: rgba(248,250,253,0.8);
}
.profile-login-methods h4 { margin: 0 0 8px; font-size: 12px; color: var(--text2); }
.profile-login-row { display: flex; align-items: center; gap: 8px; min-height: 32px; font-size: 12px; }
.profile-login-row + .profile-login-row { border-top: 1px dashed var(--border-light); }
.profile-login-row .pl-name { width: 54px; flex: 0 0 auto; color: var(--text3); }
.profile-login-row .pl-value { flex: 1; min-width: 0; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-login-row .pl-actions { flex: 0 0 auto; display: flex; gap: 4px; }
.profile-login-row .pl-disabled { font-size: 10px; color: var(--text3); }
.profile-dialog {
  width: min(400px, 92vw); padding: 22px; border-radius: var(--radius-lg);
  background: var(--white); box-shadow: var(--shadow-xl);
}
.profile-dialog h3 { margin: 0 0 6px; font-size: 16px; }
.profile-dialog .field { margin-bottom: 12px; }
.profile-dialog .field label { display: block; font-size: 12px; color: var(--text3); margin-bottom: 5px; }
.profile-dialog .field input {
  width: 100%; height: 40px; padding: 0 10px; border: 1px solid var(--border);
  border-radius: var(--radius-md); font: inherit; font-size: 13px; outline: none;
}
.profile-dialog .phone-code-row input { margin-bottom: 0; }
.profile-dialog .send-code-btn { height: 40px; margin-bottom: 0; }
.profile-dialog .error { min-height: 18px; color: var(--red); font-size: 12px; margin-bottom: 6px; }
.profile-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.home-section {
  position: relative;
  padding: 92px 28px 92px max(56px, 5vw);
  background: linear-gradient(180deg, #f7f8fb 0%, #f2f4f8 100%);
}
.home-section-muted {
  background: linear-gradient(180deg, rgba(244,246,250,0.98) 0%, rgba(237,240,246,0.96) 100%);
}
.home-section-inner {
  max-width: 1180px;
  margin: 0 auto;
}
.home-section-title {
  max-width: 820px;
  margin: 0 auto 44px;
  text-align: center;
}
.home-section-title h2 {
  margin: 0 0 14px;
  font-size: clamp(34px, 4.3vw, 52px);
  line-height: 1.02;
  color: #172033;
  letter-spacing: -0.055em;
  font-weight: 500;
}
.home-section-title p {
  margin: 0;
  color: #65748a;
  font-size: 15px;
  line-height: 1.78;
  letter-spacing: -0.015em;
}
.home-grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; }
.home-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.home-grid-5 { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.home-card {
  min-height: 100%;
  padding: 28px 24px;
  border: 1px solid rgba(222,227,236,0.92);
  border-radius:var(--radius-2xl);
  background: linear-gradient(180deg, rgba(252,253,255,0.94), rgba(242,245,250,0.94));
  box-shadow: 0 16px 34px rgba(27,36,53,0.05);
}
.home-card:hover {
  transform: translateY(-2px);
  border-color: rgba(79,110,247,0.22);
  box-shadow: 0 18px 36px rgba(27,36,53,0.08);
}
.home-card h3 {
  margin: 0 0 10px;
  color: #1e2d4a;
  font-size: 17px;
  line-height: 1.35;
  letter-spacing: -0.02em;
  font-weight: 700;
}
/* Unified tech-style card hover highlight */
.home-card:hover {
  border-color: var(--primary);
  box-shadow: 0 8px 32px rgba(51,112,255,0.14);
  background: linear-gradient(180deg, rgba(245,248,255,0.98), rgba(232,238,252,0.96));
}
.home-card:hover h3 { color: var(--primary); }
.home-card p {
  margin: 0;
  color: #5e6d82;
  font-size: 13px;
  line-height: 1.72;
  letter-spacing: -0.012em;
}
.home-card-icon {
  display: none;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  border-radius:var(--radius-xl);
  background: linear-gradient(180deg, rgba(245,248,253,0.98), rgba(231,237,247,0.94));
  border: 1px solid rgba(207,216,232,0.7);
  color: rgba(79,110,247,0.68);
  font-size: 17px;
  opacity: 0.94;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.9);
}
.home-card:hover .home-card-icon {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(51,112,255,0.08), inset 0 1px 0 rgba(255,255,255,0.9);
}
.home-view-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 64px;
  padding: 14px 16px;
  border-radius:var(--radius-2xl);
  background: linear-gradient(180deg, rgba(252,253,255,0.94), rgba(241,245,251,0.94));
  border: 1px solid rgba(220,226,237,0.92);
  color: #27344a;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  letter-spacing: -0.01em;
  box-shadow: 0 12px 24px rgba(27,36,53,0.05);
}
.home-view-pill:hover {
  transform: translateY(-1px);
  border-color: rgba(79,110,247,0.22);
  color: var(--primary);
}
.home-footer {
  padding: 42px 28px 54px;
  background: linear-gradient(180deg, #0d1b3e 0%, #0a1628 40%, #0f2247 100%);
  border-top: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.78);
  text-align: center;
  font-size: 13px;
  letter-spacing: 0.03em;
}
@media (max-width: 980px) {
  .home-header { padding: 14px 20px; }
  .home-nav-pills { display: none; }
  .home-hero.home-hero-centered { grid-template-columns: 1fr; padding: 72px 28px 60px; gap: 36px; }
  .home-section { padding-left: 28px; padding-right: 28px; }
  .home-hero-manifesto h1 { letter-spacing: -0.07em; }
  .home-login-card.home-login-secondary { width: min(520px, 100%); margin: 0 auto; }
  .home-grid-4, .home-grid-3, .home-grid-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .home-page { font-size: 12px; }
  .home-brand { font-size: 15px; }
  .home-brand img { width: 34px; height: 34px; }
  .home-hero.home-hero-centered { grid-template-columns: 1fr; padding: 52px 20px 46px; }
  .home-hero-manifesto h1 { font-size: 32px; }
  .home-login-card,
  .home-login-card.home-login-secondary { padding: 24px 22px; border-radius:var(--radius-2xl); }
  .home-section { padding: 58px 20px; }
  .home-grid-4, .home-grid-3, .home-grid-5 { grid-template-columns: 1fr; }
  .home-btn { width: 100%; }
}

/* ============================================================
   MANAGEMENT ANALYSIS DASHBOARD
   ============================================================ */
.analysis-dashboard { padding: 18px; max-width: 1180px; margin: 0 auto; overflow-y: auto; height: 100%; color: var(--text); }
.analysis-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.analysis-title h2 { margin: 0 0 4px; font-size: 18px; font-weight: 700; }
.analysis-title p { margin: 0; font-size: 11px; color: var(--text3); }
.analysis-title-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.analysis-explain-btn { border: 1px solid var(--shell-border); background: rgba(255,255,255,0.86); color: var(--text2); border-radius: 999px; padding: 3px 9px; font-size: 11px; cursor: pointer; box-shadow:var(--shadow-xs); }
.analysis-explain-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.analysis-explain-overlay { position: fixed; inset: 0; z-index: 700; background: rgba(15,23,42,0.38); display: flex; align-items: center; justify-content: center; padding: 24px; backdrop-filter:blur(5px); }
.analysis-explain-modal { width: min(760px, 94vw); max-height: 86vh; overflow-y: auto; background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,254,0.96)); border-radius:var(--radius-2xl); box-shadow: 0 28px 72px rgba(23,32,51,0.18); border: 1px solid var(--shell-border); }
.analysis-explain-head { display:flex; align-items:center; justify-content:space-between; padding:16px 18px; border-bottom:1px solid var(--shell-border); background:rgba(255,255,255,0.72); }
.analysis-explain-head h3 { margin:0; font-size:17px; font-weight:800; letter-spacing:-0.03em; color:#172033; }
.analysis-explain-body { padding:18px; font-size:12px; line-height:1.75; color:var(--text2); }
.analysis-explain-body h4 { margin:14px 0 8px; color:var(--text); font-size:13px; }
.analysis-explain-body ul { margin:6px 0 10px 18px; padding:0; }
.analysis-explain-table { width:100%; border-collapse:collapse; font-size:12px; margin:8px 0 12px; }
.analysis-explain-table th,.analysis-explain-table td { border-bottom:1px solid var(--border-light); padding:6px 8px; text-align:left; }
.analysis-explain-formula { background:#f8fafc; border:1px solid var(--border-light); border-radius:var(--radius-md); padding:10px 12px; color:var(--text); font-family:monospace; white-space:pre-wrap; }
.analysis-health { display: grid; grid-template-columns: 156px repeat(5, minmax(92px, 1fr)); gap: 10px; margin-bottom: 12px; }
.analysis-health-main { border-radius:var(--radius-lg); padding: 14px; color: #fff; min-height: 92px; display: flex; flex-direction: column; justify-content: space-between; box-shadow: var(--shadow-md); }
.analysis-health-score { font-size: 34px; font-weight: 800; line-height: 1; }
.analysis-health-label { font-size: 12px; opacity: .92; }
.analysis-kpi { background: var(--white); border: 1px solid var(--border); border-radius:var(--radius-lg); padding: 12px; min-height: 82px; box-shadow: var(--shadow-xs); }
.analysis-kpi .label { font-size: 11px; color: var(--text3); margin-bottom: 7px; }
.analysis-kpi .value { font-size: 22px; font-weight: 800; line-height: 1; }
.analysis-kpi .hint { font-size: 10px; color: var(--text3); margin-top: 8px; }
.analysis-insights { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.analysis-insight { border-radius:var(--radius-md); padding: 9px 11px; border: 1px solid transparent; font-size: 12px; line-height: 1.55; }
.analysis-insight.risk { background: #fff1f0; border-color: #ffd1cc; color: #a8071a; }
.analysis-insight.warn { background: #fff7e6; border-color: #ffe1a6; color: #ad6800; }
.analysis-insight.info { background: #e8f3ff; border-color: #c7ddff; color: #1d4ed8; }
.analysis-insight.good { background: #e8fff3; border-color: #b7ebd0; color: #047857; }
.analysis-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.analysis-card { background: var(--white); border: 1px solid var(--border); border-radius:var(--radius-lg); padding: 14px; box-shadow: var(--shadow-xs); min-width: 0; }
.analysis-card h3 { margin: 0 0 5px; font-size: 13px; font-weight: 700; }
.analysis-card .summary { font-size: 11px; color: var(--text3); line-height: 1.5; margin-bottom: 10px; }
.analysis-row { display: flex; align-items: center; gap: 8px; margin: 7px 0; font-size: 11px; }
.analysis-row .name { width: 82px; flex-shrink: 0; color: var(--text2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.analysis-row .count { width: 58px; flex-shrink: 0; text-align: right; color: var(--text3); }
.analysis-bar { flex: 1; height: 9px; border-radius: 999px; background: #edf1f7; overflow: hidden; min-width: 48px; }
.analysis-bar > span { display: block; height: 100%; border-radius: 999px; min-width: 2px; }
.analysis-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.analysis-table th { text-align: left; color: var(--text3); font-weight: 600; padding: 6px 5px; border-bottom: 1px solid var(--border); }
.analysis-table td { padding: 6px 5px; border-bottom: 1px solid var(--border-light); vertical-align: middle; }
.analysis-table tr:last-child td { border-bottom: none; }
.analysis-badge { display: inline-flex; align-items: center; padding: 2px 7px; border-radius: 999px; font-size: 10px; font-weight: 600; background: var(--hover); color: var(--text2); }
.analysis-badge.red { background: #fff1f0; color: #cf1322; }
.analysis-badge.orange { background: #fff7e6; color: #d46b08; }
.analysis-badge.blue { background: #e8f3ff; color: #1d4ed8; }
.analysis-badge.green { background: #e8fff3; color: #047857; }
.analysis-risk-list { display: flex; flex-direction: column; gap: 6px; }
.analysis-risk-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 8px; border: 1px solid var(--border-light); border-radius:var(--radius-md); background: #fbfcff; font-size: 11px; }
.analysis-risk-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.analysis-risk-meta { color: var(--text3); margin-top: 3px; }
.analysis-empty { text-align: center; padding: 50px; color: var(--text3); }
.analysis-card-wide { grid-column: 1 / -1; }
.analysis-eval-meta { font-size: 10px; color: var(--text3); margin: -3px 0 9px 90px; }
.analysis-eval-subtitle { font-size: 11px; font-weight: 700; color: var(--text2); margin: 14px 0 6px; }
.analysis-eval-tag { font-size: 9px; color: var(--text3); background: var(--hover); padding: 1px 5px; border-radius: 999px; }
.analysis-eval-table { margin-top: 8px; }
.analysis-eval-table th:nth-child(n+2), .analysis-eval-table td:nth-child(n+2) { text-align: center; }
@media (max-width: 980px) { .analysis-health { grid-template-columns: repeat(2, minmax(0, 1fr)); } .analysis-health-main { grid-column: span 2; } .analysis-insights, .analysis-grid { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .analysis-dashboard { padding: 12px; } .analysis-health { grid-template-columns: 1fr; } .analysis-health-main { grid-column: span 1; } .analysis-head { flex-direction: column; } }

/* Workspace shell responsive */
@media (max-width: 1100px) { .sidebar { width: 268px; } .topbar-mainline { padding: 8px 20px; } .view-toggle { gap: 4px; } .view-toggle button { padding: 0 8px; font-size: 10px; } }
@media (max-width: 860px) {
  .topbar-mainline { padding: 6px 16px; }
  .toolbar-spacer { display: none; }
  .view-toggle { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .eventlist-wrap { padding: 0 12px 12px; }
  .eventlist-wrap > .event-table { margin-top: 12px; }
}

/* ============================================================
   INNOVATION EVALUATION MODULE
   ============================================================ */
.innovation-page { display: none; flex-direction: column; height: 100%; overflow: hidden; }
.innovation-page.active { display: flex; }
.innovation-topbar { display: flex; align-items: center; gap: 8px; padding: 12px 18px; background: var(--white); border-bottom: 1px solid var(--border); flex-shrink: 0; }
.innovation-topbar h2 { font-size: 16px; font-weight: 700; color: var(--text); white-space: nowrap; }
.innovation-content { flex: 1; overflow-y: auto; padding: 18px; }

/* Search & filter */
.innovation-search { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.innovation-search input { padding: 6px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 13px; min-width: 200px; color: var(--text); background: var(--white); }
.innovation-search select { padding: 6px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 13px; color: var(--text); background: var(--white); }

/* List / Card grid */
.innovation-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; }
.innovation-item { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; cursor: pointer; transition: box-shadow var(--dur-fast) var(--ease-standard), border-color var(--dur-fast) var(--ease-standard); }
.innovation-item:hover { border-color: var(--primary); box-shadow: var(--shadow-md); }
.innovation-item .item-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.innovation-item .item-title { font-weight: 600; font-size: 14px; color: var(--text); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.innovation-item .item-type { font-size: 11px; color: var(--text3); background: var(--neutral-light); padding: 2px 8px; border-radius: var(--radius-full); white-space: nowrap; }
.innovation-item .item-meta { display: flex; gap: 16px; font-size: 11px; color: var(--text3); margin-top: 8px; }
.innovation-item .item-score { font-weight: 600; font-size: 20px; color: var(--primary); }

/* Level badges */
.innovation-level { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; font-weight: 700; font-size: 13px; color: #fff; flex-shrink: 0; }
.innovation-level.A { background: #8b5cf6; }
.innovation-level.B { background: #3b82f6; }
.innovation-level.C { background: #10b981; }
.innovation-level.D { background: #f59e0b; }
.innovation-level.E { background: #9ca3af; }

/* Form */
.innovation-form { max-width: 1100px; margin: 0 auto; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px; }
.innovation-form-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 12px; }
.innovation-form-table th,
.innovation-form-table td { border: 1.5px solid var(--border); padding: 6px 8px; vertical-align: top; }
.innovation-form-table th { background: var(--hover); color: var(--text3); font-weight: 600; text-align: center; }
.innovation-form-section-cell { background: var(--white); color: var(--text); font-weight: 600; text-align: center; vertical-align: middle !important; white-space: nowrap; }
.innovation-form-field-cell { color: var(--text2); font-weight: 500; text-align: center; vertical-align: middle !important; }
.innovation-form-value-cell { color: var(--text); }
.innovation-form-field-cell .required { color: var(--red); margin-left: 2px; }
.innovation-form-table input,
.innovation-form-table textarea,
.innovation-form-table select { width: 100%; padding: 5px 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 13px; color: var(--text); background: var(--white); font-family: inherit; box-sizing: border-box; }
.innovation-form-table textarea { min-height: 30px; height: 30px; resize: none; line-height: 1.35; overflow:hidden; }
.innovation-form .form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }
.innovation-dashboard-actions { display: flex; justify-content: flex-end; gap: 8px; margin-bottom: 12px; }

/* Detail */
.innovation-detail { max-width: 860px; margin: 0 auto; }
.innovation-detail .result-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; margin-bottom: 16px; }
.innovation-detail .result-header { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; }
.innovation-detail .result-score { font-size: 40px; font-weight: 800; color: var(--primary); line-height: 1; }
.innovation-detail .result-conclusion { font-size: 14px; color: var(--text2); font-style: italic; margin-top: 8px; }
.innovation-detail .input-summary { background: var(--hover); border-radius: var(--radius-md); padding: 14px; margin-bottom: 16px; }
.innovation-detail .input-summary .summary-row { display: flex; gap: 8px; margin-bottom: 6px; font-size: 12px; }
.innovation-detail .input-summary .summary-label { color: var(--text3); white-space: nowrap; min-width: 80px; }
.innovation-detail .input-summary .summary-value { color: var(--text); }

/* Dimension table */
.dim-table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 12px; }
.dim-table th, .dim-table td { padding: 8px 12px; border-bottom: 1px solid var(--border-light); text-align: left; }
.dim-table th { color: var(--text3); font-weight: 500; background: var(--hover); }
.dim-table td { color: var(--text); }
.dim-bar { width: 100px; height: 6px; background: var(--border-light); border-radius: var(--radius-full); overflow: hidden; }
.dim-bar-fill { height: 100%; border-radius: var(--radius-full); background: var(--primary); transition: width 0.4s var(--ease-standard); }

/* Review blocks */
.review-block { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 14px; margin-bottom: 10px; }
.review-block h4 { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.review-block p { font-size: 12px; color: var(--text2); line-height: 1.6; white-space: pre-wrap; }

/* Tags */
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: var(--radius-full); font-size: 11px; font-weight: 500; }
.tag.strength { background: var(--green-light); color: #047857; }
.tag.weakness { background: var(--red-light); color: #b91c1c; }
.tag.attention { background: var(--orange-light); color: #c2410c; }

/* Recommendation badges */
.rec-badge { display: inline-flex; align-items: center; padding: 5px 14px; border-radius: var(--radius-full); font-size: 13px; font-weight: 600; }
.rec-badge.promote { background: #e8fff3; color: #047857; }
.rec-badge.pilot { background: var(--primary-light); color: var(--primary); }
.rec-badge.optimize { background: var(--orange-light); color: #c2410c; }
.rec-badge.archive { background: var(--neutral-light); color: var(--text3); }

/* Loading spinner */
.innovation-loading { display: none; align-items: center; justify-content: center; padding: 40px; gap: 12px; color: var(--text3); font-size: 13px; }
.innovation-loading.active { display: flex; }
.innovation-loading .spinner { width: 24px; height: 24px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: innovation-spin 0.8s linear infinite; }
@keyframes innovation-spin { to { transform: rotate(360deg); } }

/* Dashboard */
.innovation-dashboard { max-width: 960px; margin: 0 auto; }
.innovation-dashboard .dash-kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 18px; }
.innovation-dashboard .dash-kpi-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px; text-align: center; }
.innovation-dashboard .dash-kpi-card .kpi-value { font-size: 28px; font-weight: 700; color: var(--text); }
.innovation-dashboard .dash-kpi-card .kpi-label { font-size: 11px; color: var(--text3); margin-top: 4px; }
.innovation-dashboard .dash-chart-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px; margin-bottom: 14px; }
.innovation-dashboard .dash-chart-card h4 { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 12px; }
.innovation-dashboard .dash-bar-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 12px; }
.innovation-dashboard .dash-bar-label { width: 100px; color: var(--text2); text-align: right; flex-shrink: 0; }
.innovation-dashboard .dash-bar-track { flex: 1; height: 16px; background: var(--border-light); border-radius: var(--radius-full); overflow: hidden; position: relative; }
.innovation-dashboard .dash-bar-track .dash-bar-fill { height: 100%; border-radius: var(--radius-full); }
.innovation-dashboard .dash-bar-val { width: 40px; color: var(--text3); font-size: 11px; flex-shrink: 0; }

/* Action buttons in detail */
.innovation-detail .detail-actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }

/* Empty state */
.innovation-empty { text-align: center; padding: 60px 20px; color: var(--text3); }
.innovation-empty .icon { font-size: 40px; margin-bottom: 12px; }
.innovation-empty p { font-size: 13px; margin-bottom: 6px; }
.gewu-root-layout { display:grid; grid-template-columns:260px minmax(560px,1fr) 340px; height:calc(100vh - 140px); gap:12px; padding:12px; box-sizing:border-box; }
.gewu-sidebar, .gewu-detail-panel, .gewu-main { background:var(--white); border:1px solid var(--border); border-radius:var(--radius-lg); box-shadow:var(--shadow-xs); min-width:0; display:flex; flex-direction:column; min-height:0; overflow:hidden; }
.gewu-sidebar, .gewu-detail-panel { padding:14px; }
.gewu-main { padding:14px; }
.gewu-scroll { overflow:auto; min-height:0; }
.gewu-parameter-dashboard { display:grid; gap:8px; }
.gewu-param-card { border:1px solid #fde68a; background:#fef3c7; color:#78350f; border-radius:var(--radius-lg); padding:10px; cursor:pointer; font-size:12px; line-height:1.45; }
.gewu-param-card-selected { outline:2px solid var(--primary); box-shadow:0 0 0 3px #dbeafe; }
.gewu-param-top { display:flex; align-items:center; justify-content:space-between; gap:8px; font-weight:800; }
.gewu-score { border-radius:999px; padding:2px 8px; background:#fee2e2; color:#991b1b; font-size:11px; }
.gewu-network-toolbar { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:10px; flex:0 0 auto; }
.gewu-network-toolbar button { border:1px solid var(--border); border-radius:999px; background:#fff; padding:7px 10px; cursor:pointer; font-size:12px; font-weight:700; color:var(--text); }
.gewu-network-toolbar button:hover { border-color:var(--primary); color:var(--primary); }
.gewu-network-toolbar .danger { color:var(--red); border-color:#fecaca; background:#fff7f7; }
.gewu-network-board { position:relative; min-height:620px; border:1px dashed #cbd5e1; border-radius:var(--radius-xl); background:radial-gradient(circle at 50% 35%, #eff6ff 0, #fff 45%, #f8fafc 100%); overflow:hidden; flex:1 1 auto; }
.gewu-component-node { position:absolute; width:132px; min-height:66px; border-radius:var(--radius-xl); border:2px solid #bfdbfe; background:#dbeafe; color:#1e3a8a; display:flex; align-items:center; justify-content:center; text-align:center; padding:10px; box-sizing:border-box; font-size:13px; line-height:1.35; font-weight:800; cursor:move; box-shadow:0 8px 20px rgba(30,58,138,.08); }
.gewu-component-node.hot { background:#fee2e2; border-color:#fecaca; color:#991b1b; }
.gewu-component-node.mid { background:#fef3c7; border-color:#fde68a; color:#92400e; }
.gewu-component-node.selected, .gewu-relation-label.selected { outline:2px solid var(--primary); box-shadow:0 0 0 4px #dbeafe, 0 10px 24px rgba(37,99,235,.14); }
.gewu-relation-svg { position:absolute; inset:0; pointer-events:auto; }
.gewu-relation-line { cursor:pointer; }
.gewu-relation-hit { stroke:transparent; stroke-width:16; cursor:pointer; }
.gewu-relation-label { position:absolute; transform:translate(-50%,-50%); border-radius:999px; padding:5px 9px; font-size:11px; font-weight:800; background:#fff; border:1px solid #e5e7eb; color:#475569; box-shadow:0 4px 14px rgba(15,23,42,.08); cursor:pointer; max-width:180px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.gewu-relation-label.hot { background:#fee2e2; color:#991b1b; border-color:#fecaca; }
.gewu-relation-label.mid { background:#fef3c7; color:#92400e; border-color:#fde68a; }
.gewu-object-editor { overflow:auto; min-height:0; }
.gewu-editor-mode { display:flex; gap:8px; margin-bottom:10px; }
.gewu-mode-pill { flex:1; border:1px solid var(--border); border-radius:999px; padding:7px 8px; text-align:center; font-size:12px; font-weight:800; color:var(--text2); }
.gewu-mode-pill.active { background:var(--text); color:#fff; border-color:var(--text); }
.gewu-panel-title { margin:0 0 10px; font-size:15px; color:var(--text); }
.gewu-empty { padding:36px 12px; color:var(--text3); text-align:center; font-size:13px; }
.gewu-field { display:block; margin-bottom:10px; font-size:12px; color:var(--text2); }
.gewu-field input, .gewu-field textarea, .gewu-field select { width:100%; box-sizing:border-box; margin-top:4px; border:1px solid var(--border); border-radius:var(--radius-lg); padding:8px; font:inherit; color:var(--text); background:#fff; }
.gewu-field textarea { min-height:58px; resize:vertical; }
.gewu-work-table { display:grid; grid-template-columns:1.3fr .75fr .75fr; gap:6px; margin-top:4px; }
.gewu-work-head { background:var(--text); color:#fff; border-radius:var(--radius-lg); padding:7px; font-size:12px; font-weight:800; text-align:center; }
.gewu-work-cell { border:1px solid var(--border); border-radius:var(--radius-lg); padding:7px; background:#fff; color:var(--text2); font-size:12px; }
.gewu-note { margin-top:10px; border-radius:var(--radius-lg); background:#eff6ff; border:1px solid #bfdbfe; color:#1e3a8a; padding:10px 12px; font-size:12px; line-height:1.6; }
.gewu-badges { display:flex; flex-wrap:wrap; gap:8px; margin-top:10px; color:var(--text2); font-size:12px; }
.gewu-badge { border-radius:999px; padding:4px 8px; font-weight:800; background:#f8fafc; border:1px solid var(--border); }
.gewu-badge.hot { background:#fee2e2; color:#991b1b; border-color:#fecaca; }
.gewu-badge.mid { background:#fef3c7; color:#92400e; border-color:#fde68a; }
.gewu-badge.comp { background:#dbeafe; color:#1e3a8a; border-color:#bfdbfe; }

/* ============================================================
   ACCOUNT ADMIN (platform + company)
   ============================================================ */
.admin-wrap { max-width:1240px; margin:0 auto; }
.admin-toolbar { display:flex; gap:8px; align-items:center; margin-bottom:14px; flex-wrap:wrap; }
.admin-table { width:100%; border-collapse:collapse; background:#fff; border:1px solid var(--shell-border); border-radius:var(--radius-lg); overflow:hidden; }
.admin-table th { background:#f6f8fc; color:var(--text2); font-size:12px; font-weight:700; text-align:left; padding:10px 12px; border-bottom:1px solid var(--shell-border); white-space:nowrap; }
.admin-table td { padding:10px 12px; font-size:12px; color:var(--text); border-bottom:1px solid #eef1f6; vertical-align:middle; }
.admin-table tr:last-child td { border-bottom:none; }
.admin-table tr:hover td { background:#f8faff; }
.admin-badge { display:inline-block; padding:2px 8px; border-radius:999px; font-size:11px; font-weight:700; }
.admin-badge.active { background:#e8f7ee; color:#15803d; }
.admin-badge.disabled { background:#fdecec; color:#b91c1c; }
.admin-badge.role { background:#eef2ff; color:#3730a3; }
.admin-actions { display:flex; gap:6px; flex-wrap:wrap; }
.admin-form { display:none; gap:10px; align-items:flex-end; flex-wrap:wrap; background:#fff; border:1px solid var(--shell-border); border-radius:var(--radius-lg); padding:14px; margin-bottom:14px; }
.admin-form.open { display:flex; }
.admin-form label { display:flex; flex-direction:column; gap:4px; font-size:11px; color:var(--text2); }
.admin-form input { border:1px solid var(--shell-border); border-radius:var(--radius-md); padding:7px 9px; font-size:12px; min-width:140px; }
.admin-empty { text-align:center; padding:48px; color:var(--text3); }
.admin-hint { font-size:11px; color:var(--text3); margin-bottom:10px; }

/* --- evaluation template editor --- */
.eval-admin-tabs { display:flex; gap:6px; margin-bottom:10px; }
.eval-admin-scope { display:inline-flex; align-items:center; gap:6px; font-size:11px; color:var(--text3); white-space:nowrap; }
.eval-admin-scope select {
  max-width:260px; height:28px; padding:0 8px; font-size:11px; font-family:inherit;
  border:1px solid var(--shell-border); border-radius:var(--radius-md); background:#fff; color:var(--text2);
}
.eval-admin-tab { border:1px solid var(--shell-border); background:#fff; border-radius:var(--radius-md); padding:6px 14px; font-size:12px; color:var(--text2); cursor:pointer; }
.eval-admin-tab.active { border-color:var(--primary); color:var(--primary); background:#eef4ff; font-weight:600; }
.eval-admin { background:#fff; border:1px solid var(--shell-border); border-radius:var(--radius-lg); padding:14px; }
.eval-admin-meta { display:flex; gap:16px; align-items:flex-end; flex-wrap:wrap; margin-bottom:6px; }
.eval-admin-label { display:flex; flex-direction:column; gap:4px; font-size:11px; color:var(--text2); }
.eval-admin-input { border:1px solid var(--shell-border); border-radius:var(--radius-md); padding:7px 9px; font-size:12px; font-family:inherit; background:#fff; box-sizing:border-box; }
.eval-admin-name { min-width:280px; font-weight:600; }
.eval-admin-version { font-size:11px; color:var(--text3); padding-bottom:8px; }
.eval-admin-group { border:1px solid var(--shell-border); border-radius:var(--radius-lg); margin:12px 0; overflow:hidden; background:#fff; }
.eval-admin-group-head { display:flex; align-items:center; gap:8px; padding:8px 10px; background:#f6f8fc; border-bottom:1px solid var(--shell-border); flex-wrap:wrap; }
.eval-admin-aspect { width:180px; font-weight:600; }
.eval-admin-tag { width:120px; }
.eval-admin-count { font-size:11px; color:var(--text3); }
.eval-admin-items { padding:6px 10px; }
.eval-admin-item { display:grid; grid-template-columns:130px 190px minmax(0,1fr) auto; gap:8px; align-items:start; padding:6px 0; border-bottom:1px dashed #eef1f6; }
.eval-admin-item:last-child { border-bottom:none; }
.eval-admin-desc { border:1px solid var(--shell-border); border-radius:var(--radius-md); padding:6px 8px; font-size:12px; font-family:inherit; min-height:32px; resize:vertical; box-sizing:border-box; width:100%; }
.eval-admin-actions { display:flex; gap:4px; }
.eval-admin-iconbtn { border:1px solid var(--shell-border); background:#fff; border-radius:var(--radius-sm); padding:5px 7px; font-size:11px; cursor:pointer; color:var(--text2); white-space:nowrap; }
.eval-admin-iconbtn:hover { border-color:var(--primary); color:var(--primary); }
.eval-admin-iconbtn.is-danger:hover { border-color:#dc2626; color:#dc2626; }
.eval-admin-additem { margin:2px 10px 10px; }
.eval-admin-addgroup { margin-top:4px; }
.eval-admin-status { font-size:12px; color:var(--text3); margin-bottom:8px; min-height:16px; }
.eval-admin-status.is-error { color:#b91c1c; font-weight:600; }
.eval-admin-history-title { margin:22px 0 8px; font-size:14px; font-weight:700; color:var(--text); }
@media (max-width: 900px) {
  .eval-admin-item { grid-template-columns:1fr; }
}

/* ============================================================
   SITE FILING BAR (fixed, app pages only)
   ============================================================ */
.site-beian-bar {
  position:fixed; left:0; right:0; bottom:0; height:24px;
  display:flex; align-items:center; justify-content:center;
  background:rgba(255,255,255,0.94);
  border-top:1px solid var(--shell-border);
  color:var(--text3); font-size:11px; letter-spacing:0.03em;
  z-index:190; backdrop-filter:blur(8px);
}
.site-beian-bar.hidden { display:none; }
.site-beian-bar a { color:inherit; text-decoration:none; }
.site-beian-bar a:hover { color:var(--primary); text-decoration:underline; }
body.has-beian-bar { padding-bottom:24px; }
body.has-beian-bar #navContainer { height:calc(100vh - 24px); }

/* Touch dragging on the canvas */
#flowchart { touch-action: none; }

/* ============================================================
   MOBILE (<=768px)
   ============================================================ */
@media (max-width: 768px) {
  .sidebar { position: fixed; top: 0; bottom: 0; left: 0; z-index: 600; width: min(84vw, 320px); max-width: 320px; transform: translateX(-100%); transition: transform .2s ease; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
  .sidebar:not(.collapsed) { transform: translateX(0); }
  .sidebar.collapsed { width: min(84vw, 320px); max-width: 320px; transform: translateX(-100%); padding: 0; overflow: hidden; }
  .main { width: 100%; }
  .topbar-mainline { padding: 6px 10px; gap: 6px; }
  .view-toggle { flex: 1 1 auto; min-width: 0; overflow-x: auto; }
  .view-toggle button { flex: 0 0 auto; }
  .breadcrumb { overflow-x: auto; white-space: nowrap; }
  .modal { width: calc(100vw - 20px) !important; max-width: calc(100vw - 20px) !important; max-height: 92vh; }
  .admin-wrap { overflow-x: auto; }
  .admin-table { min-width: 720px; }
  .nav-topbar { padding: 0 10px; gap: 6px; }
  .nav-logo { margin-right: 10px; font-size: 16px; }
  .nav-tabs { overflow-x: auto; }
  .nav-tab { padding: 6px 10px; white-space: nowrap; }
  .nav-body { flex-direction: column; }
  .nav-sidebar { width: 100%; flex-direction: row; overflow-x: auto; border-right: none; border-bottom: 1px solid var(--shell-border); padding: 8px; }
  .nav-sidebar-item { white-space: nowrap; flex: 0 0 auto; }
  .nav-content { padding: 12px; }
  .nav-content-header { flex-wrap: wrap; gap: 8px; }
}

@media (max-width: 768px) {
  .topbar { overflow: hidden; }
  .topbar-mainline { min-width: 0; overflow: hidden; }
  .view-toggle { flex: 1 1 0; min-width: 0; overflow-x: auto; }
  .main { min-width: 0; overflow: hidden; }
  .flowchart-wrap { overflow: hidden; }
}

@media (max-width: 768px) {
  #flowchart { max-width: 100% !important; height: auto !important; }
}

/* ============================================================
   DIALOGS & TOASTS — replacements for native alert/confirm/prompt
   ============================================================ */
.tf-dialog-overlay {
  position: fixed; inset: 0; z-index: 12000;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: rgba(15,23,42,0.38);
  backdrop-filter: blur(5px);
  opacity: 0; transition: opacity .14s ease;
}
.tf-dialog-overlay.show { opacity: 1; }
.tf-dialog {
  width: 440px; max-width: 92vw;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,254,0.96));
  border: 1px solid var(--shell-border);
  border-radius: var(--radius-2xl);
  padding: 26px;
  box-shadow: 0 28px 72px rgba(23,32,51,0.18);
  transform: translateY(6px) scale(.99);
  transition: transform .16s ease;
}
.tf-dialog-overlay.show .tf-dialog { transform: none; }
.tf-dialog-icon {
  width: 34px; height: 34px; border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 16px; margin-bottom: 12px;
}
.tf-dialog-icon--info { background: rgba(51,112,255,.10); color: var(--primary); }
.tf-dialog-icon--success { background: rgba(0,181,120,.12); color: var(--green); }
.tf-dialog-icon--warning { background: rgba(255,122,0,.14); color: var(--orange); }
.tf-dialog-icon--danger { background: rgba(245,63,63,.12); color: var(--red); }
.tf-dialog-title { margin: 0 0 8px; font-size: 18px; font-weight: 800; letter-spacing: -0.03em; color: #172033; }
.tf-dialog-message { margin: 0 0 18px; font-size: 13px; line-height: 1.7; color: var(--shell-muted); white-space: pre-wrap; word-break: break-word; }
.tf-dialog-input {
  width: 100%; min-height: 40px; margin: 0 0 18px; padding: 10px 12px;
  font: inherit; font-size: 13px; color: #172033; background: #fff;
  border: 1px solid var(--shell-border); border-radius: var(--radius-lg);
  outline: none; resize: vertical;
}
.tf-dialog-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(51,112,255,.12); }
.tf-dialog-actions { display: flex; gap: 8px; justify-content: flex-end; }
.tf-dialog-actions .btn { min-height: 40px; }
.tf-dialog-actions .btn-block { width: 100%; }
.tf-dialog-error { color: var(--red); font-size: 12px; line-height: 1.5; min-height: 18px; margin: 0 0 6px; }

.tf-toast-stack {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%);
  z-index: 12100; display: flex; flex-direction: column; gap: 8px;
  align-items: center; pointer-events: none;
}
.tf-toast {
  display: flex; align-items: flex-start; gap: 8px;
  max-width: min(520px, 90vw); padding: 10px 14px;
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,0.98); border: 1px solid var(--shell-border);
  box-shadow: 0 12px 32px rgba(23,32,51,0.16);
  font-size: 13px; line-height: 1.5; color: #172033;
  opacity: 0; transform: translateY(-6px);
  transition: opacity .16s ease, transform .16s ease;
  pointer-events: auto; cursor: pointer;
}
.tf-toast.show { opacity: 1; transform: none; }
.tf-toast-icon {
  flex-shrink: 0; width: 18px; height: 18px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; color: #fff; margin-top: 1px;
}
.tf-toast--info .tf-toast-icon { background: var(--primary); }
.tf-toast--success .tf-toast-icon { background: var(--green); }
.tf-toast--warning .tf-toast-icon { background: var(--orange); }
.tf-toast--danger .tf-toast-icon { background: var(--red); }
.tf-toast-text { white-space: pre-wrap; word-break: break-word; }

@media (max-width: 768px) {
  .tf-dialog { padding: 20px; }
  .tf-toast-stack { top: 10px; }
}

/* ============================================================
   HOME PREVIEW (logged-in "返回首页")
   ============================================================ */
#homeBackToApp { min-height: 36px; padding: 0 16px; font-size: 13px; }
@media (max-width: 768px) {
  .nav-user { gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
  .nav-user .btn { font-size: 11px; padding: 4px 8px; }
}

/* ============================================================
   SOURCE VIEW — 工作区源头（事由 + 三段骨架）
   ============================================================ */
.source-root-layout { flex: 1; overflow-y: auto; padding: 22px 28px 56px; background: #f7f9fc; }
.source-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 4px 2px 14px; }
.source-heading h2 { margin: 0 0 4px; font-size: 19px; font-weight: 800; letter-spacing: -0.02em; color: #172033; }
.source-wsname { font-weight: 600; font-size: 15px; color: var(--shell-muted); }
.source-heading p { margin: 0; font-size: 12px; line-height: 1.7; color: var(--shell-muted); }
.source-header-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.source-progress { font-size: 12px; font-weight: 700; color: var(--primary); background: rgba(51,112,255,0.08); border: 1px solid rgba(51,112,255,0.18); border-radius: 999px; padding: 4px 10px; }
.source-readonly { margin: 0 0 12px; padding: 8px 12px; font-size: 12px; color: var(--orange); background: rgba(255,122,0,0.08); border: 1px solid rgba(255,122,0,0.22); border-radius: var(--radius-lg); }

.source-stage-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 10px 2px 16px; }
.source-stage-label { font-size: 12px; font-weight: 700; color: var(--shell-muted); margin-right: 4px; }
.source-stage-chip {
  border: 1px solid var(--shell-border); background: rgba(255,255,255,0.9); color: var(--text2);
  border-radius: 999px; padding: 6px 14px; font: inherit; font-size: 12px; cursor: pointer;
  transition: all var(--dur-fast) var(--ease-standard);
}
.source-stage-chip:hover { border-color: rgba(51,112,255,0.35); color: var(--primary); }
.source-stage-chip.active { background: var(--primary-gradient); border-color: transparent; color: #fff; font-weight: 700; box-shadow: 0 8px 18px rgba(51,112,255,0.18); }
.source-stage-chip:disabled { cursor: default; opacity: 0.65; }
.source-stage-tip { font-size: 11px; color: var(--text3); }

.source-section { background: #fff; border: 1px solid var(--shell-border); border-left: 3px solid rgba(51,112,255,0.35); border-radius: var(--radius-xl); padding: 16px 18px 18px; margin-bottom: 14px; box-shadow: var(--shadow-sm); }
.source-section[data-section="matter"] { border-left-color: rgba(23,32,51,0.25); }
.source-section[data-section="model"] { border-left-color: rgba(51,112,255,0.55); }
.source-section[data-section="current"] { border-left-color: rgba(255,122,0,0.55); }
.source-section[data-section="path"] { border-left-color: rgba(0,181,120,0.55); }
.source-section-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 12px; }
.source-section-head h3 { margin: 0; font-size: 14px; font-weight: 800; color: #172033; }
.source-section-head em { font-style: normal; font-size: 11px; color: var(--text3); }
.source-step { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 6px; background: rgba(51,112,255,0.10); color: var(--primary); font-size: 11px; font-weight: 800; }

.source-field { display: block; margin-bottom: 12px; }
.source-field-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 5px; }
.source-field-label { font-size: 12px; font-weight: 700; color: #172033; }
.source-field-label i { font-style: normal; font-weight: 400; color: var(--text3); margin-left: 6px; font-size: 11px; }
.source-field-state { font-style: normal; font-size: 10px; color: var(--text3); border: 1px solid var(--shell-border); border-radius: 999px; padding: 1px 7px; flex-shrink: 0; }
.source-field-state:not(:empty) { color: var(--shell-muted); }
.source-textarea {
  width: 100%; min-height: 60px; resize: vertical; padding: 9px 11px;
  font: inherit; font-size: 13px; line-height: 1.7; color: #172033; background: #fff;
  border: 1px solid var(--shell-border); border-radius: var(--radius-lg); outline: none;
}
.source-textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(51,112,255,0.10); }
.source-textarea:disabled { background: #f6f7fa; color: var(--shell-muted); }

.source-table { margin: 4px 0 10px; }
.source-table-head { display: grid; gap: 8px; padding: 0 0 5px; font-size: 11px; color: var(--text3); }
.source-table-goals { grid-template-columns: minmax(0,1fr) minmax(0,1.5fr) 30px; }
.source-table-entities { grid-template-columns: minmax(0,1fr) minmax(0,1fr) minmax(0,0.8fr) minmax(0,0.8fr) 30px; }
.source-row { display: grid; gap: 8px; margin-bottom: 6px; align-items: center; }
.source-row:not(.source-row-entity) { grid-template-columns: minmax(0,1fr) minmax(0,1.5fr) 30px; }
.source-row-entity { grid-template-columns: minmax(0,1fr) minmax(0,1fr) minmax(0,0.8fr) minmax(0,0.8fr) 30px; }
.source-cell {
  width: 100%; height: 34px; padding: 0 10px; font: inherit; font-size: 12px;
  color: #172033; background: #fff; border: 1px solid var(--shell-border);
  border-radius: var(--radius-md); outline: none;
}
.source-cell:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(51,112,255,0.10); }
.source-cell:disabled { background: #f6f7fa; color: var(--shell-muted); }
.source-row-del {
  width: 26px; height: 26px; border: 1px solid var(--shell-border); border-radius: var(--radius-sm);
  background: #fff; color: var(--text3); cursor: pointer; font-size: 11px; line-height: 1;
}
.source-row-del:hover { color: var(--red); border-color: rgba(245,63,63,0.4); }
.source-add {
  margin-top: 2px; padding: 5px 10px; font: inherit; font-size: 11px; cursor: pointer;
  color: var(--primary); background: rgba(51,112,255,0.06); border: 1px dashed rgba(51,112,255,0.35);
  border-radius: var(--radius-md);
}
.source-add:hover { background: rgba(51,112,255,0.10); }
.source-path-note { margin: 0 0 10px; font-size: 12px; line-height: 1.7; color: var(--shell-muted); }
.source-footer { padding: 6px 2px 0; font-size: 11px; color: var(--text3); }
.source-empty { padding: 60px; text-align: center; color: var(--text3); }

@media (max-width: 768px) {
  .source-root-layout { padding: 14px 12px 40px; }
  .source-header { flex-direction: column; }
  .source-table-head { display: none; }
  .source-row, .source-row-entity { grid-template-columns: 1fr; }
  .source-row-del { justify-self: end; }
}
.source-missing { font-size: 10px; color: var(--orange); background: rgba(255,122,0,0.08); border: 1px solid rgba(255,122,0,0.25); border-radius: 999px; padding: 1px 7px; margin-left: 6px; white-space: nowrap; }
.source-field-tools { display: flex; align-items: center; gap: 6px; }
.source-mic {
  width: 24px; height: 24px; padding: 0; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--shell-border); background: #fff; border-radius: var(--radius-md);
  cursor: pointer; font-size: 12px; line-height: 1;
}
.source-mic:hover { border-color: rgba(51,112,255,0.4); background: #f7faff; }
.source-mic[data-live="1"] { width: auto; min-width: 24px; padding: 0 7px; font-size: 11px; }
.source-tidy {
  width: 24px; height: 24px; padding: 0; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--shell-border); background: #fff; border-radius: var(--radius-md);
  cursor: pointer; font-size: 12px; line-height: 1;
}
.source-tidy:hover { border-color: rgba(51,112,255,0.4); background: #f7faff; }
.source-tidy:disabled { opacity: 0.6; cursor: default; }
.source-tidy-block {
  margin-top: 8px; padding: 12px 14px;
  border: 1px solid rgba(51,112,255,0.28); background: rgba(244,248,255,0.92);
  border-radius: var(--radius-lg);
}
.source-tidy-head { font-size: 12px; font-weight: 700; color: #172033; margin-bottom: 6px; }
.source-tidy-head span { font-weight: 400; color: var(--shell-muted); margin-left: 6px; font-size: 11px; }
.source-tidy-text { font-size: 13px; line-height: 1.8; color: #172033; white-space: pre-wrap; margin-bottom: 10px; max-height: 240px; overflow: auto; }
.source-tidy-actions { display: flex; gap: 8px; }
.source-raw { display: block; margin-top: 8px; font-size: 12px; color: var(--shell-muted); }
.source-raw summary { cursor: pointer; color: var(--primary); font-size: 11px; }
.source-raw p { margin: 6px 0 0; white-space: pre-wrap; line-height: 1.7; background: #f6f8fc; border-radius: var(--radius-md); padding: 8px 10px; }
