/* ============================================================
   Freeverse Dashboard — unified product entry
   Brand: orbiting stars · deep indigo starfield · mint + warm gold
   Surface: soft light green · warm cream cards · dark green-gray text
   ============================================================ */

/* ── Brand mark (orbiting stars around a central star) ── */
.fv-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}
.fv-brand-mark {
  position: relative;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}
.fv-brand-mark .fv-star-core {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 9px; height: 9px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #fff6dc, var(--fv-gold) 60%, #9a7326 100%);
  box-shadow: 0 0 6px rgba(200, 154, 58, 0.7);
}
.fv-brand-mark .fv-orbit {
  position: absolute;
  top: 50%; left: 50%;
  border-radius: 50%;
  border: 1px solid rgba(36, 32, 70, 0.18);
  transform: translate(-50%, -50%);
}
.fv-brand-mark .fv-orbit.o1 { width: 18px; height: 18px; }
.fv-brand-mark .fv-orbit.o2 { width: 26px; height: 26px; }
.fv-brand-mark .fv-orbit-dot {
  position: absolute;
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--fv-indigo-soft);
}
.fv-brand-mark .fv-orbit.o1 .fv-orbit-dot { top: -2px; left: 50%; transform: translateX(-50%); background: var(--accent); }
.fv-brand-mark .fv-orbit.o2 .fv-orbit-dot { bottom: -2px; left: 50%; transform: translateX(-50%); background: var(--fv-gold); }
.fv-brand-name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.4px;
  color: var(--fv-indigo);
  line-height: 1;
}
.fv-brand-name small {
  display: block;
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted2);
  margin-top: 2px;
}

/* ── Dashboard page shell ── */
#page-dashboard { padding: 1.25rem 1.5rem 3rem; }

/* ── Hero / brand header ── */
.fv-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.fv-hero-left { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.fv-hero-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.3px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.fv-hero-title .fv-accent { color: var(--accent); }
.fv-hero-sub { font-size: 12px; color: var(--muted); }
.fv-hero-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.fv-hero-date {
  font-size: 11px;
  color: var(--muted2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ── Quick capture bar ── */
.fv-quick-capture {
  display: flex;
  align-items: stretch;
  gap: 0;
  margin-bottom: 1.25rem;
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--sh-sm);
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.fv-quick-capture:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.fv-qc-input {
  flex: 1;
  border: none;
  background: transparent;
  padding: .75rem 1rem;
  font-size: 13px;
  color: var(--text);
  font-family: inherit;
  outline: none;
  min-width: 0;
}
.fv-qc-input::placeholder { color: var(--muted); }
.fv-qc-type {
  border: none;
  border-left: 1px solid var(--border);
  background: var(--s2);
  padding: 0 .6rem;
  font-size: 11px;
  color: var(--muted);
  font-family: inherit;
  cursor: pointer;
  outline: none;
  min-width: 70px;
}
.fv-qc-btn {
  border: none;
  border-left: 1px solid var(--border);
  background: var(--accent);
  color: #fff;
  padding: 0 1.1rem;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--dur-fast) var(--ease);
}
.fv-qc-btn:hover { background: var(--accent-hover); }
.fv-qc-status { font-size: 11px; color: var(--muted2); padding: .5rem .75rem; min-width: 0; }

/* ── Stat strip (top metrics) ── */
.fv-stat-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .75rem;
  margin-bottom: 1.25rem;
}
.fv-stat {
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: relative;
  overflow: hidden;
  min-height: 80px;
  transition: border-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.fv-stat:hover { border-color: var(--border2); transform: translateY(-1px); }
.fv-stat-ico {
  position: absolute;
  top: .6rem; right: .6rem;
  font-size: 16px;
  opacity: .25;
  line-height: 1;
}
.fv-stat-label { font-size: 10px; color: var(--muted2); text-transform: uppercase; letter-spacing: .06em; }
.fv-stat-val { font-size: 22px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: -0.5px; overflow-wrap: break-word; }
.fv-stat-sub { font-size: 10.5px; color: var(--muted); overflow-wrap: break-word; }
.fv-stat-val.mint { color: var(--accent); }
.fv-stat-val.gold { color: var(--fv-gold-text); }
.fv-stat-val.indigo { color: var(--fv-indigo); }

/* ── Section heading ── */
.fv-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 1.5rem 0 .75rem;
  gap: .5rem;
}
.fv-section-head h2 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: .02em;
  display: flex;
  align-items: center;
  gap: 6px;
}
.fv-section-head h2 .fv-sec-ico { font-size: 15px; }
.fv-section-head .fv-sec-link {
  font-size: 11px;
  color: var(--accent);
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
}
.fv-section-head .fv-sec-link:hover { text-decoration: underline; }

/* ── Grid layouts ── */
.fv-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.fv-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
.fv-grid-2 > *, .fv-grid-3 > * { min-width: 0; min-height: 0; }

/* ── Cards (warm cream) ── */
.fv-card {
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  min-height: 100px;
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.fv-card:hover { border-color: var(--border2); box-shadow: var(--sh-sm); }
.fv-card-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--muted2);
  margin-bottom: .65rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  flex-wrap: wrap;
}
.fv-card-title .fv-live-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green);
  display: inline-block;
  margin-right: 4px;
  animation: fv-pulse 2.4s ease-in-out infinite;
}
@keyframes fv-pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

/* ── Runtime status ── */
.fv-runtime-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.fv-agent-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--s2);
  color: var(--muted);
}
.fv-agent-chip .fv-dot { width: 6px; height: 6px; border-radius: 50%; }
.fv-agent-chip.ok .fv-dot { background: var(--green); }
.fv-agent-chip.err .fv-dot { background: var(--red); }
.fv-agent-chip.ok { color: var(--text); border-color: rgba(90,138,106,.4); }
.fv-agent-chip.err { color: var(--red); }
.fv-runtime-meta { font-size: 11px; color: var(--muted2); margin-top: .5rem; line-height: 1.5; }
.fv-runtime-meta strong { color: var(--text); font-weight: 600; }

/* ── PI entry / architecture summary ── */
.fv-pi-summary { display: flex; flex-direction: column; gap: .5rem; }
.fv-pi-nums { display: flex; gap: 1rem; flex-wrap: wrap; }
.fv-pi-num { display: flex; flex-direction: column; }
.fv-pi-num-val { font-size: 18px; font-weight: 700; color: var(--fv-indigo); }
.fv-pi-num-lbl { font-size: 10px; color: var(--muted2); text-transform: uppercase; letter-spacing: .05em; }
.fv-pi-layers { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .25rem; }
.fv-pi-layer-tag {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--fv-mint-soft);
  color: var(--accent-hover);
  border: 1px solid rgba(31,158,142,.2);
  white-space: nowrap;
}
.fv-pi-cta {
  margin-top: .25rem;
  font-size: 12px;
  color: var(--accent);
  cursor: pointer;
  text-decoration: none;
  font-weight: 500;
}
.fv-pi-cta:hover { text-decoration: underline; }

/* ── Pending decisions / actions ── */
.fv-item {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  padding: .55rem .6rem;
  border-radius: 6px;
  transition: background var(--dur-fast) var(--ease);
}
.fv-item:hover { background: var(--s2); }
.fv-item-main { flex: 1; min-width: 0; }
.fv-item-title { font-size: 12.5px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fv-item-sub { font-size: 11px; color: var(--muted2); }
.fv-item-badge { flex-shrink: 0; }
.fv-badge {
  font-size: 10px;
  padding: 1px 7px;
  border-radius: 10px;
  font-weight: 600;
  white-space: nowrap;
  display: inline-block;
}
.fv-badge.mint { background: var(--fv-mint-soft); color: var(--accent-hover); }
.fv-badge.gold { background: var(--fv-gold-dim); color: var(--fv-gold-text); }
.fv-badge.indigo { background: rgba(36,32,70,.08); color: var(--fv-indigo); }
.fv-badge.gray { background: var(--s3); color: var(--muted2); }

/* ── Notes / quick capture results ── */
.fv-notes-list { display: flex; flex-direction: column; gap: .45rem; }
.fv-note {
  background: var(--s2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .55rem .7rem;
  font-size: 12px;
  color: var(--text);
  line-height: 1.5;
  position: relative;
  transition: border-color var(--dur-fast) var(--ease);
}
.fv-note:hover { border-color: var(--border2); }
.fv-note {
  min-width: 0;
  overflow-wrap: break-word;
  word-break: break-word;
}
.fv-note-text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: break-word;
}
.fv-note-meta {
  font-size: 10px;
  color: var(--muted2);
  margin-top: 3px;
  display: flex;
  gap: 8px;
  align-items: center;
}
.fv-note-del {
  position: absolute;
  top: 4px; right: 6px;
  background: none;
  border: none;
  color: var(--muted2);
  cursor: pointer;
  font-size: 12px;
  padding: 2px 4px;
  border-radius: 4px;
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease);
}
.fv-note:hover .fv-note-del { opacity: 1; }
.fv-note-del:hover { color: var(--red); background: var(--red-dim); }
.fv-notes-empty {
  font-size: 12px;
  color: var(--muted);
  padding: .75rem;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: 8px;
}

