:root {
  --bg: #f3f0ea;
  --bg-deep: #ebe6dc;
  --card: #fdfbf7;
  --surface: rgba(253, 251, 247, 0.82);
  --surface-solid: #fdfbf7;
  --primary: #1a4d3e;
  --primary-light: #2d6b58;
  --primary-bg: rgba(232, 242, 236, 0.88);
  --text: #0c1a15;
  --text-secondary: #6d7a74;
  --border: rgba(184, 149, 106, 0.2);
  --border-soft: rgba(184, 149, 106, 0.12);
  --danger: #b45309;
  --danger-bg: #fff8f3;
  --info: #475569;
  --info-bg: rgba(248, 250, 252, 0.9);
  --success: #1f6b4f;
  --success-bg: rgba(245, 252, 248, 0.92);
  --shadow: 0 8px 28px rgba(12, 26, 21, 0.06);
  --shadow-soft: 0 4px 16px rgba(12, 26, 21, 0.04);
  --radius: 18px;
  --radius-sm: 14px;
  --space-page: 18px;
  --card-paper: #faf7f2;
  --card-paper-deep: #f3efe6;
  --card-ink: #0c1a15;
  --card-muted: #6d7a74;
  --card-accent: #1a4d3e;
  --card-accent-soft: rgba(26, 77, 62, 0.12);
  --card-gold: #b8956a;
  --card-gold-soft: rgba(184, 149, 106, 0.35);
  --card-radius: 26px;
  --card-serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(ellipse 120% 80% at 50% -20%, rgba(184, 149, 106, 0.12) 0%, transparent 55%),
    radial-gradient(ellipse 90% 60% at 100% 100%, rgba(26, 77, 62, 0.06) 0%, transparent 50%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
  color: var(--text);
  height: 100dvh;
  overflow: hidden;
  line-height: 1.55;
  letter-spacing: 0.01em;
}

#app {
  max-width: 430px;
  margin: 0 auto;
  height: 100dvh;
  overflow: hidden;
  position: relative;
}

.screen {
  display: none;
}

.screen.active {
  display: flex;
}

.screen-shell {
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
}

.screen-body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 12px var(--space-page) 0;
}

.screen-footer {
  flex-shrink: 0;
  padding: 12px var(--space-page) calc(12px + env(safe-area-inset-bottom, 0px));
  background: rgba(253, 251, 247, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border-soft);
  box-shadow: 0 -8px 24px rgba(12, 26, 21, 0.04);
}

.setup-body {
  padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
}

.select-body {
  padding-bottom: 0;
}

.results-body {
  padding-bottom: 0;
}

.select-card-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  padding: 6px 0 12px;
  overflow: visible;
  position: relative;
}

.select-card-stage::before {
  content: '';
  position: absolute;
  inset: 8% 12% 12%;
  background: radial-gradient(ellipse at 50% 40%, rgba(184, 149, 106, 0.08) 0%, transparent 68%);
  pointer-events: none;
  z-index: 0;
}

.select-card-stage .card-pair {
  position: relative;
  z-index: 1;
}

.select-body .staging-slot {
  height: 72px;
}

.select-body .staging-header {
  margin-bottom: 8px;
}

.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.no-scrollbar::-webkit-scrollbar {
  display: none;
}

/* Header */
.app-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-shrink: 0;
  padding: 2px 0;
}

.app-header-compact {
  margin-bottom: 10px;
}

.app-header-compact h1 {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.app-header-compact .subtitle {
  font-size: 11px;
  color: var(--card-muted);
  letter-spacing: 0.03em;
}

.logo-sm {
  width: 38px;
  height: 38px;
  font-size: 18px;
  border-radius: 12px;
}

.app-header.with-actions {
  justify-content: space-between;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.logo {
  width: 42px;
  height: 42px;
  background:
    linear-gradient(145deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.2) inset,
    0 0 0 1px rgba(184, 149, 106, 0.18),
    0 6px 16px rgba(26, 77, 62, 0.16);
}

.app-header h1 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--card-ink);
}

.subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 3px;
  line-height: 1.45;
}

/* Card */
.card {
  background: var(--surface-solid, var(--card));
  border-radius: var(--radius);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-soft);
  padding: 16px;
}

.form-card {
  margin-bottom: 16px;
}

/* Wizard */
.wizard-progress {
  margin-bottom: 8px;
  flex-shrink: 0;
}

.wizard-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 6px;
}

.wizard-step-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--border-soft);
  color: var(--card-muted);
  font-size: 10px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.wizard-step-dot.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: none;
}

.wizard-step-dot.done {
  background: rgba(255, 255, 255, 0.6);
  border-color: rgba(26, 77, 62, 0.22);
  color: var(--primary);
}

.wizard-step-line {
  width: 18px;
  height: 1px;
  background: var(--border-soft);
}

.wizard-step-line.done {
  background: rgba(26, 77, 62, 0.2);
}

.wizard-step-label {
  text-align: center;
  font-size: 10px;
  color: rgba(109, 122, 116, 0.85);
  letter-spacing: 0.08em;
}

#screen-setup.active {
  display: flex;
}

.wizard-card {
  flex: 1;
  min-height: 0;
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 14px 16px;
}

.card.wizard-card {
  background: rgba(255, 255, 255, 0.52);
  box-shadow: none;
  border-color: rgba(184, 149, 106, 0.1);
}

.wizard-panel {
  display: none;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.wizard-panel.active {
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.25s ease;
  min-height: 0;
  overflow: hidden;
}

.wizard-panel-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-right: 2px;
  margin-right: -2px;
}

.wizard-panel-scroll::-webkit-scrollbar {
  width: 4px;
}

.wizard-panel-scroll::-webkit-scrollbar-thumb {
  background: rgba(26, 77, 62, 0.15);
  border-radius: 4px;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.wizard-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
  flex-shrink: 0;
  color: var(--card-ink);
  letter-spacing: 0.02em;
}

.wizard-desc {
  font-size: 11px;
  color: rgba(109, 122, 116, 0.92);
  margin-bottom: 14px;
  line-height: 1.45;
  flex-shrink: 0;
}

.wizard-name-field {
  margin-top: 4px;
}

.wizard-step2-industry {
  margin-bottom: 10px;
  flex-shrink: 0;
}

.wizard-step2-industry.hidden {
  display: none;
}

.wizard-industry-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--card-ink);
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--border-soft);
}

.wizard-name-field input {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: var(--surface-solid);
  font-size: 15px;
  color: var(--card-ink);
}

.wizard-name-field input:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(45, 74, 62, 0.08);
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  flex: 1;
  min-height: 0;
  align-content: start;
}

.option-grid-industry {
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.option-grid-industry .option-card {
  padding: 12px 8px;
}

.option-grid-industry .option-icon {
  font-size: 24px;
  margin-bottom: 6px;
}

.option-grid-industry .option-label {
  font-size: 12px;
  line-height: 1.3;
}

.option-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.option-card {
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 12px 8px;
  background: rgba(255, 255, 255, 0.38);
  cursor: pointer;
  text-align: center;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.option-card:active {
  transform: scale(0.99);
}

.option-card.selected {
  border-color: rgba(26, 77, 62, 0.28);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: none;
}

.wizard-panel-tone {
  overflow: hidden;
}

.wizard-panel-tone .wizard-title {
  margin-bottom: 3px;
}

.wizard-panel-tone .wizard-desc {
  margin-bottom: 10px;
}

.tone-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.tone-section-audience {
  flex-shrink: 0;
}

.tone-section {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-height: 0;
}

.tone-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(109, 122, 116, 0.88);
}

.option-grid-tone {
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  flex: unset;
}

.option-grid-audience {
  flex: 1;
  align-content: start;
}

.option-card-tone {
  padding: 12px 8px 10px;
  border-radius: 10px;
  min-height: 0;
}

.option-card-tone .option-icon {
  font-size: 20px;
  margin-bottom: 5px;
  line-height: 1;
}

.option-card-tone .option-label {
  font-size: 12px;
  line-height: 1.3;
  letter-spacing: 0.02em;
}

.option-icon {
  font-size: 22px;
  line-height: 1;
  margin-bottom: 6px;
}

.option-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.wizard-panel-prefs {
  overflow: hidden;
}

.prefs-card {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 4px 0 0;
}

.prefs-divider {
  height: 1px;
  margin: 10px 0;
  background: var(--border-soft);
}

.lang-list-compact {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pref-lang-row {
  display: grid;
  grid-template-columns: 1fr auto 18px;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 14px 14px;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.42);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: border-color 0.18s ease, background 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}

.pref-lang-row:active {
  transform: scale(0.995);
}

.pref-lang-row.selected {
  border-color: rgba(26, 77, 62, 0.28);
  background: rgba(255, 255, 255, 0.72);
}

.pref-lang-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--card-ink);
  letter-spacing: 0.02em;
}

.pref-lang-sample {
  font-family: var(--card-serif);
  font-size: 14px;
  color: var(--card-muted);
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 10em;
}

.pref-lang-row.selected .pref-lang-sample {
  color: var(--card-ink);
}

.lang-card-en .pref-lang-sample {
  font-family: Georgia, 'Times New Roman', serif;
  font-style: italic;
}

.pref-lang-check {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  opacity: 0;
  transition: opacity 0.15s ease;
}

.pref-lang-row.selected .pref-lang-check {
  opacity: 1;
}

.length-picker {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.38);
  overflow: hidden;
}

.length-option {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 2px;
  border: none;
  border-right: 1px solid var(--border-soft);
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}

.length-option:last-child {
  border-right: none;
}

.length-option:active {
  background: rgba(255, 255, 255, 0.4);
}

.length-option.selected {
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 -2px 0 var(--primary);
}

.length-option-text {
  font-size: 11px;
  font-weight: 600;
  color: var(--card-ink);
  letter-spacing: 0.02em;
  line-height: 1.25;
  text-align: center;
}

.length-option-text i {
  display: block;
  font-style: normal;
  font-size: 9px;
  font-weight: 500;
  color: var(--card-muted);
  margin-top: 1px;
}

.length-option.selected .length-option-text {
  color: var(--primary);
}

.length-option.selected .length-option-text i {
  color: rgba(26, 77, 62, 0.65);
}

.length-picker-note {
  font-size: 11px;
  color: rgba(109, 122, 116, 0.72);
  text-align: center;
  margin: 8px 0 0;
  letter-spacing: 0.02em;
  min-height: 1.3em;
}

.lang-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-height: 0;
  justify-content: center;
  overflow: hidden;
}

.wizard-panel-lang {
  overflow: hidden;
}

.wizard-panel-lang .lang-list {
  flex: 1;
  min-height: 0;
  gap: 7px;
  justify-content: stretch;
  overflow: hidden;
  padding: 0;
}

.wizard-panel-prefs .lang-list {
  flex: none;
  overflow: visible;
  padding: 0;
}

.lang-card {
  position: relative;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 10px 14px 11px;
  background: rgba(255, 255, 255, 0.42);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s ease, background 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 5px;
  overflow: hidden;
}

.wizard-panel-lang .lang-card {
  flex: 1;
  min-height: 0;
}

.lang-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lang-card-mark {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--card-muted);
  flex-shrink: 0;
}

.lang-card-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--card-ink);
  flex: 1;
  min-width: 0;
}

.lang-card-cn .lang-card-mark {
  font-family: var(--card-serif);
  font-size: 13px;
}

