/* ── Rework pass — cards, surfaces, dropdowns ─────────────────────────────
   Loaded last so it lands over main → boba → glass. Glass tints cards with
   !important, so background/border here carry !important too; everything
   else is plain so themes can still move it.                                 */

/* ══ Cards ═══════════════════════════════════════════════════════════════ */
.card,
.acard,
.panel-window {
  border-radius: var(--r-lg, 16px) !important;
  background:
    radial-gradient(120% 90% at 50% -20%, rgba(255, 255, 255, 0.055), transparent 62%),
    var(--glass-tint, var(--panel)) !important;
  border: 1px solid var(--glass-line, var(--line)) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.055),
    0 1px 2px rgba(0, 0, 0, 0.28),
    0 14px 34px -20px rgba(0, 0, 0, 0.72);
  transition:
    transform 0.26s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.26s ease,
    border-color 0.26s ease;
}

.card:hover,
.acard:hover {
  transform: translateY(-2px);
  border-color: var(--acc-line) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 2px 5px rgba(0, 0, 0, 0.34),
    0 24px 50px -24px rgba(0, 0, 0, 0.82),
    0 0 0 1px var(--acc-soft);
}

/* Head strip — sits on the card tint, separated by a hairline. */
.card-head {
  padding: 15px 18px !important;
  border-bottom: 1px solid var(--line-soft) !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0) 92%);
}

.card-head h2,
.card-head h3 {
  font-size: 14px !important;
  font-weight: 620 !important;
  letter-spacing: -0.012em !important;
}

/* Header glyph plates stay exactly as boba draws them — resizing them here
   knocked the optical centre off against the title. */

/* Stat / tone cards get the same body but keep their own rail styling. */
.stat,
.stat-card {
  border-radius: var(--r-lg, 16px);
  background:
    radial-gradient(120% 90% at 50% -20%, rgba(255, 255, 255, 0.05), transparent 62%),
    var(--glass-tint, var(--panel));
  border: 1px solid var(--glass-line, var(--line));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 10px 26px -18px rgba(0, 0, 0, 0.7);
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.22s ease, box-shadow 0.22s ease;
}

.stat:hover,
.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--acc-line);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 18px 38px -22px rgba(0, 0, 0, 0.8);
}

/* ══ Native selects ══════════════════════════════════════════════════════ */
select,
select.input {
  color-scheme: dark;
  border-radius: 10px !important;
  background-color: var(--field-bg);
  font-weight: 520;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background-color 0.18s ease;
  /* glass.css paints .input with the `background` shorthand, which wipes the
     chevron boba.css installed. Re-declare it here, last in the cascade. */
  padding-right: 40px !important;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238d97ae' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  background-size: 15px 15px;
  /* Match the resting border the text inputs carry, or the dropdown reads as
     a duller control sitting next to them. */
  border-color: var(--line) !important;
}

