/* SHORTxtra — the customers' app (/app) and Admin → SHORTxtra, on the Kit's admin shell and components (GetXtra
   theme tokens only: light and dark come with them). Every class used by resources/views/sxt has a rule here or in the
   Kit's stylesheets (tests/Unit/ShortXtraViewsTest.php). */

/* The top bar: the workspace switcher, the page title (hidden on phones: the page heading says it), the actions. */
.sxt-app .admin-topbar {
  gap: var(--space-2);
}

.sxt-switcher {
  min-width: 0;
}

.sxt-switcher-toggle {
  max-width: min(46vw, 260px);
  font-weight: 600;
}

.sxt-switcher-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sxt-switcher-menu {
  min-width: min(300px, 86vw);
}

.sxt-switcher-menu form {
  margin: 0;
}

.sxt-switcher-item {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: start;
}

.sxt-topbar-title {
  display: none;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (min-width: 900px) {
  .sxt-topbar-title {
    display: block;
  }
}

.sxt-app .admin-topbar .header-actions {
  margin-inline-start: auto;
}

.sxt-content {
  display: grid;
  gap: var(--space-5);
  align-content: start;
}

/* Small helpers shared by the app's pages. */
.sxt-sub {
  display: block;
  color: var(--text-muted);
  font-size: var(--text-sm);
  overflow-wrap: anywhere;
}

.sxt-form {
  max-width: 760px;
}

.sxt-inline-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
}

.sxt-inline-form .select {
  width: auto;
  min-width: 8rem;
}

.sxt-actions-cell {
  text-align: end;
  white-space: nowrap;
}

.sxt-actions-cell form {
  display: inline-block;
  margin: 0;
}

/* The start page of /app. */
.sxt-stats {
  margin: 0;
}

.sxt-next {
  max-width: 760px;
}

.sxt-next-list,
.sxt-invite-list {
  display: grid;
  gap: var(--space-3);
}

.sxt-next-list a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.sxt-invite-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.sxt-invite-list form {
  margin: 0;
}

.sxt-start-card {
  max-width: 720px;
}

/* Members: the invitation form on one row from tablet width. */
.sxt-invite {
  max-width: none;
}

.sxt-invite-row {
  display: grid;
  gap: var(--space-3);
  align-items: end;
}

@media (min-width: 720px) {
  .sxt-invite-row {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto;
  }
}

.sxt-invite-send {
  justify-self: start;
}

.sxt-invite-hint {
  padding: 0 var(--space-5) var(--space-4);
}

.sxt-members td {
  vertical-align: middle;
}

/* Tables that become one block per row on phones (members, workspaces, links): no sideways scrolling at 320 px. */
@media (max-width: 640px) {
  .sxt-stack thead {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
  }

  .sxt-stack,
  .sxt-stack tbody,
  .sxt-stack tr,
  .sxt-stack td {
    display: block;
    width: 100%;
  }

  .sxt-stack tr {
    padding: var(--space-3) var(--space-4);
    border-top: 1px solid var(--border);
  }

  .sxt-stack tr:first-child {
    border-top: 0;
  }

  .sxt-stack td {
    padding: var(--space-1) 0;
    border: 0;
  }

  .sxt-stack .num,
  .sxt-stack .sxt-actions-cell {
    text-align: start;
    white-space: normal;
  }
}

.sxt-roles-help {
  max-width: 760px;
}

.sxt-roles-dl {
  margin-top: var(--space-3);
}

/* Admin → SHORTxtra → Settings: the two setup profiles. */
.sxt-profiles {
  border: 0;
  margin: 0;
  min-width: 0;
}

.sxt-profile-option {
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.sxt-profile-option input {
  margin-top: 0.3em;
}

/* ---------- Phase 2: links ---------- */

/* The quick shorten box: destination, address, button — one row from tablet width. */
.sxt-quick {
  border-color: var(--brand-border);
}

.sxt-quick-row {
  display: grid;
  gap: var(--space-3);
  align-items: end;
}

@media (min-width: 760px) {
  .sxt-quick-row {
    grid-template-columns: minmax(0, 3fr) minmax(0, 1fr) auto;
  }
}

.sxt-quick-url,
.sxt-quick-alias {
  min-width: 0;
}

.sxt-quick-go {
  justify-self: start;
}

.sxt-quick-more {
  padding: 0 var(--space-5) var(--space-4);
}

/* Views (live / starred / archived / bin) and the filters. */
.sxt-views {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.sxt-filter {
  flex-wrap: wrap;
}

.sxt-filter .select {
  width: auto;
  max-width: 100%;
}

.sxt-empty {
  text-align: center;
}

.sxt-empty-action {
  display: flex;
  justify-content: center;
  padding: 0 var(--space-6) var(--space-8);
}

/* The link list: one card per link; the actions wrap under the text on phones. */
.sxt-links {
  display: grid;
  gap: var(--space-3);
}

.sxt-link {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-4);
}

@media (min-width: 900px) {
  .sxt-link {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }
}

.sxt-link-new {
  border-color: var(--brand-border);
  box-shadow: 0 0 0 3px var(--brand-ring);
}

.sxt-link-main {
  display: flex;
  gap: var(--space-3);
  min-width: 0;
}

.sxt-favicon {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-subtle);
  color: var(--text-muted);
}

.sxt-favicon img {
  width: 20px;
  height: 20px;
}

.sxt-link-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.sxt-link-short {
  font-weight: 650;
  overflow-wrap: anywhere;
}

.sxt-link-title {
  color: var(--text);
  font-size: var(--text-sm);
  overflow-wrap: anywhere;
}

.sxt-link-dest {
  overflow: hidden;
  color: var(--text-muted);
  font-size: var(--text-xs);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sxt-link-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin-top: var(--space-1);
}

.sxt-link-tags a {
  text-decoration: none;
}

.sxt-link-side {
  display: grid;
  gap: var(--space-2);
  justify-items: start;
}

@media (min-width: 900px) {
  .sxt-link-side {
    justify-items: end;
  }
}

.sxt-link-meta {
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.sxt-link-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1);
}

