/* TIBIU shared components.
 * One component set for every template: grey page, white 12px group cards, 56px rows,
 * 24px line icons, 30/36/44 buttons with >=44px hit areas, outline/text/check selection.
 * Colours come from the 2026 skin tokens (--ui-*); no new brand colours.
 * Spec and migration status: docs/php-front-components.md */

:where(body) {
  --tb-bg: var(--ui-soft, #f1f1f1);
  --tb-surface: var(--ui-surface, #fff);
  --tb-ink: var(--ui-ink, #14171a);
  --tb-ink-2: var(--ui-secondary, #4f555b);
  --tb-muted: var(--ui-muted, #6b7279);
  --tb-line: var(--ui-line, #e5e7ea);
  --tb-line-strong: var(--ui-line-strong, #d6d9dd);
  --tb-primary: var(--ui-primary, #2196f3);
  --tb-primary-hover: var(--ui-primary-hover, #1e88e5);
  --tb-danger: var(--ui-danger, #c9353f);
  --tb-success: var(--ui-success, #147e56);
  --tb-mask: rgb(0 0 0 / 40%);
  --tb-press: rgb(0 0 0 / 4%);
  --tb-shadow-pop: 0 4px 16px rgb(17 24 39 / 10%);
  --tb-radius-card: 12px;
  --tb-radius-control: 8px;
  --tb-radius-sheet: 20px;
  --tb-radius-dialog: 16px;
  --tb-radius-pill: 999px;
  --tb-gutter: 16px;
  --tb-row-h: 56px;
  --tb-icon: 24px;
  --tb-hit: 44px;
  --tb-shell: 860px;
  /* Neutral fills: ChatGPT-style filled inputs, X-style hairlines; the near-black primary button. */
  --tb-fill: #f4f4f4;
  --tb-divider: #eff3f4;
  --tb-btn-primary: var(--tb-ink);
  --tb-btn-primary-hover: #2f3336;
}

/* ---------- Page ---------- */
body[data-tibiu-skin].tb-page:not([data-tibiu-page="reader"]),
body.tb-page {
  background: var(--tb-bg) !important;
}
.tb-shell {
  box-sizing: border-box;
  width: min(var(--tb-shell), calc(100% - 30px));
  margin: 0 auto;
  padding: 12px 0 32px;
}
.tb-shell--wide { --tb-shell: 1170px; }
/* Content / feed pages: lists run edge to edge on phones (white page, no side gutter). */
.tb-shell--flush { width: min(var(--tb-shell), 100%); }

/* ---------- Icons ---------- */
.tb-icon {
  --ti-icon-size: var(--tb-icon-size, 24px) !important;
  display: inline-flex;
  flex: none;
  width: var(--tb-icon-size, 24px);
  height: var(--tb-icon-size, 24px);
}
.tb-icon--16 { --tb-icon-size: 16px; }
.tb-icon--20 { --tb-icon-size: 20px; }
.tb-icon--32 { --tb-icon-size: 32px; }
.tb-icon--text { --tb-icon-size: 1.25em; vertical-align: -0.25em; }

/* ---------- Top bar (two layers: full-width outer, centred inner) ---------- */
.tb-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--tb-topbar-bg, var(--tb-surface));
}
/* White on every page; the hairline shows only after scrolling (js/core/ui.js: data-ti-scroll-header -> .is-scrolled). */
.tb-topbar { box-shadow: inset 0 -1px 0 transparent; transition: box-shadow .2s ease; }
.tb-topbar:is(.is-scrolled, [data-ti-scrolled]) { box-shadow: inset 0 -1px 0 var(--tb-divider); }
.tb-topbar__inner {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: minmax(var(--tb-hit), 1fr) minmax(0, auto) minmax(var(--tb-hit), 1fr);
  align-items: center;
  width: min(var(--tb-shell), calc(100% - 30px));
  min-height: 48px;
  margin: 0 auto;
}
.tb-topbar__back { grid-column: 1; justify-self: start; margin-left: -10px; }
.tb-topbar__title {
  grid-column: 2;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: var(--tb-ink);
  font-size: 17px;
  font-weight: 500;
  line-height: 1.4;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tb-topbar__actions {
  grid-column: 3;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-right: -10px;
}
.tb-topbar__actions > .tb-btn--text { margin-right: 2px; }
/* Left-aligned title, for top bars whose actions are text buttons. */
.tb-topbar--start .tb-topbar__inner { grid-template-columns: var(--tb-hit) minmax(0, 1fr) auto; column-gap: 4px; }
.tb-topbar--start .tb-topbar__title { text-align: left; }
.tb-topbar--start .tb-topbar__actions { gap: 0; }
.tb-topbar .is-skeleton-chip { width: 56px; height: 20px; padding: 0; border-radius: 4px; background: var(--tb-bg); }
@media (min-width: 761px) {
  .tb-topbar__inner { min-height: 56px; }
}

/* ---------- Icon button ---------- */
.tb-icon-btn {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: var(--tb-hit);
  height: var(--tb-hit);
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--tb-ink);
  font: inherit;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.tb-icon-btn :is(ti-icon, svg) {
  --ti-icon-size: var(--tb-icon) !important;
  width: var(--tb-icon);
  height: var(--tb-icon);
}
.tb-icon-btn:active { background: var(--tb-press); }
@media (hover: hover) { .tb-icon-btn:hover { background: var(--tb-press); } }

/* Components set display, so honour the hidden attribute explicitly. */
:is([class^="tb-"], [class*=" tb-"])[hidden] { display: none !important; }

/* ---------- Group card and rows ---------- */
.tb-group { margin: 0 0 12px; }
.tb-group__title {
  margin: 0;
  padding: 12px var(--tb-gutter) 8px;
  color: var(--tb-muted);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
}
.tb-card {
  overflow: hidden;
  border-radius: var(--tb-radius-card);
  background: var(--tb-surface);
}
.tb-card--pad { padding: var(--tb-gutter); }
.tb-group__footer { margin: 0; padding: 8px var(--tb-gutter) 0; color: var(--tb-muted); font-size: 13px; line-height: 1.5; }
.tb-group__footer a { color: var(--tb-primary); word-break: break-all; }
.tb-row {
  position: relative;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: var(--tb-row-h);
  margin: 0;
  padding: 8px var(--tb-gutter);
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--tb-ink);
  font: inherit;
  font-size: 16px;
  line-height: 1.4;
  text-align: left;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
:is(a, button, label).tb-row { cursor: pointer; }
/* Divider above every row that has a visible row before it (hidden rows don't count). */
.tb-row:not([hidden]) ~ .tb-row::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: var(--tb-row-inset, var(--tb-gutter));
  border-top: 1px solid var(--tb-divider);
  pointer-events: none;
}
.tb-row:has(> .tb-row__icon) { --tb-row-inset: calc(var(--tb-gutter) + var(--tb-icon) + 12px); }
:is(a, button, label).tb-row:active { background: var(--tb-press); }
@media (hover: hover) { :is(a, button, label).tb-row:hover { background: var(--tb-press); } }
.tb-row__icon {
  --ti-icon-size: var(--tb-icon) !important;
  display: inline-flex;
  flex: 0 0 var(--tb-icon);
  width: var(--tb-icon);
  height: var(--tb-icon);
  color: var(--tb-ink);
}
.tb-row__body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.tb-row__title {
  overflow: hidden;
  color: inherit;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tb-row__desc {
  color: var(--tb-muted);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
}
.tb-row__desc--clip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-row:has(> .tb-avatar) { --tb-row-inset: calc(var(--tb-gutter) + 52px); }
.tb-row__value {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 55%;
  overflow: hidden;
  color: var(--tb-muted);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.4;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tb-row__chevron {
  --ti-icon-size: 16px !important;
  display: inline-flex;
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  margin-left: -6px;
  color: var(--tb-muted);
}
.tb-row__check {
  --ti-icon-size: 20px !important;
  display: inline-flex;
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  color: var(--tb-primary);
}
/* Selectable option row (radio-like): ✓ and primary title when selected, no tinted fill. */
.tb-row--option { cursor: pointer; }
.tb-row--option .tb-row__check { visibility: hidden; }
.tb-row--option:is(.is-selected, .select, [aria-checked="true"]) .tb-row__check { visibility: visible; }
.tb-row--option:is(.is-selected, .select, [aria-checked="true"]) .tb-row__title { color: var(--tb-primary); }
@media (hover: hover) { .tb-row--option:hover { background: var(--tb-press); } }
.tb-row--center { justify-content: center; }
.tb-row--center .tb-row__title { flex: none; }
.tb-row--danger { color: var(--tb-danger); }

/* ---------- Stats strip: <div class="tb-card tb-stats"><a><strong>12</strong><span>收藏</span></a>…</div> ---------- */
.tb-stats { display: grid; grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; padding: 14px 0; }
.tb-stats > * { display: grid; gap: 2px; min-width: 0; color: var(--tb-ink); text-align: center; text-decoration: none; }
.tb-stats strong { overflow: hidden; font-size: 18px; font-weight: 500; line-height: 1.4; text-overflow: ellipsis; }
.tb-stats > * > span { color: var(--tb-muted); font-size: 12px; line-height: 1.5; }

/* Rows inside a shared drawer run edge to edge and line up with the drawer title. */
.type2-drawer-body > .tb-card {
  --tb-gutter: var(--type2-drawer-pad, 16px);
  margin-inline: calc(var(--type2-drawer-pad, 16px) * -1);
  border-radius: 0;
}
/* Grouped drawer: grey sheet holding white tb-card groups, like a settings page. */
.tb-drawer--grouped .type2-drawer-panel { background: var(--tb-bg); }

/* ---------- Switch: <input type="checkbox" class="tb-switch"> or <button role="switch" aria-checked> ---------- */
.tb-switch {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  flex: none;
  box-sizing: border-box;
  width: 44px;
  height: 26px;
  margin: 0;
  padding: 0;
  border: 0 !important;
  border-radius: 13px !important;
  background: var(--tb-line-strong) !important;
  cursor: pointer;
  transition: background-color .2s ease;
  vertical-align: middle;
}
.tb-switch::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgb(0 0 0 / 20%);
  transition: transform .2s ease;
}
.tb-switch:is(:checked, [aria-checked="true"], .is-on) { background: var(--tb-primary) !important; }
.tb-switch:is(:checked, [aria-checked="true"], .is-on)::before { transform: translateX(18px); }
.tb-switch:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Buttons: 30 / 36 / 44 visible, hit area >= 44 ---------- */
.tb-btn {
  position: relative;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  margin: 0;
  padding: 0 16px;
  border: 1px solid var(--tb-line-strong);
  border-radius: var(--tb-radius-pill);
  background: var(--tb-surface);
  color: var(--tb-ink);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.tb-btn::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 0;
  left: 0;
  height: max(100%, var(--tb-hit));
  transform: translateY(-50%);
}
.tb-btn :is(ti-icon, svg) {
  --ti-icon-size: 1.25em !important;
  width: 1.25em;
  height: 1.25em;
  flex: none;
}
.tb-btn--sm { height: 30px; padding: 0 12px; font-size: 13px; }
.tb-btn--lg { height: 44px; padding: 0 20px; font-size: 16px; }
.tb-btn--block { display: flex; width: 100%; }
.tb-btn--primary { border-color: transparent; background: var(--tb-btn-primary); color: #fff; }
.tb-btn--text { padding: 0 8px; border-color: transparent; background: transparent; color: var(--tb-primary); }
.tb-btn--danger { color: var(--tb-danger); }
.tb-btn:active { filter: brightness(.96); }
@media (hover: hover) {
  .tb-btn:hover { background: var(--tb-press); }
  .tb-btn--primary:hover { border-color: transparent; background: var(--tb-btn-primary-hover); }
  .tb-btn--text:hover { border-color: transparent; background: transparent; color: var(--tb-primary-hover); }
}
.tb-btn:is(:disabled, [aria-disabled="true"]) { opacity: .5; cursor: not-allowed; filter: none; }
/* Busy: js/pages/user/auth.js / TibiuUI set [loading] while a request is in flight */
.tb-btn:is([loading], .is-loading) { pointer-events: none; }
.tb-btn:is([loading], .is-loading)::before {
  content: "";
  box-sizing: border-box;
  flex: none;
  width: 1em;
  height: 1em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: tb-spin .72s linear infinite;
}
@keyframes tb-spin { to { transform: rotate(360deg); } }
.tb-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.tb-actions--end { justify-content: flex-end; }
.tb-actions--section { margin: 24px 0 12px; }
.tb-actions--section > .tb-btn--block { flex: 1 1 100%; }
.tb-form { display: grid; gap: 16px; }

/* ---------- Tabs (underline) and chips (outline when selected) ---------- */
.tb-tabs {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tb-tabs::-webkit-scrollbar { display: none; }
.tb-shell > .tb-tabs { padding: 0 var(--tb-gutter); }
.tb-tab {
  position: relative;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  flex: none;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--tb-muted);
  font: inherit;
  font-size: 15px;
  font-weight: 400;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.tb-tab:is(.is-active, .active, [aria-selected="true"], [aria-current="page"]) { color: var(--tb-ink); font-weight: 600; }
.tb-tab:is(.is-active, .active, [aria-selected="true"], [aria-current="page"])::after {
  content: "";
  position: absolute;
  bottom: 4px;
  left: 50%;
  width: 20px;
  height: 3px;
  border-radius: 2px;
  background: var(--tb-primary);
  transform: translateX(-50%);
}
/* js/core/ui.js marks the row [data-ti-tab-indicator] and sets --ti-tab-center: one bar that slides between tabs. */
.tb-tabs[data-ti-tab-indicator] { position: relative; }
.tb-tabs[data-ti-tab-indicator] > .tb-tab::after { content: none; }
.tb-tabs[data-ti-tab-indicator]::after {
  content: "";
  position: absolute;
  bottom: 4px;
  left: 0;
  width: 20px;
  height: 3px;
  border-radius: 2px;
  background: var(--tb-primary);
  transform: translateX(calc(var(--ti-tab-center, 0px) - 10px));
  transition: transform .2s ease;
  pointer-events: none;
}
.tb-tab__count { margin-left: 4px; color: var(--tb-muted); font-size: 12px; font-weight: 400; }
.tb-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.tb-chip {
  position: relative;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 32px;
  margin: 0;
  padding: 0 12px;
  border: 1px solid var(--tb-line);
  border-radius: var(--tb-radius-pill);
  background: var(--tb-surface);
  color: var(--tb-ink-2);
  font: inherit;
  font-size: 13px;
  font-weight: 400;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.tb-chip::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 0;
  left: 0;
  height: var(--tb-hit);
  transform: translateY(-50%);
}
.tb-chip:is(.is-active, .active, .on, [aria-pressed="true"], [aria-selected="true"], [aria-checked="true"]) {
  border-color: var(--tb-ink);
  color: var(--tb-ink);
  font-weight: 500;
}

/* ---------- Form fields and search ---------- */
.tb-field { display: grid; gap: 6px; min-width: 0; }
.tb-field__label { color: var(--tb-ink); font-size: 14px; font-weight: 500; line-height: 1.4; }
.tb-field__hint { margin: 0; color: var(--tb-muted); font-size: 12px; line-height: 1.5; }
.tb-field-grid { display: grid; grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; gap: 12px; }
.tb-form__title { margin: 0; color: var(--tb-ink); font-size: 17px; font-weight: 500; line-height: 1.4; }
.tb-check { display: flex; align-items: flex-start; gap: 10px; color: var(--tb-ink-2); font-size: 14px; line-height: 1.6; cursor: pointer; }
.tb-check > input { flex: none; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--tb-primary); }
/* Live status line under a form: <p class="tb-status" role="status" data-error="true|false"> */
.tb-status { margin: 12px var(--tb-gutter) 0; color: var(--tb-ink-2); font-size: 14px; line-height: 1.6; }
.tb-status:empty { display: none; }
.tb-status[data-error="true"] { color: var(--tb-danger); }
.tb-input,
.tb-select,
.tb-textarea {
  box-sizing: border-box;
  width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: var(--tb-radius-pill);
  background: var(--tb-fill);
  color: var(--tb-ink);
  font: inherit;
  font-size: 15px;
  line-height: 1.4;
  outline: none;
}
.tb-textarea { min-height: 96px; border-radius: 16px; resize: vertical; }
:is(.tb-input, .tb-select, .tb-textarea):focus { border-color: var(--tb-line-strong); }
:is(.tb-input, .tb-select, .tb-textarea)::placeholder { color: var(--tb-muted); opacity: 1; }
:is(.tb-input, .tb-select, .tb-textarea)[readonly] { border-color: transparent; color: var(--tb-muted); }
.tb-search {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: var(--tb-radius-pill);
  background: var(--tb-search-bg, var(--tb-fill));
  color: var(--tb-muted);
}
.tb-page .tb-search { --tb-search-bg: var(--tb-surface); }
.tb-page :is(.tb-card, .tb-topbar, .tb-sheet, .tb-dialog, .tb-feed) .tb-search { --tb-search-bg: var(--tb-fill); }
.tb-search:focus-within { border-color: var(--tb-line-strong); }
.tb-search > :is(ti-icon, svg) {
  --ti-icon-size: 18px !important;
  flex: none;
  width: 18px;
  height: 18px;
}
.tb-search__input {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--tb-ink);
  font: inherit;
  font-size: 15px;
  outline: none;
}
.tb-search__input::placeholder { color: var(--tb-muted); opacity: 1; }

/* Input with an inline action: <div class="tb-input-group"><input class="tb-input"><button class="tb-btn tb-btn--lg">…</button></div> */
.tb-input-group { display: flex; align-items: center; gap: 8px; }
.tb-input-group > :is(.tb-input, .tb-select) { flex: 1 1 auto; min-width: 0; }
.tb-input--button { display: flex; align-items: center; justify-content: space-between; gap: 8px; text-align: left; cursor: pointer; }
.tb-input--button > ti-icon { --ti-icon-size: 16px !important; flex: none; color: var(--tb-muted); }
.tb-input--button .is-empty { color: var(--tb-muted); }

/* ---------- Overlays: mask, bottom sheet, dialog, toast ---------- */
.tb-mask { position: fixed; inset: 0; background: var(--tb-mask); }
.tb-sheet {
  box-sizing: border-box;
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  max-height: 85vh;
  overflow: auto;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  border-radius: var(--tb-radius-sheet) var(--tb-radius-sheet) 0 0;
  background: var(--tb-surface);
}
/* Grabber: <div class="tb-sheet__handle" data-ti-sheet-handle></div>; pull-down handled by js/core/ui.js. */
:is(.tb-sheet__handle, [data-ti-sheet-handle]) { display: flex; justify-content: center; padding: 8px 0 4px; cursor: grab; touch-action: none; }
:is(.tb-sheet__handle, [data-ti-sheet-handle])::before { content: ""; width: 36px; height: 4px; border-radius: 2px; background: var(--tb-line-strong); }
.tb-sheet[data-ti-dragging] { transition: none; }
[data-ti-layer] > .tb-mask { opacity: calc(1 - var(--ti-sheet-progress, 0)); }
.tb-sheet__head {
  display: grid;
  grid-template-columns: var(--tb-hit) minmax(0, 1fr) var(--tb-hit);
  align-items: center;
  min-height: 52px;
  padding: 0 6px;
}
.tb-sheet__title {
  grid-column: 2;
  margin: 0;
  overflow: hidden;
  color: var(--tb-ink);
  font-size: 16px;
  font-weight: 500;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tb-sheet__close { grid-column: 3; }
.tb-dialog {
  box-sizing: border-box;
  width: min(320px, calc(100% - 48px));
  padding: 24px 20px 16px;
  border-radius: var(--tb-radius-dialog);
  background: var(--tb-surface);
  text-align: center;
}
.tb-dialog__title { margin: 0; color: var(--tb-ink); font-size: 17px; font-weight: 500; line-height: 1.4; }
.tb-dialog__body { margin: 8px 0 0; color: var(--tb-ink-2); font-size: 14px; line-height: 1.6; }
.tb-dialog__actions { display: flex; gap: 12px; margin-top: 20px; }
.tb-dialog__actions > .tb-btn { flex: 1 1 0; }
.tb-toast {
  box-sizing: border-box;
  max-width: min(360px, calc(100% - 32px));
  padding: 10px 18px;
  border-radius: var(--tb-radius-pill);
  background: rgb(15 20 25 / 92%);
  color: #fff;
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
}

/* ---------- Empty state ---------- */
.tb-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 48px 16px;
  color: var(--tb-muted);
  text-align: center;
}
.tb-empty__icon {
  --ti-icon-size: 64px !important;
  display: inline-flex;
  width: 64px;
  height: 64px;
  color: var(--tb-line-strong);
}
.tb-empty__title { margin: 4px 0 0; color: var(--tb-ink-2); font-size: 15px; font-weight: 500; line-height: 1.5; }
.tb-empty__desc { margin: 0; font-size: 13px; line-height: 1.6; }
.tb-empty > .tb-btn { margin-top: 8px; }

/* ---------- Skeleton: placeholder bars while a list loads ---------- */
.tb-skeleton { display: block; width: 60%; height: 14px; border-radius: 4px; background: var(--tb-bg); }
.tb-skeleton--short { width: 32%; }
.tb-skeleton--long { width: 72%; height: 12px; }
.tb-row__icon:empty:not(ti-icon) { border-radius: 6px; background: var(--tb-bg); }

/* ---------- Avatar, badge, dot, tag ---------- */
.tb-avatar {
  --tb-avatar: 40px;
  display: inline-flex;
  flex: none;
  width: var(--tb-avatar);
  height: var(--tb-avatar);
  overflow: hidden;
  border-radius: 50%;
  background: var(--tb-bg);
}
.tb-avatar > img { display: block; width: 100%; height: 100%; object-fit: cover; }
.tb-avatar--sm { --tb-avatar: 32px; }
.tb-avatar--lg { --tb-avatar: 56px; }
.tb-avatar--xl { --tb-avatar: 72px; }
.tb-badge {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--tb-danger);
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
}
.tb-dot { display: inline-block; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--tb-danger); }
.tb-tag {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 20px;
  padding: 0 6px;
  border-radius: 4px;
  background: var(--tb-bg);
  color: var(--tb-ink-2);
  font-size: 12px;
  font-weight: 400;
  line-height: 1;
  white-space: nowrap;
}
.tb-tag--primary { background: transparent; box-shadow: inset 0 0 0 1px var(--tb-primary); color: var(--tb-primary); }
.tb-tag--danger { background: transparent; box-shadow: inset 0 0 0 1px var(--tb-danger); color: var(--tb-danger); }

/* ---------- Feed (X-style): full-bleed white rows, no cards, hairline between items ---------- */
/* <div class="tb-feed"><article class="tb-post">…</article>…</div>; tb-row inside a feed also runs edge to edge. */
.tb-feed { background: var(--tb-surface); }
.tb-feed > :not([hidden]) ~ :not([hidden]) { border-top: 1px solid var(--tb-divider); }
.tb-feed > .tb-row::before { content: none; }
.tb-post { display: flex; gap: 12px; padding: 12px var(--tb-gutter); color: var(--tb-ink); text-decoration: none; }
.tb-post > .tb-avatar { --tb-avatar: 40px; }
.tb-post__body { display: grid; flex: 1 1 auto; gap: 4px; min-width: 0; }
.tb-post__head { display: flex; align-items: baseline; gap: 4px; min-width: 0; font-size: 15px; line-height: 1.4; }
.tb-post__name { flex: 0 1 auto; min-width: 0; overflow: hidden; color: var(--tb-ink); font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.tb-post__meta { flex: 0 1 auto; min-width: 0; overflow: hidden; color: var(--tb-muted); font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.tb-post__text { margin: 0; color: var(--tb-ink); font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }
.tb-post__actions { display: flex; align-items: center; gap: 4px; margin: -4px 0 -8px -10px; color: var(--tb-muted); }
.tb-post__actions > .tb-icon-btn { color: inherit; }
.tb-post__actions > .tb-icon-btn :is(ti-icon, svg) { --ti-icon-size: 18px !important; width: 18px; height: 18px; }

/* ---------- Logo slot: size by height so any wordmark ratio fits ---------- */
.tb-logo { display: block; width: auto; height: var(--tb-logo-h, 26px); }
.tb-logo--auth { --tb-logo-h: 32px; }
