:root {
  font: 14px/1.6 system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #213349;
  background: #f4f7fb;
  --blue: #1d63d8;
  --border: #dce4ee;
}
.schema-dialog {
  width: min(1040px, 96vw);
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: 0 18px;
}
.form-grid label select,
.form-grid label input,
.schema-dialog label textarea {
  width: 100%;
  display: block;
}
.schema-dialog select {
  max-width: 100%;
}
.column-box {
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 14px;
  margin: 12px 0;
}
.schema-dialog .inline input {
  width: auto;
  display: inline;
}
.schema-dialog .actions {
  justify-content: flex-end;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
select[multiple] {
  width: 100%;
  max-width: 100%;
}
.filter-group {
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 12px;
  margin: 8px 0;
  background: #f8faff;
}
.filter-child {
  border-left: 3px solid #cadcf8;
  padding: 8px 12px;
  margin: 10px 0;
  background: white;
}
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  min-width: 140px;
}
.field-options {
  flex-wrap: wrap;
}
.field-options select {
  max-width: 100%;
}
button {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: white;
  color: #213349;
  padding: 7px 13px;
  cursor: pointer;
}
button:hover {
  background: #edf3fc;
  border-color: #91b3e9;
}
button:disabled {
  opacity: 0.5;
  cursor: default;
}
.primary {
  background: var(--blue);
  color: white;
  border-color: var(--blue);
}
.primary:hover {
  background: #174fab;
}
.danger {
  color: #b82828;
}
input,
select,
textarea {
  border: 1px solid #ccd6e4;
  border-radius: 6px;
  padding: 8px 10px;
  background: white;
  color: inherit;
}
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid #9fc3ff;
  outline-offset: 1px;
}
label {
  display: block;
  margin: 12px 0;
}
label input:not([type="checkbox"]),
label textarea {
  display: block;
  width: 100%;
  margin-top: 5px;
}
input[type="checkbox"] {
  accent-color: var(--blue);
}
textarea {
  resize: vertical;
}
.brand {
  font-size: 19px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo {
  background: var(--blue);
  color: white;
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  font-size: 23px;
}
.badge {
  font-size: 11px;
  font-weight: 400;
  background: #e9effc;
  border-radius: 4px;
  padding: 2px 7px;
  color: #4b68a1;
}
.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: radial-gradient(ellipse at top, #dfeaff, transparent 65%);
}
.login-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 38px;
  width: min(430px, 92vw);
  box-shadow: 0 18px 60px #183b6b0b;
}
.login-card h1 {
  font-size: 25px;
  margin: 28px 0 4px;
}
.login-card .primary {
  width: 100%;
  margin-top: 12px;
}
.muted {
  color: #728198;
}
.small {
  font-size: 12px;
}
.error {
  color: #b32727;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
header {
  height: 65px;
  border-bottom: 1px solid var(--border);
  background: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 25px;
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 5;
}
aside {
  position: fixed;
  top: 65px;
  bottom: 0;
  width: 245px;
  background: #fff;
  border-right: 1px solid var(--border);
  overflow: auto;
  padding: 16px;
}
.sidebar-title {
  font-size: 12px;
  font-weight: 700;
  color: #728198;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 10px 0;
}
aside input {
  width: 100%;
  padding: 6px 9px;
  font-size: 12px;
}
nav {
  margin-top: 8px;
}
nav button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 7px 9px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
nav button.active {
  background: #eaf1ff;
  color: #1a5cc7;
  font-weight: 600;
}
main {
  margin-left: 245px;
  padding: 88px 26px 40px;
}
.breadcrumb {
  font-size: 13px;
  color: #6c7c92;
  margin-bottom: 15px;
  overflow-wrap: anywhere;
}
.tabs {
  display: flex;
  gap: 5px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.tabs button {
  border-color: transparent;
  background: transparent;
}
.tabs .active {
  background: #e5edfc;
  color: var(--blue);
}
h1,
h2 {
  line-height: 1.3;
}
h2 {
  font-size: 21px;
  margin: 0 0 15px;
}
.card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 22px;
  margin-bottom: 20px;
}
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr));
  gap: 18px;
}
.cards .card {
  margin: 0;
}
.stat {
  overflow-wrap: anywhere;
  font-size: 23px;
  font-weight: 650;
  color: #275ea9;
}
.toolbar,
.actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin: 12px 0;
}
.toolbar input {
  min-width: 80px;
}
.spacer {
  flex: 1;
}
.table-wrap {
  overflow: auto;
  max-height: 65vh;
  background: white;
  border: 1px solid var(--border);
  border-radius: 7px;
  margin-bottom: 15px;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
}
th,
td {
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid #e8edf4;
  max-width: 420px;
  min-width: 80px;
  overflow-wrap: anywhere;
}
td {
  white-space: pre-wrap;
  vertical-align: top;
}
th {
  background: #edf2f9;
  position: sticky;
  top: 0;
  white-space: nowrap;
  z-index: 1;
}
tbody tr:hover {
  background: #f4f8ff;
}
.null {
  color: #9ca8b7;
  font-style: italic;
}
.binary {
  color: #7b5ab1;
  font-family: monospace;
}
.sql-editor {
  width: 100%;
  min-height: 240px;
  font: 14px/1.7 ui-monospace, SFMono-Regular, Consolas, monospace;
  tab-size: 2;
}
.code {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: 13px/1.7 ui-monospace, monospace;
  background: #f0f4fa;
  padding: 16px;
  border-radius: 7px;
}
.warn {
  background: #fff7e6;
  color: #805313;
  border: 1px solid #f2d8a9;
  border-radius: 7px;
  padding: 12px 16px;
  margin: 12px 0;
}
#notice {
  border-radius: 7px;
  padding: 12px 16px;
  background: #e5f1ff;
  white-space: pre-wrap;
  margin-bottom: 18px;
  overflow-wrap: anywhere;
}
#notice.error {
  background: #fceaea;
  color: #a12828;
}
dialog {
  width: min(760px, 95vw);
  max-height: 90vh;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 25px;
}
dialog::backdrop {
  background: #112d4e66;
}
.field {
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
}
.field-head {
  display: flex;
  gap: 12px;
  align-items: center;
}
.field-head label {
  margin: 0;
}
.field textarea {
  width: 100%;
  height: 65px;
  font: 13px/1.5 monospace;
}
.field small {
  color: #728198;
}
.field-options {
  display: flex;
  gap: 14px;
  align-items: center;
}
.field-options label {
  margin: 5px 0;
}
.inline {
  display: inline-block;
  margin: 0 8px 0 0;
}
.table-link {
  border: 0;
  color: var(--blue);
  padding: 0;
  background: none;
  font-weight: 600;
}
.table-wrap button {
  padding: 3px 7px;
  margin-right: 4px;
  font-size: 12px;
}
details {
  margin: 12px 0;
}
summary {
  cursor: pointer;
  color: var(--blue);
}
a {
  color: var(--blue);
}
[hidden] {
  display: none !important;
}
@media (max-width: 800px) {
  header {
    padding: 0 12px;
  }
  .brand {
    font-size: 15px;
  }
  .badge {
    display: none;
  }
  aside {
    width: 185px;
    padding: 10px;
  }
  main {
    margin-left: 185px;
    padding: 82px 12px 30px;
  }
  .card {
    padding: 14px;
  }
}
@media (max-width: 540px) {
  header .brand {
    font-size: 13px;
  }
  aside {
    position: static;
    width: auto;
    margin-top: 65px;
    max-height: 240px;
    border-bottom: 1px solid var(--border);
  }
  aside nav {
    display: flex;
    flex-wrap: wrap;
  }
  nav button {
    width: auto;
    max-width: 100%;
  }
  aside .sidebar-title {
    margin: 5px 0;
  }
  main {
    margin: 0;
    padding: 16px 10px;
  }
  #username {
    display: none;
  }
  .tabs {
    gap: 0;
  }
  .tabs button {
    padding: 6px 9px;
  }
  .toolbar input,
  .toolbar select {
    max-width: 100%;
  }
}

