/* ==========================================================================
   Toral Panel - panel-admin components
   --------------------------------------------------------------------------
   Content-area building blocks: page head, stat tiles, cards, tables,
   buttons, badges. Tokens come from toral-admin.css; this file must not
   define colours of its own.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Page wrapper & head
   -------------------------------------------------------------------------- */

/* Outermost wrapper every redesigned page renders inside .tp-content. */
.tp-page { width: 100%; min-width: 0; }

.tp-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--tp-border);
}

.tp-page-title {
  margin: 0;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -.2px;
}

.tp-page-sub {
  margin: 3px 0 0;
  color: var(--tp-text-soft);
  font-size: 13px;
}

.tp-page-actions { display: flex; align-items: center; gap: 8px; }

/* --------------------------------------------------------------------------
   2. Grid
   -------------------------------------------------------------------------- */

.tp-grid { display: grid; gap: 16px; }
.tp-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tp-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tp-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

@media (max-width: 1100px) {
  .tp-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tp-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .tp-grid-4,
  .tp-grid-3,
  .tp-grid-2 { grid-template-columns: minmax(0, 1fr); }
}

.tp-stack { display: flex; flex-direction: column; gap: 18px; }

/* My Profile: "My plan" and "Site settings account" side by side under the
   Guide card. Each card keeps its own wrapper (.tp-mb-2); here the wrapper
   stretches to the row and the card fills it, so both end on one line. */
.tp-profile-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}
.tp-profile-pair > div { display: flex; flex-direction: column; margin-bottom: 0; }
.tp-profile-pair > div > .tp-card { flex: 1; }
.tp-metric-label > .tp-btn-sm { margin-inline-start: 10px; vertical-align: middle; }

@media (max-width: 1100px) {
  .tp-profile-pair { grid-template-columns: minmax(0, 1fr); }
}

/* Settings tabs whose cards hold a short form.
   Those cards were each taking a full row of a wide screen for a handful of
   controls, so the tab read as a tall column of mostly empty boxes. This puts
   two of them side by side and hands back the single column as soon as the
   screen is too narrow for that to be readable.

   align-items: start is the point of having its own class rather than
   .tp-grid-2: a grid stretches every item to the height of the tallest one in
   the row, which would give a three-control card the height of a fifteen-
   control card next to it. */
.tp-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 16px;
}

@media (max-width: 1100px) {
  .tp-settings-grid { grid-template-columns: minmax(0, 1fr); }
}

/* An explicit column inside .tp-settings-grid.
   A grid fills row by row, so a tab with one tall card and two short ones put
   the second short card on the next grid row - and that row only begins below
   the tall card, which left a screen-high gap above it. Stacking the short
   cards inside one column keeps them together at the top of their side. */
.tp-settings-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

/* --------------------------------------------------------------------------
   3. Stat tiles (the colourful row)
   -------------------------------------------------------------------------- */

.tp-stat {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 118px;
  padding: 16px 18px 44px;
  border-radius: var(--tp-radius-lg);
  color: #fff;
  overflow: hidden;
  box-shadow: var(--tp-shadow);
}

.tp-stat-value {
  font-size: 25px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.4px;
  font-variant-numeric: tabular-nums;
}

.tp-stat-label {
  font-size: 12.5px;
  font-weight: 500;
  opacity: .88;
}

.tp-stat-icon {
  position: absolute;
  top: 15px;
  inset-inline-end: 15px;
  opacity: .32;
}

/* Decorative wave, drawn with a radial gradient rather than an SVG asset. */
.tp-stat-wave {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 42px;
  background:
    radial-gradient(120% 100% at 18% 100%, rgba(255, 255, 255, .22) 0, transparent 62%),
    radial-gradient(110% 100% at 74% 100%, rgba(255, 255, 255, .15) 0, transparent 58%),
    rgba(0, 0, 0, .08);
  pointer-events: none;
}

