:root {
  --ath-font-code: "Geist Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
  --ath-font-size: 14px;
  --ath-topbar-h: 46px;
  --ath-status-h: 26px;

  --ath-editor-bg: var(--orb-surface);
  --ath-active-line: color-mix(in srgb, var(--orb-primary) 5%, transparent);
  --ath-selection: color-mix(in srgb, var(--orb-primary) 22%, transparent);
  --ath-selection-match: color-mix(in srgb, var(--orb-primary) 12%, transparent);

  --ath-syn-keyword: #7c3aed;
  --ath-syn-string: #0a7f55;
  --ath-syn-number: #c2410c;
  --ath-syn-comment: #8b95a7;
  --ath-syn-tag: #d6336c;
  --ath-syn-attr: #b45309;
  --ath-syn-property: #1d4ed8;
  --ath-syn-function: #0e7490;
  --ath-syn-type: #a21caf;
  --ath-syn-variable: var(--orb-text);
  --ath-syn-punct: #64748b;
  --ath-syn-meta: #64748b;
  --ath-syn-regexp: #db2777;
}

.orb-dark {
  --ath-active-line: rgba(255, 255, 255, 0.03);
  --ath-selection: color-mix(in srgb, var(--orb-primary) 32%, transparent);

  --ath-syn-keyword: #c4b5fd;
  --ath-syn-string: #86efac;
  --ath-syn-number: #fdba74;
  --ath-syn-comment: #61667a;
  --ath-syn-tag: #fb7185;
  --ath-syn-attr: #fcd34d;
  --ath-syn-property: #93c5fd;
  --ath-syn-function: #67e8f9;
  --ath-syn-type: #f0abfc;
  --ath-syn-punct: #9ca3af;
  --ath-syn-meta: #9ca3af;
  --ath-syn-regexp: #f9a8d4;
}

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  background: var(--orb-bg);
  font-size: 14px;
}

.ath-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

[hidden] { display: none !important; }

* {
  scrollbar-width: thin;
  scrollbar-color: var(--orb-border-strong) transparent;
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--orb-border-strong);
  border: 3px solid transparent;
  border-radius: 10px;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background-color: var(--orb-text-subtle); }
::-webkit-scrollbar-corner { background: transparent; }

.ath-shell {
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-rows: var(--ath-topbar-h) minmax(0, 1fr) var(--ath-status-h);
}

.ath-topbar {
  position: relative;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: var(--orb-space-4);
  padding: 0 var(--orb-space-3);
  background: var(--orb-bg);
  border-bottom: 1px solid var(--orb-border);
}

.ath-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--orb-text);
  white-space: nowrap;
}
.ath-logo { width: 28px; height: 28px; object-fit: contain; }
.ath-brand-name { font-size: 0.875rem; font-weight: 500; letter-spacing: -0.01em; }
.ath-brand-name b { font-weight: 700; color: var(--orb-primary-text); }

.ath-menus { display: flex; align-items: center; gap: 2px; }

.ath-menu-btn {
  height: 30px;
  padding: 0 10px;
  border: none;
  border-radius: var(--orb-radius-sm);
  background: transparent;
  color: var(--orb-text-muted);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color var(--orb-dur-fast) var(--orb-ease), color var(--orb-dur-fast) var(--orb-ease);
}
.ath-menu-btn:hover,
.ath-menu-btn[aria-expanded="true"] { background: var(--orb-surface-alt); color: var(--orb-text); }
.ath-menu-btn:focus-visible { outline: 2px solid var(--orb-primary); outline-offset: 1px; }

.ath-menus .orb-dropdown-menu { min-width: 250px; }
.ath-menus .orb-dropdown-item { font-size: 0.8125rem; padding: 7px 10px; }
.ath-menus .orb-dropdown-item.ath-no-icon { padding-left: 36px; }

.ath-topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
}
#btn-preview[aria-pressed="true"] { color: var(--orb-primary-text); background: var(--orb-primary-dim); }

