/* Oracle SQL 練習場 — 版面與主題 */

:root {
  color-scheme: light;
  --bg: #f6f5f3;
  --surface: #ffffff;
  --surface-2: #faf9f7;
  --border: #e3e0da;
  --border-strong: #cfcbc2;
  --text: #1b1a17;
  --text-muted: #6d6961;
  --accent: #a5382b;
  --accent-soft: #fbeae7;
  --accent-text: #8c2d22;
  --ok: #1a7f45;
  --ok-soft: #e6f4ec;
  --warn: #9a6104;
  --warn-soft: #fdf3e0;
  --err: #b3261e;
  --err-soft: #fdeceb;
  --code-bg: #f4f2ee;
  --shadow: 0 1px 2px rgba(27, 26, 23, .05), 0 6px 16px -10px rgba(27, 26, 23, .18);
  --radius: 10px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang TC", "Noto Sans TC",
          "Microsoft JhengHei", Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #131519;
    --surface: #1a1d22;
    --surface-2: #1f2229;
    --border: #2b2f37;
    --border-strong: #3c424c;
    --text: #e7e9ec;
    --text-muted: #9aa1ad;
    --accent: #e0745f;
    --accent-soft: #35211d;
    --accent-text: #f0a08c;
    --ok: #4ade80;
    --ok-soft: #14291d;
    --warn: #e0b054;
    --warn-soft: #2e2415;
    --err: #f0847c;
    --err-soft: #331c1b;
    --code-bg: #11141a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -14px rgba(0, 0, 0, .7);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #131519;
  --surface: #1a1d22;
  --surface-2: #1f2229;
  --border: #2b2f37;
  --border-strong: #3c424c;
  --text: #e7e9ec;
  --text-muted: #9aa1ad;
  --accent: #e0745f;
  --accent-soft: #35211d;
  --accent-text: #f0a08c;
  --ok: #4ade80;
  --ok-soft: #14291d;
  --warn: #e0b054;
  --warn-soft: #2e2415;
  --err: #f0847c;
  --err-soft: #331c1b;
  --code-bg: #11141a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -14px rgba(0, 0, 0, .7);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { line-height: 1.35; margin: 0; font-weight: 650; }

button { font: inherit; cursor: pointer; }

code, pre, textarea { font-family: var(--mono); }

/* ── 頂部列 ─────────────────────────────────────────────── */

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  padding: 12px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}

.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }

.logo {
  display: grid; place-items: center;
  width: 38px; height: 38px; flex: none;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  font: 700 13px/1 var(--mono);
  letter-spacing: .5px;
}

.brand h1 { font-size: 16px; }
.brand p { margin: 0; font-size: 12.5px; color: var(--text-muted); }

.topbar-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

.progress { display: flex; align-items: center; gap: 9px; font-size: 12.5px; color: var(--text-muted); }
.progress-track { width: 128px; height: 6px; border-radius: 99px; background: var(--border); overflow: hidden; }
.progress-fill { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--ok); transition: width .3s ease; }

.icon-btn {
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text-muted);
  border-radius: 8px; padding: 6px 11px; font-size: 12.5px; transition: .15s;
}
.icon-btn:hover { border-color: var(--border-strong); color: var(--text); }

/* ── 載入中 ─────────────────────────────────────────────── */

.loading { padding: 80px 20px; text-align: center; color: var(--text-muted); }
.loading .spinner {
  width: 26px; height: 26px; margin: 0 auto 14px;
  border: 2.5px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── 版面 ───────────────────────────────────────────────── */

.layout[hidden] { display: none; }
.layout {
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr) 312px;
  gap: 18px;
  max-width: 1680px;
  margin: 0 auto;
  padding: 18px 20px 48px;
  align-items: start;
}

.sidebar, .side-right { position: sticky; top: 74px; max-height: calc(100vh - 92px); overflow-y: auto; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ── 左側導覽 ───────────────────────────────────────────── */

.mode-tabs { display: flex; gap: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 4px; margin-bottom: 14px; }
.mode-tabs button {
  flex: 1; border: 0; background: transparent; color: var(--text-muted);
  padding: 6px 4px; border-radius: 6px; font-size: 12.5px; transition: .15s;
}
.mode-tabs button:hover { color: var(--text); }
.mode-tabs button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); font-weight: 600; }

.nav-group { margin-bottom: 16px; }
.nav-group-title {
  font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  color: var(--text-muted); padding: 0 6px 6px;
}

