/* ==========================================================
   ObjectiveGrapher — design tokens
   Reuses the same 15 dark accent themes as this app's task-tracker
   ancestor, RefractTrack, unchanged - only the components below them
   differ (graphs/schemas instead of boards/tasks).
   ========================================================== */
:root {
  --bg:            #14171F;
  --bg-grid:       #171B26;
  --panel:         #1B1F2C;
  --panel-raised:  #212739;
  --border:        #2A3040;
  --border-soft:   #232838;

  --text:          #EDEFF5;
  --text-muted:    #8B93A8;
  --text-faint:    #5C6478;

  --accent:        #5B8CFF;
  --accent-soft:   rgba(91, 140, 255, 0.14);
  --accent-border: rgba(91, 140, 255, 0.4);
  --accent-hover:  #6f9aff;

  --normal:        #34C1A0;
  --normal-soft:   rgba(52, 193, 160, 0.14);
  --bug:           #E85C41;
  --bug-soft:      rgba(232, 92, 65, 0.16);

  --p-low:         #6B7280;
  --p-medium:      #E8B84B;
  --p-high:        #E8874B;
  --p-critical:    #E8455C;

  --done:          #34C1A0;
  --danger:        #E8455C;

  --font-display: 'Rajdhani', 'Segoe UI', sans-serif;
  --font-body:    'Inter', 'Segoe UI', sans-serif;
  --font-mono:    'JetBrains Mono', 'Consolas', monospace;

  --radius: 8px;
  --radius-sm: 5px;
}

[data-theme="slate"] {
  --bg: #16181D; --bg-grid: #1A1D24; --panel: #1E212A; --panel-raised: #262A35;
  --border: #313640; --border-soft: #262B34;
  --accent: #4FB5C9; --accent-soft: rgba(79, 181, 201, 0.14); --accent-border: rgba(79, 181, 201, 0.4); --accent-hover: #5FBCCE;
}
[data-theme="ember"] {
  --bg: #1A1613; --bg-grid: #1E1916; --panel: #24201B; --panel-raised: #2C2721;
  --border: #3A332A; --border-soft: #2E2822;
  --accent: #E8A14B; --accent-soft: rgba(232, 161, 75, 0.14); --accent-border: rgba(232, 161, 75, 0.4); --accent-hover: #EAAA5D;
}
[data-theme="violet"] {
  --bg: #1A1826; --bg-grid: #1E1B2A; --panel: #221F30; --panel-raised: #2A2740;
  --border: #363047; --border-soft: #2C2838;
  --accent: #8B7CF0; --accent-soft: rgba(139, 124, 240, 0.14); --accent-border: rgba(139, 124, 240, 0.4); --accent-hover: #9C8FF5;
}
[data-theme="rose"] {
  --bg: #1E161B; --bg-grid: #221A1F; --panel: #2A1F26; --panel-raised: #332530;
  --border: #402E3C; --border-soft: #332730;
  --accent: #E36BB0; --accent-soft: rgba(227, 107, 176, 0.14); --accent-border: rgba(227, 107, 176, 0.4); --accent-hover: #E87FBC;
}
[data-theme="moss"] {
  --bg: #151A16; --bg-grid: #191F1A; --panel: #1E251F; --panel-raised: #253027;
  --border: #313D33; --border-soft: #283229;
  --accent: #5FBF5A; --accent-soft: rgba(95, 191, 90, 0.14); --accent-border: rgba(95, 191, 90, 0.4); --accent-hover: #6FCB6A;
}
[data-theme="indigo"] {
  --bg: #14151F; --bg-grid: #181A26; --panel: #1E2030; --panel-raised: #262940;
  --border: #33374F; --border-soft: #2A2D40;
  --accent: #6E74E8; --accent-soft: rgba(110, 116, 232, 0.14); --accent-border: rgba(110, 116, 232, 0.4); --accent-hover: #7E84ED;
}
[data-theme="plum"] {
  --bg: #1B1420; --bg-grid: #201826; --panel: #271D2E; --panel-raised: #302438;
  --border: #3E2E48; --border-soft: #322639;
  --accent: #B565D8; --accent-soft: rgba(181, 101, 216, 0.14); --accent-border: rgba(181, 101, 216, 0.4); --accent-hover: #C078E0;
}
[data-theme="sky"] {
  --bg: #131A1F; --bg-grid: #171F25; --panel: #1D272E; --panel-raised: #253039;
  --border: #324049; --border-soft: #29333B;
  --accent: #5AC8E8; --accent-soft: rgba(90, 200, 232, 0.14); --accent-border: rgba(90, 200, 232, 0.4); --accent-hover: #6ED1EC;
}
[data-theme="lime"] {
  --bg: #171A13; --bg-grid: #1B1F17; --panel: #21261C; --panel-raised: #2A3122;
  --border: #38402C; --border-soft: #2D3324;
  --accent: #9ED65C; --accent-soft: rgba(158, 214, 92, 0.14); --accent-border: rgba(158, 214, 92, 0.4); --accent-hover: #ABDD70;
}
[data-theme="frost"] {
  --bg: #15181D; --bg-grid: #191D23; --panel: #1F242B; --panel-raised: #272E36;
  --border: #343C46; --border-soft: #2B3138;
  --accent: #A8C5E8; --accent-soft: rgba(168, 197, 232, 0.14); --accent-border: rgba(168, 197, 232, 0.4); --accent-hover: #B7D0EC;
}
[data-theme="mono"] {
  --bg: #121212; --bg-grid: #161616; --panel: #1C1C1C; --panel-raised: #242424;
  --border: #363636; --border-soft: #2A2A2A;
  --accent: #E8E8E8; --accent-soft: rgba(232, 232, 232, 0.14); --accent-border: rgba(232, 232, 232, 0.4); --accent-hover: #FFFFFF;
}
[data-theme="crimson"] {
  --bg: #1D1414; --bg-grid: #211717; --panel: #291B1B; --panel-raised: #332121;
  --border: #402B2B; --border-soft: #332424;
  --accent: #E14B4B; --accent-soft: rgba(225, 75, 75, 0.14); --accent-border: rgba(225, 75, 75, 0.4); --accent-hover: #E85F5F;
}
[data-theme="sun"] {
  --bg: #191710; --bg-grid: #1D1B13; --panel: #242018; --panel-raised: #2E291D;
  --border: #3D3625; --border-soft: #302B1E;
  --accent: #E8D94B; --accent-soft: rgba(232, 217, 75, 0.14); --accent-border: rgba(232, 217, 75, 0.4); --accent-hover: #EDDE5F;
}

