@font-face {
  font-family: "Geist";
  src: url("/fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "Geist Mono";
  src: url("/fonts/GeistMono-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root, .lucid-app {
  --lucid-font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --lucid-font-mono: "Geist Mono", ui-monospace, monospace;
  --risk-safe: light-dark(#16803c, #3fbf6a);
  --risk-safe-soft: light-dark(rgb(22 128 60 / .1), rgb(63 191 106 / .16));
  --risk-caution: light-dark(#a86400, #f0a52a);
  --risk-caution-soft: light-dark(rgb(168 100 0 / .1), rgb(240 165 42 / .16));
  --risk-danger: light-dark(#c62f2f, #ec6a6a);
  --risk-danger-soft: light-dark(rgb(198 47 47 / .09), rgb(236 106 106 / .16));
  --cjk-line: 1.5;
}

html[data-theme="dark"] { color-scheme: dark; }
html[data-theme="light"] { color-scheme: light; }

:lang(ja) {
  --lucid-font-sans: "Geist", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Meiryo", "Noto Sans JP", sans-serif;
  --cjk-line: 1.75;
}

:lang(zh-Hans) {
  --lucid-font-sans: "Geist", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --cjk-line: 1.75;
}

html, body {
  margin: 0;
  background: var(--lucid-bg);
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

body { min-height: 100dvh; line-height: var(--cjk-line); }

input, textarea, [contenteditable], .key-secret {
  -webkit-user-select: text;
  user-select: text;
}

img { -webkit-user-drag: none; }

[hidden] { display: none !important; }

[data-modality="pointer"] .lucid-app :focus-visible:not(input):not(textarea):not([contenteditable]),
[data-modality="pointer"] .lucid-app :focus-visible:not(input):not(textarea):not([contenteditable]) * {
  outline: none !important;
}

.root { min-height: 100dvh; }

.link {
  color: var(--lucid-ink);
  text-decoration: none;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 4px;
}
.link:hover { text-decoration: underline; text-underline-offset: 3px; }

.mark {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: block;
  flex: none;
}

.spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--lucid-line-strong);
  border-top-color: var(--lucid-ink-2);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.page-wait, .row-wait { display: grid; place-items: center; padding: 48px 0; }
.row-wait { padding: 24px 0; }

.flag { border-radius: 2px; flex: none; box-shadow: 0 0 0 .5px rgb(0 0 0 / .18); display: block; }

.lang-trigger { gap: 8px; }

.auth {
  display: grid;
  grid-template-columns: minmax(380px, 46%) minmax(0, 1fr);
  min-height: 100dvh;
}

.auth-side {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 32px 40px;
  background: var(--lucid-surface-sunken);
  box-shadow: inset -1px 0 0 var(--lucid-line);
  overflow: hidden;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 15px;
  color: var(--lucid-ink);
}

.auth-brand-mobile { display: none; }

.auth-pitch {
  margin: auto 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 460px;
}

.auth-tagline {
  margin: 0;
  font-size: 22px;
  line-height: 1.35;
  font-weight: 500;
  letter-spacing: -.01em;
  color: var(--lucid-ink);
  text-wrap: balance;
}
:lang(ja) .auth-tagline, :lang(zh-Hans) .auth-tagline { line-height: 1.6; letter-spacing: 0; }

.auth-legend { display: flex; flex-wrap: wrap; gap: 8px; }

.legend {
  font-family: var(--lucid-font-mono);
  font-size: 11px;
  letter-spacing: .02em;
  padding: 4px 8px;
  border-radius: 6px;
}
.legend-green { color: var(--risk-safe); background: var(--risk-safe-soft); }
.legend-amber { color: var(--risk-caution); background: var(--risk-caution-soft); }
.legend-red { color: var(--risk-danger); background: var(--risk-danger-soft); }

.schema-art { width: 100%; max-width: 440px; height: auto; display: block; overflow: visible; }
.art-card { fill: var(--lucid-surface); stroke: var(--lucid-line-strong); stroke-width: 1; }
.art-rule { stroke: var(--lucid-line); }
.art-title { font-family: var(--lucid-font-mono); font-size: 12px; font-weight: 600; fill: var(--lucid-ink); }
.art-col { font-family: var(--lucid-font-mono); font-size: 11px; fill: var(--lucid-ink-2); }
.art-type { font-family: var(--lucid-font-mono); font-size: 11px; fill: var(--lucid-ink-3); }
.art-link { fill: none; stroke: var(--lucid-ink-4); stroke-width: 1.25; stroke-dasharray: 3 3; }
.art-row.art-green .art-hl { fill: var(--risk-safe-soft); }
.art-row.art-green .art-col, .art-row.art-green .art-type { fill: var(--risk-safe); }
.art-row.art-amber .art-hl { fill: var(--risk-caution-soft); }
.art-row.art-amber .art-col, .art-row.art-amber .art-type { fill: var(--risk-caution); }
.art-row.art-red .art-hl { fill: var(--risk-danger-soft); }
.art-row.art-red .art-col, .art-row.art-red .art-type { fill: var(--risk-danger); text-decoration: line-through; }

.auth-main {
  display: flex;
  flex-direction: column;
  padding: 24px 32px;
  min-width: 0;
}

.auth-top { display: flex; justify-content: flex-end; align-items: center; gap: 12px; }

.auth-card {
  margin: auto;
  width: 100%;
  max-width: 380px;
  padding: 32px 0 64px;
}

.auth-form { display: flex; flex-direction: column; gap: 18px; }
.auth-wait { align-items: center; padding: 48px 0; }

.auth-head { display: flex; flex-direction: column; gap: 6px; margin-bottom: 6px; }
.auth-head h1 { margin: 0; letter-spacing: -.015em; }

.auth-row { display: flex; justify-content: flex-end; margin-top: -8px; font-size: var(--lucid-text-sm); }
.auth-row .link { color: var(--lucid-ink-2); font-weight: 450; }

.auth-switch { margin: 4px 0 0; text-align: center; font-size: var(--lucid-text-sm); color: var(--lucid-ink-3); }

.auth-done {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--risk-safe);
  background: var(--risk-safe-soft);
}
.auth-done-bad { color: var(--risk-danger); background: var(--risk-danger-soft); }

.lucid-field[data-invalid] .lucid-field-hint { display: none; }

.optional { margin-left: 6px; font-weight: 400; color: var(--lucid-ink-3); }

.wide { width: 100%; justify-content: center; }

.form-error {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--lucid-radius-md);
  background: var(--lucid-danger-soft);
  color: var(--lucid-danger);
  font-size: var(--lucid-text-sm);
  line-height: 1.45;
}
.form-error .lucid-icon { margin-top: 2px; flex: none; }

.side {
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 100%;
  min-height: 0;
}

.side-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 8px;
  font-weight: 600;
  font-size: 15px;
  color: var(--lucid-ink);
}

.side-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 12px;
  box-shadow: inset 0 1px 0 var(--lucid-line);
}

.side-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 4px 4px 8px;
  min-width: 0;
}
.side-user-text { flex: 1; min-width: 0; }
.side-user-name, .side-user-email { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user-name { font-size: var(--lucid-text-sm); font-weight: 500; color: var(--lucid-ink); }
.side-user-email { font-size: var(--lucid-text-xs); color: var(--lucid-ink-3); }

.signout {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--lucid-ink-2);
  font: inherit;
  font-size: var(--lucid-text-sm);
  display: flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 10px;
  border-radius: var(--lucid-radius-md);
  cursor: pointer;
  width: 100%;
  transition: background var(--lucid-fast) var(--lucid-ease), color var(--lucid-fast) var(--lucid-ease);
}
.signout:hover { background: var(--lucid-hover); color: var(--lucid-ink); }
.signout.is-armed { background: var(--lucid-danger); color: #fff; font-weight: 500; }
.signout.is-armed:hover { background: var(--lucid-danger); color: #fff; }
.signout:disabled { opacity: .6; cursor: default; }

.banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 24px 0;
  padding: 8px 8px 8px 14px;
  border-radius: var(--lucid-radius-lg);
  background: var(--risk-caution-soft);
  color: var(--lucid-ink);
  font-size: var(--lucid-text-sm);
}
.banner .lucid-icon { color: var(--risk-caution); flex: none; }
.banner-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.project-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 14px 16px 16px;
  min-width: 0;
  border-radius: var(--lucid-radius-lg);
  background: var(--lucid-surface);
  box-shadow: 0 0 0 1px var(--lucid-line), var(--lucid-shadow-xs);
  cursor: pointer;
  transition: box-shadow var(--lucid-fast) var(--lucid-ease), transform var(--lucid-fast) var(--lucid-ease);
}
.project-card:hover { box-shadow: 0 0 0 1px var(--lucid-line-strong), var(--lucid-shadow-sm); }