.sxt-link-actions form,
.sxt-more-menu form {
  margin: 0;
}

.sxt-link-actions .btn-icon[aria-pressed="true"] {
  color: var(--warning);
}

.sxt-share-menu,
.sxt-more-menu {
  min-width: 200px;
}

/* Forms: two or three fields side by side from tablet width. */
.sxt-form-row {
  display: grid;
  gap: var(--space-4);
}

@media (min-width: 720px) {
  .sxt-form-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sxt-form-row-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.sxt-duplicate,
.sxt-in-bin {
  max-width: 760px;
}

/* The editor. */
.sxt-edit-short {
  overflow-wrap: anywhere;
}

.sxt-edit .sxt-form {
  max-width: none;
}

.sxt-slug-group .input-addon {
  max-width: 50%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sxt-keep-old {
  margin-top: var(--space-2);
  font-size: var(--text-sm);
}

.sxt-edit-footer {
  display: flex;
  justify-content: flex-start;
}

.sxt-details dd {
  overflow-wrap: anywhere;
}

.sxt-favicon-img {
  vertical-align: -3px;
}

.sxt-aliases li,
.sxt-recent li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.sxt-aliases form {
  margin: 0;
}

.sxt-recent {
  display: grid;
  gap: var(--space-2);
}

.sxt-history {
  display: grid;
  gap: var(--space-4);
}

.sxt-history > li {
  display: grid;
  gap: var(--space-2);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border);
}

.sxt-history > li:last-child {
  border-bottom: 0;
}

.sxt-history-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-2);
}

.sxt-history-changes {
  display: grid;
  gap: var(--space-1);
  font-size: var(--text-sm);
  overflow-wrap: anywhere;
}

.sxt-history-changes del {
  color: var(--text-muted);
}

.sxt-history-changes ins {
  text-decoration: none;
}

.sxt-history-field {
  color: var(--text-muted);
}

.sxt-history form {
  margin: 0;
}

/* Campaigns and tags. */
.sxt-utm {
  color: var(--text-muted);
  font-size: var(--text-sm);
  overflow-wrap: anywhere;
}

.sxt-danger-zone {
  margin: 0;
}

.sxt-tag-input {
  width: auto;
  min-width: 0;
  flex: 1 1 12rem;
  max-width: 24rem;
}

/* ---------- Phase 4: counted clicks ---------- */

/* The link list: the 7-day sparkline next to the cached total, both a link to the statistics page. */
.sxt-link-stats {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: inherit;
  text-decoration: none;
}

.sxt-link-stats:hover strong,
.sxt-link-stats:focus-visible strong {
  color: var(--brand);
  text-decoration: underline;
}

.sxt-spark {
  display: inline-block;
  flex: none;
  vertical-align: middle;
  overflow: visible;
}

.sxt-spark-bar {
  fill: var(--brand);
}

.sxt-spark-zero {
  fill: var(--border);
}

/* /app/links/{id}/stats: the four totals, then the days. */
.sxt-stats {
  margin-bottom: var(--space-6);
}

.sxt-days .card-header h3 {
  margin: 0;
}

.sxt-days-table td.num,
.sxt-days-table th.num {
  font-variant-numeric: tabular-nums;
}

.sxt-day-empty td {
  color: var(--text-muted);
}

.sxt-days-note {
  margin: 0;
  border-top: 1px solid var(--border);
}

/* Admin → SHORTxtra → Settings: the click history. */
.sxt-privacy {
  border-top: 1px solid var(--border);
}

/* ---------- Phase 6: link options ---------- */

/* The options of the new-link form and the editor: collapsed groups, one per option, open while in use. */
.sxt-options {
  display: grid;
  gap: var(--space-2);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}

.sxt-option {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface, transparent);
}

.sxt-option > summary {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 2.75rem;
  padding: var(--space-2) var(--space-3);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.sxt-option > summary::-webkit-details-marker {
  display: none;
}

.sxt-option > summary::after {
  content: "+";
  margin-inline-start: auto;
  color: var(--text-muted);
  font-weight: 700;
}

.sxt-option[open] > summary::after {
  content: "–";
}

.sxt-option > summary:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.sxt-option-body {
  display: grid;
  gap: var(--space-3);
  padding: 0 var(--space-3) var(--space-3);
  min-width: 0;
}

.sxt-option-body .input,
.sxt-option-body .textarea {
  min-width: 0;
  max-width: 100%;
}

.sxt-card-figure {
  margin: 0;
  display: grid;
  gap: var(--space-1);
  justify-items: start;
}

.sxt-card-img {
  display: block;
  width: 240px;
  max-width: 100%;
  height: auto;
  aspect-ratio: 1200 / 630;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-subtle);
}

.sxt-frame-status {
  margin: 0;
  overflow-wrap: anywhere;
}

/* Settings: the expired-link page's own texts. */
.sxt-fieldset {
  display: grid;
  gap: var(--space-3);
  min-width: 0;
  margin: 0;
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.sxt-fieldset > legend {
  padding: 0 var(--space-1);
  font-weight: 600;
}

/* ---------- Phase 7: smart destinations ---------- */

/* /app/links/{id}/smart: the settings (rules, app stores, rotation, open in app) beside the tester. */
.sxt-smart {
  align-items: start;
}

.sxt-smart-order h3 {
  margin: 0 0 var(--space-2);
  font-size: 1rem;
}

.sxt-steps {
  margin: 0;
  padding-inline-start: 1.25rem;
  display: grid;
  gap: var(--space-1);
  color: var(--text-muted);
}

.sxt-rule .sxt-option-body > * {
  min-width: 0;
}

.sxt-rule-pos {
  max-width: 8rem;
}

.sxt-rule-remove {
  color: var(--danger, #b42318);
}

.sxt-checks {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-4);
}

.sxt-checks .check {
  min-height: 2.25rem;
}

.sxt-more > summary {
  min-height: 2.25rem;
  font-weight: 600;
  cursor: pointer;
}

.sxt-more[open] > summary {
  margin-bottom: var(--space-2);
}

.sxt-multi {
  min-height: 6.5rem;
}

.sxt-table-wrap {
  max-width: 100%;
  overflow-x: auto;
}

.sxt-rot-table .input {
  min-width: 0;
  width: 100%;
}

.sxt-rot-table td.num .sxt-weight {
  width: 6rem;
  text-align: end;
}

.sxt-rot-own {
  overflow-wrap: anywhere;
}

.sxt-tester {
  position: sticky;
  top: var(--space-4);
}

.sxt-result:empty {
  display: none;
}

.sxt-result-box {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-3);
  border: 1px solid var(--brand);
  border-radius: var(--radius);
  background: var(--bg-subtle);
}

