


.theme-btn {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--fg);
  border-radius: var(--radius-md);
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: border-color .15s;
}
.theme-btn:hover { border-color: var(--accent); }

.theme-btn svg { width: 14px; height: 14px; stroke: currentColor; flex-shrink: 0; }


.lang-wrap { position: relative; }
.lang-btn-ico { width: 14px; height: 14px; stroke: currentColor; flex-shrink: 0; }
.lang-cur { min-width: 20px; text-align: center; }
.lang-menu {
  position: absolute;
  top: calc(100% + 6px);
  inset-inline-end: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 6px;
  min-width: 158px;
  
  max-height: min(60vh, 420px);
  overflow-y: auto;
  display: none;
  flex-direction: column;
  gap: 2px;
  box-shadow: 0 12px 32px rgba(0,0,0,.12);
  z-index: 50;
}
[data-theme="dark"] .lang-menu { box-shadow: 0 12px 32px rgba(0,0,0,.55); }
.lang-menu.open { display: flex; }
.lang-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: start;
  background: none;
  border: none;
  color: var(--fg);
  font-size: 13px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.lang-opt:hover { background: var(--accent-soft); }
.lang-opt.active { font-weight: 600; }


@media (max-width: 640px) {
  
  .theme-btn, .lang-opt { min-height: 44px; }

  
  .lang-cur { display: none; }
  #langBtn { padding: 0 10px; gap: 6px; }

  
  #themeBtn { gap: 0; width: 44px; padding: 0; justify-content: center; }
  #themeBtn .theme-btn-txt { display: none; }

  
  .theme-btn.ico-txt span { display: none; }
  .theme-btn.ico-txt { gap: 0; padding: 6px 9px; }
}




.code-block { position: relative; }


.code-copy {
  position: absolute;
  top: 8px;
  inset-inline-end: 8px;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--muted);
  cursor: pointer;
  opacity: 0;                 
  transition: opacity .15s, border-color .15s, color .15s;
}
.code-block:hover .code-copy,
.code-copy:focus-visible { opacity: 1; }
.code-copy:hover { border-color: var(--accent); color: var(--fg); }
.code-copy svg { width: 14px; height: 14px; flex: none; }


.code-copy.copied { color: var(--accent); border-color: var(--accent); }


.ui-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  max-width: min(86vw, 420px);
  background: var(--fg);
  color: var(--bg);
  font-size: 13px;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
  z-index: 9999;
}
.ui-toast.show { opacity: 1; }
.ui-toast.err { background: var(--danger, #dc2626); color: #fff; }


@media (max-width: 640px) {
  .code-copy { opacity: 1; width: 44px; height: 44px; }
  
  .code-block pre { padding-top: 52px !important; }
}


.hdr-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; line-height: 1.2; color: var(--muted);
  text-decoration: none; background: none; border: 0; border-radius: 0;
  padding: 4px 2px; white-space: nowrap; transition: color .15s;
}
.hdr-link:hover { color: var(--fg); }
.hdr-link svg { width: 14px; height: 14px; stroke: currentColor; flex-shrink: 0; }


.cb { position: relative; }
.cb .cb-input { width: 100%; }
.cb .cb-list {
  position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 4px);
  max-height: 260px; overflow-y: auto;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 4px;
}

.cb::after {
  content: ''; position: absolute; right: 12px; top: 50%; width: 0; height: 0;
  margin-top: -2px; pointer-events: none;
  border-left: 4px solid transparent; border-right: 4px solid transparent;
  border-top: 5px solid var(--muted);
}
.cb:focus-within::after { border-top-color: var(--fg); }
.cb.open::after { transform: rotate(180deg); margin-top: -3px; }
.cb .cb-input { padding-right: 30px; }
.cb .cb-count { padding: 4px 10px 2px; color: var(--muted); font-size: 11px; }
.cb .cb-item {
  padding: 6px 10px; border-radius: var(--radius-sm); font-size: 13px; cursor: pointer;
  white-space: nowrap; overflow: hidden;
}
.cb .cb-item.on { background: var(--accent-soft); }
.cb .cb-item.sel { font-weight: 600; }
.cb .cb-ellip { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cb .cb-empty { padding: 8px 10px; color: var(--muted); font-size: 12px; }


td.cell-models { max-width: 360px; cursor: pointer; }
td.cell-models .cell-brief { display: flex; align-items: center; gap: 8px; }
td.cell-models .cm-names { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
td.cell-models .cell-all { display: none; max-height: 220px; overflow: auto; line-height: 1.85; }
td.cell-models.open .cell-brief { display: none; }
td.cell-models.open .cell-all { display: block; }
