:root {
  --stage-bg: #ffffff;
  --stage-ink: #5c6570;
  --bezel: #1b1e24;
  --ground: #ffffff;
  --ground-2: #f3f4f6;
  --ink: #15181d;
  --ink-2: #5f6875;
  --ink-3: #98a1ac;
  --line: #e3e6ea;
  --accent: #e0332c;
  --accent-ink: #ffffff;
  --accent-soft: #fcebea;
  --ok: #1e9e5a;
  --ok-soft: #edf8f1;
  --ok-ink: #176b3d;
  --sans:
    -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC",
    "MiSans", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC",
    "Noto Sans SC", sans-serif;
  --mono:
    "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --cw: 77%;
}
:root[lang="ja"] {
  --sans:
    -apple-system, BlinkMacSystemFont, "Hiragino Sans",
    "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", "Noto Sans CJK JP",
    "Noto Sans JP", sans-serif;
}
:root[lang="ko"] {
  --sans:
    -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic",
    "Noto Sans CJK KR", "Noto Sans KR", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --stage-bg: #0e1013;
    --stage-ink: #8b94a1;
    --bezel: #2b3038;
  }
}
:root[data-theme="dark"] {
  --stage-bg: #0e1013;
  --stage-ink: #8b94a1;
  --bezel: #2b3038;
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
  background: var(--stage-bg);
  color: var(--stage-ink);
  font-family: var(--sans);
  min-height: 100vh;
  min-height: 100dvh;
}
button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
a {
  color: inherit;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- shell: phone full-bleed by default ---------- */
.app {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  background: var(--ground);
  color: var(--ink);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  -webkit-user-select: none;
  user-select: none;
}
.main,
.left,
.right {
  display: contents;
}
.top {
  order: 0;
}
.hero {
  order: 1;
}
.search:not(.insheet) {
  order: 2;
}
.chips {
  order: 2;
}
.stage {
  order: 3;
}
.counter {
  order: 4;
}
.cta {
  order: 5;
}
.tabs {
  order: 6;
}
.strip {
  order: 7;
}
.dnav,
.me,
.arrow,
.strip,
.qr,
.stage-note {
  display: none;
}
.view.home {
  display: contents;
}
.view.page {
  order: 3;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.page-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 20px 4px;
}
.page-head h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
}
.page-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.avatar-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
}
.av-fig {
  position: relative;
  width: 72px;
  aspect-ratio: 2/3;
  border-radius: 12px;
  overflow: hidden;
  background: #222;
}
.av-main {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.av-main b {
  font-size: 17px;
}
.av-meta {
  font-size: 12px;
  color: var(--ink-2);
}
.av-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.panel {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--ground);
}
.dot[data-s="bound"]::after {
  background: var(--ok);
}
.dot[data-s="bound"] {
  cursor: pointer;
}
.dot[data-s="none"] {
  cursor: pointer;
}
.tabpane {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.script {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.script b {
  font-size: 14px;
}
.script p {
  margin: 0;
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.script .work-row {
  margin-top: 2px;
}
.script .meta {
  font-size: 12px;
  color: var(--ink-3);
}
.kb-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  text-align: left;
}
.kb-row:first-child {
  border-top: 0;
}
.kb-row .k {
  font-size: 12px;
  color: var(--ink-3);
  font-weight: 600;
  letter-spacing: 0.04em;
}
.kb-row .v {
  font-size: 14px;
  color: var(--ink);
  font-weight: 500;
  line-height: 1.45;
}
.kb-row .v.empty {
  color: var(--accent);
  font-weight: 600;
}
.plan-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.plan-row b {
  font-size: 15px;
}
.plan-sub {
  font-size: 12px;
  color: var(--ink-2);
}
.bar {
  height: 6px;
  border-radius: 3px;
  background: var(--ground-2);
  overflow: hidden;
}
.bar i {
  display: block;
  height: 100%;
  background: var(--ink);
  border-radius: 3px;
  transition: width 0.3s;
}
.grp-t {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
  letter-spacing: 0.04em;
  padding: 0 4px;
}
.grp {
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: var(--ground);
  margin-top: -6px;
}
.row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 50px;
  padding: 0 14px;
  border-top: 1px solid var(--line);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  text-align: left;
}
.row:first-child {
  border-top: 0;
}
.row small {
  margin-left: auto;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-3);
  white-space: nowrap;
}
.row .chev {
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--ink-3);
  border-bottom: 2px solid var(--ink-3);
  transform: rotate(-45deg);
  flex: 0 0 auto;
}
.row.danger {
  color: var(--accent);
  justify-content: center;
}
.u-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--ink-2);
}
.u-row b {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.u-note {
  font-size: 12px;
  color: var(--ink-3);
}
.ptable {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.ptable th,
.ptable td {
  padding: 8px 4px;
  border-top: 1px solid var(--line);
  text-align: center;
}
.ptable th:first-child,
.ptable td:first-child {
  text-align: left;
  color: var(--ink-2);
  font-weight: 500;
}
.ptable th {
  font-weight: 700;
  border-top: 0;
}
.ptable .cur {
  color: var(--accent);
}
.segs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: var(--ground-2);
  border-radius: 12px;
  padding: 3px;
  gap: 2px;
}
.segs button {
  height: 36px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 6px;
}
.segs button[aria-selected="true"] {
  background: var(--ground);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(21, 24, 29, 0.14);
}
.app.dark .segs button[aria-selected="true"] {
  background: rgba(255, 255, 255, 0.16);
}
.segs.small {
  grid-template-columns: repeat(2, 1fr);
}
.segs.small button {
  height: 30px;
  font-size: 12px;
}
.plan-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.pcard {
  border: 1.5px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.pcard.on {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
}
.pcard b {
  font-size: 15px;
}
.pcard .tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-3);
}
.pcard .price {
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  margin-top: 4px;
}
.pcard .price small {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
}
.pcard ul {
  margin: 6px 0 0;
  padding-left: 16px;
  font-size: 12px;
  color: var(--ink-2);
  line-height: 1.6;
}

/* ---------- dark home (final launch look): same structure, tokens flipped while the wall is on screen ---------- */
.app.dark {
  --ground: #0e1013;
  --ground-2: rgba(255, 255, 255, 0.09);
  --ink: #ffffff;
  --ink-2: rgba(255, 255, 255, 0.72);
  --ink-3: rgba(255, 255, 255, 0.45);
  --line: rgba(255, 255, 255, 0.12);
}
.app.dark .stage {
  background: radial-gradient(
    60% 55% at 50% 48%,
    rgba(255, 255, 255, 0.08) 0%,
    rgba(255, 255, 255, 0) 72%
  );
}
.app.dark .card {
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
}
.app.dark .card::after {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}
.app.dark .brand .mark circle:first-child {
  fill: #fff;
}
.app.dark .tabs {
  border-top-color: rgba(255, 255, 255, 0.1);
}
.app.dark .tab.action .ic {
  background: #fff;
  color: #0e1013;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}
.app.dark .tab.action .ic svg {
  stroke: #0e1013;
}
.app.dark .primary {
  box-shadow: 0 12px 28px rgba(224, 51, 44, 0.45);
}
.app.dark .hint,
.app.dark .counter {
  color: rgba(255, 255, 255, 0.4);
}
.app.dark .arrow {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  box-shadow: none;
}
.app.dark .arrow:hover {
  background: rgba(255, 255, 255, 0.2);
}
.app.dark .thumb {
  opacity: 0.45;
}
.app.dark .thumb.on {
  opacity: 1;
  box-shadow: 0 0 0 2px #fff;
}
.app.dark .site-foot {
  color: rgba(255, 255, 255, 0.4);
}
.app.dark .stage-note {
  color: rgba(255, 255, 255, 0.35);
}
.app.dark .switch {
  background: rgba(255, 255, 255, 0.22);
}
.app.dark .switch[aria-checked="true"] {
  background: var(--accent);
}
.app.dark .panel,
.app.dark .grp,
.app.dark .work,
.app.dark .idea,
.app.dark .script,
.app.dark .avatar-card,
.app.dark .prow,
.app.dark .lang-item,
.app.dark .pcard,
.app.dark .rs-lang {
  background: rgba(255, 255, 255, 0.04);
}
.app.dark .sheet {
  box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.5);
}
.app.dark .scrim {
  background: rgba(0, 0, 0, 0.6);
}
.app.dark .upload.ok {
  background: rgba(30, 158, 90, 0.18);
  color: #7ed4a3;
}
.app.dark .btn.soft {
  background: rgba(255, 255, 255, 0.1);
  color: var(--ink-2);
}
.app.dark .kb-row .v.empty {
  color: #ff7b73;
}
.app.dark .ptable .cur {
  color: #ff7b73;
}
.site-foot {
  display: none;
  margin: 0;
  font-size: 12px;
  color: var(--ink-3);
  padding: 6px 32px 4px;
  align-items: center;
  gap: 14px;
}
.site-foot a {
  color: inherit;
  text-decoration: none;
}
.site-foot a:hover {
  color: var(--ink);
}

/* ---------- header ---------- */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px 4px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.02em;
}
.brand b {
  color: var(--accent);
  font-weight: 600;
}
.brand .mark {
  width: 22px;
  height: 22px;
  color: var(--ink);
}
.brand .mark circle {
  transform-box: fill-box;
  transform-origin: center;
}
.brand .mark circle:last-child {
  animation: duoIn 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) 0.15s both;
}
@keyframes duoIn {
  from {
    transform: translateX(-6px) scale(0.2);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 0.92;
  }
}
.fl {
  display: inline-block;
  width: 22px;
  height: 15px;
  border-radius: 2.5px;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
  vertical-align: middle;
  flex: 0 0 auto;
  background: #ddd;
}
.fl svg {
  display: block;
  width: 100%;
  height: 100%;
}
.langbtn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 34px;
  padding: 0 8px 0 7px;
  border-radius: 999px;
  background: var(--ground-2);
  color: var(--ink);
}
.langbtn .fl {
  width: 27px;
  height: 18px;
}
.langbtn .chev {
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.6;
}
.me {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--ground);
  font-size: 13px;
  font-weight: 600;
  place-items: center;
}
.hdr-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.bell {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--ground-2);
  display: grid;
  place-items: center;
  color: var(--ink);
}
.bell svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.bell i {
  position: absolute;
  top: 7px;
  right: 8px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  border: 1.5px solid var(--ground);
  display: none;
}
.bell.has i {
  display: block;
}
.bell.theme svg {
  width: 17px;
  height: 17px;
}
.dnav {
  gap: 28px;
  margin-left: auto;
}
.dnav a {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
  text-decoration: none;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
}
.dnav a[aria-current="page"] {
  color: var(--ink);
  border-color: var(--ink);
}