.sxt-result-box p {
  margin: 0;
}

.sxt-result-label {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.sxt-result-url {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.sxt-result-shares {
  display: grid;
  gap: var(--space-1);
}

.sxt-result-shares li {
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
}

@media (max-width: 960px) {
  .sxt-tester {
    position: static;
  }
}

@media (max-width: 640px) {
  .sxt-rule-pos {
    max-width: none;
  }

  .sxt-rot-table td.num .sxt-weight {
    width: 100%;
  }
}

/* ---------- Phase 8: marketing tools ---------- */

/* /app/marketing: the tabs (each its own page), the two-column grid. */
.sxt-tabs {
  display: flex;
  gap: var(--space-1);
  margin: 0 0 var(--space-5);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}

.sxt-tabs a {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 2.75rem;
  padding: var(--space-2) var(--space-3);
  color: var(--text-muted);
  font-size: var(--text-sm);
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
}

.sxt-tabs a:hover {
  color: var(--text);
}

.sxt-tabs a[aria-current="page"] {
  color: var(--text);
}

.sxt-tabs a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: var(--space-2);
  right: var(--space-2);
  bottom: -1px;
  height: 2px;
  background: var(--brand);
}

.sxt-mk-grid,
.sxt-design {
  align-items: start;
  margin-bottom: var(--space-5);
}

.sxt-mk-grid > *,
.sxt-design > * {
  min-width: 0;
}

.sxt-code {
  display: inline-block;
  max-width: 100%;
  padding: 0 var(--space-1);
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
  font-size: var(--text-sm);
  background: var(--surface-2, rgba(127, 127, 127, .1));
  overflow-wrap: anywhere;
}

.sxt-postback {
  display: block;
  padding: var(--space-2);
  user-select: all;
}

.sxt-utm-fields {
  display: grid;
  gap: var(--space-3);
}

@media (min-width: 720px) {
  .sxt-utm-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Links and buttons in a row, one of them current (the preview's width, the conversions' period). */
.sxt-seg {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.sxt-seg > a,
.sxt-seg > button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-height: 2.25rem;
  padding: var(--space-1) var(--space-3);
  border: 0;
  border-radius: calc(var(--radius) - 2px);
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.sxt-seg > a[aria-current="page"],
.sxt-seg > button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.sxt-seg > a:focus-visible,
.sxt-seg > button:focus-visible {
  box-shadow: var(--ring);
  outline: none;
}

/* The templates to start a splash page or an overlay from. */
.sxt-templates {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.sxt-template {
  display: grid;
  gap: var(--space-1);
  height: 100%;
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
}

.sxt-template:hover,
.sxt-template:focus-visible {
  border-color: var(--brand);
}

.sxt-swatch {
  display: grid;
  place-items: center;
  height: 4rem;
  border: 1px solid var(--border);
  background: var(--sxt-bg, #ffffff);
}

.sxt-swatch > span {
  width: 45%;
  height: .9rem;
  background: var(--sxt-accent, #0b7a5a);
  box-shadow: 0 -1.1rem 0 -.25rem var(--sxt-fg, #14181f);
}

/* The design editor: colours, images, the live preview at phone or desktop width. */
.sxt-colours {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  margin: 0;
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.sxt-colours legend {
  padding: 0 var(--space-1);
  font-weight: 600;
}

.sxt-colour {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 2.75rem;
}

.sxt-colour input[type="color"] {
  width: 2.75rem;
  height: 2.25rem;
  padding: 2px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
}

.sxt-design-image img {
  display: block;
  max-width: 10rem;
  height: auto;
  border: 1px solid var(--border);
  object-fit: contain;
}

.sxt-preview-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.sxt-preview-head h3 {
  margin: 0;
}

.sxt-preview-stage {
  display: grid;
  justify-items: center;
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2, rgba(127, 127, 127, .08));
  overflow: hidden;
}

.sxt-preview-stage[hidden] {
  display: none;
}

.sxt-preview-frame {
  display: block;
  width: 100%;
  max-width: 100%;
  height: 34rem;
  border: 1px solid var(--border);
  background: #ffffff;
}

/* Desktop: a 1280 × 800 page shrunk to the card's width (--sxt-scale, set by marketing.js). */
.sxt-preview-stage[data-device="desktop"] {
  justify-items: start;
  height: calc(800px * var(--sxt-scale, .3) + 2 * var(--space-3));
}

.sxt-preview-stage[data-device="desktop"] .sxt-preview-frame {
  width: 1280px;
  max-width: none;
  height: 800px;
  transform: scale(var(--sxt-scale, .3));
  transform-origin: 0 0;
}

.sxt-preview-stage[data-device="phone"] .sxt-preview-frame {
  width: min(360px, 100%);
  height: 640px;
  border-radius: 1.25rem;
  border-width: 8px;
  border-color: #14181f;
}

@media (min-width: 900px) {
  .sxt-preview {
    position: sticky;
    top: var(--space-4);
  }
}

/* The link list: the UTM values of a destination (R6.2). */
.sxt-link-utm {
  display: flex;
  margin-top: var(--space-1);
  min-width: 0;
}

.sxt-link-utm .badge {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Phase 9: domains ---------- */

/* /app/domains and Admin → SHORTxtra → Domains: the add form, the state badges, the records table. */
.sxt-domain-input {
  flex: 1 1 14rem;
  min-width: 0;
  font-family: var(--font-mono, ui-monospace, monospace);
}

.sxt-domain-badges {
  gap: var(--space-1);
}

.sxt-domain-host,
.sxt-domain-title {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.sxt-domain-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.sxt-domain-list {
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.sxt-domain-problems,
.sxt-domain-steps {
  margin: var(--space-2) 0 0;
  padding-left: var(--space-5);
}

.sxt-domain-problems li,
.sxt-domain-steps li {
  margin: 0 0 var(--space-1);
}

.sxt-records td {
  vertical-align: middle;
}

.sxt-record-value {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-all;
  white-space: normal;
  user-select: all;
}

/* What the last check found: a two-column list that becomes one column on phones. */
.sxt-domain-facts {
  display: grid;
  grid-template-columns: minmax(8rem, max-content) 1fr;
  gap: var(--space-2) var(--space-4);
  margin: 0;
}

.sxt-domain-facts dt {
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.sxt-domain-facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 480px) {
  .sxt-domain-facts {
    grid-template-columns: 1fr;
    gap: 0 0;
  }

  .sxt-domain-facts dd {
    margin: 0 0 var(--space-2);
  }
}

/* ===== Phase 10: QR codes (resources/views/sxt/qr/) ===== */
/* The designer: the form beside a sticky preview; one column on phones and tablets. */
.sxt-qr-designer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(16rem, 22rem);
  gap: var(--space-4);
  align-items: start;
}

.sxt-qr-form {
  min-width: 0;
}

.sxt-qr-side {
  position: sticky;
  top: var(--space-4);
  min-width: 0;
}

@media (max-width: 900px) {
  .sxt-qr-designer {
    grid-template-columns: minmax(0, 1fr);
  }

  .sxt-qr-side {
    position: static;
    order: -1;
  }
}

/* The preview is always drawn on white (a code is printed on paper); a transparent one on a checkerboard. */
.sxt-qr-stage {
  display: grid;
  place-items: center;
  min-height: 12rem;
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #ffffff;
}

.sxt-qr-stage svg {
  display: block;
  width: 100%;
  max-width: 20rem;
  height: auto;
}

.sxt-qr-stage.is-transparent {
  background: repeating-conic-gradient(#e5e7eb 0 25%, #ffffff 0 50%) 0 0 / 16px 16px;
}

.sxt-qr-stage[aria-busy="true"] {
  opacity: .7;
}

.sxt-qr-findings {
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.sxt-qr-findings > li {
  margin: 0;
  font-size: var(--text-sm);
}

.sxt-qr-note {
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-subtle);
  color: var(--text);
}

.sxt-qr-group {
  display: grid;
  gap: var(--space-3);
  min-width: 0;
  margin: 0;
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.sxt-qr-group > legend {
  padding: 0 var(--space-1);
  font-weight: 600;
}

.sxt-qr-colours {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  align-items: center;
}

.sxt-qr-fg2 {
  align-self: end;
}

.sxt-qr-logos {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
}

.sxt-qr-logo-option img {
  width: 2rem;
  height: 2rem;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #ffffff;
  vertical-align: middle;
}

.sxt-qr-num {
  max-width: 7rem;
}

.sxt-qr-facts {
  display: grid;
  grid-template-columns: minmax(7rem, max-content) 1fr;
  gap: var(--space-2) var(--space-4);
  margin: 0;
}

.sxt-qr-facts dt {
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.sxt-qr-facts dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.sxt-qr-break {
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 480px) {
  .sxt-qr-facts {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .sxt-qr-facts dd {
    margin-bottom: var(--space-2);
  }
}

.sxt-qr-templates {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.sxt-qr-save-design {
  display: grid;
  gap: var(--space-1);
}

/* New static codes by kind. */
.sxt-qr-kinds {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.sxt-qr-kind {
  display: grid;
  gap: var(--space-1);
  height: 100%;
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
}

.sxt-qr-kind:hover,
.sxt-qr-kind:focus-visible {
  border-color: var(--brand);
}

.sxt-qr-filters {
  margin: var(--space-4) 0;
}

.sxt-qr-filter-go {
  align-self: end;
}

/* The list: a thumbnail, the name and what it holds, scans, downloads; stacked on phones. */
.sxt-qr-list {
  display: grid;
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.sxt-qr-item {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr) auto;
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-3);
}

.sxt-qr-thumb {
  display: block;
  padding: var(--space-1);
  border-radius: var(--radius);
  background: #ffffff;
}

.sxt-qr-thumb svg {
  display: block;
  width: 100%;
  height: auto;
}

.sxt-qr-info {
  min-width: 0;
}

.sxt-qr-info .sxt-sub {
  overflow-wrap: anywhere;
}

.sxt-qr-name {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.sxt-qr-scans {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--text-sm);
}

@media (max-width: 560px) {
  .sxt-qr-item {
    grid-template-columns: 3.5rem minmax(0, 1fr);
  }

  .sxt-qr-actions {
    grid-column: 1 / -1;
  }
}

/* Saved and ready designs. */
.sxt-qr-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.sxt-qr-tile {
  display: grid;
  gap: var(--space-2);
  align-content: start;
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* ===== Phase 11: Bio pages (resources/views/sxt/bio/) ===== */

/* The list. */
.sxt-bio-pages {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr));
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.sxt-bio-page-item {
  display: flex;
  flex-direction: column;
}

.sxt-bio-page-item .card-body {
  flex: 1;
}

.sxt-bio-page-name {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.sxt-bio-break,
.sxt-bio-url {
  overflow-wrap: anywhere;
}

.sxt-bio-url {
  margin: var(--space-1) 0 0;
  color: var(--text-muted);
}

.sxt-bio-numbers {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin: 0;
  color: var(--text-muted);
  font-size: var(--text-sm);
}

/* The builder: the form, and beside it (below it on phones) the phone frame. */
.sxt-bio-builder {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-4);
  align-items: start;
}

@media (min-width: 1100px) {
  .sxt-bio-builder {
    grid-template-columns: minmax(0, 1fr) 24rem;
  }

  .sxt-bio-phone-wrap {
    position: sticky;
    top: var(--space-4);
  }
}

.sxt-bio-editor {
  min-width: 0;
}

.sxt-bio-phone {
  width: 100%;
  max-width: 24rem;
  margin: 0 auto;
  padding: 0.6rem;
  border: 2px solid var(--border-strong);
  border-radius: 2rem;
  background: var(--bg-inverse);
}

.sxt-bio-phone iframe {
  display: block;
  width: 100%;
  height: min(44rem, 78vh);
  border: 0;
  border-radius: 1.5rem;
  background: var(--bg);
}

.sxt-bio-handle {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.sxt-bio-handle > span {
  font-weight: 700;
  color: var(--text-muted);
}

.sxt-bio-handle .input {
  flex: 1;
  min-width: 0;
}

.sxt-bio-imgfield {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.sxt-bio-imgfield > .label {
  flex-basis: 100%;
}

.sxt-bio-imgfield .input[type="file"] {
  flex: 1 1 12rem;
  min-width: 0;
}

.sxt-bio-imgprev {
  width: 3rem;
  height: 3rem;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.sxt-bio-list {
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.sxt-bio-item {
  min-width: 0;
}

.sxt-bio-item:focus {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.sxt-bio-item-head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--border);
  background: var(--bg-subtle);
}

.sxt-bio-grip {
  cursor: grab;
  touch-action: none;
}

.sxt-bio-item-title {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--space-2);
  overflow-wrap: anywhere;
}

.sxt-bio-item-tools {
  display: flex;
  gap: 2px;
}

.sxt-bio-item-body {
  padding: var(--space-3);
}

.sxt-bio-dragging {
  opacity: 0.55;
}

.sxt-bio-over {
  box-shadow: 0 -3px 0 var(--brand);
}

.sxt-bio-rows {
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.sxt-bio-row {
  display: grid;
  grid-template-columns: minmax(7rem, 11rem) minmax(0, 1fr);
  gap: var(--space-2);
  align-items: center;
}

.sxt-bio-row:has(.sxt-bio-imgprev) {
  grid-template-columns: 3rem minmax(0, 1fr) auto;
}

.sxt-bio-faq-rows .sxt-bio-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding-bottom: var(--space-2);
  border-bottom: 1px dashed var(--border);
}

@media (max-width: 480px) {
  .sxt-bio-row,
  .sxt-bio-row:has(.sxt-bio-imgprev) {
    grid-template-columns: minmax(0, 1fr);
  }
}

.sxt-bio-options summary {
  cursor: pointer;
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.sxt-bio-options > .stack {
  margin-top: var(--space-2);
}

.sxt-bio-add-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.sxt-bio-add .label {
  margin: 0 0 var(--space-2);
}

/* Theme choice. */
.sxt-bio-themes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 8.5rem), 1fr));
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.sxt-bio-theme {
  position: relative;
  display: grid;
  gap: var(--space-1);
  padding: var(--space-2);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
}

.sxt-bio-theme:has(input:checked) {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-ring);
}

.sxt-bio-theme input {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
}

.sxt-bio-theme-name {
  display: grid;
  font-weight: 600;
  font-size: var(--text-sm);
}

.sxt-bio-colors {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 11rem), 1fr));
  gap: var(--space-2);
}

.sxt-bio-colorpick {
  display: grid;
  gap: var(--space-1);
}

.sxt-bio-color {
  min-height: 2.5rem;
  padding: 2px;
  cursor: pointer;
}

.sxt-bio-danger .card-body {
  justify-content: space-between;
}

.sxt-bio-danger p {
  margin: 0;
  color: var(--text-muted);
}

/* The numbers. */
.sxt-bio-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 10rem), 1fr));
  gap: var(--space-3);
  margin: 0 0 var(--space-4);
  padding: 0;
  list-style: none;
}

.sxt-bio-kpi {
  margin: var(--space-1) 0;
  font-size: 1.6rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.sxt-bio-chart {
  display: block;
  width: 100%;
  height: 10rem;
  background: var(--bg-subtle);
}

.sxt-bio-bar-v {
  fill: var(--brand);
}

.sxt-bio-bar-c {
  fill: #c2410c;
}

.sxt-bio-legend {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.sxt-bio-key {
  display: inline-block;
  width: 0.8rem;
  height: 0.8rem;
  vertical-align: -0.1rem;
}

.sxt-bio-key-v {
  background: var(--brand);
}

.sxt-bio-key-c {
  background: #c2410c;
}

[data-theme="dark"] .sxt-bio-bar-c,
[data-theme="dark"] .sxt-bio-key-c {
  fill: #fb923c;
  background: #fb923c;
}

.sxt-bio-tables {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr));
  gap: var(--space-3);
  margin: var(--space-4) 0;
}

.sxt-bio-unread td:first-child {
  font-weight: 600;
}

.sxt-bio-note {
  border-color: var(--brand-border);
  background: var(--brand-soft);
  color: var(--text);
}

.sxt-bio-editor .sxt-form-row {
  align-items: start;
}

/* Phase 12: safety — Admin → SHORTxtra → Safety, the report page, the link's safety state in /app. */
.sxt-break {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.sxt-safety-filter {
  margin: 0 0 var(--space-4);
}

.sxt-report-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-base);
}

.sxt-report-facts {
  display: grid;
  grid-template-columns: minmax(7rem, auto) 1fr;
  gap: var(--space-1) var(--space-3);
  margin: 0;
}

.sxt-report-facts dt {
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.sxt-report-facts dd {
  margin: 0;
  min-width: 0;
}

@media (max-width: 30rem) {
  .sxt-report-facts {
    grid-template-columns: 1fr;
  }

  .sxt-report-facts dd {
    margin-bottom: var(--space-2);
  }
}

.sxt-safety-actions {
  display: grid;
  gap: var(--space-2);
  min-width: 0;
}

.sxt-list-entries {
  display: grid;
  gap: var(--space-1);
  margin: 0;
  padding: 0;
  list-style: none;
}

.sxt-list-entries li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-1) 0;
  border-bottom: 1px solid var(--border);
}

.sxt-safety-result {
  padding: var(--space-3);
  border-left: 4px solid var(--brand);
  background: var(--brand-soft);
  overflow-wrap: anywhere;
}

.sxt-safety-result ul {
  margin: var(--space-2) 0 0;
  padding-left: var(--space-5);
}

.sxt-rate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 12rem), 1fr));
  gap: var(--space-3);
}