.tp-stat-indigo { background: linear-gradient(135deg, #7f7ff5 0, var(--tp-indigo) 100%); }
.tp-stat-blue   { background: linear-gradient(135deg, #5fa2fb 0, var(--tp-blue) 100%); }
.tp-stat-amber  { background: linear-gradient(135deg, #fbbf4e 0, var(--tp-amber) 100%); }
.tp-stat-red    { background: linear-gradient(135deg, #f47272 0, var(--tp-red) 100%); }
.tp-stat-green  { background: linear-gradient(135deg, #3fd6a4 0, var(--tp-green) 100%); }
.tp-stat-teal   { background: linear-gradient(135deg, #45cfc3 0, var(--tp-teal) 100%); }

/* --------------------------------------------------------------------------
   4. Cards
   -------------------------------------------------------------------------- */

.tp-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--tp-border);
  border-radius: var(--tp-radius-lg);
  background: var(--tp-surface);
  box-shadow: var(--tp-shadow-sm);
  overflow: hidden;
}

/* Accent strip along the top edge of a card. */
.tp-card-accent { border-block-start: 3px solid var(--tp-border-strong); }
.tp-card-accent.tp-accent-indigo { border-block-start-color: var(--tp-indigo); }
.tp-card-accent.tp-accent-blue   { border-block-start-color: var(--tp-blue); }
.tp-card-accent.tp-accent-amber  { border-block-start-color: var(--tp-amber); }
.tp-card-accent.tp-accent-green  { border-block-start-color: var(--tp-green); }
.tp-card-accent.tp-accent-teal   { border-block-start-color: var(--tp-teal); }
.tp-card-accent.tp-accent-red    { border-block-start-color: var(--tp-red); }

.tp-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--tp-border);
  background: var(--tp-surface-2);
}

.tp-card-head-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: var(--tp-radius-sm);
  background: var(--tp-surface-3);
  color: var(--tp-text-soft);
}

.tp-card-title {
  flex: 1;
  margin: 0;
  font-size: 14.5px;
  font-weight: 650;
}

.tp-card-body { padding: 16px 18px; }
.tp-card-body-flush { padding: 0; }

.tp-empty {
  margin: 0;
  padding: 26px 18px;
  color: var(--tp-text-dim);
  font-size: 13.5px;
  text-align: center;
}

/* --------------------------------------------------------------------------
   5. Metric list (key/value rows inside a card)
   -------------------------------------------------------------------------- */

.tp-metrics { display: flex; flex-direction: column; gap: 2px; }

.tp-metric {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 4px;
  border-bottom: 1px solid var(--tp-border);
}
.tp-metric:last-child { border-bottom: 0; }

.tp-metric-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: var(--tp-radius-sm);
  background: var(--tp-surface-3);
  color: var(--tp-text-soft);
}

.tp-metric-label { flex: 1; color: var(--tp-text-soft); font-size: 13px; }

.tp-metric-value {
  font-size: 15px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   6. Tables
   -------------------------------------------------------------------------- */

/* Horizontal-only: an implicit vertical scroll container here swallowed the
   mouse wheel instead of letting it reach the page's scroll area. */
.tp-table-scroll {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--tp-border);
  border-radius: var(--tp-radius-md);
  background: var(--tp-surface);
}
/* A card already draws the frame, so the scroller must not double it. */
.tp-card-body-flush > .tp-table-scroll,
.tp-card > .tp-table-scroll { border: 0; border-radius: 0; }

.tp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  background: var(--tp-surface);
}

.tp-table th,
.tp-table td {
  padding: 11px 14px;
  text-align: start;
  border-bottom: 1px solid var(--tp-border);
  vertical-align: middle;
}

/* The header must read as a distinct band, not as another body row. */
.tp-table thead th {
  background: var(--tp-table-head);
  border-bottom: 2px solid var(--tp-border-strong);
  color: var(--tp-text-soft);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .6px;
  text-transform: uppercase;
  white-space: nowrap;
}

.tp-table tbody tr:last-child td { border-bottom: 0; }
.tp-table tbody tr:hover td { background: var(--tp-surface-2); }
.tp-table-striped tbody tr:nth-child(even) td { background: var(--tp-table-stripe); }
.tp-table-striped tbody tr:nth-child(even):hover td { background: var(--tp-surface-2); }

.tp-table .tp-num { text-align: end; font-variant-numeric: tabular-nums; }
.tp-table .tp-center { text-align: center; }
.tp-table .tp-wrap { white-space: normal; min-width: 190px; }

.tp-cell-strong { font-weight: 600; }
.tp-cell-sub {
  display: block;
  margin-top: 1px;
  color: var(--tp-text-dim);
  font-size: 11.5px;
  font-weight: 400;
}

/* Services list: the provider's own price printed under our selling price.
   Red once it has passed what we charge - that is the moment the margin is
   gone and the price needs looking at. */
.tp-rate-cost {
  font-variant-numeric: tabular-nums;
  cursor: help;
}
.tp-rate-cost.is-over {
  color: var(--tp-red);
  font-weight: 600;
}

/* Compact status matrix used on the dashboard. */
.tp-table-matrix th,
.tp-table-matrix td { text-align: center; padding: 10px 12px; }
.tp-table-matrix tbody td { font-size: 16px; font-weight: 650; font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------------------------
   7. Badges & pills
   -------------------------------------------------------------------------- */

.tp-pill {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  padding: 2px 9px;
  border-radius: var(--tp-radius-pill);
  font-size: 11.5px;
  font-weight: 650;
  line-height: 1.7;
}

/* Each tinted rule carries a plain rgba() fallback first, so a browser without
   color-mix() support still paints a background instead of nothing. */
.tp-pill-neutral { background: var(--tp-surface-3); color: var(--tp-text-soft); }
.tp-pill-indigo  { background: rgba(99, 102, 241, .15); background: color-mix(in srgb, var(--tp-indigo) 15%, transparent); color: var(--tp-indigo); }
.tp-pill-blue    { background: rgba(59, 130, 246, .15); background: color-mix(in srgb, var(--tp-blue) 15%, transparent);   color: var(--tp-blue); }
.tp-pill-green   { background: rgba(16, 185, 129, .15); background: color-mix(in srgb, var(--tp-green) 15%, transparent);  color: var(--tp-green); }
.tp-pill-amber   { background: rgba(245, 158, 11, .18); background: color-mix(in srgb, var(--tp-amber) 18%, transparent);  color: #a26200; }
.tp-pill-red     { background: rgba(239, 68, 68, .15);  background: color-mix(in srgb, var(--tp-red) 15%, transparent);    color: var(--tp-red); }
/* Used by the Partial order status, matching the Userside's .tp-pill--partial. */
.tp-pill-teal    { background: rgba(20, 184, 166, .15); background: color-mix(in srgb, var(--tp-teal) 15%, transparent);   color: var(--tp-teal); }
/* A pill that is a button: Services list Active / Inactive (one click switches it). */
.tp-pill-btn { border: 0; font-family: inherit; cursor: pointer; }
.tp-pill-btn:hover { filter: brightness(.92); box-shadow: 0 0 0 1px currentColor inset; }
.tp-pill-btn:focus-visible { outline: 2px solid currentColor; outline-offset: 1px; }
/* Sortable column of a small report table (Settings > Currency, changed prices). */
.tp-th-sort { cursor: pointer; user-select: none; white-space: nowrap; }
.tp-th-sort::after { content: " \2195"; opacity: .45; }
.tp-th-sort[data-tp-dir="asc"]::after { content: " \2191"; opacity: 1; }
.tp-th-sort[data-tp-dir="desc"]::after { content: " \2193"; opacity: 1; }

[data-tp-theme="dark"] .tp-pill-amber { color: #f0b95c; }

/* Customer level badge: settings tab, user edit, tickets list. */
.tp-pill-level         { background: var(--tp-level-new); color: var(--tp-level-on); }
.tp-pill-level-bronze  { background: var(--tp-level-bronze); }
.tp-pill-level-silver  { background: var(--tp-level-silver); }
.tp-pill-level-gold    { background: var(--tp-level-gold); }
.tp-pill-level-diamond { background: var(--tp-level-diamond); }

.tp-rank {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: var(--tp-radius-sm);
  background: var(--tp-surface-3);
  color: var(--tp-text-soft);
  font-size: 12px;
  font-weight: 700;
}
.tp-rank-1 { background: rgba(245, 158, 11, .2);  background: color-mix(in srgb, var(--tp-amber) 20%, transparent); color: #a26200; }
.tp-rank-2 { background: rgba(59, 130, 246, .16); background: color-mix(in srgb, var(--tp-blue) 16%, transparent);  color: var(--tp-blue); }
.tp-rank-3 { background: rgba(20, 184, 166, .16); background: color-mix(in srgb, var(--tp-teal) 16%, transparent);  color: var(--tp-teal); }

[data-tp-theme="dark"] .tp-rank-1 { color: #f0b95c; }

/* --------------------------------------------------------------------------
   8. Buttons
   -------------------------------------------------------------------------- */

.tp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 15px;
  border: 1px solid transparent;
  border-radius: var(--tp-radius-md);
  background: var(--tp-surface-3);
  color: var(--tp-text);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--tp-transition), border-color var(--tp-transition);
}
.tp-btn:hover { background: var(--tp-border); text-decoration: none; }

.tp-btn-primary {
  background: var(--tp-brand-600);
  border-color: var(--tp-brand-600);
  color: #fff;
}
.tp-btn-primary:hover { background: var(--tp-brand-700); border-color: var(--tp-brand-700); }

.tp-btn-ghost {
  background: transparent;
  border-color: var(--tp-border-strong);
  color: var(--tp-text-soft);
}
.tp-btn-ghost:hover { background: var(--tp-surface-2); color: var(--tp-text); }

.tp-btn-danger { background: var(--tp-red); border-color: var(--tp-red); color: #fff; }
.tp-btn-danger:hover { background: #dc2626; border-color: #dc2626; }

/* Blue action button (owner-specified #3d68b0).
   Used for the "do something" controls that are not the page's primary brand
   action: Add New / Import from Provider / bulk Apply. */
.tp-btn-action {
  background: var(--tp-action-blue);
  border-color: var(--tp-action-blue);
  color: #fff;
}
.tp-btn-action:hover,
.tp-btn-action:focus-visible {
  background: var(--tp-action-blue-700);
  border-color: var(--tp-action-blue-700);
  color: #fff;
}
.tp-btn-action:active { background: var(--tp-action-blue-800); border-color: var(--tp-action-blue-800); }
/* A link with this class must keep the white label (see `.tp-content a`). */
.tp-content a.tp-btn-action,
.tp-content a.tp-btn-action:hover { color: #fff; text-decoration: none; }

/* Pale blue variant. A tint of the same action blue rather than the solid
   fill: for a control that should read as a deliberate action without
   competing with the page's primary button.
     .tp-btn-soft-blue  the general name (per-row Save in Custom Pricing, ...)
     .tp-btn-lang-save  "Save language change" in Settings > Languages, the
                        control this variant was first drawn for. */
.tp-btn-soft-blue,
.tp-btn-lang-save {
  background: #e8eef8;
  border-color: var(--tp-action-blue);
  color: var(--tp-action-blue);
}
.tp-btn-soft-blue:hover,
.tp-btn-soft-blue:focus-visible,
.tp-btn-lang-save:hover,
.tp-btn-lang-save:focus-visible {
  background: #d7e3f4;
  border-color: var(--tp-action-blue-700);
  color: var(--tp-action-blue-700);
}
[data-tp-theme="dark"] .tp-btn-soft-blue,
[data-tp-theme="dark"] .tp-btn-lang-save {
  background: rgba(61, 104, 176, .22);
  border-color: var(--tp-action-blue);
  color: #cfe0f7;
}
[data-tp-theme="dark"] .tp-btn-soft-blue:hover,
[data-tp-theme="dark"] .tp-btn-soft-blue:focus-visible,
[data-tp-theme="dark"] .tp-btn-lang-save:hover,
[data-tp-theme="dark"] .tp-btn-lang-save:focus-visible {
  background: rgba(61, 104, 176, .34);
  color: #e8f0fc;
}

.tp-btn-sm { padding: 6px 11px; font-size: 12.5px; }
.tp-btn-block { width: 100%; }
.tp-btn[disabled], .tp-btn.is-disabled { opacity: .55; pointer-events: none; }

/* --------------------------------------------------------------------------
   8c. "More filters" disclosure (orders list)
   A <details> so it needs no JavaScript. Closed it is one small button; open
   it drops a panel over the page instead of pushing the table down.
   -------------------------------------------------------------------------- */
/* --------------------------------------------------------------------------
   8d. Userside logo cropper (Settings → Userside Theme)
   The frame below is the real shape of the Userside logo area; the admin drags
   and zooms the picture into it and the script exports exactly this frame.
   -------------------------------------------------------------------------- */
.tp-logocrop[hidden] { display: none; }
.tp-logocrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 16px;
}
.tp-logocrop__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .55);
}
.tp-logocrop__box {
  position: relative;
  width: 100%;
  max-width: 340px;
  padding: 18px;
  border: 1px solid var(--tp-border);
  border-radius: var(--tp-radius-lg);
  background: var(--tp-surface);
  box-shadow: var(--tp-shadow-lg);
}
.tp-logocrop__title { margin: 0 0 6px; font-size: 15px; font-weight: 700; }

/* The chequerboard makes transparent areas of a PNG obvious, so the admin can
   see how much empty space they are leaving around the logo. */
.tp-logocrop__stage {
  margin: 12px 0 10px;
  border: 1px dashed var(--tp-border-strong);
  border-radius: var(--tp-radius-sm);
  background-color: var(--tp-surface-2);
  background-image:
    linear-gradient(45deg, var(--tp-surface-3) 25%, transparent 25%, transparent 75%, var(--tp-surface-3) 75%),
    linear-gradient(45deg, var(--tp-surface-3) 25%, transparent 25%, transparent 75%, var(--tp-surface-3) 75%);
  background-size: 14px 14px;
  background-position: 0 0, 7px 7px;
  overflow: hidden;
  display: grid;
  place-items: center;
}
.tp-logocrop__canvas { display: block; cursor: grab; touch-action: none; }
.tp-logocrop__canvas.is-dragging { cursor: grabbing; }

.tp-logocrop__zoom { display: flex; align-items: center; gap: 10px; }
.tp-logocrop__zoom input[type="range"] { flex: 1; min-width: 0; width: auto; }
.tp-logocrop__note { margin: 8px 0 0; text-align: start; }

.tp-logocrop__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

/* The page behind the dialog must not scroll while it is open. */
body.tp-modal-open { overflow: hidden; }

.tp-logo-preview { max-height: 52px; width: auto; }
.tp-logo-preview[hidden] { display: none; }

/* A search box whose placeholder is a long hint. The typed value keeps the
   normal size; only the placeholder shrinks, so the whole hint is readable
   without making the field wider and pushing the toolbar onto a second line. */
/* `input.` and the `.tp-filters` ancestor are both needed: the generic toolbar
   rule further down this file pins every control to `min-width: 150px` at a
   specificity of (0,2,0), and it comes later, so a plainer selector loses. */
.tp-filters input.tp-search-long,
.tp-toolbar input.tp-search-long { min-width: 240px; }
.tp-search-long::placeholder { font-size: 11.5px; opacity: .75; }
.tp-search-long::-webkit-input-placeholder { font-size: 11.5px; opacity: .75; }

.tp-morefilters { position: relative; }
.tp-morefilters > summary {
  list-style: none;
  user-select: none;
  white-space: nowrap;
}
.tp-morefilters > summary::-webkit-details-marker { display: none; }
.tp-morefilters > summary::after {
  content: "";
  width: 0;
  height: 0;
  margin-inline-start: 2px;
  border-inline: 4px solid transparent;
  border-block-start: 5px solid currentColor;
}
.tp-morefilters[open] > summary::after { transform: rotate(180deg); }
.tp-morefilters[open] > summary { background: var(--tp-surface-2); color: var(--tp-text); }

.tp-morefilters-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  padding-inline: 4px;
  border-radius: var(--tp-radius-pill);
  background: var(--tp-action-blue);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1;
}

/* Two columns of fields plus a narrow third column holding Apply, which spans
   both rows. Keeping Apply beside the fields rather than under them is what
   stops the panel growing a third row. */
.tp-morefilters-panel {
  position: absolute;
  inset-block-start: calc(100% + 6px);
  /* Anchored to the toggle's END edge, so the panel grows back towards the
     controls it belongs to instead of away from them. Anchored to the start
     edge it ran off the card whenever the toggle sat far along the toolbar -
     the Transactions Log toolbar has one filter more than Orders and a search
     box that stretches, which pushed the toggle right and left the panel
     hanging ~100px outside the card. Growing inwards keeps it inside at every
     width the popover is used at, in both LTR and RTL. */
  inset-inline-start: auto;
  inset-inline-end: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr)) auto;
  gap: 8px;
  width: max-content;
  max-width: min(480px, 92vw);
  padding: 10px;
  border: 1px solid var(--tp-border);
  border-radius: var(--tp-radius-md);
  background: var(--tp-surface);
  box-shadow: var(--tp-shadow-lg);
}
/* These four controls fill their grid cell rather than sizing to content, so
   the panel does not change width as values are typed. */
.tp-morefilters-panel :where(input, select) { width: 100%; min-width: 0; }

/* Apply sits in the third column, spanning both field rows. */
.tp-morefilters-apply {
  grid-column: 3;
  grid-row: 1 / -1;
  align-self: stretch;
  white-space: nowrap;
}

/* Tablet and below: the popover is dropped in favour of an inline block.
   A floating panel anchored to one edge can run off the opposite side of a
   narrow screen — in RTL it ran off the left — and there is room for it here. */
@media (max-width: 900px) {
  .tp-morefilters { width: 100%; }
  .tp-morefilters-panel {
    position: static;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    width: 100%;
    max-width: none;
    margin-top: 8px;
    box-shadow: none;
  }
  /* The fixed third column does not survive auto-fit, so Apply goes back to
     flowing with the fields and simply spans the full width. */
  .tp-morefilters-apply { grid-column: 1 / -1; grid-row: auto; }
}
@media (max-width: 520px) {
  .tp-morefilters-panel { grid-template-columns: 1fr; }
}

/* --------------------------------------------------------------------------
   8b. Row action dropdown
   --------------------------------------------------------------------------
   The single dropdown component for the whole panel. It replaces the three
   parallel implementations that used to exist (.tp-action-menu in two
   stylesheets with conflicting definitions, plus a per-page .u-actions).
   -------------------------------------------------------------------------- */

.tp-action { position: relative; display: inline-block; }

/* A table cell holding several action controls (a dropdown plus one or more
   small forms). Without this the forms, being block elements, stack under the
   dropdown and double the row height. */
.tp-actions-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  /* Wide enough for the dropdown, the checkbox label and the button on one
     line. Without it a narrow table squeezes the column and the controls stack
     again — with the floor in place the surrounding .tp-table-scroll scrolls
     instead. */
  min-width: 300px;
}
.tp-actions-cell > form { display: inline-flex; align-items: center; gap: 8px; margin: 0; }
.tp-actions-cell .tp-row-tight { margin: 0; white-space: nowrap; font-size: 12.5px; }
/* Both controls in this cell are the compact size, so the row stays short. */
.tp-actions-cell .tp-btn { padding: 6px 11px; font-size: 12.5px; }

/* Icon-only toggle. Pages that give the toggle .tp-btn classes instead keep
   the button look, so these base rules must not fight it. */
.tp-action-toggle:not(.tp-btn) {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid transparent;
  border-radius: var(--tp-radius-sm);
  background: transparent;
  color: var(--tp-text-soft);
  cursor: pointer;
  transition: background var(--tp-transition), color var(--tp-transition);
}
.tp-action-toggle:not(.tp-btn):hover,
.tp-action.is-open .tp-action-toggle:not(.tp-btn) {
  background: var(--tp-surface-3);
  color: var(--tp-text);
}

/* Closed by default. Two callers open it: the shared component adds .is-open,
   and the Providers page's jQuery calls .show() (an inline style, which wins). */
.tp-action-menu {
  display: none;
  position: absolute;
  inset-block-start: calc(100% + 6px);
  inset-inline-end: 0;
  z-index: 30;
  min-width: 186px;
  padding: 5px;
  border: 1px solid var(--tp-border);
  border-radius: var(--tp-radius-lg);
  background: var(--tp-surface);
  box-shadow: var(--tp-shadow-lg);
  text-align: start;
}
.tp-action.is-open .tp-action-menu { display: block; }

/* Links inside the legacy Providers menu markup pick up the item styling too. */
.tp-action-menu > a,
.tp-inline-actions > a { display: block; }

/* Open menus are positioned against the WINDOW by toral-admin.js, not against
   the row: .tp-table-scroll needs overflow-x for wide tables and therefore
   clips vertically too, which cut the menu off on the last rows - and merely
   flipping it upwards moved the same cut to the first rows. Only top/left are
   set inline; everything else stays the shared dropdown look. */
.tp-action-menu.is-floating {
  position: fixed;
  inset-block-start: auto;
  inset-block-end: auto;
  inset-inline-start: auto;
  inset-inline-end: auto;
  z-index: 120;
  max-height: min(60vh, 420px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* Kept for a menu opened before the script runs, and for any page that still
   sets the class itself. */
.tp-action.is-up .tp-action-menu:not(.is-floating) {
  inset-block-start: auto;
  inset-block-end: calc(100% + 6px);
}

.tp-action-menu form { margin: 0; }

.tp-action-item {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: var(--tp-radius-sm);
  background: transparent;
  color: var(--tp-text);
  font: inherit;
  font-size: 13px;
  text-align: start;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--tp-transition);
}
.tp-action-item:hover { background: var(--tp-surface-3); text-decoration: none; }
.tp-action-item.is-danger { color: var(--tp-red); }
.tp-action-item.is-danger:hover { background: rgba(239, 68, 68, .1); }

/* Same treatment for the Providers page's own anchors inside the menu. */
.tp-action-menu a,
.tp-action-menu button:not(.tp-btn) {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: var(--tp-radius-sm);
  background: transparent;
  color: var(--tp-text) !important;
  font: inherit;
  font-size: 13px;
  text-align: start;
  text-decoration: none !important;
  white-space: nowrap;
  cursor: pointer;
}
.tp-action-menu a:hover,
.tp-action-menu button:not(.tp-btn):hover { background: var(--tp-surface-3); }
.tp-action-menu .tp-action-delete { color: var(--tp-red) !important; }
.tp-inline-actions { display: flex; flex-direction: column; }

.tp-action-sep { height: 1px; margin: 4px 6px; background: var(--tp-border); }

/* --------------------------------------------------------------------------
   8c. Toolbar, bulk bar, pagination, sortable headers
   -------------------------------------------------------------------------- */

/* Filter/search bars sit in their own framed band above the table, so the
   controls read as a group rather than floating on the page background. */
.tp-toolbar,
.tp-filters,
.tp-inline-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid var(--tp-border);
  border-radius: var(--tp-radius-md);
  background: var(--tp-surface-2);
}

/* Nested inside an already-framed toolbar, drop the second frame. */
.tp-toolbar .tp-filters,
.tp-toolbar .tp-bulk {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.tp-toolbar-search { position: relative; flex: 1 1 230px; min-width: 190px; }
.tp-toolbar-search .tp-input { padding-inline-start: 34px; }
.tp-toolbar-search-icon {
  position: absolute;
  inset-inline-start: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--tp-text-dim);
  pointer-events: none;
}

.tp-select-auto { width: auto; min-width: 140px; }

.tp-bulkbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid var(--tp-border);
  border-radius: var(--tp-radius-md);
  background: var(--tp-surface-2);
}
.tp-bulk-count { color: var(--tp-text-dim); font-size: 12.5px; }

/* Services list -> Bulk edit dialog (Actions\ServicesBulkEdit). Same overlay
   pattern as the logo cropper above. */
.tp-bulkedit[hidden] { display: none; }
.tp-bulkedit {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 16px;
}
.tp-bulkedit__backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); }
.tp-bulkedit__box {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 18px;
  border: 1px solid var(--tp-border);
  border-radius: var(--tp-radius-lg);
  background: var(--tp-surface);
  box-shadow: var(--tp-shadow-lg);
}
.tp-bulkedit__title { margin: 0 0 6px; font-size: 15px; font-weight: 700; }
.tp-bulkedit__sec {
  margin: 12px 0 0;
  padding: 10px 12px 12px;
  border: 1px solid var(--tp-border);
  border-radius: var(--tp-radius-md);
  background: var(--tp-surface-2);
}
.tp-bulkedit__sec > legend { padding: 0 4px; }
.tp-bulkedit__sec .tp-help { margin-top: 6px; }
.tp-bulkedit__row { display: flex; flex-wrap: wrap; gap: 8px; }
.tp-bulkedit__row > .tp-select,
.tp-bulkedit__row > .tp-input { flex: 1 1 150px; width: auto; min-width: 0; }
.tp-bulkedit__text { margin-top: 8px; }
.tp-bulkedit :where(.tp-input, .tp-select, .tp-textarea):disabled { opacity: .55; cursor: not-allowed; }
.tp-bulkedit > .tp-bulkedit__box > .tp-help { margin-top: 12px; }
.tp-bulkedit__actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }

.tp-table-summary { margin: 12px 0 0; color: var(--tp-text-dim); font-size: 12.5px; }

.tp-col-cb { width: 38px; text-align: center !important; }
.tp-col-cb input { cursor: pointer; }
.tp-col-actions { width: 1%; white-space: nowrap; }

/* Customer Levels tab (Settings). The three settings boxes get a width to
   wrap at instead of splitting every line three ways, and the level table -
   five columns, three of them number inputs - keeps a readable floor and
   scrolls inside .tp-table-scroll on a narrow screen. */
.tp-levels-fields > .tp-grow { flex: 1 1 210px; }
.tp-levels-table { min-width: 620px; }
.tp-levels-table .tp-input { min-width: 96px; }
/* The report has six columns with dates in them: same idea, it scrolls. */
.tp-levels-report { min-width: 780px; }
/* KYC tab, "Users awaiting KYC review": four columns, scrolls on a phone. */
.tp-kyc-pending { min-width: 520px; }

/* Rewards → Wheel slots. One flex row per slot instead of a table: the fields a
   slot needs depend on its prize type, and a table column cannot be missing
   from one row only. The label takes all the spare width; the number fields
   are only as wide as a few digits need. A field the type does not use is
   [hidden] (and disabled by the page script). */
.tp-rw-slots { display: flex; flex-direction: column; gap: 10px; }
.tp-rw-slot {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 10px 12px;
  padding: 12px;
  border: 1px solid var(--tp-border);
  border-radius: var(--tp-radius-md);
  background: var(--tp-surface);
}
.tp-rw-slot:nth-child(even) { background: var(--tp-surface-2); }
.tp-rw-slot--removed { opacity: .45; }
.tp-rw-f { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tp-rw-f[hidden] { display: none; }
.tp-rw-cap { color: var(--tp-text-soft); font-size: 12px; font-weight: 600; white-space: nowrap; }
.tp-rw-f .tp-input,
.tp-rw-f .tp-select { width: 100%; padding: 7px 9px; }
.tp-rw-f-drag   { flex: none; }
.tp-rw-f-type   { flex: 0 0 140px; }
.tp-rw-f-label  { flex: 1 1 150px; }
.tp-rw-f-value  { flex: 0 0 100px; }
.tp-rw-f-level  { flex: 0 0 120px; }
.tp-rw-f-num    { flex: 0 0 72px; }
.tp-rw-f-stock  { flex: 0 0 84px; }
.tp-rw-f-colour { flex: 0 0 88px; }
.tp-rw-f-flag,
.tp-rw-f-remove { flex: none; }
.tp-rw-flagbox { display: flex; align-items: center; min-height: 34px; }

/* Drag handle. Only the handle carries draggable, so the text fields in the row
   keep working normally. */
.tp-rw-drag {
  display: grid;
  place-items: center;
  width: 24px;
  min-height: 34px;
  padding: 0;
  border: 0;
  border-radius: var(--tp-radius-sm);
  background: transparent;
  color: var(--tp-text-dim);
  cursor: grab;
}
.tp-rw-drag:hover,
.tp-rw-drag:focus-visible { background: var(--tp-surface-3); color: var(--tp-text); }
.tp-rw-drag:active { cursor: grabbing; }
.tp-rw-slot.is-dragging { opacity: .5; }
.tp-rw-f-stock .tp-help { font-size: 11px; }
.tp-rw-legend { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0; padding: 0; list-style: none; }
.tp-rw-f-chance { flex: 0 0 132px; }
.tp-rw-chance-row { display: flex; gap: 4px; align-items: center; }
.tp-rw-chance-row .tp-input { flex: 1 1 auto; min-width: 0; }
/* While the box is empty it shows what is still left of the 100%. */
.tp-rewards-chance::placeholder { color: var(--tp-amber); font-weight: 700; opacity: 1; }

/* Rewards → Wheel slots → the "win-chance balance" box under the slot list.
   Green when the wheel could be saved as it stands, amber while something is
   still missing, red when the chances add up to more than 100. */
.tp-rw-balance {
  --tp-rw-accent: var(--tp-amber);
  padding: 14px 16px;
  border: 1px solid var(--tp-rw-accent);
  border-inline-start-width: 4px;
  border-radius: var(--tp-radius-md);
  background: var(--tp-surface-2);
}
.tp-rw-balance.is-ok   { --tp-rw-accent: var(--tp-green); }
.tp-rw-balance.is-over { --tp-rw-accent: var(--tp-red); }
.tp-rw-balance__head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.tp-rw-balance__state { font-size: 12px; font-weight: 700; color: var(--tp-rw-accent); }
.tp-rw-balance__bar { height: 8px; border-radius: var(--tp-radius-pill); background: var(--tp-border); overflow: hidden; }
.tp-rw-balance__bar > span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--tp-rw-accent); transition: width 160ms ease; }
.tp-rw-balance__nums { display: flex; flex-wrap: wrap; gap: 6px 28px; margin-top: 10px; }
.tp-rw-balance__nums > div { display: flex; flex-direction: column; gap: 2px; }
.tp-rw-balance__nums b { font-size: 18px; font-variant-numeric: tabular-nums; }
.tp-rw-balance__problems { margin: 10px 0 0; padding-inline-start: 18px; color: var(--tp-red); font-size: 13px; }
.tp-rw-balance__problems:empty { display: none; }
.tp-rw-balance .tp-help { margin: 8px 0 0; }

/* Users list (panel-admin). The login sits over the e-mail in one cell, so the
   column needs a floor - below it the address broke into a column of single
   characters. Everything else on the row is short, so the rest of the table
   keeps its natural widths. */
.tp-users-table .tp-col-user { min-width: 220px; }
.tp-users-table .tp-col-user .tp-cell-sub { overflow-wrap: anywhere; }
.tp-users-table a.tp-cell-strong { color: inherit; text-decoration: none; }
.tp-users-table a.tp-cell-strong:hover { color: var(--tp-brand-500); }

/* Users toolbar: search field + Search button + info icon kept together.
   The field fills the group (the generic toolbar rule would size it to its
   content, leaving a gap before the button), so the button always sits right
   against the field and the info icon right after it, in either direction. */
.tp-users-searchgroup {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 380px;
  min-width: 0;
}
.tp-users-searchgroup .tp-toolbar-search { min-width: 0; }
.tp-users-searchgroup .tp-toolbar-search .tp-input { width: 100%; }
.tp-users-searchgroup > .tp-btn,
.tp-users-searchgroup > .tp-action-toggle { flex: none; }

/* Level boxes in the Users toolbar: a crown in the level colour + the number
   of customers on that level. Clicking one filters the list; the active box
   is filled with its colour, and a second click clears the filter. */
.tp-users-levels { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tp-users-level {
  --tp-ul: var(--tp-level-new);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 34px;
  padding-inline: 9px 11px;
  border: 1px solid var(--tp-border-strong);
  border-radius: var(--tp-radius-md);
  background: var(--tp-surface);
  color: var(--tp-text);
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-decoration: none;
  transition: background var(--tp-transition), border-color var(--tp-transition), color var(--tp-transition);
}
.tp-users-level .tp-icon { color: var(--tp-ul); flex: none; }
.tp-users-level:hover { border-color: var(--tp-ul); color: var(--tp-text); text-decoration: none; }
.tp-users-level:focus-visible { outline: 2px solid var(--tp-ul); outline-offset: 2px; }
.tp-users-level.is-active,
.tp-users-level.is-active:hover { background: var(--tp-ul); border-color: var(--tp-ul); color: var(--tp-level-on); }
.tp-users-level.is-active .tp-icon { color: var(--tp-level-on); }
.tp-users-level-bronze  { --tp-ul: var(--tp-level-bronze); }
.tp-users-level-silver  { --tp-ul: var(--tp-level-silver); }
.tp-users-level-gold    { --tp-ul: var(--tp-level-gold); }
.tp-users-level-diamond { --tp-ul: var(--tp-level-diamond); }

/* Category grouping row inside a list table. */
.tp-row-group td {
  padding: 7px 14px !important;
  background: var(--tp-surface-3) !important;
  color: var(--tp-text-soft);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .7px;
  text-transform: uppercase;
  text-align: center;
}

/* Services list: the row being dragged to a new place. Opaque, so the rows it
   passes over do not show through it, and lifted off the table. */
.tp-table-services tr.ui-sortable-helper { box-shadow: var(--tp-shadow-lg); }
.tp-table-services tr.ui-sortable-helper td { background: var(--tp-surface) !important; }

.tp-sort {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: inherit !important;
  text-decoration: none !important;
}
.tp-sort-arrow {
  width: 0;
  height: 0;
  border-inline: 4px solid transparent;
  border-block-end: 5px solid currentColor;
  opacity: .3;
}
.is-sorted .tp-sort-arrow { opacity: .9; }
.is-sorted.is-desc .tp-sort-arrow {
  border-block-end: 0;
  border-block-start: 5px solid currentColor;
}

.tp-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
}
.tp-pagination-info { color: var(--tp-text-dim); font-size: 12.5px; }

.tp-page-link {
  display: inline-grid;
  place-items: center;
  min-width: 32px;
  padding: 6px 10px;
  border: 1px solid var(--tp-border-strong);
  border-radius: var(--tp-radius-sm);
  background: var(--tp-surface);
  color: var(--tp-text) !important;
  font-size: 13px;
  text-decoration: none !important;
  transition: background var(--tp-transition), border-color var(--tp-transition);
}
.tp-page-link:hover { background: var(--tp-surface-2); }
.tp-page-link.is-active {
  border-color: var(--tp-brand-600);
  background: var(--tp-brand-600);
  color: #fff !important;
}

/* Either end of the pager. A dead link that reloads the page you are on is
   worse than no link at all, so the ends are drawn as plainly unavailable. */
.tp-page-link.is-disabled {
  border-color: var(--tp-border);
  background: var(--tp-surface-2);
  color: var(--tp-text-dim) !important;
  cursor: default;
  pointer-events: none;
}

/* The "..." between two runs of page numbers. */
.tp-page-gap {
  padding: 0 2px;
  color: var(--tp-text-dim);
  font-size: 13px;
  user-select: none;
}

/* Status filter pills above a list. */
.tp-filterbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.tp-filter-link {
  padding: 6px 12px;
  border: 1px solid var(--tp-border-strong);
  border-radius: var(--tp-radius-pill);
  background: var(--tp-surface);
  color: var(--tp-text) !important;
  font-size: 13px;
  text-decoration: none !important;
  transition: background var(--tp-transition), border-color var(--tp-transition);
}
.tp-filter-link:hover { background: var(--tp-surface-2); }
.tp-filter-link.is-active {
  border-color: var(--tp-brand-600);
  background: var(--tp-brand-600);
  color: #fff !important;
}

/* Expandable detail row under a table row. */
.tp-detail-cell {
  padding: 12px 16px !important;
  background: var(--tp-surface-2) !important;
  white-space: normal !important;
}

.tp-text-danger { color: var(--tp-red); }

/* --------------------------------------------------------------------------
   9. Forms
   -------------------------------------------------------------------------- */

.tp-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }

/* A block of fields laid out as a responsive grid instead of one field per
   full-width row.

   .tp-form-table gives every field a whole line, which is right for a long
   text area and wasteful for a number: the service and order edit screens were
   a single column of short boxes with two thirds of the card empty beside
   them. The grid fits as many fields per line as the card is wide and folds to
   one column by itself on a phone, with no media query to keep in step.

   .tp-field-wide is for the one control in the block that genuinely needs the
   full width (a description, a service picker, a name). */
.tp-formgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px 16px;
  align-items: start;
}
.tp-formgrid > .tp-field { margin-bottom: 0; min-width: 0; }
.tp-formgrid > .tp-field-wide { grid-column: 1 / -1; }
/* Inside the grid a control fills its own cell - never more than that. The
   fixed caps that keep a field readable on a full-width row (.tp-w-25 and
   friends) would only leave a gap beside it here. */
.tp-formgrid .tp-input,
.tp-formgrid .tp-select,
.tp-formgrid .tp-textarea,
.tp-formgrid .tp-w-sm,
.tp-formgrid .tp-w-md,
.tp-formgrid .tp-w-25 { width: 100%; max-width: 100%; }

/* Field label that sits ABOVE its control (.tp-label-inline is the one that
   sits beside it). It had no display rule, so a <label> stayed inline and only
   ended up on its own line when the control below happened to be full width -
   which is why some settings fields read as a label glued to their input. */
