:root {
  --ath-font-code: "geist-mono", ui-monospace, "Cascadia Code", Consolas, monospace;
  --ath-topbar-h: 48px;
  --ath-status-h: 26px;
  --ath-grid-head: var(--orb-surface-alt);
  --ath-syn-k: #7c3aed;
  --ath-syn-s: #047857;
  --ath-syn-n: #b45309;
  --ath-syn-c: #94a3b8;
  --ath-syn-y: #0369a1;
  --ath-syn-v: #be185d;
  --ath-syn-i: inherit;
}

.orb-dark {
  --ath-syn-k: #c4b5fd;
  --ath-syn-s: #6ee7b7;
  --ath-syn-n: #fcd34d;
  --ath-syn-c: #64748b;
  --ath-syn-y: #7dd3fc;
  --ath-syn-v: #f9a8d4;
}

html, body { height: 100%; }
body { background: var(--orb-bg); font-size: 14px; overflow: hidden; }
body.ath-plain-body { overflow: auto; }
.ath-icon { width: 16px; height: 16px; flex-shrink: 0; }
* { scrollbar-width: thin; scrollbar-color: var(--orb-border-strong) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--orb-border-strong); border: 3px solid transparent; border-radius: 10px; background-clip: padding-box; }
::-webkit-scrollbar-corner { background: transparent; }
body:not(.is-ready) #app > * { opacity: 0; }
.ath-boot { height: 100vh; display: grid; place-items: center; }
.ath-boot-spin, .ath-spinner { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--orb-primary-dim-strong); border-top-color: var(--orb-primary); animation: orb-spin .8s linear infinite; display: inline-block; }
.ath-spinner-sm { width: 13px; height: 13px; border-width: 2px; }
.ath-noscript { padding: 24px; text-align: center; }
.ath-mono, code, pre { font-family: var(--ath-font-code); }
.ath-muted { color: var(--orb-text-muted); }
.ath-small { font-size: .78rem; }
.ath-mt { margin-top: var(--orb-space-3); }
.ath-nowrap { white-space: nowrap; }
.ath-danger, .orb-dropdown-item.ath-danger { color: var(--orb-danger) !important; }
.ath-warn { color: color-mix(in srgb, var(--orb-warning) 75%, var(--orb-text)); display: inline-flex; align-items: center; gap: 4px; }
.ath-w120 { width: 120px; }
.ath-w160 { width: 160px; }
.grow { flex: 1; }
.orb-modal-body .orb-label:first-child { margin-top: 0; }
.ath-modal-xl { max-width: min(1180px, 96vw) !important; }
.orb-dropdown-item[aria-checked="true"] { color: var(--orb-primary-text); font-weight: 600; }
.orb-dropdown-item[disabled] { opacity: .45; pointer-events: none; }
a.orb-dropdown-item { text-decoration: none; }

.ath-plain { min-height: 100vh; overflow: auto; }
.ath-login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px 48px; position: relative; background: radial-gradient(1200px 600px at 50% -10%, var(--orb-primary-dim), transparent 70%); }
.ath-login-tools { position: absolute; top: 12px; right: 12px; display: flex; gap: 4px; }
.ath-login-card { width: min(420px, 100%); }
.ath-login-card .orb-card-body { display: flex; flex-direction: column; gap: 6px; }
.ath-login-card .orb-label { margin-top: 8px; }
.ath-login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.ath-login-name { font-size: 1.25rem; font-weight: 500; letter-spacing: -.02em; }
.ath-login-name b { color: var(--orb-primary-text); }
.ath-login-foot { display: flex; gap: 8px; align-items: flex-start; font-size: .75rem; color: var(--orb-text-muted); margin-top: 14px; line-height: 1.5; }
.ath-login-foot .ath-icon { margin-top: 2px; color: var(--orb-primary-text); }
.ath-login-ver { position: absolute; bottom: 14px; font-size: .75rem; color: var(--orb-text-subtle); }
.ath-pw-wrap { position: relative; }
.ath-pw-wrap .orb-input { padding-right: 40px; }
.ath-pw-wrap .ath-icon-btn { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); }
.ath-totp { font-family: var(--ath-font-code); font-size: 1.25rem; letter-spacing: .3em; text-align: center; }
.ath-unlock { max-width: 460px; margin: 12vh auto; }