.sxt-num-input {
  max-width: 10rem;
}

.sxt-report-sent h2 {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
}

.sxt-safety-note {
  border-left: 4px solid var(--warning);
  padding: var(--space-2) var(--space-3);
  background: var(--warning-soft);
  overflow-wrap: anywhere;
}

.sxt-safety-note[data-sxt-safety-state="blocked"] {
  border-left-color: var(--danger);
}

.sxt-report-title .badge {
  max-width: 100%;
  white-space: normal;
  text-align: start;
}

.sxt-edit-head {
  min-width: 0;
}

.sxt-details dd {
  min-width: 0;
}

.sxt-details .btn {
  max-width: 100%;
  white-space: normal;
}

/* Phase 13: bulk shortening, imports, exports. */
.sxt-wrap {
  min-width: 0;
  overflow-wrap: anywhere;
}

.sxt-bulk-lines {
  min-height: 14rem;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: var(--text-sm, 0.875rem);
  white-space: pre;
  overflow-wrap: normal;
  overflow-x: auto;
}

.sxt-over {
  color: var(--danger);
  font-weight: 600;
}

.sxt-bulk-utm summary {
  cursor: pointer;
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.sxt-bulk-bar {
  width: 100%;
  height: 0.75rem;
  accent-color: var(--brand, var(--primary));
}

.sxt-bulk-table td .btn {
  vertical-align: middle;
}

.sxt-bulk-table td .small {
  display: block;
  margin-top: var(--space-1);
}

.sxt-import-presets {
  margin: 0;
  padding-inline-start: var(--space-5);
  display: grid;
  gap: var(--space-1);
}

/* Phase 14: plans, usage meters, banners, pricing, the platform owner's SaaS pages, the guest shortener. */
.sxt-banners {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4) 0;
}