.object-form textarea {
  width: 100%;
  max-width: 100%;
}
.object-form .form-grid label {
  min-width: 0;
}

.account-fields textarea,
.account-fields select[multiple] {
  width: 100%;
  max-width: 100%;
}
.account-dialog h2 {
  overflow-wrap: anywhere;
}
.account-fields .form-grid label {
  min-width: 0;
}
.privilege-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr));
  gap: 8px;
  max-height: 320px;
  overflow: auto;
  padding: 10px 0;
}

.server-workspace label {
  min-width: 0;
  max-width: 100%;
}
.server-charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr));
  gap: 16px;
}
.server-chart {
  margin: 0 0 16px;
  min-width: 0;
}
.server-chart svg {
  display: block;
  width: 100%;
  height: auto;
}
.server-workspace .toolbar label input:not([type="checkbox"]) {
  max-width: 100%;
}

.partition-form .form-grid label {
  min-width: 0;
}
.partition-form select[multiple] {
  width: 100%;
  max-width: 100%;
}
.partition-workspace label {
  max-width: 100%;
}
.partition-options summary {
  cursor: pointer;
  color: var(--blue);
}
.partition-element h3,
.subpartition-element h3 {
  margin-top: 0;
}

#personal-nav {
  margin: 12px 0;
}
#personal-nav details {
  margin: 8px 0;
}
#personal-nav button {
  display: block;
  width: 100%;
  text-align: left;
  overflow-wrap: anywhere;
}
.personal-bookmark pre {
  max-height: 220px;
  overflow: auto;
}
.personal-settings > .card {
  margin: 14px 0;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  color: #dbe5f3;
  background: #142032;
  --border: #42516a;
  --blue: #87b4ff;
}
:root[data-theme="dark"] .card,
:root[data-theme="dark"] dialog,
:root[data-theme="dark"] aside,
:root[data-theme="dark"] header {
  color: #dbe5f3;
  background: #1c2a40;
}
:root[data-theme="dark"] input,
:root[data-theme="dark"] textarea,
:root[data-theme="dark"] select,
:root[data-theme="dark"] button {
  background: #24344e;
  color: #e0eafd;
  border-color: #526686;
}
:root[data-theme="dark"] th {
  background: #293d59;
  color: #e0eafd;
}
:root[data-theme="dark"] .muted {
  color: #abc0dc;
}
:root[data-theme="dark"] .warn {
  background: #422f19;
  color: #ffd69a;
}
:root[data-theme="dark"] .code {
  background: #142032;
  color: #c5dbfa;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] {
    color: #dbe5f3;
    background: #142032;
    --border: #42516a;
    --blue: #87b4ff;
  }
  :root[data-theme="system"] .card,
  :root[data-theme="system"] dialog,
  :root[data-theme="system"] aside,
  :root[data-theme="system"] header {
    background: #1c2a40;
    color: #dbe5f3;
  }
  :root[data-theme="system"] input,
  :root[data-theme="system"] textarea,
  :root[data-theme="system"] select,
  :root[data-theme="system"] button {
    background: #24344e;
    color: #e0eafd;
    border-color: #526686;
  }
  :root[data-theme="system"] th {
    background: #293d59;
    color: #e0eafd;
  }
  :root[data-theme="system"] .muted {
    color: #abc0dc;
  }
  :root[data-theme="system"] .warn {
    background: #422f19;
    color: #ffd69a;
  }
  :root[data-theme="system"] .code {
    background: #142032;
    color: #c5dbfa;
  }
}
:root[data-theme="dark"] aside,
:root[data-theme="dark"] dialog,
:root[data-theme="dark"] .login-card {
  background: #1d2d44;
  color: #dbe5f3;
}
:root[data-theme="dark"] tr:hover td {
  background: #263b57;
}
:root[data-theme="dark"] summary {
  color: #9bc5ff;
}
:root[data-theme="dark"] button.active {
  background: #375984;
  color: #fff;
}
:root[data-theme="dark"] button.primary {
  background: #2664c9;
  color: #fff;
}
:root[data-theme="dark"] .error {
  color: #ffb0b0;
}
:root[data-theme="dark"] .success {
  color: #84e4ae;
}
:root[data-theme="dark"] #notice {
  background: #263d5b;
  color: #dbe5f3;
}
:root[data-theme="dark"] #notice.error {
  background: #49282b;
  color: #ffb0b0;
}
.query-builder .qbe-expression,
.query-builder .qbe-limits {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
}
.query-builder .qbe-expression > label {
  flex: 1 1 180px;
  min-width: 0;
}
.query-builder .card {
  margin: 12px 0;
}
.query-builder .qbe-condition {
  padding: 12px;
}
.query-builder select,
.query-builder textarea {
  max-width: 100%;
}
.qbe-generated {
  max-height: 500px;
  overflow: auto;
}
.designer-viewport {
  position: relative;
  width: 100%;
  height: 650px;
  max-height: 75vh;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #f0f5fb;
}
.designer-sizer {
  position: relative;
}
.designer-canvas {
  position: relative;
  transform-origin: 0 0;
  background-image: radial-gradient(#b8cbe3 1px, transparent 1px);
  background-size: 20px 20px;
}
.designer-edges {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
}
.designer-edges path[role="button"] {
  pointer-events: stroke;
  cursor: pointer;
  stroke-width: 4px;
}
.designer-edges path[role="button"]:focus,
.designer-edges path[role="button"]:hover {
  stroke: #e58d1d;
}
.designer-node {
  position: absolute;
  width: 300px;
  border: 1px solid #9cb5d5;
  border-radius: 8px;
  background: white;
  overflow: hidden;
  box-shadow: 0 4px 12px #19325015;
}
.designer-node-title {
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  background: #e5eefc;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.designer-node-title button {
  font-weight: 700;
  border: 0;
  background: transparent;
  padding: 3px;
  max-width: 230px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.designer-node-title.dragging,
.designer-note-title.dragging {
  cursor: grabbing;
}
.designer-field {
  height: 24px;
  padding: 2px 9px;
  font-size: 12px;
  line-height: 20px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-top: 1px solid var(--border);
}
.designer-field .muted {
  float: right;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.designer-node-footer {
  height: 30px;
  display: flex;
  justify-content: end;
  align-items: center;
  border-top: 1px solid var(--border);
}
.designer-node-footer button {
  font-size: 11px;
  padding: 1px 6px;
  border: 0;
}
.designer-note {
  position: absolute;
  width: 220px;
  height: 120px;
  border: 1px solid #ba9a43;
  background: #fff0bc;
  border-radius: 6px;
  overflow: hidden;
}
.designer-note-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: grab;
  touch-action: none;
  padding: 4px 8px;
  color: #674c15;
}
.designer-note-title button {
  font-size: 11px;
  padding: 1px 5px;
}
.designer-note-text {
  padding: 4px 10px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: #674c15;
  font-size: 12px;
}
.designer-table-picks,
.designer-visibility {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 14px;
  max-height: 260px;
  overflow: auto;
}
.designer-selection {
  margin: 14px 0;
}
.designer-view > .toolbar {
  margin: 12px 0;
}
.designer-inspector {
  margin: 15px 0;
}
.dictionary-table {
  margin: 18px 0;
}
:root[data-theme="dark"] .designer-viewport,
:root[data-theme="dark"] .designer-node {
  background: #1c2b42;
  color: #dbe5f3;
}
:root[data-theme="dark"] .designer-node-title {
  background: #293e5c;
}
:root[data-theme="dark"] .designer-canvas {
  background-image: radial-gradient(#4c6488 1px, transparent 1px);
}
@media (max-width: 600px) {
  .designer-viewport {
    height: 520px;
  }
}
@media print {
  :root:has(.dictionary-view) {
    color-scheme: light !important;
    color: #111 !important;
    background: #fff !important;
  }
  body:has(.dictionary-view),
  .dictionary-view,
  .dictionary-view .card,
  .dictionary-view td,
  .dictionary-view .muted,
  .dictionary-view .warn {
    color: #111 !important;
    background: #fff !important;
    box-shadow: none !important;
  }
  body:has(.dictionary-view) header,
  body:has(.dictionary-view) aside,
  body:has(.dictionary-view) #tabs,
  body:has(.dictionary-view) #breadcrumb,
  body:has(.dictionary-view) #notice,
  .dictionary-view > .toolbar,
  .dictionary-view > label,
  .dictionary-view > [role="alert"],
  .dictionary-view > details {
    display: none !important;
  }
  body:has(.dictionary-view) main {
    margin: 0;
    padding: 0;
  }
  .dictionary-view .table-wrap {
    overflow: visible;
  }
  .dictionary-view th {
    position: static;
    color: #111 !important;
    background: #edf3fa !important;
  }
  .dictionary-view td,
  .dictionary-view th {
    white-space: normal !important;
    overflow-wrap: anywhere;
    max-width: none;
  }
  .dictionary-view table {
    font-size: 9px;
    white-space: normal;
  }
  .dictionary-view tr {
    break-inside: avoid;
  }
}
@media (max-width: 600px) {
  .query-builder .filter-group {
    padding: 8px;
    margin-left: 0;
  }
  .query-builder .qbe-expression {
    display: block;
  }
}
/* Keep long relation names readable within their own panels. */
.relations-view h2,
.relations-view h4,
.relations-view p,
.relation-dialog h2,
.relation-dialog p,
.dictionary-view h3,
.designer-relations button {
  overflow-wrap: anywhere;
}
.designer-relations button {
  max-width: 100%;
  white-space: normal;
}
.relation-cell {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
.relation-cell button {
  font-size: 12px;
  padding: 3px 6px;
  max-width: 260px;
  white-space: normal;
  overflow-wrap: anywhere;
}
.relation-label {
  max-width: 260px;
  white-space: normal;
  overflow-wrap: anywhere;
}
.relation-dialog label {
  margin: 8px 0;
}
.relation-pairs {
  margin: 12px 0;
}
.relation-check-output .table-wrap {
  max-height: 45vh;
}
.central-view h2,
.central-view h3 {
  overflow-wrap: anywhere;
}
.central-record {
  margin: 12px 0;
}
.central-record pre,
.central-picker pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.central-tables {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  max-height: 28vh;
  overflow: auto;
  margin: 12px 0;
}
#expired-login {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  margin: 12px 0;
}
#expired-login legend {
  max-width: 100%;
  overflow-wrap: anywhere;
}
#connection-status {
  display: inline-block;
  max-width: 300px;
  overflow-wrap: anywhere;
  vertical-align: middle;
}

.spatial-dialog {
  width: min(1000px, 95vw);
}
.spatial-dialog textarea {
  width: 100%;
  min-height: 120px;
  font-family: monospace;
}
.spatial-preview svg {
  display: block;
  width: 100%;
  max-height: 340px;
  background: var(--bg);
  border: 1px solid var(--border);
}
.spatial-point {
  fill: #b95020;
}
.spatial-line {
  fill: none;
  stroke: #1b66ad;
  stroke-width: 2;
}
.spatial-polygon {
  fill: #428ad344;
  stroke: #1b66ad;
  stroke-width: 2;
}
.spatial-summary {
  max-height: 150px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.spatial-coordinates fieldset {
  min-width: 0;
  margin: 8px 0;
  border: 1px solid var(--border);
}
.spatial-coordinate-group {
  border-left: 2px solid var(--border);
  padding-left: 10px;
  margin: 5px 0;
}
.spatial-point-input {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.spatial-point-input label {
  flex: 1 1 130px;
  min-width: 0;
}
.spatial-point-input input {
  width: 100%;
  min-width: 0;
}
.spatial-dialog .toolbar > label {
  min-width: 0;
  flex: 1 1 180px;
}
.spatial-dialog select {
  max-width: 100%;
}

.plot-dialog {
  width: min(1200px, 95vw);
}
.plot-dialog .form-grid {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}
.plot-dialog input,
.plot-dialog select {
  max-width: 100%;
  min-width: 0;
}
.plot-chart {
  position: relative;
  overflow: hidden;
}
.plot-chart svg {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  touch-action: none;
  cursor: grab;
}
.plot-chart svg:active {
  cursor: grabbing;
}
.plot-attribution {
  position: absolute;
  right: 5px;
  bottom: 5px;
  padding: 3px 7px;
  font-size: 11px;
  color: #172b4d;
  background: white;
}
.plot-chart {
  background: white;
}
.plot-chart svg {
  position: relative;
  z-index: 1;
}
.plot-tiles {
  position: absolute;
  left: 0;
  width: 100%;
  overflow: hidden;
  pointer-events: none;
}
.plot-tiles img {
  position: absolute;
  max-width: none;
}
.plot-attribution {
  z-index: 2;
}
.chart-dialog {
  width: min(1200px, 95vw);
}
.chart-dialog .form-grid {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}
.chart-dialog input,
.chart-dialog select {
  min-width: 0;
  max-width: 100%;
}
.chart-view svg {
  width: 100%;
  height: auto;
  background: white;
}
.chart-dialog [role="status"] {
  overflow-wrap: anywhere;
}
.transform-dialog {
  width: min(950px, 95vw);
}
.transform-dialog textarea {
  width: 100%;
  min-height: 100px;
  font: 13px/1.5 monospace;
}
.transform-code {
  margin: 4px 0;
  max-height: 240px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.transform-token {
  color: #135f96;
  font-weight: 600;
}
.transform-hex {
  font-family: monospace;
  overflow-wrap: anywhere;
}
.transform-text {
  white-space: pre-wrap;
}
.transform-image {
  max-width: 100%;
  max-height: 400px;
  object-fit: contain;
  vertical-align: middle;
}
.transform-html {
  width: 100%;
  min-width: 220px;
  height: 220px;
  border: 1px solid var(--border);
  background: white;
}

.tracking-targets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1rem 0;
}
.tracking-version,
.tracking-entry {
  border-top: 1px solid var(--border);
  padding: 1rem 0;
}
.tracking-dialog {
  width: min(1100px, 94vw);
  max-height: 90vh;
  overflow: auto;
}
.tracking-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
}
.tracking-entry pre {
  max-height: 240px;
  overflow: auto;
}

.tracking-dialog {
  overflow-wrap: anywhere;
}
.tracking-dialog > textarea {
  width: 100%;
}
.tracking-entry .toolbar > * {
  min-width: 0;
}

.CodeMirror {
  height: 320px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: 14px/1.7 ui-monospace, SFMono-Regular, Consolas, monospace;
  margin: 12px 0;
}
.CodeMirror.sql-fullscreen {
  position: fixed;
  inset: 0;
  margin: 0;
  height: 100vh;
  width: 100vw;
  z-index: 1000;
  border-radius: 0;
}
.sql-editor-fullscreen {
  overflow: hidden;
}
.CodeMirror-hints {
  z-index: 1100;
  max-width: 90vw;
}
.sql-editor-tools .toolbar {
  align-items: center;
}
.sql-editor-tools .toolbar label {
  margin: 4px 0;
}
.sql-find {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr));
  gap: 12px;
}
.sql-native-hints {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 180px;
  overflow: auto;
}
[data-theme="dark"] .CodeMirror {
  background: #162334;
  color: #dce7f7;
}
[data-theme="dark"] .CodeMirror-gutters {
  background: #18283c;
  border-color: #354761;
}
[data-theme="dark"] .CodeMirror-cursor {
  border-left-color: #f0f5ff;
}
[data-theme="dark"] .cm-s-default .cm-keyword {
  color: #8dbaff;
}
[data-theme="dark"] .cm-s-default .cm-string {
  color: #9bddb4;
}