.project-top { display: flex; align-items: center; justify-content: space-between; }

.project-glyph {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--lucid-ink-2);
  background: var(--lucid-surface-sunken);
  box-shadow: inset 0 0 0 1px var(--lucid-line);
}

.project-name {
  font-weight: 500;
  color: var(--lucid-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: var(--lucid-text-xs);
  color: var(--lucid-ink-3);
}
.project-meta > span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.title-back { display: flex; align-items: center; gap: 6px; min-width: 0; margin-left: -8px; }
.title-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.dialog-form .lucid-seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; box-sizing: border-box; }
.dialog-form .lucid-seg > button { justify-content: center; }

.canvas-soon { min-height: 320px; display: grid; place-items: center; }

.dialog-form, .section-form { display: flex; flex-direction: column; gap: 16px; }
.section-form { padding: 16px; }

.settings { display: flex; flex-direction: column; gap: 24px; }

.keys-empty { padding: 16px; }

.key-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 12px 12px 16px;
  min-width: 0;
}
.key-row + .key-row { box-shadow: inset 0 1px 0 var(--lucid-line); }

.key-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex: none;
  color: var(--lucid-ink-3);
  background: var(--lucid-surface-sunken);
}

.key-text { flex: 1; min-width: 0; }
.key-name { font-size: var(--lucid-text-sm); font-weight: 500; color: var(--lucid-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.key-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: var(--lucid-text-xs); color: var(--lucid-ink-3); }
.key-meta code { font-family: var(--lucid-font-mono); }

.key-reveal { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }

.key-secret {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 12px;
  border-radius: var(--lucid-radius-md);
  background: var(--lucid-surface-sunken);
  box-shadow: inset 0 0 0 1px var(--lucid-line);
  font-family: var(--lucid-font-mono);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--lucid-ink);
  overflow-wrap: anywhere;
}

.mobile-only { display: none; }

.mobile-signout .signout { justify-content: center; background: var(--lucid-surface); box-shadow: 0 0 0 1px var(--lucid-line); height: 40px; }

@media (max-width: 860px) {
  .mobile-only { display: block; }
  .lucid-shell { grid-template-rows: auto 1fr; }
  .side { height: auto; }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-side { display: none; }
  .auth-brand-mobile { display: flex; }
  .auth-top { justify-content: space-between; }
  .auth-main { padding: 16px; }
  .auth-card { padding: 24px 0 40px; }
  .side { gap: 8px; }
  .side-brand, .side-foot { display: none; }
  .banner { margin: 12px 16px 0; }
}