.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: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.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-main {
  position: relative;
  display: flex;
  min-height: 0;
  overflow: hidden;
}

.ath-pane-head {
  display: flex;
  align-items: center;
  gap: var(--orb-space-2);
  height: 36px;
  flex-shrink: 0;
  padding: 0 6px 0 14px;
}
.ath-pane-title {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--orb-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.ath-pane-actions { margin-left: auto; display: flex; gap: 2px; flex-shrink: 0; }

.ath-icon-btn {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: var(--orb-radius-xs);
  background: transparent;
  color: var(--orb-text-muted);
  cursor: pointer;
  transition: background-color var(--orb-dur-fast) var(--orb-ease), color var(--orb-dur-fast) var(--orb-ease);
}
.ath-icon-btn:hover { background: var(--orb-surface-hover); color: var(--orb-text); }
.ath-icon-btn:focus-visible { outline: 2px solid var(--orb-primary); outline-offset: -2px; }

.ath-sidebar {
  width: var(--ath-sidebar-w, 250px);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--orb-bg);
}

.ath-explorer {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 2px 0 24px;
  font-size: 0.8125rem;
  outline: none;
}

.ath-tree-row {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 10px 0 calc(8px + var(--depth, 0) * 14px);
  color: var(--orb-text);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  outline: none;
}
.ath-tree-row:hover { background: var(--orb-surface-hover); }
.ath-tree-row.is-selected { background: var(--orb-surface-hover); }
.ath-tree-row.is-active { background: var(--orb-primary-dim); color: var(--orb-primary-text); }
.ath-tree-row:focus-visible { box-shadow: inset 0 0 0 1px var(--orb-primary); }
.ath-tree-row.is-dragging { opacity: 0.45; }
.ath-tree-row.is-drop-target {
  background: var(--orb-primary-dim-strong);
  color: var(--orb-primary-text);
  box-shadow: inset 0 0 0 1px var(--orb-primary-border);
}
.ath-explorer.is-drop-root { box-shadow: inset 0 0 0 2px var(--orb-primary-border); background: var(--orb-primary-dim); }

.ath-tree-chevron {
  width: 14px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: var(--orb-text-subtle);
}
.ath-tree-chevron .ath-icon { width: 12px; height: 12px; transition: transform var(--orb-dur-fast) var(--orb-ease); }
.ath-tree-row.is-open .ath-tree-chevron .ath-icon { transform: rotate(90deg); }

.ath-tree-name { overflow: hidden; text-overflow: ellipsis; }

.ath-ficon {
  width: 20px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--ath-font-code);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--orb-text-muted);
}
.ath-ficon .ath-icon { width: 15px; height: 15px; }
.ath-ficon-dir { color: color-mix(in srgb, var(--orb-primary) 70%, var(--orb-text-muted)); }
.ath-ficon[data-type="html"] { color: var(--orb-orange); }
.ath-ficon[data-type="php"] { color: var(--orb-indigo); }
.ath-ficon[data-type="css"] { color: var(--orb-sky); font-size: 12px; }
.ath-ficon[data-type="js"] { color: var(--orb-gold); }
.ath-ficon[data-type="ts"] { color: var(--orb-cobalt); }
.ath-ficon[data-type="json"] { color: var(--orb-amber); }
.ath-ficon[data-type="md"] { color: var(--orb-slate); }
.ath-ficon[data-type="img"] { color: var(--orb-emerald); }
.orb-dark .ath-ficon[data-type="php"] { color: var(--orb-lavender); }
.orb-dark .ath-ficon[data-type="ts"] { color: #60a5fa; }
.orb-dark .ath-ficon[data-type="md"] { color: var(--orb-text-muted); }

.ath-sidebar-empty {
  display: flex;
  flex-direction: column;
  gap: var(--orb-space-2);
  padding: var(--orb-space-2) var(--orb-space-4) var(--orb-space-4);
  font-size: 0.8125rem;
  color: var(--orb-text-muted);
}
.ath-sidebar-empty p { margin-bottom: var(--orb-space-1); }
.ath-hint { font-size: 0.75rem; color: var(--orb-text-subtle); margin-top: var(--orb-space-2); line-height: 1.5; }
.ath-tree-spacer { position: relative; min-height: 1px; }
.ath-tree-window { position: absolute; top: 0; left: 0; right: 0; will-change: transform; }
.ath-tree-row.is-loading { color: var(--orb-text-subtle); cursor: default; }
.ath-tree-message { padding: var(--orb-space-3) var(--orb-space-4); color: var(--orb-text-subtle); font-size: 0.8125rem; }
.ath-tree-message.is-error { color: var(--orb-danger); }
.ath-spinner.ath-spinner-sm { width: 13px; height: 13px; border-width: 2px; margin: 0 3px; }

.ath-splitter {
  position: relative;
  z-index: 5;
  flex: 0 0 5px;
  margin: 0 -2px;
  cursor: col-resize;
  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), width var(--orb-dur) var(--orb-ease), left var(--orb-dur) var(--orb-ease);
}
.ath-splitter:hover::after,
.ath-resizing .ath-splitter:active::after { left: 1px; width: 3px; background: var(--orb-primary); }

