:root {
  --bg0: #12100e;
  --bg1: #1a1713;
  --bg2: #242019;
  --line: rgba(245, 197, 66, 0.16);
  --text: #f5f0e6;
  --muted: #9e9586;
  --accent: #f5c542;
  --accent-dim: #c9a035;
  --danger: #e86a5c;
  --ok: #7dcb8a;
  --radius: 14px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --dock-h: 72px;
  font-family: "PingFang SC", "Segoe UI", "Noto Sans SC", system-ui, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; height: 100%;
  height: 100dvh;
  background: radial-gradient(120% 70% at 50% -20%, #3a3224 0%, transparent 50%), var(--bg0);
  color: var(--text);
  overflow: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

.overlay {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: rgba(10, 8, 6, 0.92);
}
.overlay[hidden],
.overlay.is-hidden {
  display: none !important;
}
.login-card {
  width: min(420px, 100%);
  background: linear-gradient(160deg, var(--bg2), var(--bg1));
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 22px 18px;
}
.brand { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.brand h1 { margin: 0; color: var(--accent); font-size: 1.7rem; letter-spacing: 0.04em; }
.brand span { color: var(--muted); font-size: 0.8rem; }
.lead { margin: 0 0 14px; color: var(--muted); font-size: 0.9rem; line-height: 1.4; }
.user-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 14px; min-height: 8px; }
.user-chips button {
  border: 1px solid var(--line); background: #100e0c; color: var(--text);
  border-radius: 999px; padding: 8px 12px; font-size: 0.88rem;
}

.app {
  height: 100%;
  height: 100dvh;
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  padding-top: var(--safe-t);
  min-height: 0;
}
.app[hidden] {
  display: none !important;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px 8px;
  flex: 0 0 auto;
}
.top-title { min-width: 0; flex: 1; }
.top-title strong { display: block; font-size: 1.05rem; }
.top-title span { color: var(--muted); font-size: 0.75rem; }
.logout-btn {
  flex: 0 0 auto;
  white-space: nowrap;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.78rem;
}
.logout-btn:active { color: var(--text); border-color: var(--accent); }

.page-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.step-card {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(160deg, var(--bg2), var(--bg1));
  overflow: hidden;
  flex: 0 0 auto;
}
.step-title {
  margin: 0;
  padding: 12px 14px;
  font-size: 0.92rem;
  color: var(--accent);
  font-weight: 700;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 8, 6, 0.35);
}
.step-title small {
  color: var(--muted);
  font-weight: 500;
  margin-left: 6px;
}
.step-body {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
}
.sticky-dock {
  flex: 0 0 auto;
  position: relative;
  z-index: 20;
  display: flex;
  justify-content: center;
  padding: 10px 12px calc(10px + var(--safe-b));
  border-top: 1px solid var(--line);
  background: rgba(10, 8, 6, 0.96);
}
.sticky-dock .primary {
  width: 100%;
}

.field { display: block; margin: 0 0 10px; }
.field[hidden] { display: none !important; }
.field > span {
  display: block; margin-bottom: 8px; color: var(--muted); font-size: 0.82rem;
}
.field input[type="password"],
.field input[type="text"] {
  width: 100%;
  box-sizing: border-box;
}
/* 登录密码：强制可见输入框 + 圆点掩码（iOS/Android 暗色底上默认常看不见） */
.login-card .field input {
  width: 100%;
  border: 1px solid rgba(245, 197, 66, 0.35);
  background: #0c0a08;
  border-radius: 12px;
  padding: 14px 14px;
  font-size: 17px;
  line-height: 1.35;
  outline: none;
  color: var(--text);
  -webkit-text-fill-color: var(--text);
  caret-color: var(--accent);
}
.login-card .field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(245, 197, 66, 0.18);
}
.login-card .field input::placeholder {
  color: var(--muted);
  -webkit-text-fill-color: var(--muted);
  opacity: 0.85;
  letter-spacing: 0;
}
.login-card input[type="password"] {
  letter-spacing: 0.28em;
  font-family: "SF Mono", "Menlo", "Consolas", ui-monospace, monospace;
  -webkit-text-security: disc;
  text-security: disc;
}