@property --rainbow-hue {
  syntax: '<number>';
  inherits: true;
  initial-value: 0;
}
[data-theme="rainbow"] {
  --rainbow-hue: 0;
  --bg: #121212; --bg-grid: #161616; --panel: #1C1C1C; --panel-raised: #242424;
  --border: #363636; --border-soft: #2A2A2A;
  --accent: hsl(var(--rainbow-hue) 85% 65%);
  --accent-soft: hsl(var(--rainbow-hue) 85% 65% / 0.14);
  --accent-border: hsl(var(--rainbow-hue) 85% 65% / 0.4);
  --accent-hover: hsl(var(--rainbow-hue) 90% 75%);
  animation: rainbow-cycle 30s linear infinite;
}
@keyframes rainbow-cycle { from { --rainbow-hue: 0; } to { --rainbow-hue: 360; } }
@media (prefers-reduced-motion: reduce) {
  [data-theme="rainbow"] { animation: none; --rainbow-hue: 260; }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg); color: var(--text);
  font-family: var(--font-body); font-size: 15px; line-height: 1.5;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code {
  font-family: var(--font-mono); background: var(--panel-raised);
  padding: 1px 5px; border-radius: 4px; font-size: 0.9em;
}
.muted { color: var(--text-muted); }
.required { color: var(--p-high); font-weight: 500; }

.task-code {
  font-family: var(--font-mono); background: var(--accent-soft); color: var(--accent);
  padding: 1px 5px; border-radius: 4px; font-size: 0.9em; font-weight: 600;
}