.tp-label {
  display: block;
  color: var(--tp-text-soft);
  font-size: 12.5px;
  font-weight: 600;
}

/* Checkbox / radio with its label on one line.
   Emitted by the Settings tabs (KYC, Payment Gateways, Sync, Crons), Updates
   and the userside Wallet, but it had no rule anywhere - so the box and its
   text wrapped onto separate lines and nothing lined up. */
.tp-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--tp-text);
  font-size: 13.5px;
  cursor: pointer;
}
.tp-checkbox input[type="checkbox"],
.tp-checkbox input[type="radio"] {
  flex: none;
  width: 16px;
  height: 16px;
  margin: 0;
  cursor: pointer;
  accent-color: var(--tp-brand-600);
}

/* --------------------------------------------------------------------------
   Multi-select dropdown (a closed control that opens a checkbox list)
   --------------------------------------------------------------------------
   Used where a native <select multiple> would have to grow as tall as the
   number of options to be usable - Settings > Sync > providers, for one.
   -------------------------------------------------------------------------- */

.tp-multiselect {
  position: relative;
  width: 100%;
  max-width: 320px;
  margin-block-start: 6px;
}

.tp-multiselect-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--tp-border-strong);
  border-radius: var(--tp-radius-md);
  background: var(--tp-surface);
  color: var(--tp-text);
  font: inherit;
  font-size: 13.5px;
  text-align: start;
  cursor: pointer;
}
.tp-multiselect-toggle:hover { border-color: var(--tp-brand-400); }
.tp-multiselect-toggle:focus-visible {
  outline: none;
  border-color: var(--tp-brand-500);
  box-shadow: 0 0 0 3px rgba(147, 64, 173, .18);
}

.tp-multiselect-caret {
  flex: none;
  width: 0;
  height: 0;
  border-inline: 5px solid transparent;
  border-block-start: 6px solid var(--tp-text-dim);
  transition: transform var(--tp-transition);
}
.tp-multiselect-toggle[aria-expanded="true"] .tp-multiselect-caret { transform: rotate(180deg); }

/* In the normal flow, not absolutely positioned.
   .tp-card sets overflow:hidden to keep its rounded corners, so a floating
   panel inside a card is clipped to the card and only its first row shows.
   Opening in flow makes the card grow instead, which cannot be clipped. */
.tp-multiselect-panel {
  max-height: 260px;
  margin-block-start: 4px;
  overflow-y: auto;
  padding: 4px;
  border: 1px solid var(--tp-border-strong);
  border-radius: var(--tp-radius-md);
  background: var(--tp-surface);
  box-shadow: var(--tp-shadow);
}

.tp-multiselect-option {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border-radius: var(--tp-radius-sm);
  color: var(--tp-text);
  font-size: 13.5px;
  cursor: pointer;
}
.tp-multiselect-option:hover { background: var(--tp-surface-2); }
.tp-multiselect-option input {
  flex: none;
  width: 16px;
  height: 16px;
  margin: 0;
  cursor: pointer;
  accent-color: var(--tp-brand-600);
}

/* Separator between two groups of fields inside one card. */
.tp-hr {
  height: 0;
  margin: 16px 0;
  border: 0;
  border-block-start: 1px solid var(--tp-border);
}

.tp-input,
.tp-select,
.tp-textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--tp-border-strong);
  border-radius: var(--tp-radius-md);
  background: var(--tp-surface);
  color: var(--tp-text);
  font: inherit;
  font-size: 13.5px;
  transition: border-color var(--tp-transition), box-shadow var(--tp-transition);
}
.tp-textarea { min-height: 96px; resize: vertical; }

.tp-input:focus,
.tp-select:focus,
.tp-textarea:focus {
  outline: none;
  border-color: var(--tp-brand-500);
  box-shadow: 0 0 0 3px rgba(147, 64, 173, .18);
}

.tp-input[readonly],
.tp-input[disabled] { background: var(--tp-surface-2); color: var(--tp-text-soft); }

/*
 * Unclassed controls inside panel surfaces.
 *
 * Many pages emit plain <input>/<select> without a class. Rather than touching
 * every call site, the same look is applied by context. Scoped to panel areas
 * so it can never leak outside the admin shell.
 */
.tp-content :where(.tp-toolbar, .tp-filters, .tp-bulk, .tp-bulkbar, .tp-inline-form,
                   .tp-form-row, .tp-card-body, .tp-form-table, .tp-field)
  :where(input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=submit]):not([type=button]),
         select, textarea) {
  padding: 9px 12px;
  border: 1px solid var(--tp-border-strong);
  border-radius: var(--tp-radius-md);
  background: var(--tp-surface);
  color: var(--tp-text);
  font: inherit;
  font-size: 13.5px;
  max-width: 100%;
}

/*
 * Controls sitting in a horizontal bar size to their content instead of
 * stretching, so a filter row stays one line instead of stacking.
 * .tp-grow / .tp-w-* still opt a specific control back into filling space.
 */
:where(.tp-toolbar, .tp-filters, .tp-bulk, .tp-bulkbar, .tp-inline-form)
  :where(input, select, textarea):not(.tp-grow):not([class*="tp-w-"]) {
  width: auto;
  min-width: 150px;
}
:where(.tp-toolbar, .tp-filters, .tp-bulk, .tp-bulkbar, .tp-inline-form) select {
  min-width: 130px;
}
.tp-toolbar .tp-grow,
.tp-inline-form .tp-grow { flex: 1; min-width: 170px; }

.tp-content :where(.tp-toolbar, .tp-filters, .tp-bulk, .tp-bulkbar, .tp-inline-form,
                   .tp-form-row, .tp-card-body, .tp-form-table, .tp-field)
  :where(input, select, textarea):focus {
  outline: none;
  border-color: var(--tp-brand-500);
  box-shadow: 0 0 0 3px rgba(147, 64, 173, .18);
}

/* Hand-written key/value form tables used by several settings screens. */
.tp-form-table { width: 100%; border-collapse: collapse; }
/* The label column used to have zero inline-start padding, so every label sat
   flush against the card border. It now gets the same 14px gutter the data
   tables use. Because box-sizing is border-box and the column width is fixed,
   the inputs in the next column do not move.
   The colour is the full text colour rather than the soft one: these are field
   labels people read, not secondary hints. */
.tp-form-table th {
  width: 190px;
  padding-block: 10px;
  padding-inline: 14px 12px;
  color: var(--tp-text);
  font-size: 13px;
  font-weight: 600;
  text-align: start;
  vertical-align: top;
}
.tp-form-table th label { color: inherit; }
.tp-form-table td { padding: 10px 0; vertical-align: top; }
.tp-form-table tr + tr th,
.tp-form-table tr + tr td { border-top: 1px solid var(--tp-border); }

/* Phones: the key/value table becomes a stack.
   ROOT FIX, not a fix for one screen. The label column is a fixed 190px, and
   on a 360px phone that leaves ~150px for the field. Anything that cannot
   shrink that far — the TinyMCE editor on the service Description, a wide
   select, a long input — pushes past it, the whole page grows wider than the
   screen, and the rest of the form is left with a large empty strip beside it.
   Stacking the label above its field gives every field the full width, on
   every edit screen in panel-admin. */
@media (max-width: 782px) {
  .tp-form-table,
  .tp-form-table > tbody,
  .tp-form-table > tbody > tr,
  .tp-form-table > tbody > tr > th,
  .tp-form-table > tbody > tr > td {
    display: block;
    width: auto;
    max-width: 100%;
  }
  .tp-form-table > tbody > tr > th {
    padding-inline: 0;
    padding-block: 12px 4px;
  }
  .tp-form-table > tbody > tr > td {
    padding-block: 0 12px;
    border-top: 0;
  }
  .tp-form-table > tbody > tr + tr > th { border-top: 1px solid var(--tp-border); }
}

.tp-help { margin: 0; color: var(--tp-text-dim); font-size: 12px; }

/* --------------------------------------------------------------------------
   10. Sign-in page
   -------------------------------------------------------------------------- */

body.tp-body-auth {
  display: grid;
  place-items: center;
  overflow: auto;
  background: var(--tp-loginbg-base);
}

.tp-auth {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  width: 100%;
  max-width: 440px;
  padding: 24px 16px;
  /* Above the decorative layer below. */
  position: relative;
  z-index: 1;
}

.tp-auth-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--tp-text);
}

/* The brand sits on the dark background layer, not on a surface, so it keeps
   its own colour instead of following the theme's text token. */
body.tp-body-auth .tp-auth-brand { color: #ffffff; }
.tp-auth-brand .tp-brand-img { width: 46px; height: 46px; }
.tp-auth-brand .tp-brand-img:only-child { width: auto; height: auto; max-height: 56px; }
.tp-auth-brand .tp-brand-img.tp-brand-lockup { width: auto; height: 64px; max-height: none; border-radius: 0; }
.tp-auth-brand-text { font-size: 19px; font-weight: 500; letter-spacing: .3px; }
.tp-auth-brand-text b { font-weight: 800; }

.tp-auth-card {
  width: 100%;
  padding: 26px 24px;
  border: 1px solid var(--tp-border);
  border-radius: var(--tp-radius-xl);
  background: var(--tp-surface);
  box-shadow: var(--tp-shadow-lg);
}

.tp-auth-title {
  margin: 0 0 18px;
  font-size: 19px;
  font-weight: 700;
}

.tp-auth-hint {
  margin: 14px 0 0;
  color: var(--tp-text-dim);
  font-size: 12px;
  text-align: center;
}

/* The reCAPTCHA box, when Settings > Access switches one on for this form.
   The Userside sign-in page styles its own copy in toral-userside-auth.css;
   this stylesheet is the only one the panel-admin sign-in page loads, so the
   rule is repeated here rather than shared. Google's widget is a fixed 304px
   iframe, so on a narrow phone it is allowed to scroll instead of pushing the
   card wider than the screen. */
.tp-auth-captcha {
  display: flex;
  justify-content: center;
  margin: 0 0 14px;
  overflow: visible;
  border: 0;
}
@media (max-width: 400px) {
  .tp-auth-captcha { transform: scale(.88); transform-origin: center top; }
}

/* --- sign-in background -------------------------------------------------- */
/*
   Markup: Admin\UI\LoginBackground. Same construction as the Userside sign-in
   background, with the panel-admin palette (--tp-loginbg-*).

   Performance is the design constraint, because this sits behind a form:
   - no filter: blur() — a radial gradient fading to `transparent` already has
     a soft edge and costs one gradient fill, while a blurred full-viewport
     layer is re-rasterised on every frame;
   - no backdrop-filter and no mix-blend-mode — both force the browser to read
     back what is already on screen;
   - only `transform` is animated, so the movement runs on the compositor and
     never touches layout, paint or the thread handling keystrokes.
*/
.tp-loginbg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: var(--tp-loginbg-base);
  /* Nothing inside affects anything outside, so this subtree can be skipped. */
  contain: strict;
}

.tp-loginbg-wash {
  position: absolute;
  display: block;
  border-radius: 50%;
  will-change: transform;
}

.tp-loginbg-wash--1 {
  width: 78vmax;
  height: 78vmax;
  inset-inline-start: -24vmax;
  inset-block-start: -30vmax;
  opacity: .55;
  background: radial-gradient(closest-side,
              var(--tp-loginbg-1) 0%,
              rgba(29, 78, 216, .35) 45%,
              transparent 72%);
  animation: tp-loginbg-wash-1 16s ease-in-out infinite alternate;
}

.tp-loginbg-wash--2 {
  width: 66vmax;
  height: 66vmax;
  inset-inline-end: -20vmax;
  inset-block-start: -6vmax;
  opacity: .45;
  background: radial-gradient(closest-side,
              var(--tp-loginbg-2) 0%,
              rgba(59, 130, 246, .3) 45%,
              transparent 72%);
  animation: tp-loginbg-wash-2 19s ease-in-out infinite alternate;
}

/* The amber accent stays small and faint on purpose: it is a highlight in a
   blue picture, not a third equal colour. */
.tp-loginbg-wash--3 {
  width: 52vmax;
  height: 52vmax;
  inset-inline-start: 18vmax;
  inset-block-end: -28vmax;
  opacity: .22;
  background: radial-gradient(closest-side,
              var(--tp-loginbg-3) 0%,
              rgba(242, 179, 7, .22) 45%,
              transparent 74%);
  animation: tp-loginbg-wash-3 22s ease-in-out infinite alternate;
}

@keyframes tp-loginbg-wash-1 {
  from { transform: translate3d(-5vmax, -3vmax, 0) scale(1); }
  to   { transform: translate3d(7vmax, 5vmax, 0) scale(1.16); }
}
@keyframes tp-loginbg-wash-2 {
  from { transform: translate3d(4vmax, 2vmax, 0) scale(1.14); }
  to   { transform: translate3d(-6vmax, 7vmax, 0) scale(1); }
}
@keyframes tp-loginbg-wash-3 {
  from { transform: translate3d(-4vmax, 3vmax, 0) scale(1.1); }
  to   { transform: translate3d(6vmax, -4vmax, 0) scale(1); }
}

/*
   Each <svg> is twice the viewport width and holds a path that repeats every
   1440 user units, so sliding it by exactly -50% of its own width closes the
   loop with no fade and no reset.
*/
.tp-loginbg-wave,
.tp-loginbg-line {
  position: absolute;
  /* Physical `left`, not inset-inline-start: the band is 200% wide and slides
     left by half of itself. In RTL a logical start would anchor it to the
     right edge, so it would slide away and leave the screen empty. */
  left: 0;
  inset-block-end: 0;
  width: 200%;
  display: block;
  will-change: transform;
}

.tp-loginbg-wave { height: 44vh; min-height: 260px; }
.tp-loginbg-line { height: 58vh; min-height: 320px; }

.tp-loginbg-wave path { fill: currentColor; }