/* 成片参数：每一项独立卡片 + 编号，扫一眼能分清 */
.param-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.param-item {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 48%), #12100e;
}
.param-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.param-no {
  flex: 0 0 auto;
  width: 1.6rem;
  height: 1.6rem;
  margin: 1px 0 0;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-style: normal;
  font-size: 0.78rem;
  font-weight: 700;
  color: #1a1408;
  background: var(--accent);
  line-height: 1;
}
.param-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.param-title strong {
  font-size: 0.98rem;
  font-weight: 650;
  color: var(--text);
  letter-spacing: 0.01em;
}
.param-title span {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}
.param-title span b {
  color: var(--accent);
  font-weight: 650;
}
.param-subhead {
  margin-top: 2px;
  padding-top: 10px;
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
  font-size: 0.8rem;
  font-weight: 600;
  color: #d6c4a0;
}
.param-item .hint {
  margin-top: -2px;
}
.param-list > .hint#paramHint {
  margin-top: 2px;
  padding: 0 2px;
}
input[type="text"],
input[type="password"],
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  background: #100e0c;
  border-radius: 12px;
  padding: 12px;
  font-size: 16px;
  outline: none;
}
textarea {
  min-height: 140px;
  resize: vertical;
  line-height: 1.5;
}
input[type="range"] { width: 100%; accent-color: var(--accent); }

.cat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.cat-card {
  position: relative;
  border: 1px solid var(--line);
  background: #100e0c;
  border-radius: var(--radius);
  min-height: 88px;
  color: var(--text);
  overflow: hidden;
}
.cat-card.active {
  border-color: var(--accent);
  background: rgba(245, 197, 66, 0.1);
}
.cat-pick {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  padding: 16px 12px 40px;
  min-height: 88px;
  cursor: pointer;
}
.cat-card strong { display: block; font-size: 1.05rem; margin-bottom: 6px; }
.cat-card span { color: var(--muted); font-size: 0.8rem; }
.cat-card .tag {
  display: inline-block; margin-top: 8px;
  font-size: 0.7rem; color: var(--accent-dim);
  border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px;
}
.cat-del {
  position: absolute;
  right: 8px;
  bottom: 8px;
  border: 1px solid rgba(232, 106, 92, 0.45);
  background: rgba(232, 106, 92, 0.12);
  color: var(--danger);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.2;
}

.toolbar {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px; color: var(--muted); font-size: 0.85rem;
  gap: 10px;
}
.toolbar #videoCount { flex: 1; }
button.ghost.compact.select-all {
  flex: 0 0 auto;
  min-width: 88px;
  padding: 12px 18px;
  font-size: 1rem;
  font-weight: 650;
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(245,197,66,0.1);
}
.link {
  border: 0; background: transparent; color: var(--accent); padding: 0;
  font-size: 0.85rem;
}
.link.full { display: block; width: 100%; text-align: center; margin-top: 12px; }