.app-shell {
  min-height: 100vh;
  background-image:
    linear-gradient(var(--bg-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px);
  background-size: 40px 40px;
  background-position: -1px -1px;
}

/* ---------------- Topbar ---------------- */
.topbar {
  display: flex; align-items: center; gap: 24px; padding: 12px 28px;
  background: rgba(27, 31, 44, 0.92); border-bottom: 1px solid var(--border);
  backdrop-filter: blur(6px); position: sticky; top: 0; z-index: 20;
}
.topbar__brand { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.brand-mark { color: var(--accent); font-size: 20px; line-height: 1; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 19px; letter-spacing: 0.02em; }
.project-switcher select {
  background: var(--panel-raised); border: 1px solid var(--border); color: var(--text);
  font-family: var(--font-mono); font-size: 13px; padding: 6px 10px; border-radius: var(--radius-sm);
}
.topbar__nav { display: flex; align-items: center; gap: 4px; flex: 1; }
.topbar__nav a {
  color: var(--text-muted); font-size: 14px; font-weight: 500;
  padding: 8px 12px; border-radius: var(--radius-sm); text-decoration: none;
}
.topbar__nav a:hover { color: var(--text); background: var(--panel-raised); }
.topbar__nav a.is-active { color: var(--text); background: var(--panel-raised); }
.topbar__actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.topbar__actions a.nav-cta {
  background: var(--accent); color: #0C0E14; font-weight: 600;
  padding: 8px 14px; border-radius: var(--radius-sm);
}
.topbar__actions a.nav-cta:hover { background: var(--accent-hover); text-decoration: none; }
.topbar__user { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.user-chip { font-size: 13px; color: var(--text-muted); }
.logout-link {
  background: none; border: none; padding: 0; font: inherit; cursor: pointer;
  font-size: 13px; color: var(--text-faint); text-decoration: none;
}
.logout-link:hover { color: var(--text-muted); }

/* ---------------- Layout ---------------- */
.app-main { padding: 28px; max-width: 1400px; margin: 0 auto; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-title { font-family: var(--font-display); font-weight: 700; font-size: 28px; margin: 0 0 4px; display: flex; align-items: center; gap: 10px; }
.breadcrumb-link { display: inline-block; font-size: 12.5px; color: var(--text-faint); margin-bottom: 6px; }
.breadcrumb-link:hover { color: var(--accent); text-decoration: none; }
.page-subtitle { margin: 0; color: var(--text-muted); font-size: 14px; }

.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.filter-bar input[type=search], .filter-bar select {
  background: var(--panel-raised); border: 1px solid var(--border); color: var(--text);
  font-size: 13px; padding: 7px 10px; border-radius: var(--radius-sm);
}

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-family: var(--font-body); font-weight: 600; font-size: 14px; line-height: 1.4;
  padding: 9px 16px; border-radius: var(--radius-sm); border: 1px solid transparent;
  cursor: pointer; text-decoration: none; margin: 0; box-sizing: border-box;
}
/* A <button class="btn"> (e.g. the Delete button, submitted via its
   own <form class="inline-form">) otherwise renders shorter than an
   <a class="btn"> with identical padding: browsers don't reliably
   apply the page's inherited line-height to native form controls the
   way they do to inline elements like <a>, so line-height above has
   to be set explicitly on .btn itself rather than relying on
   inheritance from html/body. margin: 0 clears Safari/Firefox's
   default button margin, which the same inheritance gap otherwise
   leaves in place too. */
.btn--primary { background: var(--accent); color: #0C0E14; }
.btn--primary:hover { background: var(--accent-hover); text-decoration: none; }
.btn--secondary { background: var(--normal-soft); color: var(--normal); border-color: rgba(52,193,160,0.3); }
.btn--secondary:hover { background: rgba(52,193,160,0.24); border-color: rgba(52,193,160,0.5); text-decoration: none; }
.btn--ghost { background: transparent; color: var(--text-muted); border-color: var(--border); }
.btn--ghost:hover { color: var(--text); border-color: var(--text-faint); text-decoration: none; }
.btn--danger { background: transparent; color: var(--danger); border-color: rgba(232,69,92,0.35); }
.btn--danger:hover { background: rgba(232,69,92,0.12); text-decoration: none; }
.btn--block { width: 100%; }
.btn--small { padding: 6px 12px; font-size: 13px; }
.link-btn {
  background: none; border: none; padding: 0; color: var(--text-faint);
  font-size: 13px; cursor: pointer; text-decoration: underline;
}
.link-btn:hover { color: var(--danger); }
.link-btn--danger { color: var(--danger); }
.inline-form { display: inline; margin-left: auto; }

/* ---------------- Badges ---------------- */
.badge {
  display: inline-block; font-size: 11px; font-weight: 600; letter-spacing: 0.02em;
  text-transform: uppercase; padding: 3px 8px; border-radius: 999px;
  background: var(--panel-raised); color: var(--text-muted);
}
.badge--done { background: var(--normal-soft); color: var(--normal); }

.project-prefix-badge {
  font-family: var(--font-mono); font-weight: 600; font-size: 12px;
  background: var(--accent-soft); color: var(--accent); padding: 3px 8px; border-radius: 5px;
}

/* ---------------- Forms ---------------- */
.form-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; max-width: 900px; }
.form-row { margin-bottom: 16px; display: flex; flex-direction: column; gap: 6px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; }
.form-row label { font-size: 13px; font-weight: 600; color: var(--text-muted); }
input[type=text], input[type=password], input[type=date], input[type=file], input[type=search],
textarea, select {
  background: var(--panel-raised); border: 1px solid var(--border); color: var(--text);
  padding: 10px 12px; border-radius: var(--radius-sm); font-family: var(--font-body); font-size: 14px;
}
textarea { resize: vertical; font-family: var(--font-body); width: 100%; }
.mono-textarea { font-family: var(--font-mono); font-size: 13px; width: 100%; }
.static-field {
  background: var(--panel-raised); border: 1px solid var(--border); color: var(--text-muted);
  padding: 10px 12px; border-radius: var(--radius-sm); font-family: var(--font-body); font-size: 14px;
  line-height: normal; user-select: text;
}
.radio-pair { display: flex; gap: 8px; }
.radio-pill, .checkbox-pill {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--border); border-radius: 999px;
  padding: 7px 12px; font-size: 13px; cursor: pointer;
}
.checkbox-pill--inactive { opacity: 0.6; }
.checkbox-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.permission-group { }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.field-row { display: flex; align-items: center; gap: 8px; width: 100%; }
.field-row input { flex: 1 1 auto; min-width: 0; }
.field-row .btn { flex: 0 0 auto; white-space: nowrap; }

.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 14px; }
.alert ul { margin: 0; padding-left: 18px; }
.alert--error { background: rgba(232,69,92,0.12); color: #ff8b9b; border: 1px solid rgba(232,69,92,0.3); }
.alert--info { background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-border); }
.alert--warn { background: rgba(232,184,75,0.14); color: var(--p-medium); border: 1px solid rgba(232,184,75,0.35); }

/* ---------------- Tables ---------------- */
.table-wrap { overflow-x: auto; }
.graph-table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.graph-table th, .graph-table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--border-soft); font-size: 13.5px; }
.graph-table th { color: var(--text-faint); font-weight: 600; text-transform: uppercase; font-size: 11px; letter-spacing: 0.03em; }
.graph-table tbody tr:hover { background: var(--panel-raised); }

.panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }

/* ---------------- Groups / Projects / Manage cards ---------------- */
.group-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.section-heading { font-family: var(--font-display); font-size: 18px; font-weight: 600; margin: 28px 0 12px; display: flex; align-items: baseline; gap: 8px; }
.section-heading:first-of-type { margin-top: 0; }
.section-heading__count { font-family: var(--font-body); font-size: 13px; font-weight: 500; color: var(--text-faint); }
.project-card--inactive { opacity: 0.55; }
.project-card--inactive:hover { opacity: 0.85; }
.group-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.group-card__head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.group-card h3 { margin: 0; font-size: 16px; }
.group-card__desc { color: var(--text-muted); font-size: 13px; margin: 0 0 10px; }
.group-card__foot { display: flex; align-items: center; gap: 12px; font-size: 12.5px; color: var(--text-muted); }
.manage-tile { display: block; text-decoration: none; transition: border-color 0.15s ease, transform 0.15s ease; }
.manage-tile:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-1px); }
.manage-tile .group-card__desc { margin-bottom: 0; }

/* ---------------- Login / install ---------------- */
.login-body {
  margin: 0; min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  background-image: linear-gradient(var(--bg-grid) 1px, transparent 1px), linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px);
  background-size: 40px 40px;
  font-family: var(--font-body); color: var(--text);
}
.login-card { width: 340px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 30px; }
.login-card__brand { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.login-card__tagline { color: var(--text-muted); font-size: 13px; margin: 0 0 18px; }
.login-form { display: flex; flex-direction: column; gap: 12px; }
.login-form label { font-size: 12px; color: var(--text-muted); font-weight: 600; }

.install-card { width: 600px; max-width: calc(100vw - 40px); }
.install-steps { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0 0 18px; padding: 0; }
.install-steps li {
  font-size: 11px; font-family: var(--font-mono); color: var(--text-faint);
  background: var(--panel-raised); border: 1px solid var(--border); border-radius: 999px; padding: 4px 10px;
}
.install-steps li.is-active { color: var(--accent); border-color: var(--accent-border); background: var(--accent-soft); }
.check-list { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.check-list__item { display: flex; align-items: flex-start; gap: 10px; font-size: 13.5px; }
.check-list__icon { flex-shrink: 0; width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; border-radius: 50%; font-size: 12px; font-weight: 700; }
.check-list__item.is-ok .check-list__icon { background: var(--normal-soft); color: var(--normal); }
.check-list__item.is-fail .check-list__icon { background: rgba(232,69,92,0.16); color: var(--danger); }
.check-list__item.is-unknown .check-list__icon { background: rgba(232,184,75,0.16); color: var(--p-medium); }
.check-list__body { display: flex; flex-direction: column; gap: 6px; }
.check-command {
  display: block; width: fit-content; max-width: 100%; font-family: var(--font-mono); font-size: 12.5px;
  white-space: nowrap; overflow-x: auto; background: var(--panel-raised); border: 1px solid var(--border);
  border-radius: 6px; padding: 6px 10px;
}
.check-command::before { content: "$ "; color: var(--text-faint); }
.url-example { display: flex; flex-direction: column; gap: 4px; margin: 0 0 14px; font-size: 13px; }
.url-example__row { display: flex; align-items: center; gap: 8px; }
.url-example__row code { white-space: nowrap; }
.theme-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; margin: 4px 0 18px; }
.theme-option { display: flex; align-items: center; gap: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 14px; cursor: pointer; }
.theme-option:has(input:checked) { border-color: var(--accent-border); background: var(--accent-soft); }
.theme-option input[type=radio] { accent-color: var(--accent); }
.theme-swatch { width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; border: 1px solid var(--border-soft); }
.theme-swatch--rainbow { background: conic-gradient(from 0deg, #E14B4B, #E8A14B, #E8D94B, #5FBF5A, #5AC8E8, #6E74E8, #B565D8, #E14B4B); animation: rainbow-swatch-spin 6s linear infinite; }
@keyframes rainbow-swatch-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .theme-swatch--rainbow { animation: none; } }
.theme-option__label { display: flex; flex-direction: column; gap: 1px; }
.theme-option__name { font-weight: 600; font-size: 13.5px; }
.theme-option__desc { font-size: 12px; color: var(--text-muted); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------------- Graph / JSON tabs ---------------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.tab-btn {
  background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--text-muted); font-family: var(--font-body); font-weight: 600;
  font-size: 14px; padding: 8px 4px; margin-bottom: -1px; cursor: pointer;
}
.tab-btn:hover:not(:disabled) { color: var(--text); }
.tab-btn.is-active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-btn:disabled { color: var(--text-faint); cursor: not-allowed; }
.tab-panel { display: none; }
.tab-panel.is-active { display: block; }

/* ---------------- JSON tab (syntax highlighting) ---------------- */
.json-view {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; overflow-x: auto; font-family: var(--font-mono); font-size: 13px; line-height: 1.6;
}
.jkey { color: var(--accent); }
.jstr { color: var(--normal); }
.jnum { color: var(--bug); }
.jbool { color: var(--p-medium); font-weight: 600; }

/* ---------------- Graph diagram ---------------- */
.graph-layout { display: grid; grid-template-columns: 1fr 320px; gap: 20px; align-items: start; }
.graph-canvas-wrap {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: auto; max-height: 75vh; padding: 12px;
  cursor: grab; touch-action: none; -webkit-user-drag: none;
}
.graph-canvas-wrap.is-panning { cursor: grabbing; user-select: none; }
.graph-svg { display: block; -webkit-user-drag: none; user-drag: none; }
.graph-details-panel {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; position: sticky; top: 80px; max-height: 75vh; overflow-y: auto;
}
.graph-details-panel h3 { margin: 0 0 12px; font-family: var(--font-display); font-size: 18px; }
.graph-details-panel h4 { margin: 16px 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-faint); }
.graph-details-panel ul { margin: 0; padding-left: 18px; font-size: 13.5px; }
.graph-details-panel li { margin-bottom: 4px; }

.details-row { display: flex; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border-soft); font-size: 13.5px; }
.details-row:last-child { border-bottom: none; }
.details-row__key { flex: 0 0 110px; color: var(--text-faint); font-weight: 600; }
.details-row__value { flex: 1; word-break: break-word; }
.details-json {
  background: var(--panel-raised); border: 1px solid var(--border); border-radius: 6px;
  padding: 8px 10px; margin: 4px 0 0; font-family: var(--font-mono); font-size: 12px;
  white-space: pre-wrap; word-break: break-word; overflow-x: auto;
}
.lock-record {
  padding: 6px 0; border-bottom: 1px solid var(--border-soft); font-size: 13px;
}
.lock-record:last-child { border-bottom: none; }
.lock-record__line1 { font-weight: 600; }
.lock-record__line2 {
  font-family: var(--font-mono); font-size: 11.5px; margin-top: 2px; word-break: break-word;
}