.sxt-banners:empty {
  display: none;
}

.sxt-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
}

.sxt-banner-text {
  flex: 1 1 14rem;
  min-width: 0;
  display: grid;
  gap: var(--space-1);
  overflow-wrap: anywhere;
}

.sxt-banner-support {
  border-inline-start: 4px solid var(--warning, #b45309);
}

.sxt-meters {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-3);
}

.sxt-meter {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-1) var(--space-3);
  align-items: baseline;
}

.sxt-meter-label {
  font-weight: 600;
  min-width: 0;
  overflow-wrap: anywhere;
}

.sxt-meter-figure {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.sxt-meter-bar {
  grid-column: 1 / -1;
  width: 100%;
  height: 0.6rem;
  accent-color: var(--brand, var(--primary));
}

.sxt-meter-near .sxt-meter-bar {
  accent-color: var(--warning, #b45309);
}

.sxt-meter-full .sxt-meter-bar {
  accent-color: var(--danger, #b91c1c);
}

.sxt-meter-note {
  grid-column: 1 / -1;
  font-size: var(--text-sm, 0.875rem);
  color: var(--text-muted, inherit);
}

.sxt-plan-grid {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
  margin-bottom: var(--space-4);
}

.sxt-plan-name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  font-size: 1.25rem;
  margin: 0;
}

.sxt-plan-list {
  margin: 0;
  display: grid;
  gap: var(--space-2);
}

.sxt-plan-list > div {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  border-bottom: 1px solid var(--border, rgba(127, 127, 127, 0.25));
  padding-bottom: var(--space-1);
}

.sxt-plan-list dt {
  min-width: 0;
  overflow-wrap: anywhere;
}

.sxt-plan-list dd {
  margin: 0;
  font-weight: 600;
  text-align: end;
  font-variant-numeric: tabular-nums;
}

.sxt-plan-features,
.sxt-plan-history,
.sxt-plan-products,
.sxt-price-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-2);
}

