:root {
      --bg: #121416;
      --panel: #191d21;
      --panel-strong: #232930;
      --text: #eef2f5;
      --muted: #97a2ad;
      --accent: #d96b3b;
      --accent-strong: #f18452;
      --border: #2f3740;
      --success: #4ec08d;
      --error: #ff6c6c;
      --shadow: 0 20px 60px rgba(0, 0, 0, 0.32);
    }

    html[data-theme="light"] {
      color-scheme: light;
      --bg: #f1f5f9;
      --panel: #ffffff;
      --panel-strong: #e9eff6;
      --text: #18212d;
      --muted: #586678;
      --accent: #c95a2d;
      --accent-strong: #e27245;
      --border: #d4dde7;
      --success: #1f9159;
      --error: #cd4f4f;
      --shadow: 0 20px 60px rgba(31, 41, 55, 0.12);
    }

    * {
      box-sizing: border-box;
    }

    body {
      margin: 0;
      min-height: 100vh;
      font-family: "Trebuchet MS", "Segoe UI", sans-serif;
      color: var(--text);
      position: relative;
      overflow-x: hidden;
      background:
        radial-gradient(circle at top left, rgba(217, 107, 59, 0.16), transparent 28%),
        linear-gradient(160deg, #101214 0%, #171b1f 52%, #111417 100%);
    }

    html[data-theme="light"] body {
      background:
        radial-gradient(circle at top left, rgba(201, 90, 45, 0.14), transparent 28%),
        linear-gradient(160deg, #f8fbff 0%, #eef3f8 54%, #e7edf4 100%);
    }

    body::after {
      content: "";
      position: fixed;
      top: auto;
      right: 10px;
      bottom: 10px;
      width: clamp(220px, 24vw, 420px);
      height: clamp(220px, 24vw, 420px);
      transform: none;
      background: url("/icon-white.svg") no-repeat center center;
      background-size: contain;
      opacity: 0.15;
      pointer-events: none;
      z-index: 0;
    }

    html[data-theme="light"] body::after {
      opacity: 0.06;
      filter: invert(1);
    }

    .page {
      width: min(1120px, calc(100% - 32px));
      margin: 32px auto;
      display: grid;
      gap: 20px;
      position: relative;
      z-index: 1;
    }

    .site-footer {
      width: min(1120px, calc(100% - 32px));
      margin: 0 auto 28px;
      position: relative;
      z-index: 1;
      color: var(--muted);
      font-size: 0.85rem;
      line-height: 1.4;
    }

    .site-footer-inner {
      display: flex;
      flex-wrap: wrap;
      gap: 10px 16px;
      align-items: center;
      justify-content: space-between;
      padding-top: 2px;
    }

    .site-footer-copy {
      display: inline-flex;
      align-items: center;
      gap: 6px;
    }

    .site-footer-copy a {
      color: var(--text);
      text-decoration: none;
    }

    .site-footer-copy a:hover {
      text-decoration: underline;
      text-underline-offset: 3px;
    }

    .site-footer-note {
      color: var(--muted);
    }

    .hero,
    .panel {
      background: var(--panel);
      border: 1px solid var(--border);
      border-radius: 10px;
      box-shadow: var(--shadow);
    }

    .hero {
      padding: 28px;
      background:
        linear-gradient(135deg, rgba(217, 107, 59, 0.14), rgba(25, 29, 33, 0.94)),
        var(--panel);
    }

    html[data-theme="light"] .hero {
      background:
        linear-gradient(135deg, rgba(201, 90, 45, 0.10), rgba(255, 255, 255, 0.96)),
        var(--panel);
    }

    .hero-inner {
      display: grid;
      grid-template-columns: auto minmax(0, 1fr);
      gap: 18px;
      align-items: center;
    }

    .hero-icon {
      width: clamp(72px, 10vw, 120px);
      height: clamp(72px, 10vw, 120px);
      display: block;
      object-fit: contain;
      filter: drop-shadow(0 14px 24px rgba(0, 0, 0, 0.22));
    }

    html[data-theme="light"] .hero-icon {
      filter: invert(0.8) drop-shadow(0 14px 24px rgba(0, 0, 0, 0.14));
    }

    .hero h1 {
      margin: 0 0 10px;
      font-size: clamp(2rem, 4vw, 3.5rem);
      line-height: 0.95;
      letter-spacing: 0.04em;
      text-transform: uppercase;
    }

    .hero p {
      margin: 0;
      max-width: 760px;
      color: var(--muted);
      font-size: 1.05rem;
    }

    .hero-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 12px;
      align-items: center;
      margin-top: 18px;
    }

    .hero-link {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      min-height: 46px;
      padding: 12px 18px;
      border-radius: 10px;
      text-decoration: none;
    }

    .hero-note {
      color: var(--muted);
      font-size: 0.95rem;
      line-height: 1.4;
    }

    .grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 20px;
    }

    .panel {
      padding: 22px;
    }

    .panel-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 16px;
    }

    .panel-head h2 {
      margin: 0;
    }

    .panel-head-actions {
      display: flex;
      gap: 10px;
      align-items: center;
      flex-wrap: wrap;
    }

    .panel h2 {
      margin: 0 0 16px;
      font-size: 1.1rem;
      text-transform: uppercase;
      letter-spacing: 0.08em;
    }

    label {
      display: block;
      margin-bottom: 8px;
      font-size: 0.95rem;
      color: var(--muted);
    }

    input,
    button {
      font: inherit;
    }

    input {
      width: 100%;
      padding: 14px 16px;
      border: 1px solid var(--border);
      border-radius: 10px;
      background: #101316;
      color: var(--text);
    }

    html[data-theme="light"] input,
    html[data-theme="light"] .editor-fallback {
      background: #ffffff;
      color: var(--text);
    }

    input:focus {
      outline: 2px solid rgba(217, 107, 59, 0.22);
      border-color: var(--accent);
    }

    .editor-shell {
      overflow: hidden;
      border: 1px solid var(--border);
      border-radius: 10px;
      background: #1d1a17;
      box-shadow: inset 0 0 0 1px rgba(248, 239, 224, 0.04);
    }

    html[data-theme="light"] .editor-shell {
      background: #ffffff;
      box-shadow: inset 0 0 0 1px rgba(31, 41, 55, 0.04);
    }

    .editor-panel.is-fullscreen {
      position: fixed;
      inset: 20px;
      z-index: 46;
      display: flex;
      flex-direction: column;
      margin: 0;
      width: auto;
      max-width: none;
      max-height: none;
    }

    .editor-panel.is-fullscreen .editor-shell {
      flex: 1 1 auto;
      min-height: 0;
    }

    .editor-panel.is-fullscreen .editor-frame,
    .editor-panel.is-fullscreen .editor-fallback {
      height: 100%;
      min-height: 0;
    }

    .editor-frame {
      min-height: 260px;
      height: 320px;
      width: 100%;
    }

    .editor-fallback {
      width: 100%;
      min-height: 260px;
      padding: 14px 16px;
      border: 0;
      background: #101316;
      color: #f8efe0;
      resize: vertical;
      font-family: "Courier New", monospace;
      line-height: 1.45;
    }

    .editor-fallback:focus {
      outline: none;
    }

    .row {
      display: flex;
      gap: 12px;
      flex-wrap: wrap;
      align-items: center;
    }

    .row > input {
      flex: 1 1 0;
      min-width: 0;
      width: auto;
    }

    .row.full-width {
      display: block;
    }

    .row + .row {
      margin-top: 14px;
    }

    .row.space-between {
      justify-content: space-between;
    }

    button {
      border: 0;
      border-radius: 10px;
      padding: 12px 18px;
      cursor: pointer;
      transition: transform 140ms ease, background 140ms ease;
    }

    button:hover {
      transform: translateY(-1px);
    }

    .primary {
      background: var(--accent);
      color: #fff7f1;
    }

    .primary:hover {
      background: var(--accent-strong);
    }

    .secondary {
      background: var(--panel-strong);
      color: var(--text);
    }

    .theme-toggle {
      position: fixed;
      left: 20px;
      bottom: 20px;
      z-index: 81;
      width: 54px;
      height: 54px;
      padding: 0;
      border-radius: 999px;
      border: 1px solid var(--border);
      background: var(--panel);
      color: var(--text);
      box-shadow: var(--shadow);
      display: grid;
      place-items: center;
      font-size: 1.2rem;
      line-height: 1;
    }

    .theme-toggle:hover {
      transform: translateY(-2px) scale(1.02);
    }

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

    html[data-theme="light"] .theme-toggle {
      background: rgba(255, 255, 255, 0.94);
    }

    #runButton {
      width: 100%;
    }

    .status {
      min-height: 24px;
      color: var(--muted);
      font-size: 0.95rem;
    }

    .status.error {
      color: var(--error);
    }

    .status.success {
      color: var(--success);
    }

    .toast-layer {
      position: fixed;
      top: 20px;
      right: 20px;
      z-index: 70;
      display: grid;
      gap: 10px;
      pointer-events: none;
    }

    .toast {
      min-width: 260px;
      max-width: min(360px, calc(100vw - 40px));
      padding: 14px 16px;
      border-radius: 12px;
      border: 1px solid var(--border);
      background: rgba(25, 29, 33, 0.94);
      color: var(--text);
      box-shadow: var(--shadow);
      backdrop-filter: blur(8px);
      opacity: 0;
      transform: translate3d(24px, -10px, 0) scale(0.98);
      transition: opacity 180ms ease, transform 180ms ease;
    }

    html[data-theme="light"] .toast {
      background: rgba(255, 255, 255, 0.96);
      color: var(--text);
    }

    .toast.open {
      opacity: 1;
      transform: translate3d(0, 0, 0) scale(1);
    }

    .toast.success {
      border-color: rgba(78, 192, 141, 0.35);
      box-shadow: 0 20px 50px rgba(78, 192, 141, 0.12);
    }

    .toast.error {
      background: #ff3b3b;
      color: #000000;
      border-color: #b10000;
      box-shadow: 0 20px 50px rgba(255, 59, 59, 0.28);
    }

    html[data-theme="light"] .toast.error {
      background: #ff3b3b;
      color: #000000;
      border-color: #b10000;
      box-shadow: 0 20px 50px rgba(255, 59, 59, 0.28);
    }

    .toast.error .toast-title,
    .toast.error .toast-message {
      color: #000000;
    }

    .toast-title {
      margin: 0 0 4px;
      font-size: 0.75rem;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      color: var(--muted);
    }

    .toast-message {
      margin: 0;
      font-size: 0.95rem;
      line-height: 1.4;
    }

    .meta {
      display: grid;
      gap: 10px;
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .meta-card {
      padding: 14px;
      border-radius: 10px;
      background: #12161a;
      border: 1px solid var(--border);
    }

    html[data-theme="light"] .meta-card {
      background: #ffffff;
    }

    .meta-card strong,
    .meta-card span {
      display: block;
    }

    .meta-card strong {
      font-size: 0.8rem;
      color: var(--muted);
      letter-spacing: 0.06em;
      text-transform: uppercase;
    }

    .meta-card span {
      margin-top: 6px;
      word-break: break-word;
    }

    .meta-link {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      width: fit-content;
      border: 0;
      padding: 0;
      background: transparent;
      color: var(--accent-strong);
      cursor: pointer;
      text-decoration: underline;
      text-underline-offset: 3px;
    }

    .meta-link:disabled {
      color: var(--muted);
      cursor: not-allowed;
      text-decoration: none;
    }

    .meta-link[href] {
      cursor: pointer;
    }

    .resume-link {
      display: block;
      width: 100%;
      max-width: 100%;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
    }

    pre {
      margin: 0;
      padding: 16px;
      min-height: 260px;
      overflow: auto;
      border-radius: 10px;
      background: #101316;
      color: #edf1f5;
      font-family: "Courier New", monospace;
      line-height: 1.5;
    }

    .export-shell {
      border-radius: 10px;
      overflow: hidden;
      border: 1px solid rgba(248, 239, 224, 0.12);
      background: #101316;
    }

    html[data-theme="light"] .export-shell {
      background: #ffffff;
      border-color: var(--border);
    }

    .export-editor {
      min-height: 320px;
      height: 320px;
    }

    .result-box {
      min-height: 260px;
      padding: 16px;
      overflow: auto;
      border-radius: 10px;
      background: #101316;
      color: #edf1f5;
    }

    html[data-theme="light"] .result-box {
      background: #ffffff;
      color: var(--text);
    }

    .result-error {
      padding: 14px 16px;
      border-radius: 12px;
      border: 1px solid #b10000;
      background: #ad2828;
      color: #ffffff;
      box-shadow: 0 18px 40px rgba(255, 59, 59, 0.20);
      line-height: 1.55;
    }

    .result-error::before {
      content: "Ошибка БД";
      display: block;
      margin-bottom: 8px;
      font-size: 0.75rem;
      font-weight: 700;
      letter-spacing: 0.08em;
      text-transform: uppercase;
    }

    .result-panel.is-fullscreen {
      position: fixed;
      inset: 20px;
      z-index: 45;
      display: flex;
      flex-direction: column;
      margin: 0;
      width: auto;
      max-width: none;
      max-height: none;
    }

    .result-panel.is-fullscreen .result-box {
      flex: 1 1 auto;
      min-height: 0;
    }

    .split-modal-backdrop {
      position: fixed;
      inset: 0;
      display: none;
      align-items: stretch;
      justify-content: stretch;
      padding: 20px;
      background: rgba(0, 0, 0, 0.72);
      z-index: 60;
    }

    html[data-theme="light"] .split-modal-backdrop,
    html[data-theme="light"] .rate-limit-backdrop,
    html[data-theme="light"] .modal-backdrop {
      background: rgba(15, 23, 42, 0.22);
    }

    .split-modal-backdrop.open {
      display: flex;
    }

    .split-modal {
      width: 100%;
      height: 100%;
      background: var(--panel);
      border: 1px solid var(--border);
      border-radius: 16px;
      box-shadow: 0 30px 80px rgba(0, 0, 0, 0.32);
      display: grid;
      grid-template-rows: auto 1fr auto;
      overflow: hidden;
    }

    html[data-theme="light"] .split-modal,
    html[data-theme="light"] .rate-limit-modal,
    html[data-theme="light"] .modal {
      background: #ffffff;
      box-shadow: 0 30px 80px rgba(31, 41, 55, 0.12);
    }

    .split-modal-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      padding: 18px 20px;
      border-bottom: 1px solid var(--border);
      background: #20262c;
    }

    html[data-theme="light"] .split-modal-head,
    html[data-theme="light"] .split-pane-head,
    html[data-theme="light"] .split-modal-actions,
    html[data-theme="light"] .rate-limit-head,
    html[data-theme="light"] .modal-head,
    html[data-theme="light"] .diagram-node-header {
      background: #edf3f8;
    }

    .split-modal-title {
      margin: 0;
      font-size: 1.05rem;
      letter-spacing: 0.04em;
      text-transform: uppercase;
    }

    .split-modal-body {
      display: grid;
      grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
      gap: 0;
      min-height: 0;
    }

    .split-pane {
      min-width: 0;
      min-height: 0;
      display: grid;
      grid-template-rows: auto 1fr;
    }

    .split-pane + .split-pane {
      border-left: 1px solid var(--border);
    }

    .split-pane-head {
      padding: 14px 16px;
      border-bottom: 1px solid var(--border);
      background: #171b1f;
      color: var(--muted);
      text-transform: uppercase;
      letter-spacing: 0.08em;
      font-size: 0.8rem;
    }

    html[data-theme="light"] .split-pane-head {
      color: var(--muted);
    }

    .split-pane-body {
      min-height: 0;
      overflow: hidden;
    }

    .split-editor-shell {
      height: 100%;
      min-height: 0;
      border: 0;
      border-radius: 0;
      box-shadow: none;
    }

    .split-editor-frame {
      width: 100%;
      height: 100%;
      min-height: 0;
    }

    .split-result {
      height: 100%;
      min-height: 0;
      overflow: auto;
      padding: 16px;
      background: #101316;
      color: #edf1f5;
    }

    html[data-theme="light"] .split-result {
      background: #ffffff;
      color: var(--text);
    }

    .result-box.has-error,
    .split-result.has-error {
      display: flex;
    }

    .result-box.has-error > .result-error,
    .split-result.has-error > .result-error {
      flex: 1 1 auto;
      min-height: 100%;
    }

    .split-result.has-error {
      padding: 15px;
    }

    .split-modal-actions {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      padding: 16px 20px 20px;
      border-top: 1px solid var(--border);
      background: #171b1f;
    }

    .split-modal-run {
      min-width: 140px;
    }

    .rate-limit-backdrop {
      position: fixed;
      inset: 0;
      display: none;
      align-items: center;
      justify-content: center;
      padding: 20px;
      background: rgba(0, 0, 0, 0.74);
      z-index: 70;
    }

    .rate-limit-backdrop.open {
      display: flex;
    }

    .rate-limit-modal {
      width: min(640px, 100%);
      background: var(--panel);
      border: 1px solid var(--border);
      border-radius: 18px;
      box-shadow: 0 30px 80px rgba(0, 0, 0, 0.34);
      overflow: hidden;
      display: grid;
      grid-template-rows: auto 1fr auto;
    }

    .rate-limit-head {
      padding: 18px 20px;
      border-bottom: 1px solid var(--border);
      background: #20262c;
    }

    .rate-limit-title {
      margin: 0;
      font-size: 1.05rem;
      letter-spacing: 0.05em;
      text-transform: uppercase;
    }

    .rate-limit-body {
      padding: 20px;
      display: grid;
      gap: 18px;
    }

    .rate-limit-image {
      min-height: 180px;
      border: 1px dashed rgba(248, 239, 224, 0.18);
      border-radius: 14px;
      background:
        linear-gradient(135deg, rgba(217, 107, 59, 0.12), rgba(74, 157, 134, 0.08)),
        #101316;
      display: grid;
      place-items: center;
      overflow: hidden;
    }

    html[data-theme="light"] .rate-limit-image {
      border-color: rgba(31, 41, 55, 0.12);
      background:
        linear-gradient(135deg, rgba(201, 90, 45, 0.08), rgba(74, 157, 134, 0.06)),
        #f8fbff;
    }

    .rate-limit-image img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
    }

    .rate-limit-copy {
      color: var(--text);
      font-size: 1rem;
      line-height: 1.6;
    }

    .rate-limit-foot {
      padding: 0 20px 20px;
      display: flex;
      justify-content: flex-end;
    }

    .result-group + .result-group {
      margin-top: 18px;
      padding-top: 18px;
      border-top: 1px solid rgba(248, 239, 224, 0.14);
    }

    html[data-theme="light"] .result-group + .result-group {
      border-top-color: rgba(31, 41, 55, 0.1);
    }

    .result-title {
      margin: 0 0 10px;
      color: #d8c3a5;
      font-size: 0.8rem;
      letter-spacing: 0.08em;
      text-transform: uppercase;
    }

    html[data-theme="light"] .result-title {
      color: var(--accent);
    }

    .table-wrap {
      overflow: auto;
      border: 1px solid rgba(248, 239, 224, 0.12);
      border-radius: 10px;
    }

    html[data-theme="light"] .table-wrap {
      border-color: var(--border);
    }

    table {
      width: 100%;
      border-collapse: collapse;
      font-size: 0.95rem;
    }

    th,
    td {
      padding: 10px 12px;
      text-align: left;
      border-bottom: 1px solid rgba(248, 239, 224, 0.12);
      vertical-align: top;
    }

    th {
      background: rgba(248, 239, 224, 0.08);
      color: #fff4df;
      position: sticky;
      top: 0;
    }

    html[data-theme="light"] th {
      background: #eef3f8;
      color: var(--text);
    }

    td {
      color: #f8efe0;
      word-break: break-word;
    }

    html[data-theme="light"] td {
      color: var(--text);
    }

    tr:last-child td {
      border-bottom: 0;
    }

    .empty-state {
      color: #d8c3a5;
      font-style: italic;
    }

    html[data-theme="light"] .empty-state {
      color: var(--muted);
    }

    .hint {
      color: var(--muted);
      font-size: 0.9rem;
    }

    .modal-backdrop {
      position: fixed;
      inset: 0;
      display: none;
      align-items: center;
      justify-content: center;
      padding: 20px;
      background: rgba(0, 0, 0, 0.58);
      z-index: 40;
    }

    .modal-backdrop.open {
      display: flex;
    }

    .modal {
      width: min(1280px, calc(100vw - 40px));
      max-height: min(90vh, 960px);
      overflow: hidden;
      background: var(--panel);
      border: 1px solid var(--border);
      border-radius: 16px;
      box-shadow: 0 30px 80px rgba(0, 0, 0, 0.22);
      display: grid;
      grid-template-rows: auto 1fr;
    }

    .modal-head {
      display: flex;
      justify-content: space-between;
      gap: 12px;
      align-items: center;
      padding: 18px 20px;
      border-bottom: 1px solid var(--border);
      background: #20262c;
    }

    .modal-title {
      margin: 0;
      font-size: 1.1rem;
      letter-spacing: 0.04em;
      text-transform: uppercase;
    }

    .modal-body {
      padding: 20px;
      overflow: auto;
    }

    .ghost {
      background: transparent;
      color: var(--text);
      border: 1px solid var(--border);
    }

    .modal-stack {
      display: grid;
      gap: 16px;
    }

    .subpanel {
      padding: 16px;
      border: 1px solid var(--border);
      border-radius: 16px;
      background: #15191d;
    }

    html[data-theme="light"] .subpanel {
      background: #ffffff;
    }

    .subpanel h3 {
      margin: 0 0 12px;
      font-size: 0.98rem;
      letter-spacing: 0.06em;
      text-transform: uppercase;
    }

    html[data-theme="light"] .subpanel h3 {
      color: var(--text);
    }

    .empty {
      padding: 18px;
      border-radius: 16px;
      background: var(--panel-strong);
      color: var(--muted);
    }

    .diagram-surface {
      position: relative;
      min-width: 960px;
      min-height: 640px;
      background:
        linear-gradient(rgba(217, 107, 59, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(217, 107, 59, 0.08) 1px, transparent 1px),
        #14181c;
      background-size: 24px 24px;
      border: 1px solid var(--border);
      border-radius: 18px;
      overflow: hidden;
    }

    html[data-theme="light"] .diagram-surface {
      background:
        linear-gradient(rgba(201, 90, 45, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(201, 90, 45, 0.08) 1px, transparent 1px),
        #f8fbff;
    }

    .diagram-svg {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      overflow: visible;
      pointer-events: none;
    }

    .diagram-node {
      position: absolute;
      background: #191d21;
      border: 1px solid var(--border);
      border-radius: 16px;
      box-shadow: 0 10px 26px rgba(0, 0, 0, 0.24);
      cursor: grab;
      user-select: none;
      overflow: hidden;
    }

    html[data-theme="light"] .diagram-node {
      background: #ffffff;
    }

    .diagram-node h3 {
      margin: 0;
      font-size: 0.98rem;
    }

    .diagram-node-header {
      padding: 14px 16px 12px;
      border-bottom: 1px solid var(--border);
      background: #20262c;
    }

    html[data-theme="light"] .diagram-node-header {
      background: #edf3f8;
    }

    .diagram-node-header h3 {
      text-transform: none;
      letter-spacing: normal;
      font-variant-caps: normal;
    }

    .diagram-columns {
      display: grid;
      font-size: 0.88rem;
      background: #191d21;
    }

    html[data-theme="light"] .diagram-columns {
      background: #f6f9fc;
    }

    .diagram-column {
      position: relative;
      display: grid;
      grid-template-columns: 14px minmax(0, 1fr) minmax(90px, auto) 14px;
      gap: 10px;
      align-items: center;
      padding: 8px 16px;
      color: var(--muted);
      border-top: 1px solid rgba(47, 55, 64, 0.9);
    }

    html[data-theme="light"] .diagram-column {
      color: var(--muted);
      border-top-color: rgba(31, 41, 55, 0.08);
    }

    .diagram-column strong {
      color: var(--text);
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .diagram-column-type {
      text-align: right;
      font-size: 0.8rem;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .diagram-socket {
      width: 12px;
      height: 12px;
      border-radius: 999px;
      border: 2px solid var(--accent);
      background: #191d21;
      box-shadow: 0 0 0 3px rgba(217, 107, 59, 0.12);
    }

    html[data-theme="light"] .diagram-socket {
      background: #ffffff;
    }

    .diagram-socket.out {
      justify-self: end;
    }

    .diagram-column.is-key .diagram-socket {
      border-color: #4ec08d;
      box-shadow: 0 0 0 3px rgba(78, 192, 141, 0.16);
    }

    .diagram-column.is-related {
      background: rgba(217, 107, 59, 0.08);
    }

    html[data-theme="light"] .diagram-column.is-related {
      background: rgba(201, 90, 45, 0.08);
    }

    .diagram-link {
      stroke: #d96b3b;
      stroke-width: 2.5;
      fill: none;
      opacity: 0.95;
    }

    .diagram-link-label {
      fill: #ffc7a8;
      font-size: 11px;
      text-anchor: middle;
    }

    html[data-theme="light"] .diagram-link-label {
      fill: #c95a2d;
    }

    .diagram-node.dragging {
      cursor: grabbing;
      box-shadow: 0 20px 40px rgba(217, 107, 59, 0.18);
      border-color: var(--accent);
    }

    @media (max-width: 860px) {
      .grid,
      .meta {
        grid-template-columns: 1fr;
      }

      .hero-inner {
        grid-template-columns: 1fr;
        justify-items: start;
      }

      .page {
        width: min(100% - 20px, 1120px);
        margin: 16px auto 28px;
      }

      .hero,
      .panel {
        padding: 18px;
      }

      .modal {
        width: min(1100px, 100%);
        max-height: min(86vh, 900px);
      }

      .site-footer {
        width: min(100% - 20px, 1120px);
        margin-bottom: 22px;
      }
    }