.lang-card-cn .lang-sample {
  font-family: var(--card-serif);
  letter-spacing: 0.18em;
  text-indent: 0.18em;
}

.lang-card-en .lang-card-mark {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 10px;
  font-style: italic;
  font-weight: 600;
}

.lang-card-en .lang-sample {
  font-family: Georgia, 'Times New Roman', serif;
  font-style: italic;
  letter-spacing: 0.04em;
  text-indent: 0;
}

.lang-card-mix .lang-card-mark {
  font-size: 9px;
  letter-spacing: 0;
}

.lang-card-mix .lang-sample {
  font-family: var(--card-serif);
  letter-spacing: 0.06em;
  text-indent: 0;
}

.lang-card:active {
  transform: scale(0.995);
}

.lang-card.selected {
  border-color: rgba(26, 77, 62, 0.3);
  background: rgba(255, 255, 255, 0.74);
}

.lang-card.selected .lang-card-mark,
.lang-card.selected .lang-card-label {
  color: var(--primary);
}

.lang-card.selected .lang-card-check {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.lang-card-check {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: transparent;
  background: transparent;
  flex-shrink: 0;
  margin-left: auto;
}

.lang-sample {
  font-size: clamp(20px, 5.5vw, 26px);
  font-weight: 600;
  color: var(--card-ink);
  line-height: 1.25;
  text-align: center;
  padding: 4px 0 2px;
  font-family: var(--card-serif);
}

.lang-card-hint {
  font-size: 10px;
  color: rgba(109, 122, 116, 0.72);
  letter-spacing: 0.05em;
  line-height: 1.4;
  text-align: center;
  margin: 0;
}

.lang-card.selected .lang-card-hint {
  color: rgba(61, 58, 52, 0.5);
}

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

.wizard-panel-details {
  overflow: hidden;
}

.wizard-panel-details .wizard-title {
  margin-bottom: 3px;
}

.wizard-panel-details .wizard-desc {
  margin-bottom: 12px;
}

.details-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
}

.details-section-notes {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 13px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.42);
  border: 1px solid var(--border-soft);
}

.details-notes-area {
  flex: 1;
  min-height: 96px;
  width: 100%;
  padding: 12px 13px;
  border: 1px solid var(--border-soft);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.55);
  font-size: 14px;
  line-height: 1.65;
  color: var(--card-ink);
  font-family: inherit;
  resize: none;
}

.details-notes-area::placeholder {
  color: rgba(61, 58, 52, 0.36);
  font-size: 13px;
}

.details-notes-area:focus {
  outline: none;
  border-color: rgba(26, 77, 62, 0.28);
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 0 3px rgba(26, 77, 62, 0.06);
}

.details-notes-hints {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  flex-shrink: 0;
}

.details-hint-chip {
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  color: var(--card-ink);
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.details-hint-chip:active {
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(26, 77, 62, 0.22);
}

.details-section-import {
  flex: 0.85;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 13px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.42);
  border: 1px solid var(--border-soft);
}

.details-section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.details-section-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--card-ink);
}

.details-optional {
  font-size: 10px;
  color: var(--card-muted);
  letter-spacing: 0.04em;
}

.details-section-import .details-import-area,
.details-import-area {
  flex: 1;
  min-height: 56px;
  width: 100%;
  padding: 12px 13px;
  border: 1px solid var(--border-soft);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.55);
  font-size: 13px;
  line-height: 1.55;
  color: var(--card-ink);
  font-family: inherit;
  resize: none;
}

.details-import-area::placeholder {
  color: rgba(61, 58, 52, 0.36);
}

.details-import-area:focus {
  outline: none;
  border-color: rgba(26, 77, 62, 0.28);
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 0 3px rgba(26, 77, 62, 0.06);
}

.details-section-import .import-actions {
  flex-shrink: 0;
  margin-top: 0;
}

.details-section-import .import-names-status {
  flex-shrink: 0;
  margin-top: 0;
}

.details-section-import .import-names-preview {
  flex-shrink: 0;
  max-height: 56px;
  overflow-y: auto;
}

.setup-import-badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(26, 77, 62, 0.08);
  color: var(--primary);
  letter-spacing: 0.02em;
}

.setup-import-badge.hidden {
  display: none;
}

.setup-section {
  background: rgba(255, 255, 255, 0.42);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 14px 12px;
  margin-bottom: 10px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
}

.setup-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.setup-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--card-ink);
  letter-spacing: 0.04em;
}

.setup-section-desc {
  font-size: 11px;
  color: var(--text-secondary);
  margin: -4px 0 10px;
  line-height: 1.5;
}

.setup-section-import .field-compact {
  margin-bottom: 0;
}

.field-inline {
  margin-bottom: 0;
}

.import-btn-icon {
  font-size: 12px;
  line-height: 1;
}

.field-compact {
  margin-bottom: 10px;
}

.field-compact .label {
  margin-bottom: 5px;
  font-size: 12px;
}

.field-compact input {
  padding: 9px 10px;
  font-size: 14px;
}

.field-hint {
  font-size: 11px;
  line-height: 1.45;
  color: var(--text-secondary);
  margin: -2px 0 8px;
}

.import-names-section {
  margin-bottom: 10px;
  padding-top: 4px;
  border-top: 1px dashed var(--border);
}

.import-names-text {
  width: 100%;
  min-height: 88px;
  padding: 12px;
  font-size: 13px;
  line-height: 1.55;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.55);
  resize: vertical;
  font-family: inherit;
}

.import-names-text:focus {
  outline: none;
  border-color: rgba(26, 77, 62, 0.32);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 0 0 3px rgba(26, 77, 62, 0.07);
}

.import-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.import-file-btn {
  position: relative;
  cursor: pointer;
  margin: 0;
}

.import-clear-btn.hidden {
  display: none;
}

.import-names-status {
  margin-top: 10px;
  font-size: 12px;
  color: var(--primary);
  font-weight: 500;
}

.import-names-status.hidden,
.import-names-preview.hidden {
  display: none;
}

.import-names-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.import-tag {
  font-size: 11px;
  padding: 4px 9px;
  border-radius: 20px;
  background: var(--primary-bg);
  color: var(--primary-light);
  border: 1px solid rgba(26, 77, 62, 0.1);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.import-more {
  font-size: 11px;
  color: var(--text-secondary);
  align-self: center;
}

.length-grid-compact {
  gap: 6px;
}

.length-grid-compact .length-card {
  padding: 8px 6px;
}

.length-grid-compact .length-card-label {
  font-size: 12px;
  margin-bottom: 2px;
}

.length-grid-compact .length-card-range {
  font-size: 10px;
}

.ai-banner-compact {
  margin-top: 8px;
  padding-top: 0;
  border-top: none;
}

.optional-tag {
  font-size: 10px;
  color: var(--card-muted);
  font-weight: 500;
  background: rgba(255, 255, 255, 0.55);
  padding: 2px 7px;
  border-radius: 999px;
  margin-left: 4px;
  border: 1px solid var(--border-soft);
}

.required-tag {
  font-size: 10px;
  color: #9f3a3a;
  font-weight: 600;
  background: rgba(255, 248, 248, 0.72);
  padding: 2px 7px;
  border-radius: 999px;
  margin-left: 4px;
  border: 1px solid rgba(159, 58, 58, 0.12);
}

.collab-card.input-readonly-wrap .input-readonly,
input.input-readonly {
  background: rgba(255, 255, 255, 0.35);
  color: var(--card-muted);
  letter-spacing: 0.12em;
  font-weight: 600;
}

.wizard-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px var(--space-page) calc(10px + env(safe-area-inset-bottom, 0px));
  background: rgba(253, 251, 247, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border-soft);
  box-shadow: 0 -8px 24px rgba(12, 26, 21, 0.05);
  z-index: 200;
}

.wizard-nav-meta {
  display: flex;
  justify-content: center;
}

.wizard-nav-meta.hidden {
  display: none;
}

.wizard-ai-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid var(--border-soft);
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

.wizard-ai-pill.ready {
  background: var(--primary-bg);
  border-color: rgba(26, 77, 62, 0.15);
  color: var(--primary);
}

.wizard-ai-pill.warn {
  background: #fef2f2;
  border-color: rgba(239, 68, 68, 0.2);
  color: #b91c1c;
}

.wizard-nav-buttons {
  display: flex;
  gap: 10px;
  align-items: center;
}

.wizard-back {
  min-width: 90px;
}

.wizard-next {
  flex: 1;
}

.wizard-final {
  flex: 1;
}

.wizard-final .btn-wide {
  width: 100%;
}

.field {
  display: block;
  margin-bottom: 18px;
}

.field:last-child {
  margin-bottom: 0;
}

.label {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

input[type="text"],
input[type="password"],
select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  font-size: 15px;
  background: rgba(255, 255, 255, 0.55);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

input:focus,
select:focus {
  border-color: rgba(26, 77, 62, 0.32);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 0 0 3px rgba(26, 77, 62, 0.07);
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

/* Segmented control */
.segmented {
  display: flex;
  background: rgba(255, 255, 255, 0.48);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 4px;
  gap: 4px;
}

.seg-btn {
  flex: 1;
  padding: 10px 6px;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.seg-btn.active {
  background: #fff;
  color: var(--primary);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
}

.checkbox-field input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.field-hint {
  font-size: 12px;
  color: var(--text-secondary);
  margin: -4px 0 10px;
  line-height: 1.5;
}

.length-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.length-card-full {
  grid-column: 1 / -1;
}

.length-card {
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 12px 10px;
  background: rgba(255, 255, 255, 0.38);
  cursor: pointer;
  text-align: center;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.length-card.selected {
  border-color: rgba(26, 77, 62, 0.28);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: none;
}

.length-card-label {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.length-card-range {
  font-size: 12px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.length-card.selected .length-card-range {
  color: var(--primary);
}

.ai-banner {
  margin-top: 4px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ai-hint {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.ai-status {
  display: inline-block;
  align-self: flex-start;
  font-size: 11px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  color: var(--card-muted);
  border: 1px solid var(--border-soft);
  letter-spacing: 0.04em;
}

.ai-status.ready {
  background: var(--primary-bg);
  color: var(--primary);
}

.ai-status.warn {
  background: #fff7ed;
  color: #c2410c;
}

.hidden {
  display: none !important;
}

/* Buttons */
.action-row {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 13px 18px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
  letter-spacing: 0.03em;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(145deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff;
  flex: 1;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.18) inset,
    0 8px 22px rgba(26, 77, 62, 0.22);
}

.btn-primary:active {
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.12) inset,
    0 4px 12px rgba(26, 77, 62, 0.18);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.72);
  color: var(--card-ink);
  border: 1px solid var(--border-soft);
  min-width: 90px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
}

.btn-wide {
  flex: 1;
}

.btn-block {
  width: 100%;
  display: flex;
}

.btn-icon {
  font-size: 16px;
}

.icon-btn {
  width: 42px;
  height: 42px;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
  transition: transform 0.16s ease, background 0.16s ease;
}

.icon-btn:active {
  transform: scale(0.96);
  background: rgba(255, 255, 255, 0.92);
}

.icon-btn-lg {
  width: 46px;
  height: 46px;
}

/* Select screen */
.select-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  color: var(--card-muted);
  margin-bottom: 10px;
  padding: 7px 12px;
  flex-shrink: 0;
  min-height: 18px;
  background: rgba(255, 255, 255, 0.42);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  letter-spacing: 0.04em;
}

#queue-status:not(.is-idle) {
  color: var(--primary-light);
  font-weight: 600;
}

#queue-status.is-idle {
  visibility: hidden;
}

.card-pair {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 10px;
  flex: 1;
  width: 100%;
  min-height: 0;
  max-height: min(50dvh, 440px);
  padding: 4px 0 8px;
  overflow: visible;
}

.card-stack {
  position: relative;
  width: min(280px, 90%);
  height: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

.card-stack-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.card-stack-deck {
  position: relative;
  width: 100%;
  height: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: visible;
  padding: 0 6px;
}

.card-stack-active {
  position: relative;
  z-index: 10;
  width: 100%;
  flex: 1;
  min-height: 0;
  max-height: calc(100% - 48px);
  display: flex;
  align-items: stretch;
  justify-content: center;
}

.card-stack-active .name-card {
  width: 100%;
  height: auto;
  max-height: 100%;
  aspect-ratio: 5 / 7.2;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.92) inset,
    0 0 0 1px rgba(184, 149, 106, 0.14),
    0 0 0 2px rgba(255, 255, 255, 0.55),
    0 28px 60px rgba(12, 26, 21, 0.12),
    0 10px 24px rgba(26, 77, 62, 0.08);
}

/* 层叠唇边 · 信笺叠放 */
.card-stack-lip {
  position: relative;
  flex-shrink: 0;
  height: 24px;
  margin-top: -11px;
  border-radius: 0 0 20px 20px;
  border: 1px solid rgba(184, 149, 106, 0.12);
  border-top: none;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.75) inset,
    0 10px 22px rgba(12, 26, 21, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  pointer-events: none;
  transform-origin: 50% 0%;
  align-self: center;
}

.card-stack-lip::before {
  content: '';
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--card-gold-soft), transparent);
}

.card-stack-lip::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    -18deg,
    transparent,
    transparent 5px,
    rgba(12, 26, 21, 0.012) 5px,
    rgba(12, 26, 21, 0.012) 6px
  );
  pointer-events: none;
}