.madeby {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--lucid-text-xs);
  color: var(--lucid-ink-3);
  text-decoration: none;
  border-radius: 4px;
  transition: color var(--lucid-fast) var(--lucid-ease);
}
.madeby:hover { color: var(--lucid-ink); }
.madeby svg { display: block; flex: none; }

.auth-foot { display: flex; justify-content: center; padding-top: 8px; }

.side-madeby { padding: 8px 10px 2px; }

.mobile-madeby { display: flex; justify-content: center; padding-top: 16px; }

.lucid-input input:-webkit-autofill,
.lucid-input input:-webkit-autofill:hover,
.lucid-input input:-webkit-autofill:focus,
.lucid-input input:autofill {
  -webkit-box-shadow: 0 0 0 1000px var(--lucid-surface-raised) inset;
  box-shadow: 0 0 0 1000px var(--lucid-surface-raised) inset;
  -webkit-text-fill-color: var(--lucid-ink);
  caret-color: var(--lucid-ink);
  transition: background-color 600000s 0s, color 600000s 0s;
}

.pw-input { padding-right: 4px; }

.pw-toggle {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--lucid-ink-3);
  width: 26px;
  height: 26px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 6px;
  cursor: pointer;
  transition: color var(--lucid-fast) var(--lucid-ease), background var(--lucid-fast) var(--lucid-ease);
}
.pw-toggle:hover { color: var(--lucid-ink); background: var(--lucid-hover); }
.pw-toggle svg { display: block; }

.start { display: flex; flex-direction: column; gap: 20px; }
.start-head { display: flex; flex-direction: column; gap: 4px; }
.start-head h2 { margin: 0; }

.template {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-radius: var(--lucid-radius-lg);
  background: var(--lucid-surface-sunken);
  box-shadow: inset 0 0 0 1px var(--lucid-line);
  min-width: 0;
}
.template-glyph {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex: none;
  color: var(--lucid-ink-2);
  background: var(--lucid-surface);
  box-shadow: inset 0 0 0 1px var(--lucid-line);
}
.template-text { flex: 1 1 160px; min-width: 0; }
.template { flex-wrap: wrap; }
.template-name { font-weight: 500; color: var(--lucid-ink); }
.template-desc { font-size: var(--lucid-text-sm); color: var(--lucid-ink-3); }