.nav-topic { margin-bottom: 4px; }
.nav-topic > summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; gap: 7px;
  padding: 6px 8px; border-radius: 7px;
  font-size: 13.5px; font-weight: 600;
}
.nav-topic > summary::-webkit-details-marker { display: none; }
.nav-topic > summary::before {
  content: "›"; display: inline-block; width: 10px; flex: none;
  color: var(--text-muted); transition: transform .15s;
}
.nav-topic[open] > summary::before { transform: rotate(90deg); }
.nav-topic > summary:hover { background: var(--surface-2); }
.nav-count { margin-left: auto; font: 500 11px var(--mono); color: var(--text-muted); }
.nav-count.done { color: var(--ok); }

.nav-item {
  display: flex; align-items: center; gap: 8px; width: 100%;
  border: 0; background: transparent; color: var(--text-muted);
  text-align: left; padding: 5px 8px 5px 25px; border-radius: 7px;
  font-size: 13px; line-height: 1.45; transition: .12s;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.nav-item .tick { flex: none; width: 13px; color: var(--ok); font-size: 12px; }

/* ── 題目卡 ─────────────────────────────────────────────── */

.main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

.prompt-card { padding: 18px 20px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 9px; }
.chip {
  font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 99px;
  background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border);
}
.chip.topic { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; }
.chip.solved { background: var(--ok-soft); color: var(--ok); border-color: transparent; }

.prompt-card h2 { font-size: 19px; margin-bottom: 8px; }
.prompt-body { margin: 0; white-space: pre-wrap; color: var(--text); }

.hint { margin-top: 12px; border-top: 1px dashed var(--border); padding-top: 10px; }
.hint summary { cursor: pointer; font-size: 13px; color: var(--accent-text); font-weight: 600; list-style: none; }
.hint summary::-webkit-details-marker { display: none; }
.hint summary::before { content: "💡 "; }
.hint p { margin: 8px 0 0; font-size: 13.5px; color: var(--text-muted); }

/* ── 編輯器 ─────────────────────────────────────────────── */

.editor-card { overflow: hidden; }
.editor-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 9px 14px; border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 12.5px; font-weight: 600; color: var(--text-muted);
}
.kbd-hint { font: 400 11.5px var(--mono); }

.editor-wrap { display: flex; background: var(--code-bg); }
.gutter {
  padding: 12px 0 12px 12px; flex: none; min-width: 34px;
  text-align: right; user-select: none;
  font: 13.5px/1.6 var(--mono); color: var(--text-muted); opacity: .55;
}
#sqlInput, #sandboxInput {
  flex: 1; min-width: 0;
  border: 0; outline: none; resize: vertical;
  background: transparent; color: var(--text);
  padding: 12px 14px; min-height: 190px;
  font: 13.5px/1.6 var(--mono);
  tab-size: 2;
}

.toolbar { display: flex; flex-wrap: wrap; gap: 8px; padding: 11px 14px; border-top: 1px solid var(--border); background: var(--surface-2); }

.btn {
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  border-radius: 8px; padding: 7px 15px; font-size: 13.5px; font-weight: 550; transition: .15s;
}
.btn:hover { border-color: var(--text-muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--text-muted); }
.btn.ghost:hover { background: var(--surface); color: var(--text); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn .spacer { margin-left: auto; }

/* ── 批改回饋 ───────────────────────────────────────────── */

.feedback { border-radius: var(--radius); border: 1px solid; padding: 14px 16px; font-size: 14px; }
.feedback h3 { font-size: 14.5px; margin-bottom: 4px; display: flex; align-items: center; gap: 7px; }
.feedback p { margin: 4px 0 0; white-space: pre-wrap; }
.feedback pre {
  margin: 10px 0 0; padding: 10px 12px; border-radius: 7px;
  background: var(--code-bg); font-size: 12.5px; line-height: 1.55;
  overflow-x: auto; white-space: pre-wrap; color: var(--text-muted);
}
.feedback.ok   { background: var(--ok-soft);   border-color: color-mix(in srgb, var(--ok) 35%, transparent);   color: var(--text); }
.feedback.ok h3 { color: var(--ok); }
.feedback.bad  { background: var(--err-soft);  border-color: color-mix(in srgb, var(--err) 35%, transparent);  color: var(--text); }
.feedback.bad h3 { color: var(--err); }
.feedback.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 35%, transparent); color: var(--text); }
.feedback.warn h3 { color: var(--warn); }