.card-stack-lip-1 {
  width: 93%;
  z-index: 9;
  margin-top: -12px;
  margin-left: -5px;
  border-radius: 0 0 20px 16px;
  filter: brightness(0.98);
  transform: rotate(-1.6deg) translateX(-6px);
}

.card-stack-lip-2 {
  width: 87%;
  z-index: 8;
  margin-top: -7px;
  margin-left: 8px;
  height: 20px;
  border-radius: 0 0 14px 20px;
  filter: brightness(0.96);
  opacity: 0.92;
  transform: rotate(2.1deg) translateX(8px);
}

.card-stack-lip-3 {
  width: 84%;
  z-index: 7;
  margin-top: -5px;
  margin-left: -3px;
  height: 18px;
  border-radius: 0 0 18px 14px;
  filter: brightness(0.94);
  opacity: 0.84;
  transform: rotate(-0.8deg) translateX(-3px) translateY(1px);
}

.card-stack-lip-ghost.card-stack-lip-1 {
  transform: rotate(-1.4deg) translateX(-5px);
  margin-left: -4px;
}

.card-stack-lip-ghost.card-stack-lip-2 {
  transform: rotate(1.7deg) translateX(7px);
  margin-left: 6px;
}

.card-stack-lip-ghost.card-stack-lip-3 {
  transform: rotate(-1deg) translateX(2px);
  margin-left: -2px;
}