/* ---------- hero / chips / cta ---------- */
.hero {
  padding: 4px 20px 10px;
}
.hero h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.hero p {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--ink-2);
}
.search {
  display: none;
  align-items: center;
  gap: 8px;
  margin: 0 20px 8px;
  height: 42px;
  padding: 0 6px 0 14px;
  border-radius: 14px;
  background: var(--ground-2);
}
.search.open {
  display: flex;
}
.search.insheet {
  margin: 0;
  order: 0;
}
.qclose {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--ground);
  color: var(--ink-2);
  font-size: 18px;
  display: grid;
  place-items: center;
}
.app.dark .qclose {
  background: rgba(255, 255, 255, 0.14);
}
.chips button.mag {
  width: 32px;
  padding: 0;
  display: grid;
  place-items: center;
}
.chips button.mag svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}
.chips button.mag[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--ground);
}
.chips button.more {
  display: none;
  align-items: center;
  gap: 3px;
}
.chips button.more svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.7;
}
.catbtn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 32px;
  padding: 0 8px 0 12px;
  border-radius: 999px;
  background: var(--ground);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  flex: 0 0 auto;
  box-shadow: 0 1px 3px rgba(21, 24, 29, 0.12);
}
.catbtn svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.6;
}
.app.dark .catbtn {
  background: rgba(255, 255, 255, 0.14);
  box-shadow: none;
}
.cat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  max-height: 60vh;
  overflow-y: auto;
  padding-bottom: 2px;
}
.cat-grid button {
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--line);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  background: var(--ground);
}
.cat-grid button[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--ground);
}
.app.dark .cat-grid button {
  background: rgba(255, 255, 255, 0.04);
}
.app.dark .cat-grid button[aria-pressed="true"] {
  background: #fff;
  color: #0e1013;
}
.reclone {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  margin-top: 2px;
}
.reclone svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.search svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--ink-3);
  stroke-width: 2;
  stroke-linecap: round;
  flex: 0 0 auto;
}
.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  outline: none;
}
.search input::placeholder {
  color: var(--ink-3);
}
.search input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}
.chips {
  display: flex;
  gap: 8px;
  padding: 0 20px 6px;
  overflow-x: auto;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar {
  display: none;
}
.chips::after {
  content: "";
  flex: 0 0 12px;
}
.chips button {
  flex: 0 0 auto;
  height: 32px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  white-space: nowrap;
  transition:
    background 0.15s,
    color 0.15s;
}
.chips button[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--ground);
}
.cta {
  padding: 6px 20px 16px;
}
.primary {
  width: 100%;
  height: 54px;
  border-radius: 16px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: 0 10px 24px rgba(224, 51, 44, 0.28);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.primary .ci {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: #fff;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.primary .ava {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.7);
}
.primary .ava svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.primary:active {
  transform: translateY(1px);
}
.cta-sub {
  margin-top: 6px;
  text-align: center;
  font-size: 12px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
#ctaReclone {
  margin-top: 4px;
}
#ctaReclone .linkbtn {
  color: var(--ink-3);
}

/* ---------- stage & cards ---------- */
.stage {
  position: relative;
  flex: 1;
  min-height: 0;
  touch-action: pan-y;
  overflow: hidden;
  --cy: 52%;
  --ty: -50%;
}
.card {
  position: absolute;
  left: 50%;
  top: var(--cy, 50%);
  width: min(var(--cw), calc(var(--stage-h, 460px) * 0.62));
  aspect-ratio: 2/3;
  border-radius: 24px;
  overflow: hidden;
  background: #222;
  color: #fff;
  box-shadow: 0 10px 30px rgba(20, 24, 30, 0.14);
  transform: translate(-50%, var(--ty, -50%))
    translate(var(--x, 0px), var(--y, 0px)) scale(var(--s, 1))
    rotate(var(--r, 0deg));
  filter: blur(var(--b, 0px)) brightness(var(--br, 1));
  opacity: var(--o, 1);
  z-index: var(--z, 0);
  transition:
    transform 0.55s cubic-bezier(0.34, 1.35, 0.64, 1),
    filter 0.45s,
    opacity 0.45s;
  cursor: grab;
}
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
  pointer-events: none;
  z-index: 1;
}
.card.dragging {
  transition: none;
  cursor: grabbing;
}
.pos-front {
  --z: 5;
}
.pos-left {
  --x: -46px;
  --y: 12px;
  --s: 0.88;
  --r: -6deg;
  --b: 3px;
  --br: 0.82;
  --o: 0.95;
  --z: 4;
}
.pos-right {
  --x: 46px;
  --y: 12px;
  --s: 0.88;
  --r: 6deg;
  --b: 3px;
  --br: 0.82;
  --o: 0.95;
  --z: 4;
}
.pos-back {
  --x: 0px;
  --y: 26px;
  --s: 0.8;
  --b: 5px;
  --br: 0.7;
  --o: 0.75;
  --z: 3;
}
.pos-off {
  --x: 0px;
  --y: 30px;
  --s: 0.78;
  --b: 8px;
  --o: 0;
  --z: 1;
  pointer-events: none;
}
.pos-left:hover,
.pos-right:hover {
  --b: 1px;
  --br: 0.95;
  --o: 1;
}
.fig {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.vid {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #111;
}
.card.novideo video.vid {
  display: none;
}
.notag {
  position: absolute;
  left: 12px;
  top: 44px;
  display: none;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(224, 51, 44, 0.85);
  color: #fff;
  z-index: 2;
}
.card.novideo .notag {
  display: inline-block;
}
img.thumb-fig {
  object-fit: cover;
}
.head {
  transform-box: fill-box;
  transform-origin: 50% 92%;
}
.eyes {
  transform-box: fill-box;
  transform-origin: center;
}
.mouth {
  transform-box: fill-box;
  transform-origin: center;
}
.pos-front .head {
  animation: bob 5s ease-in-out infinite;
}
.pos-front .eyes {
  animation: blink 4.6s infinite;
}
.pos-front.speaking .mouth {
  animation: talk 0.26s ease-in-out infinite alternate;
}
@keyframes bob {
  0%,
  100% {
    transform: rotate(-1.4deg);
  }
  50% {
    transform: rotate(1.4deg);
  }
}
@keyframes blink {
  0%,
  93%,
  100% {
    transform: scaleY(1);
  }
  96% {
    transform: scaleY(0.08);
  }
}
@keyframes talk {
  from {
    transform: scaleY(0.45);
  }
  to {
    transform: scaleY(2);
  }
}
.card-top {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
}
.live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(6px);
}
.live i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(224, 51, 44, 0.6);
  animation: pulse 1.2s infinite;
}
.card:not(.speaking) .live i {
  animation: none;
  opacity: 0.5;
}
@keyframes pulse {
  to {
    box-shadow: 0 0 0 7px rgba(224, 51, 44, 0);
  }
}
.mute {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(6px);
  color: #fff;
}
.mute svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: #fff;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.live .wave {
  display: none;
  gap: 2px;
  align-items: flex-end;
  height: 10px;
  margin-left: 2px;
}
.live .wave i {
  width: 2px;
  background: #fff;
  border-radius: 1px;
  height: 40%;
  animation: bar 0.5s ease-in-out infinite alternate;
}
.live .wave i:nth-child(2) {
  animation-delay: 0.15s;
}
.live .wave i:nth-child(3) {
  animation-delay: 0.3s;
}
.card.sound .live .wave {
  display: inline-flex;
}
.card-bottom {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 52px 14px 14px;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.74),
    rgba(0, 0, 0, 0.38) 55%,
    transparent
  );
}
.sub {
  margin: 0 0 10px;
  font-size: 15px;
  line-height: 1.45;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.42);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
  min-height: 44px;
  transition: opacity 0.25s;
}
.sub .on {
  color: #fff;
}
.meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 8px;
}
.meta b {
  display: block;
  font-size: 17px;
  line-height: 1.2;
}
.meta span {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.82);
}
.meta .fl {
  width: 36px;
  height: 24px;
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}
.hint {
  position: absolute;
  left: 0;
  right: 0;
  top: 2px;
  text-align: center;
  font-size: 12px;
  color: var(--ink-3);
  transition: opacity 0.3s;
  pointer-events: none;
  z-index: 6;
}
.hint.gone {
  opacity: 0;
}
.arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--ground);
  box-shadow: 0 4px 14px rgba(20, 24, 30, 0.18);
  place-items: center;
  z-index: 6;
  color: var(--ink);
}
.arrow.prev {
  left: 8px;
}
.arrow.next {
  right: 8px;
}
.arrow svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.arrow:hover {
  background: var(--ground-2);
}
.counter {
  text-align: center;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  padding: 2px 0 4px;
  font-variant-numeric: tabular-nums;
}
.strip {
  gap: 8px;
  padding: 10px 4px 4px;
  overflow-x: auto;
  scrollbar-width: thin;
}
.thumb {
  flex: 0 0 auto;
  width: 40px;
  height: 60px;
  border-radius: 8px;
  overflow: hidden;
  opacity: 0.5;
  transition:
    opacity 0.2s,
    transform 0.2s;
  background: #222;
}
.thumb-fig {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
}
.thumb:hover {
  opacity: 0.85;
}
.thumb.on {
  opacity: 1;
  box-shadow: 0 0 0 2px var(--ink);
  transform: translateY(-2px);
}

/* ---------- tabs (phone) ---------- */
.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  padding: 10px 8px calc(10px + env(safe-area-inset-bottom));
}
.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  color: var(--ink-3);
  font-weight: 500;
  text-decoration: none;
}
.tab svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tab[aria-current="page"] {
  color: var(--ink);
}
.tab .badge {
  position: relative;
}
.tab .badge::after {
  content: "";
  position: absolute;
  top: -1px;
  right: -2px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  border: 1.5px solid var(--ground);
}
.stage-note {
  margin: 0;
  font-size: 12px;
  color: var(--ink-3);
}