select:hover,
select.input:hover {
  border-color: var(--acc-line) !important;
  background-color: var(--panel-2, var(--panel));
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235eead4' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

select:focus,
select:focus-visible,
select.input:focus,
select.input:focus-visible {
  border-color: var(--acc) !important;
  box-shadow: 0 0 0 3px var(--acc-soft), inset 0 1px 0 rgba(255, 255, 255, 0.04) !important;
  outline: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235eead4' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6-6-6'/%3E%3C/svg%3E");
}

select option,
select.input option,
select optgroup {
  background: var(--panel-2, var(--panel));
  color: var(--txt);
}

select option:checked,
select option:hover {
  background: var(--acc-soft);
  color: var(--acc);
}

/* ══ ux-select (the styled list) ═════════════════════════════════════════ */
.ux-trigger {
  border-radius: 11px;
  border-color: var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(0, 0, 0, 0.12)), var(--field-bg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.ux-trigger:hover {
  border-color: var(--acc-line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(0, 0, 0, 0.14)), var(--field-bg);
}

.ux-select.is-open .ux-trigger {
  border-color: var(--acc);
  box-shadow: 0 0 0 3px var(--acc-soft), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.ux-chev {
  color: var(--muted);
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), color 0.16s ease;
}

.ux-select.is-open .ux-chev {
  transform: rotate(180deg);
  color: var(--acc);
}

.ux-panel {
  top: calc(100% + 7px);
  padding: 6px;
  border: 1px solid var(--acc-line);
  border-radius: 13px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent 30%),
    var(--panel-2, var(--panel));
  box-shadow:
    0 28px 70px -26px rgba(0, 0, 0, 0.9),
    0 0 0 1px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transform-origin: top center;
  animation: uxPanelIn 0.16s cubic-bezier(0.22, 1, 0.36, 1) both;
  overflow: hidden;
}

@keyframes uxPanelIn {
  from { opacity: 0; transform: translateY(-4px) scale(0.985); }
  to   { opacity: 1; transform: none; }
}

.ux-search {
  border-radius: 9px;
  border-color: var(--line);
  background: rgba(0, 0, 0, 0.35);
}

.ux-search:focus {
  border-color: var(--acc-line);
  box-shadow: 0 0 0 3px var(--acc-soft);
}

.ux-list {
  gap: 1px;
  scrollbar-width: thin;
}

.ux-option {
  border-radius: 8px;
  padding: 8px 10px;
  transition: background 0.12s ease, color 0.12s ease, padding-left 0.12s ease;
}

.ux-option:hover {
  background: var(--acc-soft);
  color: var(--txt);
  padding-left: 13px;
}

.ux-option.is-active {
  background: linear-gradient(90deg, var(--acc-soft), transparent 90%);
  color: var(--acc);
  box-shadow: inset 2px 0 0 var(--acc);
}

/* ══ User picker dropdown ════════════════════════════════════════════════ */
.userpick-menu {
  border-radius: 13px;
  border-color: var(--acc-line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent 30%),
    var(--panel-2, var(--panel));
  box-shadow: 0 28px 70px -26px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  animation: uxPanelIn 0.16s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.userpick-row {
  border-radius: 9px;
  transition: background 0.12s ease, color 0.12s ease;
}

.userpick-row:hover {
  background: var(--acc-soft);
}

/* ══ Sidebar Utilities dropdown ══════════════════════════════════════════ */
.side-drop-btn {
  border-radius: 10px;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.side-drop-btn:hover {
  border-color: var(--glass-line, var(--line));
}

.side-drop-btn.active {
  background: linear-gradient(90deg, var(--acc-soft), transparent 92%);
  border-color: var(--acc-line);
}

.side-sub {
  overflow: hidden;
  animation: sideSubIn 0.18s ease both;
}

@keyframes sideSubIn {
  from { opacity: 0; transform: translateY(-3px); }
  to   { opacity: 1; transform: none; }
}

.side-sub a {
  border-radius: 9px;
  transition: background 0.14s ease, color 0.14s ease, transform 0.14s ease;
}

.side-sub a:hover {
  transform: translateX(2px);
  background: var(--acc-soft);
}

.side-sub a.active {
  color: var(--acc);
  background: var(--acc-soft);
  box-shadow: inset 2px 0 0 var(--acc);
}

/* ══ Command palette ═════════════════════════════════════════════════════ */
.pal-box {
  border-radius: 16px;
  border-color: var(--acc-line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 34%),
    var(--panel-2, var(--panel));
  box-shadow:
    0 40px 90px -30px rgba(0, 0, 0, 0.92),
    0 0 0 1px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  animation: palIn 0.18s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes palIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.985); }
  to   { opacity: 1; transform: none; }
}

.pal-item {
  border-radius: 9px;
  transition: background 0.12s ease, color 0.12s ease, padding-left 0.12s ease;
}

.pal-item:hover {
  padding-left: 10px;
}

.pal-item.sel {
  background: linear-gradient(90deg, var(--acc-soft), transparent 92%);
  box-shadow: inset 2px 0 0 var(--acc);
}

/* ══ Focus ring, everywhere ══════════════════════════════════════════════ */
:focus-visible {
  outline: 2px solid var(--acc);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ══ Securing layout ════════════════════════════════════════════════════
   The 250px picker column was clipping method labels and leaving the form
   cramped. Picker takes a third, form takes two thirds, results run full
   width underneath. */
.secure-layout {
  grid-template-columns: minmax(0, 260px) minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 14px;
  align-items: start;
}

.secure-results {
  grid-column: auto;
}

.pick-item .pick-body strong,
.pick-item .pick-body em {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

@media (max-width: 760px) {
  .secure-layout { grid-template-columns: minmax(0, 1fr); }
}

/* ══ Reduced motion ══════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  .card, .acard, .panel-window, .stat, .stat-card,
  .ux-trigger, .ux-option, .side-sub a, .side-drop-btn, .pal-item {
    transition: none !important;
  }
  .card:hover, .acard:hover, .stat:hover, .stat-card:hover {
    transform: none !important;
  }
  .ux-panel, .userpick-menu, .side-sub, .pal-box {
    animation: none !important;
  }
}

/* -- Claimants: share ratio, beneficiary, resolved Discord IDs ----------- */
.claimant-add {
  grid-template-columns: minmax(168px, 1fr) 104px 128px 82px auto;
  align-items: center;
}
.claimant-add .benef-field {
  grid-column: 1 / -1;
}
.claimant-add #claimant-ratio {
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.benef-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 13px;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  background: var(--acc-soft);
}
.benef-field[hidden] {
  display: none !important;
}
.benef-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.benef-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--txt);
}
.benef-hint {
  text-align: right;
}