.sql-binding-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}
.sql-binding-row textarea {
  width: 100%;
  min-height: 70px;
}
.sql-plan-dialog {
  width: min(1100px, 95vw);
  overflow: auto;
  overflow-wrap: anywhere;
}
.sql-plan-node {
  border-left: 2px solid var(--border);
  padding-left: 12px;
  margin: 10px 0;
}
.sql-plan-node summary {
  font-weight: 600;
  cursor: pointer;
}
.sql-plan-node .table-wrap {
  max-height: 360px;
  overflow: auto;
}
.sql-draft-tools {
  margin-block: 0.8rem;
}
.sql-drafts {
  padding: 0.65rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
}
.sql-draft-entry {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0;
  overflow-wrap: anywhere;
  border-bottom: 1px solid var(--border);
}
.sql-draft-entry span {
  flex: 1 1 22rem;
}
.sql-draft-dialog .code {
  max-height: 45vh;
  overflow: auto;
}

.server-advisor {
  min-width: 0;
}
.advisor-finding {
  margin-block: 0.7rem;
  padding: 0.7rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  overflow-wrap: anywhere;
}
.advisor-finding[data-state="fired"] {
  border-color: #b56a14;
}
.advisor-finding .code {
  max-width: 100%;
  overflow: auto;
}
.advisor-exact {
  overflow-wrap: anywhere;
}