/* ---------- publish popup ---------- */
.tab.action .ic {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--ground);
  display: grid;
  place-items: center;
  box-shadow: 0 6px 16px rgba(21, 24, 29, 0.25);
  margin-top: -16px;
}
.tab.action .ic svg {
  width: 24px;
  height: 24px;
  stroke: var(--ground);
}
.tab.action .tl {
  color: var(--ink);
}
.tabava {
  position: relative;
  display: block;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  overflow: hidden;
  background: #222;
  box-shadow:
    0 0 0 2px var(--ground),
    0 0 0 3px var(--ink);
}
.tabava svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.tabava.big {
  width: 34px;
  height: 34px;
  box-shadow: none;
}
.me .tabava.big {
  display: block;
}
.sheet.pub {
  max-height: 88vh;
}
.sheet.spk {
  z-index: 33;
}
.pub-level {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}
.head-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.back {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--ground-2);
  display: grid;
  place-items: center;
}
.back svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.linkbtn {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.sec {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
  letter-spacing: 0.04em;
}
.works {
  max-height: 50vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 2px;
}
.work {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--ground);
}
.work-fig {
  position: relative;
  width: 48px;
  aspect-ratio: 2/3;
  border-radius: 8px;
  overflow: hidden;
  background: #222;
  cursor: pointer;
}
.work-main {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.work-title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.work-meta {
  font-size: 12px;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.work-meta .ex {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--ground-2);
  color: var(--ink-3);
  font-size: 11px;
  vertical-align: middle;
}
.work-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.dots {
  display: flex;
  gap: 7px;
  align-items: center;
  flex-wrap: wrap;
}
.dot {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  position: relative;
  line-height: 1;
  border: 0;
  padding: 0;
}
.dot svg {
  width: 11px;
  height: 11px;
}
.dot::after {
  content: "";
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1.5px solid var(--ground);
  background: #c9ced6;
}
.dot[data-s="publishing"]::after {
  background: #2f6fed;
}
.dot[data-s="published"]::after {
  background: var(--ok);
}
.dot[data-s="failed"]::after {
  background: var(--accent);
}
.dot[data-s="none"] {
  opacity: 0.38;
}
.dot[data-s="failed"] {
  cursor: pointer;
}
.btn {
  height: 34px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  flex: 0 0 auto;
}
.btn.red {
  background: var(--accent);
  color: #fff;
}
.btn.ghost {
  border: 1px solid var(--ink);
  color: var(--ink);
}
.btn.soft {
  background: var(--ground-2);
  color: var(--ink-2);
}
.empty {
  padding: 22px 12px;
  text-align: center;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.empty small {
  font-size: 12px;
  font-weight: 400;
  color: var(--ink-3);
}
.plist {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 44vh;
  overflow-y: auto;
}
.prow {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.prow.off {
  opacity: 0.6;
}
.plogo {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: #fff;
  font-family: var(--mono);
  font-weight: 600;
  font-size: 13px;
  line-height: 1;
}
.plogo svg {
  width: 18px;
  height: 18px;
}
.pname {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
}
.pstate {
  font-size: 11px;
  color: var(--ink-3);
}
.pstate.bad {
  color: var(--accent);
}
.ltag {
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--ground-2);
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-2);
  white-space: nowrap;
}
.bindbtn {
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--ink);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.switch {
  width: 44px;
  height: 26px;
  border-radius: 999px;
  background: #d5d9df;
  position: relative;
  transition: background 0.2s;
}
.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s;
}
.switch[aria-checked="true"] {
  background: var(--ink);
}
.switch[aria-checked="true"]::after {
  transform: translateX(18px);
}
.when {
  display: flex;
  gap: 8px;
  align-items: center;
}
.when .lab {
  margin-right: 2px;
}
.chip {
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
}
.chip.on {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}
.pub-foot {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.secondary {
  width: 100%;
  height: 46px;
  border-radius: 14px;
  border: 1px solid var(--line);
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}
.pub-hint {
  margin: 0;
  font-size: 12px;
  color: var(--ink-3);
  text-align: center;
  line-height: 1.5;
}
.head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

/* ---------- clone flow: login, recording, wait, result ---------- */
.inrow {
  display: flex;
  gap: 8px;
  align-items: center;
}
.inrow .input {
  flex: 1;
  min-width: 0;
}
.prefix {
  height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 600;
  color: var(--ink-2);
  flex: 0 0 auto;
}
.recbox {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border: 1px dashed var(--ink-3);
  border-radius: 12px;
}
.recbox .say {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}
.recrow {
  display: flex;
  align-items: center;
  gap: 10px;
}
.recbtn {
  flex: 0 0 auto;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 0 0 0 rgba(224, 51, 44, 0.5);
}
.recbox.on .recbtn {
  animation: pulse 1s infinite;
}
.bars {
  display: flex;
  gap: 3px;
  align-items: flex-end;
  height: 28px;
  flex: 1;
}
.bars i {
  flex: 1;
  background: var(--ink-3);
  border-radius: 2px;
  height: 25%;
}
.recbox.on .bars i {
  background: var(--accent);
  animation: bar 0.5s ease-in-out infinite alternate;
}
.recbox.on .bars i:nth-child(2n) {
  animation-delay: 0.15s;
}
.recbox.on .bars i:nth-child(3n) {
  animation-delay: 0.3s;
}
@keyframes bar {
  from {
    height: 20%;
  }
  to {
    height: 100%;
  }
}
.rectime {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-2);
  min-width: 40px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.recbox .fine {
  text-align: left;
}
.overlay {
  position: absolute;
  inset: 0;
  background: var(--ground);
  z-index: 25;
  display: flex;
  flex-direction: column;
}
.overlay.result {
  background: #0e1013;
}
.wait-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(70% 55% at 50% 35%, #4f6384 0%, #25334d 70%);
}
.wait-body {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px;
  color: #fff;
  text-align: center;
}
.ring {
  position: relative;
  width: 124px;
  height: 124px;
}
.ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.ring circle {
  fill: none;
  stroke-width: 8;
}
.ring .track {
  stroke: rgba(255, 255, 255, 0.2);
}
.ring .prog {
  stroke: #fff;
  stroke-linecap: round;
  stroke-dasharray: 326.7;
  stroke-dashoffset: 326.7;
  transition: stroke-dashoffset 0.25s linear;
}
.ring .pct {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 600;
}
.wait-body h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  text-wrap: balance;
}
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.5);
}
.steps li {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
}
.steps li::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
}
.steps li.doing {
  color: #fff;
}
.steps li.doing::before {
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(224, 51, 44, 0.6);
  animation: pulse 1.2s infinite;
}
.steps li.done {
  color: #fff;
}
.steps li.done::before {
  background: var(--ok);
}
.wait-body .fine {
  color: rgba(255, 255, 255, 0.6);
}
.wait-body .secondary {
  max-width: 320px;
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
}
.result-stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}
.result-stage .card {
  position: relative;
  left: auto;
  top: auto;
  transform: none;
  filter: none;
  opacity: 1;
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  border-radius: 0;
  cursor: default;
  z-index: 0;
  --z: 0;
}
.result-stage .card-bottom {
  padding-bottom: 172px;
}
.result-stage .card-top {
  top: 64px;
}
.result-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  z-index: 5;
  background: linear-gradient(rgba(0, 0, 0, 0.5), transparent);
}
.result-title {
  flex: 1;
  text-align: center;
  color: #fff;
  font-weight: 700;
  font-size: 16px;
}
.result-top .sp {
  width: 30px;
}
.glass {
  background: rgba(255, 255, 255, 0.18) !important;
  color: #fff !important;
  backdrop-filter: blur(8px);
  border-color: rgba(255, 255, 255, 0.35) !important;
}
.back.glass svg {
  stroke: #fff;
}
.result-ui {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.55));
  padding: 12px 16px calc(16px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.result-langs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px 0;
}
.result-langs::-webkit-scrollbar {
  display: none;
}
.result-langs .chip {
  flex: 0 0 auto;
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
  backdrop-filter: blur(8px);
}
.result-langs .chip.on {
  background: #fff;
  border-color: #fff;
  color: var(--ink);
}
.result-btns {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 10px;
}
.result-btns .secondary,
.result-btns .primary {
  height: 52px;
  width: 100%;
}
.youtag {
  position: absolute;
  left: 12px;
  top: 100px;
  font-size: 10px;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  max-width: 80%;
}
.result-side,
.player {
  display: none;
}
.prow.setrow {
  grid-template-columns: 34px minmax(0, 1fr) auto;
}
.idea {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.idea b {
  font-size: 14px;
}
.idea p {
  margin: 0;
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.5;
}
.idea .meta {
  font-size: 12px;
  color: var(--ink-3);
}
.gen10 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border: 1px dashed var(--ink-3);
  border-radius: 14px;
}
.gen10 .g-t {
  font-size: 14px;
  font-weight: 700;
}
.gen10 .g-s {
  font-size: 12px;
  color: var(--ink-2);
  margin-top: 2px;
}
.msg {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.msg:first-child {
  border-top: 0;
}
.msg i {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink-3);
  margin-top: 6px;
}
.msg.unread i {
  background: var(--accent);
}
.msg .m-t {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}
.msg .m-s {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 2px;
}
.msgs {
  display: flex;
  flex-direction: column;
  max-height: 56vh;
  overflow-y: auto;
}
.result-del {
  color: rgba(255, 255, 255, 0.7) !important;
  align-self: center;
}
.ta {
  height: auto;
  min-height: 84px;
  padding: 10px 14px;
  resize: none;
  line-height: 1.5;
  font-family: inherit;
}
.chips.wrap {
  flex-wrap: wrap;
  overflow: visible;
  padding: 0;
}
.chips.wrap button {
  height: 32px;
}
.segs.h32 button {
  height: 32px;
  font-size: 13px;
}
#mkSpeaker {
  margin-top: 6px;
}
.sub.long {
  font-size: 13px;
  line-height: 1.4;
}
.me-left,
.me-right {
  display: contents;
}
.genpill {
  position: absolute;
  top: 58px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--ground);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 8px 20px rgba(21, 24, 29, 0.25);
  white-space: nowrap;
}
.genpill i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.2s infinite;
}
.genpill.done i {
  background: var(--ok);
  animation: none;
}

