:root {
  color-scheme: light;
  --page: #f5f7f6;
  --surface: #ffffff;
  --surface-2: #edf1ef;
  --surface-3: #dde4df;
  --header: #f4bfa5;
  --header-strong: #e98e67;
  --text: #17201c;
  --muted: #62706a;
  --line: #d8dfda;
  --line-strong: #9eaaa4;
  --sql: #2a7e8c;
  --graphic: #a04a81;
  --algebra: #5c589c;
  --run: #f29b72;
  --cyan: #58c3dc;
  --green: #17bd4c;
  --yellow: #e5d500;
  --red: #f25757;
  --venn-left: #43d352;
  --venn-right: #f2bda5;
  --shadow: 0 18px 45px rgba(23, 32, 28, 0.12);
  --soft-shadow: 0 8px 24px rgba(23, 32, 28, 0.08);
  --radius: 8px;
  --font-ui: "Segoe UI", "Trebuchet MS", Verdana, sans-serif;
  --font-mono: "Cascadia Code", "Consolas", "Courier New", monospace;
}

body.theme-dark {
  color-scheme: dark;
  --page: #121716;
  --surface: #1a2220;
  --surface-2: #222c29;
  --surface-3: #2d3935;
  --header: #1f302e;
  --header-strong: #ff9d74;
  --text: #edf4ef;
  --muted: #a9b8b0;
  --line: #33413d;
  --line-strong: #5b6a65;
  --sql: #55d2e4;
  --graphic: #f0a0d4;
  --algebra: #9d98e5;
  --run: #d97957;
  --cyan: #4db7d4;
  --green: #26ca63;
  --yellow: #d9cf32;
  --red: #ff6b6b;
  --venn-left: #32be5a;
  --venn-right: #e58d6d;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
  --soft-shadow: 0 10px 26px rgba(0, 0, 0, 0.24);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 14px;
  letter-spacing: 0;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-header {
  min-height: 72px;
  display: grid;
  grid-template-columns: minmax(132px, 190px) 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 10px 24px 18px;
  position: sticky;
  top: 0;
  z-index: 40;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.24), transparent 42%),
    var(--header);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}

.brand {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  text-decoration: none;
}

.brand img {
  width: 92px;
  height: auto;
  display: block;
}

.app-version {
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 10px;
  font-weight: 700;
  color: var(--text);
  opacity: 0.6;
  margin-left: 6px;
  user-select: none;
  letter-spacing: 0.5px;
  align-self: flex-end;
  margin-bottom: 6px;
  white-space: nowrap;
  cursor: default;
}

.module-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 4vw, 42px);
  min-width: 0;
}

.module-link {
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--text);
  min-height: 36px;
  padding: 6px 8px;
  font-weight: 800;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.48);
  text-decoration: none;
}

.module-link[data-module="sql"] {
  color: var(--sql);
}

.module-link[data-module="graphic"] {
  color: var(--graphic);
}

.module-link[data-module="algebra"] {
  color: var(--algebra);
}