.id-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-soft);
}
.id-preview[hidden] {
  display: none !important;
}
.idp-ava {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  overflow: hidden;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
}
.idp-ava img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.idp-ava .ico {
  width: 15px;
  height: 15px;
}
.idp-role {
  border-radius: 9px;
  color: var(--role-color, var(--acc));
  border-color: color-mix(in srgb, var(--role-color, var(--acc)) 45%, transparent);
  background: color-mix(in srgb, var(--role-color, var(--acc)) 14%, var(--panel));
}
.idp-meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  line-height: 1.25;
}
.idp-meta strong {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--txt);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.idp-meta span {
  font-size: 0.72rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.id-preview > .p-tag {
  margin-left: auto;
}
.idp-empty {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: #fbbf24;
}
.idp-empty .ico {
  width: 15px;
  height: 15px;
}

.claimant-table {
  min-width: 1040px;
}
.claimant-table th,
.claimant-table td {
  padding-top: 10px;
  padding-bottom: 10px;
}
.claimant-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 210px;
}
.claimant-ava {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  overflow: hidden;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
}
.claimant-ava img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.claimant-ava .ico {
  width: 16px;
  height: 16px;
}
.claimant-ava.is-role {
  border-radius: 10px;
  color: var(--role-color, var(--acc));
  border-color: color-mix(in srgb, var(--role-color, var(--acc)) 45%, transparent);
  background: color-mix(in srgb, var(--role-color, var(--acc)) 14%, var(--panel));
}
.claimant-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}
.claimant-meta strong {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--txt);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 210px;
}
.claimant-sub {
  font-size: 0.74rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 210px;
}
.claimant-id {
  margin-top: 2px;
  font-size: 0.65rem;
  letter-spacing: 0.02em;
  color: var(--muted);
  opacity: 0.72;
}
.claimant-cell > .p-tag {
  margin-left: auto;
}
.claimant-stats {
  white-space: nowrap;
}
.claimant-table .perm-col {
  width: 46px;
  text-align: center;
}

.ratio-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 96px;
}
.ratio-input {
  width: 84px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.ratio-note {
  font-size: 0.68rem;
  color: var(--muted);
  white-space: nowrap;
}

.benef-slot {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 180px;
}
.benef-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.benef-ava {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  overflow: hidden;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
}
.benef-ava img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.benef-ava .ico {
  width: 13px;
  height: 13px;
}
.benef-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.15;
}
.benef-meta strong {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--txt);
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.benef-meta span {
  font-size: 0.66rem;
  color: var(--muted);
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.benef-change {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 0.68rem;
  color: var(--acc);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.benef-set {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px dashed rgba(251, 191, 36, 0.42);
  border-radius: 10px;
  background: rgba(251, 191, 36, 0.08);
  color: #fbbf24;
  font: inherit;
  font-size: 0.74rem;
  cursor: pointer;
}
.benef-set:hover {
  background: rgba(251, 191, 36, 0.14);
}
.benef-set .ico {
  width: 14px;
  height: 14px;
}

.benef-pop {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(3, 7, 10, 0.62);
  backdrop-filter: blur(6px);
  animation: benef-fade 0.14s ease;
}
.benef-pop-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(420px, 100%);
  padding: 20px;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.benef-pop-card h3 {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--txt);
}
.benef-pop-card .id-preview {
  margin: 0;
}
.benef-pop-card .input {
  width: 100%;
}
.benef-pop-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 2px;
}
@keyframes benef-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (max-width: 900px) {
  .claimant-add { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .claimant-add .btn { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .claimant-add { grid-template-columns: minmax(0, 1fr); }
}

/* ── Claimants: fluid table — the twelve checkbox columns now live behind
   one Perms cell, so the card fits the panel instead of scrolling ──────── */
.claimant-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}
.claimant-table .col-claimant { width: 340px; }
.claimant-table .col-share { width: 92px; }
.claimant-table .col-benef { width: 172px; }
.claimant-table .col-mode { width: 122px; }
.claimant-table .col-perms { width: 64px; text-align: center; }
.claimant-table .col-stats { width: 88px; }
.claimant-table .col-act { width: 84px; }
.claimant-table .col-pad,
.claimant-table .col-pad:empty {
  width: auto;
  padding: 0;
  border: 0;
  background: none;
}
.claimant-table th,
.claimant-table td {
  padding-left: 8px;
  padding-right: 8px;
}
.claimant-table .claimant-cell { min-width: 0; }
.claimant-table .claimant-meta { flex: 1 1 auto; overflow: hidden; }
.claimant-table .claimant-meta strong,
.claimant-table .claimant-sub { max-width: 100%; }
.claimant-table .claimant-cell > .p-tag { margin-left: 4px; }
.claimant-table .benef-slot { min-width: 0; gap: 6px; }
.claimant-table .benef-meta strong,
.claimant-table .benef-meta span { max-width: 78px; }
.claimant-table .ratio-note { white-space: normal; line-height: 1.25; }
.claimant-table .ratio-input { width: 100%; }

.claimant-stats { white-space: nowrap; }
.claimant-stats strong {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--txt);
}
.claimant-stats span {
  display: block;
  font-size: 0.66rem;
  color: var(--muted);
}