.card-stack-lip.accent-a {
  background:
    radial-gradient(ellipse 100% 90% at 85% 0%, rgba(232, 242, 236, 0.9) 0%, transparent 58%),
    linear-gradient(175deg, #faf7f2 0%, #f0ebe2 100%);
}

.card-stack-lip.accent-b {
  background:
    radial-gradient(ellipse 100% 90% at 15% 0%, rgba(238, 244, 250, 0.92) 0%, transparent 58%),
    linear-gradient(175deg, #fbfaf8 0%, #eef1f4 100%);
}

.card-stack-lip-text {
  font-family: var(--card-serif);
  font-size: 11px;
  font-weight: 600;
  color: rgba(12, 26, 21, 0.32);
  letter-spacing: 0.06em;
  padding: 0 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  transform: rotate(0.6deg);
}

.card-stack-lip-2 .card-stack-lip-text {
  transform: rotate(-0.8deg);
}

.card-stack-lip-3 .card-stack-lip-text {
  transform: rotate(0.4deg);
}

.card-stack-lip-ghost {
  background: linear-gradient(180deg, rgba(249, 250, 251, 0.98) 0%, rgba(238, 243, 239, 0.92) 100%);
}

.card-stack-lip-ghost::after {
  content: '';
  display: block;
  width: 36%;
  height: 4px;
  border-radius: 4px;
  background: rgba(26, 77, 62, 0.08);
}

.card-slot-single {
  flex: 0 1 auto;
  width: 100%;
  max-width: min(280px, 90%);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

.card-slot {
  flex: 1;
  min-width: 0;
  max-width: 48%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

.card-slot-left {
  z-index: 1;
}

.card-slot-right {
  z-index: 2;
}

.name-card {
  position: relative;
  width: 100%;
  height: 100%;
  max-height: 100%;
  aspect-ratio: 5 / 8.5;
  max-width: 182px;
  touch-action: none;
  user-select: none;
  cursor: grab;
  overflow: hidden;
  border-radius: var(--card-radius);
  transform-origin: center center;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 0 0 1px rgba(184, 149, 106, 0.16),
    0 0 0 2px rgba(255, 255, 255, 0.5),
    0 24px 56px rgba(12, 26, 21, 0.11),
    0 8px 20px rgba(26, 77, 62, 0.06);
  border: none;
  transition: box-shadow 0.28s ease, transform 0.28s ease;
}

.name-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 2;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
}

.name-card.card-left {
  transform: rotate(-4deg);
}

.name-card.card-right {
  transform: rotate(4deg);
}

.name-card.card-single {
  transform: none;
  max-width: 280px;
  width: 100%;
}

.card-stack-active .name-card.card-single {
  max-width: none;
}

.card-stack-active .card-inner {
  padding: 16px 16px 12px;
}

.card-stack-active .card-desc {
  font-size: 12px;
  -webkit-line-clamp: 4;
}

.card-stack-active .card-name {
  font-size: 26px;
  margin-bottom: 0;
}

.card-stack-active .card-act {
  height: 38px;
}

.name-card.card-enter.card-single {
  animation: dealSingle 0.5s cubic-bezier(0.34, 1.2, 0.64, 1) forwards;
}

@keyframes dealSingle {
  from {
    opacity: 0;
    transform: translateY(28px) scale(0.96) rotate(-0.6deg);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.name-card.accent-a {
  background:
    radial-gradient(ellipse 90% 70% at 92% 8%, rgba(232, 242, 236, 0.85) 0%, transparent 52%),
    radial-gradient(ellipse 60% 50% at 8% 92%, rgba(245, 236, 220, 0.45) 0%, transparent 55%),
    linear-gradient(172deg, #fdfbf7 0%, var(--card-paper) 38%, var(--card-paper-deep) 100%);
}

.name-card.accent-b {
  background:
    radial-gradient(ellipse 90% 70% at 8% 8%, rgba(236, 242, 250, 0.88) 0%, transparent 52%),
    radial-gradient(ellipse 60% 50% at 92% 92%, rgba(240, 244, 248, 0.5) 0%, transparent 55%),
    linear-gradient(172deg, #fcfcfb 0%, #f7f6f3 38%, #eceff2 100%);
}

.card-texture {
  position: absolute;
  inset: 0;
  opacity: 0.55;
  background-image:
    radial-gradient(circle at 18% 22%, rgba(255, 255, 255, 0.75) 0%, transparent 48%),
    radial-gradient(circle at 82% 78%, rgba(184, 149, 106, 0.06) 0%, transparent 42%),
    repeating-linear-gradient(
      -14deg,
      transparent,
      transparent 4px,
      rgba(12, 26, 21, 0.012) 4px,
      rgba(12, 26, 21, 0.012) 5px
    );
  pointer-events: none;
  z-index: 0;
}

.card-frame {
  position: absolute;
  inset: 10px;
  border-radius: calc(var(--card-radius) - 12px);
  border: 1px solid rgba(184, 149, 106, 0.18);
  pointer-events: none;
  z-index: 1;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.card-accent-line {
  position: absolute;
  top: 0;
  left: 18%;
  right: 18%;
  height: 2px;
  border-radius: 0 0 2px 2px;
  background: linear-gradient(90deg, transparent, var(--card-gold) 22%, rgba(26, 77, 62, 0.55) 50%, var(--card-gold) 78%, transparent);
  pointer-events: none;
  z-index: 3;
  opacity: 0.72;
}

.card-flash {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 3;
  opacity: 0;
}

.card-flash.flash-reject {
  animation: flashReject 0.56s ease forwards;
  opacity: 1;
  background: linear-gradient(90deg, rgba(254, 202, 202, 0.72) 0%, rgba(254, 226, 226, 0.35) 28%, transparent 55%);
}

.card-flash.flash-keep {
  animation: flashKeep 0.56s ease forwards;
  opacity: 1;
  background: linear-gradient(270deg, rgba(187, 247, 208, 0.72) 0%, rgba(220, 252, 231, 0.35) 28%, transparent 55%);
}

.card-flash.flash-stash {
  animation: flashStash 0.55s ease forwards;
}

@keyframes flashReject {
  0% { opacity: 0.85; }
  100% { opacity: 0; }
}

@keyframes flashKeep {
  0% { opacity: 0.85; }
  100% { opacity: 0; }
}

@keyframes flashStash {
  0%, 100% { opacity: 0; background: transparent; }
  30% { opacity: 1; background: linear-gradient(180deg, transparent 30%, rgba(219, 234, 254, 0.45)); }
}

.card-inner {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 18px 16px 14px;
}

.card-shine {
  position: absolute;
  top: -20%;
  left: -8%;
  width: 70%;
  height: 55%;
  background: radial-gradient(ellipse at 20% 10%, rgba(255, 255, 255, 0.72) 0%, transparent 68%);
  pointer-events: none;
  z-index: 1;
}

.name-card.card-enter.card-left {
  animation: dealLeft 0.5s cubic-bezier(0.34, 1.2, 0.64, 1) forwards;
}

.name-card.card-enter.card-right {
  animation: dealRight 0.5s cubic-bezier(0.34, 1.2, 0.64, 1) 0.08s forwards;
  opacity: 0;
}

@keyframes dealLeft {
  from {
    opacity: 0;
    transform: rotate(-10deg) translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: rotate(-4deg);
  }
}

@keyframes dealRight {
  from {
    opacity: 0;
    transform: rotate(10deg) translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: rotate(4deg);
  }
}

.card-corner,
.card-hint {
  display: none;
}

.card-swipe-edge {
  position: absolute;
  top: 8%;
  bottom: 8%;
  width: 5px;
  border-radius: 6px;
  opacity: 0;
  pointer-events: none;
  z-index: 6;
  transition: opacity 0.06s linear, width 0.06s linear, box-shadow 0.06s linear;
}

.card-swipe-edge-left {
  left: 0;
  background: linear-gradient(180deg, rgba(239, 68, 68, 0) 0%, #ef4444 18%, #dc2626 82%, rgba(239, 68, 68, 0) 100%);
  box-shadow: 0 0 18px rgba(239, 68, 68, 0);
}

.card-swipe-edge-right {
  right: 0;
  background: linear-gradient(180deg, rgba(34, 197, 94, 0) 0%, #22c55e 18%, #16a34a 82%, rgba(34, 197, 94, 0) 100%);
  box-shadow: 0 0 18px rgba(34, 197, 94, 0);
}

.card-swipe-glow {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 4;
  opacity: 0;
  transition: opacity 0.06s linear;
}

.card-swipe-status {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.92);
  z-index: 7;
  font-family: var(--card-serif);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.2em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.08s ease, transform 0.08s ease;
  padding: 14px 22px;
  border-radius: 999px;
  border: 2px solid currentColor;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(6px);
}

.card-swipe-status.status-reject {
  color: #b45309;
  border-color: rgba(185, 83, 9, 0.35);
  text-shadow: none;
}

.card-swipe-status.status-keep {
  color: #1f6b4f;
  border-color: rgba(31, 107, 79, 0.35);
  text-shadow: none;
}

.card-swipe-status.status-stash {
  color: #475569;
  font-size: 20px;
  border-color: rgba(71, 85, 105, 0.3);
  text-shadow: none;
}

.name-card.is-dragging {
  transition: none;
  cursor: grabbing;
}

.name-card.swipe-drag-left {
  box-shadow:
    inset 5px 0 16px rgba(239, 68, 68, calc(var(--swipe-intensity, 0) * 0.4)),
    -4px 0 0 0 rgba(239, 68, 68, calc(var(--swipe-intensity, 0) * 1)),
    0 1px 0 rgba(255, 255, 255, 0.95) inset,
    0 16px 40px rgba(239, 68, 68, calc(var(--swipe-intensity, 0) * 0.12)),
    0 6px 18px rgba(0, 0, 0, 0.05);
}

.name-card.swipe-drag-left .card-swipe-edge-left {
  opacity: var(--swipe-intensity, 0);
  width: calc(5px + var(--swipe-intensity, 0) * 10px);
  box-shadow: 0 0 22px rgba(239, 68, 68, calc(var(--swipe-intensity, 0) * 0.85));
}

.name-card.swipe-drag-left .card-swipe-glow {
  opacity: 1;
  background: linear-gradient(90deg, rgba(254, 202, 202, calc(var(--swipe-intensity, 0) * 0.62)) 0%, rgba(254, 226, 226, calc(var(--swipe-intensity, 0) * 0.28)) 32%, transparent 58%);
}

.name-card.swipe-drag-left .card-swipe-status.status-reject {
  opacity: var(--swipe-intensity, 0);
  transform: translate(-50%, -50%) scale(calc(0.88 + var(--swipe-intensity, 0) * 0.18));
}

.name-card.swipe-drag-right {
  box-shadow:
    inset -5px 0 16px rgba(34, 197, 94, calc(var(--swipe-intensity, 0) * 0.4)),
    4px 0 0 0 rgba(34, 197, 94, calc(var(--swipe-intensity, 0) * 1)),
    0 1px 0 rgba(255, 255, 255, 0.95) inset,
    0 16px 40px rgba(34, 197, 94, calc(var(--swipe-intensity, 0) * 0.12)),
    0 6px 18px rgba(0, 0, 0, 0.05);
}

.name-card.swipe-drag-right .card-swipe-edge-right {
  opacity: var(--swipe-intensity, 0);
  width: calc(5px + var(--swipe-intensity, 0) * 10px);
  box-shadow: 0 0 22px rgba(34, 197, 94, calc(var(--swipe-intensity, 0) * 0.85));
}

.name-card.swipe-drag-right .card-swipe-glow {
  opacity: 1;
  background: linear-gradient(270deg, rgba(187, 247, 208, calc(var(--swipe-intensity, 0) * 0.62)) 0%, rgba(220, 252, 231, calc(var(--swipe-intensity, 0) * 0.28)) 32%, transparent 58%);
}

.name-card.swipe-drag-right .card-swipe-status.status-keep {
  opacity: var(--swipe-intensity, 0);
  transform: translate(-50%, -50%) scale(calc(0.88 + var(--swipe-intensity, 0) * 0.18));
}

.name-card.swiping-left {
  --swipe-intensity: 1;
}

.name-card.swiping-left .card-swipe-edge-left {
  opacity: 1;
  width: 14px;
  box-shadow: 0 0 28px rgba(239, 68, 68, 0.75);
}

.name-card.swiping-right {
  --swipe-intensity: 1;
}

.name-card.swiping-right .card-swipe-edge-right {
  opacity: 1;
  width: 14px;
  box-shadow: 0 0 28px rgba(34, 197, 94, 0.75);
}

.name-card:active {
  cursor: grabbing;
}

.name-card.card-left:active:not(.swiping-left):not(.swiping-right):not(.swiping-down):not(.swiping-partner-out) {
  transform: rotate(-2deg) translateY(-4px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.98) inset,
    0 0 0 1px rgba(26, 77, 62, 0.08),
    0 24px 56px rgba(26, 77, 62, 0.15),
    0 8px 20px rgba(0, 0, 0, 0.06);
}

.name-card.card-right:active:not(.swiping-left):not(.swiping-right):not(.swiping-down):not(.swiping-partner-out) {
  transform: rotate(2deg) translateY(-4px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.98) inset,
    0 0 0 1px rgba(26, 77, 62, 0.08),
    0 24px 56px rgba(26, 77, 62, 0.15),
    0 8px 20px rgba(0, 0, 0, 0.06);
}

/* 弃牌 · 选牌动画 */
.name-card.card-left.swiping-left {
  animation: rejectFromLeft 0.56s cubic-bezier(0.36, 0, 0.66, -0.12) forwards;
  z-index: 6;
}

.name-card.card-right.swiping-left {
  animation: rejectFromRight 0.56s cubic-bezier(0.36, 0, 0.66, -0.12) forwards;
  z-index: 6;
}

.name-card.card-left.swiping-right {
  animation: keepFromLeft 0.56s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  z-index: 6;
}

.name-card.card-right.swiping-right {
  animation: keepFromRight 0.56s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  z-index: 6;
}

.name-card.swiping-down {
  z-index: 6;
}

.name-card.card-left.swiping-down {
  animation: stashDownLeft 0.52s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.name-card.card-right.swiping-down {
  animation: stashDownRight 0.52s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.name-card.card-left.swiping-partner-out {
  animation: partnerOutLeft 0.44s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.name-card.card-right.swiping-partner-out {
  animation: partnerOutRight 0.44s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.name-card.card-single:active:not(.swiping-left):not(.swiping-right):not(.swiping-down) {
  transform: translateY(-4px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.98) inset,
    0 0 0 1px rgba(26, 77, 62, 0.08),
    0 24px 56px rgba(26, 77, 62, 0.15),
    0 8px 20px rgba(0, 0, 0, 0.06);
}

.name-card.card-single.swiping-left {
  animation: rejectFromSingle 0.56s cubic-bezier(0.36, 0, 0.66, -0.12) forwards;
  z-index: 6;
  box-shadow:
    inset 5px 0 18px rgba(239, 68, 68, 0.45),
    -4px 0 0 0 #ef4444,
    0 16px 40px rgba(239, 68, 68, 0.18);
}

.name-card.card-single.swiping-right {
  animation: keepFromSingle 0.56s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  z-index: 6;
  box-shadow:
    inset -5px 0 18px rgba(34, 197, 94, 0.45),
    4px 0 0 0 #22c55e,
    0 16px 40px rgba(34, 197, 94, 0.18);
}

.name-card.card-single.swiping-down {
  animation: stashDownSingle 0.52s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  z-index: 6;
}

@keyframes rejectFromSingle {
  0% { transform: scale(1); opacity: 1; box-shadow: inset 5px 0 18px rgba(239, 68, 68, 0.5), -4px 0 0 0 #ef4444; }
  20% { transform: translateX(-12%) scale(0.97); opacity: 1; }
  100% { transform: rotate(-18deg) translateX(-145%) scale(0.72); opacity: 0; filter: blur(1.5px); }
}

@keyframes keepFromSingle {
  0% { transform: scale(1); opacity: 1; box-shadow: inset -5px 0 18px rgba(34, 197, 94, 0.5), 4px 0 0 0 #22c55e; }
  25% { transform: translateX(10%) scale(1.04); opacity: 1; }
  100% { transform: rotate(16deg) translateX(145%) scale(0.82); opacity: 0; filter: blur(1px); }
}

@keyframes stashDownSingle {
  0% { transform: scale(1); opacity: 1; }
  35% { transform: translateY(18%) scale(0.94); opacity: 0.85; box-shadow: 0 12px 32px rgba(59, 130, 246, 0.2); }
  100% { transform: translateY(90%) scale(0.78); opacity: 0; filter: blur(2px); }
}

@keyframes rejectFromLeft {
  0% { transform: rotate(-4deg) scale(1); opacity: 1; }
  20% { transform: rotate(-8deg) translateX(-12%) scale(0.97); opacity: 1; }
  100% { transform: rotate(-26deg) translateX(-145%) scale(0.72); opacity: 0; filter: blur(1.5px); }
}

@keyframes rejectFromRight {
  0% { transform: rotate(4deg) scale(1); opacity: 1; }
  20% { transform: rotate(0deg) translateX(-12%) scale(0.97); opacity: 1; }
  100% { transform: rotate(-18deg) translateX(-145%) scale(0.72); opacity: 0; filter: blur(1.5px); }
}

@keyframes keepFromLeft {
  0% { transform: rotate(-4deg) scale(1); opacity: 1; }
  25% { transform: rotate(0deg) translateX(10%) scale(1.04); opacity: 1; box-shadow: 0 0 28px rgba(34, 197, 94, 0.28); }
  100% { transform: rotate(16deg) translateX(145%) scale(0.82); opacity: 0; filter: blur(1px); }
}

@keyframes keepFromRight {
  0% { transform: rotate(4deg) scale(1); opacity: 1; }
  25% { transform: rotate(8deg) translateX(10%) scale(1.04); opacity: 1; box-shadow: 0 0 28px rgba(34, 197, 94, 0.28); }
  100% { transform: rotate(22deg) translateX(145%) scale(0.82); opacity: 0; filter: blur(1px); }
}

@keyframes stashDownLeft {
  0% { transform: rotate(-4deg) scale(1); opacity: 1; }
  35% { transform: rotate(-2deg) translateY(18%) scale(0.94); opacity: 0.85; box-shadow: 0 12px 32px rgba(59, 130, 246, 0.2); }
  100% { transform: rotate(0deg) translateY(90%) scale(0.78); opacity: 0; filter: blur(2px); }
}

@keyframes stashDownRight {
  0% { transform: rotate(4deg) scale(1); opacity: 1; }
  35% { transform: rotate(2deg) translateY(18%) scale(0.94); opacity: 0.85; box-shadow: 0 12px 32px rgba(59, 130, 246, 0.2); }
  100% { transform: rotate(0deg) translateY(90%) scale(0.78); opacity: 0; filter: blur(2px); }
}

@keyframes partnerOutLeft {
  0% { transform: rotate(-4deg); opacity: 1; }
  100% { transform: rotate(-1deg) scale(0.88) translateY(18px); opacity: 0; filter: blur(2px); }
}

@keyframes partnerOutRight {
  0% { transform: rotate(4deg); opacity: 1; }
  100% { transform: rotate(1deg) scale(0.88) translateY(18px); opacity: 0; filter: blur(2px); }
}

.name-card.swiping-left,
.name-card.swiping-right,
.name-card.swiping-down,
.name-card.swiping-partner-out {
  pointer-events: none;
}

.name-card.swiping-fade {
  animation: partnerOutLeft 0.44s ease forwards;
  opacity: 0;
}

.name-card.empty-slot {
  background:
    linear-gradient(172deg, rgba(250, 247, 242, 0.92) 0%, rgba(243, 239, 230, 0.88) 100%);
  border: 1px dashed rgba(184, 149, 106, 0.28);
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--card-muted);
  font-size: 13px;
  letter-spacing: 0.04em;
  cursor: default;
  opacity: 0.72;
}

.name-card.empty-slot::after {
  box-shadow: none;
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-shrink: 0;
  gap: 8px;
}

.card-tag {
  font-size: 9px;
  padding: 5px 10px;
  background: rgba(255, 255, 255, 0.52);
  border: 1px solid rgba(184, 149, 106, 0.16);
  border-radius: 999px;
  color: var(--card-accent);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 56%;
  backdrop-filter: blur(6px);
}

.card-score em {
  font-style: normal;
  font-size: 13px;
  font-weight: 700;
  font-family: var(--card-serif);
  color: var(--card-accent);
  background: rgba(255, 255, 255, 0.72);
  border: 1.5px solid rgba(184, 149, 106, 0.28);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, 0.45),
    0 4px 12px rgba(26, 77, 62, 0.08);
}

.card-top-right {
  display: flex;
  align-items: center;
  gap: 5px;
}

.card-main {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  text-align: center;
}

.card-name-block {
  flex-shrink: 0;
  margin-bottom: 10px;
  padding: 4px 0 0;
}

.card-name-eyebrow {
  display: block;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--card-gold);
  margin-bottom: 8px;
}

.card-name {
  font-family: var(--card-serif);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.28;
  margin: 0;
  flex-shrink: 0;
  letter-spacing: 0.08em;
  color: var(--card-ink);
  word-break: break-word;
}

.card-name-rule {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
  padding: 0 12%;
}

.card-name-rule::before,
.card-name-rule::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(184, 149, 106, 0.35));
}

.card-name-rule::after {
  background: linear-gradient(270deg, transparent, rgba(184, 149, 106, 0.35));
}

.card-name-rule span {
  width: 5px;
  height: 5px;
  border-radius: 1px;
  background: var(--card-gold);
  transform: rotate(45deg);
  opacity: 0.65;
}

.card-desc {
  font-size: 11.5px;
  color: var(--card-muted);
  line-height: 1.65;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  text-align: left;
  padding: 0 2px;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 10px;
  flex-shrink: 0;
  justify-content: center;
}

.mini-tag {
  font-size: 9px;
  padding: 4px 9px;
  background: rgba(255, 255, 255, 0.48);
  border: 1px solid rgba(26, 77, 62, 0.08);
  color: var(--primary-light);
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.06em;
  backdrop-filter: blur(4px);
}

.card-footer {
  flex-shrink: 0;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid rgba(184, 149, 106, 0.12);
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.42));
  margin-left: -16px;
  margin-right: -16px;
  margin-bottom: -14px;
  padding-left: 16px;
  padding-right: 16px;
  padding-bottom: 14px;
  border-radius: 0 0 var(--card-radius) var(--card-radius);
}

.card-swipe-hints {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding: 0 4px;
  gap: 4px;
}

.card-swipe-hint {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.72;
}

.card-swipe-hint i {
  font-style: normal;
  opacity: 0.85;
}

.card-swipe-hint-left {
  color: #9f3a3a;
}

.card-swipe-hint-down {
  color: #64748b;
}

.card-swipe-hint-right {
  color: #1f6b4f;
}

.card-actions {
  display: flex;
  gap: 8px;
}

.card-act {
  flex: 1;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 8px rgba(12, 26, 21, 0.04);
}

.card-act.reject {
  color: #9f3a3a;
  background: rgba(255, 248, 248, 0.78);
  border-color: rgba(159, 58, 58, 0.1);
}

.card-act.stash {
  color: #475569;
  background: rgba(248, 250, 252, 0.82);
  border-color: rgba(71, 85, 105, 0.1);
}

.card-act.keep {
  color: #1f6b4f;
  background: rgba(245, 252, 248, 0.82);
  border-color: rgba(31, 107, 79, 0.12);
}

.card-act-icon {
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}

.card-act-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.12em;
  line-height: 1;
  opacity: 0.85;
}

.card-act:active {
  transform: scale(0.96);
  box-shadow: 0 1px 4px rgba(12, 26, 21, 0.06);
}

.name-card.from-library {
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 0 0 1.5px rgba(26, 77, 62, 0.18),
    0 0 0 3px rgba(184, 149, 106, 0.12),
    0 24px 56px rgba(12, 26, 21, 0.12),
    0 8px 20px rgba(26, 77, 62, 0.06);
}

.card-score {
  flex-shrink: 0;
}

.library-badge {
  font-size: 8px;
  font-weight: 600;
  color: var(--card-accent);
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(184, 149, 106, 0.2);
  padding: 3px 7px;
  border-radius: 999px;
  letter-spacing: 0.06em;
}

.name-card.from-import {
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 0 0 1.5px rgba(71, 85, 105, 0.14),
    0 0 0 3px rgba(184, 149, 106, 0.08),
    0 24px 56px rgba(12, 26, 21, 0.11),
    0 8px 20px rgba(26, 77, 62, 0.06);
}

.import-badge {
  font-size: 8px;
  font-weight: 600;
  color: #475569;
  background: rgba(248, 250, 252, 0.88);
  border: 1px solid rgba(71, 85, 105, 0.14);
  padding: 3px 7px;
  border-radius: 999px;
  letter-spacing: 0.06em;
}

/* Staging · 信笺托盘 */
.staging-section {
  margin-bottom: 0;
  flex-shrink: 0;
  padding: 8px 0 4px;
}

.staging-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 10px;
  margin-bottom: 10px;
  padding: 0 4px;
}

.staging-title-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.staging-eyebrow {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--card-gold);
}

.staging-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--card-ink);
  letter-spacing: 0.06em;
}

.staging-meta {
  font-size: 10px;
  color: var(--card-muted);
  letter-spacing: 0.04em;
  text-align: right;
  line-height: 1.45;
  max-width: 52%;
}

.staging-tray {
  position: relative;
  padding: 10px;
  border-radius: 18px;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(255, 255, 255, 0.72) 0%, transparent 70%),
    linear-gradient(175deg, rgba(250, 247, 242, 0.95) 0%, rgba(243, 239, 230, 0.88) 100%);
  border: 1px solid rgba(184, 149, 106, 0.16);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.85) inset,
    0 8px 24px rgba(12, 26, 21, 0.05);
}

.staging-tray::before {
  content: '';
  position: absolute;
  inset: 7px;
  border-radius: 12px;
  border: 1px solid rgba(184, 149, 106, 0.1);
  pointer-events: none;
}

.staging-slots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  position: relative;
  z-index: 1;
}