.sxt-plan-features li,
.sxt-price-list li {
  display: flex;
  gap: var(--space-2);
  align-items: flex-start;
}

.sxt-plan-history li {
  overflow-wrap: anywhere;
}

.sxt-plan-products li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border, rgba(127, 127, 127, 0.25));
}

.sxt-plan-products li > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.sxt-plan-switches {
  display: grid;
  gap: var(--space-2);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
}

.sxt-override-grid {
  display: grid;
  gap: var(--space-3) var(--space-4);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr));
}

.sxt-home-plan {
  margin-bottom: var(--space-4);
}

.sxt-home-plan .card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.sxt-pricing {
  padding-block: var(--space-6, 2rem);
  display: grid;
  gap: var(--space-6, 2rem);
}

.sxt-pricing-head {
  text-align: center;
  display: grid;
  gap: var(--space-2);
  justify-items: center;
}

.sxt-pricing-grid {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
}

.sxt-price-card-top {
  border: 2px solid var(--brand, var(--primary));
}

.sxt-price {
  margin: 0;
  font-size: 1.5rem;
}

.sxt-price-actions .btn {
  width: 100%;
  white-space: normal;
}

.sxt-pricing-note {
  text-align: center;
}

.sxt-compare-table td,
.sxt-compare-table th {
  text-align: center;
}

.sxt-compare-table tbody th {
  text-align: start;
}

.sxt-guest-form,
.sxt-guest-result {
  max-width: 42rem;
  margin-bottom: var(--space-4);
}

.sxt-guest-short {
  align-items: center;
}

.sxt-guest-url {
  font-size: 1.25rem;
  font-weight: 700;
  overflow-wrap: anywhere;
  min-width: 0;
}

.sxt-guest-dest {
  overflow-wrap: anywhere;
}

.sxt-price-card .card-body {
  height: 100%;
  align-content: start;
}

.sxt-compare,
.sxt-pricing-addons,
.sxt-pricing-faq {
  display: grid;
  gap: var(--space-3);
}

/* Phase 15: the API page (keys, the simple shortener, the bookmarklet), the docs, webhooks, the share target, insights,
   a link's health. Long keys, addresses and code wrap instead of widening the page (320 px). */