body.ath-resizing { cursor: col-resize; user-select: none; }
body.ath-resizing iframe { pointer-events: none; }

body.ath-no-sidebar .ath-sidebar,
body.ath-no-sidebar [data-split="sidebar"],
body.ath-no-preview .ath-preview,
body.ath-no-preview [data-split="preview"] { display: none; }

.ath-center {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--ath-editor-bg);
}

.ath-tabs {
  display: flex;
  height: 38px;
  flex-shrink: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  background: var(--orb-bg);
  box-shadow: inset 0 -1px 0 var(--orb-border);
}
.ath-tabs::-webkit-scrollbar { display: none; }
.ath-tabs:empty { display: none; }

.ath-tab {
  position: relative;
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 230px;
  padding: 0 6px 0 10px;
  border-right: 1px solid var(--orb-border);
  font-size: 0.8125rem;
  color: var(--orb-text-muted);
  cursor: pointer;
  user-select: none;
  transition: background-color var(--orb-dur-fast) var(--orb-ease), color var(--orb-dur-fast) var(--orb-ease);
}
.ath-tab:hover { background: var(--orb-surface-alt); color: var(--orb-text); }
.ath-tab.is-active {
  background: var(--ath-editor-bg);
  color: var(--orb-text);
  box-shadow: inset 0 2px 0 var(--orb-primary);
}
.ath-tab-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ath-tab-close {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border: none;
  border-radius: var(--orb-radius-xs);
  background: transparent;
  color: var(--orb-text-muted);
  cursor: pointer;
  opacity: 0;
}
.ath-tab-close .ath-icon { width: 14px; height: 14px; }
.ath-tab:hover .ath-tab-close,
.ath-tab.is-active .ath-tab-close,
.ath-tab.is-dirty .ath-tab-close,
.ath-tab-close:focus-visible { opacity: 1; }
.ath-tab-close:hover { background: var(--orb-surface-hover); color: var(--orb-text); }
.ath-tab-dot { display: none; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.ath-tab.is-dirty .ath-tab-close:not(:hover) .ath-icon { display: none; }
.ath-tab.is-dirty .ath-tab-close:not(:hover) .ath-tab-dot { display: block; }
.ath-tab.is-dirty .ath-tab-close { color: var(--orb-text); }

.ath-editor-area {
  position: relative;
  flex: 1;
  min-height: 0;
}

.ath-editor-host,
.ath-image-view,
.ath-welcome {
  position: absolute;
  inset: 0;
  display: none;
}
body[data-view="editor"] .ath-editor-host { display: block; }
body[data-view="image"] .ath-image-view { display: grid; }
body[data-view="welcome"] .ath-welcome { display: flex; }

.ath-editor-host .cm-editor { height: 100%; }

.ath-image-view {
  place-items: center;
  padding: var(--orb-space-8);
  overflow: auto;
  background-color: var(--orb-surface-alt);
  background-image: conic-gradient(var(--orb-surface-hover) 25%, transparent 0 50%, var(--orb-surface-hover) 0 75%, transparent 0);
  background-size: 20px 20px;
}
.ath-image-view img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  box-shadow: var(--orb-shadow-md);
}