.staging-slot {
  height: 72px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.staging-slot-index {
  position: absolute;
  top: 7px;
  left: 9px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: rgba(184, 149, 106, 0.72);
  line-height: 1;
}

.staging-slot.empty {
  background:
    repeating-linear-gradient(
      -16deg,
      transparent,
      transparent 5px,
      rgba(12, 26, 21, 0.008) 5px,
      rgba(12, 26, 21, 0.008) 6px
    ),
    linear-gradient(168deg, rgba(255, 255, 255, 0.42) 0%, rgba(248, 245, 238, 0.55) 100%);
  border: 1px dashed rgba(184, 149, 106, 0.28);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.staging-slot-placeholder {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: rgba(109, 122, 116, 0.42);
  text-transform: uppercase;
  margin-top: 8px;
}

.staging-slot.filled {
  background:
    radial-gradient(ellipse 90% 80% at 50% 0%, rgba(255, 255, 255, 0.82) 0%, transparent 62%),
    linear-gradient(172deg, #fdfbf7 0%, var(--card-paper) 48%, var(--card-paper-deep) 100%);
  border: 1px solid rgba(184, 149, 106, 0.22);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.88) inset,
    0 0 0 1px rgba(255, 255, 255, 0.45),
    0 6px 16px rgba(12, 26, 21, 0.06);
  padding: 12px 8px 10px;
}

.staging-slot.filled::after {
  content: '';
  position: absolute;
  inset: 5px;
  border-radius: 10px;
  border: 1px solid rgba(184, 149, 106, 0.1);
  pointer-events: none;
}

.staging-slot-enter {
  animation: stagingFillIn 0.42s cubic-bezier(0.34, 1.15, 0.64, 1) both;
}

@keyframes stagingFillIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.staging-slot-body {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 8px 6px 0;
  text-align: center;
}

.staging-name-eyebrow {
  display: block;
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--card-gold);
  margin-bottom: 4px;
}

.staging-name {
  font-family: var(--card-serif);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  line-height: 1.32;
  letter-spacing: 0.06em;
  color: var(--card-ink);
  word-break: break-all;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.staging-remove {
  position: absolute;
  top: 5px;
  right: 5px;
  z-index: 2;
  width: 20px;
  height: 20px;
  border: 1px solid rgba(184, 149, 106, 0.22);
  background: rgba(255, 255, 255, 0.82);
  border-radius: 50%;
  font-size: 14px;
  line-height: 1;
  color: rgba(109, 122, 116, 0.75);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, color 0.15s ease, background 0.15s ease;
  backdrop-filter: blur(4px);
}

.staging-remove:active {
  transform: scale(0.92);
  color: #9f3a3a;
  background: rgba(255, 248, 248, 0.95);
}

.select-actions {
  align-items: center;
  gap: 8px;
}

.btn-done-main {
  flex: 1;
  min-width: 0;
}

.btn-analyze-footer {
  flex-shrink: 0;
  padding-left: 12px;
  padding-right: 12px;
  white-space: nowrap;
}

.btn-analyze-footer.hidden {
  display: none;
}

.select-footer .action-row,
.results-footer .action-row {
  margin-top: 0;
}

/* Results */
.filter-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  flex-shrink: 0;
}

.filter-bar input,
.filter-bar select {
  padding: 10px 12px;
  font-size: 13px;
  border-radius: var(--radius-sm);
}

.filter-bar input {
  flex: 1;
}

.filter-bar select {
  width: auto;
  min-width: 118px;
  padding-right: 30px;
}

.results-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  margin-bottom: 0;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.results-list::-webkit-scrollbar {
  display: none;
}

.result-item {
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 14px;
  box-shadow: var(--shadow-soft);
  flex-shrink: 0;
}

.preference-panel {
  flex-shrink: 0;
  margin-bottom: 10px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-soft);
}

.preference-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--card-ink);
  margin-bottom: 2px;
  letter-spacing: 0.03em;
}

.report-summary {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
  padding: 12px 14px;
  background: var(--primary-bg);
  border-radius: 12px;
  margin-bottom: 10px;
  border: 1px solid var(--border-soft);
}