.server-logs {
  min-width: 0;
}
.server-logs .table-wrap {
  max-width: 100%;
}
.server-logs td {
  max-width: 24rem;
  overflow-wrap: anywhere;
}
.log-detail-dialog .code {
  max-height: 45vh;
  overflow: auto;
}

.log-snapshots,
.log-snapshot-members {
  min-width: 0;
  overflow-wrap: anywhere;
}
.log-snapshots .table-wrap,
.log-snapshot-members .table-wrap {
  max-width: 100%;
}
.log-snapshots .table-wrap button,
.log-snapshot-members .table-wrap button {
  white-space: nowrap;
}

.server-replication,
.replication-dialog {
  min-width: 0;
  overflow-wrap: anywhere;
}
.server-replication .table-wrap {
  max-width: 100%;
}
.replication-dialog .code,
.replication-config-output .code {
  max-width: 100%;
  overflow: auto;
  max-height: 45vh;
}

#login-server {
  display: block;
  width: 100%;
  margin-top: 4px;
}

.zoom-chart {
  max-width: 100%;
  overflow: auto;
}
.zoom-svg {
  min-width: 400px;
  display: block;
  background: transparent;
  touch-action: none;
}
.zoom-background {
  fill: transparent;
  stroke: var(--border);
}
.zoom-tick {
  fill: currentColor;
  font-size: 11px;
}
.zoom-axis-label {
  fill: currentColor;
  font-size: 14px;
}
.zoom-point {
  fill: #3478df;
  stroke: #fff;
  stroke-width: 1;
  cursor: pointer;
}
.zoom-point:hover,
.zoom-point:focus {
  fill: #e17929;
  stroke: currentColor;
  stroke-width: 2;
  outline: none;
}
.zoom-point-label {
  fill: currentColor;
  font-size: 11px;
  pointer-events: none;
}
.zoom-selection {
  fill: #3478df33;
  stroke: #3478df;
  pointer-events: none;
}
.zoom-point-details {
  margin: 1rem 0;
  overflow: auto;
}
.zoom-search fieldset {
  min-width: 0;
}