.module-link.is-active {
  border-color: currentColor;
  transform: translateY(-1px);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-button,
.dock-button,
.mini-button,
.command-button,
.database-pill,
.session-button,
.section-toggle,
.module-link {
  transition:
    transform 140ms ease,
    background-color 140ms ease,
    border-color 140ms ease,
    color 140ms ease,
    box-shadow 140ms ease;
}

.icon-button:hover,
.dock-button:hover,
.mini-button:hover,
.command-button:hover,
.database-pill:hover,
.session-button:hover,
.section-toggle:hover,
.module-link:hover {
  transform: translateY(-1px);
}

.theme-toggle {
  position: relative;
  width: 38px;
  height: 38px;
  border: 0;
  background: transparent;
}

.theme-mark,
.theme-mark::before {
  display: block;
  border-radius: 999px;
}

.theme-mark {
  width: 18px;
  height: 18px;
  margin: auto;
  background: #07110e;
  position: relative;
}

.theme-mark::before {
  content: "";
  width: 18px;
  height: 18px;
  position: absolute;
  left: 6px;
  top: -4px;
  background: var(--header);
}

body.theme-dark .theme-mark {
  background: #f1d169;
  box-shadow: 0 0 16px rgba(241, 209, 105, 0.35);
}

body.theme-dark .theme-mark::before {
  transform: scale(0);
}

.session-button {
  min-height: 34px;
  border: 0;
  border-radius: 999px;
  padding: 0 20px;
  color: #ffffff;
  font-weight: 800;
}

.session-button.login {
  background: var(--green);
}

.session-button.register {
  background: var(--cyan);
}

.history-dock {
  position: absolute;
  right: 18px;
  bottom: -35px;
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 16px 12px 20px;
  background: var(--header);
  border-bottom-left-radius: 26px;
  box-shadow: var(--soft-shadow);
}

.history-dock::before {
  content: "";
  position: absolute;
  top: 0;
  left: -22px;
  width: 24px;
  height: 24px;
  background: radial-gradient(circle at 0 100%, transparent 23px, var(--header) 24px);
}

.dock-button {
  width: 34px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  color: var(--text);
  font-size: 0;
  font-weight: 900;
}

.dock-button::before {
  font-size: 24px;
  line-height: 1;
}

#undoButton::before {
  content: "\21B6";
}

#redoButton::before {
  content: "\21B7";
}

.dock-button:hover {
  background: rgba(255, 255, 255, 0.44);
}

.app-layout {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(210px, 248px) minmax(420px, 1fr) minmax(264px, 330px);
  gap: 16px;
  padding: 22px 16px 18px;
  min-height: calc(100vh - 72px);
}

.database-panel,
.snippets-panel,
.output-panel,
.metadata-panel,
.editor-shell,
.venn-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--soft-shadow);
}

.database-panel {
  border-radius: 0 var(--radius) var(--radius) 0;
  min-height: 640px;
  overflow: hidden;
}

.panel-heading,
.snippets-header,
.result-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.panel-heading {
  padding: 12px 12px 8px;
  font-weight: 800;
}

.tree-search {
  padding: 0 10px 10px;
}

.tree-search input,
.snippets-header input,
.snippet-form input,
.snippet-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text);
  outline: 0;
}

.tree-search input,
.snippets-header input {
  min-height: 34px;
  padding: 0 10px;
}

.tree-search input:focus,
.snippets-header input:focus,
.snippet-form input:focus,
.snippet-form textarea:focus,
#sqlEditor:focus {
  border-color: var(--sql);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--sql) 18%, transparent);
}

.database-tree {
  padding: 0 0 16px;
  overflow: auto;
  max-height: calc(100vh - 180px);
}