/* ---------- toast, scrim, sheets ---------- */
.toast {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 96px;
  background: var(--ink);
  color: var(--ground);
  font-size: 13px;
  padding: 10px 14px;
  border-radius: 12px;
  text-align: center;
  opacity: 0;
  transform: translateY(6px);
  transition: 0.25s;
  pointer-events: none;
  z-index: 40;
}
.toast.show {
  opacity: 1;
  transform: none;
}
.scrim {
  position: absolute;
  inset: 0;
  background: rgba(15, 18, 22, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  z-index: 30;
}
.scrim.open {
  opacity: 1;
  pointer-events: auto;
}
.sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--ground);
  border-radius: 24px 24px 0 0;
  padding: 12px 20px calc(18px + env(safe-area-inset-bottom));
  transform: translateY(105%);
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
  z-index: 31;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.sheet.open {
  transform: none;
}
.grab {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: var(--line);
  margin: 0 auto;
}
.sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.sheet-title {
  font-size: 18px;
  font-weight: 700;
}
.sheet-sub {
  font-size: 13px;
  color: var(--ink-2);
  margin-top: 2px;
}
.close {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--ground-2);
  font-size: 18px;
  display: grid;
  place-items: center;
}
.sheet-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.lab {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  letter-spacing: 0.04em;
}
.lab em {
  font-style: normal;
  color: var(--accent);
}
.lab i {
  font-style: normal;
  font-weight: 400;
}
.input {
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 14px;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  background: var(--ground);
  width: 100%;
}
.input::placeholder {
  color: var(--ink-3);
}
.upload {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 84px;
  border: 1.5px dashed var(--ink-3);
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}
.upload small {
  font-size: 12px;
  font-weight: 400;
  color: var(--ink-2);
}
.upload.ok {
  border-style: solid;
  border-color: var(--ok);
  background: var(--ok-soft);
  color: var(--ok-ink);
}
.radios {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.radio {
  min-height: 44px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  text-align: center;
}
.radio input {
  accent-color: var(--ink);
  margin: 0;
  flex: 0 0 auto;
}
.radio.on {
  border-color: var(--ink);
  color: var(--ink);
}
.fine {
  margin: 0;
  font-size: 12px;
  color: var(--ink-3);
  text-align: center;
}
.qr {
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 18px 16px;
  background: var(--ground-2);
  border-radius: 16px;
  text-align: center;
}
.qr-code {
  background: #fff;
  padding: 8px;
  border-radius: 10px;
  line-height: 0;
}
.qr b {
  font-size: 14px;
}
.qr p {
  margin: 0;
  font-size: 12px;
  color: var(--ink-2);
  line-height: 1.5;
}
.lang-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 56vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 2px;
}
.lang-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  text-align: left;
}
.lang-item .ln b {
  display: block;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lang-item .ln small {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-3);
  line-height: 1.2;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lang-item .fl {
  width: 24px;
  height: 16px;
}
.lang-item .ln {
  flex: 1;
  min-width: 0;
}
.lang-item[aria-selected="true"] {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
}
.lang-item .chk {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--ink);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
}
.lang-item[aria-selected="true"] .chk {
  opacity: 1;
}
@media (prefers-reduced-motion: reduce) {
  .pos-front .head,
  .pos-front .eyes,
  .live i {
    animation: none;
  }
  .card,
  .sheet {
    transition-duration: 0.01s;
  }
}

/* ---------- desktop: same page, two columns ---------- */
@media (min-width: 900px) {
  body {
    padding: 0;
  }
  .app {
    max-width: none;
    margin: 0;
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
    box-shadow: none;
  }
  .main,
  .left,
  .right {
    display: block;
  }
  .main {
    display: grid;
    grid-template-columns: minmax(340px, 460px) minmax(0, 1fr);
    gap: 48px;
    padding: 16px 32px 8px;
    flex: 1;
    min-height: 0;
  }
  .left {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 22px;
    min-width: 0;
  }
  .right {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }
  .top {
    height: 64px;
    padding: 0 32px;
    border-bottom: 1px solid var(--line);
    flex: 0 0 auto;
  }
  .brand {
    font-size: 17px;
  }
  .dnav {
    display: flex;
  }
  .me {
    display: grid;
  }
  .hero {
    padding: 0;
  }
  .hero h1 {
    font-size: 44px;
    line-height: 1.1;
  }
  .hero p {
    font-size: 18px;
    margin-top: 10px;
  }
  .search {
    display: flex;
    margin: 0;
    max-width: 440px;
  }
  .search.insheet {
    max-width: none;
  }
  .search:not(.insheet) .qclose {
    display: none;
  }
  .chips button.mag {
    display: none;
  }
  .chips button.more {
    display: inline-flex;
  }
  .sheet.cat {
    left: 50%;
    top: 50%;
    bottom: auto;
    width: min(620px, 92vw);
    border-radius: 20px;
    padding: 22px 26px 26px;
    transform: translate(-50%, -50%) scale(0.98);
    opacity: 0;
    pointer-events: none;
    transition:
      transform 0.25s,
      opacity 0.25s;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
  }
  .sheet.cat.open {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    pointer-events: auto;
  }
  .cat-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .chips {
    padding: 0;
    flex-wrap: wrap;
    overflow: visible;
  }
  .chips button {
    height: 34px;
    font-size: 14px;
    padding: 0 14px;
  }
  .cta {
    padding: 0;
    max-width: 440px;
  }
  .primary {
    height: 56px;
    font-size: 18px;
  }
  .cta-sub {
    text-align: left;
  }
  .stage {
    --cw: 380px;
    min-height: 320px;
    --cy: 50%;
    --ty: -50%;
  }
  .pos-left {
    --x: -130px;
    --y: 16px;
    --s: 0.86;
    --r: -6deg;
  }
  .pos-right {
    --x: 130px;
    --y: 16px;
    --s: 0.86;
    --r: 6deg;
  }
  .pos-back {
    --y: 34px;
    --s: 0.78;
  }
  .hint {
    display: none;
  }
  .arrow {
    display: grid;
  }
  .strip {
    display: flex;
    flex: 0 0 auto;
  }
  .counter {
    padding: 8px 0 0;
  }
  .tabs {
    display: none;
  }
  .stage-note {
    display: block;
    padding: 0 32px 12px;
    flex: 0 0 auto;
  }
  .site-foot {
    display: flex;
    flex: 0 0 auto;
  }
  .app.dark .top {
    border-bottom-color: rgba(255, 255, 255, 0.1);
  }
  .toast {
    left: 50%;
    right: auto;
    bottom: 40px;
    transform: translate(-50%, 6px);
    min-width: 280px;
  }
  .toast.show {
    transform: translate(-50%, 0);
  }
  .grab {
    display: none;
  }
  .sheet.lang {
    left: auto;
    right: 32px;
    top: 60px;
    bottom: auto;
    width: 460px;
    border-radius: 16px;
    padding: 14px 16px 12px;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition:
      transform 0.2s,
      opacity 0.2s;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  }
  .sheet.lang.open {
    transform: none;
    opacity: 1;
    pointer-events: auto;
  }
  .lang-grid {
    max-height: 60vh;
  }
  .sheet.clone {
    left: 50%;
    top: 50%;
    bottom: auto;
    width: min(800px, 92vw);
    border-radius: 20px;
    padding: 22px 26px 26px;
    transform: translate(-50%, -50%) scale(0.98);
    opacity: 0;
    pointer-events: none;
    transition:
      transform 0.25s,
      opacity 0.25s;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
  }
  .sheet.clone.open {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    pointer-events: auto;
  }
  .sheet-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 28px;
    align-items: start;
  }
  .qr {
    display: flex;
  }
  .hdr-right {
    margin-left: 16px;
    gap: 10px;
  }
  .view.home {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
  }
  .view.page {
    max-width: 760px;
    width: 100%;
    margin: 0 auto;
    padding-top: 12px;
  }
  .page-head {
    padding: 0 32px 8px;
  }
  .page-body {
    padding: 8px 32px 24px;
  }
  .genpill {
    top: 76px;
  }
  /* result: two columns, real player, no overlaid controls */
  .overlay.result {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 400px;
    background: var(--ground);
    color: var(--ink);
  }
  .result-stage {
    position: relative;
    inset: auto;
    flex-direction: column;
    gap: 14px;
    padding: 24px;
    background: #0e1013;
    min-height: 0;
  }
  .result-stage .card {
    width: auto;
    height: min(68vh, calc(100% - 70px));
    aspect-ratio: 9/16;
    border-radius: 22px;
  }
  .result-stage .card-bottom {
    padding-bottom: 52px;
  }
  .result-stage .card-top {
    top: 12px;
  }
  .youtag {
    top: auto;
    bottom: 118px;
  }
  .result-top,
  .result-ui {
    display: none;
  }
  .player {
    display: flex;
    align-items: center;
    gap: 10px;
    width: min(100%, 400px);
    color: #fff;
    flex: 0 0 auto;
  }
  .pbtn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    display: grid;
    place-items: center;
    color: #fff;
  }
  .pbtn svg {
    width: 16px;
    height: 16px;
    fill: #fff;
    stroke: #fff;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  .ptrack {
    flex: 1;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.25);
    overflow: hidden;
  }
  .ptrack i {
    display: block;
    height: 100%;
    width: 0;
    background: #fff;
  }
  .ptime {
    font-family: var(--mono);
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    font-variant-numeric: tabular-nums;
  }
  .result-side {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 28px 28px 24px;
    overflow-y: auto;
    min-height: 0;
  }
  .rs-title {
    font-size: 22px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .rs-script {
    margin: 0;
    font-size: 15px;
    line-height: 1.6;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--ground-2);
  }
  .rs-langs {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
  .rs-lang {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 44px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    color: var(--ink);
    text-align: left;
  }
  .rs-lang .st {
    margin-left: auto;
    font-size: 12px;
    color: var(--ink-3);
    font-weight: 500;
  }
  .rs-lang.on {
    border-color: var(--ink);
    box-shadow: inset 0 0 0 1px var(--ink);
  }
  .rs-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: auto;
    padding-top: 8px;
  }
  .rs-actions .linkbtn {
    align-self: center;
  }
  /* wait: a corner card, the wall stays usable */
  #waitView {
    inset: auto;
    top: 76px;
    right: 24px;
    width: 300px;
    border-radius: 16px;
    background: var(--ink);
    color: #fff;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    overflow: hidden;
  }
  #waitView .wait-bg {
    display: none;
  }
  #waitView .wait-body {
    padding: 18px;
    gap: 10px;
  }
  #waitView .ring {
    width: 72px;
    height: 72px;
  }
  #waitView .ring .pct {
    font-size: 15px;
  }
  #waitView h3 {
    font-size: 15px;
  }
  #waitView .steps {
    font-size: 13px;
    gap: 4px;
  }
  #waitView #waitMin {
    display: none;
  }
  /* Me sections follow a single reading order. */
  #viewMe .page-body {
    display: flex;
    flex-direction: column;
    gap: 28px;
  }
  .me-left,
  .me-right {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
  }
  .me-left {
    position: sticky;
    top: 0;
  }
  .sheet.pay,
  .sheet.login,
  .sheet.make,
  .sheet.kb,
  .sheet.inbox,
  .sheet.spk {
    left: 50%;
    top: 50%;
    bottom: auto;
    width: min(560px, 92vw);
    border-radius: 20px;
    padding: 22px 26px 26px;
    transform: translate(-50%, -50%) scale(0.98);
    opacity: 0;
    pointer-events: none;
    transition:
      transform 0.25s,
      opacity 0.25s;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
  }
  .sheet.pay.open,
  .sheet.login.open,
  .sheet.make.open,
  .sheet.kb.open,
  .sheet.inbox.open,
  .sheet.spk.open {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    pointer-events: auto;
  }
  .sheet.inbox {
    left: auto;
    right: 32px;
    top: 60px;
    transform: translateY(-8px);
    width: 420px;
  }
  .sheet.inbox.open {
    transform: none;
  }
  .sheet.make {
    width: min(640px, 92vw);
    max-height: 90vh;
    overflow-y: auto;
  }
  .sheet.pub {
    left: auto;
    right: 0;
    top: 0;
    bottom: 0;
    width: 440px;
    max-height: none;
    border-radius: 0;
    padding: 20px 22px 22px;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: -20px 0 60px rgba(0, 0, 0, 0.2);
  }
  .sheet.pub.open {
    transform: none;
  }
  .pub-level {
    flex: 1;
  }
  .works {
    max-height: none;
    flex: 1;
  }
  .plist {
    max-height: 50vh;
  }
}

