.wallet-ui > main {
  max-width: 1440px;
  padding: 24px 32px 64px;
}
.wallet-page {
  max-width: 1136px;
  margin: auto;
}
.wallet-panel {
  background: var(--card);
  border: 1px solid var(--bd);
  border-radius: 18px;
  padding: 22px;
  min-width: 0;
}
.wallet-panel h2 {
  font-size: 18px;
  margin: 0 0 20px;
}
.wallet-page > .wallet-panel {
  margin: 24px 0;
}
.wallet-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 94px;
  min-height: 44px;
  background: #fff;
  border: 1px solid var(--bd2);
  border-radius: 12px;
  color: var(--fg);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.wallet-chip small {
  font-size: 11px;
  font-weight: 400;
}
.wallet-chip-main {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  padding: 0 8px;
}
.wallet-chip-icon,
.wallet-chip-chevron {
  flex-shrink: 0;
}
.wallet-chip-chevron {
  color: var(--mut);
}
.wallet-ui #site-nav a[aria-current="page"] {
  color: var(--acc);
  background: var(--raised);
  box-shadow: inset 0 -2px 0 var(--acc);
  font-weight: 600;
}
.wallet-large {
  font-size: 40px;
  font-variant-numeric: tabular-nums;
  display: block;
  line-height: 1.4;
  margin: 8px 0;
}
.wallet-warning {
  color: #9b3e4c;
}
.wallet-dialog {
  color: var(--fg);
  background: #fff;
  border: 1px solid var(--bd);
  border-radius: 20px;
  padding: 30px;
  width: min(520px, calc(100% - 32px));
  max-height: 90dvh;
  overflow-y: auto;
  box-shadow: 0 24px 80px #1b304d33;
}
.wallet-dialog::backdrop {
  background: #1b304d70;
}
.wallet-dialog h2 {
  font-size: 22px;
  padding-right: 28px;
}
.wallet-close {
  position: absolute;
  right: 10px;
  top: 10px;
  min-width: 44px;
  min-height: 44px;
  border: 0;
  background: transparent;
  font-size: 26px;
  color: var(--fg);
  cursor: pointer;
}
.wallet-dialog label,
.wallet-panel label {
  display: block;
  margin: 14px 0 8px;
  font-size: 14px;
}
.wallet-dialog input,
.wallet-dialog textarea,
.wallet-panel input,
.wallet-panel textarea,
.wallet-panel select {
  width: 100%;
  box-sizing: border-box;
  font-size: 16px !important;
}
.wallet-block-link {
  display: block;
  padding: 14px 0;
}
.wallet-topup-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.wallet-topup-options button,
.wallet-topup-row {
  min-height: 48px;
  border: 1px solid var(--bd2);
  background: #fff;
  border-radius: 12px;
  color: var(--fg);
  cursor: pointer;
}
.wallet-topup-options button.on,
.wallet-topup-row.on {
  border-color: var(--acc);
  background: #f3f6ff;
}
.wallet-topup-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  width: 100%;
  margin-bottom: 10px;
  text-align: left;
}
.wallet-topup-row strong {
  font-size: 22px;
}
.wallet-topup-row span {
  color: var(--mut);
  font-size: 13px;
  text-align: right;
}
.wallet-dialog .btn,
.wallet-run-bar .btn {
  width: 100%;
  justify-content: center;
}
.wallet-topup-layout {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 24px;
  margin: 24px 0;
}
.wallet-balance-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: center;
  gap: 20px;
}
.wallet-balance-overview strong {
  display: block;
  font-size: 26px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.wallet-balance-overview .wallet-large {
  font-size: 40px;
}
.wallet-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
}
.wallet-table th,
.wallet-table td {
  padding: 16px 12px;
  border-bottom: 1px solid var(--bd);
  vertical-align: top;
}
.wallet-table th {
  font-weight: 400;
  color: var(--mut);
}
.wallet-history-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  min-height: 64px;
  align-items: center;
  border-bottom: 1px solid var(--bd);
  font-size: 14px;
}
.wallet-history-row small {
  display: block;
  color: var(--mut);
  margin-top: 4px;
}
.wallet-pagination {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
}
.wallet-studio {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr) 300px;
  gap: 16px;
  align-items: start;
}
.wallet-ui:has(.wallet-studio) > header {
  padding-left: 32px;
  padding-right: 32px;
}
.wallet-parameters {
  padding: 20px;
  position: sticky;
  top: 90px;
  max-height: calc(100dvh - 110px);
  overflow: auto;
}
.wallet-mode,
.wallet-model {
  padding: 12px;
  background: var(--raised);
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  font-size: 14px;
}
.wallet-mode {
  justify-content: center;
  background: #fff;
  border: 1px solid var(--bd2);
}
#wallet-prompt {
  min-height: 130px;
}
#wallet-char-count {
  float: right;
}
.wallet-form-details > button {
  width: 100%;
  margin-top: 18px;
}
.wallet-form-details > small {
  display: block;
  text-align: center;
  color: var(--mut);
  margin: 8px 0;
}
.wallet-model span {
  font-size: 13px;
}
.wallet-run-bar {
  position: sticky;
  bottom: -20px;
  margin: 20px -20px -20px;
  padding: 16px 20px;
  background: #fff;
  border-top: 1px solid var(--bd);
}
.wallet-run-bar > span,
.wallet-run-bar > small {
  display: block;
  text-align: right;
  font-size: 12px;
  color: var(--mut);
  margin-bottom: 10px;
}
.wallet-run-bar > small {
  text-align: center;
  margin: 8px 0 0;
}
.wallet-results {
  min-height: calc(100dvh - 140px);
}
.wallet-result-stage {
  min-height: 360px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--raised);
  border-radius: 14px;
  text-align: center;
  overflow: hidden;
}
.wallet-result-stage img {
  display: block;
  width: 100%;
  max-height: 70dvh;
  object-fit: contain;
}
.wallet-result-stage p {
  line-height: 2;
}
.wallet-thumbnails {
  display: flex;
  gap: 8px;
  overflow: auto;
  padding: 10px 0;
}
.wallet-thumbnails button {
  min-width: 60px;
  min-height: 60px;
  border: 2px solid transparent;
  background: var(--raised);
  border-radius: 10px;
  padding: 2px;
  cursor: pointer;
}
.wallet-thumbnails button.on {
  border-color: var(--acc);
}
.wallet-thumbnails img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 7px;
}
#wallet-result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}
.wallet-task {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--bd);
  border-radius: 0;
  min-height: 80px;
  background: #fff;
  text-align: left;
  color: var(--fg);
  padding: 14px 0;
  cursor: pointer;
  display: flex;
  gap: 10px;
  align-items: center;
}
.wallet-task img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 8px;
}
.wallet-task span {
  font-size: 13px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.wallet-task small {
  display: block;
  color: var(--mut);
  margin-top: 6px;
}
.wallet-task:focus-visible,
.wallet-thumbnails button:focus-visible {
  outline: 2px solid var(--acc);
  outline-offset: 3px;
}
.wallet-task-list {
  max-height: calc(100dvh - 140px);
  overflow: auto;
}
.wallet-compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.wallet-compare-grid figure {
  margin: 0;
}
.wallet-compare-grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  background: var(--raised);
  border-radius: 12px;
}
.wallet-compare-grid figcaption {
  text-align: center;
  padding: 10px;
}
.wallet-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.wallet-gallery img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: 12px;
}
.wallet-gallery p {
  overflow-wrap: anywhere;
}
.wallet-mobile-parameters,
.wallet-mobile-tabs {
  display: none;
}
#wallet-reference-preview {
  max-width: 100%;
  max-height: 140px;
  display: block;
  margin-top: 12px;
}
.wallet-admin-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 18px 0;
}
.wallet-admin-table {
  overflow: auto;
}
.wallet-admin-table table {
  min-width: 700px;
}
.wallet-admin-forms {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 24px;
}
.wallet-admin-forms form {
  border-top: 1px solid var(--bd);
  padding-top: 20px;
}
.wallet-admin-forms input[type="checkbox"] {
  width: auto;
  min-width: 24px;
  min-height: 24px;
}
.wallet-ui button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}
.wallet-task-list h2 small {
  font-size: 12px;
}
.wallet-page p {
  line-height: 1.8;
}
.wallet-table input {
  min-width: 120px;
}
.wallet-dialog p {
  line-height: 1.8;
}
@media (min-width: 641px) and (max-width: 1023px) {
  .wallet-studio {
    grid-template-columns: 300px minmax(0, 1fr);
  }
  .wallet-task-list {
    grid-column: 1/-1;
    max-height: 400px;
  }
  .wallet-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  .wallet-ui > main {
    padding: 16px 16px 40px;
  }
  .wallet-ui > header {
    position: sticky;
    top: 0;
    z-index: 45;
    background: var(--bg);
  }
  .wallet-ui:has(.wallet-studio) > header {
    padding-left: 16px;
    padding-right: 16px;
  }
  .wallet-chip {
    min-width: 74px;
    font-size: 13px;
  }
  .wallet-studio {
    display: flex;
    flex-direction: column;
    padding-bottom: 310px;
  }
  .wallet-results {
    order: 1;
    width: 100%;
    min-height: 400px;
    padding: 16px;
  }
  .wallet-result-stage {
    min-height: 270px;
  }
  .wallet-parameters {
    position: fixed;
    inset: auto 0 0;
    max-height: calc(85dvh - 56px);
    border-radius: 20px 20px 0 0;
    z-index: 35;
    overflow: auto;
    padding: 12px 16px calc(56px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -8px 32px #1b304d18;
  }
  .wallet-mobile-parameters {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 12px;
    width: 100%;
    justify-content: space-between;
    align-items: center;
    min-height: 56px;
    border: 0;
    background: #fff;
    color: var(--fg);
    cursor: pointer;
    margin-bottom: 4px;
    text-align: start;
  }
  .wallet-mobile-parameters strong {
    font-size: 14px;
    color: var(--accent, #355fcd);
  }
  .wallet-mobile-parameters [data-parameter-summary] {
    grid-column: 1;
    font-size: 13px;
    color: var(--mut);
  }
  .wallet-mobile-parameters svg {
    grid-column: 2;
    grid-row: 1 / 3;
    transition: transform 160ms ease;
  }
  .wallet-mobile-parameters[aria-expanded="true"] svg {
    transform: rotate(180deg);
  }
  .wallet-parameters:not(.expanded) .wallet-form-details,
  .wallet-parameters:not(.expanded) .wallet-form-scroll > label {
    display: none;
  }
  .wallet-parameters:not(.expanded) #wallet-prompt {
    min-height: 44px;
    height: 48px;
    line-height: 1.5;
  }
  .wallet-parameters:not(.expanded) .wallet-mode {
    display: none;
  }
  .wallet-run-bar {
    position: static;
    background: #fff;
    border: 0;
    margin: 10px 0 0;
    padding: 0;
  }
  .wallet-run-bar > small {
    display: none;
  }
  .wallet-run-bar > span {
    margin-bottom: 8px;
  }
  .wallet-parameters.expanded #wallet-prompt {
    min-height: 120px;
  }
  .wallet-mobile-tabs {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 36;
    background: #fff;
    border-top: 1px solid var(--bd);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    height: calc(48px + env(safe-area-inset-bottom, 0px));
  }
  .wallet-mobile-tabs button {
    width: 50%;
    min-height: 44px;
    border: 0;
    background: #fff;
    color: var(--fg);
    cursor: pointer;
  }
  .wallet-studio .wallet-task-list {
    display: none;
    width: 100%;
    max-height: none;
    order: 2;
  }
  .wallet-studio.show-tasks .wallet-task-list {
    display: block;
  }
  .wallet-studio.show-tasks .wallet-results {
    display: none;
  }
  body.nav-open .wallet-parameters,
  body.nav-open .wallet-mobile-tabs {
    visibility: hidden;
  }
  .wallet-ui:has(.wallet-studio) > footer {
    padding-bottom: 330px;
  }
  .wallet-dialog {
    border-radius: 20px 20px 0 0;
    width: 100%;
    max-width: none;
    max-height: 90dvh;
    margin: auto 0 0;
    padding: 24px 20px calc(24px + env(safe-area-inset-bottom, 0px));
    border: 0;
  }
  .wallet-topup-layout,
  .wallet-admin-forms {
    grid-template-columns: 1fr;
  }
  .wallet-balance-overview {
    grid-template-columns: 1fr 1fr;
    padding: 20px;
    gap: 24px;
  }
  .wallet-balance-overview .wallet-large {
    font-size: 34px;
  }
  .wallet-balance-overview strong {
    font-size: 23px;
  }
  .wallet-history-row {
    grid-template-columns: 1.2fr 1fr;
    font-size: 13px;
    gap: 10px;
    padding: 12px 0;
  }
  .wallet-history-row > span:last-child {
    grid-column: 1/-1;
  }
  .wallet-gallery {
    grid-template-columns: 1fr;
  }
  .wallet-gallery img {
    max-height: 240px;
    aspect-ratio: 4/3;
  }
  .wallet-compare-grid {
    gap: 8px;
  }
  .wallet-panel .btn {
    min-height: 44px;
  }
  .wallet-dialog textarea,
  .wallet-panel textarea,
  .wallet-panel select,
  .wallet-panel input {
    font-size: 16px !important;
  }
  .wallet-pagination {
    justify-content: space-between;
  }
  .wallet-page h1 {
    font-size: 32px;
  }
  .wallet-table th,
  .wallet-table td {
    padding: 12px 8px;
    font-size: 13px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .wallet-ui * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

.wallet-admin-table pre {
  max-width: 600px;
  max-height: 250px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.wallet-admin-table summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  cursor: pointer;
}
.wallet-ui input[type="file"] {
  min-height: 44px;
}
.wallet-ui input[type="file"]::file-selector-button {
  min-height: 44px;
  border: 1px solid var(--bd2);
  border-radius: 10px;
  background: #fff;
  color: var(--fg);
  padding: 8px 12px;
  margin-right: 10px;
}

/* Phase-1 canvas alignment */
.wallet-run-bar .btn {
  gap: 0.35em;
}
.wallet-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.wallet-mode-label {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--mut);
}
.wallet-file {
  display: inline-flex;
  margin-right: 10px;
}
.wallet-form-details {
  position: relative;
}
.wallet-seg {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 6px 0 12px;
}
.wallet-seg button {
  flex: 1 1 0;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 8px;
  background: #fff;
  border: 1px solid var(--bd2);
  border-radius: 10px;
  font: inherit;
  font-size: 13px;
  color: var(--fg);
  cursor: pointer;
}
.wallet-seg button[aria-pressed="true"] {
  border-color: var(--acc, #355fcd);
  background: var(--sel, #f3f6ff);
  font-weight: 500;
}
.wallet-seg i {
  display: block;
  width: 16px;
  border: 1.5px solid currentColor;
  border-radius: 2px;
  max-height: 18px;
}
.wallet-aspects button {
  flex: 0 0 calc(33.333% - 4px);
}
.wallet-notes {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: var(--fg2, inherit);
}
.wallet-examples {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.wallet-examples > div {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px;
  border: 1px solid var(--bd2);
  border-radius: 12px;
}
.wallet-examples span {
  font-size: 13px;
  color: var(--fg2, inherit);
}
.wallet-task small {
  display: block;
}
.wallet-spec {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
}
@media (max-width: 640px) {
  .wallet-examples {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.wallet-form-details label.wallet-file {
  display: inline-flex;
  width: auto;
  margin: 0 10px 0 0;
}

/* Video uses the same approved wallet panels, controls and mobile drawer. */
.wallet-duration {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 64px auto;
  gap: 8px;
  align-items: center;
}
.wallet-duration input {
  min-width: 0;
  width: 100%;
}
.wallet-video-models {
  display: grid;
  gap: 6px;
}
.wallet-video-models button {
  min-height: 44px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--bd2);
  border-radius: 10px;
  background: var(--bg);
  color: var(--fg);
  cursor: pointer;
}
.wallet-video-models button[aria-pressed="true"] {
  border-color: var(--acc);
  background: var(--raised);
  color: var(--acc);
}
.wallet-video-models button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}
#wallet-frame-aspect {
  padding: 12px;
  margin: 8px 0;
  border: 1px solid var(--bd2);
  border-radius: 10px;
  background: var(--raised);
}
#wallet-frame-aspect small {
  display: block;
  margin-top: 8px;
  color: var(--mut);
}
#wallet-frame-error,
#wallet-result-frame-error {
  overflow-wrap: anywhere;
  scroll-margin-block: 80px 330px;
}
#wallet-frame-error:empty,
#wallet-result-frame-error:empty {
  display: none;
}
.wallet-result-stage video {
  display: block;
  width: 100%;
  max-height: 70vh;
  background: #182537;
  border-radius: 10px;
}
.wallet-creation-preview {
  display: block;
  position: relative;
  width: 100%;
  min-height: 150px;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 12px;
  background: var(--raised);
  color: var(--fg);
  cursor: pointer;
}
.wallet-creation-preview img,
.wallet-creation-preview video {
  width: 100%;
  height: 220px;
  display: block;
  object-fit: cover;
}
.wallet-video-duration {
  position: absolute;
  right: 10px;
  bottom: 10px;
  background: #182537d9;
  color: white;
  padding: 4px 8px;
  border-radius: 6px;
}
.wallet-gallery-filters,
.wallet-admin-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
  align-items: end;
}
.wallet-gallery-filters label {
  flex: 1;
  min-width: 120px;
}
.wallet-gallery-filters select {
  width: 100%;
  min-height: 44px;
}
#wallet-detail-media img,
#wallet-detail-media video {
  width: 100%;
  max-height: 60vh;
  object-fit: contain;
}
#wallet-detail-prompt {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.wallet-admin-filters input,
.wallet-admin-filters select,
[data-task-action] input,
[data-task-action] select {
  max-width: 220px;
  min-height: 44px;
}
.wallet-admin-table td {
  overflow-wrap: anywhere;
}
.wallet-creation-preview:focus-visible {
  outline: 2px solid var(--acc);
  outline-offset: 3px;
}
@media (max-width: 640px) {
  .wallet-gallery .wallet-creation-preview img,
  .wallet-gallery .wallet-creation-preview video {
    height: 180px;
  }
  .wallet-mode-switch {
    margin-bottom: 8px;
  }
  .wallet-duration {
    grid-template-columns: minmax(0, 1fr) 64px;
  }
  #wallet-duration-reset {
    grid-column: 1 / -1;
    min-height: 44px;
  }
  .wallet-parameters.expanded {
    display: flex;
    flex-direction: column;
    height: calc(85dvh - 56px);
    overflow: hidden;
  }
  .wallet-parameters.expanded .wallet-mobile-parameters {
    flex-shrink: 0;
  }
  .wallet-parameters.expanded #wallet-form {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
  }
  .wallet-parameters.expanded .wallet-form-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-bottom: 12px;
  }
  .wallet-parameters.expanded .wallet-run-bar {
    flex-shrink: 0;
    margin: 0;
    padding-top: 10px;
    border-top: 1px solid var(--bd);
  }
}