.video-list { display: flex; flex-direction: column; gap: 8px; }
.swipe-row {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  background: #2a1a18;
}
.swipe-actions {
  position: absolute; inset: 0 0 0 auto; width: 76px;
  display: flex; align-items: stretch; justify-content: center;
}
.swipe-actions button {
  width: 100%; border: 0; background: var(--danger); color: #fff; font-weight: 600;
}
.swipe-front {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: 48px 64px minmax(0, 1fr) 52px;
  gap: 8px;
  align-items: center;
  padding: 8px 8px 8px 4px;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: transform 0.18s ease;
  touch-action: pan-y;
}
.swipe-front.open { transform: translateX(-76px); }
.swipe-front img {
  width: 64px; height: 64px; object-fit: cover; border-radius: 8px; background: #000;
  position: relative; z-index: 1;
}
.vid-del {
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: var(--danger);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(232, 106, 92, 0.35);
}
.thumb-wrap {
  position: relative;
  width: 64px; height: 64px;
  border-radius: 8px;
  overflow: hidden;
  background: #1a1713;
}
.thumb-ph {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  color: var(--muted); font-size: 0.7rem;
  z-index: 0;
}
.thumb-wrap img.loading { opacity: 0.25; }
.thumb-wrap img.ready { opacity: 1; }
.swipe-front .meta { min-width: 0; }
.swipe-front .meta strong {
  display: block; font-size: 0.88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.swipe-front .meta span { color: var(--muted); font-size: 0.75rem; }
.swipe-front .meta .tagline {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
}
.thumb-wrap .tl-badge {
  position: absolute;
  right: 4px; bottom: 4px;
  z-index: 2;
  background: rgba(10, 8, 6, 0.82);
  color: var(--accent);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.65rem;
  padding: 2px 6px;
  line-height: 1.2;
}
.tl-card { max-height: min(80vh, 560px); overflow: auto; }
.tl-list { display: flex; flex-direction: column; gap: 10px; }
.tl-item {
  border: 1px solid var(--line);
  background: #100e0c;
  border-radius: 12px;
  padding: 10px 12px;
}
.tl-item b { color: var(--accent); margin-right: 6px; }
.tl-item code { color: var(--muted); font-size: 0.8rem; }
.tl-desc { margin-top: 6px; font-size: 0.92rem; line-height: 1.4; }
.tl-tags { margin-top: 4px; color: var(--muted); font-size: 0.78rem; }
.check-hit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 64px;
  margin: 0;
  padding: 0;
}
.check {
  width: 28px; height: 28px; border-radius: 8px;
  border: 2px solid var(--line); background: #100e0c;
  display: grid; place-items: center; color: transparent; font-size: 0.9rem;
  font-weight: 700;
}
.check.on { border-color: var(--accent); background: rgba(245,197,66,0.15); color: var(--accent); }

.empty { text-align: center; color: var(--muted); padding: 40px 10px; }

.choice-list { display: flex; flex-direction: column; gap: 8px; }
.choice {
  position: relative;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--bg2);
  border-radius: 12px;
  padding: 14px;
  padding-right: 56px;
}
.choice strong { display: block; margin-bottom: 4px; }
.choice span { color: var(--muted); font-size: 0.8rem; }
.choice .preview-btn {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  float: none;
  display: inline-grid;
  place-items: center;
  min-width: 32px;
  height: 32px;
  color: var(--accent);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 8px;
  font-style: normal;
  font-size: 0.72rem;
  line-height: 1;
  background: rgba(245,197,66,0.08);
}
.choice .preview-btn.is-playing {
  color: #1a1408;
  background: var(--accent);
  border-color: var(--accent);
}
.choice.active {
  border-color: var(--accent);
  background: rgba(245,197,66,0.08);
}