.tp-loginbg-wave--1 {
  color: var(--tp-loginbg-1);
  opacity: .3;
  animation: tp-loginbg-slide 16s linear infinite;
}
.tp-loginbg-wave--2 {
  color: var(--tp-loginbg-2);
  opacity: .22;
  animation: tp-loginbg-slide 23s linear infinite reverse;
}
.tp-loginbg-wave--3 {
  color: var(--tp-loginbg-base);
  opacity: .55;
  animation: tp-loginbg-slide 31s linear infinite;
}

.tp-loginbg-line path {
  stroke: currentColor;
  stroke-width: 2.5;
  /* preserveAspectRatio="none" stretches the x axis and a stretched stroke
     goes lumpy; this keeps the line an even thickness. */
  vector-effect: non-scaling-stroke;
}

.tp-loginbg-line--1 {
  color: var(--tp-loginbg-3);
  opacity: .42;
  animation: tp-loginbg-slide 19s linear infinite reverse;
}
.tp-loginbg-line--2 {
  color: var(--tp-loginbg-2);
  opacity: .3;
  animation: tp-loginbg-slide 27s linear infinite;
}

@keyframes tp-loginbg-slide {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-50%, 0, 0); }
}

/* Motion is decoration. Anyone who asked their system for less of it gets the
   same picture, standing still. */
@media (prefers-reduced-motion: reduce) {
  .tp-loginbg-wash,
  .tp-loginbg-wave,
  .tp-loginbg-line { animation: none !important; }
}

/* A phone has the least GPU and the most to lose from a busy background: the
   washes stay (one gradient fill each) and the moving bands go. */
@media (max-width: 600px) {
  .tp-loginbg-wave--3,
  .tp-loginbg-line--2 { display: none; }
}

/* --------------------------------------------------------------------------
   11. Tabs
   -------------------------------------------------------------------------- */

.tp-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 18px;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--tp-border);
}

.tp-tabs a,
.tp-tabs button {
  padding: 9px 14px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: var(--tp-radius-sm) var(--tp-radius-sm) 0 0;
  background: transparent;
  color: var(--tp-text-soft) !important;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none !important;
  cursor: pointer;
  transition: color var(--tp-transition), border-color var(--tp-transition),
              background var(--tp-transition);
}
.tp-tabs a:hover,
.tp-tabs button:hover { background: var(--tp-surface-2); color: var(--tp-text) !important; }
/* A paid module outside this site's license (Admin\UI\ModuleLock). */
.tp-tabs a.tp-tab-locked,
.tp-subtab.tp-tab-locked { opacity: .55; }
.tp-tabs a.tp-tab-locked .tp-icon,
.tp-subtab.tp-tab-locked .tp-icon { vertical-align: -2px; }
.tp-card.tp-module-locked { opacity: .6; }
.tp-card.tp-module-locked .tp-icon { vertical-align: -2px; }
/* panel-admin > Module store (Admin\Pages\ModuleStorePage) */
.tp-module-store .tp-grid > div > .tp-card { height: 100%; }
.tp-module-card.is-focus { box-shadow: 0 0 0 2px var(--tp-indigo); }
/* Module picture (Admin\UI\ModuleArt): fixed Twilight-glass plum tile, the
   same on the light and the dark theme. */
.tp-module-art {
  position: relative;
  height: 128px;
  margin-bottom: 12px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .08);
  background:
    radial-gradient(circle at 88% 0%, rgba(139, 47, 134, .75), transparent 55%),
    radial-gradient(circle at 8% 100%, rgba(62, 46, 120, .95), transparent 60%),
    #2B1E46;
}
.tp-module-art::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(198, 184, 220, .07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(198, 184, 220, .07) 1px, transparent 1px);
  background-size: 20px 20px;
}
.tp-module-art svg { position: relative; display: block; width: 100%; height: 100%; }
/* Small move of each picture while the card is hovered. */
.tp-module-art .tpma-spin,
.tp-module-art .tpma-float,
.tp-module-art .tpma-flow,
.tp-module-art .tpma-scan {
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 1.2s cubic-bezier(.2, .7, .2, 1);
}
.tp-module-card:hover .tp-module-art .tpma-spin  { transform: rotate(135deg); }
.tp-module-card:hover .tp-module-art .tpma-float { transform: translate(3px, -4px); }
.tp-module-card:hover .tp-module-art .tpma-flow  { transform: translateX(10px); }
.tp-module-card:hover .tp-module-art .tpma-scan  { transform: translateY(44px); }
.tp-module-art .tpma-twinkle { animation: tpma-twinkle 3s ease-in-out infinite; }
.tp-module-art .tpma-twinkle:nth-of-type(2n) { animation-delay: 1.5s; }
.tp-module-art .tpma-pulse { animation: tpma-twinkle 2.4s ease-in-out infinite; }
@keyframes tpma-twinkle { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) {
  .tp-module-art .tpma-spin,
  .tp-module-art .tpma-float,
  .tp-module-art .tpma-flow,
  .tp-module-art .tpma-scan { transition: none; }
  .tp-module-card:hover .tp-module-art .tpma-spin,
  .tp-module-card:hover .tp-module-art .tpma-float,
  .tp-module-card:hover .tp-module-art .tpma-flow,
  .tp-module-card:hover .tp-module-art .tpma-scan { transform: none; }
  .tp-module-art .tpma-twinkle,
  .tp-module-art .tpma-pulse { animation: none; }
}

.tp-tabs a.active,
.tp-tabs button.active {
  border-bottom-color: var(--tp-brand-600);
  color: var(--tp-brand-600) !important;
}
[data-tp-theme="dark"] .tp-tabs a.active,
[data-tp-theme="dark"] .tp-tabs button.active {
  border-bottom-color: var(--tp-brand-400);
  color: var(--tp-brand-400) !important;
}

.tp-tab-panel { padding-top: 2px; }

/* --------------------------------------------------------------------------
   11a. Sub-tabs — a second tab strip INSIDE one tab panel
   --------------------------------------------------------------------------
   Used by Settings > Messages, which holds four separate screens. It must not
   look like the tab bar above it or an admin cannot tell which level they are
   switching: hence a boxed strip in the amber accent instead of the brand
   underline, and pills instead of underlined links.
   -------------------------------------------------------------------------- */

.tp-subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
  padding: 6px;
  border: 1.5px solid var(--tp-amber);
  border-radius: var(--tp-radius-md);
  background: color-mix(in srgb, var(--tp-amber) 7%, var(--tp-surface));
}

.tp-subtab {
  padding: 8px 16px;
  border: 0;
  border-radius: var(--tp-radius-sm);
  background: transparent;
  color: var(--tp-text-soft);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: color var(--tp-transition), background var(--tp-transition);
}

.tp-subtab:hover {
  background: color-mix(in srgb, var(--tp-amber) 18%, transparent);
  color: var(--tp-text);
}

.tp-subtab.is-active {
  background: var(--tp-amber);
  color: #3d2600;
}

.tp-subtab:focus-visible {
  outline: 2px solid var(--tp-amber);
  outline-offset: 2px;
}

/* The "All" switch that sits at the far end of the message search toolbar. */
.tp-msg-all {
  padding: 4px 10px;
  border: 1px solid var(--tp-border);
  border-radius: 999px;
  background: var(--tp-surface);
}

@media (max-width: 640px) {
  .tp-subtabs {
    flex-wrap: nowrap;
    overflow-x: auto;
  }
  .tp-subtab { white-space: nowrap; }
}

/* --------------------------------------------------------------------------
   11b. Settings-style form rows
   -------------------------------------------------------------------------- */

.tp-section { padding: 0; }

.tp-form-row {
  padding: 10px 12px;
  border-radius: var(--tp-radius-md);
  background: var(--tp-surface-2);
}
.tp-form-row + .tp-form-row { margin-top: 8px; }

/* Inline label that sits beside its control instead of above it. */
.tp-label-inline {
  flex: none;
  min-width: 110px;
  color: var(--tp-text-soft);
  font-size: 13px;
  font-weight: 600;
}
.tp-label-inline.is-wide { min-width: 165px; }

.tp-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tp-actions-top { display: flex; align-items: center; gap: 8px; }

.tp-push-end { margin-inline-start: auto; }

.tp-col-45 { width: 45%; }

.tp-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--tp-border);
  background: var(--tp-surface-2);
}
.tp-card-header h3 { margin: 0; font-size: 14.5px; font-weight: 650; }

.tp-inner-card {
  padding: 14px;
  border: 1px solid var(--tp-border);
  border-radius: var(--tp-radius-md);
  background: var(--tp-surface-2);
}