.perm-btn {
  display: inline-flex;
  align-items: baseline;
  gap: 1px;
  padding: 5px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--bg-soft);
  color: var(--txt);
  font: inherit;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.perm-btn span { color: var(--muted); font-size: 0.72rem; }
.perm-btn:hover { border-color: var(--acc-line); color: var(--acc); }

.perm-pop-card { width: min(460px, 100%); }
.perm-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 14px;
  max-height: 320px;
  overflow: auto;
}
.perm-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--bg-soft);
  font-size: 0.8rem;
  color: var(--txt);
  cursor: pointer;
}
.perm-opt:hover { border-color: var(--line-strong); }
.perm-opt input { flex: none; }
@media (max-width: 720px) {
  .perm-grid { grid-template-columns: 1fr; }
}

/* Below wide desktop the fixed column set costs more than it earns — drop to
   content-sized columns and let the wrapper scroll rather than squeezing the
   claimant cell into a sliver. */
@media (max-width: 1280px) {
  .claimant-table { table-layout: auto; min-width: 840px; }
  .claimant-table .col-claimant { width: auto; }
  .claimant-table .col-pad { display: none; }
  .claimant-table .claimant-cell { min-width: 240px; }
}

/* ── Securing: page tools + config dialog ────────────────────────────────── */
.page-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.secure-config-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-color: var(--line-strong);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(0, 0, 0, 0.12)), var(--panel);
  font-size: 0.84rem;
}
.secure-config-btn .ico { width: 15px; height: 15px; color: var(--acc); }
.secure-config-btn:hover {
  border-color: var(--acc-line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(0, 0, 0, 0.14)), var(--panel);
}

.secure-config-modal {
  width: min(760px, calc(100vw - 28px));
  max-width: min(760px, calc(100vw - 28px));
  /* The dropdown list is fixed to the viewport; an animated/transformed
     dialog would become its containing block and drag it off-position. */
  animation: none;
  transform: none;
  overflow: visible;
}
.secure-config-modal .modal-card { display: flex; flex-direction: column; max-height: min(92vh, 940px); }
.secure-config-modal .modal-body {
  padding: 14px 18px 18px;
  max-height: min(64vh, 660px);
  overflow: auto;
}
.secure-config-modal .modal-note { margin: 0 0 4px; }
.secure-config-status { margin-right: auto; }
.config-section { margin-top: 16px; }
.config-h {
  margin: 0 0 10px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}
.secure-config-modal .switch-grid { grid-template-columns: 1fr 1fr; gap: 6px; }
.secure-config-modal .switch-row { padding: 0.5rem 0.6rem; }
.secure-config-modal .text-grid { grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.secure-config-modal .form-grid { margin-top: 12px; grid-template-columns: 1fr; }
.secure-config-modal .field > span:last-child { line-height: 1.35; }

@media (max-width: 640px) {
  .secure-config-modal .switch-grid,
  .secure-config-modal .text-grid { grid-template-columns: 1fr; }
  .secure-config-modal .modal-body { max-height: 68vh; }
}

/* ── Domain picker (painted trigger + fixed option list) ─────────────────── */
.dom-select { position: relative; width: 100%; min-width: 0; }
.dom-select select.dom-native {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}
.dom-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 39px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(0, 0, 0, 0.12)), var(--field-bg, rgba(0, 0, 0, 0.22));
  color: var(--txt);
  font: inherit;
  font-size: 0.85rem;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}