.results-footer .action-row {
  margin-top: 0;
}

.results-footer-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.results-actions {
  flex-wrap: nowrap;
  gap: 8px;
}

.results-export-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  margin-top: 2px;
  padding: 6px 0 2px;
  font-size: 13px;
  font-weight: 500;
  color: var(--card-muted);
  letter-spacing: 0.03em;
}

.results-export-link .btn-icon {
  font-size: 14px;
  opacity: 0.75;
}

.results-export-link:active {
  color: var(--primary-light);
}

.results-actions .btn-flex {
  flex: 1;
  min-width: 0;
}

#btn-narrow-scope.is-final-pick {
  background: linear-gradient(135deg, #c9a227 0%, #e8c547 45%, #b8860b 100%);
  box-shadow: 0 8px 24px rgba(184, 134, 11, 0.35);
  animation: final-pick-glow 2s ease-in-out infinite;
}

@keyframes final-pick-glow {
  0%, 100% { box-shadow: 0 8px 24px rgba(184, 134, 11, 0.35); }
  50% { box-shadow: 0 8px 32px rgba(232, 197, 71, 0.55); }
}

.name-celebration {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 24px 16px;
}

.name-celebration.hidden {
  display: none;
}

.name-celebration-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 38%, rgba(45, 74, 62, 0.55) 0%, transparent 70%),
    linear-gradient(165deg, #0f1a16 0%, #1a1410 45%, #0d1210 100%);
  opacity: 0;
  animation: celeb-backdrop-in 0.8s ease forwards;
}

.name-celebration-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 35%, rgba(0, 0, 0, 0.55) 100%);
  pointer-events: none;
  opacity: 0;
  animation: celeb-backdrop-in 1s ease 0.1s forwards;
}

.name-celebration-burst {
  position: absolute;
  width: 100vmax;
  height: 100vmax;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232, 197, 71, 0.28) 0%, rgba(201, 162, 39, 0.08) 35%, transparent 68%);
  transform: scale(0.2);
  opacity: 0;
  animation: celeb-burst 1.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.name-celebration-rays {
  position: absolute;
  width: 140vmax;
  height: 140vmax;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    rgba(232, 197, 71, 0.06) 12deg,
    transparent 24deg,
    transparent 36deg,
    rgba(232, 197, 71, 0.05) 48deg,
    transparent 60deg,
    transparent 72deg,
    rgba(232, 197, 71, 0.04) 84deg,
    transparent 96deg
  );
  mask-image: radial-gradient(circle, black 0%, transparent 62%);
  opacity: 0;
  animation: celeb-rays 2.4s ease 0.2s forwards;
  pointer-events: none;
}

.name-celebration-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.name-celebration-particle {
  position: absolute;
  left: 50%;
  top: 44%;
  opacity: 0;
  animation: celeb-particle 2.2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.name-celebration-particle.is-spark {
  border-radius: 50%;
  box-shadow: 0 0 8px currentColor;
}

.name-celebration-particle.is-confetti {
  border-radius: 1px;
}

.name-celebration-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 380px;
  display: flex;
  justify-content: center;
}

.name-celebration-card {
  position: relative;
  width: 100%;
  padding: 36px 28px 28px;
  text-align: center;
  background:
    linear-gradient(145deg, rgba(255, 252, 245, 0.1) 0%, rgba(255, 248, 230, 0.04) 100%);
  border: 1px solid rgba(232, 197, 71, 0.35);
  border-radius: 20px;
  box-shadow:
    0 0 0 1px rgba(255, 248, 230, 0.06) inset,
    0 24px 64px rgba(0, 0, 0, 0.45),
    0 0 80px rgba(232, 197, 71, 0.12);
  backdrop-filter: blur(16px);
  opacity: 0;
  transform: translateY(28px) scale(0.94);
  animation: celeb-card-in 1s cubic-bezier(0.22, 1, 0.36, 1) 0.15s forwards;
}

.name-celebration-card::before,
.name-celebration-card::after {
  content: '';
  position: absolute;
  left: 20px;
  right: 20px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(232, 197, 71, 0.45), transparent);
}

.name-celebration-card::before {
  top: 14px;
}

.name-celebration-card::after {
  bottom: 14px;
}

.name-celebration-seal {
  position: relative;
  width: 52px;
  height: 52px;
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.5) rotate(-12deg);
  animation: celeb-seal-in 0.9s cubic-bezier(0.34, 1.56, 0.64, 1) 0.35s forwards;
}

.name-celebration-seal-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid rgba(232, 197, 71, 0.55);
  box-shadow: 0 0 20px rgba(232, 197, 71, 0.25);
  animation: celeb-seal-pulse 3s ease-in-out 1.2s infinite;
}

.name-celebration-seal-inner {
  position: relative;
  font-family: var(--card-serif);
  font-size: 22px;
  font-weight: 700;
  color: #e8c547;
  text-shadow: 0 0 16px rgba(232, 197, 71, 0.5);
}

.name-celebration-eyebrow {
  font-size: 11px;
  letter-spacing: 0.42em;
  text-indent: 0.42em;
  color: rgba(232, 197, 71, 0.9);
  margin-bottom: 8px;
  opacity: 0;
  animation: celeb-rise 0.7s ease 0.45s forwards;
}

.name-celebration-project {
  font-size: 12px;
  color: rgba(255, 248, 230, 0.5);
  margin-bottom: 20px;
  letter-spacing: 0.08em;
  opacity: 0;
  animation: celeb-rise 0.7s ease 0.52s forwards;
}

.name-celebration-project:empty {
  display: none;
  margin: 0;
}

.name-celebration-name-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 16px;
}

.name-celebration-frame-ornament {
  font-size: 8px;
  color: rgba(232, 197, 71, 0.45);
  opacity: 0;
  animation: celeb-rise 0.6s ease 0.65s forwards;
}

.name-celebration-name {
  font-family: var(--card-serif);
  font-size: clamp(32px, 10vw, 48px);
  font-weight: 700;
  color: #fff8e7;
  text-shadow:
    0 2px 0 rgba(201, 162, 39, 0.35),
    0 8px 32px rgba(232, 197, 71, 0.35);
  letter-spacing: 0.18em;
  text-indent: 0.18em;
  line-height: 1.25;
  opacity: 0;
  transform: scale(0.75);
  animation: celeb-name-in 1s cubic-bezier(0.34, 1.56, 0.64, 1) 0.58s forwards;
}

.name-celebration-divider {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
  opacity: 0;
  animation: celeb-rise 0.6s ease 0.78s forwards;
}

.name-celebration-divider span {
  display: block;
  width: 48px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 248, 230, 0.35), transparent);
}

.name-celebration-desc {
  font-size: 14px;
  line-height: 1.7;
  color: rgba(255, 248, 230, 0.72);
  margin-bottom: 12px;
  padding: 0 4px;
  opacity: 0;
  animation: celeb-rise 0.7s ease 0.85s forwards;
}

.name-celebration-blessing {
  font-size: 11px;
  letter-spacing: 0.28em;
  text-indent: 0.28em;
  color: rgba(232, 197, 71, 0.55);
  margin-bottom: 26px;
  opacity: 0;
  animation: celeb-rise 0.7s ease 0.95s forwards;
}

.name-celebration-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  opacity: 0;
  animation: celeb-rise 0.7s ease 1.05s forwards;
}

.celebration-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 46px;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.celebration-btn:active {
  transform: scale(0.98);
}

.celebration-btn-share {
  background: linear-gradient(135deg, #e8c547 0%, #c9a227 100%);
  color: #1a2e26;
  border: none;
  box-shadow: 0 8px 28px rgba(232, 197, 71, 0.32);
}

.celebration-btn-share:hover {
  box-shadow: 0 10px 32px rgba(232, 197, 71, 0.42);
}

.celebration-btn-close {
  background: transparent;
  color: rgba(255, 248, 230, 0.72);
  border: 1px solid rgba(255, 248, 230, 0.18);
}

.celebration-btn-close:hover {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 248, 230, 0.9);
}

.celebration-btn-icon {
  font-size: 16px;
  line-height: 1;
}

@keyframes celeb-backdrop-in {
  to { opacity: 1; }
}

@keyframes celeb-burst {
  0% {
    transform: scale(0.2);
    opacity: 0;
  }
  40% {
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 0.75;
  }
}

@keyframes celeb-rays {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(0deg) scale(0.8);
  }
  30% {
    opacity: 0.7;
  }
  100% {
    opacity: 0.35;
    transform: translate(-50%, -50%) rotate(18deg) scale(1);
  }
}

@keyframes celeb-card-in {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes celeb-seal-in {
  to {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

@keyframes celeb-seal-pulse {
  0%, 100% {
    box-shadow: 0 0 20px rgba(232, 197, 71, 0.2);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 28px rgba(232, 197, 71, 0.38);
    transform: scale(1.04);
  }
}

@keyframes celeb-name-in {
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes celeb-rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes celeb-particle {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(0deg) scale(0.2);
  }
  12% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) rotate(var(--rot)) scale(var(--scale, 0.2));
  }
}

@keyframes celeb-shimmer {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.12); }
}

.name-celebration.is-active .name-celebration-name {
  animation:
    celeb-name-in 1s cubic-bezier(0.34, 1.56, 0.64, 1) 0.58s forwards,
    celeb-shimmer 3.2s ease-in-out 1.4s infinite;
}

.name-celebration.is-active .name-celebration-seal-ring {
  animation: celeb-seal-pulse 3s ease-in-out 1.2s infinite;
}

.results-actions .btn-secondary {
  min-width: 0;
  padding-left: 12px;
  padding-right: 12px;
}

/* Insight bar (select) */
.insight-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 10px;
  background: rgba(255, 255, 255, 0.48);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}

.insight-label {
  font-size: 11px;
  color: var(--card-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.insight-count {
  font-size: 14px;
  font-weight: 600;
  font-family: var(--card-serif);
  color: var(--primary);
}

.insight-bar.hidden {
  display: none;
}

.insight-bar-left {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.insight-hint {
  font-size: 11px;
  color: var(--card-muted);
  flex-shrink: 0;
}

.btn-link {
  border: none;
  background: none;
  color: var(--primary-light);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 0;
  letter-spacing: 0.04em;
  -webkit-tap-highlight-color: transparent;
}

.btn-sm {
  padding: 7px 12px;
  font-size: 12px;
  min-height: auto;
  flex-shrink: 0;
}

/* Preference panel (results) */
.preference-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.preference-hint {
  font-size: 11px;
  color: var(--card-muted);
}

.preference-reanalyze {
  flex-shrink: 0;
  font-size: 12px;
  padding: 2px 0;
}

.preference-reanalyze.hidden {
  display: none;
}

.preference-report.hidden,
.preference-actions.hidden {
  display: none;
}

.report-section {
  margin-bottom: 10px;
}

.report-section-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.report-text {
  font-size: 13px;
  line-height: 1.6;
  color: var(--card-ink);
  margin: 0;
}

.report-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.report-tag {
  font-size: 11px;
  padding: 4px 9px;
  background: var(--bg);
  border-radius: 20px;
  color: var(--text-secondary);
}

.report-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.report-list li {
  font-size: 12px;
  color: var(--text-secondary);
  padding-left: 12px;
  position: relative;
}

.report-list li::before {
  content: '·';
  position: absolute;
  left: 0;
  color: var(--primary-light);
}

.report-meta {
  font-size: 11px;
  color: #9ca3af;
  margin-top: 8px;
}

.preference-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.preference-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}

.preference-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

/* Confirm dialog */
.confirm-dialog {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.confirm-dialog.hidden {
  display: none;
}

.confirm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 26, 21, 0.38);
  backdrop-filter: blur(4px);
}

.confirm-panel {
  position: relative;
  width: 100%;
  max-width: 320px;
  background: var(--surface-solid);
  border: 1px solid var(--border-soft);
  border-radius: 22px;
  padding: 24px 22px 20px;
  box-shadow: 0 24px 56px rgba(12, 26, 21, 0.16);
  animation: confirmIn 0.22s ease;
}

@keyframes confirmIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.confirm-panel h3 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--card-ink);
  letter-spacing: 0.03em;
}