.tree-list,
.tree-children {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tree-item {
  position: relative;
}

.tree-row {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  display: grid;
  grid-template-columns: 18px 18px minmax(0, 1fr);
  align-items: center;
  gap: 5px;
  min-height: 25px;
  padding: 2px 8px;
  text-align: left;
}

.tree-row:hover,
.tree-row.is-active {
  background: color-mix(in srgb, var(--sql) 14%, transparent);
}

.tree-children {
  margin-left: 18px;
}

.tree-expander {
  width: 15px;
  height: 15px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  line-height: 1;
}

.tree-expander.is-leaf {
  border-color: transparent;
  background: transparent;
}

.tree-icon {
  width: 16px;
  height: 16px;
  display: inline-block;
  border-radius: 3px;
  position: relative;
}

.tree-icon.database {
  border: 1px solid color-mix(in srgb, var(--sql) 70%, #ffffff);
  background: linear-gradient(#dbf3ef, #8bd3c9);
}

.tree-icon.table {
  border: 1px solid #7ba7c2;
  background:
    linear-gradient(90deg, transparent 31%, rgba(0, 0, 0, 0.16) 32%, rgba(0, 0, 0, 0.16) 34%, transparent 35%),
    linear-gradient(180deg, transparent 31%, rgba(0, 0, 0, 0.16) 32%, rgba(0, 0, 0, 0.16) 34%, transparent 35%),
    #b9dbef;
}

.tree-icon.column {
  border-left: 4px solid var(--yellow);
  background: var(--surface-3);
}

.tree-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace {
  display: grid;
  grid-template-rows: auto auto minmax(330px, 1fr) minmax(170px, 0.56fr);
  gap: 10px;
  min-width: 0;
}

.sql-toolbar {
  display: grid;
  grid-template-columns: minmax(110px, 190px) 1fr;
  gap: 12px;
  align-items: center;
}

.database-pill {
  min-width: 0;
  max-width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 999px;
  padding: 0 24px;
  background: var(--run);
  color: #1e1713;
  font-size: 22px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.command-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.command-button,
.mini-button {
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--text);
  font-weight: 600;
}

.command-button {
  min-height: 36px;
  padding: 0 20px;
  background: color-mix(in srgb, var(--run) 72%, #ffffff);
}

.command-button.primary {
  background: var(--run);
}

.command-button.ghost {
  background: var(--surface-2);
  border-color: var(--line);
}

.command-button:hover,
.mini-button:hover {
  border-color: color-mix(in srgb, var(--text) 22%, transparent);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
}

.file-command {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#sqlImport {
  width: 1px;
  height: 1px;
  opacity: 0;
  position: absolute;
  pointer-events: none;
}

.venn-toggle.is-active {
  background: var(--cyan);
}

.venn-panel {
  border-radius: 28px;
  overflow: hidden;
}

.venn-stage {
  position: relative;
  min-height: 250px;
  border: 3px solid color-mix(in srgb, var(--sql) 70%, #000000);
  border-radius: 28px;
  background: var(--surface);
  overflow: hidden;
}

.venn-diagram {
  height: 100%;
  min-height: 250px;
  position: relative;
  transform: scale(var(--venn-scale));
  transform-origin: center;
  transition: transform 160ms ease;
}

.venn-circle {
  width: min(30vw, 230px);
  max-width: 240px;
  aspect-ratio: 1;
  border: 3px solid color-mix(in srgb, var(--sql) 65%, #000000);
  border-radius: 999px;
  position: absolute;
  top: 48px;
  display: grid;
  place-items: center;
  font-weight: 900;
  color: #10201a;
}

.venn-left {
  left: calc(50% - 210px);
  background: color-mix(in srgb, var(--venn-left) 92%, #ffffff);
}

.venn-right {
  right: calc(50% - 210px);
  background: color-mix(in srgb, var(--venn-right) 92%, #ffffff);
}

.venn-intersection {
  position: absolute;
  left: 50%;
  top: 126px;
  transform: translateX(-50%);
  border: 0;
  border-radius: 999px;
  padding: 8px 16px;
  background: color-mix(in srgb, var(--venn-left) 46%, var(--venn-right));
  color: #0f1714;
  font-weight: 900;
  box-shadow: var(--soft-shadow);
}

.join-tooltip {
  position: absolute;
  left: 50%;
  top: 164px;
  transform: translateX(-50%);
  width: min(380px, calc(100% - 32px));
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  display: none;
  z-index: 3;
}

.join-tooltip.is-visible {
  display: block;
}

.venn-mode,
.venn-zoom {
  position: absolute;
  z-index: 4;
  border: 0;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--text);
  font-size: 0;
  display: grid;
  place-items: center;
}

.venn-mode {
  width: 24px;
  height: 24px;
  top: 14px;
}

.venn-mode::before,
.venn-zoom::before {
  font-size: 13px;
  font-weight: 900;
}

#simpleVenn {
  right: 70px;
}

#simpleVenn::before {
  content: "\25CF\25CF";
}

#tableVenn {
  right: 36px;
}

#tableVenn::before {
  content: "\25A6";
}

.venn-mode.is-active {
  background: var(--cyan);
}

.venn-zoom {
  width: 23px;
  height: 23px;
  bottom: 12px;
}

#zoomOut {
  right: 54px;
}

#zoomIn {
  right: 88px;
}

#zoomOut::before {
  content: "-";
}