/* ── Recent activity ── */
.fv-activity-item {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .45rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.fv-activity-item:last-child { border-bottom: none; }
.fv-activity-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.fv-activity-dot.done { background: var(--green); }
.fv-activity-dot.active { background: var(--accent); }
.fv-activity-dot.todo { background: var(--s3); }
.fv-activity-text { flex: 1; min-width: 0; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; overflow-wrap: normal; }
.fv-activity-time { font-size: 10px; color: var(--muted2); flex-shrink: 0; }

/* ── Honest empty / error states ── */
.fv-empty {
  font-size: 12px;
  color: var(--muted);
  padding: .6rem;
  text-align: center;
}
.fv-error { color: var(--red); font-size: 12px; padding: .6rem; text-align: center; }
.fv-loading { color: var(--muted2); font-size: 12px; padding: .6rem; text-align: center; }

/* ── Passive income mini bar (reuse dashboard pattern) ── */
.fv-progress {
  height: 7px;
  border-radius: 4px;
  background: var(--s3);
  overflow: hidden;
  margin: .4rem 0;
}
.fv-progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width .6s ease;
}

/* ── Evolution mini card ── */
.fv-evo-row { display: flex; flex-direction: column; gap: .45rem; }
.fv-evo-item { font-size: 12px; line-height: 1.5; }
.fv-evo-item .fv-evo-k { font-size: 10px; color: var(--muted2); text-transform: uppercase; letter-spacing: .05em; }
.fv-evo-item .fv-evo-v { color: var(--text); font-weight: 500; }

/* ── Domain status ── */
.fv-domain-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .5rem;
}
.fv-domain-item {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem .6rem;
  background: var(--s2);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12px;
}
.fv-domain-ico { font-size: 14px; }
.fv-domain-label { color: var(--muted); font-size: 11px; }
.fv-domain-val { color: var(--text); font-weight: 600; margin-left: auto; font-size: 12px; }

/* ── Development progress ── */
.fv-dev-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .5rem;
}
.fv-dev-item {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem .6rem;
  background: var(--s2);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12px;
}
.fv-dev-ico { font-size: 14px; }
.fv-dev-label { color: var(--muted); font-size: 11px; }
.fv-dev-val { color: var(--text); font-weight: 600; margin-left: auto; font-size: 12px; }

/* ── Responsive ── */