.ath-shell { height: 100vh; height: 100dvh; display: grid; grid-template-rows: var(--ath-topbar-h) minmax(0, 1fr) var(--ath-status-h); }
.ath-topbar { display: flex; align-items: center; gap: var(--orb-space-3); padding: 0 var(--orb-space-3); border-bottom: 1px solid var(--orb-border); background: var(--orb-bg); position: relative; z-index: 50; min-width: 0; }
.ath-brand { display: flex; align-items: center; gap: 9px; color: var(--orb-text); text-decoration: none; white-space: nowrap; }
.ath-logo { width: 28px; height: 28px; object-fit: contain; }
.ath-brand-name { font-size: .875rem; font-weight: 500; letter-spacing: -.01em; }
.ath-brand-name b { color: var(--orb-primary-text); font-weight: 700; }
.ath-crumbs { display: flex; align-items: center; gap: 2px; min-width: 0; overflow: hidden; }
.ath-crumb { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: var(--orb-radius-sm); color: var(--orb-text-muted); text-decoration: none; font-size: .8125rem; white-space: nowrap; min-width: 0; }
.ath-crumb span { overflow: hidden; text-overflow: ellipsis; }
.ath-crumb:hover { background: var(--orb-surface-alt); color: var(--orb-text); }
.ath-crumb.is-cur { color: var(--orb-text); font-weight: 600; }
.ath-crumb-sep { color: var(--orb-text-subtle); display: inline-flex; }
.ath-crumb-sep .ath-icon { width: 12px; height: 12px; }
.ath-topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.ath-cmdk { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 8px 0 10px; min-width: 220px; border: 1px solid var(--orb-border); border-radius: var(--orb-radius-sm); background: var(--orb-surface-alt); color: var(--orb-text-muted); font: inherit; font-size: .8125rem; cursor: pointer; }
.ath-cmdk span:first-of-type { flex: 1; text-align: left; }
.ath-cmdk:hover { border-color: var(--orb-border-strong); color: var(--orb-text); }
.ath-user { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 8px; border: none; border-radius: var(--orb-radius-sm); background: transparent; color: var(--orb-text); font: inherit; font-size: .8125rem; cursor: pointer; max-width: 240px; }
.ath-user:hover { background: var(--orb-surface-alt); }
.ath-user-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ath-theme-btn .ath-when-dark, .orb-dark .ath-theme-btn .ath-when-light { display: none; }
.orb-dark .ath-theme-btn .ath-when-dark { display: inline-flex; }
.ath-theme-btn span { display: inline-flex; }
.ath-accent-menu { min-width: 0; padding: var(--orb-space-3) var(--orb-space-4) var(--orb-space-4); }
.ath-accent-label { font-size: .6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--orb-text-subtle); margin-bottom: var(--orb-space-3); }
.ath-accent-grid { display: grid; grid-template-columns: repeat(4, 28px); gap: 10px; }
.ath-menu-toggle { display: none; }

.ath-main { display: flex; min-height: 0; overflow: hidden; position: relative; }
.ath-sidebar { width: 270px; flex-shrink: 0; display: flex; flex-direction: column; min-height: 0; background: var(--orb-bg); }
.ath-side-head { display: flex; align-items: center; gap: 4px; padding: 8px 8px 6px; }
.ath-searchbox { position: relative; flex: 1; min-width: 0; }
.ath-searchbox > .ath-icon { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); color: var(--orb-text-subtle); width: 14px; height: 14px; pointer-events: none; }
.ath-searchbox .orb-input { padding-left: 30px; height: 32px; font-size: .8125rem; }
.ath-tree { flex: 1; overflow: auto; padding: 2px 0 24px; font-size: .8125rem; }
.ath-tree-row { display: flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px 0 6px; color: var(--orb-text); white-space: nowrap; cursor: pointer; user-select: none; position: relative; }
.ath-tree-row.ath-d1 { padding-left: 30px; }
.ath-tree-row:hover { background: var(--orb-surface-hover); }
.ath-tree-row::before { content: ""; position: absolute; left: 0; top: 5px; bottom: 5px; width: 2px; border-radius: 0 2px 2px 0; background: var(--orb-primary); opacity: 0; transform: scaleY(.2); transition: opacity var(--orb-dur) var(--orb-ease), transform var(--orb-dur-slow) var(--orb-ease-spring); }
.ath-tree-row.is-active { background: var(--orb-primary-dim); color: var(--orb-primary-text); }
.ath-tree-row.is-active::before { opacity: 1; transform: scaleY(1); }
.ath-tree-row.is-system { opacity: .7; }
.ath-tree-chevron { width: 16px; height: 16px; display: grid; place-items: center; color: var(--orb-text-subtle); border-radius: 4px; }
.ath-tree-chevron:hover { background: var(--orb-surface-alt); color: var(--orb-text); }
.ath-tree-chevron .ath-icon { width: 12px; height: 12px; transition: transform var(--orb-dur) var(--orb-ease-spring); }
.ath-tree-row.is-open .ath-tree-chevron .ath-icon { transform: rotate(90deg); }
.ath-tree-name { overflow: hidden; text-overflow: ellipsis; flex: 1; }
.ath-ficon { display: inline-flex; color: var(--orb-text-muted); }
.ath-ficon .ath-icon { width: 15px; height: 15px; }
.ath-ficon-db { color: color-mix(in srgb, var(--orb-primary) 75%, var(--orb-text-muted)); }
.ath-ficon[data-type="table"] { color: var(--orb-info); }
.ath-ficon[data-type="view"] { color: var(--orb-amber); }
.ath-count { font-family: var(--ath-font-code); font-size: .6875rem; color: var(--orb-text-subtle); }
.ath-tree-more, .ath-tree-empty { padding: 6px 12px 6px 30px; color: var(--orb-text-subtle); font-size: .75rem; }
.ath-splitter { flex: 0 0 5px; margin: 0 -2px; cursor: col-resize; position: relative; z-index: 5; touch-action: none; }
.ath-splitter::after { content: ""; position: absolute; top: 0; bottom: 0; left: 2px; width: 1px; background: var(--orb-border); transition: background-color var(--orb-dur) var(--orb-ease); }
.ath-splitter:hover::after, body.ath-resizing .ath-splitter::after { width: 3px; left: 1px; background: var(--orb-primary); }
body.ath-resizing, body.ath-col-resizing { cursor: col-resize; user-select: none; }

