* {
  box-sizing: border-box;
}

:root {
  --radius-card: 16px;
  --radius-button: 14px;
  --radius-control: 12px;
}

/* Author display rules have repeatedly beaten the UA hidden rule on
   toggled forms/sheets, so make hidden an app-wide hard collapse. */
[hidden] {
  display: none !important;
}

/* Every theme owns its primary gradient so background shorthands cannot fall
   through to a later background-color declaration from another token. */

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page-bg, #f3f4f6);
  color: var(--text, #111827);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei",
    sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

.app {
  width: min(100%, 480px);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--app-bg, #fff);
}

.app:has(.selected-guest-panel) {
  width: 100%;
  max-width: none;
}

.app.display-app {
  width: 100%;
  max-width: none;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  background: var(--page-bg, #eef6fc);
}

.app.live-deck-app {
  width: 100%;
  max-width: none;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

.nav {
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary, #111827);
  color: var(--primary-contrast, #fff);
  font-weight: 750;
}

.page {
  padding: 22px 18px calc(28px + env(safe-area-inset-bottom));
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--muted, #6b7280);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 16px;
  font-size: 24px;
  line-height: 1.2;
}

.muted {
  color: var(--muted, #4b5563);
  line-height: 1.55;
}

.compact {
  margin-top: -6px;
  margin-bottom: 18px;
}

.hint {
  margin: 6px 0 0;
  color: var(--muted, #6b7280);
  font-size: 13px;
  line-height: 1.45;
}

.notice {
  margin-top: 18px;
  padding: 12px;
  border-radius: 8px;
  background: var(--soft, #f3f4f6);
  color: var(--text, #374151);
  line-height: 1.5;
  font-size: 14px;
}

.surface-band {
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  background: var(--surface, #fff);
}

.privacy-strip {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 14px 0 0;
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--success-soft, #e7f6f1);
  color: var(--text, #111827);
  font-size: 13px;
  line-height: 1.45;
}

.privacy-strip strong {
  flex: 0 0 auto;
  min-width: 32px;
  color: var(--success, #166534);
  white-space: nowrap;
}

.sticky-actions {
  position: sticky;
  bottom: 0;
  z-index: 3;
  margin: 18px -18px calc(-28px - env(safe-area-inset-bottom));
  padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border, #e5e7eb);
  background: var(--app-bg, #fff);
  background: color-mix(in srgb, var(--app-bg, #fff) 92%, transparent);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  margin-bottom: 12px;
}

.matchmaker-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  color: var(--text, #374151);
  font-weight: 700;
}

.mic-ready-host {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.mic-ready-host .avatar {
  width: 56px;
  height: 56px;
  margin: 0;
}

.mic-ready-host span {
  display: block;
  color: var(--muted, #6b7280);
  font-size: 13px;
}

.mic-ready-host strong {
  display: block;
  margin-top: 2px;
  color: var(--text, #111827);
  font-size: 16px;
}

.matchmaker-profile .avatar {
  width: 56px;
  height: 56px;
  margin: 0;
}

.field {
  margin-bottom: 16px;
}

.grid-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.money-grid {
  align-items: start;
}

.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  min-height: 44px;
  border: 1px solid var(--border, #d1d5db);
  border-radius: 999px;
  padding: 8px 12px;
  background: #fff;
  color: var(--text, #111827);
}

.chip.selected {
  border-color: var(--primary, #111827);
  background: var(--primary, #111827);
  color: var(--primary-contrast, #fff);
}

.quick-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.choice-group-label {
  margin-top: 10px;
  color: #6b7280;
  font-size: 13px;
  font-weight: 750;
}

.quick-chip {
  min-height: 44px;
  border: 1px solid var(--border, #d1d5db);
  border-radius: 999px;
  padding: 8px 12px;
  background: var(--surface, #fff);
  color: var(--text, #374151);
  font-size: 14px;
}

.quick-chip.selected {
  border-color: var(--primary, #111827);
  background: var(--primary, #111827);
  color: var(--primary-contrast, #fff);
}

.quick-chip:disabled {
  opacity: 0.58;
  cursor: progress;
}

.asset-builder {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.asset-builder span {
  color: var(--text, #111827);
  font-weight: 800;
}

.asset-builder .input {
  text-align: center;
}

.segmented-choice {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.goal-choice {
  grid-template-columns: 1fr;
}

.theme-choice {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.segmented-choice label {
  display: block;
}

.segmented-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented-choice span {
  display: grid;
  min-height: 44px;
  place-items: center;
  border: 1px solid var(--border, #d1d5db);
  border-radius: 8px;
  background: var(--surface, #fff);
  color: var(--text, #111827);
  font-weight: 750;
}

.segmented-choice input:checked + span {
  border-color: var(--primary, #111827);
  background: var(--primary, #111827);
  color: var(--primary-contrast, #fff);
}

.label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  color: var(--text, #374151);
  font-size: 14px;
}

.label em {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  font-style: normal;
  font-weight: 750;
}

.label .required {
  background: #fee2e2;
  color: #991b1b;
}

.label .optional {
  background: var(--soft, #f3f4f6);
  color: var(--muted, #6b7280);
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--border, #d1d5db);
  border-radius: 8px;
  padding: 9px 10px;
  background: var(--surface, #fff);
  color: var(--text, #111827);
}

.input-unit-wrap {
  position: relative;
}

/* .mic-row-field .input resets padding via shorthand later in the file;
   the extra selector depth keeps the unit clearance winning there too. */
.input-unit-wrap .input,
.mic-row-field .input-unit-wrap .input {
  padding-right: 60px;
}

/* Chip, not text: must read as a fixed control, distinct from placeholder grey. */
.input-unit {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  padding: 2px 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted, #6b7280) 12%, transparent);
  color: color-mix(in srgb, var(--muted, #6b7280) 60%, var(--text, #111827));
  font-size: 12px;
  font-weight: 700;
  pointer-events: none;
}

.textarea {
  min-height: 132px;
  resize: vertical;
}

.textarea.short {
  min-height: 84px;
}

.field.invalid .input,
.field.invalid .select,
.field.invalid .textarea,
.field.invalid .file-upload,
.field.invalid .segmented-choice span {
  border-color: #ef4444;
  box-shadow: 0 0 0 2px #fee2e2;
}

.field-error {
  margin: 6px 0 0;
  color: #991b1b;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.4;
}

.file-upload {
  position: relative;
  display: flex;
  min-height: 168px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  overflow: hidden;
  border: 1px dashed var(--accent, #9ca3af);
  border-radius: 8px;
  padding: 18px;
  background: var(--soft, #f9fafb);
  color: var(--text, #374151);
  text-align: center;
}

.file-upload input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.file-upload span {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 999px;
  background: var(--primary, #111827);
  color: var(--primary-contrast, #fff);
  font-size: 28px;
  font-weight: 750;
  line-height: 1;
}

.file-upload strong {
  max-width: 100%;
  overflow: hidden;
  color: var(--text, #111827);
  font-size: 15px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-upload small {
  color: var(--muted, #6b7280);
  font-size: 13px;
}

.file-upload.has-photo {
  min-height: 220px;
  border-style: solid;
  background-image:
    linear-gradient(rgba(17, 24, 39, 0.22), rgba(17, 24, 39, 0.22)),
    var(--photo-url);
  background-position: center;
  background-size: cover;
  color: #fff;
}

.file-upload.has-photo strong,
.file-upload.has-photo small {
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
}

.file-upload.has-photo .upload-plus {
  background: rgba(17, 24, 39, 0.78);
}

.button {
  width: 100%;
  min-height: 46px;
  border: 0;
  border-radius: var(--radius-button);
  background: var(--primary, #111827);
  color: var(--primary-contrast, #fff);
  font-weight: 750;
}

.button.secondary {
  background: var(--soft, #e5e7eb);
  color: var(--text, #111827);
}

.button:disabled {
  opacity: 0.55;
}

.stack {
  display: grid;
  gap: 12px;
}

.id {
  display: block;
  margin: 12px 0 28px;
  text-align: center;
  font-size: 52px;
  line-height: 1;
  font-weight: 850;
}

.center {
  text-align: center;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft);
  padding: 14px;
  color: var(--text);
}

.row {
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
  background: var(--surface, #fff);
}

.row {
  width: 100%;
  color: inherit;
  font: inherit;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.live-row {
  margin-bottom: 0;
  border-right: 0;
  border-left: 0;
  border-radius: 0;
  padding: 12px 0;
}

.live-row:first-child {
  border-top: 1px solid var(--border, #e5e7eb);
}

.thumb {
  width: 56px;
  height: 56px;
  border-radius: 6px;
  object-fit: cover;
  flex: 0 0 56px;
}

.thumb-placeholder {
  display: grid;
  place-items: center;
  border: 1px solid var(--border, #e5e7eb);
  background: var(--soft, #f3f4f6);
  color: var(--muted, #6b7280);
  font-size: 12px;
  font-weight: 850;
}

.live-card-photo {
  width: 112px;
  height: 140px;
  border-radius: 8px;
  background: var(--soft, #f3f4f6);
  object-fit: cover;
}

.live-card-photo-empty {
  display: grid;
  place-items: center;
  color: var(--muted, #6b7280);
  font-weight: 800;
}

.live-card-photo-strip {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 164px;
}

.live-card-photo-strip .mic-photo-thumb {
  min-height: 76px;
  border-radius: 10px;
}

.date-input-shell {
  position: relative;
  min-width: 0;
}

.date-input-shell .input {
  position: relative;
  z-index: 1;
  width: 100%;
  background: transparent;
}

.date-placeholder {
  position: absolute;
  top: 50%;
  right: 44px;
  z-index: 0;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 17px;
  font-weight: 760;
  line-height: 1;
  pointer-events: none;
  white-space: nowrap;
}

.date-input-shell.has-value .date-placeholder,
.date-input-shell:focus-within .date-placeholder {
  display: none;
}

.detail-list {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.detail-list p {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 10px;
  margin: 0;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.detail-list span {
  color: var(--muted, #6b7280);
}

.detail-list p.detail-long {
  grid-template-columns: 1fr;
  gap: 4px;
  border-top: 1px solid var(--border, #e5e7eb);
  padding-top: 10px;
  white-space: pre-wrap;
}

.detail-list p.detail-long:first-child {
  border-top: 0;
  padding-top: 0;
}

.profile-detail-list {
  border-top: 1px solid var(--border, #e5e7eb);
  padding-top: 14px;
}

.contact-panel {
  display: grid;
  gap: 10px;
  margin: 0 0 16px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  padding: 12px;
  background: var(--soft, #f3f4f6);
}

.contact-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.contact-panel span {
  color: var(--muted, #6b7280);
  font-size: 13px;
  font-weight: 750;
}

.contact-panel strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 18px;
}

.safety-review-strip {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 16px;
  border: 1px solid rgba(185, 28, 51, 0.24);
  border-radius: var(--radius-card);
  padding: 12px 14px;
  background: #fff6f6;
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
}

.safety-review-strip strong {
  flex: 0 0 auto;
  color: var(--primary);
  font-weight: 850;
}

.safety-review-strip.compact {
  margin: 6px 0 0;
  padding: 8px 10px;
  font-size: 12px;
}

.contact-copy {
  min-height: 44px;
  border: 1px solid var(--primary, #111827);
  border-radius: 8px;
  padding: 8px 12px;
  background: var(--primary, #111827);
  color: var(--primary-contrast, #fff);
  font-size: 14px;
  font-weight: 850;
}

.contact-field {
  margin-top: 18px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  padding: 12px;
  background: var(--soft, #f3f4f6);
}

.strong {
  display: block;
  font-weight: 750;
}

.error {
  padding: 10px 12px;
  border-radius: 8px;
  background: #fee2e2;
  color: #991b1b;
  line-height: 1.4;
}

.ok {
  padding: 10px 12px;
  border-radius: 8px;
  background: #dcfce7;
  color: #166534;
}

[aria-live].is-fading {
  opacity: 0;
  transition: opacity 300ms ease;
}

.warn {
  padding: 10px 12px;
  border-radius: 8px;
  background: #fef3c7;
  color: #92400e;
  line-height: 1.4;
}

.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 18px;
}

.toolbar .input {
  flex: 1;
}

.live-remote {
  max-width: 560px;
  margin: 0 auto;
}

.live-remote:has(.selected-guest-panel) {
  max-width: 1160px;
}

.live-operator-topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(380px, 460px);
  align-items: start;
  gap: 12px;
  margin-bottom: 12px;
}

.live-operator-topbar .live-command-header,
.live-operator-topbar .live-workspace-panel {
  margin: 0;
}

.live-session-command {
  display: grid;
  gap: 8px;
}

.live-session-command .live-workspace-panel {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.live-session-command .live-workspace-heading {
  align-items: center;
  gap: 8px;
}

.live-session-command .live-workspace-heading h2 {
  margin: 0;
  font-size: 16px;
}

.live-session-command .live-workspace-heading .eyebrow,
.live-session-command .live-workspace-heading .muted {
  display: none;
}

.live-session-command .live-workspace-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.live-session-command .live-workspace-actions .button,
.live-session-command .live-logout-button {
  min-height: 42px;
  padding: 8px 10px;
}

.live-session-command .live-workspace-code:not(:empty) {
  padding: 8px;
  font-size: clamp(26px, 4.4vw, 38px);
  letter-spacing: 0.08em;
}

@media (max-width: 900px) {
  .live-operator-topbar {
    grid-template-columns: minmax(0, 1fr);
  }
}
.live-command-header {
  display: grid;
  gap: 6px;
  margin-bottom: 16px;
}

.live-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.live-command-header h1 {
  margin-bottom: 4px;
}

.live-title-row h1 {
  margin: 0;
}

.live-command-header .muted {
  margin: 0;
}

.live-deck-command {
  min-height: 0;
}

.live-deck-command {
  display: grid;
  align-content: start;
  gap: 10px;
  overflow: hidden;
}

.selected-guest-panel {
  margin: 0 0 16px;
}

.live-note-form {
  display: grid;
  min-height: 0;
  gap: 10px;
}

.live-note-panel {
  overflow: hidden;
}

.live-note-panel .quick-row {
  gap: 6px;
}

.live-note-panel .quick-chip {
  min-height: 44px;
  padding: 7px 10px;
}

.live-note-textarea {
  min-height: 74px;
  max-height: 112px;
  resize: none;
}

.handwriting-panel {
  display: grid;
  gap: 8px;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 10px;
  background: var(--surface);
}

.handwriting-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.handwriting-toolbar strong {
  display: block;
  margin-top: 2px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.2;
}

.handwriting-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
}

.handwriting-actions .button {
  min-height: 34px;
  padding: 7px 9px;
  font-size: 13px;
}

.handwriting-canvas {
  display: block;
  width: 100%;
  aspect-ratio: 1000 / 360;
  border: 1px solid var(--border);
  border-radius: 8px;
  background:
    linear-gradient(rgba(15, 23, 42, 0.04) 1px, transparent 1px),
    #fffefc;
  background-size: 100% 33.333%;
  cursor: crosshair;
  touch-action: none;
}

.handwriting-status {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.guest-monetization-panel {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 12px;
  background: var(--surface);
  text-align: left;
}

.guest-monetization-panel strong {
  display: block;
  margin-top: 2px;
  color: var(--text);
  font-size: 16px;
}

.guest-monetization-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.guest-concierge-form {
  display: grid;
  gap: 8px;
}

.account-card {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 12px;
  background: var(--surface);
  text-align: left;
}

.account-card > strong,
.account-card strong {
  color: var(--text);
  font-size: 16px;
  line-height: 1.35;
}

.account-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.account-card-actions .button {
  flex: 1 1 auto;
}

.account-card-actions .text-link {
  flex: 0 0 auto;
  white-space: nowrap;
  padding: 0 12px;
}

.loading-inline {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.loading-inline::before {
  display: inline-grid;
  width: 16px;
  height: 16px;
  place-items: center;
  flex: 0 0 16px;
  content: "…";
  color: currentColor;
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
}

@media (prefers-reduced-motion: no-preference) {
  .loading-inline::before {
    border-radius: 50%;
    background: currentColor;
    content: "";
    animation: loadingInlinePulse 900ms ease-in-out infinite alternate;
  }

  @keyframes loadingInlinePulse {
    from {
      opacity: 0.25;
    }

    to {
      opacity: 0.9;
    }
  }
}

.account-inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.web-login-qr {
  margin: 18px 0 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 18px;
  background: var(--surface);
  text-align: center;
}

.web-login-qr h2 {
  margin: 0 0 14px;
  font-size: 19px;
}

.web-login-qr-frame {
  display: grid;
  width: min(100%, 238px);
  min-height: 238px;
  margin: 0 auto 12px;
  place-items: center;
  border-radius: 12px;
  background: var(--soft);
}

.web-login-qr-frame img {
  width: 220px;
  max-width: calc(100% - 18px);
  aspect-ratio: 1;
  border-radius: 8px;
  background: #fff;
  object-fit: contain;
}

.web-login-qr .muted,
.web-login-qr-status {
  margin: 7px 0 0;
}

.web-login-qr-status {
  min-height: 24px;
  color: var(--text);
  font-weight: 800;
}

.web-login-qr-refresh {
  margin-top: 12px;
}

.web-login-qr-fallback {
  margin: 0;
}

.web-login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.web-login-divider::before,
.web-login-divider::after {
  flex: 1;
  height: 1px;
  background: var(--border);
  content: "";
}

.text-link {
  min-height: 44px;
  border: 0;
  background: transparent;
  color: var(--primary);
  font: inherit;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.recovery-code-once {
  display: grid;
  gap: 8px;
  border: 1px solid color-mix(in srgb, var(--success) 34%, var(--border));
  border-radius: var(--radius-card);
  padding: 12px;
  background: var(--success-soft);
}

.recovery-code-once strong {
  font-size: 28px;
  letter-spacing: 0;
}

.relationship-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

.relationship-row span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.relationship-row > div {
  min-width: 0;
}

.relationship-row .button {
  flex: 0 0 auto;
  width: auto;
  min-height: 40px;
  padding: 8px 12px;
}

.monetization-workbench {
  margin-top: 14px;
}

.monetization-workbench .concierge-heading {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.monetization-row {
  align-items: center;
}

.monetization-row span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.live-alias-grid {
  gap: 8px;
}

.live-alias-grid .input,
.live-alias-grid .button {
  min-height: 44px;
}

.live-command-actions {
  display: grid;
  gap: 8px;
}

.live-command-actions-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.live-note-form .alias-list:empty,
.live-command-actions .alias-list:empty {
  display: none;
}

@media (max-width: 720px) {

  .live-deck-command {
    overflow: auto;
    overscroll-behavior: contain;
    padding-bottom: 2px;
  }
}

.live-search {
  position: sticky;
  top: 0;
  z-index: 2;
  margin: -10px -4px 14px;
  padding: 10px 4px;
  background: var(--app-bg, #fff);
}

.live-search {
  border-bottom: 1px solid var(--border, #e5e7eb);
}

.bucket-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 14px 0 4px;
}

.bucket-tab {
  min-height: 44px;
  border: 1px solid var(--border, #d1d5db);
  border-radius: 8px;
  background: var(--surface, #fff);
  color: var(--text, #111827);
  font-weight: 750;
}

.bucket-tab.selected {
  border-color: var(--primary, #111827);
  background: var(--primary, #111827);
  color: var(--primary-contrast, #fff);
}

.status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.live-status {
  margin: 0 0 14px;
}

.status-badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  background: var(--soft, #f3f4f6);
  color: var(--text, #374151);
  font-size: 12px;
  font-weight: 750;
}

.quick-panel {
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  padding: 10px;
  background: var(--soft, #f3f4f6);
}

.quick-panel .choice-group-label {
  margin: 0 0 8px;
}

.scoring-panel {
  display: grid;
  gap: 12px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--primary) 10%, var(--surface)), var(--surface));
}

.scoring-heading,
.scoring-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.scoring-heading strong {
  display: block;
  font-size: 16px;
}



.score-preview {
  --stamp-accent: var(--primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 88px;
  border: 1px solid color-mix(in srgb, var(--stamp-accent) 24%, var(--border));
  border-radius: 10px;
  padding: 16px 18px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--stamp-accent) 7%, var(--surface)), var(--surface));
  color: var(--stamp-accent);
}

.score-preview span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
}

.score-preview strong {
  display: block;
  color: var(--stamp-accent);
  font-size: 52px;
  line-height: 1;
  font-weight: 950;
}

.score-preview small {
  border: 1px solid color-mix(in srgb, var(--stamp-accent) 28%, var(--border));
  border-radius: 999px;
  padding: 8px 12px;
  background: color-mix(in srgb, var(--stamp-accent) 8%, var(--surface));
  color: color-mix(in srgb, var(--stamp-accent) 82%, var(--text));
  font-size: 15px;
  font-weight: 900;
  white-space: nowrap;
}

.score-preview.is-exciting {
  border-color: color-mix(in srgb, var(--stamp-accent) 58%, var(--border));
  background: linear-gradient(135deg, color-mix(in srgb, var(--stamp-accent) 12%, var(--surface)), var(--surface));
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--stamp-accent) 16%, transparent),
    0 12px 28px color-mix(in srgb, var(--stamp-accent) 10%, transparent);
}


.stamp-burst {
  position: absolute;
  inset: 10%;
  z-index: 0;
  border-radius: 50%;
  background:
    repeating-conic-gradient(from -12deg, color-mix(in srgb, var(--stamp-hot) 72%, transparent) 0 7deg, transparent 7deg 15deg),
    radial-gradient(circle, color-mix(in srgb, var(--stamp-accent) 20%, transparent), transparent 62%);
  opacity: 0.34;
  transform: rotate(-10deg) scale(1.05);
}

.stamp-level-low {
  --stamp-accent: #64748b;
  --stamp-hot: #cbd5e1;
}

.stamp-level-standard {
  --stamp-accent: #2563eb;
  --stamp-hot: #93c5fd;
}

.stamp-level-exciting {
  --stamp-accent: #ff365f;
  --stamp-hot: #ffd166;
}

.stamp-level-strong {
  --stamp-accent: #e11d48;
  --stamp-hot: #fbbf24;
}

.stamp-level-spotlight {
  --stamp-accent: #c026d3;
  --stamp-hot: #fb7185;
}

.stamp-level-rare {
  --stamp-accent: #7c3aed;
  --stamp-hot: #facc15;
}

.stamp-level-mythic {
  --stamp-accent: #0f172a;
  --stamp-hot: #f59e0b;
}

.score-dial {
  display: grid;
  grid-template-columns: minmax(96px, 1fr) minmax(130px, 1.2fr) minmax(96px, 1fr);
  gap: 12px;
  align-items: center;
  border: 1px solid color-mix(in srgb, var(--primary) 18%, var(--border));
  border-radius: 12px;
  padding: 10px;
  background: color-mix(in srgb, var(--primary) 5%, var(--surface));
}

.score-step {
  min-height: 62px;
  border: 1px solid color-mix(in srgb, var(--primary) 24%, var(--border));
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 22px;
  font-weight: 950;
}

.score-step:active {
  transform: translateY(1px) scale(0.99);
}

.score-control-value {
  display: grid;
  place-items: center;
  min-height: 62px;
  border: 1px solid color-mix(in srgb, var(--primary) 34%, var(--border));
  border-radius: 8px;
  background:
    radial-gradient(circle at center, color-mix(in srgb, var(--primary) 12%, transparent), transparent 62%),
    var(--surface);
  text-align: center;
}

.score-control-value span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.score-control-value strong {
  color: var(--primary);
  font-size: 32px;
  line-height: 1;
  font-weight: 950;
}

.score-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.score-chip {
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-weight: 900;
}

.score-chip.selected {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--primary-contrast);
}

.score-chip.is-exciting:not(.selected) {
  border-color: color-mix(in srgb, var(--stamp-accent, var(--primary)) 34%, var(--border));
  background: color-mix(in srgb, var(--stamp-accent, var(--primary)) 7%, var(--surface));
  color: color-mix(in srgb, var(--stamp-accent, var(--primary)) 76%, var(--text));
}

.scoring-actions .button {
  flex: 1 1 0;
}

.matchmaker-profile-panel {
  display: grid;
  gap: 12px;
}

.matchmaker-profile-copy {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.matchmaker-profile-copy span {
  max-width: 210px;
  color: var(--muted, #6b7280);
  font-size: 13px;
  line-height: 1.45;
  text-align: right;
}

.matchmaker-avatar-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.matchmaker-avatar-preview {
  width: 64px;
  height: 64px;
  display: block;
  border: 2px solid #fff;
  border-radius: 50%;
  background:
    linear-gradient(135deg, #ff6a78, #d9364a);
  box-shadow: 0 10px 22px rgba(255, 61, 82, 0.18);
  object-fit: cover;
}

.matchmaker-avatar-fallback {
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 24px;
  font-weight: 900;
}

.matchmaker-avatar-action {
  display: grid;
  min-height: 46px;
  place-items: center;
  border: 1px solid rgba(255, 61, 82, 0.22);
  border-radius: 12px;
  background: #fff;
  color: var(--primary, #ff3d52);
  font-size: 15px;
  font-weight: 850;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(31, 34, 43, 0.04);
}

.matchmaker-avatar-action input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.quick-label-secondary {
  padding-top: 8px;
  border-top: 1px solid var(--border, #e5e7eb);
}

.settings-panel {
  margin-top: 18px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  background: var(--surface, #fff);
}

.settings-panel summary {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-radius: var(--radius-button);
  padding: 12px 14px;
  color: var(--text, #111827);
  font-weight: 850;
  cursor: pointer;
  list-style: none;
}

.settings-panel summary::-webkit-details-marker {
  display: none;
}

.settings-panel summary::after {
  content: '+';
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--soft, #f3f4f6);
  color: var(--text, #111827);
  font-size: 18px;
  line-height: 1;
}

.settings-panel[open] summary {
  border-bottom: 1px solid var(--border, #e5e7eb);
}

.settings-panel[open] summary::after {
  content: '-';
}

.settings-panel-content {
  display: grid;
  gap: 12px;
  padding: 12px;
}

.assistant-panel {
  display: grid;
  gap: 10px;
}

.panel-heading-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.assistant-create {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px 96px;
  gap: 8px;
  align-items: center;
}

.assistant-create select.input {
  height: 44px;
  min-height: 44px;
  line-height: 1.2;
}

.assistant-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  padding: 10px;
  background: linear-gradient(180deg, var(--surface, #fff), var(--soft, #f7faf9));
}

.assistant-info {
  display: grid;
  gap: 6px;
}

.assistant-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.assistant-role-pill,
.assistant-status-pill {
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 850;
}

.assistant-role-pill {
  background: #eaf4f7;
  color: #24516d;
}

.assistant-status-pill {
  background: #e9f8ef;
  color: #17633f;
}

.assistant-row.disabled .assistant-status-pill {
  background: #f5eeee;
  color: #8b2f2f;
}

.assistant-row.disabled {
  opacity: 0.68;
}

.assistant-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.assistant-action {
  min-height: 44px;
  min-width: 86px;
  border: 1px solid var(--border, #d1d5db);
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--surface, #fff);
  color: var(--text, #111827);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.15;
  text-align: center;
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.1);
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.15s ease;
}

.assistant-action:active {
  transform: translateY(1px);
  box-shadow: 0 0 0 rgb(15 23 42 / 0);
}

.assistant-action:focus-visible {
  outline: 3px solid rgb(16 185 129 / 0.25);
  outline-offset: 2px;
}

.assistant-action-role {
  border-color: #b9d6e6;
  background: #eef8fd;
  color: #24516d;
}

.assistant-action-danger {
  border-color: #f1c7c7;
  background: #fff1f1;
  color: #9f3434;
}

.assistant-create .button {
  min-height: 44px;
  padding: 8px;
}

@media (max-width: 520px) {
  .assistant-create,
  .assistant-row {
    grid-template-columns: 1fr;
  }

  .assistant-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .assistant-action {
    min-width: 0;
  }
}

.alias-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 76px;
  gap: 8px;
}

.alias-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.alias-list span {
  border-radius: 999px;
  padding: 3px 8px;
  background: var(--soft, #f3f4f6);
  color: var(--muted, #4b5563);
  font-size: 12px;
}

.board-page {
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  padding:
    max(clamp(16px, 3vw, 42px), env(safe-area-inset-top))
    max(clamp(16px, 3vw, 42px), env(safe-area-inset-right))
    max(clamp(16px, 3vw, 42px), env(safe-area-inset-bottom))
    max(clamp(16px, 3vw, 42px), env(safe-area-inset-left));
  background-color: var(--app-bg, #fffdfb);
  background-image:
    linear-gradient(180deg, rgb(255 255 255 / 0.76), rgb(255 255 255 / 0.18)),
    linear-gradient(145deg, var(--soft, #fff0ed), var(--page-bg, #fff7f5));
  color: var(--text, #132238);
}

.display-waiting-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: clamp(24px, 6vw, 72px);
}

.display-waiting-card {
  container-type: inline-size;
  width: min(100%, 720px);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: clamp(28px, 6vw, 56px);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  text-align: center;
}

.display-waiting-card h1 {
  margin: 0 0 12px;
  font-size: clamp(42px, 8vw, 84px);
  line-height: 0.98;
}

.display-handwriting-readonly {
  min-height: 96px;
  overflow: hidden;
  border: 1px dashed color-mix(in srgb, var(--primary, #be123c) 28%, var(--border, #f0d9d7));
  border-radius: 8px;
  background: rgb(255 255 255 / 0.76);
}

.display-handwriting-readonly svg {
  display: block;
  width: 100%;
  height: 100%;
}

.status-badge.live-on-mic {
  border-color: #16a34a;
  background: #dcfce7;
  color: #166534;
}

@media (max-width: 520px) {

}

@keyframes boardStampSlam {
  0% {
    opacity: 0;
    transform: translateY(-42px) scale(1.35) rotate(calc(var(--stamp-tilt, -10deg) - 7deg));
    filter: blur(3px);
  }
  45% {
    opacity: 1;
    transform: translateY(8px) scale(0.9) rotate(var(--stamp-tilt, -10deg));
    filter: blur(0);
  }
  62% {
    transform: translateY(0) scale(1.05) rotate(var(--stamp-tilt, -10deg));
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1) rotate(var(--stamp-tilt, -10deg));
  }
}

@keyframes stampRays {
  to {
    transform: rotate(360deg);
  }
}







@media (min-width: 701px) and (max-height: 820px) {
  .board-page {
    padding:
      max(12px, env(safe-area-inset-top))
      max(12px, env(safe-area-inset-right))
      max(12px, env(safe-area-inset-bottom))
      max(12px, env(safe-area-inset-left));
  }






















}

@media (max-width: 700px) {
  .board-page {
    overflow-y: auto;
    padding:
      max(16px, env(safe-area-inset-top))
      max(16px, env(safe-area-inset-right))
      max(28px, env(safe-area-inset-bottom))
      max(16px, env(safe-area-inset-left));
  }









}

@media (min-width: 701px) and (max-width: 1100px) and (min-height: 821px) {
}

/* =========================================================
   Editorial overhaul — Tokyo Calendar–inspired presentation layer.
   Overrides earlier rules by source order. No class names or DOM
   structure are changed, so app.js routing and e2e selectors are
   unaffected; this only retunes palettes + typography + chrome.
   ========================================================= */

:root {
  --display: "Songti SC", "STSong", "Source Han Serif SC", "Noto Serif SC",
    Georgia, "Times New Roman", serif;
}

/* --- Retuned, more editorial palettes (same semantic variables) --- */
/* @generated theme-tokens BEGIN */
.theme-romance {
  --page-bg: #fff7f5;
  --app-bg: #fffdfb;
  --surface: #ffffff;
  --surface-raised: #fff8f6;
  --soft: #fff0ed;
  --primary: #d84f5f;
  --primary-contrast: #fff;
  --accent: #b93449;
  --accent-soft: rgba(185, 52, 73, 0.16);
  --brand-grad: linear-gradient(135deg, #d11a4e 0%, #c0492f 100%);
  --brand-grad-vivid: linear-gradient(120deg, #d11a4e 0%, #c0492f 52%, #c47e2e 100%);
  --success: #26856f;
  --success-soft: #e7f6f1;
  --text: #24191b;
  --muted: #766266;
  --border: #f0d9d7;
  --shadow-soft: 0 8px 24px rgba(80, 36, 42, 0.08);
}

.theme-classic {
  --page-bg: #eef1f4;
  --app-bg: #ffffff;
  --surface: #ffffff;
  --soft: #e9eef2;
  --primary: #213340;
  --primary-contrast: #ffffff;
  --accent: #5d7f90;
  --accent-soft: rgba(93, 127, 144, 0.16);
  --text: #182530;
  --muted: #5f707b;
  --border: #d8e0e6;
}

.theme-fresh {
  --page-bg: #eef3ef;
  --app-bg: #fffffd;
  --surface: #ffffff;
  --soft: #e6efe8;
  --primary: #2c5a4b;
  --primary-contrast: #fffffd;
  --accent: #6f9c86;
  --accent-soft: rgba(111, 156, 134, 0.18);
  --text: #1b2a24;
  --muted: #5b6d65;
  --border: #d6e2db;
}

.theme-premium {
  --page-bg: #f3eee4;
  --app-bg: #fffdf8;
  --surface: #fffdf8;
  --soft: #efe6d4;
  --primary: #2b251f;
  --primary-contrast: #fffdf8;
  --accent: #a9853f;
  --accent-soft: rgba(169, 133, 63, 0.16);
  --text: #2b251f;
  --muted: #7c7163;
  --border: #e4d9c4;
}

.theme-tokyo {
  --page-bg: #15171c;
  --app-bg: #1a1d23;
  --surface: #1e2127;
  --soft: #262a32;
  --primary: #c9a24b;
  --primary-contrast: #15171c;
  --accent: #c9a24b;
  --accent-soft: rgba(201, 162, 75, 0.16);
  --text: #f4f1ea;
  --muted: #a8a497;
  --border: #33373f;
}
/* @generated theme-tokens END */

/* Web-only theme integrity overrides. Keep the generated region above aligned
   with its shared source; these gradients belong to the web paint layer. */
.theme-romance {
  --primary: #cf4554;
  --brand-grad: linear-gradient(135deg, #d11a4e 0%, #c0492f 100%);
  --success: #25846e;
}

.theme-classic {
  --brand-grad: linear-gradient(135deg, #213340 0%, #385565 100%);
}

.theme-fresh {
  --brand-grad: linear-gradient(135deg, #245044 0%, #3d6857 100%);
}

.theme-premium {
  --brand-grad: linear-gradient(135deg, #2b251f 0%, #59462f 100%);
}

.theme-tokyo {
  --brand-grad: linear-gradient(135deg, #d2ae58 0%, #b98e35 100%);
}

/* --- Editorial masthead (replaces the heavy solid colour bar) --- */
.nav {
  height: auto;
  justify-content: center;
  padding: 18px 18px 14px;
  background: var(--app-bg);
  color: var(--primary);
  border-bottom: 1px solid var(--border);
  font-family: var(--display);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: 0.34em;
  text-transform: lowercase;
}

.app.display-app .nav {
  background: var(--app-bg);
}

/* --- Typography --- */
h1 {
  font-family: var(--display);
  font-size: 29px;
  font-weight: 600;
  letter-spacing: 0.005em;
  line-height: 1.2;
  margin: 0 0 14px;
}

.eyebrow {
  color: var(--accent);
  letter-spacing: 0.2em;
  font-size: 11px;
}

.muted {
  line-height: 1.62;
}

/* --- Notice / info box: hairline card with an accent rule --- */
.notice {
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  background: var(--soft);
}

/* --- Buttons --- */
.button {
  min-height: 50px;
  border-radius: var(--radius-button);
  font-weight: 600;
  letter-spacing: 0.06em;
  transition:
    opacity 140ms ease,
    transform 140ms ease;
}

.button:active {
  transform: translateY(1px);
}

.button.secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

/* --- Inputs --- */
.input,
.select,
.textarea {
  border-radius: 10px;
  padding: 12px 13px;
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}

/* --- Cards --- */
.row {
  border-radius: 12px;
  padding: 16px;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.03),
    0 10px 26px rgba(40, 30, 15, 0.05);
}

/* --- Big editorial number (success / id screens) --- */
.id {
  font-family: var(--display);
  font-weight: 600;
  font-size: 60px;
  letter-spacing: 0.06em;
  color: var(--primary);
}

/* --- Detail list: labelled rows with hairline separators --- */
.detail-list p {
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}

.detail-list p:last-child {
  border-bottom: 0;
}

.detail-list p.detail-long {
  border-top: 0;
}

.detail-list span {
  font-size: 13px;
  letter-spacing: 0.02em;
}

/* --- Segmented choice / theme picker corners --- */
.segmented-choice span {
  border-radius: 10px;
}

/* --- Theme-aware polish (replace hardcoded greys/badges so every
       theme, including dark, stays coherent) --- */
.label .required {
  background: #fff;
  color: #731120;
}

.label .optional {
  background: var(--soft);
  color: var(--muted);
}

.chip {
  background: var(--surface);
}

.city-group p,
.choice-group-label {
  color: var(--muted);
}

.city-more summary.selected {
  border-color: var(--primary);
  background: var(--soft);
  color: var(--primary);
}

.city-custom {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.city-custom-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.city-custom-row .input {
  min-height: 44px;
}

.city-custom-apply {
  min-height: 44px;
  white-space: nowrap;
}

/* =========================================================
   Tokyo Night — dark editorial theme (the Tokyo Calendar signature
   after dark). Registered in app.js (themeOptions) and the backend
   themeId enum so it persists like the other themes.
   ========================================================= */
/* Photo overlay reads better over the dark surfaces. */
.theme-tokyo .file-upload.has-photo {
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.3)), var(--photo-url);
}











/* =========================================================
   Assistant management pills + actions — theme-aware.
   These were hardcoded pastel blue/purple/pink, which clashed badly
   on the dark theme. Re-expressed through theme variables while
   preserving their semantics (neutral role, accent = active/primary,
   danger = stop). A --danger token carries the only semantic colour.
   ========================================================= */
.theme-romance,
.theme-classic,
.theme-fresh,
.theme-premium {
  --danger: #a23b46;
  --danger-soft: rgba(162, 59, 70, 0.1);
}
.theme-tokyo {
  --danger: #e07a86;
  --danger-soft: rgba(224, 122, 134, 0.16);
}

.assistant-role-pill {
  background: var(--soft);
  color: var(--muted);
}

.assistant-status-pill {
  background: var(--accent-soft);
  color: var(--accent);
}

.assistant-row.disabled .assistant-status-pill {
  background: var(--danger-soft);
  color: var(--danger);
}

.assistant-action:focus-visible {
  outline: 3px solid var(--accent-soft);
}

.assistant-action-role {
  border-color: var(--border);
  background: var(--surface);
  color: var(--text);
}

.assistant-action-danger {
  border-color: var(--danger);
  background: var(--danger-soft);
  color: var(--danger);
}

/* --- Brand wordmark in the masthead (inline SVG; letters follow the theme
       via currentColor, the linked "oo" keeps the gold accent). --- */
.nav .brand-wm {
  display: block;
  height: 22px;
  width: auto;
}

/* Shared navigation polish. */
.theme-romance .nav {
  height: 46px;
  border-bottom: 1px solid rgba(255, 61, 82, 0.1);
  background: color-mix(in srgb, var(--app-bg) 94%, white);
  color: var(--text);
}

.theme-romance .nav .brand-wm {
  height: 18px;
}

/* Brand chrome stays on the fixed piyooo palette; surface themes only skin
   the content below it. */
.nav {
  border-bottom-color: rgb(201 162 75 / 0.28);
  background: #fffdf8;
  color: #15171c;
}

.nav.masthead-compact {
  height: auto;
  min-height: 0;
  padding: 10px 18px 8px;
}

.nav.masthead-compact .brand-wm {
  height: 15px;
}

.theme-tokyo .nav {
  border-bottom-color: rgb(201 162 75 / 0.4);
  background: #15171c;
  color: #f4f1ea;
}

.theme-tokyo .nav .brand-wm {
  color: #f4f1ea;
}

/* =========================================================================
   App-wide brand polish for the guest and matchmaker surfaces.
   ========================================================================= */

/* Primary buttons → gradient pill with a soft glow */
.button {
  border: 0;
  background: var(--brand-grad);
  background-color: var(--primary);
  color: var(--primary-contrast);
  box-shadow: 0 12px 26px -12px color-mix(in srgb, var(--primary) 65%, transparent);
}

.button.secondary {
  border: 0;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--accent);
  box-shadow: none;
}

.button:active {
  transform: translateY(1px) scale(0.99);
}

.button:disabled {
  box-shadow: none;
}

/* Selected nav tabs / chips / segmented choices → gradient
   (score-chips keep their own value-graded colours) */
.bucket-tab.selected,
.chip.selected,
.quick-chip.selected,
.segmented-choice input:checked + span {
  border-color: transparent;
  background: var(--brand-grad);
  background-color: var(--primary);
  color: var(--primary-contrast);
}

/* Rounder shared controls + focus ring in the brand colour */
.input,
.select,
.textarea {
  border-radius: var(--radius-control);
}

.bucket-tab,
.chip,
.quick-chip {
  border-radius: var(--radius-control);
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

:where(button, input, select, textarea, summary, a[href], [role="button"], [role="tab"]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.input:focus-visible,
.select:focus-visible,
.textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 42%, transparent);
}

.display-waiting-card {
  border-radius: var(--radius-card);
}




.live-workspace-panel {
  display: grid;
  gap: 12px;
  margin: 12px 0 18px;
  padding: 14px;
}

.live-workspace-panel h2 {
  margin: 0 0 6px;
  font-size: 18px;
  line-height: 1.2;
}

.live-workspace-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.live-workspace-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.live-workspace-claim-form {
  display: grid;
  gap: 6px;
}

.live-workspace-claim-form > label {
  font-size: 13px;
  font-weight: 850;
}

.live-workspace-claim-form > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(104px, auto);
  gap: 8px;
}

.live-workspace-claim-form .input {
  min-height: 48px;
  text-align: center;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.live-workspace-fallback-label {
  margin: 2px 0 -6px;
}

.live-workspace-code {
  min-height: 0;
  border: 1px dashed var(--border, #d1d5db);
  border-radius: 8px;
  padding: 0;
  color: var(--primary, #111827);
  font-size: 0;
  font-weight: 950;
  text-align: center;
}

.live-workspace-code:not(:empty) {
  padding: 12px;
  font-size: clamp(34px, 12vw, 58px);
  letter-spacing: 0.08em;
}















@media (max-width: 900px) {


}

.projection-handwriting-layer {
  position: fixed;
  inset: 0;
  z-index: 90; /* topmost: above dsp2 photo cover (70) so handwriting works over everything */
  border: 0;
  outline: 0;
  background: transparent;
  box-shadow: none;
  pointer-events: none;
}

.projection-handwriting-canvas {
  display: block;
  width: 100vw;
  height: 100vh;
  border: 0;
  outline: 0;
  background: transparent;
  box-shadow: none;
  touch-action: none;
  pointer-events: auto;
}

.dsp2-ink-tools {
  position: absolute;
  right: 18px;
  bottom: 18px;
  display: grid;
  grid-auto-flow: column;
  gap: 10px;
  pointer-events: none;
}

.dsp2-ink-tool {
  min-width: 48px;
  min-height: 48px;
  border: 1px solid var(--dsp2-accent-border);
  border-radius: 999px;
  padding: 0 15px;
  /* Panel-solid, not accent-tinted: the buttons float over user handwriting
     and must stay legible on top of dense ink strokes. */
  background: var(--dsp2-panel-bg, rgba(255, 255, 255, 0.9));
  color: var(--dsp2-ink);
  font-size: 15px;
  font-weight: 900;
  pointer-events: auto;
  cursor: pointer;
}

/* panel-bg and ink are opposite poles in every dsp2 theme (incl. dark-stage
   tokyo), so this inverse pair keeps the active glyph readable everywhere —
   --dsp2-accent-bg is a 10%-alpha tint and must never be used as text color. */
.dsp2-ink-tool.is-active {
  background: var(--dsp2-ink);
  border-color: var(--dsp2-ink);
  color: var(--dsp2-panel-bg, #fff);
}

.dsp2-ink-clear.is-armed {
  background: #b3261e;
  border-color: #b3261e;
  color: #fff;
}

.display-pairing-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px;
  gap: 10px;
  margin-top: 20px;
}

.display-pairing-form .input {
  min-height: 54px;
  text-align: center;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

@media (max-width: 520px) {
  .live-workspace-actions,
  .live-workspace-claim-form > div,
  .display-pairing-form {
    grid-template-columns: 1fr;
  }
}

/* dsp2: side-anchored projection */
/* Projection palette: the theme body class picks the values; the block
   below only consumes --dsp2-* variables. Defaults = tokyo (东京夜), the
   baseline look; the four light themes override per theme. */
.dsp2-root {
  /* Brand wordmark ink on this surface: fixed brand values only (ivory on the
     dark tokyo baseline, ink on light themes) — mirrors the nav rule. */
  --dsp2-brand-ink: #f4f1ea;
  --dsp2-base: #15171c;
  --dsp2-grad-a: rgba(10, 11, 14, 0.95);
  --dsp2-grad-b: rgba(21, 23, 28, 0.9);
  --dsp2-tint-1: rgba(201, 162, 75, 0.22);
  --dsp2-tint-2: rgba(201, 162, 75, 0.16);
  --dsp2-vignette: rgba(5, 5, 8, 0.3);
  --dsp2-ink: #fff;
  --dsp2-ink-soft: rgba(255, 255, 255, 0.86);
  --dsp2-ink-muted: rgba(255, 255, 255, 0.68);
  --dsp2-ink-faint: rgba(255, 255, 255, 0.58);
  --dsp2-panel-bg: rgba(20, 22, 27, 0.65);
  --dsp2-panel-border: rgba(255, 255, 255, 0.2);
  --dsp2-panel-shadow: 0 26px 76px rgba(0, 0, 0, 0.4);
  --dsp2-chip-bg: rgba(255, 255, 255, 0.07);
  --dsp2-chip-border: rgba(255, 255, 255, 0.14);
  --dsp2-chip-strong-bg: rgba(255, 255, 255, 0.12);
  --dsp2-chip-strong-border: rgba(255, 255, 255, 0.22);
  --dsp2-accent-bg: rgba(201, 162, 75, 0.16);
  --dsp2-accent-border: rgba(201, 162, 75, 0.5);
  --dsp2-qr-bg: #fff;
  --dsp2-qr-ink: #15171c;
  --dsp2-qr-ink-soft: rgba(21, 23, 28, 0.68);
  --dsp2-stage-bg: rgba(255, 255, 255, 0.05);
  --dsp2-stage-border: rgba(201, 162, 75, 0.3);
  --dsp2-safe-x: max(30px, env(safe-area-inset-left), env(safe-area-inset-right));
  --dsp2-safe-y: max(26px, env(safe-area-inset-top), env(safe-area-inset-bottom));
  position: relative;
  display: flex;
  align-items: stretch;
  gap: clamp(24px, 4vw, 58px);
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  padding: var(--dsp2-safe-y) var(--dsp2-safe-x);
  background:
    radial-gradient(circle at 18% 16%, var(--dsp2-tint-1), transparent 31%),
    radial-gradient(circle at 78% 82%, var(--dsp2-tint-2), transparent 34%),
    linear-gradient(145deg, var(--dsp2-grad-a), var(--dsp2-grad-b)),
    var(--dsp2-base);
  background-color: var(--dsp2-base);
  color: var(--dsp2-ink);
  isolation: isolate;
}

.theme-romance .dsp2-root {
  --dsp2-brand-ink: #15171c;
  --dsp2-base: #fff3f1;
  --dsp2-grad-a: rgba(255, 248, 246, 0.96);
  --dsp2-grad-b: rgba(255, 235, 236, 0.9);
  --dsp2-tint-1: rgba(185, 28, 51, 0.1);
  --dsp2-tint-2: rgba(219, 39, 91, 0.07);
  --dsp2-vignette: rgba(120, 30, 50, 0.08);
  --dsp2-ink: #351019;
  --dsp2-ink-soft: rgba(53, 16, 25, 0.85);
  --dsp2-ink-muted: rgba(53, 16, 25, 0.62);
  --dsp2-ink-faint: rgba(53, 16, 25, 0.45);
  --dsp2-panel-bg: rgba(255, 255, 255, 0.74);
  --dsp2-panel-border: rgba(185, 28, 51, 0.16);
  --dsp2-panel-shadow: 0 26px 76px rgba(146, 38, 60, 0.16);
  --dsp2-chip-bg: rgba(185, 28, 51, 0.05);
  --dsp2-chip-border: rgba(185, 28, 51, 0.14);
  --dsp2-chip-strong-bg: rgba(185, 28, 51, 0.08);
  --dsp2-chip-strong-border: rgba(185, 28, 51, 0.22);
  --dsp2-accent-bg: rgba(185, 28, 51, 0.1);
  --dsp2-accent-border: rgba(185, 28, 51, 0.45);
  --dsp2-qr-bg: #b91c33;
  --dsp2-qr-ink: #fff;
  --dsp2-qr-ink-soft: rgba(255, 255, 255, 0.78);
  --dsp2-stage-bg: rgba(255, 255, 255, 0.5);
  --dsp2-stage-border: rgba(185, 28, 51, 0.28);
}

.theme-classic .dsp2-root {
  --dsp2-brand-ink: #15171c;
  --dsp2-base: #f2f7f9;
  --dsp2-grad-a: rgba(247, 251, 252, 0.96);
  --dsp2-grad-b: rgba(230, 241, 244, 0.9);
  --dsp2-tint-1: rgba(45, 111, 126, 0.1);
  --dsp2-tint-2: rgba(79, 149, 163, 0.08);
  --dsp2-vignette: rgba(16, 42, 51, 0.07);
  --dsp2-ink: #10262e;
  --dsp2-ink-soft: rgba(16, 38, 46, 0.85);
  --dsp2-ink-muted: rgba(16, 38, 46, 0.62);
  --dsp2-ink-faint: rgba(16, 38, 46, 0.45);
  --dsp2-panel-bg: rgba(255, 255, 255, 0.75);
  --dsp2-panel-border: rgba(45, 111, 126, 0.18);
  --dsp2-panel-shadow: 0 26px 76px rgba(24, 60, 72, 0.14);
  --dsp2-chip-bg: rgba(45, 111, 126, 0.05);
  --dsp2-chip-border: rgba(45, 111, 126, 0.14);
  --dsp2-chip-strong-bg: rgba(45, 111, 126, 0.08);
  --dsp2-chip-strong-border: rgba(45, 111, 126, 0.22);
  --dsp2-accent-bg: rgba(45, 111, 126, 0.1);
  --dsp2-accent-border: rgba(45, 111, 126, 0.45);
  --dsp2-qr-bg: #2d6f7e;
  --dsp2-qr-ink: #fff;
  --dsp2-qr-ink-soft: rgba(255, 255, 255, 0.78);
  --dsp2-stage-bg: rgba(255, 255, 255, 0.5);
  --dsp2-stage-border: rgba(45, 111, 126, 0.26);
}

.theme-fresh .dsp2-root {
  --dsp2-brand-ink: #15171c;
  --dsp2-base: #effbf6;
  --dsp2-grad-a: rgba(246, 253, 250, 0.96);
  --dsp2-grad-b: rgba(226, 246, 238, 0.9);
  --dsp2-tint-1: rgba(16, 107, 90, 0.1);
  --dsp2-tint-2: rgba(42, 167, 134, 0.08);
  --dsp2-vignette: rgba(9, 50, 42, 0.07);
  --dsp2-ink: #0d241e;
  --dsp2-ink-soft: rgba(13, 36, 30, 0.85);
  --dsp2-ink-muted: rgba(13, 36, 30, 0.62);
  --dsp2-ink-faint: rgba(13, 36, 30, 0.45);
  --dsp2-panel-bg: rgba(255, 255, 255, 0.75);
  --dsp2-panel-border: rgba(16, 107, 90, 0.18);
  --dsp2-panel-shadow: 0 26px 76px rgba(16, 74, 62, 0.14);
  --dsp2-chip-bg: rgba(16, 107, 90, 0.05);
  --dsp2-chip-border: rgba(16, 107, 90, 0.14);
  --dsp2-chip-strong-bg: rgba(16, 107, 90, 0.08);
  --dsp2-chip-strong-border: rgba(16, 107, 90, 0.22);
  --dsp2-accent-bg: rgba(16, 107, 90, 0.1);
  --dsp2-accent-border: rgba(16, 107, 90, 0.45);
  --dsp2-qr-bg: #106b5a;
  --dsp2-qr-ink: #fff;
  --dsp2-qr-ink-soft: rgba(255, 255, 255, 0.78);
  --dsp2-stage-bg: rgba(255, 255, 255, 0.5);
  --dsp2-stage-border: rgba(16, 107, 90, 0.26);
}

.theme-premium .dsp2-root {
  --dsp2-brand-ink: #15171c;
  --dsp2-base: #f7f1e8;
  --dsp2-grad-a: rgba(252, 248, 241, 0.96);
  --dsp2-grad-b: rgba(243, 232, 216, 0.9);
  --dsp2-tint-1: rgba(168, 123, 68, 0.12);
  --dsp2-tint-2: rgba(74, 51, 38, 0.07);
  --dsp2-vignette: rgba(60, 42, 28, 0.08);
  --dsp2-ink: #241812;
  --dsp2-ink-soft: rgba(36, 24, 18, 0.85);
  --dsp2-ink-muted: rgba(36, 24, 18, 0.62);
  --dsp2-ink-faint: rgba(36, 24, 18, 0.45);
  --dsp2-panel-bg: rgba(255, 255, 255, 0.72);
  --dsp2-panel-border: rgba(168, 123, 68, 0.22);
  --dsp2-panel-shadow: 0 26px 76px rgba(90, 64, 40, 0.15);
  --dsp2-chip-bg: rgba(74, 51, 38, 0.05);
  --dsp2-chip-border: rgba(168, 123, 68, 0.18);
  --dsp2-chip-strong-bg: rgba(168, 123, 68, 0.1);
  --dsp2-chip-strong-border: rgba(168, 123, 68, 0.28);
  --dsp2-accent-bg: rgba(168, 123, 68, 0.14);
  --dsp2-accent-border: rgba(168, 123, 68, 0.5);
  --dsp2-qr-bg: #4a3326;
  --dsp2-qr-ink: #fff;
  --dsp2-qr-ink-soft: rgba(255, 255, 255, 0.78);
  --dsp2-stage-bg: rgba(255, 255, 255, 0.55);
  --dsp2-stage-border: rgba(168, 123, 68, 0.34);
}

.dsp2-root::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.1), transparent 28%, transparent 72%, rgba(255, 255, 255, 0.08)),
    radial-gradient(circle at center, transparent 0 46%, var(--dsp2-vignette) 100%);
  pointer-events: none;
}

.dsp2-waiting-root {
  display: grid;
  place-items: center;
}

.dsp2-waiting-card {
  position: relative;
  z-index: 2;
  border-color: var(--dsp2-panel-border);
  background: var(--dsp2-panel-bg);
  color: var(--dsp2-ink);
  box-shadow: var(--dsp2-panel-shadow);
  backdrop-filter: blur(18px);
}

.dsp2-waiting-card .muted {
  color: var(--dsp2-ink-muted);
}

.dsp2-waiting-masthead {
  margin: 0 0 10px;
  color: var(--dsp2-ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(30px, 5vw, 58px);
  font-weight: 900;
  letter-spacing: 0.08em;
}

.dsp2-waiting-kicker {
  color: var(--dsp2-ink-muted);
  letter-spacing: 0.22em;
}

/* Waiting/pairing screens lead with the canonical wordmark SVG. */
.dsp2-waiting-brand {
  display: flex;
  justify-content: center;
  color: var(--dsp2-brand-ink, #15171c);
}

.dsp2-waiting-brand .brand-wm {
  display: block;
  width: auto;
  height: clamp(44px, 7vw, 68px);
}

.dsp2-waiting-ambient {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

.dsp2-waiting-ambient i {
  position: absolute;
  width: clamp(80px, 12vw, 180px);
  aspect-ratio: 1;
  border: 1px solid var(--dsp2-accent-border);
  border-radius: 50%;
  background: var(--dsp2-accent-bg);
  opacity: 0.72;
}

.dsp2-waiting-ambient i:nth-child(1) { top: 10%; left: 8%; }
.dsp2-waiting-ambient i:nth-child(2) { right: 10%; bottom: 12%; transform: scale(1.35); }
.dsp2-waiting-ambient i:nth-child(3) { top: 20%; right: 24%; transform: scale(0.42); }

@media (prefers-reduced-motion: no-preference) {
  .dsp2-waiting-ambient i { animation: dsp2WaitingDrift 9s ease-in-out infinite alternate; }
  .dsp2-waiting-ambient i:nth-child(2) { animation-delay: -3s; }
  .dsp2-waiting-ambient i:nth-child(3) { animation-delay: -6s; }

  @keyframes dsp2WaitingDrift {
    from { translate: -10px -8px; }
    to { translate: 14px 12px; }
  }
}

.dsp2-root.dsp2-side-right {
  flex-direction: row-reverse;
}

.dsp2-info,
.dsp2-stage {
  position: relative;
  z-index: 1;
}

.dsp2-info {
  --dsp2-brand-head-h: clamp(32px, 4.8vh, 42px);
  position: relative;
  /* Wider column buys back the height the larger attr type spends (fewer
     wraps), keeping the no-scroll budget below intact; the 手写区 keeps the
     remaining ~half of the stage. The attrs grid stretches to fill the card
     (equal-height rows) so no blank slab remains (owner call 2026-08-27). */
  flex: 0 0 min(52%, 700px);
  display: flex;
  flex-direction: column;
  gap: clamp(6px, 0.9vh, 12px);
  min-width: 360px;
  max-width: 700px;
  min-height: 0;
  /* Broadcast surface: never a scrollbar. Content is height-budgeted below
     (vh-scaled type + 2-line prose clamps); hidden is the last-resort clip. */
  overflow: hidden;
  padding: calc(clamp(10px, 1.4vh, 20px) + var(--dsp2-brand-head-h)) clamp(14px, min(2.2vw, 2vh), 28px) clamp(14px, min(2.2vw, 2vh), 28px);
  border: 1px solid var(--dsp2-panel-border);
  border-radius: 28px;
  background: var(--dsp2-panel-bg);
  box-shadow: var(--dsp2-panel-shadow);
  backdrop-filter: blur(18px);
}

.dsp2-info-projected {
  padding: clamp(14px, min(2.2vw, 2vh), 28px);
}

/* Score rarity frames on the projection card (.dsp2-info only, never the whole
   stage). Additive: the 'none' tier (score below the matchmaker's silver cutoff)
   renders no ring or badge. Tier cutoffs are configurable per matchmaker; the
   ladder is 银R → 金SR → 浮雕SSR → 闪UR. The ring is a masked gradient border so
   it respects .dsp2-info's border-radius and overflow:hidden. Each tier only
   sets --rarity-* custom props; the shared rules below consume them. */
.dsp2-info[class*="dsp2-rarity-"]:not(.dsp2-rarity-none) {
  border-color: var(--rarity-border, var(--dsp2-panel-border));
  box-shadow:
    var(--dsp2-panel-shadow),
    var(--rarity-inner, none),
    0 0 48px -10px var(--rarity-glow, transparent);
}

.dsp2-info[class*="dsp2-rarity-"]:not(.dsp2-rarity-none)::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: var(--rarity-ring-width, 3px);
  background: var(--rarity-ring, transparent);
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
  z-index: 2;
}

.dsp2-rarity-badge {
  grid-area: rarity;
  align-self: start;
  z-index: 3;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: clamp(15px, 1.4vw, 22px);
  font-weight: 1000;
  letter-spacing: 0.08em;
  color: var(--rarity-badge-ink, #43310a);
  background: var(--rarity-badge, #e6b53f);
  box-shadow:
    0 6px 16px -6px var(--rarity-glow, rgba(0, 0, 0, 0.4)),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.dsp2-rarity-badge:empty {
  display: none;
}

/* 银卡 · R — cool platinum */
.dsp2-info.dsp2-rarity-silver {
  --rarity-border: rgba(184, 197, 212, 0.6);
  --rarity-glow: rgba(188, 205, 224, 0.42);
  --rarity-inner: inset 0 0 20px -8px rgba(224, 235, 247, 0.5);
  --rarity-ring: linear-gradient(135deg, #f4f7fb, #93a1b2 34%, #f4f7fb 52%, #93a1b2 70%, #f4f7fb);
  --rarity-badge: linear-gradient(135deg, #f4f7fb, #b8c4d2);
  --rarity-badge-ink: #33404f;
}

/* 金卡 · SR — gold (reference tier) */
.dsp2-info.dsp2-rarity-gold {
  --rarity-border: rgba(224, 176, 62, 0.5);
  --rarity-glow: rgba(224, 176, 62, 0.5);
  --rarity-inner: inset 0 0 22px -6px rgba(253, 231, 166, 0.4);
  --rarity-ring: linear-gradient(135deg, #fde7a6, #a9781a 32%, #fde7a6 50%, #a9781a 68%, #fde7a6);
  --rarity-badge: linear-gradient(135deg, #fde7a6, #e6b53f);
  --rarity-badge-ink: #43310a;
}

/* 浮雕 · SSR — embossed bronze, stronger relief depth + thicker ring */
.dsp2-info.dsp2-rarity-emboss {
  --rarity-ring-width: 4px;
  --rarity-border: rgba(217, 138, 74, 0.62);
  --rarity-glow: rgba(217, 138, 74, 0.5);
  --rarity-inner: inset 0 2px 11px -3px rgba(0, 0, 0, 0.5), inset 0 -2px 9px -3px rgba(255, 221, 184, 0.55);
  --rarity-ring: linear-gradient(135deg, #ffe6c4, #7c4420 26%, #ffcaa0 46%, #7c4420 66%, #ffe6c4);
  --rarity-badge: linear-gradient(135deg, #ffe6c4, #d98a4a);
  --rarity-badge-ink: #4a2810;
}

/* 闪卡 · UR — holographic rainbow, top tier */
.dsp2-info.dsp2-rarity-holo {
  --rarity-ring-width: 4px;
  --rarity-border: rgba(255, 255, 255, 0.55);
  --rarity-glow: rgba(180, 130, 255, 0.5);
  --rarity-inner: inset 0 0 26px -6px rgba(255, 255, 255, 0.4);
  --rarity-ring: conic-gradient(from 0deg, #ff5f8f, #ffd76a, #66d9ff, #7dffb0, #c98bff, #ff5f8f);
  --rarity-badge: linear-gradient(135deg, #ffd76a, #ff8fd0 42%, #8fb8ff 76%, #a0ffd0);
  --rarity-badge-ink: #2a1840;
}

.dsp2-info.dsp2-rarity-holo-prism {
  --rarity-glow: rgba(200, 160, 255, 0.72);
  --rarity-ring-width: 4px;
}

.dsp2-info.dsp2-rarity-holo-max {
  --rarity-ring-width: 5px;
  --rarity-glow: rgba(255, 120, 170, 0.78);
}

.dsp2-info.dsp2-rarity-holo-max .dsp2-rarity-badge {
  background: linear-gradient(135deg, #ffd76a, #ff5f8f);
  color: #3a0f1f;
}

.dsp2-max-sparkles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}

.dsp2-max-sparkles i {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 1px;
  background: #fff;
  transform: rotate(45deg);
  opacity: 0;
}

.dsp2-max-sparkles i:nth-child(1) { top: 8%; left: 12%; }
.dsp2-max-sparkles i:nth-child(2) { top: 9%; left: 88%; }
.dsp2-max-sparkles i:nth-child(3) { top: 40%; left: 94%; }
.dsp2-max-sparkles i:nth-child(4) { top: 70%; left: 10%; }
.dsp2-max-sparkles i:nth-child(5) { top: 82%; left: 85%; }
.dsp2-max-sparkles i:nth-child(6) { top: 4%; left: 48%; }

@media (prefers-reduced-motion: no-preference) {
  /* Living shimmer for the top tier; the reveal sequence adds the burst. */
  .dsp2-info.dsp2-rarity-holo::before {
    animation: rarityHoloShimmer 7s linear infinite;
  }

  .dsp2-info.dsp2-rarity-holo-prism::before {
    animation: rarityHoloShimmer 3s linear infinite;
  }

  .dsp2-max-sparkles i {
    animation: dsp2SparkleTwinkle 2.6s ease-in-out infinite;
  }

  .dsp2-max-sparkles i:nth-child(2) { animation-delay: 0.35s; }
  .dsp2-max-sparkles i:nth-child(3) { animation-delay: 0.7s; }
  .dsp2-max-sparkles i:nth-child(4) { animation-delay: 1.05s; }
  .dsp2-max-sparkles i:nth-child(5) { animation-delay: 1.4s; }
  .dsp2-max-sparkles i:nth-child(6) { animation-delay: 1.75s; }

  @keyframes rarityHoloShimmer {
    to {
      filter: hue-rotate(360deg);
    }
  }

  @keyframes dsp2SparkleTwinkle {
    0%,
    100% {
      opacity: 0;
      transform: rotate(45deg) scale(0.6);
    }

    50% {
      opacity: 0.95;
      transform: rotate(45deg) scale(1.15);
    }
  }
}

/* Card brand mark: a compact logo chip (fixed brand ink/gold, like the nav
   wordmark) with the 择偶定位 tagline in the card's own muted ink beside it —
   brand clearly shown without splitting the card into a second theme. On-card
   so every clip carries it; corners of the screen are platform-overlay
   territory and stay empty. */
.dsp2-brand-head {
  position: absolute;
  top: clamp(10px, 1.4vh, 16px);
  left: clamp(14px, min(2.2vw, 2vh), 28px);
  right: clamp(14px, min(2.2vw, 2vh), 28px);
  z-index: 2;
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.2vw, 16px);
  pointer-events: none;
}

.dsp2-brand-head {
  color: var(--dsp2-brand-ink, #15171c);
}

.dsp2-brand-head .brand-wm {
  display: block;
  width: auto;
  height: clamp(24px, min(2.8vw, 3.8vh), 32px);
}

.dsp2-brand-head span {
  color: var(--dsp2-ink-muted);
  font-size: clamp(13px, min(1.5vw, 2vh), 16px);
  font-weight: 900;
  letter-spacing: 0.3em;
  line-height: 1;
}

.dsp2-header-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: clamp(10px, min(1.8vw, 2vh), 22px);
  min-width: 0;
}

.dsp2-header-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: clamp(6px, 0.8vh, 10px);
  min-width: 0;
}

.dsp2-header-copy .dsp2-brand-head {
  position: static;
  inset: auto;
  max-width: 100%;
}

.dsp2-show-badge {
  align-self: flex-start;
  border: 1px solid var(--dsp2-accent-border);
  border-radius: 999px;
  padding: 5px 11px;
  background: var(--dsp2-accent-bg);
  color: var(--dsp2-ink-muted);
  font-size: clamp(12px, 1vw, 15px);
  font-weight: 900;
  line-height: 1;
  overflow-wrap: anywhere;
}

.dsp2-info[data-rarity-badge]:not([data-rarity-badge=""]) .dsp2-show-badge {
  max-width: calc(100% - clamp(72px, 9vw, 112px));
}

.dsp2-id-block {
  display: grid;
  gap: 8px;
}

.dsp2-id-block p {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0;
  color: var(--dsp2-ink-muted);
  font-size: clamp(15px, 1.3vw, 19px);
  font-weight: 800;
}

.dsp2-id-inline {
  color: var(--dsp2-ink);
  font-size: clamp(24px, min(2.7vw, 4vh), 42px);
  line-height: 1;
  font-weight: 1000;
}

.dsp2-stamp-row {
  --dsp2-stamp-size: clamp(96px, 14vh, 136px);
  display: grid;
  grid-template-columns: auto auto;
  grid-template-areas:
    "ring rarity"
    "band rarity"
    "guess guess";
  justify-content: end;
  align-items: start;
  gap: clamp(3px, 0.5vh, 6px) clamp(7px, 0.8vw, 12px);
  min-width: 0;
}

.dsp2-stamp-ring {
  grid-area: ring;
  display: grid;
  place-items: center;
  position: relative;
  box-sizing: border-box;
  aspect-ratio: 1;
  inline-size: var(--dsp2-stamp-size);
  block-size: auto;
  min-width: 0;
  place-self: start end;
  border: 3px solid color-mix(in srgb, var(--stamp-accent, #c9a24b) 72%, #fff);
  border-radius: 50%;
  padding: clamp(8px, 1vh, 12px);
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.98), rgba(255, 244, 230, 0.88) 58%, rgba(255, 214, 156, 0.72));
  color: var(--stamp-accent, #3d2f14);
  text-align: center;
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.3);
}

.dsp2-stamp-ring span,
.dsp2-stamp-ring strong,
.dsp2-stamp-ring em,
.dsp2-stamp-ring small {
  display: block;
}

.dsp2-stamp-ring span {
  font-size: clamp(9px, min(0.9vw, 1.25vh), 12px);
  font-weight: 900;
  text-transform: uppercase;
}

.dsp2-stamp-ring strong {
  opacity: 0.48;
  transform: scale(0.88);
  transition: opacity 180ms ease, transform 180ms ease;
  font-size: clamp(27px, min(3vw, 4vh), 40px);
  line-height: 0.92;
  font-weight: 1000;
}

.dsp2-stamp-ring.is-revealed strong {
  opacity: 1;
  transform: scale(1);
}

/* One-shot landing when a fresh reveal arrives (class added post-render,
   once per submission+score — see refreshLiveDisplaySession). */
@media (prefers-reduced-motion: no-preference) {
  .dsp2-stamp-ring.is-revealed:not(.is-landing) {
    animation: dsp2StampBreathe 6s ease-in-out infinite;
    box-shadow: 0 0 34px color-mix(in srgb, var(--stamp-accent, #c9a24b) 32%, transparent);
  }

  @keyframes dsp2StampBreathe {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.015); }
  }

  .dsp2-stamp-ring.is-landing {
    animation: dsp2StampLand 460ms cubic-bezier(0.2, 1.1, 0.35, 1);
  }

  @keyframes dsp2StampLand {
    from {
      transform: scale(1.55) rotate(-7deg);
      opacity: 0;
      box-shadow: 0 42px 90px rgba(0, 0, 0, 0.55);
    }
    60% {
      transform: scale(0.96) rotate(1deg);
      opacity: 1;
    }
    to {
      transform: scale(1) rotate(0deg);
      opacity: 1;
    }
  }

  .dsp2-stamp-ring[class*="dsp2-stamp-"].is-landing {
    animation: dsp2AstroSlam 620ms cubic-bezier(0.2, 1.4, 0.3, 1);
  }

  .dsp2-stamp-ring[class*="dsp2-stamp-"].is-landing::after {
    content: "";
    position: absolute;
    inset: -14%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 240, 200, 0.9), transparent 62%);
    animation: dsp2AstroFlash 620ms ease-out forwards;
    pointer-events: none;
  }

  .dsp2-info.is-igniting {
    animation: dsp2FrameIgnite 700ms ease-out;
  }

  @keyframes dsp2AstroSlam {
    from { transform: scale(1.7) rotate(-8deg); opacity: 0; }
    55% { transform: scale(0.94) rotate(2deg); opacity: 1; }
    to { transform: scale(1) rotate(0deg); opacity: 1; }
  }

  @keyframes dsp2AstroFlash {
    from { opacity: 1; transform: scale(0.6); }
    to { opacity: 0; transform: scale(1.25); }
  }

  @keyframes dsp2FrameIgnite {
    from {
      box-shadow: var(--dsp2-panel-shadow);
    }

    35% {
      box-shadow:
        var(--dsp2-panel-shadow),
        0 0 0 3px var(--rarity-border, rgba(238, 88, 119, 0.8)),
        0 0 96px 8px var(--rarity-glow, rgba(238, 88, 119, 0.6));
    }

    to {
      box-shadow: var(--dsp2-panel-shadow);
    }
  }
}

.dsp2-stamp-ring em {
  font-style: normal;
  font-size: clamp(10px, min(1vw, 1.4vh), 13px);
  font-weight: 950;
}

.dsp2-stamp-band {
  grid-area: band;
  justify-self: center;
  color: var(--dsp2-ink-soft);
  font-size: clamp(10px, min(1vw, 1.35vh), 13px);
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.dsp2-stamp-ring.dsp2-stamp-astro {
  position: relative;
  border-color: transparent;
  /* Real dark backing echoing the SVG sky: contrast audits resolve text
     against CSS backgrounds (the SVG disc is invisible to them), and it
     keeps the ring readable if the inline SVG ever fails to paint. */
  background: radial-gradient(circle at 42% 34%, #22345f, #0a1026 78%);
  box-shadow: none;
  color: #f2ecff;
}

.dsp2-stamp-astro span {
  color: #e9c76f;
}

.dsp2-stamp-astro strong {
  color: #ffe9ad;
  text-shadow: 0 2px 18px rgba(255, 214, 120, 0.35);
}

.dsp2-stamp-astro small {
  color: rgba(226, 231, 255, 0.75);
}

.dsp2-stamp-astro > span:not(.dsp2-stamp-mark),
.dsp2-stamp-astro > strong,
.dsp2-stamp-astro > em,
.dsp2-stamp-astro > small {
  position: relative;
  z-index: 1;
}

.dsp2-stamp-ring.dsp2-stamp-chop {
  position: relative;
  border-color: transparent;
  background: radial-gradient(circle at 42% 34%, #c22636, #821725 78%);
  box-shadow: none;
  color: #fff4ee;
}

.dsp2-stamp-ring.dsp2-stamp-medallion,
.dsp2-stamp-ring.dsp2-stamp-rosette {
  position: relative;
  border-color: transparent;
  background: radial-gradient(circle at 42% 34%, #8a5f18, #3f2606 78%);
  box-shadow: none;
  color: #fff7dd;
}

.dsp2-stamp-ring.dsp2-stamp-wax {
  position: relative;
  border-color: transparent;
  background: radial-gradient(circle at 40% 32%, #96203f, #4a0c1f 78%);
  box-shadow: none;
  color: #ffe9ee;
}

.dsp2-stamp-ring.dsp2-stamp-jade {
  position: relative;
  border-color: transparent;
  background: radial-gradient(circle at 38% 30%, #1f7a52, #0e4530 78%);
  box-shadow: none;
  color: #f4fff8;
}

.dsp2-stamp-ring.dsp2-stamp-gem {
  position: relative;
  border-color: transparent;
  background: radial-gradient(circle at 42% 30%, #b02a68, #4d102f 78%);
  box-shadow: none;
  color: #ffffff;
}

.dsp2-stamp-chop span,
.dsp2-stamp-medallion span,
.dsp2-stamp-wax span,
.dsp2-stamp-jade span,
.dsp2-stamp-gem span,
.dsp2-stamp-rosette span,
.dsp2-stamp-chop strong,
.dsp2-stamp-medallion strong,
.dsp2-stamp-wax strong,
.dsp2-stamp-jade strong,
.dsp2-stamp-gem strong,
.dsp2-stamp-rosette strong,
.dsp2-stamp-chop small,
.dsp2-stamp-medallion small,
.dsp2-stamp-wax small,
.dsp2-stamp-jade small,
.dsp2-stamp-gem small,
.dsp2-stamp-rosette small {
  color: inherit;
}

.dsp2-stamp-ring[class*="dsp2-stamp-"] > span:not(.dsp2-stamp-mark),
.dsp2-stamp-ring[class*="dsp2-stamp-"] > strong,
.dsp2-stamp-ring[class*="dsp2-stamp-"] > em,
.dsp2-stamp-ring[class*="dsp2-stamp-"] > small {
  position: relative;
  z-index: 1;
}

.dsp2-stamp-mark {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.dsp2-stamp-mark svg {
  display: block;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 16px 30px rgba(0, 0, 0, 0.45));
}

.dsp2-guess-pill {
  grid-area: guess;
  justify-self: start;
  display: grid;
  gap: 4px;
  width: var(--dsp2-stamp-size);
  border: 1px solid var(--dsp2-chip-strong-border);
  border-radius: 14px;
  padding: 8px 10px;
  background: var(--dsp2-chip-strong-bg);
  text-align: center;
}

.dsp2-guess-pill.is-open {
  border-color: var(--dsp2-accent-border);
  background: var(--dsp2-accent-bg);
}

.dsp2-guess-pill span {
  color: var(--dsp2-ink-muted);
  font-size: clamp(13px, 1.2vw, 16px);
  font-weight: 800;
}

.dsp2-guess-pill strong {
  font-size: clamp(12px, min(1.3vw, 1.6vh), 16px);
  line-height: 1.1;
}

.dsp2-attrs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  gap: clamp(5px, 0.7vh, 7px);
  min-height: 0;
  flex: 1 1 auto;
}

.dsp2-attr {
  display: flex;
  flex-direction: column;
  justify-content: center;
  container-type: size;
}

.dsp2-attr {
  min-width: 0;
  margin: 0;
  border: 1px solid var(--dsp2-chip-border);
  border-radius: 12px;
  padding: clamp(4px, 0.7vh, 8px) 10px;
  background: var(--dsp2-chip-bg);
  color: var(--dsp2-ink);
}

.dsp2-attr-wide {
  grid-column: 1 / -1;
}

.dsp2-attr span,
.dsp2-attr strong {
  display: block;
}

.dsp2-attr span {
  margin-bottom: 1px;
  color: var(--dsp2-ink-muted);
  font-size: clamp(16px, min(2.1vw, 3vh), 27px);
  font-weight: 800;
}

/* 2-line cap on every value: prose fields (家庭/个人优势/理想对象) are unbounded
   user text; the projection is a glance surface — full text lives on /mm. The
   cap is what makes the no-scroll card a provable height budget. */
.dsp2-attr strong {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
  font-size: clamp(25px, min(3.3vw, 4.8vh), 44px);
  line-height: 1.08;
}

@supports (container-type: size) {
  .dsp2-attr span {
    font-size: clamp(16px, 20cqh, 27px);
  }

  .dsp2-attr strong {
    font-size: clamp(25px, 32cqh, 56px);
  }
}

.dsp2-stage {
  flex: 1 1 auto;
  display: grid;
  place-items: center;
  min-width: 0;
}

.dsp2-photo-cover {
  position: fixed;
  inset: 0;
  z-index: 70;
  overflow: hidden;
  background: #0d0e11;
}

.dsp2-photo-cover img,
.dsp2-photo-fallback {
  width: 100%;
  height: 100%;
}

.dsp2-photo-cover img {
  display: block;
  object-fit: cover;
}

.dsp2-photo-fallback {
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 45% 34%, var(--dsp2-tint-1), transparent 24%),
    linear-gradient(145deg, var(--dsp2-grad-a), var(--dsp2-grad-b)),
    var(--dsp2-base);
  color: var(--dsp2-ink-soft);
  font-size: clamp(42px, 7vw, 92px);
  font-weight: 1000;
}

.dsp2-photo-badge {
  position: absolute;
  top: max(24px, env(safe-area-inset-top));
  left: max(24px, env(safe-area-inset-left));
  display: grid;
  gap: 4px;
  border-radius: 18px;
  padding: 12px 16px;
  background: rgba(10, 11, 14, 0.72);
  color: #fff;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(14px);
}

.dsp2-photo-right .dsp2-photo-badge {
  right: max(24px, env(safe-area-inset-right));
  left: auto;
}

.dsp2-photo-badge span,
.dsp2-photo-badge strong {
  display: block;
}

.dsp2-photo-badge span {
  font-size: clamp(30px, 4.2vw, 60px);
  line-height: 1;
  font-weight: 1000;
}

.dsp2-photo-badge strong {
  color: rgba(255, 255, 255, 0.78);
  font-size: clamp(14px, 1.35vw, 19px);
}

.dsp2-pairing-page {
  background:
    radial-gradient(circle at 18% 14%, color-mix(in srgb, var(--primary) 22%, transparent), transparent 32%),
    var(--brand-grad, var(--primary));
  background-color: var(--primary);
}

.dsp2-pairing-page .display-waiting-card {
  border: 1px solid color-mix(in srgb, var(--primary) 20%, var(--border));
  box-shadow: 0 24px 68px rgba(84, 18, 34, 0.22);
}

.dsp2-pairing-instruction {
  margin: 14px 0 6px;
  color: var(--muted);
  font-size: clamp(18px, 2.2vw, 28px);
  font-weight: 800;
}

.dsp2-pair-request-code {
  display: block;
  color: var(--text);
  /* Six tabular digits with 0.12em tracking must fit the waiting card, whose
     width is capped (min(100%, 720px)) while 12vw keeps growing: at 1366px the
     last digit spilled past the card. Bound the size by the card's inline size. */
  font-size: min(clamp(64px, 12vw, 168px), 13cqi);
  font-variant-numeric: tabular-nums;
  font-weight: 1000;
  letter-spacing: 0.12em;
  line-height: 1;
  text-indent: 0.12em;
}

.dsp2-pair-request-main {
  display: grid;
  gap: 20px;
  align-items: center;
}

.dsp2-pair-request-qr {
  display: grid;
  gap: 8px;
  justify-items: center;
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.dsp2-pair-request-qr img {
  width: 172px;
  height: 172px;
  border: 8px solid #fff;
  border-radius: 12px;
  background: #fff;
  object-fit: contain;
}

@media (min-width: 800px) {
  .dsp2-pairing-page .display-waiting-card {
    width: min(100%, 980px);
  }

  .dsp2-pair-request-main {
    grid-template-columns: minmax(0, 1fr) 190px;
  }

  .dsp2-pair-request-main .dsp2-pair-request-code {
    font-size: min(clamp(64px, 12vw, 168px), 9.5cqi);
  }
}

.dsp2-pair-request-expiry {
  margin: 10px 0 0;
  font-size: clamp(15px, 1.5vw, 20px);
}

.dsp2-manual-pairing {
  margin-top: 18px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
  text-align: left;
}

.dsp2-manual-pairing summary {
  cursor: pointer;
  font-weight: 850;
}

.dsp2-manual-pairing .muted {
  margin: 10px 0 0;
}

.dsp2-pairing-side {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.dsp2-side-choice {
  gap: 8px;
}

.dsp2-side-choice span {
  min-height: 48px;
  border-radius: var(--radius-control);
  font-weight: 900;
}

.dsp2-side-choice input:checked + span {
  border-color: transparent;
  background: var(--brand-grad, var(--primary));
  background-color: var(--primary);
  color: var(--primary-contrast);
}

@media (orientation: portrait) {
  .dsp2-root {
    gap: 16px;
    padding:
      max(16px, env(safe-area-inset-top))
      max(16px, env(safe-area-inset-right))
      max(16px, env(safe-area-inset-bottom))
      max(16px, env(safe-area-inset-left));
  }

  .dsp2-info {
    flex-basis: 57%;
    min-width: 0;
    padding: calc(clamp(10px, 1.4vh, 20px) + var(--dsp2-brand-head-h)) clamp(14px, min(3vw, 2vh), 28px) clamp(14px, min(3vw, 2vh), 28px);
  }

  .dsp2-info.dsp2-info-projected {
    padding: clamp(14px, min(3vw, 2vh), 28px);
  }

  /* Keep two columns: the 11-attr grid predates this 1fr rule — a single
     column stacks past any viewport height and forces the scroll we ban. */
  .dsp2-attrs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dsp2-stamp-row {
    --dsp2-stamp-size: clamp(84px, 8.5vh, 104px);
  }
}

@media (orientation: portrait) and (max-width: 520px) {
  .dsp2-root,
  .dsp2-root.dsp2-side-right {
    flex-direction: column;
    overflow-y: auto;
  }

  .dsp2-info {
    flex: 0 0 auto;
    width: 100%;
    max-width: none;
  }

  .dsp2-stage {
    flex: 0 0 42svh;
    width: 100%;
    min-height: 240px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dsp2-stamp-ring,
  .dsp2-stamp-ring strong {
    transition: none;
    animation: none;
  }
}

/* mm2: live-first workspace */
.mm2-live-view {
  display: grid;
  gap: 12px;
  max-width: 430px;
  margin: 0 auto;
  padding: 14px 12px calc(140px + env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at top left, color-mix(in srgb, var(--primary) 13%, transparent), transparent 34%),
    var(--app-bg, var(--surface));
}

.mm2-detail-panel {
  display: none;
}

@media (min-width: 768px) {
  .app:has(.mm2-live-view) {
    width: 100%;
    max-width: none;
  }

  .mm2-live-view {
    grid-template-columns: minmax(400px, 430px) minmax(320px, 1fr);
    max-width: 980px;
  }

  .mm2-live-view > * {
    grid-column: 1;
  }

  .mm2-live-view > .mm2-detail-panel {
    position: sticky;
    top: calc(70px + env(safe-area-inset-top));
    grid-column: 2;
    grid-row: 1;
    display: block;
    align-self: start;
    height: 1px;
    overflow: visible;
  }

  .mm2-detail-panel-shell {
    position: absolute;
    inset: 0 0 auto;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    width: 100%;
    height: calc(100dvh - 82px - env(safe-area-inset-top));
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    background: var(--surface);
    box-shadow: var(--shadow-soft, none);
  }

  .mm2-detail-panel-head {
    padding: 14px;
    border-bottom: 1px solid var(--border);
  }

  .mm2-detail-panel-head .eyebrow {
    margin: 0 0 5px;
  }

  .mm2-detail-panel-head h2 {
    margin: 0;
  }

  .mm2-detail-panel-body {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 12px;
  }

  .mm2-detail-panel .mm2-empty-hero {
    box-shadow: none;
  }

  .mm2-live-view .mm2-detail-open,
  .mm2-live-view #mm2DetailBackdrop,
  .mm2-live-view .mm2-admin-sheet.mm2-detail-sheet {
    display: none;
  }

  .mm2-live-view .mm2-bottom-bar {
    right: auto;
    left: max(12px, calc((100vw - 980px) / 2 + 12px));
    width: clamp(400px, calc(100vw - 356px), 430px);
  }
}

.mm2-header,
.mm2-current-head,
.mm2-sheet-head,
.mm2-queue-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mm2-header h1,
.mm2-current-head h2,
.mm2-sheet-head h2,
.mm2-queue-head h2 {
  margin: 0;
  line-height: 1.1;
}

.mm2-header .eyebrow,
.mm2-current-head .eyebrow,
.mm2-sheet-head .eyebrow {
  margin: 0 0 5px;
  letter-spacing: 0;
  text-transform: none;
}

.mm2-header-statuses {
  display: flex;
  min-width: 0;
  align-items: flex-end;
  flex-direction: column;
  gap: 5px;
}

.mm2-display-mirror {
  display: block;
  max-width: 250px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mm2-display-mirror:empty,
#mm2ReconnectApproval:empty,
#mm2PairedDisplayManagement:empty {
  display: none;
}

.mm2-device-reconnect,
.mm2-paired-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid color-mix(in srgb, var(--primary) 30%, var(--border));
  border-radius: var(--radius-control);
  padding: 9px 10px;
  background: var(--soft);
  font-size: 12px;
  font-weight: 800;
}

.mm2-device-reconnect + .mm2-device-reconnect {
  margin-top: 6px;
}

.mm2-device-reconnect > span,
.mm2-paired-display > span {
  flex: 1 1 auto;
  min-width: 0;
}

.mm2-device-reconnect .button,
.mm2-paired-display .button {
  /* The base .button is width: 100%; in this flex row that swallowed the
     label (measured live: span 24px, button 408px — the label wrapped one
     character per line). */
  width: auto;
  min-height: 36px;
  flex: 0 0 auto;
  padding: 6px 12px;
}

.mm2-queue-head-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mm2-new-submissions {
  min-height: 30px;
  border: 1px solid color-mix(in srgb, var(--primary) 38%, var(--border));
  border-radius: 999px;
  padding: 5px 10px;
  background: var(--soft);
  color: var(--primary);
  font-family: inherit;
  font-size: 12px;
  font-weight: 850;
  line-height: 1;
  cursor: pointer;
}

.mm2-queue-head h2 {
  letter-spacing: 0;
  text-transform: none;
}

.mm2-live-pill,
.mm2-photo-live-pill {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 5px 10px;
  background: var(--brand-grad, var(--primary));
  background-color: var(--primary);
  color: var(--primary-contrast);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.mm2-live-pill.is-idle {
  border: 1px solid var(--border);
  background: var(--soft);
  color: var(--muted);
}

button.mm2-pairing-pill {
  min-height: 44px;
  border: 0;
  padding-block: 8px;
  cursor: pointer;
  font-family: inherit;
}

button.mm2-pairing-pill.is-idle {
  border: 1px solid var(--border);
}

.mm2-message-action {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  margin-left: 10px;
  border: 0;
  border-radius: 999px;
  padding: 8px 14px;
  background: #92400e;
  color: #fffbeb;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

















@media (max-width: 340px) {
}

.mm2-hero-slot {
  display: grid;
  gap: 12px;
  scroll-margin-top: calc(70px + env(safe-area-inset-top));
}

.mm2-empty-hero,
.mm2-current-card {
  display: grid;
  gap: 12px;
  padding: 12px;
  box-shadow: var(--shadow-soft, none);
}

.mm2-empty-hero h2 {
  margin: 0;
  font-size: 20px;
}

.mm2-hero-slot .live-workspace-panel {
  margin: 0;
}

.mm2-current-card h2 {
  font-size: 42px;
  letter-spacing: 0;
}

.mm2-stats,
.mm2-privacy-row,
.mm2-guess-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.mm2-stats span {
  min-height: 28px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 9px;
  background: var(--soft);
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
}

.mm2-stats .mm2-stat-occupation {
  max-width: calc(12em + 18px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mm2-stats .mm2-stat-money {
  border-color: color-mix(in srgb, var(--muted) 22%, var(--border));
  background: color-mix(in srgb, var(--muted) 12%, transparent);
  color: color-mix(in srgb, var(--muted) 60%, var(--text));
}

.mm2-prior-context {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.mm2-photo-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  padding: 12px;
  background: color-mix(in srgb, var(--primary) 5%, var(--surface));
}

.mm2-photo-control > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.mm2-photo-control span:not(.mm2-photo-live-pill),
.mm2-photo-control small {
  display: block;
}

.mm2-photo-control span:not(.mm2-photo-live-pill) {
  color: var(--text);
  font-weight: 900;
}

.mm2-photo-control small {
  color: var(--muted);
  font-size: 12px;
}

.mm2-photo-control .button {
  width: auto;
  min-width: 92px;
  min-height: 44px;
  padding: 0 12px;
}

.mm2-photo-picker {
  display: grid;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  padding: 10px;
  background: var(--surface);
}

.mm2-photo-picker .choice-group-label {
  margin: 0;
}

.mm2-photo-thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
}

.mm2-photo-thumb {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  padding: 0;
  border: 2px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--soft);
}

.mm2-photo-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mm2-photo-thumb.is-selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 30%, transparent);
}

.mm2-photo-picker-message {
  margin: 0;
  min-height: 16px;
  font-size: 12px;
}

.mm2-photo-picker-message .ok {
  color: var(--success, #176b5c);
}

.mm2-photo-picker-message .error {
  color: #991b1b;
}

.mm2-guest-detail {
  display: grid;
  gap: 12px;
}

.mm2-guest-detail .contact-panel,
.mm2-guest-detail .live-deck-command {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-soft, none);
}

.mm2-guest-detail .contact-panel {
  margin: 0;
  padding: 12px;
}

.mm2-guest-detail .live-deck-command {
  overflow: visible;
  padding: 12px;
}

.mm2-guest-detail .live-command-actions:empty,
.mm2-guest-detail #message:empty,
.mm2-guest-detail .alias-list:empty {
  display: none;
}

.mm2-score-card {
  display: grid;
  gap: 12px;
}

.mm2-score-card .scoring-panel {
  border-radius: var(--radius-card);
  padding: 12px;
}

.mm2-score-card .score-preview {
  min-height: 72px;
  padding: 12px;
}

.mm2-score-card .score-preview strong {
  font-size: 38px;
}

.mm2-score-card .score-dial {
  /* Steppers keep the >=56x96 live tap-target contract from the old deck. */
  grid-template-columns: 96px minmax(0, 1fr) 96px;
  gap: 6px;
  padding: 7px;
}

.mm2-score-card .score-step,
.mm2-score-card .score-control-value {
  min-height: 56px;
}

.mm2-score-card .score-step {
  font-size: 16px;
}

.mm2-score-card .score-grid {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 0 2px 4px;
  scroll-snap-type: x proximity;
}

.mm2-score-card .score-chip {
  flex: 0 0 52px;
  scroll-snap-align: center;
}

.mm2-guess-line {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  padding: 8px 10px;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
}

.mm2-guess-line span,
.mm2-guess-line strong,
.mm2-guess-line em {
  font-style: normal;
  font-weight: 850;
}

.mm2-guess-line.is-open strong {
  color: var(--success, var(--primary));
}

.mm2-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 82px;
  gap: 8px;
  position: sticky;
  top: env(safe-area-inset-top);
  z-index: 8;
  margin: 0 -4px;
  padding: 8px 4px;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  background: color-mix(in srgb, var(--app-bg, var(--surface)) 96%, transparent);
  backdrop-filter: blur(12px);
}

/* Inline (main-view) placement above the queue: search is a mid-stream hot
   path (owner call 2026-08-27) — the drawer keeps only 备注/绑定. */
.mm2-search-inline {
  margin: 2px 0 10px;
}

.mm2-search-inline + .mm2-search-results:not(:empty) {
  margin-bottom: 12px;
}

.mm2-search-row .button {
  min-height: 46px;
}

.mm2-search-results {
  display: flex;
  gap: 8px;
  overflow-x: auto;
}

.mm2-filter-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 0;
  padding-bottom: 2px;
}

.mm2-filter-tabs .bucket-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex: 0 0 auto;
  min-width: 84px;
}

.mm2-bucket-count {
  display: inline-flex;
  width: 20px;
  min-width: 20px;
  height: 20px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: color-mix(in srgb, currentColor 12%, transparent);
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  visibility: hidden;
}

.mm2-bucket-count.has-value {
  visibility: visible;
}

.bucket-tab.selected .mm2-bucket-count {
  background: color-mix(in srgb, var(--primary-contrast) 20%, transparent);
}

.mm2-queue-head h2 {
  font-size: 18px;
}

.mm2-queue-counts {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

/* Slide-up drawer opener: notes/alias/search live in the drawer so the main
   screen fits hero + score + queue in one viewport (C layout). */
.mm2-detail-open {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
  color: var(--text);
  font-weight: 900;
}

.mm2-detail-open b {
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.mm2-detail-open.is-compact {
  flex: 0 0 auto;
  width: auto;
  min-height: 44px;
  padding: 0 12px;
}

.mm2-detail-open.is-compact b {
  display: none;
}

.mm2-detail-open:not(.has-guest) span::after {
  content: '（先选嘉宾可加备注）';
  margin-left: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.mm2-detail-sheet .mm2-search-row {
  margin-bottom: 10px;
}

/* The detail drawer docks ABOVE the fixed bottom bar (unlike the admin sheet,
   which covers it) so the operator can 投屏/盖章 while reviewing notes. Its
   backdrop and sheet sit below the bar's z-index (18) and dim only the page. */
#mm2DetailBackdrop {
  z-index: 16;
}

/* Compound selector so this wins over .mm2-admin-sheet regardless of source
   order (both are single-class otherwise). */
.mm2-admin-sheet.mm2-detail-sheet {
  z-index: 17;
  bottom: calc(90px + env(safe-area-inset-bottom));
  max-height: min(58dvh, 520px);
}

/* Extra scroll room so the last control (保存备注) never sits flush against
   the drawer's bottom edge where the fixed bar could intercept the click. */
.mm2-detail-sheet .mm2-sheet-body {
  padding-bottom: 20px;
}

/* Keep each body section at its natural height and let the body scroll — a
   collapsing flex item (e.g. #result shrinking to 0) would let a search card
   overflow onto the operator detail and swallow its clicks. */
.mm2-detail-sheet .mm2-sheet-body > * {
  flex-shrink: 0;
}

/* Fixed pink/blue on purpose: gender marks stay semantic across all themes. */
.mm2-gender {
  display: inline-block;
  margin-left: 5px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  line-height: 17px;
  vertical-align: 1px;
}

.mm2-gender.is-female {
  background: #fce7f3;
  color: #9d2458;
}

.mm2-gender.is-male {
  background: #dbeafe;
  color: #1d4ed8;
}

.mm2-queue-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  margin: 0 -12px;
  padding: 0 12px 6px;
  scroll-snap-type: x proximity;
}

.mm2-queue-item {
  position: relative;
  flex: 0 0 152px;
  border-radius: var(--radius-card);
  scroll-snap-align: start;
}

.mm2-queue-item .mm2-queue-card {
  width: 100%;
  height: 100%;
  scroll-snap-align: none;
}

.mm2-queue-reorder-controls {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;
  display: flex;
  gap: 4px;
}

.mm2-queue-drag-handle,
.mm2-queue-move {
  display: inline-flex;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid color-mix(in srgb, var(--text) 16%, transparent);
  border-radius: 999px;
  padding: 0 8px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  color: var(--text);
  font-size: 11px;
  font-weight: 900;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--text) 12%, transparent);
  backdrop-filter: blur(8px);
}

.mm2-queue-drag-handle {
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.mm2-queue-item.is-dragging .mm2-queue-drag-handle {
  cursor: grabbing;
}

.mm2-queue-item.is-dragging {
  opacity: 0.58;
}

.mm2-queue-item.is-drag-target {
  box-shadow: inset 0 0 0 2px var(--primary);
}

.mm2-queue-move {
  appearance: none;
}

.mm2-queue-card {
  flex: 0 0 152px;
  display: grid;
  gap: 7px;
  min-height: 168px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 10px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
  box-shadow: var(--shadow-soft, none);
  scroll-snap-align: start;
}

.mm2-search-card {
  flex-basis: 148px;
}

.mm2-queue-card.is-selected {
  border-color: var(--primary);
  box-shadow:
    inset 0 0 0 1px var(--primary),
    var(--shadow-soft, none);
}

.mm2-queue-card .thumb {
  width: 100%;
  height: 76px;
  border-radius: var(--radius-control);
}

.mm2-queue-card .strong,
.mm2-queue-card small {
  display: block;
  min-width: 0;
}

.mm2-queue-card small {
  color: var(--muted);
  font-weight: 750;
}

.mm2-queue-card .status-row {
  gap: 4px;
}

.mm2-queue-card .status-badge {
  min-height: 20px;
  padding: 1px 6px;
  font-size: 11px;
}

.mm2-queue-skeleton {
  pointer-events: none;
}

.mm2-skeleton-block {
  display: block;
  overflow: hidden;
  border-radius: var(--radius-control);
  background: color-mix(in srgb, var(--surface) 82%, var(--border));
}

.mm2-skeleton-block::after {
  content: "";
  display: block;
  width: 45%;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--surface), transparent);
  transform: translateX(-120%);
  animation: mm2QueueShimmer 1400ms ease-in-out infinite;
}

.mm2-skeleton-block.is-title {
  width: 48%;
  height: 16px;
}

.mm2-skeleton-block.is-copy {
  width: 76%;
  height: 13px;
}

.mm2-skeleton-block.is-badge {
  width: 42%;
  height: 20px;
  border-radius: 999px;
}

@keyframes mm2QueueShimmer {
  to { transform: translateX(280%); }
}

@media (prefers-reduced-motion: reduce) {
  .mm2-skeleton-block::after {
    animation: none;
    transform: none;
  }
}

/* Fixed, not sticky: as a grid item the bar's sticky range would be its own
   auto row (zero travel). The page reserves space via .mm2-live-view's
   bottom padding. */
.mm2-bottom-bar {
  position: fixed;
  right: max(0px, calc((100vw - 430px) / 2));
  bottom: 0;
  left: max(0px, calc((100vw - 430px) / 2));
  z-index: 18;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--app-bg, var(--surface)) 94%, transparent);
  box-shadow: 0 -14px 34px color-mix(in srgb, var(--primary) 13%, transparent);
  backdrop-filter: blur(16px);
}

.mm2-action {
  min-height: 48px;
  border: 1px solid var(--border);
  border-radius: var(--radius-button);
  background: var(--surface);
  color: var(--accent);
  font-weight: 950;
}

.mm2-action-primary,
.mm2-action-stamp.is-ready {
  border-color: transparent;
  background: var(--brand-grad);
  background-color: var(--primary);
  color: var(--primary-contrast);
}

.mm2-action-more {
  padding: 0;
  font-size: 24px;
  line-height: 1;
}

.mm2-inline-undo {
  min-height: 44px;
  border: 0;
  padding: 0 8px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 950;
  text-decoration: underline;
  cursor: pointer;
}

.mm2-action:disabled {
  opacity: 0.55;
}

.mm2-action-message {
  grid-column: 1 / -1;
}

.mm2-action-message:empty {
  display: none;
}

.mm2-hotkeys {
  display: none;
  grid-column: 1 / -1;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.mm2-hotkeys button {
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.mm2-hotkeys [hidden] {
  display: none;
}

@media (min-width: 768px) {
  .mm2-hotkeys {
    display: flex;
  }
}

.mm2-admin-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: color-mix(in srgb, var(--text) 34%, transparent);
}

.mm2-admin-sheet {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 81;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  max-height: min(78dvh, 720px);
  border-radius: 18px 18px 0 0;
  padding: 8px 12px calc(12px + env(safe-area-inset-bottom));
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 -22px 58px color-mix(in srgb, var(--primary) 22%, transparent);
}

.mm2-sheet-handle {
  justify-self: center;
  width: 44px;
  height: 5px;
  border-radius: 999px;
  background: var(--border);
}

.mm2-sheet-head {
  padding: 10px 0;
}

.mm2-icon-button {
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--soft);
  color: var(--text);
  font-size: 24px;
  line-height: 1;
}

.mm2-sheet-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  overflow-y: auto;
  padding-bottom: 10px;
}

.mm2-admin-group {
  display: grid;
  gap: 8px;
}

.mm2-admin-group > h3 {
  margin: 10px 4px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.12em;
}

.mm2-danger-zone {
  margin-top: 8px;
  border-top: 1px solid color-mix(in srgb, #b91c1c 28%, var(--border));
  padding-top: 10px;
}

.mm2-sheet-row {
  /* overflow:hidden gives rows an automatic minimum of 0, so without an
     explicit no-shrink the height-constrained body compresses every open
     accordion into an equal-split sliver instead of scrolling. */
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
  overflow: hidden;
}

.mm2-sheet-row > summary {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 12px;
  cursor: pointer;
  font-weight: 950;
  list-style: none;
}

.mm2-sheet-row > summary::-webkit-details-marker {
  display: none;
}

.mm2-sheet-row > summary b {
  display: inline-flex;
  min-width: 26px;
  min-height: 26px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--brand-grad, var(--primary));
  background-color: var(--primary);
  color: var(--primary-contrast);
  font-size: 12px;
}















.mm2-sheet-row > .quick-panel,
.mm2-sheet-row > .live-workspace-panel,
.mm2-sheet-stack {
  margin: 0 10px 10px;
}

.mm2-sheet-stack {
  display: grid;
  gap: 10px;
}

.mm2-sheet-stack .quick-panel,
.mm2-info-side-panel {
  display: grid;
  gap: 10px;
}

.mm2-side-choice {
  gap: 8px;
}

.mm2-side-choice span {
  min-height: 44px;
}

.rarity-threshold-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.rarity-threshold-grid label {
  display: grid;
  gap: 4px;
  font-size: 13px;
  font-weight: 700;
}

.rarity-threshold-grid label span {
  color: var(--muted, #6b7280);
}

.rarity-threshold-grid button {
  grid-column: 1 / -1;
}

.stamp-style-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.stamp-style-swatch {
  display: grid;
  min-width: 64px;
  min-height: 72px;
  place-items: center;
  gap: 3px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 5px 7px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.stamp-style-swatch.selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 22%, transparent);
}

.stamp-style-swatch-mark {
  display: block;
  width: 44px;
  height: 44px;
}

.stamp-style-swatch-mark svg {
  display: block;
  width: 100%;
  height: 100%;
}

.mm2-sheet-footer {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

@media (min-width: 431px) {
  .mm2-admin-sheet {
    right: max(0px, calc((100vw - 430px) / 2));
    left: max(0px, calc((100vw - 430px) / 2));
  }
}

@media (min-width: 560px) {
  .mm2-admin-sheet {
    right: max(12px, calc((100vw - 430px) / 2));
    left: max(12px, calc((100vw - 430px) / 2));
    border-radius: 18px;
    bottom: 12px;
    padding-bottom: 12px;
  }
}

/* Versioned venue proposal and staff decision surfaces. */
.app:has(.ops-venue-page) {
  width: min(100%, 980px);
}

.venue-panel-body,
.venue-version-list,
.venue-proposal-section,
.venue-proposal-form,
.venue-decision-zone,
.ops-venue-results {
  display: grid;
  gap: 12px;
}

.venue-panel-body {
  margin: 0 10px 12px;
}

.venue-panel-body > .muted,
.venue-proposal-section > h3,
.venue-legal-note,
.venue-decision-note,
.venue-deployment-notice p {
  margin: 0;
}

.venue-proposal-section {
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.venue-proposal-section > h3 {
  color: var(--text);
  font-size: 16px;
}

.venue-form-grid,
.venue-fact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.venue-proposal-form label,
.venue-verification-form label,
.ops-venue-page label {
  display: grid;
  gap: 6px;
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
}

.venue-division-results {
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--surface);
}

.venue-division-option {
  display: flex;
  width: 100%;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 0;
  border-top: 1px solid var(--border);
  padding: 9px 11px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.venue-division-option:first-child {
  border-top: 0;
}

.venue-division-option:hover,
.venue-division-option:focus-visible,
.venue-division-option.is-active {
  background: color-mix(in srgb, var(--primary) 10%, var(--surface));
  outline: none;
}

.venue-division-option small,
.venue-division-empty,
.venue-division-edit-note {
  color: var(--muted);
  font-size: 12px;
}

.venue-division-option small {
  flex-shrink: 0;
}

.venue-division-empty {
  margin: 0;
  padding: 12px;
}

.venue-division-edit-note {
  grid-column: 1 / -1;
  margin: -2px 0 0;
}

.venue-legal-note,
.venue-decision-note {
  border-radius: var(--radius-control);
  padding: 10px;
  background: color-mix(in srgb, #f59e0b 10%, var(--surface));
  color: var(--text);
  font-size: 12px;
  line-height: 1.6;
}

.venue-version-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 13px;
  background: color-mix(in srgb, var(--soft) 38%, var(--surface));
}

.venue-version-head,
.ops-venue-result-head,
.ops-venue-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.venue-version-head .eyebrow,
.ops-venue-result-head .eyebrow,
.ops-venue-header .eyebrow {
  margin-bottom: 4px;
}

.venue-version-head h3,
.ops-venue-result-head h2,
.ops-venue-header h1 {
  margin: 0;
  overflow-wrap: anywhere;
}

.venue-version-head h3 {
  font-size: 16px;
}

.venue-statuses {
  display: flex;
  flex: 0 1 180px;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

.venue-statuses .status-badge.warning {
  background: #fff4d6;
  color: #714b00;
}

.venue-statuses .status-badge.ok {
  background: #dcfce7;
  color: #166534;
}

.venue-fact-grid {
  margin: 0;
}

.venue-fact-grid > div {
  min-width: 0;
  border-radius: var(--radius-control);
  padding: 9px 10px;
  background: var(--surface);
}

.venue-fact-grid dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.venue-fact-grid dd {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 13px;
  font-weight: 760;
}

.venue-blockers {
  display: grid;
  gap: 6px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
  color: var(--text);
  font-size: 12px;
}

.venue-blocker-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.venue-blocker-list li {
  border-radius: 999px;
  padding: 4px 7px;
  background: #fff4d6;
  color: #714b00;
  font-weight: 760;
}

.venue-ready-copy {
  color: #166534;
  font-weight: 800;
}

.venue-decision-zone {
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.venue-decision-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.button.secondary.danger {
  border-color: #be123c;
  color: #9f1239;
}

.venue-decision-message:empty,
#venueProposalMessage:empty,
#opsVenuePageMessage:empty {
  display: none;
}

.ops-venue-page {
  display: grid;
  gap: 18px;
}

.ops-venue-auth-card {
  width: min(100%, 480px);
  margin: 7vh auto 0;
}

.ops-venue-header {
  align-items: center;
}

.ops-venue-header .muted {
  margin: 6px 0 0;
}

.ops-venue-lookup {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.ops-venue-lookup .button,
.ops-venue-header .button {
  min-height: 44px;
}

.ops-venue-results {
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

/* Platform-admin workspace and identity console. */
.app:has(.platform-admin-page) {
  width: min(100%, 1040px);
}

.platform-admin-page,
.platform-admin-list,
.platform-admin-detail,
.platform-admin-members,
.platform-admin-actions,
.platform-admin-user-result {
  display: grid;
  gap: 14px;
}

.platform-admin-header,
.platform-admin-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.platform-admin-header h1,
.platform-admin-header p,
.platform-admin-card-head h2,
.platform-admin-summary h2,
.platform-admin-members h2,
.platform-admin-actions h2 {
  margin: 0;
}

.platform-admin-header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.platform-admin-header-actions .button {
  width: auto;
}

.platform-admin-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  border-radius: var(--radius-card);
  padding: 5px;
  background: var(--soft);
}

.platform-admin-tabs button {
  min-height: 44px;
  border: 0;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.platform-admin-tabs button.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-soft);
}

.platform-admin-tab-badge {
  display: inline-grid;
  min-width: 20px;
  min-height: 20px;
  place-items: center;
  border-radius: 999px;
  padding: 0 6px;
  background: var(--soft);
  font-size: 11px;
}

.platform-admin-tabs button.is-active .platform-admin-tab-badge {
  background: color-mix(in srgb, var(--primary) 16%, white);
}

.platform-admin-application-card {
  display: grid;
  gap: 9px;
  padding: 14px;
}

.platform-admin-application-card p {
  margin: 0;
}

.platform-admin-application-actions,
.platform-admin-application-actions form,
.workspace-application-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.workspace-phone-bind {
  display: grid;
  gap: 16px;
}

.workspace-phone-bind > .muted,
.workspace-phone-bind #message p {
  margin: 0;
}

.workspace-phone-bind #phoneBindConflictLogout {
  margin-top: 10px;
}

.platform-admin-application-actions form {
  flex: 1;
}

.platform-admin-application-actions .input {
  min-width: 0;
  flex: 1;
}

.platform-admin-workspace-card {
  display: grid;
  width: 100%;
  gap: 11px;
  padding: 14px;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.platform-admin-workspace-card:hover,
.platform-admin-workspace-card:focus-visible {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 4%, var(--surface));
  outline: none;
}

.platform-admin-codes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.platform-admin-code {
  border-radius: 999px;
  padding: 4px 8px;
  background: var(--accent-soft);
  color: var(--text);
  font-size: 12px;
  font-weight: 850;
}

.platform-admin-code.is-inactive {
  opacity: 0.58;
  text-decoration: line-through;
}

.platform-admin-card-grid,
.platform-admin-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.platform-admin-card-grid > span,
.platform-admin-facts > div {
  min-width: 0;
  border-radius: var(--radius-control);
  padding: 9px 10px;
  background: var(--soft);
}

.platform-admin-card-grid small,
.platform-admin-facts dt {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.platform-admin-card-grid b,
.platform-admin-facts dd {
  display: block;
  margin: 4px 0 0;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.platform-admin-summary,
.platform-admin-user-result {
  margin: 0;
}

.platform-admin-member-card {
  display: grid;
  gap: 5px;
  padding: 12px;
}

.platform-admin-member-card p {
  margin: 0;
  overflow-wrap: anywhere;
}

.platform-admin-action-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 0 12px 12px;
}

.platform-admin-action-form p {
  grid-column: 1 / -1;
  margin: 0;
}

.platform-admin-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.platform-admin-search label {
  display: grid;
  gap: 6px;
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
}

.platform-admin-user-result ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 20px;
}

.platform-admin-forbidden {
  display: grid;
  min-height: 55svh;
  align-content: center;
  text-align: center;
}

.platform-admin-forbidden h1,
.platform-admin-forbidden p {
  margin: 0;
}

.mm2-platform-admin-link {
  width: 100%;
}

.venue-deployment-notice {
  display: grid;
  gap: 5px;
  border: 1px solid #d6a428;
  border-radius: var(--radius-card);
  padding: 12px;
  background: #fff8df;
  color: #5c4200;
  font-size: 13px;
  line-height: 1.55;
}

.venue-deployment-notice.is-enabled {
  border-color: #16a34a;
  background: #ecfdf3;
  color: #14532d;
}

@media (max-width: 620px) {
  .venue-form-grid,
  .venue-fact-grid,
  .ops-venue-lookup {
    grid-template-columns: minmax(0, 1fr);
  }

  .venue-version-head,
  .ops-venue-result-head,
  .ops-venue-header {
    align-items: stretch;
    flex-direction: column;
  }

  .venue-statuses {
    flex-basis: auto;
    justify-content: flex-start;
  }

  .ops-venue-header .button {
    width: 100%;
  }

  .platform-admin-header {
    align-items: stretch;
    flex-direction: column;
  }

  .platform-admin-header .button,
  .platform-admin-action-form .button,
  .platform-admin-search .button {
    width: 100%;
  }

  .platform-admin-card-grid,
  .platform-admin-facts,
  .platform-admin-action-form,
  .platform-admin-search {
    grid-template-columns: minmax(0, 1fr);
  }

  .platform-admin-application-actions,
  .platform-admin-application-actions form,
  .workspace-application-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .platform-admin-application-actions .button,
  .workspace-application-actions .button {
    width: 100%;
  }
}

/* Guest entry → Mini Program handoff. */
.miniapp-handoff-page {
  display: grid;
  gap: 18px;
  min-height: calc(100svh - 42px);
  align-content: start;
  padding-top: 20px;
  padding-bottom: calc(28px + env(safe-area-inset-bottom));
}

.miniapp-handoff-page .mic-live-bar {
  display: flex;
  align-items: center;
  margin-bottom: 4px;
}

.miniapp-handoff-page .mic-avatar-fallback {
  display: grid;
  place-items: center;
  margin: 0;
  background: var(--brand-grad, var(--accent));
  background-color: var(--accent);
  color: var(--primary-contrast);
  font-size: 22px;
  font-weight: 850;
}

.miniapp-handoff-copy {
  display: grid;
  gap: 10px;
  text-align: center;
}

.miniapp-handoff-copy h1,
.miniapp-handoff-copy p {
  margin: 0;
}

.miniapp-handoff-copy h1 {
  color: var(--text);
  font-size: clamp(26px, 7vw, 36px);
  line-height: 1.15;
  text-wrap: balance;
}

.miniapp-handoff-copy .muted,
.miniapp-handoff-hint {
  font-size: 15px;
  line-height: 1.65;
}

.miniapp-handoff-hint {
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--accent-soft);
  color: var(--text);
}

.miniapp-handoff-steps {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.miniapp-handoff-steps li {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 58px;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 12px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.miniapp-handoff-steps strong {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  background: var(--brand-grad, var(--accent));
  background-color: var(--accent);
  color: var(--primary-contrast);
}

.miniapp-handoff-steps span {
  color: var(--text);
  font-size: 15px;
  font-weight: 750;
  line-height: 1.45;
}

.miniapp-code-block {
  display: grid;
  justify-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  background: var(--surface);
}

.miniapp-code-block img {
  width: min(68vw, 240px);
  height: auto;
  border-radius: 12px;
}

.miniapp-code-block p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.miniapp-handoff-privacy {
  border-radius: 14px;
}

.miniapp-handoff-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
  color: var(--muted);
  font-size: 13px;
}

.miniapp-handoff-footer .text-link {
  display: inline-flex;
  align-items: center;
}

.legal-doc {
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  padding: 12px 14px;
  background: var(--surface, #fff);
}

.legal-doc-title {
  margin: 0 0 2px;
  font-size: 15px;
}

.legal-doc-meta {
  margin: 0 0 8px;
  color: var(--muted, #6b7280);
  font-size: 12px;
}

.legal-doc-body {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--text, #111827);
  font-size: 13px;
  line-height: 1.7;
}

.legal-doc-body strong {
  border-radius: 3px;
  padding: 0 1px;
  background: color-mix(in srgb, var(--primary, #d84f5f) 12%, transparent);
  font-weight: 800;
}

.legal-page {
  display: grid;
  gap: 12px;
}

.legal-page h1 {
  margin: 0;
}

.legal-page .legal-doc-title {
  font-size: 16px;
}

/* ---- Projection surface on an iPad / touch device (2026-09-03) ----
   A long-press must not select text or open the image callout, a double-tap
   must not zoom, and a drag on the page must not rubber-band or pull-to-refresh.
   The ink canvas keeps its own touch-action: none for strokes. */
.dsp2-root,
.board-page {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
}

.dsp2-root canvas {
  touch-action: none;
}

body:has(.dsp2-root),
body:has(.board-page) {
  overscroll-behavior: none;
}

/* ---- Phone console (<=520px) ----
   The header is a two-column flex row; a long projection mirror line widened
   the status column until 直播资料台 wrapped to two lines. Let the mirror wrap
   inside a narrower column instead. The detail/admin sheets sit under the fixed
   bottom bar, so give their scroll bodies room for the last card to clear it. */
@media (max-width: 520px) {
  .mm2-display-mirror {
    max-width: 176px;
    white-space: normal;
    line-height: 1.3;
  }

  .mm2-detail-sheet .mm2-sheet-body,
  .mm2-admin-sheet .mm2-sheet-body {
    padding-bottom: calc(150px + env(safe-area-inset-bottom));
  }
}