.dom-trigger:hover {
  border-color: var(--acc-line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(0, 0, 0, 0.14)), var(--field-bg, rgba(0, 0, 0, 0.22));
}
.dom-select.is-open .dom-trigger,
.dom-trigger:focus-visible {
  outline: none;
  border-color: var(--acc);
  box-shadow: 0 0 0 3px var(--acc-soft);
}
.dom-value { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dom-chev { display: inline-flex; flex: none; color: var(--muted); transition: transform 0.18s ease, color 0.18s ease; }
.dom-select.is-open .dom-chev { transform: rotate(180deg); color: var(--acc); }

.dom-panel {
  position: fixed;
  inset: auto;
  margin: 0;
  box-sizing: border-box;
  min-width: 180px;
  max-width: calc(100vw - 16px);
  z-index: 12000;
  display: grid;
  gap: 2px;
  padding: 5px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: var(--panel);
  box-shadow: 0 24px 60px -18px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(0, 0, 0, 0.28);
  overflow: auto;
}
.dom-panel[hidden] { display: none; }
.dom-opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--txt);
  font: inherit;
  font-size: 0.84rem;
  text-align: left;
  cursor: pointer;
}
.dom-opt:hover,
.dom-opt:focus-visible { outline: none; background: var(--bg-soft); }
.dom-opt.is-active { color: var(--acc); background: var(--acc-soft); }
.dom-tick { flex: none; width: 13px; height: 13px; opacity: 0; }
.dom-opt.is-active .dom-tick { opacity: 1; }

.domain-row .dom-select { flex: 0 1 230px; width: 230px; }
@media (max-width: 560px) {
  .domain-row { flex-wrap: wrap; }
  .domain-row .dom-select { flex: 1 1 100%; width: 100%; }
}

/* ── Invoice identity strip ─────────────────────────────────────────────
   The invoice modal names the buyer and pins the invoice facts above the
   payment block: avatar, display name, handle, then id/plan/created. */
.inv-who {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--row, rgba(255, 255, 255, 0.03));
}
.inv-av {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--acc-soft);
  color: var(--acc);
  font-size: 15px;
  font-weight: 700;
}
.inv-av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.inv-who-text { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.inv-who-text b { font-size: 13.5px; font-weight: 640; line-height: 1.3; }
.inv-k {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}
.inv-handle { line-height: 1.3; }
.inv-facts { margin-left: auto; display: flex; gap: 22px; flex-wrap: wrap; }
.inv-fact { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.inv-fact b {
  max-width: 220px;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 640px) {
  .inv-facts { margin-left: 0; width: 100%; gap: 12px 22px; }
  .inv-fact b { max-width: 100%; }
}

/* ── Bot card name ──────────────────────────────────────────────────────
   Stat-card typography: tight display weight, a thin accent rule down the
   left of the text column, and a mono index that sits under it. */
.bot-card .bot-card-mid {
  position: relative;
  padding-left: 11px;
}
.bot-card .bot-card-mid::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.38rem;
  bottom: 0.38rem;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--acc), rgba(255, 255, 255, 0.04));
  opacity: 0.7;
}
.bot-card .bot-name {
  margin: 0;
  font-family: var(--font-display, 'Geist', 'Inter', system-ui, sans-serif);
  font-size: clamp(1.04rem, 1.5vw, 1.2rem);
  font-weight: 750;
  letter-spacing: -0.025em;
  line-height: 1.2;
  color: var(--txt);
}
.bot-card .bot-name::selection { background: var(--acc-soft); }
.bot-card .bot-meta {
  letter-spacing: 0.04em;
  font-size: 0.72rem;
}

/* ── Live 2FA block (account modal, security tab) ────────────────────── */
.vp-otp {
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background:
    radial-gradient(120% 130% at 0% 0%, var(--acc-soft, rgba(255, 255, 255, 0.05)), transparent 62%),
    var(--row, rgba(255, 255, 255, 0.03));
}
.vp-otp-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.vp-otp-k {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}
.vp-otp-row { display: flex; align-items: center; gap: 10px; margin-top: 5px; }
.vp-otp-code {
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  line-height: 1.2;
  color: var(--txt);
  font-variant-numeric: tabular-nums;
}
.vp-otp-copy { margin-left: auto; }
.vp-otp-timer { min-width: 34px; text-align: right; font-variant-numeric: tabular-nums; }
.vp-otp-bar {
  height: 3px;
  margin-top: 9px;
  border-radius: 3px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.07);
}
.vp-otp-fill {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--acc), var(--acc-2));
  transition: width 0.9s linear, background 0.2s ease;
}
.vp-otp-fill.is-low { background: linear-gradient(90deg, #e5484d, #ff8a8a); }