.music-details {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #100e0c;
  overflow: hidden;
}
.music-summary {
  display: block;
  list-style: none;
  cursor: pointer;
  color: var(--text);
  padding: 0;
  margin: 0;
}
.music-summary::-webkit-details-marker,
.music-summary::marker {
  display: none;
  content: "";
}
.music-summary-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 72px;
  padding: 14px;
  box-sizing: border-box;
}
.music-summary-text { min-width: 0; flex: 1; }
.music-summary-text strong {
  display: block;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 650;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.music-summary-text span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
}
.music-chevron {
  flex: 0 0 auto;
  width: 28px; height: 28px;
  border-radius: 8px;
  border: 1px solid var(--line);
  display: grid; place-items: center;
  color: var(--accent);
  font-style: normal;
  font-size: 0.85rem;
  transition: transform 0.18s ease;
}
.music-details[open] .music-chevron {
  transform: rotate(180deg);
}
/* display:flex 会覆盖 UA 对 closed details 的 display:none，必须显式隐藏 */
.music-details:not([open]) > .music-panel {
  display: none !important;
}
.music-details[open] > .music-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px 14px;
  border-top: 1px solid var(--line);
}
.local-music {
  max-height: 280px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.local-music .choice { margin-top: 0; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line);
  background: #100e0c;
  color: var(--muted);
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 0.9rem;
  line-height: 1.2;
  min-height: 40px;
}
.chip.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(245,197,66,0.1);
  font-weight: 600;
}
/* iPhone：字幕选项用按钮芯片，避免原生 select 深色主题空白 */
.caption-chips {
  gap: 8px;
  min-height: 44px;
  align-items: center;
}
.caption-chips .chip {
  max-width: 100%;
  color: #e8dfd0 !important;
  background: #1a1713 !important;
  border: 1px solid rgba(245, 197, 66, 0.35) !important;
  -webkit-appearance: none;
  appearance: none;
}
.caption-chips .chip.active {
  color: #1a1408 !important;
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  font-weight: 700;
}
input[type="text"],
input[type="password"],
textarea,
select {
  color: var(--text);
  -webkit-text-fill-color: var(--text);
  opacity: 1;
}
select {
  -webkit-appearance: none;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(50% - 3px), calc(100% - 12px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 32px;
}

.row-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.voice-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}
.voice-row select { width: 100%; min-width: 0; }
.voice-row .ghost.compact {
  white-space: nowrap;
  padding: 12px 14px;
  min-width: 72px;
}
.voice-clone {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}
.voice-clone-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
}
.voice-clone-row input[type="text"] {
  min-width: 0;
  width: 100%;
}
.voice-clone .primary.compact,
.voice-clone .ghost.compact {
  white-space: nowrap;
  padding: 12px 12px;
}
.voice-clone .danger {
  justify-self: start;
  color: #fca5a5;
  border-color: rgba(248, 113, 113, 0.35);
}
.hint { color: var(--muted); font-size: 0.8rem; margin: 0; line-height: 1.4; }
.hint:empty { display: none; }
.warn-hint {
  color: #b45309;
  background: rgba(245, 158, 11, 0.12);
  border-left: 3px solid #d97706;
  padding: 8px 10px;
  border-radius: 0 8px 8px 0;
  margin: 0 0 14px;
}
.lib-block {
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.lib-block-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 10px;
}
.lib-block-head strong {
  font-size: 0.95rem;
}
.lib-block-head span {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.dock {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.primary, .ghost {
  border-radius: 999px;
  padding: 14px 16px;
  font-size: 1rem;
  font-weight: 650;
}
.primary {
  border: 0;
  background: linear-gradient(90deg, #f5c542, #e0a820);
  color: #1a1408;
}
.primary:disabled { opacity: 0.45; }
.ghost {
  border: 1px solid var(--line);
  background: rgba(20,18,14,0.9);
  color: var(--text);
  font-weight: 500;
}
.ghost.full { width: 100%; display: block; text-align: center; }
.ghost.danger-outline { color: var(--danger); border-color: rgba(232,106,92,0.4); }
.file-dock { text-align: center; }
.file-dock input { display: none; }
.file-dock.accent {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(245,197,66,0.1);
  font-weight: 650;
}

.upload-float {
  position: sticky;
  top: 0;
  z-index: 35;
  flex: 0 0 auto;
  margin: 0 12px 8px;
  background: rgba(20, 18, 14, 0.97);
  border: 1px solid rgba(245, 197, 66, 0.45);
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}
.upload-float[hidden] { display: none !important; }
.upload-float-inner strong {
  display: block;
  font-size: 0.92rem;
  color: var(--accent);
  margin-bottom: 8px;
}
.upload-float .bar { margin-bottom: 6px; }
.upload-float span { font-size: 0.8rem; color: var(--muted); }
.app.is-uploading .page-scroll {
  scroll-behavior: smooth;
}

.progress-head { margin-bottom: 10px; }
.bar {
  height: 8px; border-radius: 99px; background: #2a2620; overflow: hidden;
}
.bar > i {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent));
  transition: width 0.25s ease;
}
.status { margin-top: 8px; font-size: 0.88rem; color: var(--muted); }
.status.ok { color: var(--ok); }
.status.err { color: var(--danger); }

.console {
  margin: 0;
  min-height: 120px;
  max-height: 28vh;
  overflow: auto;
  background: #0a0908;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.75rem;
  line-height: 1.45;
  color: #cfc4b0;
  white-space: pre-wrap;
  word-break: break-word;
}
.console:empty { display: none; }

.done-box { margin-top: 14px; }
.done-box video {
  width: 100%;
  max-height: 42vh;
  border-radius: 12px;
  background: #000;
  border: 1px solid var(--line);
}
.done-box video.save-pulse {
  outline: 3px solid #f0c060;
  box-shadow: 0 0 0 6px rgba(240, 192, 96, 0.28);
  animation: savePulse 1.1s ease-in-out 3;
}
@keyframes savePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.015); }
}
.save-tip {
  margin: 8px 2px 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.sheet[hidden] { display: none !important; }
.sheet {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}
.sheet-card {
  position: relative;
  width: min(520px, 100%);
  background: var(--card, #1c1914);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 18px 18px 0 0;
  padding: 18px 16px calc(16px + var(--safe-b));
  box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.35);
}
.sheet-card h3 {
  margin: 0 0 8px;
  font-size: 1.1rem;
}
.sheet-card p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}
.save-steps {
  margin: 0 0 14px 1.1rem;
  padding: 0;
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.55;
}
.sheet-card .full { width: 100%; margin-top: 8px; }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + var(--safe-b));
  transform: translateX(-50%) translateY(20px);
  background: #2b261e; color: var(--text);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 0.88rem;
  opacity: 0; pointer-events: none;
  transition: 0.2s ease;
  z-index: 90;
  max-width: 86vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.theme-suggest {
  margin: 12px 0 4px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.theme-suggest #themeSuggestHint { margin: 0; }


#genCopyBtn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  margin: 12px 0 6px;
  padding: 14px 16px;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffd76a 0%, var(--accent) 55%, var(--accent-dim) 100%);
  color: #14120f;
  box-shadow: 0 6px 18px rgba(245, 197, 66, 0.38);
}
#genCopyBtn:disabled {
  opacity: 0.55;
  box-shadow: none;
}
#genCopyBtn:active {
  transform: translateY(1px);
  box-shadow: 0 3px 10px rgba(245, 197, 66, 0.28);
}
#genCopyHint { margin: 0 0 10px; }
.copy-extra-btns {
  grid-template-columns: 1fr;
  margin-top: 8px;
}

