/* Admin panel. */
.adm { max-width: 1200px; margin: 0 auto; padding: 32px max(16px, env(safe-area-inset-right, 0px)) 64px max(16px, env(safe-area-inset-left, 0px)); display: flex; flex-direction: column; gap: 20px; }
.adm-me { margin-left: 4px; }
.adm-gate { padding: 40px 0; text-align: center; color: var(--muted); }
.adm h2 { font-size: 20px; }
.adm-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.adm-stat { padding: 18px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.adm-stat span { font-size: 13px; color: var(--muted); }
.adm-stat b { font-family: var(--display); font-size: 30px; letter-spacing: -0.02em; color: var(--text); font-variant-numeric: tabular-nums; }
.adm-stat i { font-style: normal; font-size: 13px; color: var(--muted); }
.adm-meter { height: 6px; border-radius: 99px; background: var(--soft); overflow: hidden; margin-top: 6px; }
.adm-meter span { display: block; height: 100%; width: 0; background: var(--brand-400); border-radius: 99px; transition: width 0.4s var(--ease); }
.adm-meter.is-high span { background: var(--orange); }
.adm-card { padding: 20px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 14px; }
.adm-card .table-wrap { border: 0; border-radius: 0; }
.live-list { display: flex; flex-direction: column; gap: 8px; }
.live-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface-2); }
.live-row .live-dot { flex: none; }
.live-row b { min-width: 0; overflow-wrap: anywhere; }
.live-row .muted { font-family: var(--mono); font-size: 12.5px; }
.live-row .btn { margin-left: auto; }
.adm-users-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.adm-search { width: min(320px, 100%); height: 42px; }
.adm-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.adm-table th, .adm-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.adm-table th { font-size: 12.5px; font-weight: 600; color: var(--muted); background: transparent; }
.adm-table td.num, .adm-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.adm-table tbody tr.is-click { cursor: pointer; }
.adm-table tbody tr.is-click:hover { background: var(--brand-50); }
.adm-table tbody tr.is-off { opacity: 0.55; }
.adm-table .u-email { font-weight: 600; color: var(--text); }
.adm-table .u-name { color: var(--muted); font-size: 13px; }
.adm-table .low { color: var(--warn); }
.adm-table--sm { font-size: 13px; }
.badge { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; margin-left: 6px; border-radius: 6px; font-size: 11px; font-weight: 600; vertical-align: 1px; background: var(--soft); color: var(--text-2); }
.badge--admin { background: var(--brand-700); color: #fff; }
.badge--off { background: #fde4dc; color: #9a3412; }
.badge--live { background: #fdf1dc; color: var(--amber-ink); }

.adm-sheet { position: fixed; inset: 0; z-index: 20; background: rgba(15, 30, 51, 0.35); display: flex; justify-content: flex-end; animation: fade-in 0.2s var(--ease); }
.adm-panel {
  width: min(560px, 100%); height: 100%; overflow-y: auto; background: var(--bg); box-shadow: var(--shadow-2);
  padding: 28px max(20px, env(safe-area-inset-right, 0px)) 40px 28px; display: flex; flex-direction: column; gap: 16px; position: relative;
  animation: slide-in 0.3s var(--ease);
}
@keyframes slide-in { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.adm-panel > * { flex-shrink: 0; } /* scroll the panel, never squash its parts */
.adm-close { position: absolute; top: 18px; right: 18px; }
.p-head h2 { font-size: 22px; padding-right: 44px; overflow-wrap: anywhere; }
.p-badges .badge:first-child { margin-left: 0; }
.p-balance { display: flex; flex-direction: column; gap: 2px; padding: 16px; border-radius: var(--r-md); background: var(--brand-700); color: #e3e8ef; }
.p-balance b { font-family: var(--display); font-size: 36px; color: #fff; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.p-balance .muted { color: #b9c6d6; }
.p-credit { display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); }
.p-label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.p-quick { display: flex; gap: 8px; flex-wrap: wrap; }
.p-row { display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; }
.p-row .field { height: 44px; }
.p-msg { min-height: 18px; margin: 0; color: var(--muted); }
.p-msg.is-ok { color: var(--ok); }
.p-msg.is-err { color: var(--warn); }
.p-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.p-toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.adm-panel textarea { width: 100%; resize: vertical; border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 10px 12px; font: 400 14px/1.5 var(--font); background: var(--surface); color: var(--text); }
.adm-panel textarea:focus { outline: 0; border-color: var(--brand-400); box-shadow: 0 0 0 4px rgba(47, 93, 140, 0.12); }
.p-save-note { align-self: flex-start; }
.adm-panel h3 { font-size: 16px; margin-top: 6px; }
.adm-panel .table-wrap { background: var(--surface); }

@media (max-width: 900px) { .adm-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .adm-stats { grid-template-columns: 1fr; } .p-row { grid-template-columns: 1fr; } }

.req-row b { overflow-wrap: anywhere; }
.req-row .req-pack { font-weight: 600; }
.req-row .btn + .btn { margin-left: 0; }
.req-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.p-link { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: var(--r-md); background: var(--brand-50); }
.p-link .p-row { grid-template-columns: 1fr auto; }
.p-link input { font-family: var(--mono); font-size: 12.5px; }

/* Palabra wallet */
.pal { gap: 16px; }
.pal-main { display: grid; grid-template-columns: minmax(220px, 300px) minmax(0, 1fr); gap: 20px; align-items: stretch; }
.pal-wallet { padding: 18px 20px; border-radius: var(--r-md); background: var(--brand-700); color: #e3e8ef; display: flex; flex-direction: column; gap: 4px; }
.pal-label { font-size: 13px; color: #b9c6d6; }
.pal-wallet b { font-family: var(--display); font-size: 40px; line-height: 1.05; color: #fff; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.pal-sub { font-size: 14px; color: #d3dfeb; }
.pal-wallet.is-low { background: #7a2e0e; }
.pal-facts { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.pal-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.pal-chips .badge { margin-left: 0; }
.badge--ok { background: #e6f4ec; color: #14532d; }
.pal-line { margin: 0; font-size: 14.5px; color: var(--text-2); }
.pal-line.is-warn { padding: 10px 12px; border-radius: var(--r-sm); background: #fdf1dc; color: var(--amber-ink); }
.pal-key { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--line); font-size: 14.5px; }
.pal-form { display: flex; flex-direction: column; gap: 8px; }
.pal-form .p-row { grid-template-columns: 1fr auto; }
.mono { font-family: var(--mono); }
@media (max-width: 700px) { .pal-main { grid-template-columns: 1fr; } }

/* translation health */
.hl-sum { display: flex; gap: 8px; flex-wrap: wrap; }
.hl-sum .badge { height: 26px; padding: 0 10px; font-size: 13px; margin-left: 0; }
.hl { display: inline-flex; align-items: center; gap: 6px; white-space: normal; }
.hl-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--ok); }
.hl--warn .hl-dot { background: var(--orange); }
.hl--bad .hl-dot { background: #d9480f; }
.hl--unknown .hl-dot { background: var(--dim); }
.hl-why { color: var(--muted); font-size: 12.5px; }
.adm-table td.rate-bad { color: #b42318; font-weight: 600; }
.adm-table td.rate-warn { color: var(--amber-ink); font-weight: 600; }
.adm-table .hl-cell { white-space: normal; min-width: 180px; }
.badge--warn { background: #fdf1dc; color: var(--amber-ink); }

/* Translation card: facts as a two-column list. */
.r-facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; font-size: 14px; }
.r-facts dt { color: var(--muted); }
.r-facts dd { margin: 0; font-variant-numeric: tabular-nums; }
.r-facts a { color: inherit; }
.r-ev-bad td { color: #b42318; }
.r-ev-warn td { color: #9a6700; }