/* The confirmed prototype supplies the visual tokens and shell. Business pages below share them. */
body {
  color: var(--ink);
}
button,
a,
input,
textarea,
select {
  touch-action: manipulation;
}
a {
  text-decoration: none;
}
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
input,
textarea,
select {
  font: inherit;
  color: var(--ink);
}
.app {
  user-select: auto;
  overflow-y: auto;
}
.top {
  flex-shrink: 0;
}
.brand {
  white-space: nowrap;
}
.screen {
  flex: 1;
  min-height: 0;
}
.home.screen {
  display: flex;
  flex-direction: column;
}
.home .main,
.home .left,
.home .right {
  display: contents;
}
.home .hero {
  order: 1;
}
.home .search {
  order: 2;
}
.home .chips {
  order: 3;
}
.home .stage {
  order: 4;
}
.home .cta {
  order: 5;
}
.home .strip {
  order: 6;
}
.tabs {
  flex-shrink: 0;
}
.card .meta a {
  display: block;
  font-weight: 700;
  font-size: 17px;
}
.card .sub {
  color: white;
  font-size: 14px;
}
.card-top {
  font-size: 12px;
}
.preview-label {
  border-radius: 20px;
  padding: 5px 8px;
  background: #0009;
  color: #fff;
}
.card-top button {
  background: #0009;
  padding: 5px 8px;
  border-radius: 20px;
  color: white;
}
.card .meta span {
  font-size: 12px;
}
.card {
  touch-action: pan-y;
}
.tabs a {
  cursor: pointer;
}
.dnav button {
  font-size: 14px;
  font-weight: 600;
}
.home .cta {
  padding-bottom: 16px;
}
.card a:focus-visible {
  outline-color: white;
}
.card button:focus-visible {
  outline-color: white;
}
[role="status"].notice {
  padding: 10px 14px;
  background: var(--accent-soft);
  border-radius: 12px;
  color: var(--ink);
  margin: 8px 0;
}
.notice:empty {
  display: none;
}
.muted {
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.6;
}
.tag {
  display: inline-block;
  background: var(--ground-2);
  padding: 6px 10px;
  border-radius: 20px;
  font-size: 14px;
}
.linkbtn {
  font-size: 14px;
}
.page-content {
  padding: 24px 20px;
  max-width: 1050px;
  width: 100%;
  margin: 0 auto;
  overflow: auto;
  flex: 1;
}
.page-content h1 {
  font-size: 28px;
  margin: 0 0 12px;
}
.page-content h2 {
  font-size: 20px;
}
.page-content p {
  line-height: 1.6;
}
.two-column {
  display: grid;
  gap: 24px;
}
.full-video {
  width: 100%;
  aspect-ratio: 9/16;
  max-height: 76vh;
  max-height: 76dvh;
  object-fit: contain;
  background: #111;
  border-radius: 20px;
}
.form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
}
.form input,
.form textarea,
.form select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--ground-2);
  padding: 12px;
  font-size: 16px;
  outline-offset: 2px;
}
.form textarea {
  resize: vertical;
  min-height: 160px;
  line-height: 1.65;
}
.form input[type="checkbox"] {
  width: auto;
}
.form .inline {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
}
.row-fields {
  display: flex;
  gap: 10px;
}
.row-fields > * {
  flex: 1;
  min-width: 0;
}
.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.btn {
  min-height: 40px;
  padding: 9px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn.soft {
  background: var(--ground-2);
  color: var(--ink);
}
.primary {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.form .primary {
  width: 100%;
  min-height: 50px;
}
.auth {
  max-width: 440px;
  padding: 40px 20px;
}
.auth .form {
  padding: 20px 0;
}
.auth .auth-switch {
  color: var(--accent);
}
dialog {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--ink);
  background: var(--ground);
  width: min(560px, calc(100% - 24px));
  max-height: 90vh;
  max-height: 90dvh;
  overflow: auto;
}
dialog::backdrop {
  background: #0008;
}
dialog .dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
dialog h2 {
  margin: 0;
  font-size: 20px;
}
dialog .close {
  min-width: 40px;
  height: 40px;
  background: var(--ground-2);
  border-radius: 50%;
  font-size: 24px;
}
dialog input[type="search"] {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  background: var(--ground-2);
  border-radius: 12px;
  font: inherit;
  margin-bottom: 14px;
}
.cat-grid a {
  display: grid;
  place-items: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 14px;
}
.speaker-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.speaker-grid button {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  padding-bottom: 10px;
}
.speaker-grid img {
  width: 100%;
  height: 125px;
  object-fit: cover;
}
.speaker-grid span {
  display: block;
  font-size: 14px;
  padding-top: 8px;
}
.speaker {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 8px;
}
.speaker img {
  width: 36px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
}
.work-card {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 12px;
  border: 1px solid var(--line);
  padding: 12px;
  border-radius: 16px;
  margin-bottom: 12px;
}
.work-card img {
  width: 64px;
  height: 96px;
  object-fit: cover;
  border-radius: 10px;
}
.work-card h3 {
  font-size: 16px;
  margin: 4px 0;
}
.work-card .muted {
  margin: 5px 0;
}
.work-list {
  min-width: 0;
}
.stage-list {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 8px;
}
.stage-list li {
  padding: 10px;
  border-radius: 10px;
  background: var(--ground-2);
  font-size: 14px;
}
.stage-list li.done {
  color: var(--ok-ink);
  background: var(--ok-soft);
}
.stage-list li.current {
  border: 1px solid var(--accent);
}
.job-panel {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  margin: 16px 0;
}
.version-list {
  display: grid;
  gap: 10px;
}
.version-list article {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.version-list pre {
  white-space: pre-wrap;
  font: inherit;
  font-size: 14px;
  line-height: 1.5;
}
.category-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.template-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.template-grid img {
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
  border-radius: 16px;
}
.template-grid h2 {
  font-size: 16px;
}
.saved-mark {
  font-size: 13px;
  color: var(--ink-2);
}
.tabpane[hidden] {
  display: none;
}
.private-badge {
  font-size: 13px;
  color: var(--ink-2);
}
.result-copy {
  white-space: pre-wrap;
  line-height: 1.7;
}
.small-note {
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-2);
}
.mobile-back {
  display: inline-flex;
  margin-bottom: 16px;
}
.publish-drawer .platforms {
  display: grid;
  gap: 12px;
}
.publish-drawer .platforms div {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
}
.bottom-space {
  padding-bottom: 20px;
}
.pending-link {
  position: fixed;
  right: 20px;
  top: 80px;
  z-index: 9;
  background: var(--ink);
  color: var(--ground);
  border-radius: 20px;
  padding: 12px 18px;
  box-shadow: 0 4px 15px #0002;
}
.footer-note {
  padding: 14px 20px;
  font-size: 12px;
  color: var(--ink-2);
}
@media (max-width: 899px) {
  .me {
    display: none;
  }
  .tabs {
    position: sticky;
    bottom: 0;
    background: var(--ground);
    z-index: 8;
  }
  .home .stage {
    --cy: calc(100% - 12px);
    --ty: -100%;
  }
  .home .card {
    width: min(77%, calc((var(--stage-h, 460px) - 20px) * 0.6666667));
  }
  .home .hint {
    top: 6px;
  }
  .page-content .two-column .full-video {
    max-height: 62vh;
    max-height: 62dvh;
  }
  .page-content {
    padding-bottom: 28px;
  }
  dialog {
    position: fixed;
    top: auto;
    bottom: 0;
    margin: 0 auto;
    width: min(100%, 560px);
    border-radius: 22px 22px 0 0;
    max-height: 90vh;
    max-height: 90dvh;
  }
  .page-content .primary {
    min-height: 50px;
  }
  .home .hero h1 {
    font-size: 28px;
  }
  .row-fields {
    flex-wrap: wrap;
  }
}
@media (min-width: 900px) {
  .app {
    max-width: none;
    margin: 0;
  }
  .home .main {
    width: 100%;
    max-width: 1280px;
    margin-inline: auto;
    display: grid;
    grid-template-columns: 40% 60%;
    flex: 1;
    min-height: 0;
    padding: 24px 32px 16px;
    gap: 0;
  }
  .home .left {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 20px;
    padding-right: 36px;
  }
  .home .right {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }
  .home .hero {
    padding: 0;
  }
  .home .hero h1 {
    font-size: 44px;
  }
  .home .hero p {
    font-size: 18px;
  }
  .home .search {
    display: flex;
    margin: 0;
  }
  .home .stage {
    min-height: 360px;
  }
  .home .card {
    width: min(380px, calc(var(--stage-h, 650px) * 0.58));
  }
  .home .cta {
    padding: 0;
  }
  .home .strip {
    display: flex;
  }
  .two-column {
    grid-template-columns: minmax(280px, 0.85fr) minmax(340px, 1fr);
    gap: 40px;
  }
  .two-column.me-layout {
    grid-template-columns: 320px minmax(0, 1fr);
  }
  .template-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
  .page-content {
    padding: 32px;
  }
  .full-video {
    max-height: 760px;
  }
  .publish-drawer {
    right: 0;
    left: auto;
    top: 0;
    bottom: 0;
    height: 100vh;
    height: 100dvh;
    max-height: none;
    margin: 0;
    border-radius: 0;
    width: 440px;
  }
  .footer-note {
    padding: 14px 32px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
/* The editor follows the prototype's centered panel; the first action remains writing. */
.make-screen {
  max-width: 730px;
}
.make-screen .two-column {
  display: flex;
  flex-direction: column-reverse;
  gap: 0;
}
.make-editor {
  background: var(--ground);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 24px;
}
.make-screen .make-aside > video,
.make-screen .make-aside > p {
  display: none;
}
.make-editor h1 {
  font-size: 24px;
}
.make-editor .form {
  gap: 12px;
}
@media (min-width: 1180px) {
  .make-aside #job-panel {
    position: fixed;
    right: 20px;
    top: 70px;
    width: 260px;
    z-index: 5;
  }
  .make-aside .job-panel {
    background: var(--ground);
    box-shadow: 0 10px 30px #0002;
  }
}
@media (max-width: 899px) {
  .make-screen {
    padding: 16px 14px 28px;
  }
  .make-editor {
    padding: 18px 14px;
  }
  .make-editor .actions {
    gap: 6px;
  }
  .make-editor .actions .btn {
    font-size: 13px;
    padding: 7px 9px;
  }
  .make-editor .form textarea {
    min-height: 175px;
  }
}
.card .sub.demand-excerpt {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-weight: 500;
}
/* Restore the 29f3947 controls and keep native dialogs inside the prototype shell. */
.primary .ci {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}
.langbtn .fl {
  width: 27px;
  height: 18px;
}
.langbtn .chev {
  flex: 0 0 12px;
  width: 12px;
  height: 12px;
  stroke-width: 2;
}
.chips button.more svg {
  flex: 0 0 12px;
}
.card-top .mute {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(6px);
}
.card-top .mute svg {
  width: 15px;
  height: 15px;
  stroke: #fff;
  stroke-width: 2;
}
.app.modal-open {
  overflow: hidden;
}
dialog.prototype-dialog {
  position: fixed;
  inset: auto;
  margin: 0;
  left: var(--dialog-left, 0px);
  top: var(--dialog-top, auto);
  bottom: var(--dialog-bottom, 0px);
  width: var(--dialog-width, 100%);
  height: var(--dialog-height, auto);
  max-width: none;
  max-height: var(--dialog-maxHeight, 88vh);
  max-height: var(--dialog-maxHeight, 88dvh);
  padding: 12px 20px calc(18px + env(safe-area-inset-bottom));
  border: 0;
  border-radius: 24px 24px 0 0;
  box-shadow: none;
  color: var(--ink);
  background: var(--ground);
  overflow: auto;
  gap: 14px;
}
dialog.prototype-dialog[open] {
  display: flex;
  flex-direction: column;
}
dialog.prototype-dialog::backdrop {
  background: transparent;
}
dialog.prototype-dialog:focus-visible {
  outline: none;
}
.prototype-dialog > p {
  margin: 0;
}
.prototype-dialog h2,
.prototype-dialog .sheet-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  line-height: normal;
}
.prototype-dialog .dialog-head {
  align-items: flex-start;
  margin: 0;
  gap: 12px;
}
.prototype-dialog .close {
  width: 30px;
  min-width: 30px;
  height: 30px;
  min-height: 30px;
  flex: 0 0 30px;
  padding: 0;
  border-radius: 50%;
  font-size: 18px;
  line-height: normal;
  display: grid;
  place-items: center;
}
.prototype-dialog .linkbtn {
  font-size: 12px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.prototype-dialog .pub-level {
  flex: 1;
  min-height: 0;
  gap: 12px;
}
.prototype-dialog .works {
  min-height: 0;
}
.prototype-dialog .work-fig img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.prototype-dialog .btn {
  height: 34px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
}
.prototype-dialog .btn.red {
  border: 0;
  background: var(--accent);
  color: var(--accent-ink);
}
.prototype-dialog .btn.ghost {
  border: 1px solid var(--ink);
}
.prototype-dialog .secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.prototype-dialog .pub-foot {
  flex-shrink: 0;
}
.prototype-dialog .ltag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.prototype-dialog .bindbtn:disabled {
  opacity: 1;
}
.prototype-dialog .sheet-head {
  flex-shrink: 0;
}
.app.dark .prototype-dialog {
  box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.5);
}
.app.dark .prototype-dialog .prow {
  background: rgba(255, 255, 255, 0.04);
}
@media (min-width: 900px) {
  dialog.prototype-dialog {
    padding: 22px 26px 26px;
    border-radius: 20px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
  }
  dialog.prototype-dialog.centered-dialog {
    transform: translateY(-50%);
  }
  dialog.prototype-dialog#language-dialog {
    padding: 14px 16px 12px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  }
  dialog.prototype-dialog.publish-drawer {
    padding: 20px 22px 22px;
    border-radius: 0;
    box-shadow: -20px 0 60px rgba(0, 0, 0, 0.2);
  }
  .prototype-dialog .works {
    max-height: none;
    flex: 1;
  }
  .prototype-dialog .plist {
    max-height: 50vh;
  }
  .prototype-dialog .grab {
    display: none;
  }
}
/* Complete prototype parity: original component rules above remain the visual baseline. */
.site-foot {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  flex-shrink: 0;
}
.site-foot b {
  font-family: var(--mono);
}
.site-foot .copyright {
  margin-left: auto;
}
.stage-note {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  flex-shrink: 0;
}
.view.home {
  display: contents;
}
.view.home .main,
.view.home .left,
.view.home .right {
  display: contents;
}
.view.home .hero {
  order: 1;
  padding: 4px 20px 10px;
}
.view.home .search {
  order: 2;
}
.view.home .chips {
  order: 2;
}
.view.home .stage {
  order: 3;
  --cy: 52%;
  --ty: -50%;
  min-height: 0;
}
.view.home .cta {
  order: 5;
  padding: 6px 20px 16px;
}
.view.home .strip {
  order: 7;
}
.view.home .card {
  width: min(var(--cw), calc(var(--stage-h, 460px) * 0.62));
}
.view.home .sub {
  font-size: 15px;
  line-height: 1.45;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.42);
  min-height: 44px;
  max-height: 65px;
  overflow: hidden;
}
.view.home .sub .on {
  color: #fff;
}
.view.home .meta a {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
}
.view.home .preview-label {
  padding: 0;
  background: none;
  border-radius: 0;
  font-size: 11px;
}
.view.home .card-top {
  font-size: 11px;
}
.view.home .meta .fl {
  width: 36px;
  height: 24px;
  flex: 0 0 auto;
}
.view.home .hint {
  top: 2px;
}
.no-match {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 30px;
  text-align: center;
  font-size: 14px;
  color: var(--ink-2);
}
.prototype-dialog .search.insheet {
  display: flex;
  order: initial;
  margin: 0;
  height: 42px;
  min-height: 42px;
  padding: 0 6px 0 14px;
}
.prototype-dialog .search.insheet input {
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  height: auto;
  font-size: 14px;
  background: none;
}
@media (max-width: 899px) {
  .search input,
  .prototype-dialog .search.insheet input {
    font-size: 16px;
  }
}
.prototype-dialog .search .qclose {
  font-size: 18px;
  width: 30px;
  height: 30px;
}
.prototype-dialog .cat-grid {
  max-height: 60vh;
}
.cat-grid a[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--ground);
}
.prototype-dialog .form {
  gap: 14px;
}
.prototype-dialog .form label.field {
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
}
.prototype-dialog .field .lab {
  font-size: 13px;
  font-weight: 600;
}
.prototype-dialog .field .lab i {
  font-style: normal;
  font-size: 12px;
  font-weight: 400;
  color: var(--ink-3);
  margin-left: 4px;
}
.prototype-dialog .field .lab em {
  font-style: normal;
  font-size: 11px;
  color: var(--accent);
  margin-left: 4px;
}
.prototype-dialog .form .input {
  width: 100%;
  height: 46px;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--ground);
  padding: 0 14px;
  font: inherit;
  font-size: 16px;
  font-weight: 400;
  color: var(--ink);
}
.prototype-dialog .form textarea.input {
  height: auto;
  min-height: 84px;
  padding: 10px 14px;
  resize: none;
  line-height: 1.5;
}
.prototype-dialog .input:focus {
  border-color: var(--ink);
  outline: none;
  box-shadow: 0 0 0 1px var(--ink);
}
.prototype-dialog .form button.primary {
  min-height: 54px;
  height: 54px;
}
.prototype-dialog .fine {
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-3);
  margin: 0;
  text-align: center;
}
.prototype-dialog .sheet-body {
  display: flex;
  gap: 14px;
}
.prototype-dialog .qr {
  display: none;
}
.prototype-dialog .upload {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 92px;
  border: 1.5px dashed var(--line);
  border-radius: 14px;
  padding: 16px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
}
.prototype-dialog .upload small {
  font-size: 12px;
  font-weight: 400;
  color: var(--ink-3);
  margin-top: 4px;
}
.voice-choice {
  display: flex;
  gap: 8px;
}
.prototype-dialog .voice-choice .radio {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 13px;
}
.prototype-dialog .voice-choice input {
  width: 16px;
  height: 16px;
  margin: 0;
  flex: none;
  accent-color: var(--ink);
}
.prototype-dialog .voice-choice .radio.on {
  border-color: var(--ink);
}
.phone-handoff {
  display: grid;
  place-items: center;
  width: 148px;
  height: 148px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  background: var(--ground-2);
}
.phone-handoff svg {
  width: 54px;
  height: 54px;
  stroke: var(--ink-3);
}
.spk-choices {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}
.prototype-dialog .row {
  font-size: 14px;
}
.prototype-dialog .speaker-grid img {
  height: 125px;
}
.prototype-dialog .lang-grid {
  max-height: 58vh;
}
.prototype-dialog .lang-item:disabled {
  opacity: 0.4;
}
.prototype-dialog .lang-item .ln small {
  font-size: 11px;
}
.prototype-dialog .lang-item .chk {
  width: 16px;
  height: 16px;
}
.prototype-dialog .pcard .tag {
  padding: 0;
  background: none;
  font-size: 11px;
}
.prototype-dialog .pcard .price span {
  font-size: 22px;
}
.prototype-dialog .pcard ul {
  font-weight: 400;
}
.info-content p {
  font-size: 14px;
  line-height: 1.7;
  margin: 0 0 10px;
}
#make-dialog .sheet-head {
  align-items: flex-start;
}
#make-dialog .speaker {
  display: inline-flex;
  width: auto;
  min-height: 30px;
  height: 30px;
  margin-top: 6px;
  padding: 0 12px;
  border-radius: 999px;
  background: none;
  gap: 0;
  font-size: 13px;
  font-weight: 600;
}
#make-dialog .form #topic-step,
#make-dialog .form #script-step,
#make-dialog #make-options {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
#make-dialog #script-step .input {
  min-height: 170px;
}
#make-dialog .history-link {
  float: right;
  font-weight: 500;
  font-size: 12px;
}
#make-dialog .mode-link {
  align-self: flex-start;
  font-size: 12px;
}
#make-dialog #content-goal {
  font-size: 12px;
  color: var(--ink-2);
}
#make-dialog #content-goal .form {
  margin-top: 10px;
}
#make-dialog .make-save-row {
  font-size: 11px;
  margin-top: -6px;
}
#make-dialog .make-save-row span {
  font-size: 11px;
  color: var(--ink-3);
}
#make-dialog .notice {
  font-size: 13px;
}
#make-dialog .script-tools .chips {
  padding: 0;
  gap: 6px;
}
#make-dialog .script-tools .chips button {
  font-size: 13px;
  padding: 0 10px;
}
.prototype-dialog .version-list article {
  padding: 12px;
}
.prototype-dialog .version-list pre {
  font-size: 14px;
  white-space: pre-wrap;
  line-height: 1.5;
}
.prototype-dialog .panel p {
  font-size: 14px;
  line-height: 1.6;
}
.prototype-dialog #ai-candidate p {
  white-space: pre-wrap;
  margin: 0;
}
.view.page {
  width: 100%;
  min-height: 0;
}
.view.page .page-body {
  gap: 14px;
}
.view.page .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
}
.view.page .btn.red {
  border: 0;
  background: var(--accent);
  color: #fff;
}
.view.page .btn.ghost {
  border: 1px solid var(--ink);
  color: var(--ink);
}
.view.page .btn.soft {
  background: var(--ground-2);
  color: var(--ink-2);
  border: 0;
}
.view.page .work-fig img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.view.page .av-fig img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.view.page .segs {
  margin-top: -6px;
}
.view.page .work-title {
  font-size: 14px;
}
.view.page .work {
  margin: 0;
}
.view.page .grp {
  flex-shrink: 0;
}
.view.page .panel {
  flex-shrink: 0;
}
.view.page .tabpane {
  gap: 10px;
  margin-top: 10px;
}
.view.page #pane-knowledge .btn {
  align-self: flex-start;
}
.view.page .kb-row .v {
  display: block;
  white-space: normal;
  text-align: left;
}
.view.page .me-left,
.view.page .me-right {
  display: contents;
}
.view.page .settings-list {
  max-height: none;
  flex-shrink: 0;
}
.view.page .ltag {
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  font: inherit;
  font-size: 11px;
  max-width: 140px;
  border: 0;
  color: var(--ink-2);
}
.view.page .pstate {
  font-size: 11px;
}
.view.page .ptable td {
  font-size: 12px;
}
.view.page .fine {
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-3);
  margin: 0;
}
.view.page .grp-t {
  margin: 0;
}
.view.page .row .chev {
  display: block;
}
.view.page .row.danger {
  font-weight: 600;
}
.view.page .avatar-card {
  background: var(--ground);
}
.app.dark .view.page .avatar-card {
  background: rgba(255, 255, 255, 0.04);
}
.app[data-page="result"] > .top,
.app[data-page="result"] > .tabs,
.app[data-page="result"] > .site-foot,
.app[data-page="result"] > .stage-note {
  visibility: hidden;
}
.result-media {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}
.result-frame {
  position: relative;
  width: min(100%, calc(100vh * 9 / 16));
  width: min(100%, calc(100dvh * 9 / 16));
  aspect-ratio: 9 / 16;
  max-height: 100%;
  flex: 0 0 auto;
}
.result-controls {
  position: absolute;
  inset: auto 0 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 32px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.65));
}
.result-media video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.result .result-title {
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.result .result-top {
  align-items: center;
  gap: 12px;
}
.result-top .back:last-child {
  margin-left: auto;
  flex-shrink: 0;
}
.result .result-ui {
  position: static;
  background: none;
  padding-top: 0;
  gap: 12px;
}
.result .result-langs {
  gap: 6px;
  flex-wrap: wrap;
}
.result .result-langs .langchip {
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  padding: 0 12px;
  height: 32px;
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}
.result .result-langs .langchip.on {
  background: #fff;
  color: #15181d;
  border-color: #fff;
}
.result .result-langs .langchip:disabled {
  opacity: 0.45;
}
.result .result-btns {
  display: flex;
  gap: 10px;
}
.result .result-btns > * {
  flex: 1;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}
.result .rs-actions .secondary {
  display: flex;
  align-items: center;
  justify-content: center;
}
.result .rs-title {
  font-size: 22px;
}
.result .rs-script {
  margin: 0;
  white-space: pre-wrap;
}
.result #result-details {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.result-extra {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.result-extra .btn {
  min-height: 30px;
  height: 30px;
  padding: 0 9px;
  border-radius: 9px;
  font-size: 12px;
}
.result .fine {
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.5;
}
.result .rs-lang {
  flex-shrink: 0;
}
.result .rs-lang .fl {
  width: 24px;
  height: 16px;
}
.result .rs-actions .linkbtn {
  font-size: 12px;
}
.result .player {
  display: flex;
  position: relative;
  inset: auto;
  align-items: center;
  width: calc(100% - 32px);
  margin: 0 16px;
  flex: 0 0 auto;
  z-index: 5;
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  gap: 8px;
  color: #fff;
}
.result .pbtn {
  height: 34px;
  width: 34px;
  flex: 0 0 34px;
}
.result .pbtn svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: #fff;
}
.video-seek {
  width: 100%;
  min-width: 0;
  height: 4px;
  accent-color: #fff;
  flex: 1;
  padding: 0;
  border: 0;
  border-radius: 2px;
  cursor: pointer;
}
.result .ptime {
  font-size: 11px;
  white-space: nowrap;
}
.result .result-side {
  min-width: 0;
}
.result #result-details .grp-t {
  padding: 0;
}
.result #result-details .rs-langs {
  gap: 6px;
}
.result .result-top svg {
  width: 18px;
  height: 18px;
}
#mobile-result-details {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
#mobile-result-details #result-details {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
#mobile-result-details .rs-script {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--ground-2);
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
}
#mobile-result-details .rs-langs {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
#mobile-result-details .rs-lang {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
#mobile-result-details .rs-lang .st {
  margin-left: auto;
  font-size: 12px;
  color: var(--ink-3);
}
#mobile-result-details .fine {
  font-size: 12px;
}
.wait-overlay {
  position: absolute;
  inset: 0;
  z-index: 25;
  display: flex;
  flex-direction: column;
  background: #0e1013;
  color: #fff;
}
.wait-overlay .wait-body {
  position: relative;
  flex: 1;
  gap: 16px;
}
.wait-overlay .ring .prog {
  stroke: #fff;
  stroke-dasharray: 365;
  stroke-dashoffset: 365;
  transition: stroke-dashoffset 0.3s;
}
.wait-overlay .ring .pct {
  font-size: 22px;
}
.wait-overlay h3 {
  font-size: 20px;
  margin: 0;
}
.wait-overlay .steps {
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  font-size: 14px;
  text-align: left;
}
.wait-overlay .steps li {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.45);
}
.wait-overlay .steps li::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid currentColor;
}
.wait-overlay .steps li.done {
  color: #fff;
}
.wait-overlay .steps li.done::before {
  background: #fff;
}
.wait-overlay .steps li.doing {
  color: #fff;
}
.wait-overlay .steps li.doing::before {
  background: var(--accent);
  border-color: var(--accent);
}
.wait-overlay .fine {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.6;
  max-width: 320px;
  margin: 0;
}
.wait-overlay .secondary {
  max-width: 300px;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
}
.wait-overlay .btn {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
}
.wait-overlay .btn.red {
  background: var(--accent);
  border: 0;
}
.genpill {
  z-index: 24;
}
.genpill.done i {
  background: var(--ok);
}
@media (min-width: 900px) {
  /* The canvas spans the window; header controls follow the content edges. */
  .top {
    padding-inline: max(32px, calc((100% - 1280px) / 2 + 32px));
  }
  .view.home {
    display: flex;
    flex: 1;
    min-height: 0;
    flex-direction: column;
  }
  .view.home .main {
    display: grid;
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    grid-template-columns: minmax(340px, 460px) minmax(0, 1fr);
    gap: 48px;
    padding: 16px 32px 8px;
    flex: 1;
    min-height: 0;
  }
  .view.home .left {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 22px;
    min-width: 0;
    padding-right: 0;
  }
  .view.home .right {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }
  .view.home .hero {
    padding: 0;
  }
  .view.home .hero p {
    margin-top: 10px;
  }
  .view.home .search {
    margin: 0;
    max-width: 440px;
  }
  .view.home .chips {
    padding: 0;
  }
  .view.home .cta {
    padding: 0;
    max-width: 440px;
  }
  .view.home .stage {
    --cw: 380px;
    --cy: 50%;
    --ty: -50%;
    min-height: 320px;
  }
  .view.home .strip {
    display: flex;
    padding: 10px 4px 4px;
    flex: 0 0 auto;
  }
  .view.home .hint {
    display: none;
  }
  .view.page {
    max-width: 760px;
    margin: 0 auto;
    padding-top: 12px;
  }
  .view.page .page-head {
    padding: 0 32px 8px;
  }
  .view.page .page-body {
    padding: 8px 32px 24px;
  }
  .view.page#viewMe .page-body {
    display: flex;
    flex-direction: column;
    gap: 28px;
  }
  .view.page .me-left,
  .view.page .me-right {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
  }
  .view.page .me-left {
    position: sticky;
    top: 0;
  }
  .view.page #me-tabs {
    margin-top: -6px;
  }
  .view.page .tabpane {
    margin-top: 0;
  }
  .prototype-dialog.clone-dialog .sheet-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 28px;
    align-items: start;
  }
  .prototype-dialog.clone-dialog .qr {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    text-align: center;
    font-size: 13px;
    line-height: 1.6;
  }
  .prototype-dialog .qr p {
    margin: 0;
    color: var(--ink-3);
    font-size: 12px;
  }
  .prototype-dialog .qr b {
    font-size: 14px;
  }
  .result .result-stage {
    position: relative;
    inset: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 0;
    padding: 24px;
    background: #0e1013;
  }
  .result .result-media {
    width: 100%;
    height: auto;
    aspect-ratio: 9/16;
    flex: 0 1 auto;
    min-height: 0;
    overflow: hidden;
    border-radius: 22px;
  }
  .result .result-frame {
    width: min(100%, calc(68vh * 9 / 16), calc((100vh - 112px) * 9 / 16));
    width: min(100%, calc(68dvh * 9 / 16), calc((100dvh - 112px) * 9 / 16));
    aspect-ratio: auto;
    max-height: none;
    display: flex;
    flex-direction: column;
    gap: 14px;
  }
  .result .result-controls {
    position: static;
    background: none;
    padding: 0;
  }
  .result .result-media video {
    border-radius: 22px;
  }
  .result .player {
    position: relative;
    inset: auto;
    width: 100%;
    margin: 0;
    background: none;
    backdrop-filter: none;
    padding: 0;
    flex: 0 0 auto;
  }
  .result .result-ui,
  .result .result-top {
    display: none;
  }
  .result .result-side {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 28px;
    overflow-y: auto;
    min-height: 0;
  }
  .result .rs-actions {
    margin-top: auto;
  }
  .wait-overlay {
    inset: auto;
    top: 76px;
    right: 24px;
    width: 300px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    background: var(--ink);
    color: var(--ground);
  }
  .wait-overlay .wait-bg {
    display: none;
  }
  .wait-overlay .wait-body {
    padding: 18px;
    gap: 10px;
  }
  .wait-overlay .ring {
    width: 72px;
    height: 72px;
  }
  .wait-overlay .ring .pct {
    font-size: 15px;
  }
  .wait-overlay h3 {
    font-size: 15px;
  }
  .wait-overlay .steps {
    font-size: 13px;
    gap: 6px;
  }
  .wait-overlay .secondary {
    height: 36px;
    font-size: 12px;
  }
  .genpill {
    top: 76px;
  }
}
@media (max-width: 899px) {
  .view.home .chips {
    scrollbar-width: none;
  }
  .result .result-stage {
    position: absolute;
    inset: 0;
  }
  .result .result-side {
    display: none;
  }
  .result .result-ui {
    padding-bottom: calc(22px + env(safe-area-inset-bottom));
  }
  .result .result-del {
    color: rgba(255, 255, 255, 0.7);
  }
  .site-foot,
  .stage-note {
    display: none;
  }
  .prototype-dialog .result-extra .btn {
    font-size: 12px;
  }
}
.site-foot {
  order: 8;
}
.stage-note {
  order: 9;
}