@media (max-width: 1024px) {
  .fv-grid-3 { grid-template-columns: 1fr 1fr; }
  .fv-stat-strip { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  #page-dashboard { padding: 1rem; }
  .fv-hero { flex-direction: column; align-items: flex-start; gap: .5rem; }
  .fv-hero-title { font-size: 17px; }
  .fv-grid-2, .fv-grid-3 { grid-template-columns: 1fr; gap: .75rem; }
  .fv-stat-strip { grid-template-columns: repeat(2, 1fr); gap: .5rem; }
  .fv-stat { padding: .65rem .75rem; min-height: 68px; }
  .fv-stat-val { font-size: 18px; }
  .fv-quick-capture { flex-wrap: wrap; }
  .fv-qc-input { width: 100%; border-bottom: 1px solid var(--border); }
  .fv-qc-type { flex: 1; }
  .fv-qc-btn { flex: 1; }
}

/* Extra small: 360 / 390 / 430 — single column, no overflow */
@media (max-width: 430px) {
  #page-dashboard { padding: .75rem; overflow-x: hidden; }
  .fv-stat-strip { grid-template-columns: 1fr 1fr; gap: .4rem; }
  .fv-stat-ico { display: none; }
  .fv-hero-right { width: 100%; justify-content: space-between; }
  .fv-runtime-row { gap: .35rem; }
  .fv-agent-chip { font-size: 10px; padding: 2px 7px; }
  .fv-pi-nums { gap: .6rem; }
}
@media (max-width: 360px) {
  .fv-stat-strip { grid-template-columns: 1fr 1fr; gap: .35rem; }
  .fv-stat { padding: .5rem .6rem; min-height: 60px; }
  .fv-stat-val { font-size: 16px; }
  .fv-hero-title { font-size: 15px; }
  .fv-brand-name { font-size: 13px; }
  .fv-brand-mark { width: 24px; height: 24px; }
}


/* ============================================================
   Freeverse whole-product system — shared shell + page language
   ============================================================ */
.shell {
  grid-template-columns: 232px minmax(0, 1fr);
}
.topbar {
  background: var(--s1);
  border-bottom-color: var(--border);
  min-width: 0;
}
.fv-nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--s1);
  color: var(--text);
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
}
.fv-nav-toggle:hover,
.fv-nav-toggle[aria-expanded="true"] {
  background: var(--fv-mint-soft);
  border-color: var(--accent);
  color: var(--accent-hover);
}
.fv-nav-backdrop { display: none; }
.sidebar {
  padding: 1rem .65rem;
  background: var(--s1);
  border-right-color: var(--border);
  min-width: 0;
}
.nav-section { margin: 0 0 1rem; padding: 0 .15rem; }
.nav-section.fv-planet-active .nav-label { color: var(--accent); }
.nav-section.fv-planet-active .nav-item.active { border-left-color: var(--accent); }
.nav-label {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: .3rem .7rem .45rem;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .09em;
  text-transform: uppercase;
  cursor: pointer;
  user-select: none;
  border-radius: 6px;
  transition: color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.nav-label::after {
  content: '▾';
  margin-left: auto;
  font-size: 9px;
  opacity: .55;
  transition: transform var(--dur-fast) var(--ease);
}
.nav-label:hover { color: var(--text); background: var(--fv-mint-soft); }
.nav-label.collapsed::after { transform: rotate(-90deg); }
.nav-label:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.nav-section-body { display: flex; flex-direction: column; }
.nav-section-body > .nav-item,
.nav-section-body > .nav-sub { min-width: 0; }
.nav-item {
  min-height: 38px;
  margin: 2px 0;
  padding: .55rem .7rem;
  gap: .65rem;
  border-left: 2px solid transparent;
  border-radius: 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
}
.nav-item:hover {
  background: var(--fv-mint-soft);
  color: var(--text);
}
.nav-item.active {
  color: #176f64;
  border-left-color: var(--accent);
  background: #e2f1e9;
  font-weight: 650;
}
.nav-icon { flex: 0 0 20px; font-size: 15px; }
.nav-sub { margin-left: 1rem; }
.nav-sub-item { padding: .45rem .6rem; border-radius: 7px; }
/* System PI remains a compatible page ID, but is reached through the unified Architecture Center tabs. */
#fv-sidebar #nav-system-pi,
#fv-sidebar .nav-item[onclick*="project-control"] { display: none; }
.content {
  min-width: 0;
  background: var(--bg);
}
.page:not(#page-dashboard) {
  padding: 1.35rem clamp(1rem, 2.2vw, 2rem) 2.5rem;
}
.page:not(#page-dashboard) .page-title {
  min-height: 42px;
  margin: 0 0 1.25rem;
  padding: 0 0 .8rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: clamp(1.1rem, 1.4vw, 1.4rem);
  font-weight: 650;
  letter-spacing: -.025em;
}
.page:not(#page-dashboard) .page-title .icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--fv-mint-soft);
  color: var(--accent-hover);
  opacity: 1;
}
.page:not(#page-dashboard) .card,
.page:not(#page-dashboard) .stat-card,
.page:not(#page-dashboard) .decision-card,
.page:not(#page-dashboard) .suggestion-card,
.page:not(#page-dashboard) .wiki-domain-group {
  border-color: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--sh-sm);
}
.page:not(#page-dashboard) .card-title,
.page:not(#page-dashboard) .section-title,
.page:not(#page-dashboard) .section-header {
  color: var(--text);
}
.page:not(#page-dashboard) .card-title {
  padding-bottom: .55rem;
  border-bottom: 1px solid var(--border);
}
.page:not(#page-dashboard) .item-list,
.page:not(#page-dashboard) .list-item,
.page:not(#page-dashboard) .empty,
.page:not(#page-dashboard) .loading-text {
  min-width: 0;
}
.page:not(#page-dashboard) .empty {
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: rgba(250, 249, 243, .65);
}
.page:not(#page-dashboard) .pc-sec,
.page:not(#page-dashboard) .kn-section,
.page:not(#page-dashboard) .pi-panel,
.page:not(#page-dashboard) .pi-side-panel {
  border-radius: var(--radius);
}
.page:not(#page-dashboard) button,
.page:not(#page-dashboard) input,
.page:not(#page-dashboard) select,
.page:not(#page-dashboard) textarea {
  max-width: 100%;
}
.page:not(#page-dashboard) button,
.fv-nav-toggle,
.nav-item,
.nav-sub-item {
  -webkit-tap-highlight-color: transparent;
}
.page:not(#page-dashboard) .table-wrap,
.page:not(#page-dashboard) .table-container,
.page:not(#page-dashboard) .overflow-x-auto {
  max-width: 100%;
  overflow-x: auto;
}
.page:not(#page-dashboard) img,
.page:not(#page-dashboard) canvas,
.page:not(#page-dashboard) svg {
  max-width: 100%;
}
#workspace-main { min-width: 0; overflow-x: clip; }
#workspace-main > * { min-width: 0; }
:where(.page, #workspace-main) :where(.grid2, .grid3, .grid4, .dash-row, .form-grid, .row) > * {
  min-width: 0;
}
:where(.page, #workspace-main) :where(p, .item-title, .item-sub, .card-title, .page-title) {
  overflow-wrap: anywhere;
}
:where(.page, #workspace-main) :where(table) {
  max-width: 100%;
}
.fv-nav-toggle:focus-visible,
.fv-nav-backdrop:focus-visible,
.nav-item:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* Tablet: retain readable labels instead of collapsing to an icon-only rail. */
@media (min-width: 769px) and (max-width: 1100px) {
  .shell { grid-template-columns: 212px minmax(0, 1fr); }
  .nav-label { display: block; }
  .nav-item { justify-content: flex-start; padding: .5rem .55rem; gap: .45rem; font-size: 11px; }
  .nav-icon { font-size: 14px; }
  .agent-pills { display: none; }
  .page:not(#page-dashboard) { padding: 1rem 1.1rem 2rem; }
}

/* Mobile: real drawer, not a shrunken desktop sidebar or a 20-item bottom strip. */
@media (max-width: 768px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 52px minmax(0, 1fr);
    height: 100dvh;
    min-height: 0;
  }
  .topbar {
    grid-column: 1;
    grid-row: 1;
    height: 52px;
    min-height: 52px;
    padding: 0 .65rem;
    gap: .6rem;
    z-index: 101;
  }
  .fv-nav-toggle { display: inline-flex; }
  .fv-brand { gap: .45rem; min-width: 0; }
  .fv-brand-mark { width: 25px; height: 25px; }
  .fv-brand-name { font-size: 14px; }
  .fv-brand-name small { display: none; }
  .topbar-right { gap: .4rem; }
  .topbar-time { display: none; }
  .topbar-bell { padding: .35rem; }
  .sidebar {
    position: fixed;
    top: 52px;
    bottom: 0;
    left: 0;
    width: min(86vw, 330px);
    height: auto;
    display: block;
    padding: .75rem .65rem 1.25rem;
    overflow-x: hidden;
    overflow-y: auto;
    border-right: 1px solid var(--border);
    border-top: 0;
    border-radius: 0 16px 0 0;
    box-shadow: var(--sh-md);
    transform: translateX(-105%);
    transition: transform .22s var(--ease);
    z-index: 91;
  }
  .sidebar.is-open { transform: translateX(0); }
  .fv-nav-backdrop {
    display: block;
    position: fixed;
    inset: 52px 0 0;
    width: 100%;
    height: auto;
    border: 0;
    border-radius: 0;
    background: rgba(29, 39, 31, .34);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s var(--ease);
    z-index: 90;
  }
  .fv-nav-backdrop.is-open { opacity: 1; pointer-events: auto; }
  .nav-section { display: block; margin: 0 0 .9rem; padding: 0 .1rem; }
  .nav-label { display: block; padding: .35rem .7rem .4rem; }
  .nav-item {
    display: flex;
    justify-content: flex-start;
    min-height: 44px;
    margin: 2px 0;
    padding: .65rem .75rem;
    gap: .7rem;
    border-left: 2px solid transparent;
    border-bottom: 0;
    border-radius: 9px;
    font-size: 13px;
  }
  .nav-item.active { border-left-color: var(--accent); border-bottom-color: transparent; }
  .nav-icon { width: 20px; font-size: 17px; }
  .nav-sub, .nav-arrow { display: flex; }
  .nav-sub { margin-left: 1rem; }
  .content {
    grid-row: 2;
    height: calc(100dvh - 52px);
    min-height: 0;
    padding: .75rem;
    padding-bottom: max(.75rem, env(safe-area-inset-bottom));
    overflow-x: hidden;
  }
  .page { padding: 0; width: 100%; }
  .page:not(#page-dashboard) { padding: .2rem 0 1.25rem; }
  .page:not(#page-dashboard) .page-title { margin-bottom: .9rem; font-size: 1.12rem; }
  .grid2, .grid3, .grid4, .dash-row.cols-4, .dash-row.cols-2,
  .fv-grid-2, .fv-grid-3 { grid-template-columns: minmax(0, 1fr); gap: .75rem; }
  .fv-stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card, .fv-card { padding: .8rem; }
  .input-row { flex-wrap: wrap; }
  .modal { width: min(95vw, 520px); min-width: 0; resize: none; }
  .table-wrap, .table-container, .overflow-x-auto { max-width: 100%; overflow-x: auto; }
}
@media (max-width: 390px) {
  .topbar { padding-inline: .45rem; gap: .4rem; }
  .fv-nav-toggle { width: 34px; height: 34px; }
  .fv-brand-name { font-size: 13px; }
  .topbar-bell { font-size: 15px; }
  .fv-hero-title { font-size: 16px; }
  .fv-stat { padding: .55rem .6rem; }
  .fv-stat-val { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* Cross-page link tone and small-screen overflow fixes found in browser smoke test. */
.page a:not(.btn):not(.ai-back),
#workspace-main a:not(.btn):not(.ai-back) {
  color: var(--accent-hover);
  text-decoration: none;
}
.page a:not(.btn):not(.ai-back):hover,
#workspace-main a:not(.btn):not(.ai-back):hover {
  text-decoration: underline;
}
#page-dashboard .fv-card-title a.fv-sec-link {
  color: var(--accent-hover);
  text-decoration: none;
  font-weight: 600;
}
#page-dashboard .fv-card-title a.fv-sec-link:hover { text-decoration: underline; }
#page-dashboard .fv-runtime-row {
  flex-wrap: wrap;
  max-width: 100%;
  min-width: 0;
}
#page-dashboard .fv-agent-chip { max-width: 100%; }
#page-dashboard .fv-grid-2,
#page-dashboard .fv-grid-3,
#page-dashboard .fv-card { min-width: 0; }
@media (max-width: 768px) {
  #page-dashboard .fv-quick-capture {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    width: 100%;
    min-width: 0;
    overflow: hidden;
  }
  #page-dashboard .fv-qc-input {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: .7rem .8rem;
    border-bottom: 1px solid var(--border);
  }
  #page-dashboard .fv-qc-type,
  #page-dashboard .fv-qc-btn {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    padding-inline: .45rem;
    text-overflow: ellipsis;
  }
  #page-dashboard .fv-runtime-row { gap: .35rem; }
  #page-dashboard .fv-agent-chip { font-size: 10px; padding: 3px 7px; }
  #page-dashboard .fv-card-title { align-items: flex-start; }
  #page-dashboard .fv-card-title a.fv-sec-link { white-space: normal; text-align: right; }
  #page-dashboard .fv-pi-nums { flex-wrap: wrap; }
}

@media (max-width: 768px) {
  #page-dashboard .fv-card-title > span:first-child {
    flex: 1 1 52%;
    min-width: 0;
    overflow-wrap: anywhere;
  }
  #page-dashboard .fv-card-title > a.fv-sec-link {
    flex: 0 1 46%;
    max-width: 46%;
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    font-size: 10px;
    line-height: 1.3;
    color: var(--accent-hover) !important;
    text-decoration: none !important;
  }
}
#page-dashboard .fv-card-title > a.fv-sec-link {
  color: var(--accent-hover) !important;
  text-decoration: none !important;
}
#page-dashboard .fv-card-title > a.fv-sec-link:hover {
  text-decoration: underline !important;
}

/* A single navigation surface for the two complementary system views. */
.fv-system-center-tabs {
  display: flex;
  align-items: center;
  gap: .25rem;
  width: fit-content;
  max-width: 100%;
  margin: .4rem 0 .85rem;
  padding: .25rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--s2);
}
.fv-system-center-tabs button {
  min-height: 36px;
  padding: .45rem .85rem;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 550;
  white-space: nowrap;
  cursor: pointer;
}
.fv-system-center-tabs button:hover { color: var(--text); background: var(--fv-mint-soft); }
.fv-system-center-tabs button.active {
  border-color: var(--border);
  background: var(--s1);
  color: var(--accent-hover);
  font-weight: 650;
  box-shadow: var(--sh-sm);
}
.fv-system-center-tabs button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
@media (max-width: 768px) {
  .fv-system-center-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }
  .fv-system-center-tabs button { min-width: 0; white-space: normal; }
}

/* Keep the Orchestrator shell isolated from domain fragments that reuse
   generic class names such as .topbar/.content/.sidebar. */
.shell > .topbar {
  grid-column: 1 / -1;
  grid-row: 1;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  height: var(--topbar-h);
  min-height: var(--topbar-h);
  padding: 0 1.25rem;
  gap: 1rem;
  overflow: visible;
  position: sticky;
  top: 0;
  z-index: 101;
  background: var(--s1);
  border-bottom: 1px solid var(--border);
}
.shell > .sidebar {
  grid-column: 1;
  grid-row: 2;
  display: block;
  flex-direction: column;
  position: relative;
  top: auto;
  bottom: auto;
  left: auto;
  width: auto;
  height: calc(100vh - var(--topbar-h));
  min-width: 0;
  padding: 1rem .65rem;
  overflow-x: hidden;
  overflow-y: auto;
  border-right: 1px solid var(--border);
  background: var(--s1);
  transform: none;
  z-index: 1;
}
.shell > .content {
  grid-column: 2;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--topbar-h));
  min-height: 0;
  min-width: 0;
  padding-bottom: 1rem;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--bg);
}
@media (min-width: 769px) and (max-width: 1100px) {
  .shell > .topbar { padding-inline: .9rem; gap: .65rem; }
  .shell > .sidebar { height: calc(100vh - var(--topbar-h)); }
  .shell > .content { height: calc(100vh - var(--topbar-h)); }
}
@media (max-width: 768px) {
  .shell > .topbar {
    grid-column: 1;
    grid-row: 1;
    height: 52px;
    min-height: 52px;
    padding: 0 .65rem;
    gap: .6rem;
    position: sticky;
    top: 0;
    z-index: 101;
    overflow: visible;
  }
  .shell > .sidebar {
    grid-column: 1;
    grid-row: 2;
    position: fixed;
    top: 52px;
    bottom: 0;
    left: 0;
    width: min(86vw, 330px);
    height: auto;
    display: block;
    padding: .75rem .65rem 1.25rem;
    overflow-x: hidden;
    overflow-y: auto;
    border-right: 1px solid var(--border);
    border-top: 0;
    border-radius: 0 16px 0 0;
    transform: translateX(-105%);
    transition: transform .22s var(--ease);
    z-index: 91;
  }
  .shell > .sidebar.is-open { transform: translateX(0); }
  .shell > .content {
    grid-column: 1;
    grid-row: 2;
    height: calc(100dvh - 52px);
    min-height: 0;
    padding: .75rem;
    padding-bottom: max(.75rem, env(safe-area-inset-bottom));
    overflow-x: hidden;
    overflow-y: auto;
  }
}

/* Domain themes may define generic .topbar-right; keep the shell controls aligned. */
.shell > .topbar > .fv-brand {
  display: inline-flex;
  flex: 0 0 auto;
  min-width: 0;
  margin: 0;
}
.shell > .topbar > .topbar-right {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: .6rem;
  margin-left: auto;
  position: static;
  width: auto;
  min-width: 0;
}
@media (max-width: 768px) {
  .shell > .topbar > .topbar-right {
    margin-left: auto;
    gap: .35rem;
  }
}

/* ============================================================
   Freeverse — whole-site shared page language
   Covers every page family without breaking existing DOM / hooks.
   Scoped to .page / #workspace-main so domain fragments inherit too.
   ============================================================ */

/* ── Page canvas + header (non-dashboard pages) ── */
.page {
  color: var(--text);
  line-height: 1.55;
  min-width: 0;
}
.page .page-title {
  display: flex;
  align-items: center;
  gap: .5rem;
  min-height: 42px;
  margin: 0 0 1.25rem;
  padding: 0 0 .8rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: clamp(1.1rem, 1.4vw, 1.4rem);
  font-weight: 650;
  letter-spacing: -.025em;
  flex-wrap: wrap;
}
.page .page-title .icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  flex: 0 0 34px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--fv-mint-soft);
  color: var(--accent-hover);
}
.page .page-sub,
.page .kn-page-subtitle,
.page .fv-hero-sub {
  color: var(--muted);
  font-size: 12px;
}

/* ── Cards / panels (cream surface) ── */
.page .card,
.page .stat-card,
.page .decision-card,
.page .suggestion-card,
.page .wiki-domain-group,
.page .kn-card,
.page .pc-sec,
.page .kn-section,
.page .pi-panel {
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--sh-sm);
  padding: 1rem;
  margin-bottom: 1rem;
  min-width: 0;
}
.page .card:hover,
.page .kn-card:hover,
.page .pc-sec:hover {
  border-color: var(--border2);
}
.page .card-title,
.page .section-title,
.page .section-header,
.page .kn-page-title,
.page .pc-sec-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  padding-bottom: .55rem;
  margin-bottom: .75rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.page .card-title a,
.page .section-title a { color: var(--accent-hover); text-decoration: none; font-weight: 600; }
.page .card-title a:hover { text-decoration: underline; }

/* ── Form controls ── */
.page label,
.page .form-label,
.page .kn-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: .25rem;
}
.page:not(#page-dashboard) input[type="text"],
.page:not(#page-dashboard) input[type="number"],
.page:not(#page-dashboard) input[type="password"],
.page:not(#page-dashboard) input[type="date"],
.page:not(#page-dashboard) input[type="search"],
.page:not(#page-dashboard) input[type="email"],
.page:not(#page-dashboard) input[type="url"],
.page:not(#page-dashboard) input[type="tel"],
.page:not(#page-dashboard) input[type="time"],
.page:not(#page-dashboard) textarea,
.page:not(#page-dashboard) select,
.page:not(#page-dashboard) .form-input,
.page:not(#page-dashboard) .kn-input {
  width: 100%;
  max-width: 100%;
  min-height: 38px;
  padding: .5rem .7rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--s1);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  line-height: 1.4;
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
  outline: none;
}
.page:not(#page-dashboard) textarea { min-height: 72px; resize: vertical; }
.page:not(#page-dashboard) input:focus,
.page:not(#page-dashboard) textarea:focus,
.page:not(#page-dashboard) select:focus,
.page:not(#page-dashboard) .form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.page:not(#page-dashboard) input::placeholder,
.page:not(#page-dashboard) textarea::placeholder { color: var(--muted); opacity: .8; }
.page .input-row,
.page .form-row,
.page .bl-form-row,
.page .form-group {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-bottom: .75rem;
  align-items: flex-end;
}
.page .input-row > *,
.page .form-row > *,
.page .bl-form-row > * { flex: 1; min-width: 120px; }
.page .form-group { flex-direction: column; align-items: stretch; }

/* ── Buttons ── */
.page:not(#page-dashboard) button,
.page:not(#page-dashboard) .btn,
.page .bl-btn,
.page .kn-tab,
.page .kn-filter-chip,
.page .pi-tab,
.page .pi-pan-btn,
.page .pi-zoom-btn,
.page .refresh-btn,
.page .pc-details-toggle {
  font-family: inherit;
  font-size: 12px;
  font-weight: 550;
  min-height: 36px;
  padding: .45rem .85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--s1);
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.page:not(#page-dashboard) button:hover,
.page:not(#page-dashboard) .btn:hover,
.page .bl-btn:hover { background: var(--s2); border-color: var(--border2); }
.page:not(#page-dashboard) button:focus-visible,
.page:not(#page-dashboard) .btn:focus-visible,
.page .bl-btn:focus-visible,
.fv-nav-toggle:focus-visible,
.fv-nav-backdrop:focus-visible,
.nav-item:focus-visible,
.nav-sub-item:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
.page:not(#page-dashboard) .btn-primary,
.page .bl-btn-primary,
.page:not(#page-dashboard) button[type="submit"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.page:not(#page-dashboard) .btn-primary:hover,
.page .bl-btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.page:not(#page-dashboard) .btn-ghost,
.page .bl-btn:not(.bl-btn-primary):not(.bl-btn-danger) { background: transparent; }
.page .bl-btn-danger { background: var(--red-dim); border-color: rgba(196,96,96,.4); color: var(--red); }
.page .bl-btn-danger:hover { background: var(--red); color: #fff; }
.page:not(#page-dashboard) button:disabled,
.page:not(#page-dashboard) .btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── Tables ── */
.page table,
.page table.dataTable {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.page thead th {
  text-align: left;
  padding: .55rem .7rem;
  background: var(--s2);
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
}
.page tbody td {
  padding: .5rem .7rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: top;
}
.page tbody tr:last-child td { border-bottom: none; }
.page tbody tr:hover td { background: var(--fv-mint-soft); }
.page .table-wrap,
.page .table-container,
.page .overflow-x-auto,
.page .kn-explorer-list {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ── Lists / items ── */
.page .item-list,
.page .list,
.page .kn-explorer-list { display: flex; flex-direction: column; gap: .4rem; min-width: 0; }
.page .list-item,
.page .item,
.page .kn-item {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  padding: .55rem .65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--s1);
  min-width: 0;
  transition: border-color var(--dur-fast) var(--ease);
}
.page .list-item:hover { border-color: var(--border2); }
.page .item-title { font-size: 12.5px; color: var(--text); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.page .item-sub { font-size: 11px; color: var(--muted2); }

/* ── Status badges ── */
.page .badge,
.page .status-badge,
.page .bl-status-badge,
.page .kn-status,
.page .tag-chip,
.page .tag-chip-wrap .tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 10px;
  white-space: nowrap;
  border: 1px solid var(--border);
  background: var(--s2);
  color: var(--muted);
}
.page .badge.ok, .page .status-active, .page .bl-status-running { background: var(--green-dim); color: var(--green); border-color: rgba(90,138,106,.4); }
.page .badge.err, .page .status-error, .page .bl-status-failed { background: var(--red-dim); color: var(--red); border-color: rgba(196,96,96,.4); }
.page .badge.warn, .page .bl-status-pending { background: var(--yellow-dim); color: var(--fv-gold-text); border-color: rgba(184,154,74,.4); }
.page .badge.info, .page .bl-status-done { background: var(--blue-dim); color: var(--blue); border-color: rgba(90,138,170,.4); }

/* ── Loading / error / empty states ── */
.page .loading-text,
.page .bl-loading,
.page .domain-skeleton,
.page [class*="loading"] {
  color: var(--muted2);
  font-size: 12px;
  padding: .6rem;
  text-align: center;
}
.page .empty,
.page .kn-empty,
.page .fv-empty {
  font-size: 12px;
  color: var(--muted);
  padding: .75rem;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: rgba(250,249,243,.65);
}
.page .error,
.page .domain-error,
.page .fv-error { color: var(--red); font-size: 12px; padding: .6rem; text-align: center; }

/* ── Grids ── */
.page .grid2, .page .grid3, .page .grid4,
.page .dash-row, .page .form-grid,
.page .kn-type-grid, .page .kn-status-grid,
.page .kn-decision-matrix, .page .bl-stats {
  display: grid;
  gap: 1rem;
  min-width: 0;
}
.page .grid2 { grid-template-columns: 1fr 1fr; }
.page .grid3 { grid-template-columns: 1fr 1fr 1fr; }
.page .grid4 { grid-template-columns: repeat(4, 1fr); }
.page .grid2 > *, .page .grid3 > *, .page .grid4 > *,
.page .dash-row > *, .page .bl-stats > * { min-width: 0; }

/* ── Modals ── */
.modal {
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--sh-md);
  color: var(--text);
}
.modal-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  padding-bottom: .6rem;
  margin-bottom: .75rem;
  border-bottom: 1px solid var(--border);
}
.modal-footer { display: flex; gap: .5rem; justify-content: flex-end; margin-top: 1rem; padding-top: .75rem; border-top: 1px solid var(--border); }

/* ── Agent health pills (topbar) ── */
.agent-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  padding: 3px 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--s2);
  color: var(--muted);
  white-space: nowrap;
}
.agent-pill .dot { width: 6px; height: 6px; border-radius: 5px; background: var(--s3); }
.agent-pill.ok .dot { background: var(--green); }
.agent-pill.err .dot { background: var(--red); }
.agent-pill.ok { color: var(--text); border-color: rgba(90,138,106,.4); }
.agent-pill.err { color: var(--red); }

/* ── Scrollbar polish (webkit) ── */
.sidebar::-webkit-scrollbar,
.content::-webkit-scrollbar,
.kn-body::-webkit-scrollbar { width: 8px; height: 8px; }
.sidebar::-webkit-scrollbar-thumb,
.content::-webkit-scrollbar-thumb,
.kn-body::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 4px; }
.sidebar::-webkit-scrollbar-track,
.content::-webkit-scrollbar-track { background: transparent; }

/* ============================================================
   Freeverse — responsive (whole-site)
   Breakpoints: 360 / 390 / 430 / 768 / 1024 / desktop
   ============================================================ */

@media (max-width: 1024px) {
  .page .grid3, .page .grid4 { grid-template-columns: 1fr 1fr; }
  .page .kn-type-grid, .page .kn-status-grid { grid-template-columns: 1fr 1fr; }
}

/* Tablet */
@media (min-width: 769px) and (max-width: 1100px) {
  .page { padding: 1rem 1.1rem 2rem; }
}

/* Mobile drawer is already defined above (@media max-width 768px).
   Here we add whole-page mobile refinements. */
@media (max-width: 768px) {
  .page { padding: 0; width: 100%; min-width: 0; }
  .page:not(#page-dashboard) { padding: .2rem .75rem 1.25rem; }
  .page:not(#page-dashboard) .page-title { margin-bottom: .9rem; font-size: 1.12rem; }
  .page .grid2, .page .grid3, .page .grid4,
  .page .dash-row { grid-template-columns: minmax(0, 1fr); gap: .75rem; }
  .page .card, .page .kn-card, .page .pc-sec { padding: .8rem; }
  .page .input-row, .page .form-row, .page .bl-form-row { flex-direction: column; align-items: stretch; }
  .page .input-row > *, .page .form-row > *, .page .bl-form-row > * { min-width: 0; }
  .page table { font-size: 12px; }
  .page thead th, .page tbody td { padding: .45rem .5rem; }
  .modal { width: min(95vw, 520px); min-width: 0; resize: none; }
  .agent-pills { display: none; }
  /* PI graph: keep usable — focus, don't shrink */
  #pi-map-container { min-height: 320px; }
  .pi-map-controls { transform: scale(.9); transform-origin: bottom right; }
}

@media (max-width: 430px) {
  .page:not(#page-dashboard) .page-title { font-size: 1rem; }
  .page .card, .page .kn-card, .page .pc-sec { padding: .65rem; }
  .page .card-title { font-size: 12px; }
  .page button, .page .btn, .page .bl-btn { padding: .4rem .6rem; }
  .page .bl-form-row label { min-width: auto; }
}

@media (max-width: 390px) {
  .page:not(#page-dashboard) .page-title { font-size: .95rem; }
  .page thead th, .page tbody td { padding: .4rem .45rem; font-size: 11.5px; }
}

@media (max-width: 360px) {
  .page:not(#page-dashboard) .page-title { font-size: .9rem; }
  .page .card, .page .kn-card { padding: .55rem; }
}

@media (prefers-reduced-motion: reduce) {
  .nav-label::after,
  .nav-section-body,
  .page button,
  .page .btn,
  .page input,
  .page textarea,
  .page select { transition-duration: .01ms !important; }
}

/* Fragment-based domain workspaces share the shell but keep their own feature styles. */
#workspace-main {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  color: var(--text);
  line-height: 1.55;
}
#workspace-main :is(input, textarea, select) {
  max-width: 100%;
  box-sizing: border-box;
  font-family: inherit;
}
#workspace-main :is(img, svg, canvas, video) { max-width: 100%; }
#workspace-main :is(button, a, [role="button"], input, textarea, select):focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
#workspace-main .domain-skeleton,
#workspace-main .domain-error {
  margin: .75rem 0;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--s1);
  color: var(--muted);
  overflow-wrap: anywhere;
}
#workspace-main .domain-error {
  color: var(--red);
  border-color: rgba(196, 96, 96, .35);
  background: var(--red-dim);
}
@media (max-width: 768px) {
  #workspace-main { padding-bottom: max(.75rem, env(safe-area-inset-bottom)); }
  #workspace-main :is(input, textarea, select, button) { min-height: 38px; }
}

/* ═══════════════════════════════════════════════════════════════
   Planetary Constellation Dashboard
   ═══════════════════════════════════════════════════════════════ */

/* Dashboard container */
.fv-dash {
  padding: 16px 20px;
  background: #0d1117;
  min-height: 100%;
  color: #e6edf3;
  font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

/* Header */
.fv-dash-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #21262d;
}
.fv-dash-title {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 4px;
  color: #e6edf3;
  letter-spacing: 0.5px;
}
.fv-dash-sub {
  font-size: 13px;
  color: #8b949e;
  margin: 0;
}
.fv-dash-status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}
.fv-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 12px;
  background: rgba(63, 185, 80, 0.1);
  border: 1px solid rgba(63, 185, 80, 0.3);
  font-size: 12px;
  color: #3fb950;
}
.fv-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3fb950;
  animation: fv-pulse 2s ease-in-out infinite;
}
@keyframes fv-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.fv-status-time {
  font-size: 11px;
  color: #8b949e;
}

/* Main layout: constellation + right panel */
.fv-dash-main {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

/* ═══════════ CONSTELLATION ═══════════ */
.fv-constellation {
  flex: 1;
  min-width: 0;
  background: #161b22;
  border: 1px solid #21262d;
  border-radius: 12px;
  overflow: hidden;
}
.fv-const-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid #21262d;
  background: #1c2128;
}
.fv-const-title {
  font-size: 15px;
  font-weight: 600;
  color: #e6edf3;
}
.fv-const-tabs {
  display: flex;
  gap: 4px;
}
.fv-const-tab {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  color: #8b949e;
  background: #21262d;
}
.fv-const-tab.active {
  color: #1f9e8e;
  background: rgba(31, 158, 142, 0.15);
}
.fv-const-legend {
  display: flex;
  gap: 10px;
}
.fv-legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: #8b949e;
}
.fv-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* ── 3D Depth System ── */
.fv-const-canvas {
  position: relative;
  height: 560px;
  background: radial-gradient(ellipse at 50% 40%, #0d1117 0%, #010409 100%);
  overflow: hidden;
  perspective: 1200px;
  transform-style: preserve-3d;
}

/* Inter-planet connections */
.fv-const-connections {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* ── Elliptical Orbits ── */
.fv-planet-orbit {
  position: absolute;
  left: var(--orbit-x);
  top: var(--orbit-y);
  transform: translate(-50%, -50%);
  width: var(--orbit-size);
  height: var(--orbit-size);
  transform-style: preserve-3d;
}

/* Planet base */
.fv-planet {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  cursor: pointer;
  z-index: 2;
}
.fv-planet-body {
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
}
.fv-planet:hover .fv-planet-body {
  transform: scale(1.08);
}

/* ── Enhanced Planet Visuals ── */
/* Planet 1: Earth-like (Personal Evolution) */
.fv-planet-earth .fv-planet-body {
  width: 90px;
  height: 90px;
  background: radial-gradient(circle at 35% 35%, #2a8a7a, #1f9e8e 40%, #0d5a4e 70%, #062e28);
  box-shadow:
    0 0 30px rgba(31, 158, 142, 0.3),
    0 0 60px rgba(31, 158, 142, 0.15),
    inset -8px -8px 20px rgba(0,0,0,0.4),
    inset 4px 4px 10px rgba(255,255,255,0.1);
}
.fv-planet-earth .fv-planet-body::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: radial-gradient(circle, transparent 60%, rgba(31, 158, 142, 0.2) 100%);
  pointer-events: none;
}
.fv-planet-earth .fv-planet-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotateX(75deg);
  width: 130px;
  height: 130px;
  border: 1px solid rgba(31, 158, 142, 0.3);
  border-radius: 50%;
  pointer-events: none;
}

/* Planet 2: Mars-like (Technical Runtime) */
.fv-planet-mars .fv-planet-body {
  width: 75px;
  height: 75px;
  background: radial-gradient(circle at 35% 35%, #8a4a3a, #c4604a 40%, #7a2a1a 70%, #3a1008);
  box-shadow:
    0 0 25px rgba(196, 96, 60, 0.3),
    0 0 50px rgba(196, 96, 60, 0.12),
    inset -6px -6px 15px rgba(0,0,0,0.4),
    inset 3px 3px 8px rgba(255,255,255,0.1);
}
.fv-planet-mars .fv-planet-body::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: radial-gradient(circle, transparent 60%, rgba(196, 96, 60, 0.18) 100%);
  pointer-events: none;
}

/* Planet 3: Jupiter-like (Evolution & Governance) */
.fv-planet-jupiter .fv-planet-body {
  width: 80px;
  height: 80px;
  background: radial-gradient(circle at 35% 35%, #a88a4a, #c89a3a 40%, #8a6a1a 70%, #4a3a08);
  box-shadow:
    0 0 25px rgba(200, 154, 58, 0.3),
    0 0 50px rgba(200, 154, 58, 0.12),
    inset -6px -6px 15px rgba(0,0,0,0.4),
    inset 3px 3px 8px rgba(255,255,255,0.1);
}
.fv-planet-jupiter .fv-planet-body::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: radial-gradient(circle, transparent 60%, rgba(200, 154, 58, 0.18) 100%);
  pointer-events: none;
}

/* Planet text */
.fv-planet-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px;
}
.fv-planet-name {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
  line-height: 1.2;
}
.fv-planet-en {
  font-size: 8px;
  color: rgba(255,255,255,0.7);
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
  line-height: 1.2;
}

/* Elliptical orbit paths — shown only for focused planet */
.fv-satellite::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: calc(var(--orbit-rx, 120px) * 2);
  height: calc(var(--orbit-ry, 80px) * 2);
  transform: translate(-50%, -50%);
  border: 1px dashed rgba(48, 54, 61, 0.2);
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.4s;
}
.fv-focused .fv-satellite::before {
  opacity: 1;
}

/* Satellite — position driven by JS elliptical orbit engine */
.fv-satellite {
  position: absolute;
  top: 0;
  left: 0;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  background: #1c2128;
  border: 2px solid #58a6ff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: box-shadow 0.2s ease;
  will-change: transform, opacity;
}
.fv-satellite:hover {
  box-shadow: 0 0 14px rgba(88, 166, 255, 0.6);
  z-index: 10;
}
.fv-satellite span {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  color: #8b949e;
  white-space: nowrap;
  pointer-events: none;
}
.fv-satellite:hover span {
  color: #e6edf3;
}

/* Satellite color variants */
.fv-sat-mint { border-color: #1f9e8e; }
.fv-sat-mint:hover { box-shadow: 0 0 14px rgba(31, 158, 142, 0.6); }
.fv-sat-gold { border-color: #c89a3a; }
.fv-sat-gold:hover { box-shadow: 0 0 14px rgba(200, 154, 58, 0.6); }
.fv-sat-blue { border-color: #58a6ff; }
.fv-sat-blue:hover { box-shadow: 0 0 14px rgba(88, 166, 255, 0.6); }
.fv-sat-green { border-color: #3fb950; }
.fv-sat-green:hover { box-shadow: 0 0 14px rgba(63, 185, 80, 0.6); }
.fv-sat-purple { border-color: #bc8cff; }
.fv-sat-purple:hover { box-shadow: 0 0 14px rgba(188, 140, 255, 0.6); }

/* ── Planet Focus Mode ── */
.fv-const-canvas.fv-focus-mode .fv-planet-orbit {
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0.12;
  transform: scale(0.4) translate(-50%, -50%);
  pointer-events: none;
}
.fv-const-canvas.fv-focus-mode .fv-planet-orbit.fv-focused {
  opacity: 1;
  transform: scale(1.4) translate(-50%, -50%);
  z-index: 100;
  pointer-events: all;
}
.fv-const-canvas.fv-focus-mode .fv-satellite {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s;
}
.fv-const-canvas.fv-focus-mode .fv-focused .fv-satellite {
  opacity: 1;
  pointer-events: all;
}

/* ── Focus Overlay + Panel ── */
.fv-focus-overlay {
  position: absolute;
  inset: 0;
  background: rgba(1, 4, 9, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fv-const-canvas.fv-focus-mode .fv-focus-overlay {
  opacity: 1;
  pointer-events: all;
}
.fv-focus-panel {
  width: 420px;
  max-width: 90%;
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.fv-focus-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.fv-focus-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--s2);
  color: var(--text);
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.fv-focus-close:hover { background: var(--red-dim); color: var(--red); }
.fv-focus-sats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.fv-focus-sat {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--s2);
  color: var(--text);
  transition: all 0.2s;
}
.fv-focus-sat:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Relationship Lines ── */
.fv-connection-line {
  fill: none;
  stroke-width: 1.5;
  stroke-dasharray: 6 8;
  animation: fv-dash-flow 30s linear infinite;
  transition: opacity 0.3s, stroke-width 0.3s;
}
.fv-connection-line.fv-highlighted {
  stroke-width: 2.5;
  stroke-dasharray: none;
  animation: none;
  filter: drop-shadow(0 0 4px currentColor);
}
.fv-connection-line.fv-dimmed { opacity: 0.08; }
@keyframes fv-dash-flow { to { stroke-dashoffset: -280; } }

/* ═══════════ RIGHT PANEL ═══════════ */
.fv-right-panel {
  width: 300px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.fv-panel-card {
  background: #161b22;
  border: 1px solid #21262d;
  border-radius: 10px;
  padding: 12px 14px;
}
.fv-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.fv-panel-title {
  font-size: 13px;
  font-weight: 600;
  color: #e6edf3;
}
.fv-panel-link {
  font-size: 11px;
  color: #1f9e8e;
  text-decoration: none;
  cursor: pointer;
}
.fv-panel-link:hover { text-decoration: underline; }

/* Status items */
.fv-status-item { margin-bottom: 10px; }
.fv-status-item:last-child { margin-bottom: 0; }
.fv-status-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
  font-size: 12px;
}
.fv-status-row span:first-child { color: #8b949e; }
.fv-status-row span:last-child { color: #e6edf3; font-weight: 600; }
.fv-status-bar {
  height: 6px;
  background: #21262d;
  border-radius: 3px;
  overflow: hidden;
}
.fv-status-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
}

/* Knowledge list */
.fv-knowledge-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid #21262d;
  font-size: 12px;
}
.fv-knowledge-item:last-child { border-bottom: none; }
.fv-knowledge-title { color: #e6edf3; flex: 1; }
.fv-knowledge-tag {
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 10px;
  color: #fff;
  margin-left: 8px;
}
.fv-knowledge-time { color: #8b949e; font-size: 10px; margin-left: 8px; }

/* Activity list */
.fv-activity-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  font-size: 12px;
}
.fv-activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.fv-activity-dot.green { background: #3fb950; }
.fv-activity-dot.blue { background: #58a6ff; }
.fv-activity-dot.mint { background: #1f9e8e; }
.fv-activity-dot.purple { background: #bc8cff; }
.fv-activity-dot.gold { background: #c89a3a; }
.fv-activity-text { color: #e6edf3; flex: 1; }
.fv-activity-time { color: #8b949e; font-size: 10px; }

/* ═══════════ BOTTOM ROW ═══════════ */
.fv-bottom-row {
  display: flex;
  gap: 12px;
}
.fv-bottom-card {
  flex: 1;
  background: #161b22;
  border: 1px solid #21262d;
  border-radius: 10px;
  padding: 12px 14px;
  min-width: 0;
}
.fv-bottom-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 600;
  color: #e6edf3;
}

/* Component status */
.fv-comp-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 12px;
}
.fv-comp-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3fb950;
  flex-shrink: 0;
}
.fv-comp-name { color: #e6edf3; flex: 1; }
.fv-comp-status { color: #3fb950; font-size: 11px; }

/* Task items */
.fv-task-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  font-size: 12px;
  border-bottom: 1px solid #21262d;
}
.fv-task-item:last-child { border-bottom: none; }
.fv-task-prio {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.fv-task-prio.p1 { background: #f85149; }
.fv-task-prio.p2 { background: #c89a3a; }
.fv-task-prio.p3 { background: #8b949e; }
.fv-task-title { color: #e6edf3; flex: 1; }
.fv-task-meta { color: #8b949e; font-size: 10px; }
.fv-task-status { font-size: 10px; padding: 2px 6px; border-radius: 4px; }
.fv-task-status.running { background: rgba(63,185,80,0.15); color: #3fb950; }
.fv-task-status.active { background: rgba(31,158,142,0.15); color: #1f9e8e; }
.fv-task-status.pending { background: rgba(139,148,158,0.15); color: #8b949e; }

/* Progress card */
.fv-progress-card {
  display: flex;
  align-items: center;
  gap: 16px;
}
.fv-progress-ring {
  position: relative;
  width: 70px;
  height: 70px;
  flex-shrink: 0;
}
.fv-progress-ring svg { transform: rotate(-90deg); }
.fv-progress-ring-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 16px;
  font-weight: 700;
  color: #e6edf3;
}
.fv-progress-stats {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
}
.fv-progress-stat {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #8b949e;
}
.fv-progress-stat-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

/* Quick capture in bottom card */
.fv-quick-capture {
  display: flex;
  gap: 8px;
}
.fv-qc-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #30363d;
  border-radius: 6px;
  background: #0d1117;
  color: #e6edf3;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}
.fv-qc-input:focus { border-color: #1f9e8e; }
.fv-qc-input::placeholder { color: #484f58; }
.fv-qc-type {
  padding: 8px;
  border: 1px solid #30363d;
  border-radius: 6px;
  background: #0d1117;
  color: #e6edf3;
  font-size: 12px;
  outline: none;
}
.fv-qc-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  background: #1f9e8e;
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s;
}
.fv-qc-btn:hover { background: #2ab8a6; }

/* Empty / loading / error states */
.fv-empty { color: #8b949e; font-size: 12px; padding: 8px 0; }
.fv-loading { color: #8b949e; font-size: 12px; padding: 8px 0; }
.fv-error { color: #f85149; font-size: 12px; padding: 8px 0; }

/* ═══════════ HOME PAGE (data-driven) ═══════════ */
.fv-home-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}
.fv-home-grid-2 {
  grid-template-columns: 1fr 1fr;
}
.fv-home-card {
  background: #161b22;
  border: 1px solid #21262d;
  border-radius: 12px;
  padding: 16px;
  min-height: 180px;
}
.fv-home-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #21262d;
}
.fv-home-card-title {
  font-size: 14px;
  font-weight: 600;
  color: #e6edf3;
}
.fv-home-section {
  margin-bottom: 16px;
}
.fv-home-section-head {
  margin-bottom: 12px;
}
.fv-home-section-title {
  font-size: 14px;
  font-weight: 600;
  color: #e6edf3;
}
.fv-domain-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.fv-domain-card {
  background: #161b22;
  border: 1px solid #21262d;
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s;
}
.fv-domain-card:hover {
  border-color: #3fb950;
  transform: translateY(-2px);
}
.fv-domain-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 600;
  color: #e6edf3;
}
.fv-domain-link {
  color: #8b949e;
  font-size: 16px;
}

/* Home data items */
.fv-data-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #21262d;
  font-size: 13px;
}
.fv-data-item:last-child { border-bottom: none; }
.fv-data-label { color: #8b949e; }
.fv-data-value { color: #e6edf3; font-weight: 500; }
.fv-data-value.accent { color: #3fb950; }
.fv-data-value.warning { color: #c89a3a; }
.fv-data-value.danger { color: #f85149; }

/* Direction card */
.fv-direction-item {
  padding: 8px 0;
  border-bottom: 1px solid #21262d;
}
.fv-direction-item:last-child { border-bottom: none; }
.fv-direction-label { font-size: 12px; color: #8b949e; margin-bottom: 4px; }
.fv-direction-value { font-size: 14px; color: #e6edf3; font-weight: 500; }
.fv-direction-bar {
  height: 6px;
  background: #21262d;
  border-radius: 3px;
  margin-top: 6px;
  overflow: hidden;
}
.fv-direction-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--accent);
  transition: width 0.6s ease;
}

/* Attention card */
.fv-attention-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid #21262d;
  font-size: 13px;
}
.fv-attention-item:last-child { border-bottom: none; }
.fv-attention-icon { flex-shrink: 0; font-size: 14px; }
.fv-attention-text { color: #e6edf3; }
.fv-attention-time { font-size: 11px; color: #8b949e; margin-top: 2px; }

/* Actions card */
.fv-action-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid #21262d;
  font-size: 13px;
}
.fv-action-item:last-child { border-bottom: none; }
.fv-action-priority {
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.fv-action-priority.high { background: #f85149; }
.fv-action-priority.medium { background: #c89a3a; }
.fv-action-priority.low { background: #3fb950; }
.fv-action-text { color: #e6edf3; flex: 1; }
.fv-action-time { font-size: 11px; color: #8b949e; }

/* System card */
.fv-system-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #21262d;
  font-size: 13px;
}
.fv-system-row:last-child { border-bottom: none; }
.fv-system-label { color: #8b949e; }
.fv-system-value { color: #e6edf3; font-weight: 500; }
.fv-system-value.ok { color: #3fb950; }
.fv-system-value.warn { color: #c89a3a; }
.fv-system-value.err { color: #f85149; }

/* ═══════════ Decision Center ═══════════ */
.fv-dc-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.fv-dc-tab {
  padding: 6px 14px;
  border-radius: 16px;
  border: 1px solid #21262d;
  background: #161b22;
  color: #8b949e;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}
.fv-dc-tab:hover { border-color: #3fb950; color: #e6edf3; }
.fv-dc-tab.active {
  background: rgba(63, 185, 80, 0.15);
  border-color: #3fb950;
  color: #3fb950;
}
.fv-dc-count {
  display: inline-block;
  min-width: 18px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
}
.fv-dc-item {
  background: #161b22;
  border: 1px solid #21262d;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 10px;
  transition: border-color 0.2s;
}
.fv-dc-item:hover { border-color: #30363d; }
.fv-dc-item-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.fv-dc-item-title {
  font-size: 14px;
  font-weight: 600;
  color: #e6edf3;
  flex: 1;
}
.fv-dc-item-source {
  font-size: 11px;
  color: #8b949e;
  padding: 2px 8px;
  border-radius: 8px;
  background: #21262d;
  white-space: nowrap;
}
.fv-dc-item-source.brain { color: #bc8cff; }
.fv-dc-item-source.knowledge { color: #58a6ff; }
.fv-dc-item-source.project { color: #c89a3a; }
.fv-dc-item-desc {
  font-size: 13px;
  color: #8b949e;
  margin-top: 6px;
  line-height: 1.5;
}
.fv-dc-item-meta {
  display: flex;
  gap: 12px;
  margin-top: 8px;
  font-size: 12px;
  color: #8b949e;
}
.fv-dc-item-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.fv-dc-btn {
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid #21262d;
  background: transparent;
  color: #8b949e;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}
.fv-dc-btn:hover { border-color: #3fb950; color: #3fb950; }
.fv-dc-btn.primary { background: rgba(63, 185, 80, 0.15); border-color: #3fb950; color: #3fb950; }
.fv-dc-btn.primary:hover { background: rgba(63, 185, 80, 0.25); }
.fv-dc-btn.danger { border-color: #f85149; color: #f85149; }
.fv-dc-btn.danger:hover { background: rgba(248, 81, 73, 0.1); }
.fv-dc-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.fv-dc-detail {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #21262d;
  font-size: 13px;
  color: #8b949e;
}
.fv-dc-detail-row {
  display: flex;
  gap: 8px;
  margin-bottom: 6px;
}
.fv-dc-detail-label {
  color: #8b949e;
  min-width: 80px;
}
.fv-dc-detail-value {
  color: #e6edf3;
  flex: 1;
}
.fv-dc-reason-input {
  width: 100%;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #21262d;
  background: #0d1117;
  color: #e6edf3;
  font-size: 13px;
  margin-top: 8px;
}
.fv-dc-reason-input:focus { outline: none; border-color: #3fb950; }

/* ═══════════ Decision Tracking ═══════════ */
.fv-dt-card {
  background: #161b22;
  border: 1px solid #21262d;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 12px;
}
.fv-dt-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}
.fv-dt-card-title {
  font-size: 14px;
  font-weight: 600;
  color: #e6edf3;
  flex: 1;
}
.fv-dt-status {
  font-size: 11px;
  padding: 2px 10px;
  border-radius: 10px;
  font-weight: 600;
}
.fv-dt-status.pending { background: rgba(200, 154, 58, 0.15); color: #c89a3a; }
.fv-dt-status.accepted { background: rgba(63, 185, 80, 0.15); color: #3fb950; }
.fv-dt-status.rejected { background: rgba(248, 81, 73, 0.15); color: #f85149; }
.fv-dt-status.modified { background: rgba(88, 166, 255, 0.15); color: #58a6ff; }
.fv-dt-status.done { background: rgba(63, 185, 80, 0.15); color: #3fb950; }
.fv-dt-status.cancelled { background: rgba(139, 148, 158, 0.15); color: #8b949e; }
.fv-dt-status.cancelled { background: rgba(139, 148, 158, 0.15); color: #8b949e; }
.fv-dt-chain {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.fv-dt-step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 12px;
  background: #0d1117;
  border-radius: 8px;
  border: 1px solid #21262d;
}
.fv-dt-step-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
}
.fv-dt-step-icon.suggestion { background: rgba(188, 140, 255, 0.15); color: #bc8cff; }
.fv-dt-step-icon.decision { background: rgba(88, 166, 255, 0.15); color: #58a6ff; }
.fv-dt-step-icon.action { background: rgba(63, 185, 80, 0.15); color: #3fb950; }
.fv-dt-step-icon.outcome { background: rgba(200, 154, 58, 0.15); color: #c89a3a; }
.fv-dt-step-icon.reflection { background: rgba(188, 140, 255, 0.15); color: #bc8cff; }
.fv-dt-step-body { flex: 1; min-width: 0; }
.fv-dt-step-title {
  font-size: 13px;
  font-weight: 500;
  color: #e6edf3;
}
.fv-dt-step-meta {
  font-size: 11px;
  color: #8b949e;
  margin-top: 4px;
}
.fv-dt-outcome-form {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #21262d;
}
.fv-dt-outcome-form label {
  display: block;
  font-size: 12px;
  color: #8b949e;
  margin-bottom: 4px;
  margin-top: 8px;
}
.fv-dt-outcome-form input,
.fv-dt-outcome-form textarea {
  width: 100%;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #21262d;
  background: #0d1117;
  color: #e6edf3;
  font-size: 13px;
  font-family: inherit;
}
.fv-dt-outcome-form textarea { resize: vertical; min-height: 60px; }
.fv-dt-outcome-form input:focus,
.fv-dt-outcome-form textarea:focus { outline: none; border-color: #3fb950; }

/* Responsive */
@media (max-width: 1200px) {
  .fv-home-grid { grid-template-columns: 1fr 1fr; }
  .fv-domain-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .fv-dash { padding: 12px; }
  .fv-dash-header { flex-direction: column; gap: 8px; }
  .fv-dash-status { align-items: flex-start; }
  .fv-home-grid { grid-template-columns: 1fr; }
  .fv-home-grid-2 { grid-template-columns: 1fr; }
  .fv-domain-grid { grid-template-columns: 1fr; }
  .fv-dc-tabs { gap: 6px; }
  .fv-dc-tab { padding: 4px 10px; font-size: 12px; }
  .fv-dc-item-head { flex-direction: column; gap: 6px; }
}