.ath-center { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--orb-surface); }
.ath-tabs { display: flex; height: 40px; flex-shrink: 0; overflow-x: auto; scrollbar-width: none; background: var(--orb-bg); box-shadow: inset 0 -1px 0 var(--orb-border); }
.ath-tabs::-webkit-scrollbar { display: none; }
.ath-tab { position: relative; display: flex; align-items: center; gap: 7px; padding: 0 14px; font-size: .8125rem; color: var(--orb-text-muted); text-decoration: none; white-space: nowrap; border-right: 1px solid var(--orb-border); transition: background-color var(--orb-dur) var(--orb-ease), color var(--orb-dur) var(--orb-ease); }
.ath-tab::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--orb-primary); transform: scaleX(0); transition: transform var(--orb-dur-slow) var(--orb-ease-out); }
.ath-tab:hover { background: var(--orb-surface-alt); color: var(--orb-text); }
.ath-tab.is-active { background: var(--orb-surface); color: var(--orb-text); }
.ath-tab.is-active::before { transform: scaleX(1); }
.ath-pane { flex: 1; min-height: 0; overflow: auto; position: relative; }
.ath-pane-browse, .ath-pane-sql, .ath-pane-variables, .ath-pane-processes, .ath-pane-charsets { overflow: hidden; }
.ath-page { padding: 16px; display: flex; flex-direction: column; gap: 14px; max-width: 1600px; }
.ath-page.ath-fill { height: 100%; max-width: none; }
.ath-loading { display: grid; place-items: center; padding: 48px; }
.ath-empty { display: grid; justify-items: center; gap: 12px; padding: 48px 16px; text-align: center; color: var(--orb-text-muted); }
.ath-empty > .ath-icon { width: 42px; height: 42px; color: var(--orb-primary-text); }

.ath-statusbar { display: flex; align-items: center; padding: 0 6px; font-size: .75rem; color: var(--orb-text-muted); background: var(--orb-bg); border-top: 1px solid var(--orb-border); white-space: nowrap; overflow: hidden; }
.ath-status-item { padding: 0 8px; overflow: hidden; text-overflow: ellipsis; }
.ath-status-item:empty { display: none; }
#st-msg { flex: 0 1 auto; min-width: 0; font-family: var(--ath-font-code); }
.ath-status-spacer { flex: 1; }
.ath-status-mode { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: var(--orb-radius-xs); background: var(--orb-primary-dim); color: var(--orb-primary-text); font-weight: 600; }
.ath-status-mode .ath-icon { width: 12px; height: 12px; }
.ath-status-brand { color: var(--orb-text-subtle); }