/* Keep the baked subtitles unobstructed during mobile playback. */
@media (max-width: 899px) {
  .result .result-controls {
    transition: opacity 0.18s ease;
  }
  .result.watching .result-controls {
    opacity: 0;
    pointer-events: none;
  }
}

.view.page .linkbtn {
  font-size: 12px;
}

.auth-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.auth-input-row > .input {
  flex: 1;
  min-width: 0;
}
.auth-input-row > button {
  flex-shrink: 0;
  white-space: nowrap;
}
.auth-links {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.prototype-dialog .auth-password-hint {
  text-align: left;
  margin-top: -8px;
}

#clone-form .upload {
  height: auto;
  min-height: 116px;
  padding: 14px;
}
#clone-photo-preview {
  width: 72px;
  height: 110px;
  object-fit: contain;
  border-radius: 10px;
}
.record-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
}
.record-script {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-2);
  user-select: text;
}
.record-box audio {
  width: 100%;
  height: 36px;
}
.upload-consent {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-2);
}
.upload-consent input {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  accent-color: var(--accent);
}
.prototype-dialog .form .upload-consent {
  flex-direction: row;
  align-items: flex-start;
}

/* Me follows one vertical information order on every screen. */
html[data-page="me"] {
  scrollbar-gutter: stable;
}
html[data-page="me"].modal-open {
  overflow: hidden;
}
.app[data-page="me"] {
  height: auto;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: visible;
}
.view.page#viewMe {
  max-width: 1280px;
  flex: 1 0 auto;
  min-height: auto;
}
#viewMe > .page-body {
  flex: none;
  min-height: auto;
  overflow: visible;
}
.app[data-page="me"] > :is(.scrim, .toast, .genpill, .wait-overlay) {
  position: fixed;
}
#viewMe .me-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 0 0 auto;
  min-width: 0;
}
#viewMe .av-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
#viewMe .av-identity {
  display: flex;
  flex: 1;
  min-width: 0;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 12px;
}
#viewMe .av-identity > b {
  min-width: 0;
  overflow-wrap: anywhere;
}
#viewMe .av-account {
  font-size: 12px;
  color: var(--ink-2);
  text-align: left;
  overflow-wrap: anywhere;
}
#viewMe .av-account:hover {
  color: var(--ink);
  text-decoration: underline;
}
#viewMe .me-logout {
  flex: 0 0 auto;
  height: 32px;
  min-height: 32px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 500;
}
#viewMe #me-tabs {
  margin-top: 0;
}