.graph-node { cursor: pointer; }
.graph-node-circle {
  fill: var(--panel-raised); stroke: var(--border); stroke-width: 2;
  transition: stroke 0.1s ease, fill 0.1s ease;
}
.graph-node:hover .graph-node-circle { stroke: var(--accent-border); }
.graph-node.is-selected .graph-node-circle { stroke: var(--accent); fill: var(--accent-soft); }
.graph-node--start .graph-node-circle { stroke: var(--normal); stroke-width: 3; }
.graph-node-id {
  font-family: var(--font-mono); font-size: 12px; fill: var(--text); pointer-events: none;
}
.graph-node-label {
  font-family: var(--font-body); font-size: 12px; fill: var(--text-muted); pointer-events: none;
}

.graph-edge { cursor: pointer; }
.graph-edge-line { stroke: var(--text-faint); stroke-width: 1.5; fill: none; }
.graph-edge-line--open { stroke-dasharray: 5 4; }
.graph-edge-hitarea { stroke: transparent; stroke-width: 14; fill: none; }
.graph-edge:hover .graph-edge-line { stroke: var(--accent-border); }
.graph-edge.is-selected .graph-edge-line { stroke: var(--accent); stroke-width: 2.5; }
.graph-arrowhead { fill: var(--text-faint); }
.graph-edge:hover .graph-arrowhead, .graph-edge.is-selected .graph-arrowhead { fill: var(--accent); }
.graph-edge-label {
  font-family: var(--font-body); font-size: 11px; fill: var(--text-muted);
  paint-order: stroke; stroke: var(--panel); stroke-width: 4px;
}