.theme-suggest #themeSuggestBtn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 48px;
  padding: 14px 16px;
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  border-radius: 14px;
  border: 0;
  background: linear-gradient(180deg, #ffd76a 0%, var(--accent) 55%, var(--accent-dim) 100%);
  color: #14120f;
  box-shadow: 0 6px 18px rgba(245, 197, 66, 0.38);
}
.theme-suggest #themeSuggestBtn:disabled {
  opacity: 0.55;
  box-shadow: none;
}
.theme-suggest #themeSuggestBtn:active {
  transform: translateY(1px);
  box-shadow: 0 3px 10px rgba(245, 197, 66, 0.28);
}

.theme-suggest-chips {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}
.theme-suggest-chips .chip,
.theme-suggest-chips .theme-opt {
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: start;
  gap: 10px;
  width: 100%;
  margin: 0;
  border: 1px solid rgba(245, 197, 66, 0.28);
  background: rgba(245, 197, 66, 0.08);
  color: var(--text);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.45;
  text-align: left;
  white-space: normal;
  min-height: 48px;
  cursor: pointer;
  -webkit-tap-highlight-color: rgba(245, 197, 66, 0.25);
  touch-action: manipulation;
}
.theme-suggest-chips .theme-opt-no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin-top: 1px;
  border-radius: 999px;
  background: rgba(245, 197, 66, 0.18);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
}
.theme-suggest-chips .theme-opt-text {
  min-width: 0;
  word-break: break-word;
}
.theme-suggest-chips .chip.active,
.theme-suggest-chips .theme-opt.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #14120f;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(245, 197, 66, 0.28);
}
.theme-suggest-chips .chip.active .theme-opt-no,
.theme-suggest-chips .theme-opt.active .theme-opt-no {
  background: rgba(20, 18, 15, 0.16);
  color: #14120f;
}

#themeInput.theme-flash {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px rgba(245, 197, 66, 0.35);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