.ath-welcome {
  overflow: auto;
  align-items: center;
  justify-content: center;
  padding: var(--orb-space-8) var(--orb-space-4);
  background:
    radial-gradient(600px 300px at 50% 0%, var(--orb-primary-dim), transparent 70%),
    var(--ath-editor-bg);
}
.ath-welcome-inner { max-width: 560px; width: 100%; text-align: center; margin: auto; }
.ath-welcome-logo {
  display: block;
  width: 104px;
  height: 104px;
  margin: 0 auto var(--orb-space-4);
  object-fit: contain;
  filter: drop-shadow(0 10px 24px rgba(3, 3, 26, 0.35));
}
.ath-welcome .orb-lead { margin: var(--orb-space-3) auto 0; }
.ath-welcome-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--orb-space-3);
  margin: var(--orb-space-6) 0 var(--orb-space-3);
}
.ath-recent { margin-bottom: var(--orb-space-2); }
.ath-limited { text-align: left; margin-top: var(--orb-space-5); }

.ath-shortcuts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--orb-space-3) var(--orb-space-6);
  margin-top: var(--orb-space-8);
  padding-top: var(--orb-space-6);
  border-top: 1px solid var(--orb-border);
  text-align: left;
}
.ath-shortcuts > div {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8125rem;
  color: var(--orb-text-muted);
}
.ath-shortcuts > div > span:last-child { margin-left: 6px; }

.ath-preview {
  width: var(--ath-preview-w, 42%);
  flex-shrink: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--orb-bg);
}

.ath-preview-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border: none;
  border-radius: var(--orb-radius-full);
  background: var(--orb-danger-dim);
  color: var(--orb-danger);
  font-size: 0.71875rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.ath-preview-status .ath-icon { width: 13px; height: 13px; }

.ath-preview-body {
  position: relative;
  flex: 1;
  min-height: 0;
  margin: 0 8px 8px;
  border: 1px solid var(--orb-border);
  border-radius: var(--orb-radius-md);
  overflow: hidden;
  background: #ffffff;
}
.ath-preview-body iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #ffffff;
}
.ath-preview-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--orb-space-3);
  padding: var(--orb-space-6);
  text-align: center;
  font-size: 0.8125rem;
  color: var(--orb-text-subtle);
  background: var(--orb-surface);
}
.ath-preview-empty .ath-icon { width: 32px; height: 32px; }

.ath-statusbar {
  display: flex;
  align-items: center;
  padding: 0 6px;
  font-size: 0.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; }