/* ---------------- Schema mapping tool ---------------- */
.schema-mapping { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 16px; }
.schema-mapping__col h3 { margin: 0 0 12px; font-family: var(--font-display); font-size: 15px; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-muted); }
@media (max-width: 720px) {
  .schema-mapping { grid-template-columns: 1fr; }
}

/* ---------------- Progression tab ---------------- */
.progression-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.progression-step {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 14px; font-size: 13.5px;
}
.progression-step__headline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 600; }
.progression-step__headline code { font-size: 0.9em; }
.progression-step__lock { margin-top: 4px; font-size: 12.5px; }
.progression-step__granted { margin-top: 6px; color: var(--normal); font-weight: 600; font-size: 12.5px; }
.progression-step__inventory { margin-top: 6px; font-size: 12px; }

/* ---------------- Responsive ---------------- */
@media (max-width: 900px) {
  .graph-layout { grid-template-columns: 1fr; }
  .graph-details-panel { position: static; max-height: none; }
  .topbar { flex-wrap: wrap; row-gap: 10px; }
  .topbar__nav { order: 3; width: 100%; overflow-x: visible; flex-wrap: wrap; row-gap: 6px; }
  .topbar__actions { margin-left: 0; }
}
@media (max-width: 600px) {
  .topbar { flex-direction: column; align-items: stretch; row-gap: 10px; padding: 12px 16px; }
  .topbar__brand { flex-shrink: 1; }
  .project-switcher { width: 100%; }
  .project-switcher select { width: 100%; }
  .topbar__nav { order: initial; width: 100%; }
  .topbar__actions { width: 100%; margin-left: 0; flex-wrap: wrap; }
  .topbar__user { width: 100%; justify-content: space-between; flex-shrink: 1; }
}