.ath-icon-btn { min-width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border: none; border-radius: var(--orb-radius-xs); background: transparent; color: var(--orb-text-muted); cursor: pointer; text-decoration: none; flex-shrink: 0; }
.ath-icon-btn:hover { background: var(--orb-surface-hover); color: var(--orb-text); }
.ath-icon-btn:disabled { opacity: .35; cursor: default; background: transparent; }
.ath-icon-btn:focus-visible { outline: 2px solid var(--orb-primary); outline-offset: -2px; }
.ath-dbl { margin-left: -10px; }
.ath-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ath-filter { max-width: 280px; height: 32px; font-size: .8125rem; }
.ath-size { width: auto; height: 32px; font-size: .8125rem; padding-top: 0; padding-bottom: 0; }
.ath-inline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ath-inline .orb-input { flex: 1; min-width: 160px; }
.ath-inline .orb-label { margin: 0; }
.ath-form2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ath-form3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.ath-checks { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.ath-radios { display: flex; flex-wrap: wrap; gap: 8px; }
.ath-radio { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--orb-border); border-radius: var(--orb-radius-sm); cursor: pointer; font-size: .875rem; }
.ath-radio:has(input:checked) { border-color: var(--orb-primary); background: var(--orb-primary-dim); color: var(--orb-primary-text); }
.ath-radio:has(input:disabled) { opacity: .45; cursor: default; }
.ath-pw-row { display: flex; gap: 8px; }
.ath-pw-row .orb-input { font-family: var(--ath-font-code); }
.ath-meter { height: 4px; border-radius: 4px; background: var(--orb-surface-alt); margin-top: 6px; overflow: hidden; }
.ath-meter i { display: block; height: 100%; width: 0; background: var(--orb-danger); transition: width var(--orb-dur) var(--orb-ease), background-color var(--orb-dur) var(--orb-ease); }
.ath-meter i[data-s="3"] { background: var(--orb-warning); }
.ath-meter i[data-s="4"], .ath-meter i[data-s="5"] { background: var(--orb-success); }

.ath-card { border: 1px solid var(--orb-border); border-radius: var(--orb-radius-md); background: var(--orb-bg); padding: 14px 16px; }
.ath-card h3 { display: flex; align-items: center; gap: 8px; font-size: .9375rem; font-weight: 700; margin: 0 0 12px; flex-wrap: wrap; }
.ath-card h3 > .ath-icon { color: var(--orb-primary-text); }
.ath-h3 { font-size: .9375rem; font-weight: 700; margin: 16px 0 10px; }
.ath-h4 { font-size: .8125rem; font-weight: 700; margin: 14px 0 8px; color: var(--orb-text-muted); text-transform: uppercase; letter-spacing: .04em; }
.ath-cols2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.ath-danger-zone { border-color: color-mix(in srgb, var(--orb-danger) 35%, var(--orb-border)); }
.ath-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.ath-stats-sm { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.ath-stat { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--orb-border); border-radius: var(--orb-radius-md); background: var(--orb-bg); min-width: 0; }
.ath-stat-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--orb-primary-dim); color: var(--orb-primary-text); flex-shrink: 0; }
.ath-stat-label { font-size: .6875rem; text-transform: uppercase; letter-spacing: .05em; color: var(--orb-text-muted); font-weight: 600; }
.ath-stat-value { font-size: 1.05rem; font-weight: 700; overflow-wrap: anywhere; }
.ath-stats-sm .ath-stat-value { font-size: .9375rem; }
.ath-stat-sub { font-size: .75rem; color: var(--orb-text-muted); overflow-wrap: anywhere; }
.ath-kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; font-size: .8125rem; }
.ath-kv dt { color: var(--orb-text-muted); }
.ath-kv dd { margin: 0; font-family: var(--ath-font-code); overflow-wrap: anywhere; }
.ath-monitor canvas { width: 100%; height: 140px; display: block; }
.ath-mon-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .75rem; margin-top: 8px; color: var(--orb-text-muted); }
.ath-mon-item { display: inline-flex; align-items: center; gap: 6px; }
.ath-mon-dot { width: 10px; height: 3px; border-radius: 2px; display: inline-block; }
.ath-mon-Questions { background: var(--orb-primary); }
.ath-mon-Threads_connected { background: var(--orb-success); }
.ath-mon-Bytes_sent { background: var(--orb-warning); }