.schema-view { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.stat {
  padding: 14px 16px;
  border-radius: var(--lucid-radius-lg);
  background: var(--lucid-surface);
  box-shadow: 0 0 0 1px var(--lucid-line);
  min-width: 0;
}
.stat-value { font-size: 22px; font-weight: 600; color: var(--lucid-ink); font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat-label { font-size: var(--lucid-text-xs); color: var(--lucid-ink-3); margin-top: 2px; }
.stat-danger .stat-value { color: var(--risk-danger); }
.stat-caution .stat-value { color: var(--risk-caution); }

.sql-card { display: flex; flex-direction: column; min-width: 0; padding: 0 !important; overflow: hidden; }
.sql-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 10px 10px 12px;
  box-shadow: inset 0 -1px 0 var(--lucid-line);
}
.sql-actions { display: flex; gap: 4px; flex-wrap: wrap; }

.sql {
  margin: 0;
  max-height: 62vh;
  overflow: auto;
  padding: 14px 0;
  background: var(--lucid-surface-sunken);
  font-family: var(--lucid-font-mono);
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--lucid-ink-2);
  counter-reset: line;
  -webkit-user-select: text;
  user-select: text;
  tab-size: 2;
}
.sql code { display: block; min-width: max-content; }
.sql-line { display: block; padding: 0 16px 0 0; white-space: pre; }
.sql-line::before {
  counter-increment: line;
  content: counter(line);
  display: inline-block;
  width: 44px;
  padding-right: 16px;
  text-align: right;
  color: var(--lucid-ink-4);
  -webkit-user-select: none;
  user-select: none;
}
.tk-kw { color: light-dark(#7c3aed, #c4a7ff); }
.tk-type { color: light-dark(#0e7490, #67d4e8); }
.tk-id { color: var(--lucid-ink); }
.tk-str { color: light-dark(#16803c, #7fd99a); }
.tk-num { color: light-dark(#a86400, #f0b45a); }

.canvas-note { text-align: center; }

@media (max-width: 860px) {
  .stats { gap: 8px; }
  .stat { padding: 10px 12px; }
  .template { flex-wrap: wrap; }
  .template .lucid-btn { width: 100%; justify-content: center; }
}

.shell-full { height: 100dvh; min-height: 0; }
.shell-full .lucid-shell-main { min-height: 0; height: 100dvh; overflow: hidden; display: flex; flex-direction: column; }
.shell-full .banner { margin: 10px 12px 0; }

.grow { flex: 1; }
.mono { font-family: var(--lucid-font-mono); }
.danger-text { color: var(--lucid-danger) !important; }

.editor { flex: 1; min-height: 0; display: flex; flex-direction: column; }

.ed-bar {
  height: 52px;
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px 0 8px;
  box-shadow: inset 0 -1px 0 var(--lucid-line);
  min-width: 0;
}
.ed-name { font-weight: 600; color: var(--lucid-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; max-width: 260px; }
.ed-status { font-size: var(--lucid-text-xs); color: var(--lucid-ink-3); white-space: nowrap; padding-left: 4px; }
.ed-status[data-state="error"] { color: var(--risk-danger); }
.ed-group { display: flex; align-items: center; gap: 2px; padding: 0 6px; box-shadow: inset -1px 0 0 var(--lucid-line); }
.ed-zoom {
  appearance: none; border: 0; background: transparent; color: var(--lucid-ink-2);
  font: inherit; font-size: var(--lucid-text-xs); font-variant-numeric: tabular-nums;
  width: 46px; height: 28px; border-radius: 6px; cursor: pointer;
}
.ed-zoom:hover { background: var(--lucid-hover); color: var(--lucid-ink); }
.ed-count {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px;
  border-radius: 9px; background: var(--lucid-hover); font-size: 11px; font-variant-numeric: tabular-nums; color: var(--lucid-ink-2);
  box-sizing: border-box;
}
.ed-issues-btn.has-errors .lucid-icon { color: var(--risk-danger); }

.ed-main { flex: 1; min-height: 0; display: grid; grid-template-columns: 232px minmax(0, 1fr) 340px; }

.ed-list { display: flex; flex-direction: column; min-height: 0; box-shadow: inset -1px 0 0 var(--lucid-line); }
.ed-list-head { display: flex; gap: 4px; padding: 10px 8px 8px 10px; }
.ed-list-head .lucid-input { flex: 1; }
.ed-list-body { flex: 1; overflow: auto; padding: 0 6px 12px; }
.ed-list-empty { padding: 12px 8px; font-size: var(--lucid-text-sm); color: var(--lucid-ink-3); }
.ed-item {
  appearance: none; border: 0; background: transparent; font: inherit; width: 100%;
  display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 8px; border-radius: 6px;
  color: var(--lucid-ink-2); font-size: var(--lucid-text-sm); cursor: pointer; text-align: left;
}
.ed-item:hover { background: var(--lucid-hover); color: var(--lucid-ink); }
.ed-item.is-selected { background: var(--lucid-accent-soft); color: var(--lucid-ink); }
.ed-item .lucid-icon { color: var(--lucid-ink-3); flex: none; }
.ed-item-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed-item-count { font-size: 11px; color: var(--lucid-ink-4); font-variant-numeric: tabular-nums; }
.ed-dot { width: 6px; height: 6px; border-radius: 50%; flex: none; }
.ed-dot.is-error { background: var(--risk-danger); }
.ed-dot.is-warning { background: var(--risk-caution); }

.ed-center { position: relative; min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }

.canvas { position: relative; flex: 1; min-height: 0; overflow: hidden; background-color: var(--lucid-bg); background-image: radial-gradient(circle at center, var(--lucid-line-strong) var(--dot, 1px), transparent calc(var(--dot, 1px) + .4px)); }
.canvas-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; }
.canvas.can-pan .canvas-svg { cursor: grab; }
.canvas.is-panning .canvas-svg { cursor: grabbing; }

.tnode { cursor: default; }
.tnode-shadow { fill: rgb(0 0 0 / .22); }
html[data-theme="light"] .tnode-shadow { fill: rgb(0 0 0 / .06); }
.tnode-card { fill: var(--lucid-surface); }
.tnode-head { fill: var(--lucid-surface-raised); }
.tnode-rule { stroke: var(--lucid-line-strong); stroke-width: 1; }
.tnode-outline { fill: none; stroke: var(--lucid-line-strong); stroke-width: 1; pointer-events: none; }
.tnode.is-selected .tnode-outline { stroke: var(--lucid-accent); stroke-width: 2; }
.tnode.is-dragging { opacity: .92; }
.tnode-name { fill: var(--lucid-ink); font: 600 13px var(--lucid-font-sans); }
.tnode-badge circle { fill: var(--risk-danger); }
.tnode-badge.is-warning circle { fill: var(--risk-caution); }
.tnode-badge text { fill: #fff; font: 600 10px var(--lucid-font-sans); }
html[data-theme="dark"] .tnode-badge.is-warning text { fill: #1a1300; }
.trow-hit { fill: transparent; }
.trow.is-hover .trow-hit { fill: var(--lucid-hover); }
.trow.is-focus .trow-hit { fill: var(--lucid-accent-soft); }
.trow-name { fill: var(--lucid-ink-2); font: 12.5px var(--lucid-font-sans); }
.trow-name.is-required { fill: var(--lucid-ink); }
.trow-type { fill: var(--lucid-ink-3); font: 11.5px var(--lucid-font-mono); }
.trow-key { fill: none; stroke: var(--risk-caution); stroke-width: 1.3; stroke-linejoin: round; }
.trow-link { fill: none; stroke: var(--lucid-ink-3); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.handle { fill: var(--lucid-surface); stroke: var(--lucid-accent); stroke-width: 1.5; opacity: 0; cursor: crosshair; transition: opacity var(--lucid-fast); }
.trow.is-hover .handle { opacity: 1; }

.edge-line { fill: none; stroke: var(--lucid-ink-4); stroke-width: 1.5; }
.edge-mark { fill: none; stroke: var(--lucid-ink-4); stroke-width: 1.5; stroke-linecap: round; }
.edge.is-active .edge-line, .edge.is-active .edge-mark { stroke: var(--lucid-accent); stroke-width: 2; }
.edges { pointer-events: none; }
.link-draft { fill: none; stroke: var(--lucid-accent); stroke-width: 2; stroke-dasharray: 5 4; pointer-events: none; }
.marquee { fill: var(--lucid-accent-soft); stroke: var(--lucid-accent); stroke-width: 1; pointer-events: none; vector-effect: non-scaling-stroke; }

.ed-empty { position: absolute; inset: 0; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; pointer-events: none; padding: 24px; overflow: auto; }
.ed-empty-card {
  pointer-events: auto; width: 100%; max-width: 480px; min-width: 0; box-sizing: border-box;
  display: flex; flex-direction: column; gap: 14px; padding: 22px;
  border-radius: var(--lucid-radius-xl); background: var(--lucid-surface); box-shadow: 0 0 0 1px var(--lucid-line), var(--lucid-shadow-lg);
}
.ed-empty-title { font-size: 18px; font-weight: 600; color: var(--lucid-ink); }
.ed-empty-desc { font-size: var(--lucid-text-sm); color: var(--lucid-ink-3); margin-top: -8px; }
.ed-empty-or { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.ed-panel {
  flex: none; height: 38%; min-height: 180px; display: flex; flex-direction: column;
  background: var(--lucid-surface); box-shadow: inset 0 1px 0 var(--lucid-line-strong); z-index: 1;
}
.ed-panel-bar { display: flex; align-items: center; gap: 4px; height: 40px; padding: 0 8px 0 14px; flex: none; box-shadow: inset 0 -1px 0 var(--lucid-line); }
.ed-panel-title { font-size: var(--lucid-text-sm); font-weight: 600; color: var(--lucid-ink); }
.ed-sql { flex: 1; max-height: none; min-height: 0; }
.ed-issues { flex: 1; overflow: auto; padding: 8px 10px 14px; }
.ed-panel-empty { display: flex; align-items: center; gap: 8px; padding: 14px 6px; color: var(--risk-safe); font-size: var(--lucid-text-sm); }
.ed-issue-group + .ed-issue-group { margin-top: 10px; }
.ed-issue-head { display: flex; align-items: center; font-size: var(--lucid-text-xs); font-weight: 600; color: var(--lucid-ink-3); padding: 6px 6px 4px; text-transform: uppercase; letter-spacing: .04em; }

.issue { display: flex; align-items: flex-start; gap: 8px; font-size: var(--lucid-text-sm); line-height: 1.45; color: var(--lucid-ink-2); }
.issue .lucid-icon { flex: none; margin-top: 2px; }
.issue.is-error .lucid-icon { color: var(--risk-danger); }
.issue.is-warning .lucid-icon { color: var(--risk-caution); }
.issue.is-info .lucid-icon { color: var(--lucid-ink-3); }
.issue-row { appearance: none; border: 0; background: transparent; font: inherit; width: 100%; text-align: left; padding: 6px; border-radius: 6px; cursor: pointer; }
.issue-row:hover { background: var(--lucid-hover); }
.issue-text { flex: 1; min-width: 0; color: var(--lucid-ink); }
.issue-table { font-size: 11.5px; color: var(--lucid-ink-3); white-space: nowrap; max-width: 30%; overflow: hidden; text-overflow: ellipsis; }

.inspector { min-height: 0; overflow: auto; box-shadow: inset 1px 0 0 var(--lucid-line); background: var(--lucid-surface-sunken); }
.insp-body { display: flex; flex-direction: column; }
.insp-section { display: flex; flex-direction: column; gap: 8px; padding: 14px; box-shadow: inset 0 -1px 0 var(--lucid-line); min-width: 0; }
.insp-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 24px; }
.insp-title { font-size: var(--lucid-text-xs); font-weight: 600; color: var(--lucid-ink-3); text-transform: uppercase; letter-spacing: .04em; }
.insp-tname input { font-weight: 600; }
.insp-label { font-size: var(--lucid-text-xs); color: var(--lucid-ink-3); }
.insp-hint { font-size: var(--lucid-text-xs); color: var(--lucid-ink-3); }
.insp-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.insp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.insp-mini { display: flex; flex-direction: column; gap: 4px; font-size: var(--lucid-text-xs); color: var(--lucid-ink-3); min-width: 0; }
.insp-full { width: 100%; }
.insp-switches { display: flex; flex-direction: column; gap: 8px; }
.insp-item { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 4px 0; }
.insp-item-text { flex: 1; min-width: 0; font-size: 12px; color: var(--lucid-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.insp-rel { flex-direction: column; align-items: stretch; gap: 2px; }
.insp-rel-line { display: flex; align-items: center; gap: 4px; }
.insp-add { display: flex; flex-direction: column; gap: 8px; padding-top: 4px; }
.insp-add-row { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.insp-add-row > .lucid-select-trigger, .insp-add-row > div:first-child { flex: 1; min-width: 0; }
.insp-danger { box-shadow: none; align-items: flex-start; }
.insp-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 48px 20px; }
.insp-empty-icon { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; color: var(--lucid-ink-3); background: var(--lucid-surface); box-shadow: inset 0 0 0 1px var(--lucid-line); }
.insp-empty-title { font-weight: 500; color: var(--lucid-ink); }
.insp-empty .lucid-btn { margin-top: 6px; }

.cols { display: flex; flex-direction: column; gap: 2px; margin: 0 -6px; }
.col { border-radius: 8px; }
.col.is-open { background: var(--lucid-surface); box-shadow: 0 0 0 1px var(--lucid-line); }
.col-line { display: flex; align-items: center; gap: 2px; padding: 2px; min-width: 0; }
.col-pk {
  appearance: none; border: 0; background: transparent; width: 24px; height: 24px; flex: none;
  display: grid; place-items: center; border-radius: 6px; color: var(--lucid-ink-4); cursor: pointer;
}
.col-pk:hover { background: var(--lucid-hover); color: var(--lucid-ink-2); }
.col-pk.is-on { color: var(--risk-caution); }
.col-name { flex: 1; min-width: 0; }
.col-name input { font-family: var(--lucid-font-mono); font-size: 12.5px; }
.col-type { flex: none; max-width: 112px; font-family: var(--lucid-font-mono); font-size: 12px; }
.col-more {
  appearance: none; border: 0; background: transparent; width: 24px; height: 24px; flex: none;
  display: grid; place-items: center; border-radius: 6px; color: var(--lucid-ink-3); cursor: pointer;
}
.col-more:hover { background: var(--lucid-hover); color: var(--lucid-ink); }
.col-detail { display: flex; flex-direction: column; gap: 12px; padding: 6px 10px 10px 30px; }
.col-actions { display: flex; align-items: center; gap: 2px; }

@media (max-width: 1280px) {
  .ed-main { grid-template-columns: 200px minmax(0, 1fr) 300px; }
}

@media (max-width: 1180px) {
  .ed-main { grid-template-columns: minmax(0, 1fr) 300px; }
  .ed-list { display: none; }
  .ed-group:has(.ed-zoom) { display: none; }
}

@media (max-width: 860px) {
  .shell-full { height: auto; }
  .shell-full .lucid-shell-main { height: calc(100dvh - 58px); }
  .ed-bar { overflow-x: auto; scrollbar-width: none; }
  .ed-bar::-webkit-scrollbar { display: none; }
  .ed-name { display: none; }
  .ed-status, .ed-group:has(.ed-zoom) { display: none; }
  .ed-main { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  .ed-list { display: none; }
  .inspector { max-height: 42dvh; box-shadow: inset 0 1px 0 var(--lucid-line); }
}

.is-far .trow-name, .is-far .trow-type, .is-far .trow-key, .is-far .trow-link, .is-far .handle, .is-far .edge-mark { display: none; }
.is-far .tnode-shadow { display: none; }
.is-farther .tnode-name, .is-farther .tnode-badge text { display: none; }

.sqled { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.sqled-body { position: relative; flex: 1; min-height: 0; background: var(--lucid-surface-sunken); }
.sqled-view { position: absolute; inset: 0; max-height: none; overflow: hidden; margin: 0; pointer-events: none; }
.sqled-input {
  position: absolute; inset: 0; width: 100%; height: 100%; box-sizing: border-box; resize: none; border: 0; outline: none; margin: 0;
  padding: 14px 16px 14px 60px; background: transparent; color: transparent; caret-color: var(--lucid-ink);
  font-family: var(--lucid-font-mono); font-size: 12.5px; line-height: 1.65; tab-size: 2; white-space: pre; overflow: auto;
  -webkit-text-fill-color: transparent;
}
.sqled-input::selection { background: var(--lucid-accent-soft); -webkit-text-fill-color: transparent; }
.sqled-status {
  flex: none; display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 14px; min-width: 0;
  font-size: var(--lucid-text-xs); color: var(--lucid-ink-3); box-shadow: inset 0 1px 0 var(--lucid-line);
}
.sqled-status > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sqled-status .lucid-icon { flex: none; }
.sqled-status.is-error { color: var(--risk-danger); background: var(--risk-danger-soft); }
.sqled-detail { color: var(--lucid-ink-3); min-width: 0; }
.sqled-detail::before { content: "·"; margin-right: 8px; }

.imp { display: flex; flex-direction: column; gap: 12px; border-radius: var(--lucid-radius-lg); transition: box-shadow var(--lucid-fast); }
.imp.is-drop { box-shadow: 0 0 0 2px var(--lucid-accent); }
.imp-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.imp-text { width: 100%; min-height: 180px; max-height: 260px; font-size: 12px !important; line-height: 1.55; white-space: pre; overflow: auto; box-sizing: border-box; }
.imp-hint { font-size: var(--lucid-text-xs); color: var(--lucid-ink-3); margin-top: -4px; }
.imp-result { display: flex; flex-direction: column; gap: 10px; }
.imp-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.imp-stat { padding: 10px 12px; border-radius: var(--lucid-radius-md); background: var(--lucid-surface-sunken); box-shadow: inset 0 0 0 1px var(--lucid-line); min-width: 0; }
.imp-stat-value { font-size: 18px; font-weight: 600; color: var(--lucid-ink); font-variant-numeric: tabular-nums; }
.imp-stat-label { font-size: var(--lucid-text-xs); color: var(--lucid-ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.imp-warnings { display: flex; flex-direction: column; gap: 6px; max-height: 220px; overflow: auto; padding-right: 4px; }
.imp-warnings .issue { padding: 2px 0; }
.imp-mode { display: flex; align-items: center; }

@media (max-width: 860px) {
  .imp-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.sql, .sqled-input { letter-spacing: 0; font-variant-ligatures: none; font-kerning: none; font-feature-settings: normal; }
.sqled-view code { will-change: transform; }

.trow-mark { fill: transparent; }
.trow.is-added .trow-hit { fill: var(--risk-safe-soft); }
.trow.is-added .trow-mark { fill: var(--risk-safe); }
.trow.is-changed .trow-hit { fill: var(--risk-caution-soft); }
.trow.is-changed .trow-mark { fill: var(--risk-caution); }
.trow.is-dropped .trow-hit { fill: var(--risk-danger-soft); }
.trow.is-dropped .trow-mark { fill: var(--risk-danger); }
.trow.is-dropped .trow-name, .trow.is-dropped .trow-type { fill: var(--risk-danger); }
.trow-strike { stroke: var(--risk-danger); stroke-width: 1; opacity: .7; }
.trow.is-dropped { pointer-events: none; }
.tnode.is-added .tnode-outline { stroke: var(--risk-safe); stroke-width: 2; }
.tnode.is-changed .tnode-outline { stroke: var(--risk-caution); stroke-width: 1.5; }
.tnode.is-selected.is-added .tnode-outline, .tnode.is-selected.is-changed .tnode-outline { stroke: var(--lucid-accent); stroke-width: 2; }

.ed-compare {
  display: flex; align-items: center; height: 28px; border-radius: 14px; flex: none; min-width: 0; max-width: 300px;
  background: var(--risk-caution-soft); color: var(--lucid-ink); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--risk-caution) 35%, transparent);
}
.ed-compare-label {
  appearance: none; border: 0; background: transparent; font: inherit; color: inherit; cursor: pointer;
  display: flex; align-items: center; gap: 6px; padding: 0 4px 0 10px; height: 100%; min-width: 0; font-size: var(--lucid-text-xs);
}
.ed-compare-label span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed-compare-label .lucid-icon { color: var(--risk-caution); flex: none; }
.ed-compare-x {
  appearance: none; border: 0; background: transparent; color: var(--lucid-ink-2); cursor: pointer;
  width: 26px; height: 26px; margin-right: 1px; border-radius: 13px; display: grid; place-items: center; flex: none;
}
.ed-compare-x:hover { background: var(--lucid-hover); color: var(--lucid-ink); }

.chg-panel { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.chg-list { min-height: 0; overflow: auto; padding: 8px 10px 14px; box-shadow: inset -1px 0 0 var(--lucid-line); display: flex; flex-direction: column; gap: 2px; }
.chg-summary { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 4px 6px 8px; }
.chg-count { display: inline-flex; align-items: center; gap: 6px; font-size: var(--lucid-text-xs); color: var(--lucid-ink-2); font-variant-numeric: tabular-nums; }
.chg-note { display: flex; align-items: flex-start; gap: 6px; padding: 6px 8px; margin: 0 0 6px; border-radius: 6px; font-size: var(--lucid-text-xs); color: var(--lucid-ink-2); background: var(--lucid-hover); }
.chg-note .lucid-icon { flex: none; margin-top: 1px; }
.chg-note.is-warn { color: var(--risk-caution); background: var(--risk-caution-soft); margin: 8px 12px 0; }
.chg {
  appearance: none; border: 0; background: transparent; font: inherit; text-align: left; width: 100%; cursor: pointer;
  display: flex; align-items: flex-start; gap: 10px; padding: 7px 8px; border-radius: 6px; min-width: 0;
}
.chg:hover { background: var(--lucid-hover); }
.chg.is-covered { padding-left: 26px; }
.chg-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; margin-top: 6px; background: var(--risk-safe); }
.chg.is-caution .chg-dot, .chg-dot.is-caution { background: var(--risk-caution); }
.chg.is-destructive .chg-dot, .chg-dot.is-destructive { background: var(--risk-danger); }
.chg-count .chg-dot { margin-top: 0; }
.chg-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.chg-what { font-size: var(--lucid-text-sm); color: var(--lucid-ink); overflow-wrap: anywhere; }
.chg-why { font-size: var(--lucid-text-xs); color: var(--lucid-ink-3); line-height: 1.45; }
.chg-level {
  flex: none; font-size: 11px; font-weight: 500; padding: 2px 7px; border-radius: 10px;
  color: var(--risk-safe); background: var(--risk-safe-soft); white-space: nowrap;
}
.chg-level.is-caution { color: var(--risk-caution); background: var(--risk-caution-soft); }
.chg-level.is-destructive { color: var(--risk-danger); background: var(--risk-danger-soft); }
.chg-rebuild { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 8px 2px; font-size: var(--lucid-text-xs); font-weight: 600; color: var(--lucid-ink-2); }
.chg-rebuild .chg-why { font-weight: 400; }
.chg-sql { min-height: 0; display: flex; flex-direction: column; }
.chg-sql-bar { display: flex; align-items: center; gap: 4px; padding: 8px 8px 8px 12px; flex: none; box-shadow: inset 0 -1px 0 var(--lucid-line); }
.chg-code { flex: 1; min-height: 0; max-height: none; }

.ver { display: flex; flex-direction: column; gap: 14px; }
.ver-save { display: flex; gap: 8px; }
.ver-save .lucid-input { flex: 1; min-width: 0; }
.ver-empty { font-size: var(--lucid-text-sm); color: var(--lucid-ink-3); padding: 8px 0; }
.ver-list { display: flex; flex-direction: column; gap: 4px; max-height: 340px; overflow: auto; }
.ver-row { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 12px; border-radius: var(--lucid-radius-md); background: var(--lucid-surface-sunken); box-shadow: inset 0 0 0 1px var(--lucid-line); min-width: 0; }
.ver-row.is-active { box-shadow: inset 0 0 0 1px var(--risk-caution); }
.ver-text { flex: 1; min-width: 0; }
.ver-label { font-weight: 500; color: var(--lucid-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ver-meta { font-size: var(--lucid-text-xs); color: var(--lucid-ink-3); }

@media (max-width: 860px) {
  .chg-panel { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); }
  .chg-list { box-shadow: inset 0 -1px 0 var(--lucid-line); }
  .ed-compare { max-width: 160px; }
}

@media (max-width: 860px) {
  .inspector:has(> .insp-empty) { display: none; }
  .ed-panel { height: 62%; }
  .chg-panel { grid-template-rows: minmax(0, 1.1fr) minmax(0, 1fr); }
}

:root, .lucid-app {
  --brand: #64AE2E;
  --brand-hover: light-dark(#579a27, #74bf3c);
  --brand-ink: #0b1408;
}
.lucid-btn[data-variant="primary"] { background-color: var(--brand); color: var(--brand-ink); }
.lucid-btn[data-variant="primary"]:hover:not(:disabled):not([aria-disabled="true"]) { background-color: var(--brand-hover); }
.lucid-btn[data-variant="primary"] .lucid-icon { color: inherit; }

.prop-btn { position: relative; display: inline-flex; }
.prop-badge {
  position: absolute; top: -3px; right: -4px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; pointer-events: none;
  display: grid; place-items: center; font-size: 10px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums;
  background: var(--brand); color: var(--brand-ink); box-shadow: 0 0 0 2px var(--lucid-bg);
}
.prop-row { align-items: center; }
.prop-row .chg-level { flex: none; }
.prop-note { margin-top: 4px; font-size: var(--lucid-text-xs); color: var(--lucid-ink-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.prop-status { flex: none; font-size: var(--lucid-text-xs); font-weight: 500; padding: 2px 8px; border-radius: 10px; background: var(--lucid-hover); color: var(--lucid-ink-2); }
.prop-status.is-approved { background: var(--risk-safe-soft); color: var(--risk-safe); }
.prop-empty { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.ver > .lucid-seg { align-self: flex-start; }

.rv-bar {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 6;
  width: min(580px, calc(100% - 24px)); display: flex; flex-direction: column; gap: 8px; padding: 10px 10px 10px 12px;
  border-radius: var(--lucid-radius-lg); background: var(--lucid-surface-raised, var(--lucid-surface));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 45%, var(--lucid-line)), 0 10px 30px rgb(0 0 0 / .22);
}
.rv-bar.is-editing { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--risk-caution) 50%, var(--lucid-line)), 0 10px 30px rgb(0 0 0 / .22); }
.rv-head { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.rv-glyph { flex: none; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: color-mix(in srgb, var(--brand) 18%, transparent); color: var(--brand); }
.rv-bar.is-editing .rv-glyph { background: var(--risk-caution-soft); color: var(--risk-caution); }
.rv-text { flex: 1; min-width: 0; padding-top: 1px; }
.rv-title { font-weight: 500; color: var(--lucid-ink); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rv-meta { font-size: var(--lucid-text-xs); color: var(--lucid-ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rv-warn { display: flex; align-items: flex-start; gap: 6px; padding: 6px 8px; border-radius: 6px; font-size: var(--lucid-text-xs); color: var(--risk-caution); background: var(--risk-caution-soft); overflow-wrap: anywhere; }
.rv-warn .lucid-icon { flex: none; margin-top: 1px; }
.rv-warn.is-error { color: var(--risk-danger); background: var(--risk-danger-soft); }
.rv-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rv-reject { display: flex; flex-direction: column; gap: 12px; }
.rv-reject-actions { display: flex; justify-content: flex-end; gap: 8px; }
.editor.is-previewing .inspector :is(input, textarea, button, select, [role="switch"], [role="combobox"], .lucid-btn) { pointer-events: none; }
.editor.is-previewing .inspector .insp-body, .editor.is-previewing .inspector > :not(.insp-empty) { opacity: .72; }

@media (max-width: 860px) {
  .rv-bar { top: 8px; width: calc(100% - 16px); }
  .rv-actions .grow { display: none; }
  .rv-actions > .lucid-btn[data-variant="primary"] { margin-left: auto; }
}

.connect { display: flex; flex-direction: column; gap: 10px; width: 100%; min-width: 0; }
.connect > .lucid-seg { align-self: flex-start; }
.connect-head { font-weight: 500; color: var(--lucid-ink); margin-top: 6px; }
.connect-where { font-size: var(--lucid-text-xs); color: var(--lucid-ink-2); }
.connect-code { position: relative; border-radius: var(--lucid-radius-md); background: var(--lucid-surface-sunken); box-shadow: inset 0 0 0 1px var(--lucid-line); min-width: 0; }
.connect-code pre { margin: 0; padding: 12px 12px 40px; font-family: var(--lucid-font-mono); font-size: 12px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--lucid-ink); user-select: text; -webkit-user-select: text; }
.connect-code > .lucid-btn { position: absolute; right: 6px; bottom: 6px; }
.connect-pad { padding: 4px 16px 16px; }

.auth-demo {
  display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 6px; padding: 10px 12px;
  border-radius: var(--lucid-radius-md); text-decoration: none; font-size: var(--lucid-text-sm); font-weight: 500;
  color: var(--lucid-ink); background: color-mix(in srgb, var(--brand) 10%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 35%, transparent);
  transition: background-color .15s ease;
}
.auth-demo:hover { background: color-mix(in srgb, var(--brand) 16%, transparent); }
.auth-demo .lucid-icon { color: var(--brand); flex: none; }
.demo-wait { align-items: center; justify-content: center; text-align: center; min-height: 220px; gap: 14px; }

.demo-card {
  display: flex; flex-direction: column; gap: 6px; margin: 0 0 8px; padding: 12px;
  border-radius: var(--lucid-radius-md); background: color-mix(in srgb, var(--brand) 9%, var(--lucid-surface-sunken));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 30%, var(--lucid-line));
}
.demo-card-title { display: flex; align-items: center; gap: 6px; font-size: var(--lucid-text-sm); font-weight: 600; color: var(--lucid-ink); }
.demo-card-title .lucid-icon { color: var(--brand); flex: none; }
.demo-card-desc { font-size: var(--lucid-text-xs); line-height: 1.45; color: var(--lucid-ink-2); margin-bottom: 4px; }
.demo-mobile .demo-card { margin: 12px 16px 0; }
.demo-mobile:empty, .demo-mobile:not(:has(.demo-card)) { display: none; }
.lucid-input:has(input:disabled) { opacity: .5; cursor: not-allowed; }
.lucid-input:has(input:disabled) input, .lucid-input:has(input:disabled) .pw-toggle { cursor: not-allowed; pointer-events: none; }
.auth-legal { margin: 2px 0 0; text-align: center; font-size: var(--lucid-text-xs); line-height: 1.5; color: var(--lucid-ink-3); }
.auth-legal .link { color: var(--lucid-ink-2); }
a.auth-brand { text-decoration: none; color: inherit; }