.tp-code-block {
  overflow: auto;
  padding: 12px 14px;
  border: 1px solid var(--tp-border);
  border-radius: var(--tp-radius-md);
  background: var(--tp-surface-3);
  color: var(--tp-text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 12.5px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

/* --------------------------------------------------------------------------
   12. Toggle switch
   -------------------------------------------------------------------------- */

.tp-switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; }
.tp-switch input { position: absolute; opacity: 0; width: 0; height: 0; }

.tp-slider {
  position: relative;
  width: 42px;
  height: 23px;
  flex: none;
  border-radius: var(--tp-radius-pill);
  background: var(--tp-border-strong);
  transition: background var(--tp-transition);
}
.tp-slider::before {
  content: "";
  position: absolute;
  inset-inline-start: 3px;
  top: 3px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #fff;
  transition: transform var(--tp-transition);
}
.tp-switch input:checked + .tp-slider { background: var(--tp-green); }
.tp-switch input:checked + .tp-slider::before { transform: translateX(19px); }
html[dir="rtl"] .tp-switch input:checked + .tp-slider::before { transform: translateX(-19px); }
.tp-switch input:focus-visible + .tp-slider { outline: 2px solid var(--tp-brand-500); outline-offset: 2px; }

/* --------------------------------------------------------------------------
   13. Layout utilities
   --------------------------------------------------------------------------
   A small, fixed set that replaces the ad hoc inline style attributes that
   used to be scattered through the page classes. Keep this list short: a
   recurring pattern belongs in a named component above, not here.
   -------------------------------------------------------------------------- */

.tp-row      { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tp-row-tight{ display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tp-row-top  { align-items: flex-start; }
.tp-col      { display: flex; flex-direction: column; gap: 6px; }
.tp-between  { justify-content: space-between; }
.tp-end      { justify-content: flex-end; }
.tp-center-x { justify-content: center; }
.tp-grow     { flex: 1; min-width: 0; }

.tp-mt-0 { margin-top: 0; }
.tp-mt-1 { margin-top: 8px; }
.tp-mt-2 { margin-top: 16px; }
.tp-mt-3 { margin-top: 24px; }
.tp-mb-0 { margin-bottom: 0; }
.tp-mb-1 { margin-bottom: 8px; }
.tp-mb-2 { margin-bottom: 16px; }
.tp-mb-3 { margin-bottom: 24px; }

.tp-w-full { width: 100%; }
.tp-w-sm   { width: 100%; max-width: 180px; }
.tp-w-md   { width: 100%; max-width: 320px; }
.tp-w-lg   { width: 100%; max-width: 520px; }

.tp-text-dim    { color: var(--tp-text-dim); }
.tp-text-soft   { color: var(--tp-text-soft); }
.tp-text-sm     { font-size: 12.5px; }
.tp-text-strong { font-weight: 650; }
.tp-text-center { text-align: center; }
.tp-text-end    { text-align: end; }
.tp-nowrap      { white-space: nowrap; }
.tp-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 12.5px;
}

.tp-hidden { display: none !important; }
.tp-inline-block { display: inline-block; }

/* --------------------------------------------------------------------------
   14. Status counters (Orders / Tickets summary boxes)
   -------------------------------------------------------------------------- */

.tp-status-counters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 4px 0 16px;
}

.tp-counter {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 92px;
  padding: 9px 13px;
  border: 1px solid var(--tp-border);
  border-radius: var(--tp-radius-md);
  background: var(--tp-surface);
  color: var(--tp-text) !important;
  text-decoration: none !important;
  box-shadow: var(--tp-shadow-sm);
  transition: border-color var(--tp-transition), background var(--tp-transition);
}
.tp-counter:hover { border-color: var(--tp-brand-500); background: var(--tp-surface-2); }
.tp-counter strong { font-weight: 600; font-size: 13.5px; }

.tp-counter-dot {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: var(--tp-radius-pill);
  background: var(--tp-text-dim);
}
.tp-dot-amber   { background: var(--tp-amber); }
.tp-dot-red     { background: var(--tp-red); }
.tp-dot-green   { background: var(--tp-green); }
.tp-dot-blue    { background: var(--tp-blue); }
.tp-dot-neutral { background: var(--tp-text-dim); }

.tp-counter-badge {
  position: absolute;
  top: -7px;
  inset-inline-end: -7px;
  display: grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding-inline: 6px;
  border: 2px solid var(--tp-surface);
  border-radius: var(--tp-radius-pill);
  background: var(--tp-red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

/* --------------------------------------------------------------------------
   15. Misc content bits
   -------------------------------------------------------------------------- */

.tp-unread-dot { color: var(--tp-blue); font-weight: 700; }

/* tr.is-unread / tr.is-muted used to be defined here as two one-liners. They
   are only ever used by the Tickets list, and now have a third sibling
   (.is-waiting), so all three live together in section 15b below. */

.tp-link-box {
  max-height: 58px;
  overflow: auto;
  padding: 7px 9px;
  border: 1px solid var(--tp-border);
  border-radius: var(--tp-radius-sm);
  background: var(--tp-surface-2);
  direction: ltr;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.tp-code-inline {
  display: inline-block;
  padding: 2px 6px;
  border-radius: var(--tp-radius-sm);
  background: var(--tp-surface-3);
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-word;
}

.tp-logo-thumb {
  width: 34px;
  height: 34px;
  object-fit: contain;
  border: 1px solid var(--tp-border);
  border-radius: var(--tp-radius-sm);
  background: #fff;
}

.tp-divider { height: 1px; margin: 20px 0; background: var(--tp-border); }

.tp-card-pad { padding: 16px; }
.tp-card-muted { background: var(--tp-surface-2); }

.tp-subtitle { margin: 0; font-size: 13.5px; font-weight: 650; }

/* A read-only value shown where an input would otherwise sit. This class was
   used by the ticket screen but had no rule at all, so those values rendered
   as unstyled bare text. */
.tp-static {
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid var(--tp-border);
  border-radius: var(--tp-radius-sm);
  background: var(--tp-surface-2);
  color: var(--tp-text);
  font-size: 13.5px;
  word-break: break-word;
}

.tp-thread {
  max-height: 520px;
  overflow-y: auto;
  padding-inline-end: 6px;
  scrollbar-width: thin;
}

.tp-message {
  max-width: 88%;
  margin-bottom: 12px;
  padding: 11px 14px;
  border: 1px solid var(--tp-border);
  border-radius: var(--tp-radius-md);
  background: var(--tp-surface-2);
  box-shadow: var(--tp-shadow-sm);
}
/* The customer's own messages hug the start edge, support hugs the end edge,
   so a long thread reads as a conversation rather than one column of boxes. */
.tp-message.is-user  { margin-inline-end: auto; border-start-start-radius: 4px; }
.tp-message.is-admin {
  margin-inline-start: auto;
  border-start-end-radius: 4px;
  border-color: color-mix(in srgb, var(--tp-blue) 35%, var(--tp-border));
  background: color-mix(in srgb, var(--tp-blue) 8%, var(--tp-surface));
}
.tp-message-meta { margin-bottom: 5px; color: var(--tp-text-dim); font-size: 12px; }
.tp-message-body { white-space: pre-wrap; word-break: break-word; line-height: 1.7; }

/* --------------------------------------------------------------------------
   15b. Tickets
   --------------------------------------------------------------------------
   The list screen's row states and the two-column single-ticket screen.
   -------------------------------------------------------------------------- */

/* "New" tag beside the status pill: shown whenever the admin has not read the
   ticket, INCLUDING on a closed one. */
.tp-pill-new {
  background: var(--tp-blue);
  color: #fff;
  letter-spacing: .2px;
}

.tp-tickets-tablecard { margin-top: 4px; }
.tp-ticket-subject-cell { font-weight: 600; }

/* Actions cell: View + the icon-only close button side by side. The close
   button keeps the small-button height, so the row does not grow. */
.tp-ticket-actions { display: inline-flex; align-items: center; gap: 6px; }
.tp-ticket-close-btn { padding-inline: 7px; }
.tp-ticket-close-btn .tp-icon { display: block; }

/* Row states, in the priority the page applies them (TicketsPage::render()).
   .is-unread is set first, so a ticket the customer answered AND closed in one
   act still stands out instead of being greyed away.

   SPECIFICITY, and the reason the colour coding used to look almost absent:
   the tickets table is striped, and `.tp-table-striped tbody tr:nth-child(even)
   td` (0,2,3) outranked a bare `tr.is-unread td` (0,1,2) — so every SECOND row
   lost its state colour entirely and was painted plain stripe grey. Scoping
   these to .tp-tickets-table puts them above both the stripe and the hover
   rule, so a state now paints every row it applies to. */
.tp-table.tp-tickets-table tbody tr.is-unread td {
  background: rgba(59, 130, 246, .2);
  background: color-mix(in srgb, var(--tp-blue) 20%, transparent);
}
.tp-table.tp-tickets-table tbody tr.is-unread:hover td {
  background: rgba(59, 130, 246, .28);
  background: color-mix(in srgb, var(--tp-blue) 28%, transparent);
}
tr.is-unread .tp-ticket-subject-cell { font-weight: 700; }

/* Closed and already read: plain white row, everything dimmed so it reads as
   finished. The controls come back to full strength on hover, so a closed
   ticket is still comfortably clickable. */
.tp-table.tp-tickets-table tbody tr.is-muted td {
  background: var(--tp-surface);
  color: var(--tp-text-dim);
}
.tp-table.tp-tickets-table tbody tr.is-muted:hover td {
  background: var(--tp-surface-2);
}
tr.is-muted .tp-btn,
tr.is-muted .tp-pill { opacity: .55; }
tr.is-muted:hover .tp-btn,
tr.is-muted:hover .tp-pill { opacity: 1; }

/* Answered and read: the ball is with the customer. A soft purple, kept
   deliberately lighter than the unread blue above so the row that still needs
   the admin always reads as the stronger of the two. */
.tp-table.tp-tickets-table tbody tr.is-waiting td {
  background: rgba(147, 64, 173, .1);
  background: color-mix(in srgb, var(--tp-brand-500) 10%, transparent);
}
.tp-table.tp-tickets-table tbody tr.is-waiting:hover td {
  background: rgba(147, 64, 173, .16);
  background: color-mix(in srgb, var(--tp-brand-500) 16%, transparent);
}

/* Single ticket screen ---------------------------------------------------- */

.tp-ticketview-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.tp-ticketview-heading { min-width: 0; }
.tp-ticketview-sub { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }

/* Two columns: the conversation gets the room, the facts get a narrow rail.
   This is what stops every card from spanning the whole page. */
.tp-ticketview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
  align-items: start;
}
.tp-ticketview-main,
.tp-ticketview-side { min-width: 0; }

@media (max-width: 1000px) {
  .tp-ticketview-grid { grid-template-columns: minmax(0, 1fr); }
}

/* Saved replies: the small bar above the reply box and its dialog
   (TicketViewPage::canned_bar() / canned_modal(), admin-ticket-replies.js). */
.tp-canned {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.tp-canned-select {
  flex: 1 1 200px;
  min-width: 0;
  max-width: 340px;
  padding: 6px 9px;
  font-size: 13px;
}
.tp-canned-error { color: var(--tp-red); }
/* Delete sits apart from Cancel / Save, on the far side of the row. */
.tp-confirm-actions .tp-canned-del { margin-inline-end: auto; }

/* Label + value line in the side rail. */
.tp-fact {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--tp-border);
  font-size: 13px;
}
.tp-fact:last-child { border-bottom: 0; padding-bottom: 0; }
.tp-fact-label { flex: none; color: var(--tp-text-soft); font-weight: 600; }
.tp-fact-value { min-width: 0; text-align: end; word-break: break-word; }

/* --------------------------------------------------------------------------
   16. KYC box (User edit)
   --------------------------------------------------------------------------
   Replaces the PHP-constant "design tokens" that used to live in
   KYCMetabox.php. Image and field sizes are kept as they were.
   -------------------------------------------------------------------------- */

.tp-kyc-box {
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid var(--tp-border);
  border-radius: var(--tp-radius-lg);
  background: var(--tp-surface-2);
}

.tp-kyc-subbox {
  padding: 12px;
  border: 1px solid var(--tp-border);
  border-radius: var(--tp-radius-md);
  background: var(--tp-surface);
}

.tp-kyc-heading { margin: 0 0 12px; font-size: 15px; font-weight: 650; }

.tp-kyc-label {
  margin: 0 0 4px;
  color: var(--tp-text-soft);
  font-size: 12px;
}

.tp-kyc-value { margin: 0 0 10px; font-size: 14px; }
.tp-kyc-value.is-dim { color: var(--tp-text-dim); }

.tp-kyc-note {
  padding: 8px 10px;
  border-radius: var(--tp-radius-sm);
  background: var(--tp-surface-3);
  white-space: pre-wrap;
}

.tp-kyc-callout {
  padding: 8px 10px;
  border: 1px solid var(--tp-amber);
  border-radius: var(--tp-radius-sm);
  background: color-mix(in srgb, var(--tp-amber) 12%, var(--tp-surface));
}

/* Held payments. On a phone the six columns were squeezed into the screen
   width and the text broke letter by letter; the table now keeps a readable
   width and its .tp-table-scroll wrapper scrolls sideways instead. Only the
   reason - the one long text - may wrap. */
.tp-kyc-table { width: 100%; min-width: 680px; border-collapse: collapse; }
.tp-kyc-cell {
  padding: 8px 10px;
  border: 1px solid var(--tp-border);
  vertical-align: top;
  white-space: nowrap;
}
.tp-kyc-table .tp-kyc-reason { min-width: 200px; white-space: normal; }

/* Card to card lists (requests + bank SMS). Same approach: on a phone the
   bank SMS text was squeezed to a few letters per line; the text keeps the
   width it has on a desktop and .tp-table-scroll scrolls sideways instead. */
.tp-c2c-table .tp-c2c-text { min-width: 280px; max-width: 420px; white-space: pre-wrap; }
.tp-c2c-table .tp-c2c-wide { min-width: 180px; }
.tp-kyc-table .tp-inline-block { margin: 0; }

.tp-kyc-image {
  display: block;
  max-width: 100%;
  max-height: 180px;
  margin-bottom: 8px;
  border: 1px solid var(--tp-border);
  border-radius: var(--tp-radius-sm);
}

/* "View image / View video" under each KYC file (KYCMetabox::view_button). */
.tp-kyc-view { margin-bottom: 8px; }

/* --------------------------------------------------------------------------
   Settings > Userside Theme — theme picker
   A small preview of each of the five Userside themes, so the admin picks by
   look rather than by name. Uses the panel-admin tokens, not the Userside
   ones: this control lives in panel-admin.
   -------------------------------------------------------------------------- */
.tp-us-themegrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 12px;
}

.tp-us-themecard {
  position: relative;
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 2px solid var(--tp-border);
  border-radius: var(--tp-radius-lg);
  background: var(--tp-surface);
  cursor: pointer;
  transition: border-color var(--tp-transition), box-shadow var(--tp-transition),
              transform var(--tp-transition);
}
.tp-us-themecard:hover { transform: translateY(-2px); box-shadow: var(--tp-shadow); }
.tp-us-themecard.is-active { border-color: var(--tp-brand-600); box-shadow: var(--tp-shadow); }

/* The radio stays focusable for the keyboard but is not drawn. */
.tp-us-themecard input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.tp-us-themecard input[type="radio"]:focus-visible + .tp-us-themeswatch {
  outline: 2px solid var(--tp-brand-500);
  outline-offset: 2px;
}

/* Three bands: sidebar colour, accent colour, page background. */
.tp-us-themeswatch {
  display: grid;
  grid-template-columns: 2fr 1fr 2fr;
  height: 44px;
  border-radius: var(--tp-radius-md);
  overflow: hidden;
}
.tp-us-themeswatch > span { display: block; }

.tp-us-themename { font-size: 13.5px; font-weight: 700; }
.tp-us-thememeta { color: var(--tp-text-dim); font-size: 11.5px; }

/* Live selection without JS. The server also prints .is-active, so browsers
   without :has() still show the saved choice, just not the un-saved one. */
.tp-us-themecard:has(input[type="radio"]:checked) {
  border-color: var(--tp-brand-600);
  box-shadow: var(--tp-shadow);
}

/* --------------------------------------------------------------------------
   Updates: service picker in the announcement editor
   -------------------------------------------------------------------------- */

/* Results drop under the search box rather than in a dialog: the editor is a
   plain form and a modal would put the rest of the fields out of reach. */
.tp-upd-results {
  margin-block-start: 6px;
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid var(--tp-border);
  border-radius: var(--tp-radius-md);
  background: var(--tp-surface);
}

.tp-upd-result {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-block-end: 1px solid var(--tp-border);
  background: transparent;
  color: var(--tp-text);
  font: inherit;
  font-size: 13px;
  text-align: start;
  cursor: pointer;
}
.tp-upd-result:last-child { border-block-end: 0; }
.tp-upd-result:hover { background: var(--tp-surface-2); }
.tp-upd-result.is-empty { color: var(--tp-text-dim); cursor: default; }
.tp-upd-result.is-empty:hover { background: transparent; }

.tp-upd-result-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-upd-result-rate { flex: none; color: var(--tp-text-dim); font-variant-numeric: tabular-nums; }

.tp-upd-picked {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 10px;
  border: 1px solid var(--tp-border);
  border-radius: var(--tp-radius-md);
  background: var(--tp-surface-2);
}

/* The chosen services of an announcement, one removable chip each
   (UpdateEditPage::service_field, admin-updates.js). */
.tp-upd-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tp-upd-chips:not(:empty) { margin-block-end: 8px; }
.tp-upd-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 4px 6px 4px 10px;
  border: 1px solid var(--tp-border);
  border-radius: var(--tp-radius-md);
  background: var(--tp-surface-2);
  font-size: 12.5px;
}
.tp-upd-chip-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 320px; }
.tp-upd-chip-x {
  flex: none;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: var(--tp-radius-sm);
  background: transparent;
  color: var(--tp-text-dim);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.tp-upd-chip-x:hover { background: var(--tp-surface-3); color: var(--tp-text); }
.tp-upd-result-all { justify-content: center; font-weight: 600; }

/* --------------------------------------------------------------------------
   17. Services: provider picker + import results
   --------------------------------------------------------------------------
   Every selector below was already being emitted by ServicesPage.php and
   admin-services.js but had no rule anywhere in the project, so the controls
   rendered as unstyled browser defaults - and #tp-provider-services was
   painted dark by a hard-coded inline <style> in the PHP. The look now comes
   from the --tp-picker-* tokens, so it follows the light/dark theme.
   -------------------------------------------------------------------------- */

/* The provider-services list in the Add New panel. */
#tp-provider-services {
  max-height: 280px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--tp-picker-border);
  border-radius: var(--tp-radius-md);
  background: var(--tp-picker-bg);
  color: var(--tp-text);
}
#tp-provider-services em { color: var(--tp-text-soft); font-style: normal; }
#tp-provider-services .error { color: var(--tp-red); }

.tp-svc-list { display: flex; flex-direction: column; gap: 6px; }

#tp-svc-filter {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--tp-picker-border);
  border-radius: var(--tp-radius-sm);
  background: var(--tp-surface);
  color: var(--tp-text);
  font: inherit;
  font-size: 13px;
}

.tp-svc-items { display: flex; flex-direction: column; }