.ath-table-wrap { overflow: auto; border: 1px solid var(--orb-border); border-radius: var(--orb-radius-md); background: var(--orb-bg); }
.ath-table { width: 100%; border-collapse: collapse; font-size: .8125rem; }
.ath-table th { position: sticky; top: 0; background: var(--ath-grid-head); color: var(--orb-text-muted); font-weight: 600; text-align: left; font-size: .75rem; padding: 8px 10px; border-bottom: 1px solid var(--orb-border); white-space: nowrap; z-index: 1; }
.ath-table td { padding: 7px 10px; border-bottom: 1px solid var(--orb-border); vertical-align: middle; }
.ath-table tbody tr:last-child td { border-bottom: none; }
.ath-table tbody tr:hover td { background: var(--orb-surface-hover); }
.ath-table .is-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ath-table .ath-chk, .ath-table .ath-c { width: 1%; text-align: center; }
.ath-table .ath-actions { white-space: nowrap; width: 1%; }
.ath-table .ath-actions > * { vertical-align: middle; }
.ath-total td { font-weight: 700; background: var(--orb-surface-alt); }
.ath-link { display: inline-flex; align-items: center; gap: 7px; color: var(--orb-text); text-decoration: none; font-weight: 600; }
.ath-link:hover { color: var(--orb-primary-text); }
.ath-link .ath-icon { color: var(--orb-text-muted); }
.ath-coled td { padding: 4px; }
.ath-coled .orb-input, .ath-coled .orb-select { height: 32px; font-size: .8125rem; min-width: 90px; }
.ath-rowform td:first-child { white-space: nowrap; }
.ath-rowform .orb-textarea, .ath-rowform .orb-input, .ath-rowform .orb-select { width: 100%; min-width: 220px; font-size: .8125rem; }
.ath-fn { width: 140px !important; min-width: 0 !important; }
.ath-log-bad td { color: var(--orb-danger); }
.ath-log-warn td { color: color-mix(in srgb, var(--orb-warning) 70%, var(--orb-text)); }
.ath-log-ok td:nth-child(2) { color: var(--orb-success); }
.ath-keys td { padding: 6px 10px; }
.ath-keys td:first-child { white-space: nowrap; width: 1%; }
.ath-checklist { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 14px; max-height: 280px; overflow: auto; }
.ath-checklist .orb-checkbox span { display: inline-flex; align-items: center; gap: 6px; overflow: hidden; text-overflow: ellipsis; }
.ath-details summary { cursor: pointer; font-size: .8125rem; color: var(--orb-text-muted); padding: 6px 0; }
.ath-details[open] summary { margin-bottom: 8px; }
.ath-sticky-bar { position: sticky; bottom: 0; padding: 12px 0; background: linear-gradient(transparent, var(--orb-surface) 30%); }
.ath-steps { padding-left: 20px; display: grid; gap: 12px; }
.ath-secret { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
.ath-secret code { font-size: 1rem; padding: 6px 10px; background: var(--orb-surface-alt); border-radius: var(--orb-radius-sm); letter-spacing: .05em; }
.ath-uri { display: block; font-size: .7rem; word-break: break-all; color: var(--orb-text-muted); margin-top: 4px; }
.ath-about { display: flex; gap: 18px; align-items: flex-start; }
.ath-confirm { margin: 0 0 8px; }

.ath-sql-preview { margin: 8px 0 0; padding: 10px 12px; background: var(--orb-surface-alt); border: 1px solid var(--orb-border); border-radius: var(--orb-radius-sm); font-size: .78rem; line-height: 1.55; white-space: pre-wrap; word-break: break-word; max-height: 420px; overflow: auto; }
.ath-sqlpanel { height: 100%; display: flex; flex-direction: column; min-height: 0; }
.ath-sql-top { display: flex; flex-direction: column; border-bottom: 1px solid var(--orb-border); flex-shrink: 0; }
.ath-sql-ed { height: 34vh; min-height: 120px; resize: vertical; overflow: hidden; border-bottom: 1px solid var(--orb-border); }
.ath-sql-bar { display: flex; align-items: center; gap: 6px; padding: 8px 12px; flex-wrap: wrap; background: var(--orb-bg); }
.ath-sql-out { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.ath-sql-hint { padding: 24px; color: var(--orb-text-subtle); text-align: center; font-size: .8125rem; }
.ath-rtabs { display: flex; gap: 2px; padding: 6px 10px 0; border-bottom: 1px solid var(--orb-border); overflow-x: auto; flex-shrink: 0; }
.ath-rtab { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid transparent; border-bottom: none; border-radius: var(--orb-radius-sm) var(--orb-radius-sm) 0 0; background: transparent; color: var(--orb-text-muted); font: inherit; font-size: .8125rem; cursor: pointer; white-space: nowrap; }
.ath-rtab small { font-family: var(--ath-font-code); color: var(--orb-text-subtle); }
.ath-rtab.is-active { background: var(--orb-surface); border-color: var(--orb-border); color: var(--orb-text); margin-bottom: -1px; }
.ath-rbody { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.ath-rbody > .ath-toolbar { padding: 6px 12px; font-size: .78rem; flex-shrink: 0; }
.ath-msgs { padding: 12px; overflow: auto; display: grid; gap: 8px; align-content: start; }
.ath-msg { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--orb-border); border-radius: var(--orb-radius-sm); font-size: .8125rem; }
.ath-msg > .ath-icon { color: var(--orb-success); margin-top: 2px; }
.ath-msg code { display: block; white-space: pre-wrap; word-break: break-word; font-size: .78rem; }
.ath-pageinfo { font-size: .78rem; }
.ath-hist { margin-top: 10px; display: grid; gap: 6px; max-height: 60vh; overflow: auto; }
.ath-hist-item { display: grid; gap: 4px; text-align: left; padding: 8px 10px; border: 1px solid var(--orb-border); border-radius: var(--orb-radius-sm); background: var(--orb-bg); color: var(--orb-text); cursor: pointer; font: inherit; }
.ath-hist-item:hover { border-color: var(--orb-primary); }
.ath-hist-item code { white-space: pre-wrap; word-break: break-word; font-size: .75rem; max-height: 5.5em; overflow: hidden; }
.ath-hist-meta { display: flex; align-items: center; gap: 6px; font-size: .7rem; color: var(--orb-text-muted); }
.ath-hist-meta .ath-icon { width: 12px; height: 12px; }

.ath-editor { position: relative; background: var(--orb-bg); }
.ath-editor .cm-editor { height: 100%; font-size: 13px; background: var(--orb-bg); color: var(--orb-text); }
.ath-editor .cm-editor.cm-focused { outline: none; }
.ath-editor .cm-scroller { font-family: var(--ath-font-code); line-height: 1.6; }
.ath-editor .cm-gutters { background: var(--orb-bg); color: var(--orb-text-subtle); border-right: 1px solid var(--orb-border); }
.ath-editor .cm-activeLine { background: color-mix(in srgb, var(--orb-primary) 6%, transparent); }
.ath-editor .cm-activeLineGutter { background: color-mix(in srgb, var(--orb-primary) 10%, transparent); color: var(--orb-text); }
.ath-editor .cm-cursor { border-left-color: var(--orb-primary); border-left-width: 2px; }
.ath-editor .cm-selectionBackground, .ath-editor .cm-focused .cm-selectionBackground { background: color-mix(in srgb, var(--orb-primary) 22%, transparent) !important; }
.ath-editor .cm-matchingBracket { background: color-mix(in srgb, var(--orb-primary) 20%, transparent); outline: 1px solid var(--orb-primary-border); }
.ath-editor .cm-selectionMatch { background: color-mix(in srgb, var(--orb-warning) 20%, transparent); }
.ath-editor .cm-placeholder { color: var(--orb-text-subtle); }
.ath-editor .cm-panels { background: var(--orb-surface-alt); color: var(--orb-text); border-color: var(--orb-border); }
.ath-editor .cm-panel input, .ath-editor .cm-panel button { font: inherit; font-size: 12px; }
.ath-sql-fallback { width: 100%; height: 100%; border: 0; resize: none; padding: 10px 12px; background: var(--orb-bg); color: var(--orb-text); font: 13px/1.6 var(--ath-font-code); outline: none; }
.ath-k { color: var(--ath-syn-k); font-weight: 600; }
.ath-s { color: var(--ath-syn-s); }
.ath-n { color: var(--ath-syn-n); }
.ath-c { color: var(--ath-syn-c); font-style: italic; }
.ath-o { color: var(--orb-text-muted); }
.ath-y { color: var(--ath-syn-y); }
.ath-v { color: var(--ath-syn-v); }
.cm-tooltip { background: var(--orb-bg) !important; color: var(--orb-text); border: 1px solid var(--orb-border) !important; border-radius: var(--orb-radius-sm); box-shadow: var(--orb-shadow-md); overflow: hidden; font-family: var(--ath-font-code); font-size: 12.5px; }
.cm-tooltip-autocomplete ul li[aria-selected] { background: var(--orb-primary) !important; color: #fff !important; }
.cm-completionDetail { color: var(--orb-text-subtle); margin-left: 8px; font-style: normal !important; }
.cm-completionIcon { opacity: .7; }

.ath-browse { height: 100%; display: flex; flex-direction: column; min-height: 0; }
.ath-browse-bar { padding: 8px 12px; border-bottom: 1px solid var(--orb-border); background: var(--orb-bg); flex-shrink: 0; }
.ath-pager { display: flex; align-items: center; gap: 2px; }
.ath-pageinput { width: 64px; height: 30px; text-align: center; padding: 0 4px; font-size: .8125rem; }
.ath-browse-bar .ath-searchbox { max-width: 280px; }
.ath-filters { padding: 10px 12px; border-bottom: 1px solid var(--orb-border); background: var(--orb-surface-alt); display: grid; gap: 6px; flex-shrink: 0; }
.ath-frow { display: flex; gap: 6px; align-items: center; }
.ath-frow .orb-select, .ath-frow .orb-input { height: 32px; font-size: .8125rem; }
.ath-frow .orb-select { width: auto; max-width: 220px; }
.ath-frow .orb-input { flex: 1; }
.ath-where { font-family: var(--ath-font-code); font-size: .75rem; font-weight: 700; color: var(--orb-text-muted); width: 64px; }
.ath-sqlline { display: flex; gap: 10px; align-items: baseline; padding: 4px 12px; font-size: .72rem; border-bottom: 1px solid var(--orb-border); background: var(--orb-bg); overflow: hidden; flex-shrink: 0; }
.ath-sqlline code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--orb-text-muted); }
.ath-sqlline:empty { display: none; }
.ath-browse-foot { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 6px 12px; font-size: .75rem; border-top: 1px solid var(--orb-border); background: var(--orb-bg); color: var(--orb-text-muted); flex-shrink: 0; }

.ath-grid-host { flex: 1; min-height: 0; position: relative; display: flex; flex-direction: column; }
.ath-grid-host > .orb-alert { margin: 12px; }
.ath-grid { position: relative; flex: 1; min-height: 0; overflow: auto; outline: none; font-family: var(--ath-font-code); font-size: 12.5px; background: var(--orb-surface); }
.ath-grid:focus-visible { box-shadow: inset 0 0 0 1px var(--orb-primary-border); }
.ath-grid-head { position: sticky; top: 0; z-index: 3; display: flex; height: 30px; background: var(--ath-grid-head); border-bottom: 1px solid var(--orb-border-strong); min-width: 100%; }
.ath-gh { position: relative; flex-shrink: 0; display: flex; align-items: center; gap: 5px; padding: 0 8px; height: 30px; border-right: 1px solid var(--orb-border); color: var(--orb-text); font-family: var(--orb-font-sans); font-size: .75rem; font-weight: 600; cursor: pointer; user-select: none; overflow: hidden; }
.ath-gh:hover { background: var(--orb-surface-hover); }
.ath-gh.is-num { justify-content: flex-end; }
.ath-gh.is-sorted { color: var(--orb-primary-text); }
.ath-gh-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ath-gh-key .ath-icon { width: 12px; height: 12px; color: var(--orb-amber); }
.ath-gh-sort .ath-icon { width: 13px; height: 13px; }
.ath-gh-rs { position: absolute; right: -3px; top: 0; bottom: 0; width: 7px; cursor: col-resize; z-index: 2; }
.ath-gh-rs:hover { background: var(--orb-primary-dim-strong); }
.ath-gh-num, .ath-gc-num { width: 58px; position: sticky; left: 0; z-index: 2; justify-content: flex-start; gap: 6px; background: var(--ath-grid-head); color: var(--orb-text-subtle); font-size: .7rem; }
.ath-gh-num { z-index: 4; }
.ath-grid-body { position: relative; }
.ath-grid-win { position: absolute; top: 0; left: 0; }
.ath-gr { position: absolute; left: 0; height: 28px; display: flex; border-bottom: 1px solid var(--orb-border); background: var(--orb-surface); }
.ath-gr.is-odd { background: color-mix(in srgb, var(--orb-surface-alt) 45%, var(--orb-surface)); }
.ath-gr:hover { background: var(--orb-surface-hover); }
.ath-gr.is-sel, .ath-gr.is-sel .ath-gc-num { background: var(--orb-primary-dim); }
.ath-gc { flex-shrink: 0; height: 27px; line-height: 27px; padding: 0 8px; border-right: 1px solid var(--orb-border); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--orb-text); cursor: default; }
.ath-gc-num { display: flex; align-items: center; cursor: pointer; border-right: 1px solid var(--orb-border-strong); }
.ath-gc.is-num { text-align: right; font-variant-numeric: tabular-nums; }
.ath-gc.is-null { color: var(--orb-text-subtle); font-style: italic; }
.ath-gc.is-bin { color: var(--ath-syn-y); }
.ath-gc.is-long { color: var(--orb-text-muted); }
.ath-gc.is-act { box-shadow: inset 0 0 0 2px var(--orb-primary); background: var(--orb-primary-dim); }
.ath-gcheck { width: 13px; height: 13px; border: 1.5px solid var(--orb-border-strong); border-radius: 3px; display: inline-block; flex-shrink: 0; position: relative; }
.ath-gcheck.is-on { background: var(--orb-primary); border-color: var(--orb-primary); }
.ath-gcheck.is-on::after { content: ""; position: absolute; left: 3px; top: 0; width: 4px; height: 7px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.ath-gcheck.is-some { background: var(--orb-primary-dim-strong); border-color: var(--orb-primary); }
.ath-grid-empty { position: absolute; top: 60px; left: 0; right: 0; text-align: center; color: var(--orb-text-subtle); font-family: var(--orb-font-sans); font-size: .8125rem; pointer-events: none; }
.ath-grid-edit { position: absolute; z-index: 6; height: 28px; min-height: 28px; max-height: 240px; resize: both; padding: 4px 8px; border: 2px solid var(--orb-primary); border-radius: 4px; background: var(--orb-bg); color: var(--orb-text); font: 12.5px/1.4 var(--ath-font-code); box-shadow: var(--orb-shadow-lg); outline: none; }
.ath-ctx { position: fixed; z-index: 2000; min-width: 220px; }

.ath-palette { position: fixed; inset: 0; z-index: 3000; background: rgba(2, 6, 23, .35); display: flex; justify-content: center; align-items: flex-start; padding-top: 12vh; }
.ath-pal-box { width: min(640px, 94vw); background: var(--orb-bg); border: 1px solid var(--orb-border); border-radius: var(--orb-radius-lg); box-shadow: var(--orb-shadow-lg); overflow: hidden; }
.ath-pal-input { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--orb-border); }
.ath-pal-input input { flex: 1; border: none; outline: none; background: transparent; color: var(--orb-text); font: inherit; font-size: 1rem; }
.ath-pal-list { max-height: 50vh; overflow: auto; padding: 6px; }
.ath-pal-item { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: none; border-radius: var(--orb-radius-sm); background: transparent; color: var(--orb-text); font: inherit; font-size: .875rem; text-align: left; cursor: pointer; }
.ath-pal-item.is-active, .ath-pal-item:hover { background: var(--orb-primary-dim); color: var(--orb-primary-text); }
.ath-pal-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ath-pal-hint { font-size: .75rem; color: var(--orb-text-subtle); white-space: nowrap; }
.ath-pal-empty { padding: 18px; text-align: center; color: var(--orb-text-subtle); }

