:root {
  color-scheme: dark;
  --bg: #07110d;
  --panel: #0d1914;
  --panel-2: #112019;
  --line: rgba(211, 243, 225, .11);
  --line-strong: rgba(211, 243, 225, .2);
  --text: #edf7f1;
  --muted: #91a69b;
  --green: #65e79b;
  --green-2: #28b86a;
  --amber: #f2bd66;
  --red: #ff8585;
  --blue: #83b8ff;
  --radius: 18px;
  --shadow: 0 24px 70px rgba(0, 0, 0, .24);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; color: var(--text); background: var(--bg); }
button, a { font: inherit; }
button { color: inherit; }
a { color: inherit; }
.skip-link { position: fixed; left: 12px; top: -60px; z-index: 50; padding: 10px 14px; border-radius: 10px; background: var(--green); color: #04120a; }
.skip-link:focus { top: 12px; }
:focus-visible { outline: 3px solid rgba(101, 231, 155, .65); outline-offset: 3px; }

.boot-screen, .login-screen { min-height: 100vh; display: grid; place-content: center; justify-items: center; padding: 28px; text-align: center; background: radial-gradient(circle at 50% 26%, rgba(46, 171, 101, .15), transparent 34%); }
.brand-mark { display: grid; place-items: center; width: 48px; height: 48px; border: 1px solid rgba(101, 231, 155, .5); border-radius: 15px; color: var(--green); background: rgba(101, 231, 155, .08); font-size: 22px; font-weight: 800; box-shadow: inset 0 0 22px rgba(101, 231, 155, .06); }
.boot-screen p { margin: 18px 0 5px; font-weight: 750; letter-spacing: -.02em; }
.boot-screen span { color: var(--muted); font-size: 13px; }
.login-card { width: min(100%, 480px); padding: 42px; border: 1px solid var(--line); border-radius: 26px; background: rgba(13, 25, 20, .92); box-shadow: var(--shadow); text-align: left; }
.login-card .brand-mark { margin-bottom: 48px; }
.eyebrow { margin: 0 0 10px; color: var(--green); font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.login-card h1 { margin: 0; font-size: clamp(34px, 7vw, 54px); line-height: .98; letter-spacing: -.055em; }
.login-card > p:not(.eyebrow) { margin: 18px 0 30px; color: var(--muted); line-height: 1.65; }
.secure-note { display: flex; gap: 10px; margin-top: 20px; color: var(--muted); font-size: 12px; }

.primary-button, .quiet-button, .icon-button { border: 0; cursor: pointer; }
.primary-button { display: inline-flex; justify-content: center; align-items: center; width: 100%; min-height: 48px; padding: 0 20px; border-radius: 13px; background: var(--green); color: #06140c; font-weight: 800; transition: transform .18s ease, background .18s ease; }
.primary-button:hover { transform: translateY(-1px); background: #80f0ac; }
.quiet-button { padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: transparent; color: var(--muted); }
.quiet-button:hover { color: var(--text); border-color: var(--line-strong); }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 24px 16px; border-right: 1px solid var(--line); background: #08130f; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 26px; text-decoration: none; }
.brand b { display: block; letter-spacing: -.02em; }
.brand small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .12em; }
.nav-label { margin: 20px 10px 8px; color: #64776d; font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.sidebar nav { display: grid; gap: 4px; }
.nav-button { display: flex; align-items: center; gap: 11px; min-height: 42px; padding: 0 12px; border: 0; border-radius: 11px; color: var(--muted); background: transparent; cursor: pointer; text-align: left; }
.nav-button:hover { color: var(--text); background: rgba(255, 255, 255, .025); }
.nav-button.active { color: var(--text); background: rgba(101, 231, 155, .09); box-shadow: inset 3px 0 var(--green); }
.nav-icon { width: 18px; color: var(--green); font-size: 13px; text-align: center; }
.owner-card { margin-top: auto; display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; padding: 13px 10px; border-top: 1px solid var(--line); }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #193227; color: var(--green); font-weight: 800; }
.owner-card b, .owner-card small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.owner-card b { font-size: 12px; }
.owner-card small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.icon-button { padding: 7px; background: transparent; color: var(--muted); border-radius: 8px; }

.main { min-width: 0; }
.topbar { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 34px; border-bottom: 1px solid var(--line); background: rgba(7, 17, 13, .88); backdrop-filter: blur(18px); }
.topbar h1 { margin: 0; font-size: 15px; letter-spacing: -.01em; }
.sync-state { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 12px rgba(101, 231, 155, .75); }
.workspace { width: min(1480px, 100%); margin: 0 auto; padding: 38px 34px 80px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.page-head h2 { margin: 4px 0 0; font-size: clamp(29px, 4vw, 44px); letter-spacing: -.045em; }
.page-head p { margin: 8px 0 0; color: var(--muted); line-height: 1.55; }
.date-chip { flex: 0 0 auto; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); font-size: 11px; }

.status-banner { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 18px; padding: 18px 20px; border: 1px solid rgba(101, 231, 155, .18); border-radius: var(--radius); background: linear-gradient(100deg, rgba(101, 231, 155, .095), rgba(101, 231, 155, .025)); }
.status-banner b { display: block; font-size: 14px; }
.status-banner span { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; }
.health-score { color: var(--green); font-size: 22px; font-weight: 800; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.metric, .panel, .product-card, .roadmap-column { border: 1px solid var(--line); background: var(--panel); }
.metric { min-height: 118px; padding: 19px; border-radius: 15px; }
.metric span { color: var(--muted); font-size: 11px; }
.metric b { display: block; margin-top: 18px; font-size: 27px; letter-spacing: -.04em; }
.metric small { display: block; margin-top: 5px; color: var(--green); font-size: 10px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, .7fr); gap: 18px; }
.panel { padding: 22px; border-radius: var(--radius); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.panel-head h3 { margin: 0; font-size: 15px; }
.panel-head span { color: var(--muted); font-size: 10px; }
.list { display: grid; }
.list-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); }
.list-row:first-child { border-top: 0; }
.list-row b { display: block; font-size: 13px; }
.list-row small { display: block; margin-top: 5px; color: var(--muted); line-height: 1.45; }
.badge { display: inline-flex; align-items: center; min-height: 24px; padding: 0 9px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); font-size: 10px; white-space: nowrap; }
.badge.green { color: var(--green); border-color: rgba(101, 231, 155, .24); background: rgba(101, 231, 155, .06); }
.badge.amber { color: var(--amber); border-color: rgba(242, 189, 102, .22); }
.badge.red { color: var(--red); border-color: rgba(255, 133, 133, .22); }
.badge.blue { color: var(--blue); border-color: rgba(131, 184, 255, .22); }
.progress { height: 5px; margin-top: 10px; overflow: hidden; border-radius: 99px; background: #1b2b23; }
.progress i { display: block; height: 100%; border-radius: inherit; background: var(--green); }

.product-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.product-card { display: flex; min-height: 210px; flex-direction: column; padding: 20px; border-radius: 16px; }
.product-card header { display: flex; justify-content: space-between; gap: 14px; }
.product-card h3 { margin: 18px 0 8px; font-size: 20px; letter-spacing: -.03em; }
.product-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.product-card footer { margin-top: auto; padding-top: 20px; color: var(--muted); font-size: 10px; }
.domain { color: var(--green); font-size: 11px; }
.roadmap-board { display: grid; grid-template-columns: repeat(4, minmax(240px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 8px; }
.roadmap-column { min-height: 470px; padding: 15px; border-radius: 16px; }
.column-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 13px; padding: 2px 3px 12px; border-bottom: 1px solid var(--line); }
.column-head b { font-size: 12px; }
.task-card { margin-top: 9px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); }
.task-card b { font-size: 12px; line-height: 1.4; }
.task-card p { margin: 7px 0 13px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.task-card footer { display: flex; justify-content: space-between; color: #60746a; font-size: 9px; }
.wide-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, .45fr); gap: 18px; }
.code-block { overflow: auto; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: #07100c; color: #b5c9be; font: 11px/1.65 Consolas, monospace; }
.domain-table { width: 100%; border-collapse: collapse; }
.domain-table th, .domain-table td { padding: 13px 10px; border-top: 1px solid var(--line); text-align: left; font-size: 11px; }
.domain-table th { border-top: 0; color: var(--muted); font-size: 9px; letter-spacing: .09em; text-transform: uppercase; }
.domain-table td:first-child { color: var(--green); font-weight: 700; }
.empty { padding: 38px 20px; color: var(--muted); text-align: center; }
.notice { margin-bottom: 16px; padding: 14px 16px; border: 1px solid rgba(242, 189, 102, .22); border-radius: 13px; background: rgba(242, 189, 102, .05); color: #d9c39a; font-size: 11px; line-height: 1.55; }
.security-form { display: grid; gap: 12px; }
.security-form label { display: grid; gap: 7px; color: var(--muted); font-size: 10px; }
.security-form input { width: 100%; min-height: 43px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); background: #08130f; }
.security-form .primary-button { margin-top: 4px; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 40; max-width: 360px; padding: 13px 16px; border: 1px solid var(--line-strong); border-radius: 12px; background: #14251d; color: var(--text); font-size: 12px; box-shadow: var(--shadow); opacity: 0; transform: translateY(12px); pointer-events: none; transition: .2s ease; }
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 1100px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid, .wide-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { position: static; width: 100%; height: auto; padding: 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { padding-bottom: 12px; }
  .sidebar nav { grid-template-columns: repeat(4, minmax(0, 1fr)); overflow-x: auto; }
  .nav-label, .owner-card { display: none; }
  .nav-button { justify-content: center; min-width: 120px; font-size: 11px; }
  .topbar { min-height: 58px; padding: 0 18px; }
  .workspace { padding: 26px 16px 60px; }
  .page-head { display: block; }
  .date-chip { display: inline-block; margin-top: 16px; }
  .product-grid { grid-template-columns: 1fr; }
}
@media (max-width: 500px) {
  .login-card { padding: 28px 22px; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .metric { min-height: 102px; padding: 15px; }
  .metric b { margin-top: 13px; font-size: 23px; }
  .status-banner { align-items: flex-start; }
  .health-score { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}

/* Selleres HQ — light glass system */
:root {
  color-scheme: light;
  --bg: #f5f5f7;
  --panel: rgba(255, 255, 255, .68);
  --panel-2: rgba(255, 255, 255, .78);
  --line: rgba(15, 23, 42, .075);
  --line-strong: rgba(15, 23, 42, .13);
  --text: #1d1d1f;
  --muted: #6e6e73;
  --green: #0071e3;
  --green-2: #0077ed;
  --amber: #b36800;
  --red: #d70015;
  --blue: #0071e3;
  --radius: 22px;
  --shadow: 0 18px 50px rgba(15, 23, 42, .07), 0 2px 10px rgba(15, 23, 42, .035);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", Inter, "Segoe UI", Arial, sans-serif;
}

html {
  background: #f5f5f7;
}

body {
  background:
    radial-gradient(circle at 16% -10%, rgba(255, 255, 255, .98) 0, rgba(255, 255, 255, 0) 34%),
    radial-gradient(circle at 88% 8%, rgba(216, 229, 247, .45) 0, rgba(216, 229, 247, 0) 31%),
    linear-gradient(145deg, #f7f7f9 0%, #eceef2 100%);
  background-attachment: fixed;
}

.boot-screen,
.login-screen {
  background:
    radial-gradient(circle at 50% 12%, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0) 36%),
    radial-gradient(circle at 72% 70%, rgba(207, 224, 247, .55), rgba(207, 224, 247, 0) 34%),
    linear-gradient(145deg, #f8f8fa, #e8ebf0);
}

.login-card {
  border: 1px solid rgba(255, 255, 255, .86);
  background: rgba(255, 255, 255, .68);
  box-shadow: 0 38px 100px rgba(15, 23, 42, .12), inset 0 1px rgba(255, 255, 255, .95);
  backdrop-filter: blur(34px) saturate(175%);
  -webkit-backdrop-filter: blur(34px) saturate(175%);
}

.brand-mark {
  border: 1px solid rgba(255, 255, 255, .8);
  color: #fff;
  background: linear-gradient(150deg, #45454a 0%, #171719 100%);
  box-shadow: 0 10px 25px rgba(0, 0, 0, .15), inset 0 1px rgba(255, 255, 255, .25);
}

.eyebrow {
  color: #717176;
}

.primary-button {
  background: #1d1d1f;
  color: #fff;
  box-shadow: 0 10px 22px rgba(29, 29, 31, .16);
}

.primary-button:hover {
  background: #000;
  box-shadow: 0 13px 28px rgba(29, 29, 31, .2);
}

.app-shell {
  background: transparent;
}

.sidebar {
  border-right: 1px solid rgba(15, 23, 42, .065);
  background: rgba(246, 247, 249, .7);
  box-shadow: inset -1px 0 rgba(255, 255, 255, .65);
  backdrop-filter: blur(34px) saturate(165%);
  -webkit-backdrop-filter: blur(34px) saturate(165%);
}

.brand small,
.nav-label {
  color: #86868b;
}

.nav-button {
  color: #67676c;
}

.nav-button:hover {
  color: #1d1d1f;
  background: rgba(255, 255, 255, .62);
}

.nav-button.active {
  color: #1d1d1f;
  background: rgba(255, 255, 255, .86);
  box-shadow: 0 8px 22px rgba(15, 23, 42, .065), inset 0 1px rgba(255, 255, 255, .95);
}

.nav-icon {
  color: #0071e3;
}

.owner-card {
  border-color: rgba(15, 23, 42, .07);
}

.avatar {
  color: #fff;
  background: linear-gradient(145deg, #8e8e93, #4b4b50);
  box-shadow: inset 0 1px rgba(255, 255, 255, .3);
}

.topbar {
  border-bottom: 1px solid rgba(15, 23, 42, .055);
  background: rgba(248, 248, 250, .66);
  box-shadow: inset 0 -1px rgba(255, 255, 255, .6);
  backdrop-filter: blur(28px) saturate(170%);
  -webkit-backdrop-filter: blur(28px) saturate(170%);
}

.pulse {
  background: #34c759;
  box-shadow: 0 0 0 4px rgba(52, 199, 89, .11), 0 0 14px rgba(52, 199, 89, .35);
}

.date-chip,
.quiet-button {
  border-color: rgba(15, 23, 42, .07);
  background: rgba(255, 255, 255, .46);
  box-shadow: inset 0 1px rgba(255, 255, 255, .8);
}

.status-banner {
  border: 1px solid rgba(255, 255, 255, .85);
  background: linear-gradient(120deg, rgba(255, 255, 255, .82), rgba(244, 248, 253, .62));
  box-shadow: var(--shadow), inset 0 1px rgba(255, 255, 255, .96);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
}

.health-score {
  color: #1d1d1f;
  letter-spacing: -.04em;
}

.metric,
.panel,
.product-card,
.roadmap-column {
  border: 1px solid rgba(255, 255, 255, .86);
  background: rgba(255, 255, 255, .66);
  box-shadow: var(--shadow), inset 0 1px rgba(255, 255, 255, .92);
  backdrop-filter: blur(26px) saturate(165%);
  -webkit-backdrop-filter: blur(26px) saturate(165%);
}

.metric {
  transition: transform .22s ease, box-shadow .22s ease, background .22s ease;
}

.metric:hover,
.product-card:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, .82);
  box-shadow: 0 22px 55px rgba(15, 23, 42, .095), inset 0 1px rgba(255, 255, 255, 1);
}

.metric small,
.domain {
  color: #0071e3;
}

.list-row,
.column-head,
.domain-table th,
.domain-table td {
  border-color: rgba(15, 23, 42, .065);
}

.badge {
  border-color: rgba(15, 23, 42, .09);
  background: rgba(255, 255, 255, .58);
  color: #6e6e73;
}

.badge.green {
  color: #187a32;
  border-color: rgba(52, 199, 89, .17);
  background: rgba(52, 199, 89, .09);
}

.badge.amber {
  color: #9a5900;
  border-color: rgba(255, 159, 10, .2);
  background: rgba(255, 159, 10, .08);
}

.badge.red {
  color: #c3192d;
  border-color: rgba(255, 59, 48, .18);
  background: rgba(255, 59, 48, .07);
}

.badge.blue {
  color: #0066cc;
  border-color: rgba(0, 113, 227, .17);
  background: rgba(0, 113, 227, .07);
}

.progress {
  background: rgba(120, 120, 128, .14);
}

.progress i {
  background: linear-gradient(90deg, #0a84ff, #64a9ff);
  box-shadow: 0 0 12px rgba(10, 132, 255, .2);
}

.task-card {
  border-color: rgba(15, 23, 42, .07);
  background: rgba(255, 255, 255, .72);
  box-shadow: 0 8px 24px rgba(15, 23, 42, .045), inset 0 1px rgba(255, 255, 255, .85);
}

.code-block {
  border-color: rgba(15, 23, 42, .08);
  background: rgba(244, 245, 247, .82);
  color: #424247;
  box-shadow: inset 0 1px 4px rgba(15, 23, 42, .04);
}

.notice {
  border-color: rgba(255, 159, 10, .18);
  background: rgba(255, 246, 224, .72);
  color: #795117;
}

.notice.success {
  border-color: rgba(52, 199, 89, .18);
  background: rgba(232, 248, 237, .72);
  color: #27653a;
}

.security-form input {
  border-color: rgba(15, 23, 42, .1);
  color: #1d1d1f;
  background: rgba(255, 255, 255, .76);
  box-shadow: inset 0 1px 3px rgba(15, 23, 42, .035);
}

.security-form input:focus {
  border-color: rgba(0, 113, 227, .45);
  outline: 3px solid rgba(0, 113, 227, .11);
}

.toast {
  border-color: rgba(255, 255, 255, .86);
  background: rgba(255, 255, 255, .82);
  color: #1d1d1f;
  box-shadow: 0 22px 60px rgba(15, 23, 42, .13), inset 0 1px rgba(255, 255, 255, .95);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
}

:focus-visible {
  outline-color: rgba(0, 113, 227, .58);
}

@media (max-width: 760px) {
  .sidebar {
    background: rgba(247, 248, 250, .88);
  }
}

/* Interactive project memory cloud */
.memory-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(110px, 150px)) minmax(260px, 1fr);
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.memory-summary > div {
  min-height: 84px;
  padding: 15px 17px;
  border: 1px solid rgba(255, 255, 255, .86);
  border-radius: 18px;
  background: rgba(255, 255, 255, .64);
  box-shadow: 0 12px 34px rgba(15, 23, 42, .055), inset 0 1px rgba(255, 255, 255, .95);
  backdrop-filter: blur(22px) saturate(160%);
}

.memory-summary span {
  display: block;
  color: var(--muted);
  font-size: 10px;
}

.memory-summary strong {
  display: block;
  margin-top: 9px;
  font-size: 24px;
  letter-spacing: -.04em;
}

.memory-summary > p {
  margin: 0;
  padding: 0 8px 0 20px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.memory-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, .8fr) minmax(320px, 1.5fr) auto;
  align-items: center;
  gap: 15px;
  margin-bottom: 14px;
  padding: 13px;
  border-radius: 18px;
}

.memory-search {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: 12px;
  background: rgba(255, 255, 255, .7);
  box-shadow: inset 0 1px 3px rgba(15, 23, 42, .035);
  color: #8e8e93;
}

.memory-search input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font: inherit;
  font-size: 11px;
}

.memory-search:focus-within {
  border-color: rgba(0, 113, 227, .35);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, .09), inset 0 1px 3px rgba(15, 23, 42, .035);
}

.memory-filters {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 2px;
}

.memory-filter {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(15, 23, 42, .07);
  border-radius: 10px;
  background: rgba(255, 255, 255, .48);
  color: var(--muted);
  cursor: pointer;
  font-size: 10px;
}

.memory-filter span {
  margin-left: 4px;
  opacity: .6;
}

.memory-filter:hover,
.memory-filter.active {
  color: #1d1d1f;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 6px 18px rgba(15, 23, 42, .07), inset 0 1px #fff;
}

.memory-filter.active {
  border-color: rgba(0, 113, 227, .2);
}

.memory-toolbar-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 9px;
  white-space: nowrap;
}

.memory-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 14px;
  margin-bottom: 18px;
}

.memory-canvas {
  min-width: 0;
  padding: 0;
  overflow: hidden;
}

.memory-canvas-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 17px 19px 8px;
}

.memory-canvas-head b,
.memory-canvas-head span {
  display: block;
}

.memory-canvas-head b {
  font-size: 13px;
}

.memory-canvas-head div > span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}

.memory-live {
  display: flex !important;
  align-items: center;
  gap: 7px;
  color: #187a32;
  font-size: 9px;
  white-space: nowrap;
}

.memory-live i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34c759;
  box-shadow: 0 0 0 4px rgba(52, 199, 89, .1), 0 0 13px rgba(52, 199, 89, .35);
}

.memory-canvas svg {
  display: block;
  width: 100%;
  min-height: 510px;
  max-height: 640px;
  touch-action: none;
  cursor: grab;
  user-select: none;
  background:
    radial-gradient(circle at 50% 48%, rgba(0, 113, 227, .07), rgba(0, 113, 227, 0) 31%),
    radial-gradient(circle at 18% 75%, rgba(175, 82, 222, .045), rgba(175, 82, 222, 0) 25%);
}

.memory-canvas svg.dragging { cursor: grabbing; }

.memory-edge {
  stroke: rgba(29, 29, 31, .115);
  stroke-width: 1.15;
  vector-effect: non-scaling-stroke;
  transition: opacity .2s ease;
}

.memory-node {
  cursor: pointer;
  transition: opacity .2s ease;
}

.memory-node circle {
  fill: #fff;
  stroke: rgba(255, 255, 255, .94);
  stroke-width: 3px;
  filter: drop-shadow(0 7px 9px rgba(15, 23, 42, .12));
  transition: transform .18s ease, stroke .18s ease, filter .18s ease;
}

.memory-node text {
  fill: #4c4c52;
  font-size: 9px;
  font-weight: 620;
  paint-order: stroke;
  stroke: rgba(247, 248, 250, .94);
  stroke-width: 3px;
  stroke-linejoin: round;
  pointer-events: none;
}

.memory-node:hover circle,
.memory-node:focus-visible circle,
.memory-node.selected circle {
  transform: scale(1.16);
  stroke: #fff;
  stroke-width: 4px;
  filter: drop-shadow(0 10px 14px rgba(15, 23, 42, .2));
}

.memory-node-core circle { fill: #1d1d1f; }
.memory-node-product circle { fill: #0a84ff; }
.memory-node-domain circle { fill: #8e8e93; }
.memory-node-roadmap circle { fill: #ff9f0a; }
.memory-node-decision circle { fill: #af52de; }
.memory-node-session circle { fill: #5ac8fa; }
.memory-node-system circle { fill: #54545a; }
.memory-node.selected circle { stroke: #0071e3; }
.memory-node-core text { fill: #1d1d1f; font-size: 12px; font-weight: 760; }
.memory-node.is-hidden,
.memory-edge.is-hidden { opacity: .045; pointer-events: none; }

.memory-inspector {
  position: relative;
  align-self: stretch;
  min-height: 300px;
  overflow: hidden;
}

.memory-inspector::before {
  content: "";
  position: absolute;
  width: 170px;
  height: 170px;
  right: -65px;
  top: -75px;
  border-radius: 50%;
  background: rgba(0, 113, 227, .08);
  filter: blur(4px);
  pointer-events: none;
}

.memory-inspector-kicker {
  position: relative;
  margin: 0 0 14px;
  color: #0071e3;
  font-size: 9px;
  font-weight: 760;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.memory-inspector h3 {
  position: relative;
  margin: 0;
  font-size: 24px;
  letter-spacing: -.04em;
}

.memory-inspector-copy {
  position: relative;
  min-height: 75px;
  margin: 14px 0 25px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
}

.memory-inspector dl {
  position: relative;
  margin: 0;
}

.memory-inspector dl > div {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid rgba(15, 23, 42, .065);
}

.memory-inspector dt {
  color: var(--muted);
  font-size: 9px;
}

.memory-inspector dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 10px;
  font-weight: 620;
}

.memory-lists { margin-top: 0; }

@media (max-width: 1180px) {
  .memory-toolbar { grid-template-columns: minmax(220px, .7fr) minmax(0, 1.3fr); }
  .memory-toolbar-meta { grid-column: 1 / -1; justify-content: flex-end; }
  .memory-layout { grid-template-columns: minmax(0, 1fr) 245px; }
}

@media (max-width: 900px) {
  .memory-summary { grid-template-columns: repeat(3, 1fr); }
  .memory-summary > p { grid-column: 1 / -1; padding: 4px 2px; }
  .memory-layout { grid-template-columns: 1fr; }
  .memory-inspector { min-height: 240px; }
}

@media (max-width: 620px) {
  .memory-summary { grid-template-columns: repeat(3, 1fr); gap: 7px; }
  .memory-summary > div { min-height: 70px; padding: 12px; }
  .memory-summary strong { font-size: 20px; }
  .memory-toolbar { grid-template-columns: 1fr; }
  .memory-toolbar-meta { grid-column: auto; justify-content: space-between; }
  .memory-canvas-head { align-items: flex-start; }
  .memory-canvas svg { min-height: 430px; }
}

/* Cosmic edition — premium visual layer */
.memory-canvas {
  position: relative;
  border-color: rgba(132, 158, 255, .22) !important;
  background:
    radial-gradient(circle at 70% 10%, rgba(92, 77, 255, .17), transparent 32%),
    radial-gradient(circle at 16% 88%, rgba(0, 205, 255, .12), transparent 34%),
    linear-gradient(145deg, rgba(11, 14, 34, .985), rgba(3, 5, 17, .99)) !important;
  box-shadow:
    0 34px 90px rgba(24, 28, 68, .22),
    inset 0 1px rgba(255, 255, 255, .1),
    inset 0 0 80px rgba(68, 94, 255, .05) !important;
}

.memory-canvas::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(118deg, rgba(255, 255, 255, .055), transparent 21%, transparent 72%, rgba(99, 211, 255, .035));
  pointer-events: none;
}

.memory-canvas-head {
  position: relative;
  z-index: 2;
  min-height: 64px;
  padding: 18px 22px 13px;
  border-bottom: 1px solid rgba(151, 174, 255, .1);
  background: linear-gradient(180deg, rgba(19, 23, 50, .72), rgba(11, 14, 35, .2));
  color: #f5f7ff;
  backdrop-filter: blur(14px);
}

.memory-canvas-head div > span { color: rgba(208, 218, 244, .52); }
.memory-live { color: #83efff; }
.memory-live i {
  background: #62eeff;
  box-shadow: 0 0 0 4px rgba(98, 238, 255, .09), 0 0 17px rgba(98, 238, 255, .75);
}

.memory-canvas svg {
  position: relative;
  z-index: 1;
  background-color: #050716;
  background-image:
    radial-gradient(ellipse at 52% 47%, rgba(80, 69, 210, .2) 0, rgba(47, 53, 141, .08) 28%, transparent 57%),
    radial-gradient(ellipse at 77% 26%, rgba(0, 194, 255, .12) 0, transparent 34%),
    radial-gradient(ellipse at 18% 78%, rgba(177, 75, 255, .1) 0, transparent 31%),
    radial-gradient(circle, rgba(255, 255, 255, .72) 0 1px, transparent 1.25px),
    radial-gradient(circle, rgba(134, 196, 255, .48) 0 .8px, transparent 1px),
    linear-gradient(170deg, rgba(8, 12, 32, .98), rgba(3, 4, 14, 1));
  background-position: center, center, center, 8px 11px, 31px 17px, center;
  background-size: auto, auto, auto, 57px 57px, 83px 83px, auto;
  cursor: crosshair;
}

.memory-canvas svg.dragging { cursor: grabbing; }

.memory-edge {
  stroke: rgba(117, 160, 255, .28);
  stroke-width: 1.05;
  filter: drop-shadow(0 0 2px rgba(84, 160, 255, .42));
  transition: opacity .24s ease, stroke .24s ease, stroke-width .24s ease, filter .24s ease;
}

.memory-edge.is-active {
  stroke: rgba(112, 225, 255, .92);
  stroke-width: 1.8;
  filter: drop-shadow(0 0 4px rgba(83, 213, 255, .95));
}

.memory-node {
  outline: none !important;
  transition: opacity .25s ease;
}

.memory-node:focus,
.memory-node:focus-visible {
  outline: none !important;
}

.memory-node .memory-node-halo {
  fill: rgba(87, 137, 255, .055);
  stroke: rgba(122, 173, 255, .13);
  stroke-width: 1px;
  opacity: .55;
  filter: blur(.2px);
  transform-box: fill-box;
  transform-origin: center;
  transition: opacity .22s ease, transform .22s ease, stroke .22s ease;
}

.memory-node .memory-node-body {
  stroke: rgba(230, 241, 255, .72);
  stroke-width: 1.3px;
  filter: drop-shadow(0 0 6px rgba(80, 134, 255, .46)) drop-shadow(0 7px 12px rgba(0, 0, 0, .42));
  transition: transform .2s ease, stroke .2s ease, filter .2s ease;
}

.memory-node .memory-node-shine {
  fill: rgba(255, 255, 255, .46);
  stroke: none;
  filter: blur(.35px);
  pointer-events: none;
}

.memory-node:hover .memory-node-shine,
.memory-node:focus-visible .memory-node-shine,
.memory-node.selected .memory-node-shine {
  transform: scale(1.04);
  stroke: none;
}

.memory-node-core .memory-node-body { fill: url(#memory-core-gradient); }
.memory-node-product .memory-node-body { fill: url(#memory-product-gradient); }
.memory-node-domain .memory-node-body { fill: url(#memory-domain-gradient); }
.memory-node-roadmap .memory-node-body { fill: url(#memory-roadmap-gradient); }
.memory-node-decision .memory-node-body { fill: url(#memory-decision-gradient); }
.memory-node-session .memory-node-body { fill: url(#memory-session-gradient); }
.memory-node-system .memory-node-body { fill: url(#memory-system-gradient); }

.memory-node text {
  fill: rgba(232, 238, 255, .8);
  font-size: 9.5px;
  font-weight: 570;
  paint-order: stroke;
  stroke: rgba(3, 5, 16, .95);
  stroke-width: 3.5px;
  letter-spacing: .01em;
}

.memory-node-core text {
  fill: #fff;
  font-size: 13px;
  font-weight: 760;
  stroke-width: 4px;
}

.memory-node:hover .memory-node-body,
.memory-node:focus-visible .memory-node-body,
.memory-node.selected .memory-node-body {
  transform: scale(1.12);
  stroke: rgba(226, 249, 255, .98);
  stroke-width: 2px;
  filter: drop-shadow(0 0 10px rgba(88, 197, 255, .9)) drop-shadow(0 9px 14px rgba(0, 0, 0, .5));
}

.memory-node:hover .memory-node-halo,
.memory-node:focus-visible .memory-node-halo,
.memory-node.selected .memory-node-halo {
  opacity: 1;
  transform: scale(1.2);
  stroke: rgba(114, 224, 255, .82);
  stroke-width: 1.5px;
}

.memory-node.is-related .memory-node-halo {
  opacity: .9;
  stroke: rgba(117, 192, 255, .58);
}

.memory-node.is-context-dimmed { opacity: .34; }
.memory-node.is-context-dimmed text { opacity: .48; }
.memory-node.is-hidden { opacity: .035; }

.memory-node-core .memory-node-halo {
  fill: rgba(93, 74, 255, .14);
  stroke: rgba(111, 215, 255, .48);
  opacity: .95;
  animation: cosmic-core-pulse 3.8s ease-in-out infinite;
}

@keyframes cosmic-core-pulse {
  0%, 100% { transform: scale(.94); opacity: .7; }
  50% { transform: scale(1.16); opacity: 1; }
}

.memory-inspector {
  border-color: rgba(126, 155, 255, .2) !important;
  color: #f4f7ff;
  background:
    radial-gradient(circle at 100% 0, rgba(84, 91, 232, .2), transparent 34%),
    radial-gradient(circle at 0 100%, rgba(0, 190, 238, .08), transparent 42%),
    linear-gradient(150deg, rgba(15, 19, 43, .98), rgba(6, 8, 23, .99)) !important;
  box-shadow: 0 30px 80px rgba(26, 31, 73, .2), inset 0 1px rgba(255, 255, 255, .08) !important;
}

.memory-inspector::before {
  background: rgba(66, 106, 255, .15);
  filter: blur(10px);
}

.memory-inspector-kicker { color: #67ddff; }
.memory-inspector-copy { color: rgba(216, 224, 246, .62); }
.memory-inspector dl > div { border-color: rgba(158, 177, 235, .12); }
.memory-inspector dt { color: rgba(205, 216, 243, .48); }
.memory-inspector dd { color: rgba(244, 247, 255, .9); }
.memory-inspector .badge {
  border-color: rgba(126, 174, 255, .2);
  background: rgba(109, 143, 255, .09);
}

@media (prefers-reduced-motion: reduce) {
  .memory-node-core .memory-node-halo { animation: none; }
}