.zoom-axis-base {
  overflow-wrap: anywhere;
}
.normalization,
.normalization .card,
.normalization fieldset {
  min-width: 0;
}
.normalization-columns label {
  overflow-wrap: anywhere;
}
.normalization pre {
  max-width: 100%;
  overflow: auto;
}
.normalization .inline {
  display: inline-flex;
  gap: 0.35rem;
  align-items: baseline;
}
.normalization .inline input {
  width: auto;
  display: inline;
}
.normalization-columns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-content: start;
}
.normalization-candidate {
  border-top: 1px solid var(--border);
  padding: 0.6rem 0;
  overflow-wrap: anywhere;
}

.navigation-tree {
  display: block;
  min-width: 0;
}
.navigation-tree details {
  margin: 3px 0;
  padding-left: 8px;
  border-left: 1px solid var(--border);
}
.navigation-tree summary {
  font-size: 12px;
  overflow-wrap: anywhere;
}
.navigation-tree .navigation-object > summary {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
}
.navigation-tree .navigation-object > summary::before {
  content: "▸";
  flex: 0 0 12px;
  cursor: pointer;
}
.navigation-tree .navigation-object[open] > summary::before {
  content: "▾";
}
.navigation-tree summary > button {
  min-width: 0;
  flex: 1;
  width: auto;
  padding: 4px;
}
.navigation-tree .navigation-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px;
}
.navigation-tree .navigation-pager button,
.navigation-tree .navigation-tools button {
  width: auto;
  display: inline-block;
  font-size: 11px;
  padding: 3px;
}
.navigation-tree .navigation-page {
  min-width: 0;
}
.navigation-tree .navigation-category > input {
  margin-top: 5px;
}
.navigation-tree p {
  margin: 3px 0;
  overflow-wrap: anywhere;
}
.navigation-tree button:focus-visible,
.navigation-tree summary:focus-visible {
  outline: 2px solid #377cdd;
  outline-offset: 1px;
}
.navigation-target {
  outline: 2px solid #377cdd;
  outline-offset: -2px;
}
@media (max-width: 540px) {
  aside .navigation-tree {
    display: block;
  }
  .navigation-tree button {
    width: 100%;
  }
  .navigation-tree summary > button {
    width: auto;
  }
}
.navigation-tree .navigation-hide {
  flex: 0 0 auto;
  width: auto;
  font-size: 10px;
  padding: 2px 3px;
  opacity: 0.65;
}
.navigation-tree .navigation-hide:hover,
.navigation-tree .navigation-hide:focus-visible {
  opacity: 1;
}
.navigation-tree .navigation-category > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.navigation-tree .navigation-leaf {
  display: flex;
  align-items: center;
  min-width: 0;
}
.navigation-tree .navigation-leaf > button:first-child {
  flex: 1;
  min-width: 0;
}
.navigation-hidden-record {
  padding: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  overflow-wrap: anywhere;
}