.ath-searchform { display: flex; gap: 8px; flex-wrap: wrap; }
.ath-searchform .orb-input { flex: 1; min-width: 220px; }
.ath-searchform .orb-select { width: auto; }
.ath-drop { display: grid; justify-items: center; gap: 6px; padding: 28px 16px; border: 2px dashed var(--orb-border-strong); border-radius: var(--orb-radius-md); text-align: center; color: var(--orb-text-muted); cursor: pointer; transition: border-color var(--orb-dur) var(--orb-ease), background-color var(--orb-dur) var(--orb-ease); }
.ath-drop > .ath-icon { width: 34px; height: 34px; color: var(--orb-primary-text); }
.ath-drop b { color: var(--orb-text); }
.ath-drop span { font-size: .78rem; max-width: 560px; }
.ath-drop:hover, .ath-drop.is-over { border-color: var(--orb-primary); background: var(--orb-primary-dim); }
.ath-file { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; }
.ath-prog { display: grid; grid-template-columns: 110px 1fr 180px; align-items: center; gap: 12px; margin-top: 12px; font-size: .8125rem; }
.ath-prog b { font-weight: 600; font-variant-numeric: tabular-nums; }
.orb-progress-bar { transition: width .25s var(--orb-ease); }
.ath-ilog { display: grid; gap: 10px; margin-top: 14px; }
.ath-ops { max-width: 900px; }