/* ── 結果表格 ───────────────────────────────────────────── */

.result-card { overflow: hidden; }
.result-head {
  display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 9px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2);
  font-size: 12.5px; color: var(--text-muted);
}
.result-head strong { color: var(--text); font-weight: 600; }
.table-scroll { overflow-x: auto; max-height: 460px; }
table.result { border-collapse: collapse; width: 100%; font-size: 13px; }
table.result th, table.result td {
  padding: 7px 13px; text-align: left; white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
table.result th {
  position: sticky; top: 0; z-index: 1;
  background: var(--surface-2); font: 600 12px var(--mono);
  color: var(--text-muted); letter-spacing: .02em;
}
table.result td { font-family: var(--mono); font-size: 12.5px; }
table.result tbody tr:hover td { background: var(--surface-2); }
table.result td.num { text-align: right; }
table.result td.null { color: var(--text-muted); font-style: italic; opacity: .7; }

/* ── 右側面板 ───────────────────────────────────────────── */

.panel-tabs { display: flex; gap: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 4px; margin-bottom: 12px; }
.panel-tabs button { flex: 1; border: 0; background: transparent; color: var(--text-muted); padding: 6px 2px; border-radius: 6px; font-size: 12.5px; }
.panel-tabs button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); font-weight: 600; }

.panel[hidden] { display: none; }
.panel { display: flex; flex-direction: column; gap: 10px; }
.panel-card { padding: 12px 14px; }
.panel-card h4 { margin: 0 0 7px; font-size: 13px; display: flex; align-items: center; gap: 7px; }
.panel-card h4 .tag { font: 500 10.5px var(--mono); color: var(--text-muted); font-weight: 400; }

.col-list { list-style: none; margin: 0; padding: 0; font-size: 12.5px; }
.col-list li { display: flex; gap: 8px; padding: 3px 0; border-bottom: 1px dotted var(--border); }
.col-list li:last-child { border-bottom: 0; }
.col-name { font: 600 12px var(--mono); color: var(--accent-text); flex: none; }
.col-type { font: 400 10.5px var(--mono); color: var(--text-muted); flex: none; }
.col-note { color: var(--text-muted); margin-left: auto; text-align: right; font-size: 11.5px; }

.panel pre.syntax {
  margin: 0; padding: 11px 12px; border-radius: 8px; background: var(--code-bg);
  font-size: 12px; line-height: 1.6; overflow-x: auto; color: var(--text);
  border: 1px solid var(--border);
}
.panel .summary-text { font-size: 12.5px; color: var(--text-muted); margin: 0 0 9px; }

.dialect-list { list-style: none; margin: 0; padding: 0; }
.dialect-list li { padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 12.5px; }
.dialect-list li:last-child { border-bottom: 0; }
.dialect-list b { display: block; font: 600 12px var(--mono); color: var(--accent-text); margin-bottom: 2px; }
.dialect-list span { color: var(--text-muted); }

/* ── 自由查詢 ───────────────────────────────────────────── */

.sandbox-note { font-size: 13px; color: var(--text-muted); margin: 0; }

footer {
  padding: 22px 20px 34px; text-align: center;
  font-size: 12.5px; color: var(--text-muted);
  border-top: 1px solid var(--border);
}
footer a { color: var(--accent-text); }

/* ── 響應式 ─────────────────────────────────────────────── */

@media (max-width: 1180px) {
  .layout { grid-template-columns: 228px minmax(0, 1fr); }
  .side-right { grid-column: 1 / -1; position: static; max-height: none; }
  .panel { flex-direction: row; flex-wrap: wrap; }
  .panel > * { flex: 1 1 290px; }
}

@media (max-width: 820px) {
  body { font-size: 14.5px; }
  .layout { grid-template-columns: minmax(0, 1fr); padding: 14px 16px 40px; gap: 14px; }
  .sidebar { position: static; max-height: 300px; }
  .topbar { padding: 10px 16px; }
  .brand p { display: none; }
  .panel > * { flex: 1 1 100%; }
}