.ath-status-item:empty { display: none; }
.ath-status-spacer { flex: 1; }
.ath-status-mode {
  padding: 1px 8px;
  border-radius: var(--orb-radius-xs);
  background: var(--orb-primary-dim);
  color: var(--orb-primary-text);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ath-status-mode.is-limited { background: var(--orb-warning-dim); color: color-mix(in srgb, var(--orb-warning) 70%, var(--orb-text)); }
.ath-status-brand { color: var(--orb-text-subtle); }

.ath-dialog .orb-modal-close .ath-icon { width: 18px; height: 18px; }
.ath-dialog-text { font-size: 0.875rem; line-height: 1.6; }
.ath-context-menu { position: fixed; z-index: 2000; min-width: 220px; }
.ath-context-menu .orb-dropdown-item { font-size: 0.8125rem; padding: 7px 10px; }

.ath-error-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.ath-error-list li {
  padding: 8px 10px;
  border-radius: var(--orb-radius-sm);
  background: var(--orb-danger-dim);
  color: var(--orb-danger);
  font-size: 0.78125rem;
  word-break: break-word;
}

.ath-keys-table { width: 100%; font-size: 0.8125rem; }
.ath-keys-table td { padding: 7px 10px; vertical-align: middle; }
.ath-keys-table td:first-child { white-space: nowrap; width: 1%; }
.ath-combo { display: inline-flex; gap: 3px; }

.ath-about { text-align: center; }
.ath-about p { margin-top: var(--orb-space-2); font-size: 0.875rem; }
.ath-about-logo { width: 72px; height: 72px; margin: 0 auto var(--orb-space-3); display: block; object-fit: contain; }

.ath-lang-menu { min-width: 250px; }
.ath-lang-menu .ath-accent-label { padding: 6px 10px 0; margin-bottom: 6px; }
.ath-lang-menu .orb-dropdown-item { font-size: 0.8125rem; padding: 7px 10px; }
.ath-lang-item.is-current { color: var(--orb-primary-text); font-weight: 600; }
.ath-lang-item.is-current svg { color: var(--orb-primary-text); }
.ath-lang-code { margin-left: auto; font-size: 0.6875rem; color: var(--orb-text-subtle); text-transform: uppercase; letter-spacing: 0.04em; }

.ath-shell { transition: opacity 140ms var(--orb-ease); }
body:not(.is-ready) .ath-shell { opacity: 0; }
body:not(.is-ready) * { transition: none !important; animation: none !important; }

.ath-drop-hint {
  position: fixed;
  inset: 12px;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--orb-space-3);
  border: 2px dashed var(--orb-primary);
  border-radius: var(--orb-radius-xl);
  background: color-mix(in srgb, var(--orb-bg) 82%, transparent);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: var(--orb-primary-text);
  font-size: 1rem;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--orb-dur) var(--orb-ease);
}
.ath-drop-hint.is-visible { opacity: 1; }
.ath-drop-hint .ath-icon { width: 24px; height: 24px; }

@media (max-width: 960px) {
  .ath-preview {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    width: min(100%, 520px);
    border-left: 1px solid var(--orb-border);
    box-shadow: var(--orb-shadow-lg);
  }
  [data-split="preview"] { display: none; }
}

@media (max-width: 720px) {
  .ath-sidebar {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 21;
    width: min(85%, 300px);
    border-right: 1px solid var(--orb-border);
    box-shadow: var(--orb-shadow-lg);
  }
  [data-split="sidebar"] { display: none; }
  .ath-brand-name { display: none; }
  .ath-topbar { gap: var(--orb-space-2); }
  .ath-shortcuts { grid-template-columns: 1fr; }
  #st-indent,
  .ath-status-brand { display: none; }
}

.ath-settings { display: flex; flex-direction: column; gap: var(--orb-space-6); }
.ath-set-section h3 {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--orb-text-subtle);
  margin-bottom: var(--orb-space-2);
}
.ath-set-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 240px);
  align-items: center;
  gap: var(--orb-space-4);
  padding: 10px 0;
  border-bottom: 1px solid var(--orb-border);
}
.ath-set-row:last-child { border-bottom: none; }
.ath-set-label { display: flex; flex-direction: column; gap: 2px; font-size: 0.875rem; min-width: 0; }
.ath-set-label small { font-size: 0.75rem; color: var(--orb-text-subtle); line-height: 1.45; }
.ath-set-control { display: flex; justify-content: flex-end; min-width: 0; }
.ath-set-control .orb-select { min-height: 36px; padding-top: 6px; padding-bottom: 6px; }
.ath-set-accents { grid-template-columns: repeat(8, 22px); gap: 8px; }
.ath-set-accents .orb-color-dot { width: 22px; height: 22px; }
.ath-range { display: flex; align-items: center; gap: var(--orb-space-3); width: 100%; }
.ath-range-value { min-width: 48px; text-align: right; font-size: 0.8125rem; color: var(--orb-text-muted); font-variant-numeric: tabular-nums; }
.ath-set-hint { font-size: 0.8125rem; color: var(--orb-text-muted); line-height: 1.5; margin-bottom: var(--orb-space-3); }
.ath-set-hint code { font-family: var(--orb-font-mono); font-size: 0.75rem; }
.ath-font-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--orb-space-3); }
.ath-font-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--orb-space-3);
  padding: 6px 6px 6px 12px;
  border: 1px solid var(--orb-border);
  border-radius: var(--orb-radius-sm);
  font-size: 0.9375rem;
}
.ath-set-empty { font-size: 0.8125rem; color: var(--orb-text-subtle); }