.sxt-api-secret {
  border-color: var(--brand-border);
}

.sxt-copy-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}

.sxt-api-code,
.sxt-api-path {
  overflow-wrap: anywhere;
  word-break: break-all;
  min-width: 0;
}

.sxt-api-code {
  font-size: var(--text-sm);
  padding: var(--space-1) var(--space-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-subtle);
}

.sxt-api-pre {
  margin: 0;
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-subtle);
  font-size: var(--text-sm);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
}

.sxt-api-url,
.sxt-insight-dest {
  overflow-wrap: anywhere;
  word-break: break-word;
  min-width: 0;
}

.sxt-insight-dest {
  display: block;
  max-width: 36rem;
}

.sxt-api-scopes,
.sxt-api-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

.sxt-api-actions {
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.sxt-api-events {
  display: grid;
  gap: var(--space-2);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
}

.sxt-api-list {
  margin: 0;
  padding-left: var(--space-4);
  display: grid;
  gap: var(--space-1);
  overflow-wrap: anywhere;
}

.sxt-api-op {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-2) var(--space-3);
}

.sxt-api-op > summary {
  cursor: pointer;
  overflow-wrap: anywhere;
}

.sxt-api-op[open] > summary {
  margin-bottom: var(--space-2);
}

.sxt-api-method {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  min-width: 4.5rem;
  justify-content: center;
}

.sxt-bookmarklet {
  cursor: grab;
}

.sxt-share-made {
  max-width: 42rem;
}

.sxt-best-top {
  margin: 0;
  padding-left: var(--space-5);
  display: grid;
  gap: var(--space-1);
}

.sxt-best-days th,
.sxt-best-days td {
  white-space: nowrap;
}

.sxt-best-bar meter {
  width: 6rem;
  vertical-align: middle;
}

.sxt-health-parts {
  list-style: none;
  margin: var(--space-2) 0;
  padding: 0;
  display: grid;
  gap: var(--space-1);
  font-size: var(--text-sm);
}

.sxt-health-parts [data-ok="0"] {
  color: var(--text-muted);
}

.sxt-ai-out {
  white-space: pre-line;
  overflow-wrap: anywhere;
  margin: 0;
}

.sxt-ai-out:empty {
  display: none;
}

.sxt-health-badge {
  white-space: normal;
  max-width: 100%;
}

/* ---------- Phase 16 (R24): the look, the dashboard's live box and checklist, the palette, the guide ---------- */

/* Appearance (App\Modules\Look\Appearance → attributes of <html>): corners, density, text size. Sharp = the tokens. */
html[data-sxt-corners="soft"] {
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 18px;
}

html[data-sxt-corners="round"] {
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 18px;
  --radius-xl: 22px;
  --radius-2xl: 26px;
}

html[data-sxt-density="compact"] {
  --space-4: 0.75rem;
  --space-5: 1rem;
  --space-6: 1.125rem;
  --space-8: 1.5rem;
}

html[data-sxt-font="small"] {
  font-size: 93.75%;
}

html[data-sxt-font="large"] {
  font-size: 112.5%;
}

/* Phase 4's note: at 320 px the workspace name ran into the theme button — the name gets the room that is left. */
.sxt-app .admin-topbar {
  min-width: 0;
  gap: var(--space-2);
}

.sxt-app .admin-topbar .header-actions {
  flex-shrink: 0;
  gap: var(--space-1);
}

.sxt-switcher {
  flex: 0 1 auto;
  min-width: 64px;
  overflow: hidden;
}

.sxt-switcher-toggle {
  display: inline-flex;
  max-width: 100%;
  min-width: 0;
}

@media (max-width: 479.98px) {
  .sxt-how {
    display: none;
  }

  .sxt-app .admin-topbar .header-actions .btn {
    padding-inline: var(--space-1);
  }

  .sxt-app .admin-topbar .header-actions [data-dropdown-toggle] > .icon-sm,
  .sxt-switcher-toggle > .icon-sm {
    display: none;
  }

  .sxt-switcher-toggle {
    padding-inline: var(--space-1);
  }
}

/* The setup checklist. */
.sxt-checklist .card-header h3,
.sxt-ticker .card-header h3 {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.sxt-checklist-bar {
  height: 6px;
  margin-bottom: var(--space-4);
  overflow: hidden;
  border-radius: 999px;
  background: var(--bg-muted);
}

.sxt-checklist-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
}

.sxt-checklist-fill[data-n="1"] { width: 20%; }
.sxt-checklist-fill[data-n="2"] { width: 40%; }
.sxt-checklist-fill[data-n="3"] { width: 60%; }
.sxt-checklist-fill[data-n="4"] { width: 80%; }
.sxt-checklist-fill[data-n="5"] { width: 100%; }

.sxt-checklist-steps {
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.sxt-checklist-steps li {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.sxt-step-icon {
  display: inline-flex;
  flex-shrink: 0;
  color: var(--text-muted);
}

.sxt-step-name {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 600;
}

.sxt-step-how {
  flex-shrink: 0;
  font-size: var(--text-sm);
}

.sxt-step-done {
  background: var(--success-soft);
}

.sxt-step-done .sxt-step-icon,
.sxt-step-done .sxt-step-name {
  color: var(--success);
}

.sxt-step-open .sxt-step-icon {
  color: var(--brand-text);
}

/* The live click box. */
.sxt-pulse {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--success);
}

.sxt-ticker-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-3);
}

.sxt-ticker-count {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-2);
  margin: 0;
}

.sxt-ticker-count strong {
  font-family: var(--font-heading);
  font-size: var(--text-4xl);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.sxt-ticker-count span {
  color: var(--text-muted);
}

.sxt-ticker-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 48px;
  min-width: 0;
  overflow: hidden;
}

.sxt-ticker-bars span {
  flex: 1 1 0;
  min-width: 1px;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--brand-soft);
}