/* ── 編輯器輸入提示 ───────────────────────────────────────── */
.ac-box {
  position: fixed; z-index: 60;
  min-width: 240px; max-width: 420px; max-height: 236px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 8px; box-shadow: var(--shadow); padding: 4px;
}
.ac-item {
  display: flex; align-items: baseline; gap: 8px;
  padding: 5px 8px; border-radius: 6px; cursor: pointer;
  font-size: 13px; white-space: nowrap;
}
.ac-item.active { background: var(--accent-soft); }
.ac-item:hover { background: var(--surface-2); }
.ac-item.active:hover { background: var(--accent-soft); }
.ac-kind {
  flex: none; font-size: 10.5px; font-weight: 600; letter-spacing: .02em;
  padding: 1px 5px; border-radius: 4px; color: var(--text-muted); background: var(--code-bg);
}
.ac-資料表 { color: var(--accent-text); background: var(--accent-soft); }
.ac-欄位 { color: var(--ok); background: var(--ok-soft); }
.ac-函數 { color: var(--warn); background: var(--warn-soft); }
.ac-text { font-family: var(--mono); font-weight: 550; color: var(--text); }
.ac-meta {
  margin-left: auto; padding-left: 10px;
  font-size: 11.5px; color: var(--text-muted);
  overflow: hidden; text-overflow: ellipsis;
}

/* ── 解答密碼 ─────────────────────────────────────────────── */
.pw-overlay[hidden] { display: none; }
.pw-overlay {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(20, 19, 17, .55); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.pw-panel {
  background: var(--bg); border: 1px solid var(--border-strong);
  border-radius: 14px; box-shadow: var(--shadow);
  width: min(400px, 100%); padding: 22px;
  display: flex; flex-direction: column; gap: 10px;
}
.pw-panel h2 { font-size: 16px; margin: 0; }
.pw-note { margin: 0; font-size: 13px; line-height: 1.6; color: var(--text-muted); }
.pw-input {
  font: inherit; padding: 9px 11px;
  border: 1px solid var(--border-strong); border-radius: 8px;
  background: var(--surface); color: var(--text);
}
.pw-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.pw-error[hidden] { display: none; }
.pw-error { margin: 0; font-size: 12.5px; color: var(--err); }
.pw-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 2px; }

/* ── 資料表關聯圖 ─────────────────────────────────────────── */
.dg-overlay[hidden] { display: none; }
.dg-overlay {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(20, 19, 17, .55); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.dg-panel {
  background: var(--bg); border: 1px solid var(--border-strong);
  border-radius: 14px; box-shadow: var(--shadow);
  width: min(1420px, 100%); max-height: 100%;
  display: flex; flex-direction: column; overflow: hidden;
}
.dg-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 18px; border-bottom: 1px solid var(--border); background: var(--surface);
}
.dg-bar h2 { font-size: 16px; margin: 0; }
.dg-hint { margin-left: auto; font-size: 12px; color: var(--text-muted); }
.dg-body { overflow: auto; padding: 18px; }

.dg-scroll { overflow-x: auto; padding-bottom: 6px; }
.dg-canvas { position: relative; }
.dg-svg { position: absolute; inset: 0; overflow: visible; pointer-events: none; }
.dg-svg path, .dg-svg circle { pointer-events: auto; }
.dg-link {
  fill: none; stroke: var(--accent); stroke-width: 1.6;
  stroke-linejoin: round; stroke-linecap: round; opacity: .65;
}
.dg-link:hover { opacity: 1; stroke-width: 2.6; }
.dg-arrow { fill: var(--accent); }
.dg-dot { fill: var(--accent); opacity: .75; }

.dg-card {
  position: absolute;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 10px; box-shadow: var(--shadow); overflow: hidden;
}
.dg-head {
  display: flex; align-items: baseline; gap: 8px;
  height: 38px; padding: 0 12px;
  background: var(--accent-soft); border-bottom: 1px solid var(--border);
}
.dg-head b { font: 600 14px var(--mono); color: var(--accent-text); }
.dg-head span { margin-left: auto; font-size: 11px; color: var(--text-muted); }
.dg-row {
  display: flex; align-items: center; gap: 7px;
  height: 25px; padding: 0 12px; font-size: 12px;
}
.dg-row:hover { background: var(--surface-2); }
.dg-key {
  flex: none; width: 21px; font-size: 9px; font-weight: 700; text-align: center;
  border-radius: 3px; line-height: 14px; color: transparent;
}
.dg-pk { background: var(--warn-soft); color: var(--warn); }
.dg-fk { background: var(--accent-soft); color: var(--accent-text); }
.dg-col { font-family: var(--mono); color: var(--text); }
.dg-type { margin-left: auto; font-size: 10.5px; color: var(--text-muted); }
.dg-null {
  flex: none; font-size: 9px; font-weight: 700; line-height: 14px;
  padding: 0 4px; border-radius: 3px; background: var(--code-bg); color: var(--text-muted);
}