/* Mode switch replaces the static mode label. */
.wallet-mode-switch + .wallet-mode-label { display: none; }
.wallet-operations-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(220px,100%),1fr)); gap: 12px; }
.wallet-operations-grid h2 { font-size: 14px; font-weight: 500; }
.wallet-operations-grid strong { font-size: 24px; }
.wallet-operations-grid small { display: block; margin-top: 8px; }
.wallet-alert-count { display: inline-flex; min-width: 20px; min-height: 20px; padding: 0 5px; margin-left: 4px; align-items: center; justify-content: center; border-radius: 12px; background: #a62038; color: #fff; font-size: 12px; }
.wallet-operations > .wallet-panel { margin-top: 18px; }
.wallet-operations .table-wrap { max-width: 100%; overflow-x: auto; }
.wallet-operations .wallet-table td { overflow-wrap: anywhere; }
.wallet-operations .wallet-table input { min-width: 130px; }
.wallet-video-hero { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 32px; padding: 48px 0; }
.wallet-showcase video { display: block; width: 100%; max-height: 480px; border-radius: 18px; background: #203755; }
.wallet-showcase-placeholder { min-height: 280px; display: grid; place-items: center; border-radius: 18px; background: linear-gradient(135deg,#203755,#527baf); color: #fff; }
@media (max-width: 770px) { .wallet-video-hero { grid-template-columns: 1fr; padding: 24px 0; } }
#wallet-expansion-seg button { flex: 1 1 0; }

/* Phone keyboard: the drawer sits on top of the keyboard and shrinks to the
   visible viewport; tabs and the balance line step aside while typing. */
@media (max-width: 640px) {
  body.wallet-typing .wallet-mobile-tabs { display: none; }
  body.wallet-typing .wallet-parameters {
    bottom: var(--wallet-kb, 0px);
    padding-bottom: 12px;
  }
  body.wallet-typing .wallet-parameters.expanded {
    height: min(calc(85dvh - 56px), calc(var(--wallet-vvh, 100dvh) - 64px));
  }
  body.wallet-typing .wallet-run-bar > span { display: none; }
  body.wallet-typing .wallet-parameters.expanded .wallet-mobile-parameters { min-height: 44px; }
  body.wallet-typing .wallet-parameters.expanded [data-parameter-summary] { display: none; }
}

/* Gallery filters: segmented buttons per the canvas. */
.wallet-filter-group { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--mut); }
.wallet-gallery-filters .wallet-filter-group:first-child { flex: 0 1 300px; }
.wallet-gallery-filters .wallet-filter-group:nth-child(2) { flex: 0 1 460px; }
.wallet-gallery-filters .wallet-seg { margin: 0; flex-wrap: nowrap; }
.wallet-gallery-filters .wallet-seg button { white-space: nowrap; }
@media (max-width: 640px) {
  .wallet-gallery-filters .wallet-filter-group { flex: 1 1 100%; }
  .wallet-gallery-filters .wallet-seg button { padding: 6px 4px; font-size: 13px; }
}
.wallet-gallery-filters .wallet-seg { width: 100%; }
.wallet-gallery-filters .wallet-seg button { flex: 1 1 0; min-width: 0; }
@media (max-width: 640px) {
  .wallet-gallery-filters .wallet-filter-group:first-child,
  .wallet-gallery-filters .wallet-filter-group:nth-child(2) { flex: 1 1 100%; }
  .wallet-gallery-filters .wallet-seg { flex-wrap: wrap; }
  .wallet-gallery-filters .wallet-seg button { flex: 1 1 auto; min-width: max-content; }
}

/* Operations: the current page, range and filter are highlighted. */
.wallet-admin-nav a[aria-current="page"] { background: var(--fg, #1b304d); border-color: var(--fg, #1b304d); color: #fff; }
.wallet-operations-grid section small { display: block; color: var(--mut); font-size: 12px; margin-top: 6px; }

/* Video home: one 1136px content column per band, proportions per canvas HOME-pc-new / HOME-m-new. */
.wallet-video-home .home-band { padding-top: 64px; padding-bottom: 64px; }
.wallet-video-home .home-band > h2, .wallet-video-home .wvh-split h2, .wallet-video-home .wvh-grid2 h2, .wallet-video-home .wvh-row h2 { font-size: 28px; margin: 0 0 20px; }
.wvh-hero { border-top: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 56px; align-items: center; padding-top: 72px !important; }
.wvh-hero h1 { font-size: clamp(40px, 4.2vw, 56px); line-height: 1.15; margin: 0 0 16px; }
.wvh-hero .lead { font-size: 18px; margin: 0 0 24px; }
.wvh-hero .cta-row { display: flex; gap: 12px; flex-wrap: wrap; justify-content: flex-start; }
.wallet-video-home .wallet-showcase video, .wallet-video-home .wallet-showcase-placeholder { width: 100%; aspect-ratio: 16 / 9; border-radius: 16px; display: block; }
.wallet-video-home .wallet-showcase video { height: auto; max-height: none; aspect-ratio: auto 16 / 9; object-fit: contain; background: transparent; }
.wallet-video-home .wallet-showcase-placeholder { min-height: 0; display: flex; align-items: center; justify-content: center; }
.wvh-note { font-size: 13px; margin: 10px 0 0; }
.wvh-entries { background: #fff; padding-top: 40px !important; padding-bottom: 40px !important; }
.wvh-grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.wvh-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
.wvh-entry { display: flex; align-items: center; gap: 14px; min-height: 88px; padding: 18px 20px; border: 1px solid var(--bd); border-radius: 16px; background: #fff; color: var(--fg); text-decoration: none; }
.wvh-entry:hover { border-color: var(--bd2); background: var(--raised); }
.wvh-entry span { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.wvh-entry small { color: var(--mut); font-size: 14px; }
.wvh-entry svg { color: var(--mut); flex: none; }
.wvh-split { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 40px; align-items: start; }
.wvh-split .home-composer { margin: 0; }
.wvh-examples { background: #fff; }
.wvh-examples .home-comparison { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 12px 40px; align-items: start; }
.wvh-examples .home-comparison > * { grid-column: 2; }
.wvh-examples .home-comparison > .comparison-stage { grid-column: 1; grid-row: 1 / span 8; max-height: 520px; }
.wvh-step { border-top: 1px solid var(--bd2); padding-top: 14px; display: flex; flex-direction: column; gap: 4px; }
.wvh-step span { font-size: 12px; color: var(--mut); }
.wvh-step p { margin: 0; color: var(--mut); font-size: 14px; }
.wvh-pricing { background: #fff; }
.wvh-row { display: flex; align-items: center; justify-content: space-between; gap: 20px 32px; flex-wrap: wrap; }
.wvh-row > div { flex: 1 1 420px; }
.wallet-video-home .wvh-row h2 { margin-bottom: 8px; }
.wvh-row p { margin: 0; color: var(--mut); }
.wvh-links { display: flex; gap: 10px; flex-wrap: wrap; }
.wvh-final h2 { font-family: PixelMint Display, system-ui; font-weight: 400; font-size: 40px !important; margin: 0 !important; }
@media (max-width: 769px) {
  .wvh-hero, .wvh-split, .wvh-grid2, .wvh-examples .home-comparison { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .wvh-examples .home-comparison > *, .wvh-examples .home-comparison > .comparison-stage { grid-column: 1; grid-row: auto; }
  .wvh-grid3 { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .wallet-video-home .home-band { padding-top: 40px; padding-bottom: 40px; }
  .wvh-hero { padding-top: 32px !important; }
  .wvh-hero h1 { font-size: 36px; }
  .wvh-final h2 { font-size: 28px !important; }
  .wvh-row .btn, .wvh-hero .cta-row .btn { flex: 1 1 auto; }
}

/* Section 12: owner-only gallery, image-first cards and explicit selection. */
.gallery-redesign { max-width:1200px; padding-bottom:160px; }
.gallery-redesign [hidden], .gallery-detail [hidden] { display:none!important; }
.gallery-heading { display:flex; align-items:center; justify-content:space-between; margin-bottom:20px; }
.gallery-heading h1 { margin:0 0 6px; font-size:28px; }
.gallery-heading p { margin:0; }
.gallery-filter-row { display:flex; align-items:center; gap:12px; flex-wrap:wrap; margin-bottom:12px; }
.gallery-filter-row .wallet-seg { margin:0; flex-wrap:nowrap; width:auto; padding:3px; background:var(--raised,#edf1f7); border-radius:10px; }
.gallery-filter-row .wallet-seg button { min-width:56px; min-height:44px; padding:8px 12px; border:0; box-shadow:none; white-space:normal; font-size:14px; background:transparent; }
.gallery-filter-row .wallet-seg button[aria-pressed=true] { background:#fff; color:var(--fg); box-shadow:0 1px 4px #15243a15; }
.gallery-select-button { margin-left:auto; }
.gallery-status { min-height:20px; font-size:14px; color:var(--mut); }
.gallery-favorites-hint { border:1px solid var(--bd); padding:12px 16px; border-radius:10px; font-size:14px; }
.wallet-gallery.gallery-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:16px; margin-top:16px; }
.gallery-card { position:relative; aspect-ratio:16/10; min-width:0; overflow:hidden; border-radius:12px; background:var(--raised,#edf1f7); outline:2px solid transparent; outline-offset:1px; }
.gallery-card.is-selected { outline-color:var(--acc,#355fcd); }
.gallery-media { position:absolute; inset:0; display:block; border:0; border-radius:0; padding:0; width:100%; height:100%; background:transparent; cursor:pointer; }
.gallery-card .gallery-media img,.gallery-card .gallery-media video { display:block; width:100%; height:100%; object-fit:cover; border:0; border-radius:0; margin:0; }
.gallery-card:focus-within { outline-color:var(--acc,#355fcd); }
.gallery-pending { display:grid; place-items:center; height:100%; padding:20px; text-align:center; font-size:14px; }
.gallery-kind-badge { position:absolute; left:10px; bottom:10px; display:flex; align-items:center; gap:6px; background:#fffffff2; color:#17283f; padding:5px 8px; border-radius:6px; font-size:12px; pointer-events:none; }
.gallery-redesign svg { width:18px; height:18px; flex:none; }
.gallery-check { position:absolute; left:2px; top:2px; width:44px; height:44px; padding:11px; background:transparent; border:0; cursor:pointer; z-index:3; opacity:0; }
.gallery-check svg { background:#ffffffda; border:1px solid #ffffff; border-radius:6px; width:22px; height:22px; color:transparent; }
.gallery-check[aria-checked=true] svg { color:#fff; background:var(--acc,#355fcd); border-color:var(--acc,#355fcd); }
.gallery-hover-actions { position:absolute; top:4px; right:4px; display:flex; gap:2px; opacity:0; z-index:4; pointer-events:none; }
.gallery-hover-actions button,.gallery-hover-actions a { display:grid; place-items:center; width:36px; height:36px; padding:0; border:1px solid #ffffff55; background:#ffffffee; color:#1b304d; border-radius:7px; cursor:pointer; }
.gallery-hover-actions button[aria-pressed=true] { color:#d33c50; }
.gallery-hover-actions button[aria-pressed=true] svg { fill:currentColor; }
.gallery-favorite-pin { position:absolute; right:12px; top:12px; color:#db3750; filter:drop-shadow(0 1px 2px #0006); pointer-events:none; }
.gallery-favorite-pin svg { fill:currentColor; stroke:#fff; }
.gallery-card:focus-within .gallery-hover-actions { opacity:1; pointer-events:auto; }
.gallery-card:focus-within .gallery-check,.gallery-redesign.is-selecting .gallery-check { opacity:1; }
@media (hover:hover) { .gallery-card:hover .gallery-hover-actions { opacity:1; pointer-events:auto; } .gallery-card:hover .gallery-check { opacity:1; } .gallery-card:hover .gallery-favorite-pin { opacity:0; } }
.gallery-empty { padding:50px 0; text-align:center; color:var(--mut); }
.gallery-legacy { margin-top:48px; }
.gallery-legacy-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:16px; }
.gallery-legacy-grid article { min-width:0; }
.gallery-legacy-grid img { width:100%; aspect-ratio:16/10; object-fit:cover; border-radius:12px; }
.gallery-legacy-grid article>div { display:flex; flex-wrap:wrap; gap:8px; margin-top:10px; }
.gallery-legacy-grid .btn { min-height:44px; padding:8px 10px; font-size:13px; }
.gallery-selection-bar { position:fixed; z-index:45; bottom:20px; left:50%; transform:translateX(-50%); width:min(880px,calc(100% - 40px)); padding:16px; background:#fff; border:1px solid var(--bd); border-radius:16px; box-shadow:0 8px 40px #172a4330; }
.gallery-selection-summary { display:flex; align-items:center; gap:16px; margin-bottom:14px; }
.gallery-selection-summary p { margin:4px 0 0; color:var(--mut); font-size:13px; }
.gallery-selection-summary>button { margin-left:auto; border:0; background:transparent; min-height:44px; padding:8px; color:var(--mut); cursor:pointer; }
.gallery-thumb-stack { position:relative; width:46px; height:46px; margin-left:6px; }
.gallery-thumb-stack img { position:absolute; width:42px; height:42px; border:2px solid #fff; border-radius:6px; object-fit:cover; }
.gallery-thumb-stack img:nth-child(2) { transform:rotate(-8deg) translate(-5px,0); }
.gallery-thumb-stack img:nth-child(3) { transform:rotate(8deg) translate(5px,0); }
.gallery-selection-actions { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; }
.gallery-selection-actions .btn { min-width:0; min-height:44px; padding:8px 10px; }
.gallery-mobile-selection { display:none; }
.gallery-action-menu { position:fixed; inset:auto; width:340px; max-width:calc(100vw - 16px); max-height:75dvh; overflow:auto; padding:16px 8px 8px; border:1px solid var(--bd); border-radius:14px; background:#fff; color:var(--fg); box-shadow:0 8px 40px #172a4330; margin:0; }
.gallery-action-menu::backdrop { background:#12203830; }
.gallery-action-menu h2 { font-size:16px; margin:0 40px 12px 10px; }
.gallery-menu-close { position:absolute; right:4px; top:4px; border:0; background:transparent; min-width:44px; min-height:44px; cursor:pointer; font-size:24px; }
#gallery-menu-items button { display:flex; align-items:flex-start; flex-direction:column; justify-content:center; min-height:52px; width:100%; text-align:left; padding:10px 12px; border:0; background:transparent; border-radius:8px; color:inherit; cursor:pointer; }
#gallery-menu-items button:hover:not(:disabled) { background:var(--raised); }
#gallery-menu-items button:disabled { opacity:.5; cursor:not-allowed; }
#gallery-menu-items small { display:block; font-size:12px; margin-top:4px; }
#gallery-menu-items .gallery-danger,.gallery-danger { color:#b52c40; }
.gallery-delete-dialog { width:min(440px,calc(100% - 32px)); border:1px solid var(--bd); border-radius:18px; padding:24px; color:var(--fg); background:#fff; }
.gallery-delete-dialog::backdrop { background:#10203d77; }
.gallery-delete-dialog h2 { font-size:22px; }
.gallery-delete-dialog>div { display:flex; justify-content:flex-end; gap:10px; }
.gallery-delete-dialog .gallery-danger { background:#b82f43; color:#fff; border-color:#b82f43; }
.gallery-detail { position:fixed; inset:0; width:min(1200px,calc(100vw - 64px)); max-width:none; max-height:calc(100dvh - 64px); padding:0; border:0; border-radius:16px; background:#fff; color:var(--fg); }
.gallery-detail::backdrop { background:#050d1dd9; }
.gallery-detail-top { display:flex; align-items:center; justify-content:flex-end; gap:8px; padding:6px 12px; border-bottom:1px solid var(--bd); }
.gallery-detail-top>button { border:0; background:transparent; min-width:44px; min-height:44px; color:var(--fg); cursor:pointer; font-size:20px; }
#gallery-detail-close { order:4; }
#gallery-detail-position { margin-right:auto; font-size:14px; }
.gallery-detail-inner { display:grid; grid-template-columns:minmax(0,1fr) 340px; min-height:420px; }
.gallery-detail-stage { position:relative; display:grid; place-items:center; min-width:0; min-height:420px; background:#0b111c; touch-action:pan-y; }
#gallery-detail-media { width:100%; }
#gallery-detail-media:empty { display:none; }
#gallery-detail-media img,#gallery-detail-media video,#wallet-detail-media img,#wallet-detail-media video { display:block; width:100%; max-height:70dvh; height:auto; object-fit:contain; }
.gallery-detail-stage>button { position:absolute; top:50%; transform:translateY(-50%); border:0; border-radius:50%; width:44px; height:44px; background:#ffffffde; color:#15243a; cursor:pointer; font-size:28px; }
.gallery-detail-prev { left:12px; }.gallery-detail-next { right:12px; }
.gallery-detail-info { padding:22px; max-height:calc(100dvh - 120px); overflow:auto; min-width:0; }
.gallery-detail-title { display:flex; align-items:flex-start; gap:8px; justify-content:space-between; }
.gallery-detail-title h2 { margin:0; font-size:18px; line-height:1.4; }
#gallery-detail-counter { font-size:13px; white-space:nowrap; color:var(--mut); }
.gallery-detail-info h3 { margin:20px 0 8px; color:var(--mut); font-size:12px; font-weight:500; }
#wallet-detail-prompt { margin:0; white-space:pre-wrap; overflow-wrap:anywhere; line-height:1.6; font-size:14px; }
.gallery-detail-info dl { font-size:13px; margin:20px 0; }
.gallery-detail-info dl>div { display:flex; justify-content:space-between; gap:12px; margin:8px 0; }
.gallery-detail-info dt { color:var(--mut); }.gallery-detail-info dd { margin:0; }
.gallery-detail-tools { display:flex; gap:6px; flex-wrap:wrap; margin-bottom:16px; }
.gallery-detail-tools .btn { flex:1; padding:8px 10px; font-size:13px; min-height:44px; }
.gallery-detail-info>.btn { width:100%; margin-top:10px; min-height:44px; }
.gallery-detail-info>small { display:block; font-size:12px; color:var(--mut); margin:8px 0 16px; }
#gallery-detail-error { color:#b52c40; font-size:13px; }
@media (max-width:769px) {
 .gallery-redesign { padding-bottom:150px; }
 .gallery-heading h1 { font-size:24px; }
 .gallery-filter-row { gap:8px; }
 .gallery-filter-row .wallet-seg { width:100%; display:flex; }
 .gallery-filter-row .wallet-seg button { flex:1; min-width:0; padding:6px; font-size:13px; }
 .gallery-select-button { margin-left:0; width:100%; }
 .wallet-gallery.gallery-grid,.gallery-legacy-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
 .gallery-card { border-radius:9px; }
 .gallery-kind-badge { left:6px; bottom:6px; padding:3px 5px; font-size:11px; gap:4px; }
 .gallery-kind-badge svg { width:14px; height:14px; }
 .gallery-hover-actions,.gallery-check { display:none!important; }
 .gallery-redesign.is-selecting .gallery-check { display:block!important; opacity:1; }
 .gallery-redesign.is-selecting .gallery-heading,.gallery-redesign.is-selecting .gallery-select-button { display:none; }
 .gallery-redesign.is-selecting .gallery-mobile-selection { display:flex; align-items:center; gap:8px; justify-content:space-between; min-height:56px; position:sticky; top:72px; z-index:20; background:#f4f7fc; margin-bottom:12px; }
 .gallery-mobile-selection button { min-height:44px; padding:8px; border:0; background:transparent; color:var(--fg); }
 .gallery-selection-bar { bottom:0; left:0; transform:none; width:100%; border-radius:16px 16px 0 0; padding:12px 12px calc(12px + env(safe-area-inset-bottom)); }
 .gallery-selection-summary { display:none; }
 .gallery-selection-actions { gap:6px; }
 .gallery-selection-actions .btn { display:flex; flex-direction:column; gap:3px; padding:6px 2px; font-size:12px; min-height:56px; }
 .gallery-action-menu { top:auto!important; bottom:0!important; left:0!important; max-width:none; width:100%; border-radius:20px 20px 0 0; padding:22px 12px calc(14px + env(safe-area-inset-bottom)); }
 .gallery-action-menu::backdrop { background:#10203d88; }
 #gallery-menu-items button { min-height:60px; }
 .gallery-detail { width:100%; height:100dvh; max-height:100dvh; margin:0; border-radius:0; }
 .gallery-detail-top { position:sticky; top:0; background:#fff; z-index:3; padding-top:env(safe-area-inset-top); }
 #gallery-detail-close { order:0; }
 #gallery-detail-position { margin-left:8px; }
 .gallery-detail-inner { grid-template-columns:minmax(0,1fr); min-height:0; }
 .gallery-detail-stage { min-height:240px; }
 .gallery-detail-stage>button { display:none; }
 #wallet-detail-media img,#wallet-detail-media video { max-height:44dvh; }
 .gallery-detail-info { max-height:none; overflow:visible; padding:20px 16px calc(24px + env(safe-area-inset-bottom)); }
 .gallery-detail-title h2 { font-size:16px; }
}

.gallery-redesign .gallery-heading { background: transparent; color: var(--text, #19304e); border: 0; padding: 0; }

/* Desktop gallery filters: one line per label, content-sized buttons, one shared height. */
@media (min-width:770px) {
 .gallery-filter-row .wallet-seg { align-items:stretch; gap:2px; }
 .gallery-filter-row .wallet-seg button { flex:0 0 auto; min-width:64px; min-height:40px; padding:0 16px; white-space:nowrap; line-height:1.2; }
}