.confirm-panel p {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.confirm-actions {
  display: flex;
  gap: 10px;
}

.confirm-actions .btn {
  flex: 1;
  min-height: 44px;
}

.btn-danger {
  background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
  color: #fff;
  border: none;
}

.btn-danger:active {
  filter: brightness(0.92);
}

/* Bottom sheet */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.sheet.hidden {
  display: none;
}

.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
}

.sheet-panel {
  position: relative;
  width: 100%;
  max-width: 430px;
  max-height: 85dvh;
  background: var(--card);
  border-radius: 20px 20px 0 0;
  display: flex;
  flex-direction: column;
  animation: sheetUp 0.28s ease;
}

@keyframes sheetUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sheet-header h2 {
  font-size: 17px;
  font-weight: 600;
}

.sheet-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px;
  -webkit-overflow-scrolling: touch;
}

.sheet-footer {
  flex-shrink: 0;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--card);
}

.result-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 6px;
}

.result-name {
  font-size: 16px;
  font-weight: 700;
  flex: 1;
}

.result-score {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-bg);
  padding: 3px 8px;
  border-radius: 6px;
  flex-shrink: 0;
}

.result-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  line-height: 1.5;
}

.result-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 10px;
}

.result-actions {
  display: flex;
  gap: 8px;
}

.result-btn {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  font-size: 12px;
  cursor: pointer;
  color: var(--text-secondary);
}

.result-btn.favorited {
  background: var(--primary-bg);
  color: var(--primary);
  border-color: var(--primary);
}

.results-actions {
  flex-wrap: wrap;
}

.empty-hint {
  text-align: center;
  color: var(--text-secondary);
  padding: 40px 20px;
  font-size: 14px;
}

/* Toast */
.toast {
  position: fixed;
  bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  background: rgba(12, 26, 21, 0.88);
  color: #faf7f2;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 13px;
  z-index: 1200;
  max-width: 90%;
  text-align: center;
  border: 1px solid rgba(184, 149, 106, 0.18);
  box-shadow: 0 12px 32px rgba(12, 26, 21, 0.18);
  animation: fadeInUp 0.3s ease;
  letter-spacing: 0.03em;
}

.toast.hidden {
  display: none;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* Loading */
.loading {
  position: fixed;
  inset: 0;
  background: rgba(243, 240, 234, 0.82);
  backdrop-filter: blur(6px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1150;
  gap: 16px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 2px solid var(--border-soft);
  border-top-color: var(--card-gold);
  border-right-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loading p {
  font-size: 14px;
  color: var(--text-secondary);
}

/* ── Home ── */
.home-body {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: calc(16px + env(safe-area-inset-top, 0px)) var(--space-page) calc(12px + env(safe-area-inset-bottom, 0px));
}

.home-top {
  flex-shrink: 0;
}

.home-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 16px;
}

.home-scroll .home-section:first-child {
  margin-top: 24px;
}

.home-scroll .home-collab-section + .home-projects-section {
  margin-top: 28px;
}

.home-hero {
  padding: 8px 2px 28px;
}

.home-eyebrow {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.28em;
  color: var(--card-gold);
  margin-bottom: 16px;
}

.home-title {
  font-family: var(--card-serif);
  font-size: 36px;
  font-weight: 600;
  line-height: 1.18;
  color: var(--card-ink);
  letter-spacing: 0.02em;
  margin-bottom: 10px;
}

.home-title-em {
  color: var(--primary);
}

.home-lead {
  font-size: 13px;
  color: var(--card-muted);
  line-height: 1.6;
  max-width: 26em;
}

.home-actions-card {
  display: flex;
  flex-direction: column;
  border-radius: calc(var(--radius) + 2px);
  overflow: hidden;
  background: var(--surface-solid);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow);
}

.home-action-primary {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  padding: 22px 22px 20px;
  border: none;
  background: linear-gradient(145deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  transition: filter 0.18s ease;
}

.home-action-primary:active {
  filter: brightness(0.94);
}

.home-action-primary-label {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.home-action-primary-hint {
  font-size: 12px;
  opacity: 0.78;
}

.home-action-secondary {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 16px 20px;
  border: none;
  border-top: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.18s ease;
}

.home-action-secondary:active {
  background: rgba(255, 255, 255, 0.85);
}

.home-action-secondary-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.home-action-secondary-text strong {
  font-size: 15px;
  font-weight: 600;
  color: var(--card-ink);
  letter-spacing: 0.02em;
}

.home-action-secondary-text small {
  font-size: 11px;
  color: var(--card-muted);
  line-height: 1.45;
}

.home-action-chevron {
  flex-shrink: 0;
  font-size: 22px;
  line-height: 1;
  color: var(--card-gold);
  opacity: 0.7;
}

.home-section {
  margin-top: 32px;
}

.home-top .home-section {
  margin-top: 24px;
}

.home-scroll .home-section {
  margin-top: 0;
}

.home-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 0 2px;
}

.home-section-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--card-ink);
  letter-spacing: 0.06em;
}

.home-count {
  font-size: 11px;
  color: var(--card-muted);
  letter-spacing: 0.02em;
}

.home-tools-section > .home-section-label {
  margin-bottom: 12px;
  padding: 0 2px;
}

.home-tools-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.home-tool-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 16px 14px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.52);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.16s ease;
}

.home-tool-tile:active {
  transform: scale(0.98);
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(26, 77, 62, 0.2);
}

.home-tool-tile-mark {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-bg);
  border: 1px solid rgba(26, 77, 62, 0.1);
  letter-spacing: 0.04em;
}

.home-tool-tile-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--card-ink);
  letter-spacing: 0.02em;
}

.home-tool-tile-desc {
  font-size: 10px;
  color: var(--card-muted);
  line-height: 1.4;
}

.project-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.project-swipe-row {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
}

.project-swipe-actions {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 72px;
  display: flex;
  z-index: 0;
}

.project-delete-btn {
  flex: 1;
  border: none;
  background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.04em;
  -webkit-tap-highlight-color: transparent;
}

.project-delete-btn:active {
  filter: brightness(0.92);
}

.project-swipe-content {
  position: relative;
  z-index: 1;
  touch-action: pan-y;
  transition: transform 0.28s cubic-bezier(0.25, 0.8, 0.25, 1);
  will-change: transform;
  background: var(--surface-solid);
  border-radius: var(--radius);
}

.project-swipe-row.is-open .project-swipe-content {
  transform: translateX(-72px);
}

.project-swipe-content .project-card {
  background: var(--surface-solid);
}

.project-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px 16px 16px 14px;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  text-align: left;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
  -webkit-tap-highlight-color: transparent;
}

.project-card:active {
  transform: scale(0.985);
  border-color: rgba(184, 149, 106, 0.28);
  box-shadow: 0 4px 16px rgba(12, 26, 21, 0.06);
}

.project-card-icon {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-bg);
  border-radius: 14px;
  font-size: 20px;
  border: 1px solid var(--border-soft);
}

.project-card-body {
  flex: 1;
  min-width: 0;
}

.project-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.project-card-title {
  flex: 1;
  min-width: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--card-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.02em;
}

.project-status {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 999px;
  letter-spacing: 0.04em;
  border: 1px solid transparent;
}

.project-status-configuring {
  background: var(--info-bg);
  color: var(--info);
  border-color: var(--border-soft);
}

.project-status-selecting {
  background: var(--primary-bg);
  color: var(--primary);
  border-color: rgba(26, 77, 62, 0.12);
}

.project-status-completed {
  background: var(--success-bg);
  color: var(--success);
  border-color: rgba(31, 107, 79, 0.12);
}

.project-card-meta {
  font-size: 12px;
  color: var(--card-muted);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-card-time {
  font-size: 11px;
  color: rgba(109, 122, 116, 0.72);
}

.project-card-arrow {
  flex-shrink: 0;
  font-size: 18px;
  color: var(--card-gold);
  line-height: 1;
  margin-left: 2px;
  opacity: 0.65;
}

.project-empty {
  text-align: center;
  padding: 32px 20px;
  background: rgba(255, 255, 255, 0.38);
  border: 1px dashed rgba(184, 149, 106, 0.22);
  border-radius: var(--radius-sm);
}

.project-empty p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.project-empty span {
  font-size: 12px;
  color: var(--card-muted);
}

.project-empty.hidden {
  display: none;
}

.tool-body {
  overflow-y: auto;
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  -webkit-overflow-scrolling: touch;
}

.tool-lead {
  font-size: 12px;
  color: var(--card-muted);
  line-height: 1.55;
  margin: -4px 0 12px;
}

.tool-card {
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.48);
  margin-bottom: 12px;
}

.tool-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.tool-field-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--card-muted);
}

.tool-textarea {
  width: 100%;
  min-height: 108px;
  padding: 12px;
  border: 1px solid var(--border-soft);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.55);
  font-size: 14px;
  line-height: 1.6;
  font-family: inherit;
  resize: vertical;
}

.tool-textarea:focus {
  outline: none;
  border-color: rgba(26, 77, 62, 0.28);
  box-shadow: 0 0 0 3px rgba(26, 77, 62, 0.06);
}

.tool-result.hidden,
.tool-actions.hidden,
.tool-names-list.hidden,
.tool-disclaimer.hidden,
.dedup-results.hidden {
  display: none;
}

.tool-result {
  margin-bottom: 12px;
}

.competitor-summary {
  font-size: 13px;
  line-height: 1.65;
  color: var(--card-ink);
  padding: 12px 13px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--border-soft);
  margin-bottom: 10px;
}

.competitor-pattern {
  padding: 11px 12px;
  border-radius: 11px;
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.42);
  margin-bottom: 8px;
}

.competitor-pattern-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--primary);
  margin-bottom: 6px;
}

.competitor-pattern-list {
  margin: 0;
  padding-left: 16px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--card-ink);
}

.competitor-tags-block {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.competitor-tag {
  font-size: 10px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.55);
  color: var(--card-muted);
}

.competitor-tag.is-gap {
  color: var(--primary);
  border-color: rgba(26, 77, 62, 0.18);
  background: rgba(232, 242, 236, 0.55);
}

.tool-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.tool-names-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tool-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.tool-section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--card-muted);
  letter-spacing: 0.06em;
}

.tool-name-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 13px;
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.5);
}

.tool-name-display {
  font-family: var(--card-serif);
  font-size: 17px;
  font-weight: 600;
  color: var(--card-ink);
}

.tool-name-desc {
  font-size: 11px;
  color: var(--card-muted);
  margin-top: 3px;
  line-height: 1.4;
}