.dg-legend { margin-top: 18px; font-size: 13px; color: var(--text-muted); line-height: 1.75; }
.dg-legend-row { display: flex; flex-wrap: wrap; gap: 18px; margin-bottom: 10px; }
.dg-legend-row span { display: inline-flex; align-items: center; gap: 6px; }
.dg-note { margin: 10px 0 4px; }
.dg-note b { color: var(--text); }
.dg-soft { margin: 0 0 4px; padding-left: 20px; }
.dg-soft code { font-size: 12px; background: var(--code-bg); padding: 1px 5px; border-radius: 4px; }

@media (max-width: 720px) {
  .dg-overlay { padding: 0; }
  .dg-panel { border-radius: 0; height: 100%; width: 100%; }
  .dg-body { padding: 12px; }
}

/* ── 語法小動畫 ─────────────────────────────────────────── */

.an-box {
  margin: 0 0 10px; padding: 8px 6px 7px; border-radius: 8px;
  background: var(--surface-2); border: 1px solid var(--border);
}

.an-viewport {
  overflow-x: auto;
  /* 少數步驟兩張表並排真的塞不下，留一條細捲軸讓它捲，不要硬擠 */
  scrollbar-width: thin;
  padding-bottom: 2px;
}

.an-stage { display: flex; flex-direction: column; gap: 4px; min-width: min-content; }

.an-tables { display: flex; align-items: flex-start; justify-content: center; gap: 4px; }

/* 兩張表中間的運算子標記 */
.an-op {
  flex: none; align-self: center; font: 600 9.5px var(--mono); letter-spacing: .02em;
  color: var(--accent-text); background: var(--accent-soft);
  border: 1px solid var(--border); border-radius: 4px;
  padding: 2px 3px; max-width: 70px; text-align: center; line-height: 1.3;
  overflow-wrap: anywhere;
}

.an-table { flex: 0 1 auto; min-width: 0; }
.an-tname {
  font: 600 9.5px var(--mono); color: var(--text-muted); line-height: 1.4;
  margin-bottom: 3px; overflow-wrap: anywhere;
}

.an-table table {
  border-collapse: collapse; width: 100%;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 5px;
}
.an-table th {
  font: 600 9px var(--mono); color: var(--text-muted); text-align: left;
  padding: 3px 3px; border-bottom: 1px solid var(--border-strong);
  white-space: nowrap;
}
.an-table td {
  font: 400 10px var(--mono); color: var(--text);
  padding: 3px 3px; border-bottom: 1px dotted var(--border);
  white-space: nowrap;
}
.an-table tr:last-child td { border-bottom: 0; }

/* 每一列的三種狀態：命中、被排除、補 NULL */
.an-row { transition: background-color .35s ease, opacity .35s ease; }
.an-row.is-hit  { background: var(--ok-soft); }
.an-row.is-hit td { color: var(--ok); font-weight: 600; }
.an-row.is-miss { opacity: .35; text-decoration: line-through; }
.an-row.is-null { background: var(--warn-soft); }

.an-null { font: 600 9px var(--mono); color: var(--warn); letter-spacing: .03em; }

.an-out { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.an-arrowdown { font-size: 9px; color: var(--text-muted); line-height: 1; }
.an-out .an-table { min-width: 40%; }

.an-note {
  margin: 7px 0 0; font-size: 11.5px; line-height: 1.55; color: var(--text);
  min-height: 3.1em;
}

.an-ctrl { display: flex; align-items: center; gap: 4px; margin-top: 6px; }
.an-btn {
  flex: none; border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--text); border-radius: 5px; padding: 1px 7px;
  font-size: 11px; line-height: 1.7; transition: .15s;
}
.an-btn:hover { border-color: var(--accent); color: var(--accent-text); }
.an-play { font-size: 9.5px; min-width: 26px; }

.an-dots { display: flex; gap: 4px; margin-left: 3px; }
.an-dot {
  width: 6px; height: 6px; border-radius: 99px; background: var(--border-strong);
  cursor: pointer; transition: .2s;
}
.an-dot:hover { background: var(--text-muted); }
.an-dot.on { background: var(--accent); transform: scale(1.25); }

.an-count { margin-left: auto; font: 400 10px var(--mono); color: var(--text-muted); }

@media (prefers-reduced-motion: reduce) {
  .an-row, .an-dot { transition: none; }
}
