/* Text-agent studio (忆访、忆传、忆镜). Uses the shell's design tokens from /styles.css. */
.studio-body { background: var(--paper); }
.studio { max-width: 980px; margin: 0 auto; padding: 22px 24px 60px; color: var(--ink); zoom: var(--ui-font-scale); }
/* 抵消 /styles.css 的 main { min-height: calc(100vh - 88px) }：手机上 iframe 跟内容变高后，
   vh 按 iframe 算，内容最小高度会跟着 iframe 一起涨、删内容后缩不回去。 */
main.studio { min-height: 0; }
.studio-header { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; margin-bottom: 18px; }
.studio-kicker { margin: 0; font-size: 12px; letter-spacing: .08em; color: var(--gold); font-weight: 700; }
.studio-header h1 { margin: 4px 0 6px; font-size: 24px; }
.studio-lead { margin: 0; color: var(--muted); line-height: 1.6; max-width: 640px; }
.studio-wallet { margin: 4px 0 0; padding: 6px 12px; border-radius: 999px; background: var(--gold-soft); color: var(--ink); font-size: 13px; white-space: nowrap; }
.studio-alert { padding: 10px 14px; border-radius: 10px; background: #fbeaea; color: var(--danger); border: 1px solid #efcaca; }
.studio-alert.info { background: var(--green-soft); color: var(--green); border-color: #c9e6da; }
.studio-failed { white-space: pre-line; }
.studio-section { margin: 0 0 22px; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.studio-section h2 { margin: 0 0 12px; font-size: 17px; }
.studio-section h3 { margin: 14px 0 8px; font-size: 15px; }
.studio-muted { color: var(--muted); font-size: 13px; line-height: 1.6; }
.studio-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.studio-row label { display: inline-flex; gap: 6px; align-items: center; font-size: 14px; }
.studio-steps { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; counter-reset: step; }
.studio-steps li { display: flex; gap: 10px; align-items: baseline; font-size: 14px; }
.studio-steps li::before { counter-increment: step; content: counter(step); flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--slate-soft); text-align: center; line-height: 22px; font-size: 12px; }
.studio-steps li.done::before { content: "✓"; background: var(--green-soft); color: var(--green); }
.studio-steps li.current { font-weight: 700; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; font-size: 14px; }
.button:disabled { opacity: .5; cursor: not-allowed; }
.button-primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.button-danger { background: var(--gold); border-color: var(--gold); color: #fff; }
.button-secondary { background: var(--slate-soft); }
.button-ghost { background: transparent; }
select, input[type="number"] { min-height: 34px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); }

/* chat */
/* --host-vh：外层壳写入的“一屏高/100”，避免 iframe 被撑高后 vh 跟着变大 */
.chat { display: grid; gap: 10px; max-height: calc(var(--host-vh, 1vh) * 52); overflow-y: auto; padding: 4px 2px 10px; }
.bubble { max-width: 82%; padding: 10px 14px; border-radius: 14px; line-height: 1.7; white-space: pre-wrap; font-size: 15px; }
.bubble.assistant { background: var(--slate-soft); justify-self: start; border-top-left-radius: 4px; }
.bubble.user { background: var(--gold-soft); justify-self: end; border-top-right-radius: 4px; }
.bubble .bubble-meta { display: block; margin-top: 4px; font-size: 11px; color: var(--muted); }
.composer { display: grid; gap: 8px; margin-top: 10px; }
.composer textarea { width: 100%; box-sizing: border-box; min-height: 84px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font-size: 15px; line-height: 1.6; resize: vertical; }
.mic.listening { background: #fbeaea; border-color: #e7b5b5; color: var(--danger); }
.budget-bar { height: 6px; border-radius: 3px; background: var(--slate-soft); overflow: hidden; }
.budget-bar > span { display: block; height: 100%; background: var(--green); }

/* documents */
.doc-preview { max-height: 360px; overflow-y: auto; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.doc-preview pre, .checkpoint-text { margin: 0; white-space: pre-wrap; font-family: inherit; font-size: 14px; line-height: 1.8; }
.outline-list { margin: 6px 0 0; padding-left: 20px; }
.outline-list li { margin: 6px 0; line-height: 1.6; }
.outline-list .tag { margin-left: 8px; }
.outline-section h4 { margin: 12px 0 4px; font-size: 14px; color: var(--gold); }
.outline-section + .outline-section { margin-top: 6px; }
.studio-quote { margin: 8px 0; padding: 8px 12px; border-left: 3px solid var(--gold); background: var(--gold-soft); font-size: 14px; line-height: 1.7; }
.chapter-table, .shot-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.chapter-table th, .chapter-table td, .shot-table th, .shot-table td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; background: var(--slate-soft); }
.tag.ok { background: var(--green-soft); color: var(--green); }
.tag.wait { background: var(--gold-soft); }

/* shared checkpoint card (same class names as 忆影) */
.checkpoint-list { display: grid; gap: 12px; }
.checkpoint-card { padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.checkpoint-card h3 { margin: 2px 0 10px; font-size: 15px; }
.checkpoint-card.checkpoint-done { opacity: .55; }
.checkpoint-card .section-kicker { margin: 0; font-size: 12px; color: var(--gold); font-weight: 700; }
.checkpoint-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.checkpoint-table th, .checkpoint-table td { padding: 6px; border-bottom: 1px solid var(--line); text-align: left; }
.checkpoint-total { margin: 10px 0 4px; }
.checkpoint-muted { color: var(--muted); font-size: 13px; line-height: 1.6; }
.checkpoint-warning, .checkpoint-message { color: var(--danger); font-size: 13px; }
.checkpoint-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 10px; }
.checkpoint-document { max-height: 420px; overflow-y: auto; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.checkpoint-panel { margin-top: 10px; display: grid; gap: 8px; }
.checkpoint-input, .checkpoint-editor { width: 100%; box-sizing: border-box; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font-size: 14px; line-height: 1.6; }
.checkpoint-editor { font-family: inherit; min-height: 280px; }
.checkpoint-questions { padding-left: 20px; display: grid; gap: 12px; }
.checkpoint-question { margin: 0 0 6px; font-weight: 600; line-height: 1.6; }
.confirmation-check { display: flex; gap: 8px; align-items: flex-start; margin-top: 10px; font-size: 13px; line-height: 1.6; }

/* media agents (忆绘、忆声、忆剪) */
.checkpoint-preview { display: block; max-width: 100%; max-height: 360px; margin: 0 0 8px; border-radius: 8px; background: #000; object-fit: contain; }
.checkpoint-audio { display: block; width: 100%; margin: 4px 0 8px; }
.checkpoint-reserve td { color: var(--muted); }
.checkpoint-choices { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 8px; }
.checkpoint-choice { display: inline-flex; gap: 6px; align-items: center; font-size: 14px; }
.checkpoint-candidates { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.checkpoint-candidate { display: grid; gap: 6px; padding: 6px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-size: 13px; }
.checkpoint-candidate:has(input:checked) { border-color: var(--navy); box-shadow: 0 0 0 2px var(--navy) inset; }
.checkpoint-candidate img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: var(--paper); border-radius: 6px; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.media-tile { display: grid; gap: 6px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); font-size: 13px; }
.media-tile img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; background: var(--slate-soft); }
.media-tile .tile-empty { display: grid; place-items: center; aspect-ratio: 4 / 3; border-radius: 6px; background: var(--slate-soft); color: var(--muted); }
.media-tile label { display: flex; gap: 6px; align-items: center; }
.matrix { width: 100%; border-collapse: collapse; font-size: 13px; }
.matrix th, .matrix td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.matrix img { width: 72px; height: 54px; object-fit: cover; border-radius: 6px; }
.matrix audio { width: 220px; }

@media (max-width: 640px) {
  .studio { padding: 16px 14px 48px; }
  .studio-header { flex-direction: column; }
  .studio-wallet { white-space: normal; border-radius: 14px; }
  .bubble { max-width: 92%; }
}

/* 忆访 video interview: usable on a phone held by an older person — large type, large buttons */
.big-button { min-height: 52px; padding: 0 22px; font-size: 18px; border-radius: 14px; }
.vi-who { display: grid; gap: 8px; margin-bottom: 12px; }
.vi-who label { display: flex; gap: 8px; align-items: center; font-size: 17px; }
.vi-who select, .vi-input { min-height: 46px; font-size: 17px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); }
.vi-new-person { display: grid; gap: 8px; }
.vi-new-person[hidden] { display: none; }
.vi-live { display: grid; gap: 12px; }
.vi-preview { width: 100%; max-height: calc(var(--host-vh, 1vh) * 62); object-fit: cover; border-radius: 14px; background: #111; }
.vi-preview.landscape { aspect-ratio: 16 / 9; }
.vi-preview.portrait { aspect-ratio: 9 / 16; width: auto; height: calc(var(--host-vh, 1vh) * 62); max-width: 100%; justify-self: center; }
.vi-preview.mirrored { transform: scaleX(-1); }
.vi-options { display: grid; gap: 10px; margin: 6px 0 4px; }
.vi-choice { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.vi-choice-label { min-width: 4em; font-size: 17px; font-weight: 600; }
.vi-option { min-height: 48px; padding: 0 18px; font-size: 17px; border-radius: 12px; }
.vi-option.selected { background: var(--navy); border-color: var(--navy); color: #fff; }
.vi-rotate { margin: 0; padding: 10px 14px; border-radius: 12px; background: var(--gold-soft); font-size: 17px; font-weight: 600; }
.vi-rotate[hidden] { display: none; }
.vi-question { margin: 0; padding: 14px 16px; border-radius: 14px; background: var(--slate-soft); font-size: 24px; line-height: 1.6; font-weight: 600; }
.vi-caption { margin: 0; min-height: 1.6em; font-size: 18px; line-height: 1.6; color: var(--ink); }
.vi-status { margin: 0; font-size: 15px; color: var(--danger); font-weight: 600; }
.vi-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.vi-upload { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
.vi-recording { padding: 10px 0; border-bottom: 1px solid var(--line); }
.vi-recording .tag { margin-left: 8px; }
.vi-transcript p { margin: 4px 0; font-size: 14px; line-height: 1.7; }

@media (max-width: 640px) {
  .vi-actions .button { flex: 1 1 100%; }
  .vi-question { font-size: 22px; }
  .vi-option { flex: 1 1 40%; }
}

/* WP-L: picture / sound source of each shot */
.source-tag.real { background: var(--green-soft); color: var(--green); }
.source-tag.ai { background: var(--gold-soft); }
.vi-actions[hidden] { display: none; }

/* Phones (个人版 uses the phone browser): large type, large buttons, one column, no
   sideways scrolling. Inputs stay at 16px+ so iOS Safari does not zoom in on focus. */
@media (max-width: 640px) {
  .studio-header h1 { font-size: 22px; }
  .studio-lead { font-size: 15px; }
  .studio-muted, .checkpoint-muted { font-size: 15px; }
  .studio-section { padding: 14px; border-radius: 12px; }
  .studio-section h2 { font-size: 19px; }
  .studio-section h3 { font-size: 17px; }
  .studio-steps li { font-size: 16px; }
  .button { min-height: 48px; padding: 0 16px; font-size: 16px; border-radius: 12px; }
  .studio-row > .button, .studio-row > a.button { flex: 1 1 100%; }
  .studio-row label { width: 100%; font-size: 16px; }
  .studio-row label select { flex: 1; min-width: 0; }
  select { max-width: 100%; }
  select, input[type="number"], input[type="text"] { min-height: 46px; font-size: 16px; }
  .composer textarea { font-size: 17px; }
  .bubble { font-size: 17px; }
  .tag { font-size: 13px; padding: 2px 10px; }
  .checkpoint-card { padding: 14px; }
  .checkpoint-card h3 { font-size: 17px; }
  .checkpoint-actions .button { flex: 1 1 45%; }
  .checkpoint-input, .checkpoint-editor { font-size: 16px; }
  .checkpoint-input { min-height: 46px; }
  .confirmation-check { font-size: 15px; }
  .confirmation-check input, .checkpoint-choice input { width: 22px; height: 22px; }
  .checkpoint-choice { font-size: 16px; }
  .doc-preview, .checkpoint-document { max-height: none; }
  .media-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* Tables become stacked cards: one row per block, cells one under another. */
  .shot-table, .chapter-table, .matrix { display: block; }
  .shot-table thead, .matrix thead { display: none; }
  .shot-table tbody, .chapter-table tbody, .matrix tbody { display: block; }
  .shot-table tr, .chapter-table tr, .matrix tr { display: block; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .shot-table td, .chapter-table td, .matrix td { display: block; padding: 3px 0; border: 0; font-size: 15px; line-height: 1.6; }
  .shot-table td:first-child { font-weight: 700; }
  .shot-table td:nth-child(-n+4) { display: inline-block; margin-right: 10px; }
  .matrix img { width: 100%; height: auto; max-width: 240px; }
  .matrix audio { width: 100%; }
}

/* 素材标签 (WP-C): filters and the per-asset editor; large controls, one column on a phone */
.tags-panel { display: grid; gap: 12px; }
.tags-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; align-items: end; }
.tags-field { display: grid; gap: 4px; font-size: 14px; min-width: 0; }
.tags-field select, .tags-field input, .tags-tile input[type="text"], .tags-tile input[type="number"] { box-sizing: border-box; width: 100%; min-height: 44px; padding: 0 10px; font-size: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); }
.tags-tile .tags-field { display: grid; gap: 4px; }
.tags-check { display: flex; gap: 8px; align-items: center; min-height: 44px; font-size: 16px; }
.tags-check input { width: 22px; height: 22px; flex: none; }
.tags-untagged { align-self: end; }
.tags-count { margin: 0; }
.tags-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; align-items: start; }
.tags-tile { min-width: 0; overflow-wrap: anywhere; }
.tags-tile .tags-summary { margin: 0; font-size: 14px; line-height: 1.6; }
.tags-tile .tags-edit { min-height: 44px; }
.tags-editing { grid-column: 1 / -1; }
.tags-editing img, .tags-editing .tile-empty { width: 100%; max-width: 220px; }
.tags-group { margin: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; min-width: 0; }
.tags-group legend { padding: 0 6px; font-weight: 600; font-size: 14px; }
.tags-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0 10px; }

@media (max-width: 640px) {
  .tags-filters { grid-template-columns: minmax(0, 1fr); }
  .tags-results { grid-template-columns: minmax(0, 1fr); }
  .tags-tile img, .tags-tile .tile-empty { max-height: 180px; }
  .tags-checks { grid-template-columns: minmax(0, 1fr); }
  .tags-editing .studio-row > .button { flex: 1 1 100%; min-height: 48px; }
}

/* 导入交付营成果 (WP-D): large controls, one column on a phone */
.camp-panel summary { cursor: pointer; font-size: 16px; font-weight: 700; min-height: 44px; display: flex; align-items: center; }
.camp-panel h3 { margin: 16px 0 8px; }
.camp-field { display: grid; gap: 8px; margin: 0 0 14px; }
.camp-text { box-sizing: border-box; width: 100%; padding: 10px 12px; font-size: 16px; line-height: 1.7; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font-family: inherit; resize: vertical; }
.camp-file { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 14px; color: var(--muted); }
.camp-file input, .camp-pick input { max-width: 100%; font-size: 16px; }
.camp-picks { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; margin-bottom: 12px; }
.camp-pick { display: grid; gap: 6px; padding: 12px; border: 1px dashed var(--line); border-radius: 12px; min-width: 0; align-content: start; }
.camp-uploads, .camp-media, .camp-drafts { display: grid; gap: 8px; margin: 0 0 12px; padding: 0; list-style: none; }
.camp-upload { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; overflow-wrap: anywhere; }
.camp-media li { padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; overflow-wrap: anywhere; }
.camp-media li strong { margin-right: 8px; }
.camp-drafts li { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 16px; }
.camp-replace { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 12px; font-size: 15px; line-height: 1.6; }
.camp-replace[hidden] { display: none; }
.camp-replace input { width: 22px; height: 22px; flex: none; margin-top: 2px; }
.camp-error { margin: 0; color: var(--danger); font-size: 14px; line-height: 1.6; }
.camp-status { margin: 0 0 10px; }
.camp-big { min-height: 48px; font-size: 16px; }
.camp-small { min-height: 40px; }

@media (max-width: 640px) {
  .camp-picks { grid-template-columns: minmax(0, 1fr); }
  .camp-actions > .button { flex: 1 1 100%; }
}

/* Touch screens have no Ctrl+Enter. */
@media (pointer: coarse) { .studio-key-hint { display: none; } }

/* 逐步解锁：五步进度条 + 这一步的确认 / 还差什么。 */
.phase-strip { display: grid; gap: 14px; margin: 0 0 18px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.phase-steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin: 0; padding: 0; list-style: none; }
.phase-step { display: grid; justify-items: center; gap: 4px; padding: 8px 4px; border-radius: 10px; text-align: center; color: var(--muted); }
.phase-dot { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line); font-weight: 800; background: var(--paper); }
.phase-name { font-size: 14px; font-weight: 700; line-height: 1.3; }
.phase-state { font-size: 12px; }
.phase-locked { color: #2f6b3a; }
.phase-locked .phase-dot { border-color: #2f6b3a; background: #2f6b3a; color: #fff; }
.phase-current { color: var(--ink); }
.phase-current .phase-dot { border-color: var(--gold); color: var(--gold); }
.phase-upcoming { opacity: .6; }
.phase-here { background: var(--paper); outline: 2px solid var(--gold); }
.phase-panel h2 { margin: 0 0 6px; font-size: 18px; }
.phase-panel p { margin: 0 0 8px; line-height: 1.7; }
.phase-missing-title { font-weight: 700; }
.phase-missing { margin: 0 0 4px; padding-left: 22px; line-height: 1.8; }
.phase-actions { display: grid; gap: 8px; }
.phase-question { font-weight: 700; }
.phase-buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.phase-actions .button { min-height: 46px; font-size: 16px; }
@media (max-width: 560px) {
  .phase-strip { padding: 12px; }
  .phase-steps { gap: 2px; }
  .phase-name { font-size: 12px; }
  .phase-state { display: none; }
  .phase-actions .button { width: 100%; }
}

/* WO-06：个人版（body.edition-personal）把仍偏小的标签/说明抬到至少 16px；不影响专业版与总部 */
body.edition-personal .studio-kicker,
body.edition-personal .studio-wallet,
body.edition-personal .studio-muted,
body.edition-personal .checkpoint-muted,
body.edition-personal .checkpoint-warning,
body.edition-personal .checkpoint-message,
body.edition-personal .confirmation-check,
body.edition-personal .checkpoint-candidate,
body.edition-personal .media-tile,
body.edition-personal .chapter-table,
body.edition-personal .shot-table,
body.edition-personal .checkpoint-table,
body.edition-personal .matrix,
body.edition-personal .tag,
body.edition-personal .checkpoint-card .section-kicker,
body.edition-personal .studio-steps li::before,
body.edition-personal .bubble .bubble-meta,
body.edition-personal .phase-state,
body.edition-personal .phase-name,
body.edition-personal .tags-field,
body.edition-personal .tags-tile .tags-summary,
body.edition-personal .tags-group legend,
body.edition-personal .camp-file,
body.edition-personal .camp-error {
  font-size: 16px;
  line-height: 1.6;
}

@media (max-width: 560px) {
  body.edition-personal .phase-name { font-size: 16px; }
}