.photo-edit-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.photo-edit-actions .fine {
  margin: 0;
  flex: 1;
  min-width: 150px;
}
.photo-edit-preview {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.photo-compare {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.photo-compare figure {
  margin: 0;
  min-width: 0;
}
.photo-compare img {
  display: block;
  width: 100%;
  height: 200px;
  object-fit: contain;
  background: var(--ground-2);
  border-radius: 10px;
}
.photo-compare figcaption {
  text-align: center;
  margin-top: 6px;
  font-size: 12px;
  color: var(--ink-2);
}
.photo-edit-choices {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.photo-edit-choices .btn {
  flex: 1;
}
@media (max-width: 480px) {
  .photo-compare img {
    height: 176px;
  }
}
/* Single-template creation uses the same full-page canvas and shared header. */
html[data-page^="pipeline"] {
  overflow-y: auto;
}
html[data-page^="pipeline"].modal-open {
  overflow: hidden;
}
html[data-page^="pipeline"] .app {
  height: auto;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: visible;
}
html[data-page^="pipeline"] .pipeline-view {
  flex: none;
  height: auto;
  overflow: visible;
}
.pipeline-view {
  display: block;
  padding: 24px 20px 90px;
}
.pipeline-content {
  width: min(100%, 1000px);
  margin-inline: auto;
}
.pipeline-content .page-head {
  padding-inline: 0;
}
@media (min-width: 900px) {
  .app[data-page^="pipeline"] > .top {
    width: min(100%, 1040px);
    margin-inline: auto;
    padding-inline: 20px;
  }
}
.pipeline-card {
  border: 1px solid var(--line, #dedfe2);
  border-radius: 16px;
  padding: 22px;
  margin: 20px 0;
}
.pipeline-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.pipeline-inputs input[type="file"] {
  width: 100%;
  margin: 12px 0;
}
.pipeline-inputs img {
  max-width: 100%;
  max-height: 260px;
  object-fit: contain;
  border-radius: 10px;
}
.pipeline-inputs audio {
  width: 100%;
  margin-top: 14px;
}
.pipeline-consent {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 16px 0;
}
.pipeline-card .primary {
  width: 100%;
}
.pipeline-card video {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 680px;
  object-fit: contain;
  background: #111;
  border-radius: 10px;
  margin: 16px auto;
}
.pipeline-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin: 12px 0;
}
@media (max-width: 700px) {
  .pipeline-view {
    padding: 18px 14px 90px;
  }
  .pipeline-inputs {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .pipeline-card {
    padding: 16px;
  }
}

.pipeline-photo-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 18px 0;
}
.pipeline-photo-compare figure {
  margin: 0;
  text-align: center;
  min-width: 0;
}
.pipeline-photo-compare img {
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  border-radius: 10px;
}
.pipeline-photo-compare figcaption {
  margin-top: 8px;
}

.pipeline-generation-feedback {
  scroll-margin-block: 100px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin: 12px 0;
  color: var(--ink);
}
.pipeline-generation-feedback[data-state="error"] {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}
#pipeline-usage-hint[data-insufficient="true"] {
  color: var(--accent);
}
.pipeline-view [hidden] {
  display: none !important;
}
.pipeline-steps {
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
  scroll-margin-top: 75px;
}
.pipeline-steps button {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 8px;
  background: var(--panel, transparent);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}
.pipeline-steps button span {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid currentColor;
  border-radius: 50%;
  margin-right: 6px;
}
.pipeline-steps button[aria-current="step"] {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}
.pipeline-steps button:disabled {
  opacity: 0.5;
  cursor: default;
}
.pipeline-step {
  min-width: 0;
}
.pipeline-step h3 {
  margin: 0 0 18px;
}
.pipeline-step .field {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}
.pipeline-step .field img {
  max-width: 100%;
  max-height: 300px;
  object-fit: contain;
  border-radius: 12px;
}
.pipeline-file-picker {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.pipeline-file-picker input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.pipeline-file-picker:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.pipeline-file-picker[aria-disabled="true"] {
  opacity: 0.5;
  cursor: default;
}
.pipeline-file-picker input:disabled {
  cursor: default;
}
.pipeline-file-name {
  overflow-wrap: anywhere;
}
.pipeline-step audio,
#pipeline-generated-voice {
  width: 100%;
  margin: 12px 0;
}
.pipeline-step textarea {
  box-sizing: border-box;
  width: 100%;
  resize: vertical;
  min-height: 220px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  line-height: 1.8;
}
.pipeline-script-preview {
  white-space: pre-wrap;
  line-height: 1.9;
}
.pipeline-script-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0;
}
.pipeline-script-options [aria-pressed="true"] {
  border-color: var(--accent);
  color: var(--accent);
}
.pipeline-step-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
}
.pipeline-step-actions #pipeline-next {
  margin-left: auto;
}
#pipeline-segment-progress {
  width: 100%;
  accent-color: var(--accent);
  margin: 10px 0;
}
.pipeline-script-library {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  margin: 16px 0;
}
.pipeline-script-filters {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}
.pipeline-script-filters input {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px;
  background: transparent;
  color: var(--ink);
  font: inherit;
}
.pipeline-script-card {
  border-top: 1px solid var(--line);
  padding: 16px 0;
}
.pipeline-script-card h4 {
  margin: 0 0 8px;
}
.pipeline-script-card p {
  overflow-wrap: anywhere;
}
.pipeline-script-card details {
  margin: 12px 0;
}
.pipeline-script-card summary {
  cursor: pointer;
}
@media (max-width: 600px) {
  .pipeline-script-filters {
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  }
  .pipeline-script-filters > button {
    grid-column: 1 / -1;
  }
  .pipeline-script-library {
    padding: 12px;
  }
}
@media (max-width: 600px) {
  .pipeline-steps {
    gap: 6px;
  }
  .pipeline-steps button {
    font-size: 13px;
    padding: 10px 4px;
  }
  .pipeline-steps button span {
    display: flex;
    margin: 0 auto 5px;
  }
}

/* Rename the digital human in place on the 我 page. */
.av-rename {
  margin-left: 8px;
  font-size: 12px;
  vertical-align: middle;
}
.av-rename-input {
  height: 32px;
  max-width: 220px;
  font-size: 15px;
}

/* Link from the category layer to the full template catalogue. */
.cat-all {
  display: flex;
  justify-content: center;
  margin-top: 14px;
}