#zoomIn::before {
  content: "+";
}

.venn-table-view {
  min-height: 250px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 52px 28px 28px;
}

.venn-table-view div {
  border: 1px solid var(--line);
  border-top: 8px solid var(--sql);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 16px;
}

.venn-table-view div:nth-child(1) {
  border-top-color: var(--venn-left);
}

.venn-table-view div:nth-child(2) {
  border-top-color: color-mix(in srgb, var(--venn-left) 50%, var(--venn-right));
}

.venn-table-view div:nth-child(3) {
  border-top-color: var(--venn-right);
}

.venn-table-view strong,
.venn-table-view span {
  display: block;
}

.venn-table-view span {
  color: var(--muted);
  margin-top: 8px;
}

.editor-shell {
  border-radius: var(--radius);
  min-height: 330px;
  display: grid;
  grid-template-rows: 38px minmax(260px, 1fr);
  overflow: hidden;
}

.tab-strip {
  display: flex;
  align-items: end;
  gap: 2px;
  padding: 0 12px;
  background: var(--page);
  border-bottom: 1px solid var(--line-strong);
  overflow: auto hidden;
}

.editor-tab,
.add-tab {
  height: 31px;
  border: 1px solid var(--line-strong);
  border-bottom: 0;
  border-radius: 7px 7px 0 0;
  background: var(--surface-2);
  color: var(--text);
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 180px;
  cursor: pointer;
  user-select: none;
}

.editor-tab.is-active {
  background: var(--surface);
  height: 35px;
}

.tab-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.close-tab {
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0;
  padding: 0;
}

.close-tab::before {
  content: "x";
  font-size: 12px;
  font-weight: 900;
}

.close-tab:hover {
  background: var(--red);
  color: #ffffff;
}

.add-tab {
  width: 32px;
  justify-content: center;
  font-weight: 900;
  padding: 0;
}

#sqlEditor {
  width: 100%;
  height: 100%;
  min-height: 292px;
  resize: none;
  border: 0;
  outline: 0;
  padding: 18px 18px 18px 54px;
  background:
    linear-gradient(90deg, var(--surface-2) 0 40px, transparent 40px),
    repeating-linear-gradient(var(--surface), var(--surface) 27px, color-mix(in srgb, var(--line) 46%, transparent) 28px);
  color: var(--text);
  font-family: var(--font-mono);
  line-height: 28px;
  tab-size: 2;
}

.result-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(260px, 0.9fr);
  gap: 10px;
  min-height: 170px;
}

.output-panel,
.metadata-panel {
  border-radius: 26px;
  overflow: hidden;
  min-width: 0;
}

.result-heading {
  padding: 12px 18px 6px 24px;
}

.result-heading h2,
.snippets-header h2,
.modal h2 {
  margin: 0;
  font-size: 17px;
}

.output-content,
.metadata-content {
  padding: 8px 18px 18px;
  max-height: 310px;
  overflow: auto;
}

.empty-state {
  color: var(--muted);
  padding: 10px 0;
}

.execution-block {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-2);
  margin-bottom: 10px;
}

.execution-block header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  background: var(--surface-3);
  font-weight: 800;
}

.execution-block pre {
  margin: 0;
  padding: 10px 12px;
  white-space: pre-wrap;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.45;
}

.status-ok {
  color: color-mix(in srgb, var(--green) 70%, var(--text));
}

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

.result-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.result-table th,
.result-table td {
  border: 1px solid var(--line);
  padding: 7px 9px;
  text-align: left;
}

.result-table th {
  background: var(--surface-3);
}

.metadata-list {
  display: grid;
  gap: 8px;
}

.metadata-item {
  border-left: 4px solid var(--sql);
  background: var(--surface-2);
  border-radius: 6px;
  padding: 8px 10px;
}

.metadata-item strong {
  display: block;
  margin-bottom: 3px;
}

.snippets-panel {
  border-radius: 30px;
  padding: 12px;
  align-self: start;
  min-height: 560px;
  max-height: calc(100vh - 112px);
  overflow: auto;
}