.tool-disclaimer {
  font-size: 10px;
  color: var(--card-muted);
  line-height: 1.5;
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.42);
  border: 1px dashed var(--border-soft);
}

.dedup-results {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dedup-item {
  padding: 12px 13px;
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.5);
}

.dedup-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.dedup-item-name {
  font-family: var(--card-serif);
  font-size: 17px;
  font-weight: 600;
  color: var(--card-ink);
}

.dedup-overall {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  letter-spacing: 0.04em;
}

.dedup-channels {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dedup-channel {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
}

.dedup-channel-label {
  color: var(--card-muted);
  flex-shrink: 0;
  min-width: 72px;
}

.dedup-channel-detail {
  color: var(--card-ink);
  text-align: right;
  line-height: 1.45;
  flex: 1;
}

.dedup-badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  margin-left: 6px;
  letter-spacing: 0.03em;
  flex-shrink: 0;
}

.dedup-badge-ok {
  color: #1f6b4f;
  background: rgba(232, 242, 236, 0.9);
  border: 1px solid rgba(31, 107, 79, 0.18);
}

.dedup-badge-warn {
  color: #b45309;
  background: rgba(255, 248, 240, 0.95);
  border: 1px solid rgba(180, 83, 9, 0.18);
}

.dedup-badge-bad {
  color: #9f1239;
  background: rgba(255, 241, 242, 0.95);
  border: 1px solid rgba(159, 18, 57, 0.16);
}

.dedup-overall-ok {
  color: #1f6b4f;
  background: rgba(232, 242, 236, 0.9);
}

.dedup-overall-warn {
  color: #b45309;
  background: rgba(255, 248, 240, 0.95);
}

.dedup-overall-bad {
  color: #9f1239;
  background: rgba(255, 241, 242, 0.95);
}

/* Collab */
.collab-hub-body,
.collab-room-body,
.collab-summary-body {
  overflow-y: auto;
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  -webkit-overflow-scrolling: touch;
}

.collab-hub-body {
  padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
}

.collab-join-footer {
  padding-top: 12px;
}

.collab-join-footer .btn {
  width: 100%;
}

.collab-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}

.collab-card h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}

.collab-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.collab-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 10px;
  background: rgba(255, 255, 255, 0.48);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}

.collab-bar.hidden {
  display: none;
}

.collab-bar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.collab-bar-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.collab-select-theme {
  font-family: var(--card-serif);
  font-size: 14px;
  font-weight: 600;
  color: var(--card-ink);
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.collab-select-theme:empty {
  display: none;
}

.collab-meta-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.collab-theme-banner {
  margin-bottom: 12px;
  padding: 16px 18px;
  border-radius: var(--radius);
  background:
    radial-gradient(ellipse 90% 80% at 50% 0%, rgba(255, 255, 255, 0.72) 0%, transparent 62%),
    linear-gradient(172deg, #fdfbf7 0%, var(--card-paper) 48%, var(--card-paper-deep) 100%);
  border: 1px solid rgba(184, 149, 106, 0.2);
  box-shadow: var(--shadow-soft);
  text-align: center;
}

.collab-theme-eyebrow {
  display: block;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--card-gold);
  margin-bottom: 8px;
}

.collab-theme-title {
  font-family: var(--card-serif);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--card-ink);
  letter-spacing: 0.06em;
  word-break: break-word;
}

.collab-theme-meta {
  margin-top: 8px;
  font-size: 11px;
  color: var(--card-muted);
  letter-spacing: 0.04em;
}

.collab-theme-meta:empty {
  display: none;
}

.collab-theme-banner.is-error .collab-theme-title {
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--card-muted);
}

.collab-code {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--primary);
  font-family: var(--card-serif);
}

.collab-live {
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.collab-code-card {
  text-align: center;
  padding: 20px 16px;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: var(--radius);
  color: #fff;
}

.collab-code-label {
  font-size: 12px;
  opacity: 0.85;
  margin-bottom: 8px;
}

.collab-code-display {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: 0.18em;
  margin-bottom: 8px;
}

.collab-code-tip {
  font-size: 12px;
  opacity: 0.8;
  margin-bottom: 14px;
}

.collab-code-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.collab-code-actions .btn {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  font-size: 12px;
  padding: 8px 12px;
}

.collab-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.collab-stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 8px;
  text-align: center;
}

.collab-stat strong {
  display: block;
  font-size: 20px;
  color: var(--primary);
  margin-bottom: 2px;
}

.collab-stat span {
  font-size: 11px;
  color: var(--text-secondary);
}

.collab-section h3 {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
  padding: 0 2px;
}

.collab-participants {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.collab-participant {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.collab-participant-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary-bg);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}

.collab-participant-body {
  flex: 1;
  min-width: 0;
}

.collab-participant-name {
  font-size: 14px;
  font-weight: 600;
}

.collab-participant-meta {
  font-size: 11px;
  color: var(--text-secondary);
}

.collab-participant-status {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
  flex-shrink: 0;
}

.collab-participant-status.selecting {
  background: var(--primary-bg);
  color: var(--primary);
}

.collab-participant-status.done {
  background: var(--success-bg);
  color: var(--success);
}

.collab-status-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--primary-bg);
  color: var(--primary);
  flex-shrink: 0;
  margin-right: 8px;
}

.collab-status-badge.review {
  background: var(--info-bg);
  color: var(--info);
}

.collab-status-badge.finalized {
  background: var(--success-bg);
  color: var(--success);
}

.collab-finalized-banner {
  background: linear-gradient(135deg, #f0fdf4 0%, #fff 100%);
  border: 1px solid rgba(34, 197, 94, 0.35);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
  text-align: center;
}

.collab-finalized-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.collab-finalized-name {
  font-size: 24px;
  font-weight: 800;
  color: var(--success);
  margin-bottom: 10px;
}

.collab-proposals-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.collab-proposal-item {
  font-size: 13px;
  padding: 8px 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
}

.collab-proposal-item strong {
  color: var(--primary);
}

.collab-review-ranked {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.collab-review-ranked .collab-vote-item {
  margin-bottom: 0;
}

.collab-review-ranked .collab-vote-item.is-pickable {
  cursor: pointer;
  transition: border-color 0.15s;
}

.collab-review-ranked .collab-vote-item.is-pickable:hover {
  border-color: var(--primary);
}

.collab-review-ranked .collab-vote-item.is-selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-bg);
}

.collab-pool-banner {
  background: var(--info-bg);
  color: var(--info);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  padding: 8px 12px;
  margin: 0 0 8px;
  border-radius: var(--radius-sm);
}

.collab-pool-banner.hidden {
  display: none;
}

.proposed-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 12px;
  background: #fef3c7;
  color: #b45309;
  white-space: nowrap;
}

.collab-room-host-actions {
  margin-top: 8px;
}

.collab-room-host-actions .btn-flex {
  flex: 1;
  min-width: 0;
}

.collab-room-actions {
  flex-wrap: nowrap;
}

.collab-room-actions .btn-secondary {
  min-width: 88px;
}

.btn-link-danger {
  color: var(--danger);
  display: block;
  width: 100%;
  text-align: center;
  margin-top: 10px;
}

.collab-summary-block {
  margin-bottom: 14px;
}

.collab-summary-block.hidden {
  display: none;
}

.collab-block-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.collab-vote-item.is-proposed {
  border-color: rgba(245, 158, 11, 0.28);
  background: linear-gradient(135deg, #fffbeb 0%, #fff 100%);
}

.collab-person-tag.is-proposed {
  border-color: rgba(245, 158, 11, 0.35);
  background: #fffbeb;
}

.collab-person-tag-note {
  font-size: 10px;
  font-style: normal;
  color: #b45309;
  margin-left: 4px;
}

.collab-vote-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 8px;
}

.collab-vote-item.consensus {
  border-color: rgba(34, 197, 94, 0.35);
  background: linear-gradient(135deg, #f0fdf4 0%, #fff 100%);
}

.collab-vote-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 4px;
}

.collab-vote-name {
  font-size: 16px;
  font-weight: 700;
}

.collab-vote-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  background: var(--info-bg);
  color: var(--info);
  white-space: nowrap;
}

.collab-vote-badge.consensus {
  background: var(--success-bg);
  color: var(--success);
}

.collab-vote-voters {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.collab-person-block {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 8px;
}

.collab-person-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.collab-person-names {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.collab-person-tag {
  font-size: 12px;
  padding: 4px 10px;
  background: var(--primary-bg);
  color: var(--primary);
  border-radius: 20px;
}

.collab-session-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
  background: var(--info-bg);
  color: var(--info);
  margin-left: 6px;
}

@media (max-height: 680px) {
  .app-header-compact h1 {
    font-size: 17px;
  }

  .wizard-step-dot {
    width: 24px;
    height: 24px;
    font-size: 10px;
  }

  .option-grid-industry .option-icon {
    font-size: 22px;
  }

  .option-grid-tone {
    grid-template-columns: repeat(2, 1fr);
  }

  .option-card-tone .option-icon {
    font-size: 15px;
  }

  .option-card-tone .option-label {
    font-size: 9px;
  }

  .pref-lang-row {
    min-height: 48px;
    padding: 13px 12px;
    gap: 8px;
  }

  .pref-lang-sample {
    font-size: 13px;
    max-width: 8em;
  }

  .length-option {
    padding: 9px 1px;
  }

  .length-option-text {
    font-size: 10px;
  }

  .length-option-text i {
    font-size: 8px;
  }

  .details-notes-area {
    min-height: 88px;
  }

  .details-import-area {
    min-height: 88px;
  }

  .staging-slot {
    height: 62px;
  }

  .staging-tray {
    padding: 8px;
  }

  .staging-name {
    font-size: 12px;
  }

  .card-pair {
    max-height: min(48dvh, 400px);
    padding: 2px 0 6px;
    gap: 8px;
  }

  .card-stack {
    width: min(248px, 92%);
  }

  .card-stack-active {
    max-height: calc(100% - 40px);
  }

  .card-stack-lip-1 {
    width: 92%;
    height: 20px;
    margin-top: -10px;
    margin-left: -4px;
    transform: rotate(-1.4deg) translateX(-4px);
  }

  .card-stack-lip-2 {
    width: 85%;
    height: 18px;
    margin-left: 6px;
    transform: rotate(1.8deg) translateX(6px);
  }

  .card-stack-lip-3 {
    width: 81%;
    height: 16px;
    margin-left: -2px;
    transform: rotate(-0.7deg) translateX(-2px);
  }

  .card-slot-single {
    max-width: min(248px, 92%);
  }

  .name-card,
  .name-card.card-single {
    max-width: 248px;
    aspect-ratio: 5 / 7;
  }

  .card-stack-active .name-card {
    aspect-ratio: 5 / 7;
  }

  .card-stack-active .card-name {
    font-size: 23px;
  }

  .card-desc {
    font-size: 11px;
  }

  .card-inner {
    padding: 12px 11px 10px;
  }

  .card-act {
    height: 34px;
  }

  .card-act-label {
    display: none;
  }

  .select-body .staging-slot {
    height: 64px;
  }

  .setup-body {
    padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  }

  .home-title {
    font-size: 30px;
  }

  .home-action-primary {
    padding: 18px 18px 16px;
  }

  .home-tool-tile {
    padding: 14px 12px;
  }
}