.tp-svc-item {
  padding: 7px 9px;
  border-radius: var(--tp-radius-sm);
  color: var(--tp-text);
  font-size: 13px;
  cursor: pointer;
}
.tp-svc-item + .tp-svc-item { border-block-start: 1px solid var(--tp-picker-border); }
.tp-svc-item:hover { background: var(--tp-picker-hover); }
.tp-svc-item.is-selected {
  background: var(--tp-picker-hover);
  font-weight: 600;
}

/* Collapsed state: a service has been picked, so the list folds away and only
   the chosen row is left on screen. Typing a new API service id reopens it
   (see admin-services.js). */
.tp-svc-selected { display: none; }
#tp-provider-services.is-collapsed {
  max-height: none;
  overflow: visible;
}
#tp-provider-services.is-collapsed #tp-svc-filter,
#tp-provider-services.is-collapsed .tp-svc-items { display: none; }
#tp-provider-services.is-collapsed .tp-svc-selected {
  display: block;
  padding: 7px 9px;
  border-radius: var(--tp-radius-sm);
  background: var(--tp-picker-hover);
  color: var(--tp-text);
  font-size: 13px;
  font-weight: 600;
}

/* Live suggestions under the API Service ID field. */
.tp-suggest {
  max-height: 240px;
  margin-block-start: 6px;
  overflow-y: auto;
  border: 1px solid var(--tp-picker-border);
  border-radius: var(--tp-radius-md);
  background: var(--tp-picker-bg);
  box-shadow: var(--tp-shadow-sm);
}
.tp-suggest ul { margin: 0; padding: 0; list-style: none; }
.tp-suggest li {
  padding: 7px 10px;
  color: var(--tp-text);
  font-size: 13px;
  cursor: pointer;
}
.tp-suggest li + li { border-block-start: 1px solid var(--tp-picker-border); }
.tp-suggest li:hover { background: var(--tp-picker-hover); }

/* Import from Provider: the toolbar above the results and the results table. */
.tp-import-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

/* The results are a data table, so they keep the normal table surface every
   other list in the panel uses - only the frame and the sticky header are
   added here. The lavender above belongs to the pickers, not to data. */
.tp-import-scroller {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--tp-border);
  border-radius: var(--tp-radius-md);
  background: var(--tp-surface);
}
#toral-import-results em { color: var(--tp-text-soft); font-style: normal; }
#toral-import-results .error { color: var(--tp-red); }

/* The scroller is a fixed-height box (JS sizes it to ~30 rows), so the header
   has to stay put while the body scrolls under it. */
.tp-import-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}

/* Field widths used by the services form. */
.tp-w-25 { width: 100%; max-width: 250px; }
.tp-name-field { width: 100%; }

/* The Name field's live preview — the name with its {codes} filled in, printed
   under the textarea by admin-services.js.
   It is only shown while the name actually carries a code (the script sets
   `hidden` otherwise), so it costs the form no room the rest of the time. The
   expanded text has no Latin {code} island left in it, which is the whole point:
   it reads in one direction where the textarea above it cannot. */
.tp-name-preview {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  margin-top: 6px;
  padding: 6px 10px;
  border: 1px solid var(--tp-border);
  border-radius: var(--tp-radius-sm);
  background: var(--tp-surface-2);
  font-size: 12px;
  line-height: 1.8;
}
.tp-name-preview[hidden] { display: none; }
.tp-name-preview-label { color: var(--tp-text-soft); white-space: nowrap; }
.tp-name-preview-value { font-weight: 600; }

/* --------------------------------------------------------------------------
   18. Order Requests (Refill / Cancel)
   -------------------------------------------------------------------------- */

/* A row action posts its own tiny form. A <form> is a block element, so
   without this each button dropped onto its own line and doubled the row. */
.tp-inline-post {
  display: inline-block;
  margin: 0;
  margin-inline-end: 6px;
}

/* Open-request count beside a tab label. */
.tp-tab-count {
  display: inline-block;
  min-width: 18px;
  margin-inline-start: 6px;
  padding: 1px 6px;
  border-radius: var(--tp-radius-pill);
  background: var(--tp-surface-3);
  color: var(--tp-text-soft);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}
/* Something on that tab waits for the admin (Users > KYC review): the same
   amber as the sidebar badge that points to it. */
.tp-tab-count.is-alert { background: var(--tp-amber); color: #3d2600; }

/* Providers list: the Enabled column prints a tick or a dash with these
   classes, which had no rule. */
.tp-check { color: var(--tp-green); font-weight: 700; }
.tp-dash  { color: var(--tp-text-dim); }

/* The per-service auto sync tick under the service name field. */
.tp-svc-autosync { margin-top: 8px; }
.tp-svc-autosync .tp-help { margin-top: 4px; }

/* --------------------------------------------------------------------------
   hidden
   --------------------------------------------------------------------------
   ROOT FIX, not a patch for one screen: the user agent's own
   `[hidden] { display: none }` is a plain element rule, so ANY class rule that
   sets `display` (.tp-card, .tp-field, .tp-row, .tp-actions, .tp-upd-picked …)
   silently beats it and a `hidden` element stays on screen. Every panel-admin
   screen that shows/hides a field from PHP or JS depends on this working, so
   the rule is stated once, here, for the whole admin. */
[hidden] { display: none !important; }

/* --------------------------------------------------------------------------
   Categories screen (/panel-admin/categories/)
   --------------------------------------------------------------------------
   The two cards on this screen are edit-in-place tables: every row carries a
   whole form. The controls therefore have to be compact, or a row grows to
   three lines and the page reads as a wall of buttons. */

.tp-cat-page .tp-btn { padding: 6px 11px; font-size: 12.5px; }

.tp-cat-page .tp-toolbar,
.tp-cat-page .tp-inline-form { padding: 10px 12px; gap: 7px; }

.tp-cat-table th,
.tp-cat-table td { padding: 6px 10px; }

.tp-cat-table td { white-space: nowrap; }

/* Save and Delete are two separate forms; this keeps them on one line with an
   even gap instead of letting Delete drop to a line of its own. */
.tp-row-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
}

.tp-row-form {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.tp-content .tp-row-form :where(input:not([type=checkbox]):not([type=radio]):not([type=file]),
                                select) {
  padding: 5px 9px;
  border: 1px solid var(--tp-border-strong);
  border-radius: var(--tp-radius-md);
  background: var(--tp-surface);
  color: var(--tp-text);
  font: inherit;
  font-size: 12.5px;
  min-width: 0;
}

.tp-content .tp-row-form input[type=file] { font-size: 11.5px; max-width: 150px; }
.tp-content .tp-row-form select { min-width: 96px; }
.tp-content .tp-row-form .tp-input.tp-w-sm { width: 130px; max-width: 130px; }

/* --------------------------------------------------------------------------
   Centred dialogs
   --------------------------------------------------------------------------
   One set of rules serves both:
     .tp-del-*     the delete-category dialog (assets/js/admin-categories.js)
     .tp-confirm-* the shared confirmation gate (assets/js/toral-admin.js),
                   used by every [data-tp-confirm] control in the panel.
   They used to paint their own colours inline, which ignored the panel
   theme. */

.tp-del-modal,
.tp-confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 16px;
}
.tp-del-backdrop,
.tp-confirm-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); }
.tp-del-box,
.tp-confirm-box {
  position: relative;
  width: 100%;
  max-width: 520px;
  padding: 18px;
  border: 1px solid var(--tp-border);
  border-radius: var(--tp-radius-lg);
  background: var(--tp-surface);
  box-shadow: var(--tp-shadow-lg);
  color: var(--tp-text);
}
.tp-del-title,
.tp-confirm-title { margin-bottom: 8px; font-size: 15px; font-weight: 700; }
.tp-del-text,
.tp-confirm-text { margin-bottom: 6px; }
.tp-del-note,
.tp-confirm-note { margin-bottom: 16px; color: var(--tp-text-dim); font-size: 12.5px; }
.tp-del-actions,
.tp-confirm-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }

/* The confirm dialog's note is optional, so the gap above the buttons is put
   on the buttons themselves rather than on whatever happens to precede them. */
.tp-confirm-note { margin-bottom: 0; }
.tp-confirm-actions { margin-top: 16px; }

@media (max-width: 782px) {
  /* On a phone the row's controls stack, and the update form is flattened into
     the actions strip (display: contents) so that Save no longer occupies a
     whole line of its own: Save and Delete end up side by side on the last
     line, Save first. */
  .tp-cat-table td { white-space: normal; }
  .tp-cat-page .tp-row-actions { flex-wrap: wrap; row-gap: 6px; }
  .tp-cat-page .tp-row-form-edit { display: contents; }
}

/* The two cards on the Categories screen hold their content directly (no
   .tp-card-body wrapper), so they carry the gutter themselves. */
.tp-cat-page .tp-card { padding: 14px 16px; }
.tp-cat-page .tp-card > .tp-table-scroll {
  min-width: 0;                       /* flex child must be allowed to shrink,
                                         otherwise it never scrolls sideways */
  border: 1px solid var(--tp-border);
  border-radius: var(--tp-radius-md);
}

/* --------------------------------------------------------------------------
   19. Orders table (panel-admin)
   --------------------------------------------------------------------------
   Everything below is scoped to .tp-orders-table so no other list inherits it.

   The problem it solves: the table shared its width out evenly, so User and
   API Response - two columns whose content is a single string - grew as wide
   as their longest value and squeezed Order Details, the one column that has
   four things to show. Those two are pinned narrow and made scrollable
   instead, and the space goes where it is read.
   -------------------------------------------------------------------------- */

/* Sticky header.

   position:sticky resolves against the nearest scroll container. .tp-table-scroll
   scrolls sideways, and `overflow-y: hidden` made it a vertical scroll container
   as well - one that never scrolls - so a sticky header pinned itself to a box
   that does not move and did nothing at all. `clip` clips exactly the same way
   without creating that scroll container, so the header now resolves against
   .tp-content, which is the surface the admin actually scrolls. The `hidden`
   line before it is the fallback for a browser without `clip`: the header stops
   being sticky, nothing else changes. */
.tp-table-scroll-sticky {
  overflow-y: hidden;
  overflow-y: clip;
}

.tp-table-sticky thead th,
.tp-table-sticky thead td {
  position: sticky;
  inset-block-start: 0;
  z-index: 3;
  /* The header is opaque on purpose: rows scroll underneath it. */
  background: var(--tp-table-head);
}

/* A background a shade off the card behind it, so the rows read as a block.
   Deliberately faint - it has to survive both themes without becoming a
   second colour on the page. */
.tp-orders-table {
  background: color-mix(in srgb, var(--tp-surface-2) 55%, var(--tp-surface));
}
.tp-orders-table tbody tr:nth-child(even) td {
  background: color-mix(in srgb, var(--tp-surface-2) 85%, var(--tp-surface));
}
.tp-orders-table tbody tr:hover td { background: var(--tp-surface-2); }

/* Column widths. `table-layout: auto` is kept so a short list still looks
   natural; these are targets, not hard limits. */
.tp-orders-table .tp-col-id       { width: 62px;  white-space: nowrap; }
.tp-orders-table .tp-col-details  { width: 34%;   min-width: 280px; }
.tp-orders-table .tp-col-provider { width: 130px; }
/* Qty and Price moved into Order Details, and Date prints the day and the
   time on two lines instead of one - so Date needs no more than the width of
   a date, and everything those three changes freed goes to User, the column
   that was wrapping a longer login. */
.tp-orders-table .tp-col-user     { width: 316px; }
/* On a phone the table is only as wide as the screen, and `width` above is a
   target, so the User column was squeezed to a sliver. A floor makes the
   table wider than the screen instead, and .tp-table-scroll scrolls sideways
   (the same approach as .tp-users-table .tp-col-user). */
@media (max-width: 782px) {
  .tp-orders-table .tp-col-user   { min-width: 316px; }
}
.tp-orders-table .tp-col-status  { width: 96px;  white-space: nowrap; }
.tp-orders-table .tp-col-date     { width: 110px; white-space: nowrap; }
.tp-orders-table .tp-col-api      { width: 168px; }
.tp-orders-table .tp-col-actions  { width: 96px; }

/* The login in the orders list. Plain readable text that wraps inside its own
   column - no scroller, no truncation - and keeps the row height down. */
.tp-orders-table .tp-user-name {
  display: block;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  color: inherit;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.tp-orders-table a.tp-user-name:hover { color: var(--tp-brand-500); }

/* Date and time, stacked. The time is the secondary half of the pair, so it
   reads a shade quieter than the day above it. */
.tp-orders-table .tp-date-day  { font-size: 13px; line-height: 1.35; }
.tp-orders-table .tp-date-time {
  font-size: 12px;
  line-height: 1.35;
  color: var(--tp-text-soft);
}

/* The narrow, scrollable box used by API Response.

   Closed it is a couple of lines with its own scrollbar; the title attribute
   carries the full text, so hovering already shows everything as a tooltip.
   Clicking or tapping it (it is focusable) opens it fully.

   It opens by growing its own row, NOT by floating over the table. A floating
   panel would be cut off: the table sits in a container that scrolls sideways
   and clips vertically, so an overlay on one of the lower rows would simply
   disappear below the edge. Growing the row is always fully visible. */
.tp-cellbox {
  display: block;
  max-height: 44px;
  overflow: auto;
  padding: 4px 6px;
  border: 1px solid var(--tp-border);
  border-radius: var(--tp-radius-sm);
  background: var(--tp-surface);
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  cursor: pointer;
  transition: max-height var(--tp-transition), border-color var(--tp-transition);
}
.tp-cellbox-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  direction: ltr;
  text-align: start;
}
/* Opened by click, tap or keyboard focus. */
.tp-cellbox:focus,
.tp-cellbox:focus-within {
  max-height: none;
  border-color: var(--tp-brand-500);
  cursor: text;
  outline: none;
}
/* A hint that there is more to see, while it is closed. */
.tp-cellbox:hover { border-color: var(--tp-border-strong); }