@media (max-width: 1100px) {
  .ath-cmdk { min-width: 0; }
  .ath-cmdk span { display: none; }
  .ath-cmdk span.orb-kbd { display: none; }
}

@media (max-width: 860px) {
  .ath-menu-toggle { display: inline-flex; }
  .ath-brand-name, .ath-user-name { display: none; }
  .ath-sidebar { position: absolute; top: 0; bottom: 0; left: 0; z-index: 30; width: min(88vw, 320px) !important; border-right: 1px solid var(--orb-border); box-shadow: var(--orb-shadow-lg); transform: translateX(-102%); transition: transform var(--orb-dur) var(--orb-ease); }
  body.ath-side-open .ath-sidebar { transform: none; }
  .ath-splitter { display: none; }
  .ath-form2, .ath-form3, .ath-cols2 { grid-template-columns: minmax(0, 1fr); }
  .ath-prog { grid-template-columns: 1fr; gap: 4px; }
  .ath-topbar { gap: 6px; padding: 0 8px; }
  .ath-crumb span { max-width: 110px; }
  .ath-crumb:first-child span { display: none; }
  .ath-status-brand { display: none; }
  .ath-page { padding: 12px; }
  .ath-tab { padding: 0 12px; }
  .ath-tab-name { display: none; }
  .ath-tab.is-active .ath-tab-name { display: inline; }
}

@media (max-width: 560px) {
  .ath-crumbs { display: none; }
  .ath-statusbar { display: none; }
  .ath-shell { grid-template-rows: var(--ath-topbar-h) minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

.ath-section-title { display: flex; align-items: center; gap: 8px; margin: 4px 0 -2px; color: var(--orb-text-muted); }
.ath-section-title .ath-icon { color: var(--orb-primary-text); }
