:root {
  color-scheme: light;
  --app-height: 100vh;
  --app-width: 100vw;
  --bg: #f6f7f4;
  --ink: #141611;
  --muted: #66706a;
  --line: #dfe4dd;
  --panel: #ffffff;
  --accent: #146c5f;
  --accent-strong: #0f4f47;
  --danger: #b42318;
  --ok: #19703e;
  --code: #101418;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: var(--app-height);
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.auth-shell {
  min-height: var(--app-height);
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-panel {
  width: min(100%, 420px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 16px 45px rgba(20, 22, 17, 0.08);
}

.eyebrow,
.database-name {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
}

.auth-panel h1,
.topbar h1 {
  margin: 0;
}

.ghost {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 8px;
  min-height: 42px;
  padding: 0 12px;
}

.main-tabs {
  display: flex;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(246, 247, 244, 0.88);
}

.main-tabs button {
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 40px;
  padding: 0 16px;
  background: #fff;
  color: var(--ink);
  font-weight: 750;
}

.main-tabs button.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.auth-form {
  margin-top: 22px;
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

input {
  min-height: 48px;
  padding: 0 12px;
}

input:disabled,
textarea:disabled,
button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.auth-form button,
.run {
  border: 0;
  border-radius: 8px;
  min-height: 52px;
  background: var(--accent);
  color: white;
  font-weight: 800;
}

.error,
.status-line.error {
  color: var(--danger);
}

.workbench {
  min-height: var(--app-height);
  display: grid;
  grid-template-rows: auto auto 1fr;
  padding-bottom: env(safe-area-inset-bottom);
}

.workbench.content-open {
  grid-template-columns: minmax(0, 1fr);
}

.workbench.content-open .schema-panel {
  display: none;
}

.app-view {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 14px 10px;
  background: rgba(246, 247, 244, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.topbar h1 {
  font-size: 22px;
  overflow-wrap: anywhere;
}

.editor-zone {
  display: grid;
  gap: 10px;
  padding: 12px 14px;
}

.editor-head,
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

#sqlEditor {
  min-height: 240px;
  resize: vertical;
  padding: 14px;
  background: var(--code);
  color: #ecf4ef;
  border-color: #2f3834;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 16px;
  line-height: 1.55;
  tab-size: 2;
}

.run {
  position: sticky;
  bottom: max(10px, env(safe-area-inset-bottom));
  z-index: 3;
  box-shadow: 0 8px 24px rgba(20, 108, 95, 0.25);
}

.status-line {
  min-height: 30px;
  padding: 0 14px 8px;
  color: var(--muted);
  font-size: 13px;
}

.status-line.ok {
  color: var(--ok);
}

.results {
  padding: 0 14px 24px;
}

.lessons-view {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 16px;
  padding: 14px;
}

.lesson-list {
  position: sticky;
  top: 126px;
  align-self: start;
  display: grid;
  gap: 8px;
  max-height: calc(var(--app-height) - 150px);
  overflow: auto;
}

.lesson-list button {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 8px;
  text-align: left;
}

.lesson-list button.active {
  border-color: var(--accent);
  box-shadow: inset 3px 0 0 var(--accent);
}

.lesson-list span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #eef3ee;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 850;
}

.lesson-list strong {
  min-width: 0;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lesson-article {
  min-width: 0;
  max-width: 880px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
}

.exercises-view {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 16px;
  padding: 14px;
}

.admin-view {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 16px;
  padding: 14px;
}

.exercise-nav {
  position: sticky;
  top: 126px;
  align-self: start;
  display: grid;
  gap: 10px;
  max-height: calc(var(--app-height) - 150px);
}

.exercise-nav select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 0 10px;
}

.exercise-list {
  display: grid;
  gap: 8px;
  overflow: auto;
}

.admin-students {
  position: sticky;
  top: 126px;
  align-self: start;
  display: grid;
  gap: 8px;
  max-height: calc(var(--app-height) - 150px);
  overflow: auto;
}

.admin-students button {
  display: grid;
  gap: 4px;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  text-align: left;
}

.admin-students button.active {
  border-color: var(--accent);
  box-shadow: inset 3px 0 0 var(--accent);
}

.admin-students span {
  color: var(--muted);
  font-size: 12px;
}

.exercise-list button {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 8px;
  text-align: left;
}

.exercise-list button.active {
  border-color: var(--accent);
  box-shadow: inset 3px 0 0 var(--accent);
}

.exercise-list span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #eef3ee;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 850;
}

.exercise-list strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.exercise-workspace {
  display: grid;
  gap: 12px;
  min-width: 0;
  max-width: 980px;
}

.admin-progress {
  min-width: 0;
  display: grid;
  gap: 12px;
  align-content: start;
}

.admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.admin-head h2 {
  margin: 0;
  font-size: 22px;
}

.admin-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.admin-summary div {
  display: grid;
  gap: 4px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.admin-summary strong {
  font-size: 24px;
}

.admin-summary span {
  color: var(--muted);
  font-size: 12px;
}

.admin-task-progress {
  display: grid;
  gap: 10px;
}

.admin-progress-group {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
}

.admin-progress-group summary {
  min-height: 36px;
  font-weight: 800;
}

.admin-progress-group ul {
  display: grid;
  gap: 6px;
  margin: 6px 0 4px;
  padding: 0;
  list-style: none;
}

.admin-progress-group li {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 110px 76px;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
}

.admin-progress-group li span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 28px;
  border-radius: 8px;
  background: #eef3ee;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 850;
}

.admin-progress-group li strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.admin-progress-group li em,
.admin-progress-group li small {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.admin-progress-group li.passed {
  border-color: #bfe3cd;
  background: #f0faf4;
}

.admin-progress-group li.passed em {
  color: var(--ok);
  font-weight: 800;
}

.admin-progress-group li.failed {
  border-color: #f2c1bc;
  background: #fff4f2;
}

.admin-progress-group li.failed em {
  color: var(--danger);
  font-weight: 800;
}

.admin-progress-group li.manual {
  background: #fbfaf7;
}

.exercise-toolbar,
.exercise-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.exercise-toolbar {
  justify-content: space-between;
}

.exercise-prompt,
.exercise-editor,
.exercise-feedback {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.exercise-prompt {
  padding: 18px;
}

.exercise-kicker {
  color: var(--muted);
  font-size: 12px;
}

.exercise-prompt h2 {
  margin: 5px 0 8px;
  font-size: 22px;
}

.exercise-prompt-body {
  margin-top: 12px;
}

.exercise-prompt-body p,
.exercise-prompt-body li {
  line-height: 1.6;
}

.exercise-prompt-body code {
  border-radius: 5px;
  background: #eef3ee;
  padding: 2px 5px;
  color: var(--code);
}

.exercise-editor {
  display: grid;
  gap: 10px;
  padding: 14px;
}

#exerciseSql {
  min-height: 190px;
  resize: vertical;
  padding: 14px;
  background: var(--code);
  color: #ecf4ef;
  border-color: #2f3834;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 16px;
  line-height: 1.55;
}

.exercise-feedback {
  min-height: 44px;
  padding: 12px 14px;
  color: var(--muted);
}

.exercise-feedback.ok {
  border-color: #bfe3cd;
  background: #f0faf4;
  color: var(--ok);
}

.exercise-feedback.error {
  border-color: #f2c1bc;
  background: #fff4f2;
  color: var(--danger);
}

.exercise-feedback.manual {
  border-color: #f2d8a6;
  background: #fff8eb;
  color: #7a4b00;
}

.lesson-meta {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 12px;
}

.lesson-article h2,
.lesson-article h3,
.lesson-article h4 {
  margin: 24px 0 10px;
  line-height: 1.2;
}

.lesson-article h2 {
  margin-top: 0;
  font-size: 26px;
}

.lesson-article h3 {
  font-size: 19px;
}

.lesson-article h4 {
  font-size: 16px;
}

.lesson-article p,
.lesson-article li,
.lesson-article blockquote {
  line-height: 1.65;
}

.lesson-article p {
  margin: 10px 0;
}

.lesson-article ul,
.lesson-article ol {
  padding-left: 22px;
}

.lesson-article code {
  border-radius: 5px;
  background: #eef3ee;
  padding: 2px 5px;
  color: var(--code);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.92em;
}

.lesson-article blockquote {
  margin: 12px 0;
  border-left: 3px solid var(--accent);
  padding: 2px 0 2px 12px;
  color: var(--muted);
}

.lesson-article a {
  color: var(--accent-strong);
}

.code-block {
  position: relative;
  margin: 12px 0;
}

.code-block pre {
  margin: 0;
  overflow: auto;
  border-radius: 8px;
  background: var(--code);
  padding: 14px;
}

.code-block pre code {
  background: transparent;
  padding: 0;
  color: #ecf4ef;
  font-size: 13px;
  line-height: 1.55;
}

.code-action {
  position: absolute;
  top: 8px;
  right: 8px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  min-height: 32px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  backdrop-filter: blur(8px);
}

.empty,
.table-wrap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.empty {
  padding: 18px;
  color: var(--muted);
}

.table-wrap {
  overflow: auto;
  max-height: min(56vh, calc(var(--app-height) - 360px));
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
  font-size: 13px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px;
  text-align: left;
  vertical-align: top;
  max-width: 360px;
  overflow-wrap: anywhere;
}

th {
  position: sticky;
  top: 0;
  background: #eef3ee;
  z-index: 1;
}

.schema-panel {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 10;
  width: min(94vw, 460px);
  padding: 16px;
  background: var(--panel);
  border-left: 1px solid var(--line);
  box-shadow: -18px 0 40px rgba(20, 22, 17, 0.14);
  transform: translateX(105%);
  transition: transform 180ms ease;
  overflow: auto;
}

.schema-panel.open {
  transform: translateX(0);
}

.history-head {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0;
}

.schema-tree {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  font-size: 13px;
}

.tree-node {
  margin: 1px 0;
}

.tree-node summary {
  min-height: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 2px 0;
  font-weight: 650;
  list-style-position: outside;
}

.tree-node summary::-webkit-details-marker {
  color: #6c7670;
}

.tree-children {
  margin-left: 18px;
  border-left: 1px solid #edf0ec;
  padding-left: 8px;
}

.node-label {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 1 1 auto;
}

.node-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.node-label em {
  margin-left: auto;
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
  white-space: nowrap;
}

.node-icon {
  position: relative;
  flex: 0 0 15px;
  width: 15px;
  height: 15px;
  border-radius: 2px;
}

.node-icon.database {
  border: 2px solid #4d82c8;
  border-radius: 50%;
}

.node-icon.schema {
  border: 1px solid #c86800;
  background: #ffb45c;
}

.node-icon.folder,
.node-icon.constraint,
.node-icon.foreign-key,
.node-icon.index,
.node-icon.trigger {
  background: #f08a00;
}

.node-icon.folder::before,
.node-icon.constraint::before,
.node-icon.foreign-key::before,
.node-icon.index::before,
.node-icon.trigger::before {
  content: "";
  position: absolute;
  top: -3px;
  left: 1px;
  width: 8px;
  height: 4px;
  border-radius: 2px 2px 0 0;
  background: #f5a12c;
}

.node-icon.table,
.node-icon.foreign-table,
.node-icon.view,
.node-icon.sequence {
  border: 1px solid #4a90d9;
  background:
    linear-gradient(#4a90d9 0 1px, transparent 1px 6px, #4a90d9 6px 7px, transparent 7px),
    linear-gradient(90deg, #4a90d9 0 1px, transparent 1px 7px, #4a90d9 7px 8px, transparent 8px);
}

.node-icon.column {
  border: 1px solid #4a90d9;
  background: #eef7ff;
}

.node-icon.function {
  border: 1px solid #7f61c6;
  background: #f1ebff;
}

.tree-action {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  flex: 0 0 auto;
  min-height: 30px;
  padding: 0 10px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
}

.tree-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.tree-list li,
.tree-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 28px;
  padding: 2px 0;
}

.tree-empty,
.muted {
  color: var(--muted);
}

.history-head {
  margin-top: 18px;
}

.history-list {
  display: grid;
  gap: 8px;
}

.history-list button {
  display: grid;
  gap: 4px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  text-align: left;
}

.history-list span {
  color: var(--muted);
  font-size: 12px;
}

.history-list strong {
  font-size: 13px;
  overflow-wrap: anywhere;
}

@media (min-width: 900px) {
  .workbench {
    grid-template-columns: minmax(0, 1fr) 360px;
    grid-template-rows: auto auto 1fr;
  }

  .topbar,
  .main-tabs,
  .app-view {
    grid-column: 1;
  }

  .schema-panel {
    position: sticky;
    grid-column: 2;
    grid-row: 1 / span 4;
    width: auto;
    height: var(--app-height);
    transform: none;
    box-shadow: none;
  }

  #schemaToggle,
  #closeSchema {
    display: none;
  }
}

@media (max-width: 899px) {
  body {
    overflow-x: hidden;
  }

  .auth-shell {
    align-items: start;
    padding: max(18px, env(safe-area-inset-top)) 14px 18px;
  }

  .auth-panel {
    margin-top: 7vh;
    padding: 20px;
  }

  .workbench {
    display: block;
  }

  .topbar {
    min-height: 64px;
    padding: max(10px, env(safe-area-inset-top)) 12px 8px;
  }

  .main-tabs {
    position: sticky;
    top: 64px;
    z-index: 3;
    padding: 8px 10px;
  }

  .main-tabs button {
    flex: 1 1 0;
    min-height: 42px;
  }

  .topbar h1 {
    font-size: 20px;
  }

  .database-name {
    max-width: calc(100vw - 126px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .ghost {
    min-height: 40px;
    padding: 0 10px;
  }

  .editor-zone {
    gap: 9px;
    padding: 10px 10px 12px;
  }

  #sqlEditor {
    min-height: clamp(180px, calc(var(--app-height) * 0.34), 320px);
    max-height: calc(var(--app-height) - 260px);
    font-size: 16px;
  }

  .run {
    width: 100%;
    min-height: 54px;
  }

  .status-line {
    padding: 0 10px 8px;
  }

  .results {
    padding: 0 10px calc(18px + env(safe-area-inset-bottom));
  }

  .lessons-view {
    display: block;
    padding: 10px;
  }

  .exercises-view {
    display: block;
    padding: 10px;
  }

  .admin-view {
    display: block;
    padding: 10px;
  }

  .exercise-nav {
    position: static;
    display: grid;
    max-height: none;
    margin-bottom: 10px;
  }

  .admin-students {
    position: static;
    display: flex;
    gap: 8px;
    max-height: none;
    margin: 0 -10px 10px;
    overflow-x: auto;
    padding: 0 10px 4px;
    scroll-snap-type: x proximity;
  }

  .admin-students button {
    flex: 0 0 210px;
    scroll-snap-align: start;
  }

  .exercise-list {
    display: flex;
    gap: 8px;
    margin: 0 -10px;
    overflow-x: auto;
    padding: 0 10px 4px;
    scroll-snap-type: x proximity;
  }

  .exercise-list button {
    grid-template-columns: 30px 120px auto;
    flex: 0 0 auto;
    width: 230px;
    min-height: 50px;
    scroll-snap-align: start;
  }

  .exercise-list span {
    width: 30px;
    height: 30px;
  }

  .exercise-toolbar {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  #setupCourseBtn {
    grid-column: 1 / -1;
    order: -1;
  }

  .exercise-prompt,
  .exercise-editor {
    padding: 14px;
  }

  .exercise-prompt h2 {
    font-size: 20px;
  }

  #exerciseSql {
    min-height: clamp(170px, calc(var(--app-height) * 0.28), 300px);
  }

  .exercise-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .admin-head {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-summary {
    grid-template-columns: 1fr;
  }

  .admin-progress-group li {
    grid-template-columns: 32px minmax(0, 1fr);
  }

  .admin-progress-group li em,
  .admin-progress-group li small {
    grid-column: 2;
  }

  .lesson-list {
    position: static;
    display: flex;
    gap: 8px;
    max-height: none;
    margin: 0 -10px 10px;
    overflow-x: auto;
    padding: 0 10px 4px;
    scroll-snap-type: x proximity;
  }

  .lesson-list button {
    grid-template-columns: 30px 172px;
    flex: 0 0 auto;
    width: 230px;
    min-height: 50px;
    scroll-snap-align: start;
  }

  .lesson-list span {
    width: 30px;
    height: 30px;
  }

  .lesson-article {
    max-width: none;
    padding: 16px;
  }

  .lesson-article h2 {
    font-size: 22px;
  }

  .lesson-article h3 {
    font-size: 17px;
  }

  .code-block pre {
    padding: 46px 12px 12px;
  }

  .code-action {
    left: 8px;
    right: auto;
  }

  .table-wrap {
    max-height: clamp(220px, calc(var(--app-height) * 0.45), 520px);
  }

  table {
    min-width: 680px;
  }

  th,
  td {
    padding: 9px;
  }

  .schema-panel {
    inset: 0;
    width: 100vw;
    max-width: none;
    padding: max(14px, env(safe-area-inset-top)) 14px calc(18px + env(safe-area-inset-bottom));
    border-left: 0;
    transform: translateX(100%);
  }

  .schema-panel.open {
    transform: translateX(0);
  }

  .panel-head {
    position: sticky;
    top: 0;
    z-index: 2;
    min-height: 52px;
    margin: -14px -14px 0;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(12px);
  }

  .schema-tree {
    padding-top: 12px;
  }

  .tree-node summary {
    min-height: 36px;
  }

  .tree-children {
    margin-left: 14px;
    padding-left: 7px;
  }

  .tree-list li,
  .tree-row {
    min-height: 34px;
  }

  .tree-action {
    min-height: 34px;
  }

  .history-list button {
    min-height: 52px;
  }
}

@media (max-width: 420px) {
  .topbar h1 {
    font-size: 18px;
  }

  .auth-panel {
    padding: 18px;
  }

  #sqlEditor {
    min-height: clamp(160px, calc(var(--app-height) * 0.31), 260px);
    padding: 12px;
  }

  .node-label em {
    max-width: 92px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (max-height: 620px) and (max-width: 899px) {
  .auth-panel {
    margin-top: 0;
  }

  .topbar {
    min-height: 56px;
  }

  .main-tabs {
    top: 56px;
  }

  #sqlEditor {
    min-height: 150px;
  }

}

@media (orientation: landscape) and (max-width: 899px) {
  .topbar {
    position: static;
  }

  .main-tabs {
    top: 0;
  }

  #sqlEditor {
    min-height: 140px;
    max-height: 220px;
  }

  .table-wrap {
    max-height: 320px;
  }
}