/* Link + copy button, mirroring the customer's own Orders list. */
.tp-linkwrap {
  display: inline-flex;
  align-items: flex-start;
  gap: 5px;
  max-width: 100%;
}
.tp-linkwrap .tp-link-box {
  display: block;
  flex: 1;
  min-width: 0;
  max-height: 44px;
  overflow: auto;
}

.tp-copybtn {
  flex: none;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid var(--tp-border);
  border-radius: var(--tp-radius-sm);
  background: var(--tp-surface);
  color: var(--tp-text-soft);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  transition: background var(--tp-transition), color var(--tp-transition), border-color var(--tp-transition);
}
.tp-copybtn:hover {
  border-color: var(--tp-brand-500);
  background: var(--tp-surface-2);
  color: var(--tp-text);
}
/* Confirmation, set by assets/js/toral-admin.js for a moment after a copy. */
.tp-copybtn.is-copied {
  border-color: var(--tp-green);
  background: var(--tp-green);
  color: #fff;
}

/* Row actions: compact, wrapping, and colour-coded by what they do.
   Every pairing below sets a background AND its own text colour, so a label
   can never end up the same shade as what it sits on - including the ghost
   Edit button, which keeps a dark label on a light surface. */
.tp-rowacts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.tp-rowact {
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}
.tp-rowact-edit {
  border-color: var(--tp-border);
  background: var(--tp-surface-2);
  color: var(--tp-text);
}
.tp-rowact-edit:hover { background: var(--tp-surface-3); color: var(--tp-text); }

.tp-rowact-send {
  border-color: var(--tp-action-blue);
  background: var(--tp-action-blue);
  color: #fff;
}
.tp-rowact-send:hover { background: var(--tp-action-blue-700); border-color: var(--tp-action-blue-700); color: #fff; }

.tp-rowact-refill {
  border-color: var(--tp-green);
  background: var(--tp-green);
  color: #fff;
}
.tp-rowact-refill:hover { filter: brightness(.92); color: #fff; }

.tp-rowact-cancel {
  border-color: var(--tp-red);
  background: var(--tp-red);
  color: #fff;
}
.tp-rowact-cancel:hover { background: #dc2626; border-color: #dc2626; color: #fff; }

/* Close button on the More filters popover. */
.tp-morefilters-close {
  position: absolute;
  inset-block-start: 4px;
  inset-inline-end: 4px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: var(--tp-radius-sm);
  background: transparent;
  color: var(--tp-text-soft);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
}
.tp-morefilters-close:hover { background: var(--tp-surface-3); color: var(--tp-text); }
/* Room for the button so it never lands on top of the first field. Only the
   top padding is touched, so the panel's own `position` - absolute on desktop,
   static below 900px - is left exactly as the rules above set it. */
.tp-morefilters-panel { padding-block-start: 28px; }

/* --------------------------------------------------------------------------
   Inline edit panel (Providers list)
   The "Edit" and "Add New Provider" forms are loaded by AJAX into a row of
   the table, or into a block above it. Those two containers had no styling of
   their own at all, so the form appeared flush against the table edge with no
   padding, no surface and no separation from the rows around it - the one
   place in panel-admin that did not look like the rest of it.
   -------------------------------------------------------------------------- */
.tp-inline-box:empty { display: none; }

/* Inside the table: a recessed strip under the row it belongs to. */
tr.tp-inline-row > td {
  padding: 0;
  background: var(--tp-surface-2);
}
/* The row hover tint would fight the strip's own background. */
.tp-table tbody tr.tp-inline-row:hover > td,
.tp-table-striped tbody tr.tp-inline-row:nth-child(even) > td,
.tp-table-striped tbody tr.tp-inline-row:nth-child(even):hover > td {
  background: var(--tp-surface-2);
}
tr.tp-inline-row > td > .tp-inline-box { padding: 18px 16px; }

/* Above the table ("Add New Provider"): a card of its own. */
div.tp-inline-row > .tp-inline-box {
  padding: 18px 16px;
  border: 1px solid var(--tp-border);
  border-radius: var(--tp-radius-lg);
  background: var(--tp-surface);
  box-shadow: var(--tp-shadow-sm);
}

/* The form's own bits: the fields already use .tp-form-table / .tp-input /
   .tp-btn, so only the wrappers need saying. */
.tp-provider-form .tp-form-table { margin: 0; }
.tp-provider-form .tp-actions { margin: 14px 0 0; }
.tp-provider-form .tp-form-status { margin-bottom: 14px; }

/* The Sync form sits beside the Edit dropdown in the actions cell. */
.tp-sync { display: inline-flex; align-items: center; gap: 8px; margin: 0; }

/* --------------------------------------------------------------------------
   24. Toasts  (the panel's notification)
   A stack pinned to the bottom of the window at the END of the inline
   direction: bottom right in an LTR panel, bottom left in an RTL one, from
   the one `inset-inline-end` - no separate [dir="rtl"] rule to keep in sync.
   Emitted once per page by Admin\UI\Toast, driven by assets/js/toral-admin.js.
   -------------------------------------------------------------------------- */

.tp-toasts {
  position: fixed;
  inset-block-end: 20px;
  inset-inline-end: 20px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(380px, calc(100vw - 32px));
  pointer-events: none;
}
.tp-toasts:empty { display: none; }

.tp-toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 14px;
  border: 1px solid var(--tp-border);
  border-inline-start: 3px solid var(--tp-border-strong);
  border-radius: var(--tp-radius-md);
  /* Light green so the toast stands out from the page; the text colour is
     set per theme below to stay readable on it. */
  border-color: #86d9b4;
  background: #dcf5e8;
  color: #0b3d2a;
  font-size: 13.5px;
  line-height: 1.55;
  box-shadow: var(--tp-shadow-lg);
  pointer-events: auto;
  animation: tp-toast-in 220ms cubic-bezier(.4, 0, .2, 1);
}
.tp-toast.is-leaving { animation: tp-toast-out 180ms ease-in forwards; }

.tp-toast-success { border-inline-start-color: var(--tp-green); }
.tp-toast-error   { border-inline-start-color: var(--tp-red); }
.tp-toast-warning { border-inline-start-color: var(--tp-amber); }
.tp-toast-info    { border-inline-start-color: var(--tp-blue); }

.tp-toast-icon { flex: none; margin-top: 1px; }
.tp-toast-success .tp-toast-icon { color: var(--tp-green); }
.tp-toast-error   .tp-toast-icon { color: var(--tp-red); }
.tp-toast-warning .tp-toast-icon { color: var(--tp-amber); }
.tp-toast-info    .tp-toast-icon { color: var(--tp-blue); }

.tp-toast-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }

.tp-toast-close {
  flex: none;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-block: -2px 0;
  margin-inline: 0 -4px;
  padding: 0;
  border: 0;
  border-radius: var(--tp-radius-sm);
  background: transparent;
  color: var(--tp-text-dim);
  cursor: pointer;
}
.tp-toast-close:hover { background: rgba(0, 0, 0, .08); color: inherit; }
.tp-toast-close { color: inherit; opacity: .7; }
.tp-toast-close:hover { opacity: 1; }

[data-tp-theme="dark"] .tp-toast {
  border-color: #2f7d5b;
  background: #16382b;
  color: #d6f5e6;
}
[data-tp-theme="dark"] .tp-toast-close:hover { background: rgba(255, 255, 255, .12); }

@keyframes tp-toast-in {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to   { opacity: 1; transform: none; }
}
@keyframes tp-toast-out {
  from { opacity: 1; transform: none; }
  to   { opacity: 0; transform: translateY(6px) scale(.98); }
}

/* An admin who asked for less motion gets the message without the slide. */
@media (prefers-reduced-motion: reduce) {
  .tp-toast, .tp-toast.is-leaving { animation: none; }
}

@media (max-width: 600px) {
  .tp-toasts { inset-inline: 16px; width: auto; }
}

/* --------------------------------------------------------------------------
   22. Settings screen
   --------------------------------------------------------------------------
   Classes the Settings tabs (and the user-edit cards) already asked for in
   their markup but that were never defined anywhere, so the elements fell
   back to browser defaults: an unstyled <ul>, a field label with no weight of
   its own, a translation table with full-height rows. Defining them here -
   next to the components they belong to - is what makes those screens match
   the rest of the panel instead of changing every call site.
   -------------------------------------------------------------------------- */

/* The small, dimmed field label used by Card::row(), the export box and the
   Access address fields. Without it those lines read as plain body text. */
.tp-kbd {
  color: var(--tp-text-soft);
  font-size: 12.5px;
  font-weight: 600;
}

/* Bulleted hint lists (Settings > Crons > Tips). */
.tp-list {
  margin: 0;
  padding-inline-start: 18px;
  color: var(--tp-text-soft);
  font-size: 13px;
  line-height: 1.9;
}
.tp-list > li + li { margin-top: 2px; }

/* Secondary text inside a table cell (the original string in Languages). */
.tp-small-text {
  font-size: 12.5px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

/* A table with many rows of short content: the translation editor. */
.tp-table-compact th,
.tp-table-compact td { padding-block: 8px; }
.tp-table-compact textarea { min-height: 38px; }

/* A titled block inside a card body, separated from the one above it. */
.tp-form-block { display: block; }
.tp-form-block + .tp-form-block { margin-top: 18px; }

/* Currency tab: the USD <-> custom-currency switch and its two side labels. */
.tp-currency-switch-row .tp-row { align-items: center; gap: 12px; }
.tp-switch-side {
  color: var(--tp-text-soft);
  font-size: 13px;
  font-weight: 600;
}

/*
 * Settings has eleven tabs. Wrapped onto three lines they read as a block of
 * text rather than a tab bar, so on narrow screens the row scrolls sideways
 * instead - one line, in the original order, with the active tab always
 * reachable. Wide screens are unchanged.
 */
@media (max-width: 1100px) {
  .tp-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }
  .tp-tabs a,
  .tp-tabs button { white-space: nowrap; }
}

/* --------------------------------------------------------------------------
   25. Messages tab
   --------------------------------------------------------------------------
   The message grid and the single-message editor (Settings > Messages).
   Kept together because they are two halves of one screen and nothing else
   uses them.
   -------------------------------------------------------------------------- */

.tp-msg-table td { vertical-align: top; }
.tp-msg-table td .tp-help { margin: 3px 0 0; }

.tp-msg-col-on  { width: 64px; text-align: center; }
.tp-msg-col-pat { width: 170px; }
.tp-msg-col-pat .tp-input { font-size: 12.5px; padding-block: 5px; }

.tp-msg-channels { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.tp-msg-channels .tp-checkbox { font-size: 12.5px; }

.tp-checkbox.tp-is-disabled { opacity: .45; cursor: not-allowed; }

/* "2 SMS — costs the customer 140 Toman", or the reason the SMS box is off.
   Sits under the channel checkboxes of one message. */
.tp-msg-smslen { margin-top: 5px; font-size: 12px; }
.tp-msg-smslen.is-blocked { color: var(--tp-red); }

/* Head of the Messages card: a setting elsewhere is quietly cancelling what
   this card was configured to do (e.g. pattern codes with the gateway's
   pattern switch off). Compact on purpose - it sits above a long grid. */
.tp-msg-warn {
  margin: 0 0 12px;
  padding: 8px 12px;
  border-inline-start: 3px solid var(--tp-amber);
  border-radius: 8px;
  background: rgba(245, 158, 11, .10);
  background: color-mix(in srgb, var(--tp-amber) 10%, transparent);
  color: inherit;
  line-height: 1.7;
}

/* The editor: text on the left, the placeholder cheat-sheet beside it. */
.tp-msg-edit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  gap: 20px;
  align-items: start;
}

.tp-msg-edit-main { min-width: 0; }

.tp-msg-edit-side {
  padding: 14px 16px;
  border: 1px solid var(--tp-border);
  border-radius: var(--tp-radius-md);
  background: var(--tp-surface-2);
  position: sticky;
  top: 12px;
}

.tp-msg-vars { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.tp-msg-vars li { display: flex; flex-direction: column; gap: 2px; }
.tp-msg-vars .tp-kbd { align-self: flex-start; direction: ltr; }
.tp-msg-vars .tp-help { margin: 0; }

.tp-sms-provider-block { margin-top: 4px; }
.tp-sms-provider-block[hidden] { display: none; }

/*
 * Narrow screens: the grid is five columns of real content, so it scrolls
 * sideways rather than folding into an unreadable stack, and the editor drops
 * its sidebar underneath the fields.
 */
@media (max-width: 900px) {
  .tp-msg-edit { grid-template-columns: 1fr; }
  .tp-msg-edit-side { position: static; }
}

@media (max-width: 760px) {
  .tp-msg-table { display: block; overflow-x: auto; white-space: nowrap; }
  .tp-msg-table td, .tp-msg-table th { white-space: normal; }
  .tp-msg-col-pat { width: 140px; }
}

/* A read-only multi-line value (an order's comment list, its usernames …).
   Same box as .tp-static, but it keeps the line breaks and never stretches
   the page: long lists scroll inside their own box. */
pre.tp-static.tp-pre-wrap {
  margin: 0;
  max-height: 220px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
  line-height: 1.7;
}

/* Order edit > Order information: the username is a link to the customer's
   page, and the provider's last answer keeps its own small time line under
   the box. Same box as .tp-static, so it sits in the grid like its
   neighbours and folds to one column on a phone with them. */
.tp-static.tp-static-link a {
  color: var(--tp-brand-500);
  font-weight: 600;
  text-decoration: none;
  word-break: break-all;
}
.tp-static.tp-static-link a:hover { text-decoration: underline; }
pre.tp-static.tp-api-reply {
  unicode-bidi: plaintext;
  font-size: 12.5px;
}
.tp-api-reply-at {
  margin-top: 4px;
  color: var(--tp-text-soft);
  font-size: 11.5px;
}