@media (max-width: 560px) {
  .ath-set-row { grid-template-columns: 1fr; gap: var(--orb-space-2); }
  .ath-set-control { justify-content: flex-start; }
}

.ath-palette-overlay {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 72px;
  background: rgba(0, 0, 0, 0.18);
}
.ath-palette {
  width: min(640px, calc(100vw - 32px));
  max-height: min(480px, 70vh);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--orb-surface);
  border: 1px solid var(--orb-border-strong);
  border-radius: var(--orb-radius-md);
  box-shadow: var(--orb-shadow-lg);
  animation: orb-pop var(--orb-dur) var(--orb-ease-out);
}
.ath-palette-input {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--orb-border);
  padding: 14px 16px;
  background: transparent;
  color: var(--orb-text);
  font-size: 0.9375rem;
  outline: none;
}
.ath-palette[data-mode="cmd"] .ath-palette-input,
.ath-palette[data-mode="line"] .ath-palette-input { font-family: var(--orb-font-mono); }
.ath-palette-list { overflow-y: auto; padding: 6px; }
.ath-palette-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 6px 10px;
  border-radius: var(--orb-radius-sm);
  font-size: 0.8125rem;
  cursor: pointer;
}
.ath-palette-item.is-active { background: var(--orb-primary-dim-strong); }
.ath-palette-item.is-disabled { color: var(--orb-text-subtle); cursor: default; }
.ath-palette-item .ath-icon { color: var(--orb-text-muted); }
.ath-palette-noicon { width: 20px; flex-shrink: 0; }
.ath-palette-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ath-palette-label mark { background: none; color: var(--orb-primary-text); font-weight: 700; }
.ath-palette-detail {
  margin-left: auto;
  padding-left: 12px;
  color: var(--orb-text-subtle);
  font-size: 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 55%;
  font-family: var(--orb-font-mono);
}

.ath-status-problems {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 100%;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.ath-status-problems:hover { color: var(--orb-text); background: var(--orb-surface-hover); }
.ath-status-problems span { display: inline-flex; align-items: center; gap: 3px; }
.ath-status-problems .ath-icon { width: 12px; height: 12px; }
.ath-status-problems.has-errors .ath-st-err { color: var(--orb-danger); font-weight: 700; }
body[data-view="welcome"] .ath-status-problems,
body[data-view="image"] .ath-status-problems { display: none; }

.ath-snippet-preview {
  margin: 0;
  max-width: 460px;
  max-height: 260px;
  overflow: auto;
  font-family: var(--ath-font-code);
  font-size: 12px;
  line-height: 1.5;
  white-space: pre;
  color: var(--orb-text-muted);
}

.ath-pane-title[data-badge]::after {
  content: attr(data-badge);
  margin-left: 8px;
  padding: 1px 6px;
  border-radius: var(--orb-radius-xs);
  background: var(--orb-primary-dim);
  color: var(--orb-primary-text);
  font-size: 0.625rem;
  letter-spacing: 0.04em;
}
.ath-preview-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--orb-space-3);
  background: color-mix(in srgb, var(--orb-surface) 88%, transparent);
  color: var(--orb-text-muted);
  font-size: 0.8125rem;
  z-index: 2;
}
.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 0.8s linear infinite;
}