.sxt-ticker-bars span[data-h="1"] { height: 10%; background: var(--brand); }
.sxt-ticker-bars span[data-h="2"] { height: 20%; background: var(--brand); }
.sxt-ticker-bars span[data-h="3"] { height: 30%; background: var(--brand); }
.sxt-ticker-bars span[data-h="4"] { height: 40%; background: var(--brand); }
.sxt-ticker-bars span[data-h="5"] { height: 50%; background: var(--brand); }
.sxt-ticker-bars span[data-h="6"] { height: 60%; background: var(--brand); }
.sxt-ticker-bars span[data-h="7"] { height: 70%; background: var(--brand); }
.sxt-ticker-bars span[data-h="8"] { height: 80%; background: var(--brand); }
.sxt-ticker-bars span[data-h="9"] { height: 90%; background: var(--brand); }
.sxt-ticker-bars span[data-h="10"] { height: 100%; background: var(--brand); }

.sxt-ticker-feed {
  display: grid;
  gap: var(--space-2);
  margin: 0;
}

.sxt-ticker-item {
  display: grid;
  min-width: 0;
  padding: var(--space-2) var(--space-3);
  border-inline-start: 3px solid var(--brand);
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
}

.sxt-ticker-item strong {
  overflow-wrap: anywhere;
}

@media (min-width: 900px) {
  .sxt-ticker-body {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
    align-items: start;
  }

  .sxt-ticker-bars {
    grid-column: 1;
  }

  .sxt-ticker-feed {
    grid-column: 2;
    grid-row: 1 / span 3;
  }
}

/* The command palette and the shortcut list (native <dialog>, components.css .modal). */
.sxt-palette {
  width: min(640px, calc(100vw - 1rem));
  margin-top: min(12vh, 6rem);
}

.sxt-palette-box {
  display: grid;
  min-width: 0;
}

.sxt-palette-field {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
}

.sxt-palette-input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  font-size: var(--text-lg);
}

.sxt-palette-input:focus-visible {
  outline: none;
  box-shadow: none;
}

.sxt-palette-list {
  max-height: min(60vh, 420px);
  margin: 0;
  padding: var(--space-2);
  overflow-y: auto;
  list-style: none;
}

.sxt-palette-group {
  padding: var(--space-2) var(--space-3) var(--space-1);
  color: var(--text-subtle);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sxt-palette-item {
  display: grid;
  min-width: 0;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius);
  cursor: pointer;
}

.sxt-palette-item[aria-selected="true"] {
  background: var(--brand-soft);
  color: var(--brand-text);
}

.sxt-palette-label,
.sxt-palette-sub {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sxt-palette-sub {
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.sxt-palette-none {
  padding: var(--space-4) var(--space-3);
  color: var(--text-muted);
}

.sxt-palette-hint {
  margin: 0;
  padding: var(--space-2) var(--space-4);
  border-top: 1px solid var(--border);
  color: var(--text-subtle);
  font-size: var(--text-xs);
}

.sxt-keys-list {
  display: grid;
  gap: var(--space-2);
  margin: 0;
}

.sxt-keys-list > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-2);
}

.sxt-keys-list dd {
  margin: 0;
  color: var(--text);
}

.sxt-keys-list .sxt-sub {
  display: inline;
}

.sxt-keys-list kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: 0 var(--space-1);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  text-align: center;
}

/* The workspace's look form. */
.sxt-look-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: var(--space-4);
}

.sxt-look-color {
  width: 88px;
  height: 44px;
  padding: var(--space-1);
}

.sxt-look-preview {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
}

.sxt-look-preview .sxt-sub {
  display: inline;
}

/* The guide. */
.sxt-guide {
  display: grid;
  gap: var(--space-5);
  max-width: 860px;
}

.sxt-guide-head {
  flex-wrap: wrap;
}

.sxt-guide-toc-list {
  columns: 2 220px;
  margin: var(--space-2) 0 0;
  padding-inline-start: var(--space-5);
}

.sxt-guide-section {
  scroll-margin-top: 5rem;
}

.sxt-guide-section p,
.sxt-guide-list li {
  overflow-wrap: anywhere;
}

.sxt-guide-list {
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding-inline-start: var(--space-5);
}

.sxt-guide-code {
  max-width: 100%;
  margin: 0;
  padding: var(--space-3);
  overflow-x: auto;
  border-radius: var(--radius);
  background: var(--bg-muted);
  font-size: var(--text-sm);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.sxt-guide-top {
  margin: 0;
  font-size: var(--text-sm);
}

.sxt-guide-section:target {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-ring);
}

@media print {
  .sxt-app .admin-sidebar,
  .sxt-app .admin-topbar,
  .sxt-app .admin-footer,
  .sxt-app .site-notices,
  .sxt-no-print {
    display: none !important;
  }

  .sxt-guide-section {
    break-inside: avoid;
    border: 0;
    box-shadow: none;
  }
}

/* Motion (R24.2): small entrances, only without prefers-reduced-motion. */
@media (prefers-reduced-motion: no-preference) {
  .sxt-pulse {
    animation: sxt-pulse 1.8s ease-out infinite;
  }

  .sxt-ticker-new {
    animation: sxt-slide-in var(--duration-slow) var(--ease);
  }

  .sxt-ticker-bars span {
    transition: height var(--duration-slow) var(--ease);
  }

  .sxt-checklist-fill {
    transition: width var(--duration-slow) var(--ease);
  }

  .sxt-content > .card,
  .sxt-content > .stat-grid {
    animation: sxt-rise var(--duration-slow) var(--ease) both;
  }
}

@keyframes sxt-pulse {
  0% { box-shadow: 0 0 0 0 rgb(15 123 85 / 0.45); }
  70% { box-shadow: 0 0 0 10px rgb(15 123 85 / 0); }
  100% { box-shadow: 0 0 0 0 rgb(15 123 85 / 0); }
}

@keyframes sxt-slide-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}

@keyframes sxt-rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* Phase 16: hooks of the palette button, the shortcut dialog, the guide's contents and the look form. */
.sxt-palette-open,
.sxt-how {
  flex-shrink: 0;
}

.sxt-keys {
  width: min(480px, calc(100vw - 1rem));
}

.sxt-guide-toc h3 {
  font-size: var(--text-base);
}

.sxt-look h3 {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.sxt-look-accent {
  max-width: 420px;
}