.snippets-header {
  border-bottom: 1px solid var(--line);
  padding: 0 0 10px;
}

.snippets-header input {
  max-width: 145px;
  border-radius: 999px;
  background: var(--surface-3);
}

.snippet-section {
  padding-top: 10px;
}

.section-title-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.section-toggle {
  width: 100%;
  min-height: 34px;
  padding: 0 0;
  border: 0;
  background: transparent;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 900;
  text-align: left;
}

.section-toggle::before {
  content: "\25BE";
  margin-right: 6px;
  color: var(--muted);
}

.snippet-section.is-collapsed .section-toggle::before {
  content: "\25B8";
}

.section-count {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  min-height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--muted);
  font-size: 12px;
}

.snippet-section.is-collapsed .snippet-list {
  display: none;
}

.snippet-list {
  display: grid;
  gap: 10px;
  padding-top: 6px;
}

.snippet-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  overflow: hidden;
}

.snippet-card header {
  padding: 10px 12px 6px;
}

.snippet-card h3 {
  margin: 0;
  font-size: 15px;
}

.snippet-card p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.snippet-code {
  margin: 0 12px 10px;
  padding: 8px;
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 11px;
  max-height: 88px;
  overflow: auto;
  white-space: pre-wrap;
}

.snippet-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 12px 12px;
}

.mini-button {
  min-height: 27px;
  padding: 0 12px;
  background: var(--surface-2);
  font-size: 12px;
}

.snippet-actions .insert {
  background: var(--cyan);
}

.snippet-actions .info {
  background: color-mix(in srgb, var(--green) 45%, #ffffff);
}

.snippet-actions .edit {
  background: var(--yellow);
}

.snippet-actions .delete {
  background: var(--red);
  color: #ffffff;
}

.create-snippet {
  background: var(--cyan);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(8, 13, 12, 0.54);
}

.modal {
  width: min(720px, 100%);
  max-height: min(760px, calc(100vh - 44px));
  overflow: auto;
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 18px 20px 10px;
  border-bottom: 0;
}

.modal-header .icon-button {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  min-width: 74px;
  min-height: 32px;
}

.modal-header .icon-button:hover {
  background: transparent;
  color: var(--red);
  box-shadow: none;
  transform: none;
}

.snippet-form {
  padding: 18px 20px 20px;
  display: grid;
  gap: 14px;
}

.snippet-form label {
  display: grid;
  gap: 7px;
  font-weight: 800;
}

.snippet-form input,
.snippet-form textarea {
  padding: 10px 12px;
  font-weight: 500;
}

.snippet-form textarea {
  resize: vertical;
  min-height: 86px;
}

#snippetCode {
  font-family: var(--font-mono);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 6px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 90;
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  min-width: min(420px, calc(100vw - 32px));
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--text);
  color: var(--surface);
  text-align: center;
  box-shadow: var(--shadow);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 1180px) {
  .app-layout {
    grid-template-columns: minmax(190px, 226px) minmax(0, 1fr);
  }

  .snippets-panel {
    grid-column: 1 / -1;
    min-height: 260px;
    max-height: none;
    border-radius: 18px;
  }

  .snippet-list {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }
}

@media (max-width: 820px) {
  .app-header {
    grid-template-columns: 1fr;
    justify-items: start;
    gap: 8px;
    padding-bottom: 54px;
  }

  .module-nav,
  .header-actions {
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
  }

  .history-dock {
    left: 16px;
    right: auto;
    bottom: 8px;
    border-radius: 999px;
    padding: 8px 12px;
  }

  .history-dock::before {
    display: none;
  }

  .app-layout {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .database-panel,
  .snippets-panel {
    min-height: 0;
  }

  .database-tree {
    max-height: 260px;
  }

  .sql-toolbar,
  .result-grid,
  .venn-table-view {
    grid-template-columns: 1fr;
  }

  .venn-circle {
    width: 160px;
    top: 58px;
  }

  .venn-left {
    left: calc(50% - 150px);
  }

  .venn-right {
    right: calc(50% - 150px);
  }
}
