:root {
  --paper: #f7f5f0;
  --ink: #302a26;
  --muted: #8b8077;
  --line: #e6e0d7;
  --red: #85332d;
  --sand: #ece6dc;
  --white: #fffefa;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family:
    -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans", sans-serif;
  background: var(--paper);
  color: var(--ink);
  font-size: 14px;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--white);
  padding: 10px 16px;
  border-radius: 7px;
  color: var(--ink);
}
button:hover {
  border-color: #ac8c77;
  background: #f1ece4;
}
button.primary {
  background: var(--red);
  border-color: var(--red);
  color: white;
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
a {
  color: var(--red);
}
input,
textarea,
select {
  border: 1px solid var(--line);
  background: var(--white);
  padding: 11px 12px;
  border-radius: 6px;
  color: var(--ink);
  width: 100%;
}
textarea {
  resize: vertical;
  line-height: 1.8;
  min-height: 110px;
}
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid #c8a18b;
  outline-offset: 1px;
}
label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin: 14px 0 7px;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-family: Georgia, "Songti TC", serif;
  font-size: 38px;
  font-weight: 400;
  letter-spacing: -1px;
  margin-bottom: 12px;
}
h2 {
  font-family: Georgia, "Songti TC", serif;
  font-size: 25px;
  font-weight: 400;
}
h3 {
  font-size: 16px;
  font-weight: 500;
}
p {
  line-height: 1.8;
}
small,
.muted {
  color: var(--muted);
}
.shell {
  display: grid;
  grid-template-columns: 230px 1fr;
  min-height: 100vh;
}
.sidebar {
  overflow-y: auto;
  background: #eee9e0;
  border-right: 1px solid var(--line);
  padding: 32px 20px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
}
.wordmark {
  font-family: Georgia, serif;
  font-size: 24px;
  letter-spacing: -1px;
  margin: 0 10px 5px;
}
.edition {
  font-size: 9px;
  letter-spacing: 3px;
  color: var(--muted);
  margin: 0 10px 30px;
}
.brand-picker {
  margin-bottom: 26px;
  display: flex;
  gap: 5px;
}
.brand-picker button {
  padding: 8px;
}
.brand-picker .site-brand {
  padding: 8px 0;
  font-size: 15px;
}
.nav-label {
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--muted);
  margin: 15px 12px 8px;
}
.nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nav button {
  text-align: left;
  border: 0;
  background: transparent;
  padding: 12px 13px;
  font-size: 13px;
}
.nav button.active {
  background: #ded4c6;
  color: #702f29;
}
.nav .icon {
  display: inline-block;
  width: 27px;
  color: #9a8878;
}
.local {
  margin-top: auto;
  padding: 22px 10px 0;
  border-top: 1px solid #ddd3c6;
  font-size: 11px;
  color: var(--muted);
}
.dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #7e9174;
  margin-right: 6px;
}
.main {
  min-width: 0;
}
.topbar {
  height: 72px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 96px 0 42px; /* room for the 中文 / EN switch (i18n.js) */
  font-size: 12px;
  color: var(--muted);
}
.topbar strong {
  color: var(--ink);
  font-weight: 500;
}
.workspace {
  padding: 35px 42px 65px;
  max-width: 1640px;
  margin: auto;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--red);
  margin-bottom: 15px;
}
.heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 26px;
  gap: 20px;
}
.heading p {
  margin: 0;
  color: var(--muted);
}
.hero {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  min-height: 355px;
  background: #e9e0d3;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 28px;
}
.hero-text {
  padding: 38px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.hero h2 {
  font-size: 39px;
  line-height: 1.35;
  max-width: 410px;
}
.hero-text p {
  color: #76685d;
  max-width: 350px;
  font-size: 13px;
}
.hero-image {
  display: flex;
  min-width: 0;
  background: #722f28;
  position: relative;
}
.hero-image img {
  width: 100%;
  height: 355px;
  object-fit: contain;
  object-position: center 30%;
}
.hero-image .caption {
  position: absolute;
  bottom: 22px;
  left: 24px;
  font-size: 10px;
  letter-spacing: 2px;
  color: white;
}
.hero-image.empty {
  align-items: center;
  justify-content: center;
  color: #e0c0a3;
  font-family: Georgia, serif;
  font-size: 70px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}
.stat {
  background: var(--white);
  border: 1px solid var(--line);
  padding: 22px;
  border-radius: 8px;
}
.stat span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.stat strong {
  display: block;
  font-family: Georgia, serif;
  font-size: 32px;
  font-weight: 400;
  margin: 9px 0 3px;
}
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 26px 0 17px;
}
.section-head h2 {
  margin: 0;
}
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 18px;
}
.asset {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  text-align: left;
  padding: 0;
  position: relative;
  min-width: 0;
}
.gallery.character-baseline-gallery {
  grid-template-columns: none;
  grid-auto-flow: column;
  grid-auto-columns: minmax(175px, 220px);
  overflow-x: auto;
  padding-bottom: 12px;
}
.social-feed { margin-top: 32px; }
.caption-underlay-options { display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:16px; margin:20px 0; }
.caption-underlay-options button[aria-pressed="true"] { outline:3px solid #843329; }
.caption-demo { display:flex; align-items:center; height:120px; padding:20px; margin-bottom:12px; color:white; font-size:24px; font-weight:700; background:linear-gradient(140deg,#a3957b,#53645b); }
.caption-demo.with-gradient { background:linear-gradient(to right,rgba(65,3,9,.95),rgba(65,3,9,0) 65%),linear-gradient(140deg,#a3957b,#53645b); }
.caption-demo.with-solid { background:linear-gradient(to right,#650e15 0%,#650e15 62%,transparent 62%),linear-gradient(140deg,#a3957b,#53645b); }
.social-feed-placeholder {
  min-height: 260px;
  padding: 32px 24px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: var(--white);
}
.social-feed-placeholder h3 { margin: 16px 0 8px; }
.social-feed-placeholder p { margin: 0 0 12px; }
.social-feed-placeholder small { color: var(--muted); }
.character-baseline-gallery .asset img {
  object-fit: contain;
  background: var(--white);
}
.asset img {
  width: 100%;
  height: 230px;
  object-fit: cover;
  display: block;
}
.asset .info {
  padding: 13px;
}
.asset .info strong {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 7px;
}
.asset .info small {
  font-size: 10px;
}
.asset .mark {
  position: absolute;
  top: 9px;
  left: 9px;
  background: #fffaf0;
  padding: 5px 8px;
  border-radius: 4px;
  font-size: 10px;
}
.asset.selected {
  outline: 3px solid var(--red);
}
.toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 22px;
}
.toolbar input {
  flex: 1;
}
.toolbar select {
  max-width: 220px;
}
.pill {
  font-size: 10px;
  display: inline-block;
  border-radius: 20px;
  padding: 5px 10px;
  background: #eee6da;
  color: #796353;
  line-height: 1.4;
}
.pill.green {
  background: #e8edde;
  color: #60704e;
}
.pill.red {
  background: #f1dfda;
  color: #85332d;
}
.panel {
  background: var(--white);
  border: 1px solid var(--line);
  padding: 26px;
  border-radius: 9px;
}
.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}
.split {
  display: grid;
  grid-template-columns: 270px 1fr;
  gap: 22px;
}
.doclist {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.doclist button {
  text-align: left;
  line-height: 1.5;
}
.doclist button.active {
  background: #eee4d8;
  border-color: #b79b85;
}
.editor {
  min-height: 440px;
  font-size: 13px;
}
.actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}
.empty-state {
  text-align: center;
  border: 1px dashed #cfc3b5;
  border-radius: 10px;
  padding: 70px 30px;
  color: var(--muted);
}
.empty-state h2 {
  color: var(--ink);
}
.empty-state .symbol {
  font-family: Georgia;
  font-size: 60px;
  color: #b69b86;
  margin-bottom: 20px;
}
.chat {
  max-width: 900px;
  margin: auto;
}
.messages {
  min-height: 330px;
  max-height: 54vh;
  overflow: auto;
  padding: 10px 0 20px;
}
.bubble {
  padding: 17px 20px;
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 10px;
  margin: 12px 0;
  max-width: 90%;
  line-height: 1.8;
  white-space: pre-wrap;
}
.bubble.user {
  margin-left: auto;
  background: #ede3d6;
  border: 0;
}
.bubble .role {
  display: block;
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: 6px;
}
.composer {
  padding: 18px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.composer textarea {
  border: 0;
  min-height: 95px;
  background: transparent;
  padding: 0;
}
.composer small {
  font-size: 11px;
}
.attachment {
  font-size: 11px;
  background: var(--sand);
  padding: 7px 12px;
  border-radius: 5px;
  display: inline-block;
  margin: 0 8px 8px 0;
}
.job {
  border: 1px solid var(--line);
  padding: 22px;
  border-radius: 8px;
  background: var(--white);
  margin-bottom: 13px;
}
.job header {
  display: flex;
  justify-content: space-between;
  gap: 15px;
}
.job h3 {
  margin-bottom: 8px;
}
.job img {
  max-width: 210px;
  max-height: 300px;
  display: block;
  margin-top: 20px;
  border-radius: 5px;
}
.job pre {
  white-space: pre-wrap;
  max-height: 250px;
  overflow: auto;
  font-size: 12px;
  color: var(--muted);
}
.pipeline {
  border-top: 3px solid var(--red);
}
.steps {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 16px 0;
}
.steps span {
  font-size: 11px;
  color: #89735f;
}
.settings {
  max-width: 970px;
}
.settings .panel {
  margin-bottom: 22px;
}
.settings h2 {
  font-size: 22px;
}
.row {
  display: flex;
  gap: 16px;
}
.row > div {
  flex: 1;
}
code {
  font-family: monospace;
  font-size: 11px;
  background: var(--sand);
  padding: 3px 5px;
}
.check {
  display: flex;
  gap: 10px;
  align-items: center;
}
.check input {
  width: auto;
}
.banner {
  padding: 13px 18px;
  background: #ede5d8;
  border: 1px solid #ddcdbb;
  border-radius: 6px;
  color: #806950;
  font-size: 12px;
  margin-bottom: 20px;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 12px;
  max-width: 940px;
  width: 90%;
  padding: 30px;
  background: var(--paper);
  color: var(--ink);
  max-height: 92vh;
  overflow: auto;
}
.video-busy-overlay { position: fixed; inset: 0; z-index: 10000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; background: rgb(250 248 244 / 94%); padding: 32px; text-align: center; cursor: wait; }
.video-text-editor textarea[readonly] { background: #eeeae3; }
#video-board-previews pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; }
dialog::backdrop {
  background: #241a1866;
  backdrop-filter: blur(4px);
}
.modal-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}
.modal-layout > img {
  width: 100%;
  max-height: 65vh;
  object-fit: contain;
  background: #e7ded2;
  border-radius: 7px;
}
.close {
  float: right;
  margin-bottom: 10px;
}
.preview {
  width: 100%;
  max-height: 500px;
  object-fit: contain;
}
.upload-input {
  max-width: 270px;
  font-size: 11px;
  padding: 7px;
}
#toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  padding: 13px 23px;
  color: white;
  background: #302a26;
  border-radius: 8px;
  z-index: 100;
  display: none;
  max-width: 90vw;
}
.loading {
  padding: 90px;
  text-align: center;
  color: var(--muted);
}
details {
  margin-top: 15px;
}
summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
}
.mono {
  font-family: monospace;
  font-size: 12px;
}
@media (max-width: 1050px) {
  .shell {
    grid-template-columns: 190px 1fr;
  }
  .workspace {
    padding: 28px 25px;
  }
  .topbar {
    padding: 0 84px 0 25px;
  }
  .hero-text {
    padding: 25px;
  }
  .hero h2 {
    font-size: 30px;
  }
  .grid2 {
    grid-template-columns: 1fr;
  }
  .split {
    grid-template-columns: 220px 1fr;
  }
}
@media (max-width: 720px) {
  .shell {
    display: block;
  }
  .sidebar {
    position: relative;
    height: auto;
    padding: 18px;
  }
  .edition,
  .local,
  .nav-label {
    display: none;
  }
  .wordmark {
    margin-bottom: 18px;
  }
  .brand-picker {
    margin-bottom: 12px;
  }
  .nav {
    flex-direction: row;
    overflow-x: auto;
  }
  .nav button {
    white-space: nowrap;
  }
  .topbar {
    height: 48px;
  }
  .workspace {
    padding: 24px 16px;
  }
  .hero {
    grid-template-columns: 1fr;
  }
  .hero-image {
    display: none;
  }
  .hero h2 {
    max-width: none;
  }
  .stats {
    grid-template-columns: 1fr 1fr;
  }
  .split,
  .modal-layout {
    grid-template-columns: 1fr;
  }
  .gallery {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .asset img {
    height: 190px;
  }
  .toolbar {
    flex-wrap: wrap;
  }
  .toolbar select {
    max-width: none;
  }
  .heading {
    align-items: flex-start;
  }
  h1 {
    font-size: 30px;
  }
  .row {
    flex-direction: column;
  }
  .doclist {
    max-height: 200px;
    overflow: auto;
  }
}
:root {
  --wiki-border: #e5dfd6;
}
.wiki-reader {
  line-height: 1.9;
  overflow-wrap: anywhere;
}
.wiki-reader table {
  border-collapse: collapse;
  width: 100%;
}
.wiki-reader td,
.wiki-reader th {
  padding: 10px;
  border: 1px solid var(--wiki-border);
  text-align: left;
}
.wiki-reader pre {
  white-space: pre-wrap;
}
.wiki-reader h1 {
  font-size: 32px;
}
.wiki-reader h2 {
  margin-top: 32px;
  font-size: 24px;
}
.product-cover {
  width: 100%;
  height: 240px;
  object-fit: contain;
}
select[multiple] {
  min-height: 120px;
}
:root {
  --poster-accent: #87372f;
}
.reference-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
  max-height: 360px;
  overflow: auto;
  padding: 4px;
}
.reference-tile {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 6px;
  text-align: left;
}
.reference-tile img {
  width: 100%;
  height: 130px;
  object-fit: cover;
  border-radius: 5px;
}
.reference-tile span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}
.reference-tile small {
  font-size: 12px;
}
.reference-tile.selected {
  outline: 2px solid var(--poster-accent);
  background: #f3e5de;
}
.reference-picker {
  margin: 20px 0;
}
#poster-chat .logo-thumb-grid {display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:12px;max-height:300px;overflow:auto;margin:16px 0;}
#poster-chat .logo-tile {min-width:0;padding:10px;font-size:13px;overflow-wrap:anywhere;}
#poster-chat .logo-thumb {display:flex;height:76px;align-items:center;justify-content:center;background:repeating-conic-gradient(#ddd 0% 25%,#fff 0% 50%) 0 / 16px 16px;margin-bottom:8px;overflow:hidden;}
#poster-chat .logo-thumb img {display:block;width:100%;height:76px;max-width:100%;max-height:76px;object-fit:contain;}
#poster-chat .logo-position-grid {display:grid;grid-template-columns:repeat(2,110px);gap:10px;margin:16px 0;}
.logo-position-demo {display:block;position:relative;width:70px;height:48px;border:1px solid #a99c8e;margin:0 auto 6px;background:#fff;}
.logo-position-demo i {position:absolute;font-size:9px;font-style:normal;}
.logo-position-demo.top-left i {top:3px;left:3px;}.logo-position-demo.top-right i {top:3px;right:3px;}
.logo-position-demo.bottom-left i {bottom:3px;left:3px;}.logo-position-demo.bottom-right i {bottom:3px;right:3px;}
#logo-advanced {margin:16px 0;max-width:460px;}
#poster-chat .copy-answer {min-height:100px;height:110px;}
#poster-chat .copy-answer[hidden] {display:none;}
#poster-chat .copy-answer:disabled {background:#e8e5e0;color:#78736c;border-color:#d5d0c8;cursor:not-allowed;opacity:1;}
#poster-chat .copy-answer:disabled::placeholder {color:#78736c;opacity:1;}
#poster-chat #questions-form:has(.copy-answer) label[for=focus-answer] {font-size:16px;font-weight:500;}
.poster-progress {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  list-style: none;
  padding: 0;
  color: #82796e;
  font-size: 14px;
}
.poster-progress li { padding: 8px 10px; border-radius: 8px; }
.poster-progress .current { background: #eee4d7; color: #89392f; font-weight: 700; }
.poster-progress .done { color: #526348; }
.poster-progress li:has(button) {padding:0;}
.poster-progress button {padding:8px 10px;border:0;background:transparent;color:inherit;font:inherit;border-radius:8px;cursor:pointer;}
.poster-progress button:hover:not(:disabled) {background:#eee4d7;text-decoration:underline;}
.poster-progress button:focus-visible {outline:3px solid #397a9d;outline-offset:2px;}
.poster-progress button:disabled {cursor:wait;opacity:.55;}
.video-camera-picker {margin:20px 0;}
.video-camera-picker > span {color:var(--muted);}
:is(#video-camera-options,#video-era-options,#video-speech-options) {margin:0;border:1px solid #e4ddd3;border-radius:10px;background:#fff;}
:is(#video-camera-options,#video-era-options,#video-speech-options) summary {padding:16px;color:inherit;cursor:pointer;}
.video-camera-option {padding:0 10px;}
.video-camera-option button {width:100%;text-align:left;border:0;background:transparent;}
.video-camera-option button:hover,.video-camera-option button:focus-visible {background:#eee4d7;}
.video-camera-option button[aria-pressed=true] {color:#89392f;font-weight:700;}
.video-camera-option [role=tooltip] {display:none;margin:0;padding:12px 16px;background:#f5efe6;color:#403831;border-radius:8px;}
.video-camera-option:hover [role=tooltip],.video-camera-option:focus-within [role=tooltip] {display:block;}
:is(#video-camera-selected,#video-era-selected,#video-speech-selected) {margin:10px 0;}
.poster-step-title { outline: none; }
#poster-chat label[for="focus-answer"],
#poster-chat label[for="logo-choice"],
#poster-chat #topic-form > label {
  display: block;
  font-size: clamp(1.25rem, 1.1rem + .5vw, 1.5rem);
  font-weight: 700;
  line-height: 1.55;
  color: #292522;
  margin: 16px 0 12px;
  overflow-wrap: anywhere;
}
.harness-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.harness-hub-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; align-items: start; }
.harness-hub-grid .harness-card { min-width: 0; overflow-wrap: anywhere; }
.harness-hub-grid .harness-card-empty { order: 1; }
.harness-hub-grid .diagram-canvas { height: 280px; display: flex; align-items: center; justify-content: center; }
.harness-hub-grid .diagram-canvas img { max-height: 254px; max-width: 100%; }
.harness-import-note { margin-top: 22px; }
@media (max-width: 900px) { .harness-hub-grid { grid-template-columns: minmax(0, 1fr); } }
.harness-diagram { margin: 20px 0; }
.diagram-canvas { position: relative; background: #fff; border: 1px solid #ded7cd; border-radius: 12px; padding: 12px; }
.diagram-canvas img { display: block; width: auto; max-width: 100%; height: auto; max-height: 320px; margin: 0 auto; object-fit: contain; }
.diagram-canvas img { cursor: zoom-in; }
.diagram-canvas img:focus-visible { outline: 2px solid #843329; outline-offset: 4px; }
.diagram-lens { position: absolute; z-index: 3; pointer-events: none; overflow: hidden; background: white; border: 2px solid #843329; border-radius: 12px; box-shadow: 0 8px 28px #241a1830; }
.diagram-lens[hidden] { display: none; }
.diagram-lens svg { display: block; width: 100%; height: 100%; }
#poster-chat .focus-more { background: #e3edf3; color: #234f6d; border-color: #9fb9ca; }
#focus-extra { margin-top: 16px; padding: 20px; border: 1px solid #9fb9ca; border-radius: 12px; background: #f0f5f8; }
.question-visuals { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 16px; margin: 20px 0 12px; }
.question-visuals figure { margin: 0; min-width: 0; border: 1px solid #ded7cd; border-radius: 12px; overflow: hidden; }
.question-visuals img { display: block; width: 100%; height: 240px; object-fit: contain; background: #eee9e1; }
.question-visuals figcaption { padding: 12px; font-size: 16px; font-weight: 600; }
.question-visual-choice { padding: 0; overflow: hidden; text-align: left; border: 2px solid #ded7cd; border-radius: 12px; min-width: 0; }
.question-visual-choice span { display: block; padding: 12px; font-size: 16px; font-weight: 700; }
.question-visual-choice[aria-pressed="true"] { border-color: #87372e; background: #efe2d7; box-shadow: 0 0 0 2px #87372e; }
.question-visual-choice:focus-visible { outline: 3px solid #397a9d; outline-offset: 4px; }
.question-images-dialog { width: min(1050px, 94vw); max-width: 94vw; max-height: 88dvh; padding: 20px; border: 1px solid #ded7cd; border-radius: 18px; background: #faf8f4; color: #292522; }
.question-images-dialog[open] { display: flex; flex-direction: column; }
.question-images-dialog::backdrop { background: rgb(0 0 0 / 45%); }
.question-images-dialog header, .question-images-dialog footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; flex-shrink: 0; }
.question-images-dialog h2 { font-size: 24px; margin: 0; }
.question-images-scroll { overflow-y: auto; min-height: 0; overscroll-behavior: contain; margin: 16px 0; }
.question-images-dialog .reference-grid { max-height: none; overflow: visible; }
.question-images-error { color: #87372e; }
.ratio-picker { border: 0; padding: 0; margin: 20px 0; }
.ratio-picker legend { font-size: 22px; font-weight: 700; margin-bottom: 14px; }
.ratio-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(105px, 1fr)); gap: 12px; }
.ratio-grid button { padding: 12px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.ratio-grid button[aria-pressed="true"] { border-color: #87372e; background: #efe2d7; box-shadow: 0 0 0 2px #87372e; }
.ratio-grid button:focus-visible { outline: 3px solid #397a9d; outline-offset: 3px; }
.ratio-example { height: 80px; display: flex; align-items: center; justify-content: center; }
.ratio-example > span { display: block; border: 2px solid currentColor; background: #87372e18; }
.ratio-grid small { font-size: 14px; }
.discard-poster { color: #87372e; border-color: #b6837d; background: transparent; }
.discard-poster:hover:not(:disabled) { background: #f7e5e2; }
.poster-current-step { margin: 24px 0; }
.poster-history { border-top: 1px solid #ded7cd; padding-top: 16px; }
#poster-chat [hidden] { display: none !important; }
.poster-messages {
  max-height: 330px;
  overflow: auto;
  margin: 20px 0;
}
.poster-messages p,
.poster-copy {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
#poster-chat .bubble {
  margin: 12px 0;
  max-width: 95%;
}
#poster-chat .steps {
  flex-wrap: wrap;
}
#poster-chat pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
#poster-chat button {
  margin-top: 8px;
}
.poster-result {
  display: block;
  max-width: 100%;
  max-height: 65vh;
  object-fit: contain;
  margin: 20px auto;
}
@media (max-width: 600px) {
  .reference-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .reference-tile img {
    height: 110px;
  }
  #poster-chat .section-head {
    align-items: flex-start;
    flex-wrap: wrap;
  }
}
.nav-group { margin: 8px 0; }
.nav-group-title { padding: 8px 14px; color: #80776c; font-size: 13px; font-weight: 600; }
.nav-group-items { display: flex; flex-direction: column; gap: 4px; margin-left: 14px; padding-left: 8px; border-left: 1px solid #d5cabc; }
@media (max-width: 720px) {
  .nav-group { flex-shrink: 0; margin: 0; }
  .nav-group-title { padding: 0 10px 4px; }
  .nav-group-items { flex-direction: row; margin-left: 0; padding-left: 0; border-left: 0; }
}
.brand-avatar { display:block; width:64px; height:64px; border-radius:50%; object-fit:cover; margin:0 10px 12px; flex-shrink:0; box-shadow:0 0 0 3px #fff8; }
.is-loading::before { content: ''; display: inline-block; width: 1em; height: 1em; margin-inline-end: .65em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; vertical-align: -.12em; animation: studio-spin .85s linear infinite; flex-shrink: 0; }
@keyframes studio-spin { to { transform: rotate(360deg); } }
.operation-loading { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 1000; padding: 12px 20px; border: 1px solid #d8caba; border-radius: 12px; background: #fffaf4; color: #843329; box-shadow: 0 4px 18px #241a1820; pointer-events: none; }
.image-loading { background: linear-gradient(100deg, #e9e3da 25%, #faf7f2 45%, #e9e3da 65%); background-size: 220% 100%; animation: studio-shimmer 1.4s ease-in-out infinite; }
@keyframes studio-shimmer { to { background-position: -220% 0; } }
@media (prefers-reduced-motion: reduce) { .is-loading::before, .image-loading { animation: none !important; } }
/* Source crops stay uncropped so every letter can be inspected. */
.lettering-attachments { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:16px; }
.lettering-attachments figure { margin:0; padding:12px; border:1px solid #ddd4c7; border-radius:12px; min-width:0; }
.lettering-attachments img { display:block; width:100%; max-height:220px; object-fit:contain; }
.lettering-attachments figcaption { font-weight:600; margin:8px 0; }
.lettering-choice-grid { max-height:420px; overflow-y:auto; align-items:start; padding:4px; }
.lettering-choice-grid img { height:170px; object-fit:contain; }
.question-visuals.lettering-curated { display:block; }
.lettering-curated-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; margin:16px 0; }
.lettering-curated-grid img { height:180px; }
.lettering-curated-grid small { display:block; padding:0 16px 16px; font-size:14px; line-height:1.6; font-weight:400; }
.lettering-curated details { border-top:1px solid #ded7cd; padding-top:16px; }
.lettering-option {min-width:0;}
.lettering-option > button {width:100%;}
.lettering-curated .lettering-help {border-top:0;padding:8px 4px;}
.lettering-help summary {font-size:14px;cursor:pointer;}
.lettering-help p {font-size:14px;line-height:1.7;margin:8px 0;}
.help-question {display:inline-flex;align-items:center;justify-content:center;border:1px solid currentColor;border-radius:50%;width:18px;height:18px;font-size:12px;}
@media(max-width:600px) { .lettering-curated-grid { grid-template-columns:1fr; } }
:root .poster-saved-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(210px,1fr)); gap: 16px; max-height: 420px; overflow: auto; margin: 16px 0; }
:root .poster-saved-grid article { border: 1px solid #ddd5c9; border-radius: 12px; padding: 16px; }
:root .poster-saved-grid img { width: 100%; height: 150px; object-fit: contain; display: block; margin-bottom: 10px; }
#poster-saved-history { padding: 16px; border: 1px solid #ddd5c9; border-radius: 12px; margin-bottom: 24px; }
.generated-results {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,420px),1fr));gap:24px;align-items:start}
.generated-result-image {width:100%;height:420px;object-fit:contain;background:#eee9e1}
.generated-reference-grid {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.generated-reference-grid figure {margin:0;overflow-wrap:anywhere}
.generated-reference-grid img {width:100%;height:180px;object-fit:contain;background:#eee9e1}
.generated-prompt {white-space:pre-wrap;overflow-wrap:anywhere;max-height:600px;overflow:auto}
.record-filters {display:flex;flex-wrap:wrap;align-items:end;gap:16px;margin-bottom:28px;padding:20px;background:#eee8df;border-radius:12px}
.record-filters label {display:flex;flex-direction:column;gap:6px;flex:1 1 170px;min-width:0;margin:0}
.record-filters label:first-child {flex:2 1 250px}
.record-filters input,.record-filters select {width:100%;min-width:0;margin:0}
.record-filters small {flex-basis:100%}
/* Product knowledge and auditable ingestion workspace. */
.product-search { display: flex; align-items: end; gap: 1.25rem; margin-bottom: 1.5rem; }
.product-search label { flex: 1; }
.product-search input { display: block; width: 100%; }
.product-search [role="status"] { white-space: nowrap; padding-bottom: .75rem; }
.product-entry { margin-bottom: 1rem; }
.product-entry h2 { margin: .75rem 0; }
.product-facts { display: grid; grid-template-columns: repeat(auto-fit,minmax(180px,1fr)); gap: 1rem; }
.product-facts dt { color: #887e72; font-size: .85rem; }
.product-facts dd { margin: .25rem 0 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.product-local-photos { display: flex; gap: 1rem; flex-wrap: wrap; }
.product-local-photos img { width: 160px; height: 180px; object-fit: contain; }
.product-wiki { align-items: start; }
.product-wiki .product-list-item { display:flex; gap:12px; align-items:flex-start; text-align:left; }
.product-list-item > img, .product-photo-placeholder { width:64px; height:72px; flex:0 0 64px; object-fit:contain; border-radius:6px; background:#f5f2ed; }
.product-photo-placeholder { display:grid; place-items:center; font-size:12px; color:#756c61; }
.product-list-item > span:last-child { min-width:0; overflow-wrap:anywhere; }
.product-list-item small, .product-variant-links small { display:block; }
.product-related-overview { margin:24px 0; padding:20px; border:1px solid var(--wiki-border); border-radius:12px; }
.product-variant-links { display:grid; grid-template-columns:repeat(auto-fit,minmax(140px,1fr)); gap:12px; }
.product-variant-links button { min-width:0; text-align:left; }
.product-variant-links img { display:block; width:100%; height:160px; object-fit:contain; margin-bottom:8px; }
.product-local-photos > a { display: flex; flex-direction: column; max-width: 240px; overflow-wrap: anywhere; }
.product-local-photos small { max-width: 240px; }
.product-photo-variant { padding: 16px 0; border-bottom: 1px solid var(--wiki-border); }
.product-photo-candidates { padding: 16px; margin: 24px 0; background: #eee4d8; border-radius: 8px; }
.product-wiki > .doclist { max-height: 76vh; overflow-y: auto; padding-right: 4px; }
.product-wiki-article { min-width: 0; min-height: 480px; }
.product-wiki-article .product-local-photos img { width: 240px; height: 260px; max-width: 100%; }
.product-wiki-article .product-facts { border-top: 1px solid var(--wiki-border); padding-top: 20px; }
.product-wiki-toolbar { margin-top: 24px; }
@media (max-width: 760px) {
  .product-wiki { grid-template-columns: minmax(0, 1fr); }
  .product-wiki > .doclist { max-height: 280px; }
  .product-wiki-toolbar { flex-wrap: wrap; }
  .product-wiki-toolbar input, .product-wiki-toolbar select { min-width: 0; width: 100%; flex-basis: 100%; }
}
.product-preview-table { overflow-x: auto; max-height: 480px; }
.product-preview-table table { width: 100%; border-collapse: collapse; }
.product-preview-table td, .product-preview-table th { padding: .7rem; border-bottom: 1px solid #e2dcd3; text-align: left; }
#product-ingestion-form input { width: 100%; margin-bottom: 1rem; }
@media(max-width: 650px) { .product-search { display: block; } }
.product-article-hero { display:grid; grid-template-columns:minmax(0,1fr) minmax(220px,320px); gap:28px; align-items:start; }
.product-article-hero > div { min-width:0; }
.product-article-hero h1 { font-size:32px; overflow-wrap:anywhere; }
.product-carousel { min-width:0; }
.product-carousel-frame { position:relative; background:#f5f2ed; border-radius:12px; overflow:hidden; }
.product-carousel-frame a { display:block; }
.product-carousel-frame a[hidden] { display:none; }
.product-carousel-frame img { display:block; width:100%; height:320px; object-fit:contain; }
.product-carousel-frame button { position:absolute; top:50%; transform:translateY(-50%); width:40px; height:44px; padding:0; background:#fff; font-size:28px; }
.product-photo-prev { left:8px; }
.product-photo-next { right:8px; }
.product-photo-dots { display:flex; justify-content:center; flex-wrap:wrap; gap:2px; margin-top:8px; }
.product-photo-dots button { display:grid; place-items:center; width:28px; height:28px; padding:0; border:0; background:transparent; }
.product-photo-dots button::after { content:""; width:8px; height:8px; border-radius:50%; background:#c9c0b5; }
.product-photo-dots button[aria-current="true"]::after { background:#863b32; }
.product-photo-count { text-align:center; font-size:13px; margin:0; }
@media(max-width:1000px) { .product-article-hero { grid-template-columns:minmax(0,1fr); } .product-carousel { width:100%; max-width:360px; } }
.question-visuals.poster-subject-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.poster-subject-grid .question-visual-choice img { height: 280px; object-fit: contain; }
@media (max-width: 800px) { .question-visuals.poster-subject-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pose-vault-layout {display:grid;grid-template-columns:260px minmax(0,1fr);gap:24px;align-items:start}
.pose-vault-list {max-height:80vh;overflow:auto;display:grid;gap:8px}
.pose-vault-list button {text-align:left;width:100%}
.pose-vault-list small {display:block;color:var(--muted);margin-top:6px}
.pose-vault-list button[aria-pressed=true] {background:#ede3d6;border-color:#a9866e}
.pose-vault-reader {min-width:0}
.pose-comparison {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.pose-comparison figure {margin:0;min-width:0}
.pose-comparison figure:only-child {grid-column:1 / -1}
.pose-comparison figcaption {margin:10px 0;font-weight:600}
.pose-comparison img {width:100%;height:430px;object-fit:contain;background:#eee9e1;border-radius:12px}
.pose-empty {height:430px;display:grid;place-items:center;text-align:center;padding:20px;background:#eee9e1;border-radius:12px;color:#82786d}
.pose-inputs {display:flex;gap:10px;flex-wrap:wrap}
.pose-inputs figure {margin:0;max-width:130px}
.pose-inputs img {width:100%;height:140px;object-fit:contain}
.pose-vault-reader pre {white-space:pre-wrap;overflow-wrap:anywhere}
@media(max-width:800px){.pose-vault-layout{grid-template-columns:1fr}.pose-vault-list{max-height:220px}.pose-comparison img,.pose-empty{height:260px}}
.video-step-nav{display:flex;flex-wrap:wrap;gap:8px;margin:20px 0}.video-step-nav [aria-current=step]{background:#eee3d6;border-color:#843329}.video-ref-grid,.video-story-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.video-ref-grid figure{margin:0}.video-ref-grid img,.video-pose-preview{width:100%;height:180px;object-fit:contain;background:#eee9e0}.video-ref-grid figcaption{overflow-wrap:anywhere;font-size:14px}#video-chat textarea{min-height:100px}#video-story-json{min-height:360px;font-family:monospace}#video-chat pre{white-space:pre-wrap;overflow-wrap:anywhere;max-height:500px;overflow:auto}#video-chat label{display:block;margin:16px 0}#video-chat input[type=checkbox]{width:auto}@media(max-width:650px){.video-ref-grid,.video-story-grid{grid-template-columns:1fr}}
#video-product-picker .actions{display:none}
.video-progress{padding:12px 16px;background:#eee9e1;border-radius:10px;color:#63584e}
#video-duration{width:100%;padding:0;accent-color:#87372e;cursor:pointer;min-height:36px}
.video-duration-ticks{display:flex;justify-content:space-between;gap:8px;color:#80786d;font-size:14px;margin-bottom:28px}
[data-video-ratio="9:16"] .ratio-example>span{width:42.75px;height:76px}
[data-video-ratio="16:9"] .ratio-example>span{width:76px;height:42.75px}
[data-video-ratio="1:1"] .ratio-example>span{width:76px;height:76px}
[data-video-ratio="3:4"] .ratio-example>span{width:57px;height:76px}
[data-video-ratio="4:3"] .ratio-example>span{width:76px;height:57px}
[data-video-ratio="21:9"] .ratio-example>span{width:76px;height:32.57px}
.video-scenes{border:0;padding:0;margin:20px 0}.video-scenes legend{font-size:22px;font-weight:700;margin-bottom:16px}
.video-scene-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
.video-scene-card{position:relative;aspect-ratio:1;min-width:0;padding:0;overflow:hidden;border:2px solid #ded7cd;border-radius:12px;display:block;background:transparent}
.video-scene-card img{width:100%;height:100%;object-fit:cover;display:block}
.video-scene-card>span:not(.video-scene-plus){position:absolute;bottom:0;left:0;right:0;padding:10px;background:#fffef1ed;color:#302b27;font-weight:600;overflow-wrap:anywhere}
.video-scenes [aria-pressed=true]{border-color:#87372e;box-shadow:0 0 0 2px #87372e}
.video-scene-card:focus-visible{outline:3px solid #397a9d;outline-offset:3px}
.video-scene-upload,.video-scene-upload:hover{background:transparent;border:2px dashed #999;color:#777}
.video-scene-plus{display:block;font-size:54px;font-weight:300;line-height:1}
.video-scene-upload>.video-scene-upload-label{opacity:0;background:transparent!important;color:#777!important;transition:opacity .15s}
.video-scene-upload:hover>.video-scene-upload-label,.video-scene-upload:focus-visible>.video-scene-upload-label{opacity:1}
@media(hover:none){.video-scene-upload>.video-scene-upload-label{opacity:1}}
@media(max-width:650px){.video-scene-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}}
.video-loading { display:flex; align-items:center; gap:14px; padding:18px; border:1px solid #ded7cd; border-radius:12px; background:#efe6d8; color:#87372e; }
.video-loading small { display:block; margin-top:6px; color:#655d54; }
.video-loading-spinner { flex:0 0 auto; width:26px; height:26px; border:3px solid #d8c4b8; border-top-color:#87372e; border-radius:50%; animation:video-loading-spin .85s linear infinite; }
@keyframes video-loading-spin { to { transform:rotate(360deg); } }
.video-generation-activity { display:flex; align-items:center; gap:14px; min-height:84px; margin:16px 0; padding:16px; background:#f4ece3; border-radius:12px; }
.video-render-choices { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; margin:24px 0; }
.video-render-choices button { min-height:110px; padding:22px; font-size:20px; font-weight:700; border:2px solid #87372e; text-align:left; }
.video-render-choices button span { display:block; font-size:14px; font-weight:400; margin-top:10px; }
.video-render-choices button:disabled { opacity:.5; cursor:not-allowed; }
.video-music-summary { padding:16px; background:#eee8df; border-radius:12px; }
@media(max-width:700px) { .video-render-choices { grid-template-columns:1fr; } }
.video-generation-activity small { display:block; margin-top:6px; color:#766c62; }
.video-generation-activity.is-queued { background:#f1efeb; }
.video-generation-activity.is-queued .video-loading-spinner { border-color:#ddd8d0; border-top-color:#93897e; animation-duration:2s; }
@media (prefers-reduced-motion:reduce) { .video-loading-spinner { animation:none; } }
.video-result {display:block;width:100%;max-height:65vh;background:#111;border-radius:12px;}
.panel > .video-loading-spinner {display:inline-block;}
.video-scenes:has([data-scene="AI 決定"][aria-pressed="true"]) .video-scene-card img {filter:grayscale(1);opacity:.4;}
.video-season-grid {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;}
.video-seasons [data-season] {cursor:pointer;}
.video-seasons [data-season]:hover {border-color:#a9866e;}
.video-seasons [data-season][aria-pressed=true] {border-color:#87372e;box-shadow:0 0 0 2px #87372e;background:#efe2d7;}
.video-seasons [data-season][aria-pressed=true]::after {content:'✓ 已選';display:inline-block;background:#87372e;color:#fff;padding:4px 9px;border-radius:6px;font-size:14px;font-weight:600;margin-left:10px;}
.video-seasons .video-scene-card[aria-pressed=true]::after {position:absolute;top:10px;right:10px;margin:0;pointer-events:none;}
.video-seasons [data-season]:focus-visible {outline:3px solid #397a9d;outline-offset:5px;}
.video-seasons:has([data-season="AI 決定"][aria-pressed="true"]) img {filter:grayscale(1);opacity:.4;}
@media(max-width:650px){.video-season-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;}}
.video-revision-modes {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-bottom:18px;}
.video-revision-modes button {text-align:left;white-space:normal;}
.video-revision-modes span {display:block;font-size:.9em;margin-top:8px;}
.video-revision-modes [aria-pressed=true] {border-color:#87372e;background:#efe6d8;}
#video-revision:disabled {background:#e8e5e0;color:#77716b;cursor:not-allowed;opacity:1;}
@media(max-width:500px){.video-revision-modes{grid-template-columns:1fr;}}
/* Final video review: two readable editors, one confirmation action. */
.video-text-editor { margin-block: 1.8rem; }
.video-text-editor > label { font-size: 1.2rem; font-weight: 700; }
#video-chat .video-text-editor textarea { min-height: 26rem; width: 100%; line-height: 1.8; resize: vertical; white-space: pre-wrap; }
#video-review-assets audio { max-width: 100%; }
.video-confirm { margin-top: 2rem; }
.video-frame-card textarea{width:100%;min-height:240px!important}.video-frame-card>button{margin:12px 0}.video-frame-versions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.video-frame-versions figure{margin:12px 0;padding:12px;border:1px solid #e5ded5;border-radius:12px}.video-frame-versions figcaption{overflow-wrap:anywhere}.video-frame-versions button{width:100%;margin-top:8px}@media(max-width:650px){.video-frame-versions{grid-template-columns:1fr}}
#production-history{margin-top:28px}#production-history summary{cursor:pointer}#production-history pre{white-space:pre-wrap;overflow-wrap:anywhere;max-height:480px;overflow:auto}.history-job{padding:20px 0;border-top:1px solid #e5ded5}.history-job>img,.history-job>video{max-width:100%;max-height:360px}.history-references{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:12px}.history-references figure{margin:0;overflow-wrap:anywhere}.history-references img{width:100%;height:160px;object-fit:contain}.history-references audio{max-width:100%}.video-credit-total{font-size:32px;font-weight:700}#video-film-quote{border:2px solid #87372e}#video-film-quote button{margin:8px 12px 8px 0}
.library-create,.library-summary,.library-tabs,.library-card-actions,.library-pagination{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.library-create button{white-space:nowrap}.library-summary button{padding:8px 12px;font-size:14px}.library-notice{display:flex;gap:16px;align-items:center;justify-content:space-between;padding:12px 16px;background:#eee7dc;border-radius:10px;font-size:14px}.library-notice button{padding:6px 12px;white-space:nowrap}
.library-tools{background:#fffdfa;border:1px solid #e5ded5;border-radius:14px;padding:20px}.library-search{display:block;margin:0 0 16px}.library-search input{width:100%;margin-top:8px}.library-tabs button{padding:9px 16px}.library-tabs [aria-pressed=true]{background:#87372e;border-color:#87372e;color:#fff}.library-filters{display:flex;align-items:end;flex-wrap:wrap;gap:12px;margin-top:16px}.library-filters label{flex:1;min-width:135px;margin:0;font-size:13px}.library-filters select,.library-filters input{display:block;width:100%;margin-top:5px;padding:10px}.library-filters>button{padding:10px}
.library-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:20px}.library-card{min-width:0;background:#fffdfa;border:1px solid #e5ded5;border-radius:14px;overflow:hidden}.library-preview{border:0;border-radius:0;padding:0;display:grid;position:relative;width:100%;height:220px;background:#eae4dc;overflow:hidden}.library-preview img,.library-preview video{width:100%;height:220px;object-fit:contain;min-width:0}.library-preview.is-mosaic{grid-template-columns:repeat(2,minmax(0,1fr));grid-auto-rows:110px;gap:3px}.library-preview.is-mosaic img{height:110px;object-fit:cover}.library-preview:hover{filter:brightness(.97)}.library-play{position:absolute;bottom:12px;left:12px;background:#241e1bdd;color:#fff;border-radius:20px;padding:7px 14px}.library-draft{display:flex;flex-direction:column;justify-content:center;text-align:left;padding:24px;gap:14px}.library-draft span{display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;font-size:15px;line-height:1.7}
.library-card-body{padding:18px}.library-card-body h3{font-size:19px;line-height:1.5;margin:12px 0 6px;overflow-wrap:anywhere;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.library-card-body p{margin:6px 0;font-size:14px}.library-card-body small{font-size:12px;color:#756c63}.library-status{display:inline-block;border-radius:20px;background:#eee7dc;color:#6b5946;padding:4px 9px;font-size:12px}.library-status.completed,.library-status.image,.library-status.boards{background:#e4edde;color:#405d35}.library-status.attention{background:#f6dfd9;color:#922f23}.library-status.running{background:#e2eaf4;color:#305f88}.library-card-actions{margin-top:16px}.library-card-actions button,.library-link{font-size:14px}.library-card-actions button{padding:9px 12px}.library-link{color:#87372e;text-decoration:underline;text-underline-offset:3px}.library-pagination{justify-content:center;margin-top:24px}.library-empty{padding:36px;text-align:center;grid-column:1/-1;color:#756c63}
.library-list{grid-template-columns:1fr}.library-list .library-card{display:grid;grid-template-columns:210px minmax(0,1fr)}.library-list .library-preview,.library-list .library-preview>img,.library-list .library-preview>video{height:180px}.library-list .library-preview.is-mosaic{grid-auto-rows:90px}.library-list .library-preview.is-mosaic img{height:90px}
.library-detail{background:#fffdfa;border:1px solid #e5ded5;border-radius:16px;padding:26px;scroll-margin-top:20px}.library-detail>label{display:block;max-width:460px;margin:20px 0}.library-detail select{width:100%;margin-top:8px}.library-detail .library-tabs{border-bottom:1px solid #e5ded5;padding-bottom:14px;margin-bottom:22px}.library-player{display:block;max-width:100%;width:100%;max-height:560px;background:#171411;border-radius:12px}.library-output-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin-top:22px}.library-output-grid figure{margin:0;min-width:0}.library-output-grid button{display:block;padding:0;width:100%;overflow:hidden;border-radius:10px;background:#eee7dc}.library-output-grid img{display:block;width:100%;height:230px;object-fit:contain}.library-output-grid figcaption{font-size:13px;margin:8px 0;overflow-wrap:anywhere}.library-lightbox{width:min(1000px,94vw);max-height:94vh;padding:20px;border:0;border-radius:14px}.library-lightbox::backdrop{background:#000b}.library-lightbox>button{display:block;margin-left:auto}.library-lightbox>img{display:block;max-width:100%;max-height:72vh;margin:auto}.library-lightbox>div{display:flex;justify-content:center;align-items:center;gap:20px;margin-top:14px}
@media(max-width:1100px){.library-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.library-list{grid-template-columns:1fr}.library-output-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:650px){.library-grid{grid-template-columns:1fr}.library-create{margin-top:12px}.library-filters label{min-width:120px}.library-list .library-card{grid-template-columns:110px minmax(0,1fr)}.library-card-body{padding:14px}.library-list .library-card-actions{flex-direction:column;align-items:start}.library-detail{padding:16px}.library-output-grid{grid-template-columns:1fr}.library-tools{padding:14px}#production-history .section-head{flex-wrap:wrap;gap:12px}.library-notice{align-items:start}.library-detail .section-head button{font-size:13px}}
.social-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 20px; margin: 24px 0; }
.social-two { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 24px; }
#social-studio { max-width: 1400px; }
#social-studio .panel { margin-bottom: 22px; min-width: 0; overflow-wrap: anywhere; }
#social-studio input, #social-studio select, #social-studio textarea { width: 100%; box-sizing: border-box; }
#social-studio input[type=checkbox] { width: auto; flex-shrink: 0; }
#social-studio label { display: block; margin: 12px 0; }
#social-studio .check { display: flex; gap: 10px; align-items: baseline; }
#social-studio button { margin: 8px 8px 8px 0; }
#social-studio button:disabled { opacity: .5; cursor: not-allowed; }
#social-studio a { text-decoration: underline; text-underline-offset: 4px; }
#social-studio p { line-height: 1.7; }
#social-studio [hidden] { display: none; }
#social-studio progress { width: 100%; accent-color: #8d342d; margin: 12px 0 24px; }
#social-studio img, #social-studio video { display: block; max-width: 100%; max-height: 320px; object-fit: contain; margin: 16px auto; }
.social-notice { padding: 16px 20px; border-left: 4px solid #8d342d; background: #f1e8dc; margin: 16px 0; line-height: 1.6; }
.social-guide { border: 2px solid #8d342d; }
.social-guide li { padding: 8px 0; line-height: 1.7; }
.social-platform { background: #efe6da; border-radius: 14px; width: 48px; height: 48px; display: grid; place-items: center; font-weight: 700; }
.social-source-list { max-height: 250px; overflow: auto; padding: 12px; border: 1px solid #e4ddd3; }
.social-history { padding: 20px 0; border-top: 1px solid #e4ddd3; }
.social-copy { white-space: pre-wrap; }
.social-confirm { border: 2px solid #8d342d; }
.social-tabs [aria-pressed=true] { background: #8d342d; color: white; }
.social-kpis { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 16px; margin-top: 22px; }
.social-kpis div { background: #f5f1eb; padding: 20px; border-radius: 12px; }
.social-kpis strong { display: block; font-size: 30px; margin-top: 10px; }
#social-studio dl > div { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px solid #eee8df; padding: 8px 0; }
#social-status:not(:empty) { padding: 16px; background: #eee7db; position: sticky; top: 0; z-index: 2; border-radius: 10px; }
@media(max-width:1000px) { .social-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media(max-width:650px) { .social-grid,.social-two { grid-template-columns: 1fr; } .social-kpis { grid-template-columns: repeat(2,minmax(0,1fr)); } #social-studio .panel { padding: 20px; } }
.sd-dashboard{display:grid;gap:24px;min-width:0}.sd-dashboard .panel{margin:0;min-width:0}.sd-filters{display:flex;flex-wrap:wrap;justify-content:space-between;gap:16px;margin-top:20px}.sd-switch{display:flex;flex-wrap:wrap;gap:4px;background:#eee8df;padding:5px;border-radius:24px}.sd-switch button{padding:9px 18px;border:0;border-radius:20px;background:transparent;min-width:52px}.sd-switch button[aria-pressed=true]{background:#88372f;color:white}.sd-platforms{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px;margin-top:22px}.sd-platform{border:1px solid #e6dfd6;border-top:4px solid;border-radius:14px;padding:22px}.sd-platform h3{margin-top:0}.sd-platform dl>div{display:flex;justify-content:space-between;gap:12px;padding:7px 0}.sd-platform dd{margin:0;text-align:right;font-weight:600}.sd-platform small{display:block;font-weight:400;font-size:12px;color:#75695e}.sd-border-instagram{border-color:#b73584}.sd-border-facebook{border-color:#2979ce}.sd-border-threads{border-color:#ad791d}.sd-instagram{color:#b73584}.sd-facebook{color:#2979ce}.sd-threads{color:#ad791d}.sd-micro{font-size:13px;line-height:1.8;color:#75695e}.sd-chart{display:block;width:100%;min-width:0;height:auto;margin:18px 0}.sd-chart text{font-size:12px;fill:#75695e}.sd-chart circle:focus{stroke:#211d1a;stroke-width:3px;outline:none}.sd-legend{display:flex;gap:20px;flex-wrap:wrap}.sd-empty{padding:40px 20px;text-align:center;background:#f5f1eb;border:1px dashed #d8ccbf;border-radius:12px;color:#75695e;margin:18px 0}.sd-posts{list-style:none;padding:0;display:grid;gap:14px}.sd-post{display:grid;grid-template-columns:28px 90px minmax(0,1fr);gap:20px;border:1px solid #e6dfd6;border-left:4px solid;border-radius:12px;padding:20px}.sd-post.sd-border-instagram{border-left-color:#b73584}.sd-post.sd-border-facebook{border-left-color:#2979ce}.sd-post.sd-border-threads{border-left-color:#ad791d}.sd-post p{overflow-wrap:anywhere}.sd-rank{font-size:24px}.sd-thumb{height:105px;background:#eee8df;border-radius:8px;overflow:hidden;display:grid;place-items:center}.sd-thumb img{width:100%;height:100%;object-fit:cover}.sd-no-image{font-size:12px;text-align:center;padding:8px}.sd-table{overflow:auto;max-height:360px}.sd-table table{width:100%;border-collapse:collapse}.sd-table td,.sd-table th{text-align:left;padding:12px;border-bottom:1px solid #e6dfd6;white-space:nowrap}.sd-dashboard .section-head{gap:16px;flex-wrap:wrap}.sd-dashboard h2{font-size:24px}.sd-dashboard details{margin-top:14px}
@media(max-width:1050px){.sd-platforms{grid-template-columns:1fr}.sd-post{grid-template-columns:24px 70px minmax(0,1fr);gap:10px}}
@media(max-width:600px){.sd-post{grid-template-columns:24px minmax(0,1fr)}.sd-thumb{grid-column:2;width:90px;height:100px}.sd-post>div:last-child{grid-column:1/-1}.sd-switch button{padding:8px 12px}.sd-dashboard .panel{padding:18px}.sd-dashboard h2{font-size:21px}}
.editor-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:22px}.editor-media{min-width:0}.editor-media>img,.editor-media>video{display:block;width:100%;height:240px;object-fit:contain;background:#eee8df;border-radius:10px}.editor-eligibility{margin:16px 0;font-size:14px}.editor-media p{overflow-wrap:anywhere}#ai-editor .library-tabs{margin-bottom:22px}#editor-settings fieldset{margin:20px 0}#editor-settings fieldset .check{display:inline-flex;margin-right:18px}#editor-settings .social-source-list .check{display:flex}#ai-editor .social-kpis{margin:20px 0}#ai-editor input[type=checkbox]{width:auto}#ai-editor fieldset{min-width:0}#ai-editor .social-copy{white-space:pre-wrap}.editor-eligibility input{width:auto}
@media(max-width:720px){.editor-grid{grid-template-columns:1fr}}
.publication-record { display: grid; grid-template-columns: minmax(250px, 34%) minmax(0, 1fr); gap: 0; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--white); }
#publication-library .library-tools { display: grid; grid-template-columns: 1fr 1fr 2fr; gap: 16px; padding: 16px; }
#publication-library .library-tools label { min-width: 0; }
@media (max-width: 700px) { #publication-library .library-tools { grid-template-columns: 1fr; } }
.social-connection-compact { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 18px 24px; }
.publication-record > div { min-width: 0; }
.publication-records { display: grid; gap: 24px; margin-top: 20px; }
#social-studio #publication-library { padding: 24px; }
#publication-library > .section-head { margin: 0; }
#publication-library > .section-head h2 { margin: 0; }
#publication-library .library-tools { margin: 12px 0; padding: 10px 0; border: 0; border-radius: 0; }
#publication-library .library-tools label { margin: 0; }
.publication-visual { position: relative; background: #eae4db; display: flex; flex-direction: column; justify-content: center; min-height: 360px; }
.publication-visual a { display: block; }
#social-studio .publication-visual img, #social-studio .publication-visual video { display: block; width: 100%; height: 420px; max-height: none; object-fit: contain; border-radius: 0; }
.publication-format { position: absolute; top: 14px; left: 14px; background: #302a26dc; color: white; padding: 5px 12px; border-radius: 20px; z-index: 1; font-size: 12px; }
.publication-visual-hint { text-align: center; padding: 12px; color: #61554b; font-size: 12px; }
.publication-content { padding: 24px; }
.publication-meta { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13px; }
.publication-status { background: #f3e6d7; padding: 6px 10px; border-radius: 20px; font-weight: 600; }
.publication-status[data-state=published] { background: #e5efe3; color: #355d3c; }
.publication-status[data-state=failed], .publication-status[data-state=unknown] { background: #f6e0dc; color: #85332d; }
#publication-library .publication-content h3 { margin: 16px 0 4px; font-size: 23px; }
.publication-origin { font-size: 12px; color: var(--muted); margin: 0 0 14px; }
.publication-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 14px 0; }
.publication-dates dt, .publication-caption > span { color: var(--muted); font-size: 12px; }
.publication-dates > div { display: block; border: 0; padding: 0; }
.publication-dates dd { margin: 4px 0 0; font-size: 13px; }
.publication-caption { border-top: 1px solid var(--line); padding-top: 14px; }
.publication-caption p { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.65; max-height: 180px; overflow: auto; margin: 6px 0 14px; }
.publication-metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 6px; padding: 12px; border-radius: 10px; background: #f6f3ee; }
.publication-metrics div { display: flex; flex-direction: column; gap: 4px; }
.publication-metrics strong { font-size: 22px; }
.publication-metrics span { font-size: 12px; color: var(--muted); }
.publication-performance > p { font-size: 11px; color: var(--muted); margin: 8px 0; }
.publication-audit { font-size: 12px; margin-top: 12px; overflow-wrap: anywhere; }
#publication-library .social-kpis { margin: 14px 0; gap: 10px; }
#publication-library .social-kpis div { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; }
#publication-library .social-kpis strong { margin: 0; font-size: 22px; }
#publication-library > .actions { margin: 10px 0; }
#publication-library > .section-head p { margin: 6px 0; }
#publication-composer > summary { cursor: pointer; font-weight: 600; }
#publication-composer #social-publish { padding: 20px 0 0; margin: 0; border: 0; }
@media (max-width: 850px) { .publication-record { grid-template-columns: 1fr; } #social-studio .publication-visual img, #social-studio .publication-visual video { height: 360px; } .publication-content { padding: 18px; } }
@media (max-width: 500px) { .publication-dates { grid-template-columns: 1fr; } #publication-library .social-kpis { grid-template-columns: 1fr 1fr; } }

/* Render confirmation: keep details available without overwhelming the primary action. */
.render-reference-strip{display:flex;gap:8px;overflow:auto;margin:12px 0}
.render-reference-strip img{width:64px;height:64px;object-fit:contain;border:1px solid var(--border,#e5dfd5);border-radius:8px;background:white}
#video-content-details>summary,#video-production>details>summary{padding:14px 0;cursor:pointer}
.render-step-footer:has(#video-confirm-script:not([hidden])){position:sticky;bottom:0;background:var(--bg,#f8f5f0);padding:16px 0;border-top:1px solid #e5dfd5;z-index:2}
#video-film-quote{border:2px solid #87372e}
:root .video-next-dialog { width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: auto; border: 1px solid #e6ddd2; border-radius: 18px; padding: 28px; background: #faf8f5; color: #302b27; }
.video-next-dialog::backdrop { background: rgb(35 28 23 / 45%); }
.video-next-options { display: grid; gap: 14px; margin: 24px 0; }
.video-next-option > button { width: 100%; text-align: left; }
.video-next-tooltip { margin: 6px 2px 0; color: var(--muted, #6f6359); font-size: .9rem; line-height: 1.6; }
.style-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:16px; margin-bottom:24px; }
.style-card { display:flex; flex-direction:column; gap:6px; align-items:flex-start; padding:0 0 14px; text-align:left; background:var(--white); border:1px solid var(--line); border-radius:8px; overflow:hidden; min-width:0; }
.style-card.active { outline:3px solid #843329; }
.style-card img { width:100%; height:230px; object-fit:cover; object-position:top; display:block; }
.style-card strong, .style-card small, .style-card .pill { margin:0 14px; }
.style-detail dl { display:grid; grid-template-columns:minmax(90px,160px) 1fr; gap:8px 18px; margin:0 0 14px; }
.style-detail dt { color:var(--muted); }
.style-detail dd { margin:0; min-width:0; overflow-wrap:anywhere; }
.style-products { display:flex; flex-wrap:wrap; gap:8px; }
.doclist-label{margin-top:14px;padding:6px 2px;color:var(--muted);font-size:12px;border-top:1px solid var(--line)}
.article-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;flex-wrap:wrap;margin-bottom:6px}
.article-head h2{margin:0;flex:1 1 240px}
.article-head .actions{margin-top:0}
.wiki-editor{display:flex;flex-direction:column;gap:12px}
.we-bar{position:sticky;top:0;z-index:5;display:flex;align-items:center;gap:16px;flex-wrap:wrap;padding:14px 18px;background:var(--white);border:1px solid var(--line);border-radius:10px}
.we-heading{display:flex;flex-direction:column;gap:2px;flex:1 1 240px;min-width:0}
.we-heading small{color:var(--muted)}
.we-status{font-size:13px;padding:5px 11px;border-radius:999px;background:var(--sand);color:var(--muted)}
.we-status.is-dirty{background:#f6e7c8;color:#7a5412}
.we-status.is-saving{background:#e5e1f0;color:#4f4476}
.we-buttons{display:flex;gap:10px}
.we-help{font-size:13px;line-height:1.7;color:#6f6256}
.we-notice{padding:13px 16px;border-radius:8px;border:1px solid #ddcdbb;background:#ede5d8;color:#5f4f3d;font-size:14px;line-height:1.7}
.we-notice+.we-notice{margin-top:10px}
.we-notice.is-error{border-color:#d9a9a2;background:#f8e8e5;color:#7b2d26}
.we-notice.is-saved{border-color:#b6cfae;background:#e9f2e5;color:#35592b;margin-bottom:16px}
.we-notice .actions{margin-top:10px}
.we-notice small{display:block;margin-top:8px}
.we-panes{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}
.we-pane{display:flex;flex-direction:column;min-width:0}
.we-label{display:block;margin:0 0 7px;font-size:13px}
.we-toolbar{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:8px}
.we-toolbar button{padding:6px 10px;font-size:13px}
.wiki-editor .editor{flex:1;min-height:520px;font-size:15px;line-height:1.75;resize:vertical}
.we-preview{flex:1;min-height:520px;max-height:72vh;overflow:auto;padding:18px 20px;background:var(--white);border:1px solid var(--line);border-radius:8px}
.we-meta{padding:16px 18px;background:var(--white);border:1px solid var(--line);border-radius:10px}
.we-meta h3{margin:0 0 10px}
.we-meta-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 18px}
.we-wide{grid-column:1/-1}
.we-chips{display:flex;flex-wrap:wrap;gap:6px}
.we-chips:not(:empty){margin-bottom:8px}
.we-chip{display:inline-flex;align-items:center;gap:6px;padding:4px 6px 4px 11px;background:var(--sand);border-radius:999px;font-size:13px}
.we-chip button{padding:0 6px;border:0;background:none;line-height:1.5}
.we-results{display:flex;flex-direction:column;gap:4px;margin-top:6px}
.we-results button{text-align:left}
.we-version{padding:12px 0;border-top:1px solid var(--line)}
.we-version-head{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:8px}
.we-version-head small{color:var(--muted)}
.we-version-head button{margin-left:auto}
.we-version pre{max-height:220px;overflow:auto;white-space:pre-wrap}
@media(max-width:900px){.we-panes,.we-meta-grid{grid-template-columns:minmax(0,1fr)}.wiki-editor .editor,.we-preview{min-height:320px}.we-bar{position:static}}
.we-hint{margin:0 0 8px;font-size:12.5px;color:var(--muted)}
/* Phone-camera switches in step 8: one card per choice so each can be turned on or off on its own. */
.video-phone-look {margin:20px 0;padding:0;border:0;display:grid;gap:10px;}
.video-phone-look legend {color:var(--muted);margin-bottom:10px;}
.video-phone-toggle {position:relative;margin:0;display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:14px;padding:14px 16px;border:1px solid #e4ddd3;border-radius:10px;background:#fff;cursor:pointer;}
.video-phone-toggle input {position:absolute;opacity:0;pointer-events:none;}
.video-phone-toggle strong {display:block;}
.video-phone-toggle small {display:block;color:var(--muted);margin-top:2px;}
.video-phone-icon {display:grid;place-items:center;width:44px;height:44px;border-radius:10px;background:#f5efe6;color:#7a6a5a;}
.video-switch {width:44px;height:26px;border-radius:13px;background:#d9d0c4;position:relative;transition:background .15s;}
.video-switch::after {content:'';position:absolute;top:3px;left:3px;width:20px;height:20px;border-radius:50%;background:#fff;transition:transform .15s;box-shadow:0 1px 2px rgba(0,0,0,.2);}
.video-phone-toggle:has(input:checked) {border-color:#89392f;background:#fbf6f1;}
.video-phone-toggle:has(input:checked) .video-phone-icon {background:#89392f;color:#fff;}
.video-phone-toggle:has(input:checked) .video-switch {background:#89392f;}
.video-phone-toggle:has(input:checked) .video-switch::after {transform:translateX(18px);}
.video-phone-toggle:has(input:focus-visible) {outline:2px solid #89392f;outline-offset:2px;}
#video-phone-note:empty {display:none;}
#video-phone-note {margin:0;color:#89392f;}
/* "#video-chat label" is more specific than the card class and stacked the switch cards; this restores the row. */
#video-chat .video-phone-toggle {display:grid;margin:0;}
/* Video type cards reuse the phone-switch card look; the chosen one is filled. */
.video-type-picker {margin:0 0 20px;padding:0;border:0;display:grid;gap:10px;}
.video-type-picker legend {color:var(--muted);margin-bottom:10px;}
.video-type-card {width:100%;text-align:left;font:inherit;color:inherit;cursor:pointer;grid-template-columns:auto 1fr;}
.video-type-card[aria-pressed="true"] {border-color:#89392f;background:#fbf6f1;}
.video-type-card[aria-pressed="true"] .video-phone-icon {background:#89392f;color:#fff;}
.video-type-card:focus-visible {outline:2px solid #89392f;outline-offset:2px;}
.video-type-speech {padding:12px 14px;border-radius:10px;background:#f5efe6;}
.video-closing-line {margin:0 0 20px;padding:16px;border:1px solid #e4ddd3;border-radius:10px;display:grid;gap:12px;}
.video-closing-line legend {padding:0 6px;}
.video-closing-line [role=group] {display:flex;flex-wrap:wrap;gap:8px;}
.video-closing-line [aria-pressed="true"] {border-color:#89392f;background:#fbf6f1;color:#89392f;}
.video-product-name {display:grid;gap:8px;}
.video-product-name p {margin:0;}
.video-name-options {display:flex;flex-wrap:wrap;gap:8px;}
.video-name-actions {display:flex;flex-wrap:wrap;gap:8px;}
.video-name-actions button,.video-product-name p button {width:auto;}
.video-duration-picker {margin:0 0 20px;padding:0;border:0;}
.video-duration-picker legend {color:var(--muted);margin-bottom:10px;}
.video-duration-picker [role=group] {display:grid;grid-template-columns:repeat(4,1fr);gap:8px;}
.video-duration-picker [aria-pressed="true"] {border-color:#89392f;background:#fbf6f1;color:#89392f;font-weight:600;}
.video-logo-choices {display:grid;grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:8px;}
.video-logo-choices button {padding:8px;background:#f5efe6;border-radius:10px;}
.video-logo-choices img {display:block;width:100%;height:48px;object-fit:contain;}
.video-logo-choices [aria-pressed="true"] {outline:2px solid #89392f;outline-offset:1px;}
.video-end-card-titles {display:grid;grid-template-columns:repeat(4,1fr);gap:8px;}
.video-end-card-titles [aria-pressed="true"] {border-color:#89392f;background:#fbf6f1;color:#89392f;}
.video-end-card-preview {margin:12px 0;max-width:220px;}
.video-end-card-preview img {width:100%;border-radius:10px;display:block;}
/* Reminders and errors (Alex, 2026-11-07): a red band that shakes once, so nobody misses them. */
.reminder,[role="alert"]:not(:empty){display:block;margin:10px 0;padding:10px 14px;border-radius:10px;border:1px solid #d9534f;background:#fdecea;color:#9b1c1c;font-weight:600;animation:reminder-shake .45s ease-in-out 1;}
.field-reminder,.field-reminder:focus{box-shadow:0 0 0 3px #d9534f !important;border-color:#d9534f !important;border-radius:10px;animation:reminder-shake .45s ease-in-out 1;}
@keyframes reminder-shake{0%,100%{transform:translateX(0)}20%{transform:translateX(-6px)}40%{transform:translateX(6px)}60%{transform:translateX(-4px)}80%{transform:translateX(4px)}}
@media (prefers-reduced-motion: reduce){.reminder,[role="alert"]:not(:empty),.field-reminder{animation:none;}}
/* Era: two plain cards side by side, no dropdown (Alex, 2026-11-07). */
.video-era-cards {display:grid;grid-template-columns:1fr 1fr;gap:10px;}
.video-era-picker .video-type-card {grid-template-columns:1fr;align-items:start;height:100%;}
@media (max-width:560px){.video-era-cards{grid-template-columns:1fr;}}
.video-camera-cards {display:grid;grid-template-columns:repeat(3,1fr);gap:10px;}
@media (max-width:640px){.video-camera-cards{grid-template-columns:1fr 1fr;}}
.video-edit {margin-top:12px;padding:12px 14px;border:1px solid #e4ddd3;border-radius:10px;background:#fff;}
.video-edit summary {font-weight:600;cursor:pointer;}
.video-edit label {display:block;margin-top:10px;}
.video-edit-switch input {width:auto;margin-right:6px;}
.video-edit-quote {margin-top:12px;}
.video-ai-edit {margin:16px 0 0;padding:12px 0 0;border:0;border-top:1px solid #e4ddd3;}
.video-ai-edit legend {font-weight:600;padding:0;}
.video-ai-edit textarea {min-height:72px;}
.video-subtitle-picker .video-subtitle-language {margin-top:8px;}
.video-subtitle-translation {margin:12px 0;padding:10px 12px;border:1px solid var(--line, #ddd);border-radius:8px;}
.video-subtitle-translation summary {cursor:pointer;font-weight:600;}
.video-subtitle-translation ol {margin:8px 0 0;padding-left:1.4em;}
/* 訪談 Interview wizard */
#interview-chat .iv-row {display:flex;flex-wrap:wrap;gap:8px;margin:0 0 16px;}
#interview-chat .iv-row button[aria-pressed="true"],#interview-chat .iv-option[aria-pressed="true"] {border-color:#89392f;background:#fbf6f1;color:#89392f;}
#interview-chat .iv-options {display:grid;gap:8px;margin:12px 0 16px;}
#interview-chat .iv-option {display:grid;gap:4px;text-align:left;padding:12px 14px;border-radius:10px;}
#interview-chat .iv-option strong {font-size:12px;color:var(--muted);}
#interview-chat label {display:grid;gap:6px;margin:0 0 14px;}
#interview-chat textarea#iv-beats,#interview-chat textarea#iv-paste {font-family:ui-monospace,Menlo,monospace;font-size:13px;line-height:1.6;}
.iv-timeline {display:block;width:100%;height:24px;margin:8px 0 4px;}
.iv-ticks {width:100%;display:flex;justify-content:space-between;color:var(--muted);font-size:12px;margin-bottom:14px;}
.iv-cost {display:grid;grid-template-columns:1fr auto;gap:6px 16px;margin:0 0 12px;}
.iv-cost dd {margin:0;text-align:right;}
.iv-results {display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:12px;margin:12px 0;}
.iv-results video {width:100%;max-height:70vh;border-radius:10px;background:#000;}

#interview-chat .iv-edit {margin:8px 0 12px;}
#interview-chat .iv-edit ol {margin:6px 0 0;padding-left:1.4em;}
#interview-chat .iv-edit li {margin:2px 0;}
/* 訪談 redesign (2026-11-08): script rows with Emma's picture, director box, music, fixed settings */
#interview-chat .iv-ask {display:flex;gap:10px;align-items:flex-end;flex-wrap:wrap;margin:0 0 14px;}
#interview-chat .iv-ask .iv-grow {flex:1 1 280px;margin:0;}
#interview-chat .iv-ask input {flex:1 1 220px;}
#interview-chat .iv-side {display:grid;gap:8px;}
#interview-chat .iv-side .iv-row {margin:0;}
#interview-chat .iv-direction {min-height:150px;line-height:1.7;}
#interview-chat .iv-warn {color:#89392f;font-size:14px;align-self:center;}
#interview-chat .iv-beats {list-style:none;margin:0 0 14px;padding:0;}
#interview-chat .iv-beat {display:grid;grid-template-columns:56px 108px 150px minmax(0,1fr);gap:10px;align-items:start;padding:10px 0;border-top:1px solid var(--line,#e6ddd0);}
#interview-chat .iv-pic {width:56px;height:76px;border-radius:6px;object-fit:cover;background:#f3ede6;display:flex;align-items:center;justify-content:center;color:#89392f;font-size:13px;}
#interview-chat .iv-pic-new {border:1px dashed #c9b6a6;}
#interview-chat .iv-pic-wait .video-loading-spinner {width:20px;height:20px;}
#interview-chat .iv-time {font-size:14px;white-space:nowrap;display:flex;align-items:center;gap:2px;padding-top:6px;}
#interview-chat .iv-time input {width:62px;padding:4px 6px;}
#interview-chat .iv-beat select {width:100%;}
#interview-chat .iv-line {display:grid;gap:4px;}
#interview-chat .iv-say {display:flex;gap:6px;align-items:center;}
#interview-chat .iv-say input {flex:1;min-width:0;}
#interview-chat .iv-star {color:#c47a52;}
#interview-chat .iv-line small {color:var(--muted);font-size:13px;}
#interview-chat .iv-link {border:none;background:none;padding:0;color:#89392f;text-decoration:underline;font-size:13px;justify-self:start;cursor:pointer;}
#interview-chat .iv-redo {display:grid;gap:6px;margin-top:4px;}
#interview-chat .iv-redo .actions {margin:0;}
#interview-chat .iv-quote-box {display:flex;justify-content:space-between;align-items:center;gap:12px;padding:10px 14px;margin:10px 0;border-radius:10px;background:#fbf3e6;color:#6b4a12;}
#interview-chat .iv-music {border:1px solid var(--line,#e6ddd0);border-radius:10px;padding:10px 14px;margin:14px 0;}
#interview-chat .iv-music legend {padding:0 6px;font-weight:600;}
#interview-chat .iv-music-item {display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:10px;align-items:center;margin:0;padding:6px 0;}
#interview-chat .iv-music-item small {display:block;color:var(--muted);font-size:12px;}
#interview-chat .iv-music-item audio {height:32px;max-width:220px;}
#interview-chat .iv-music-new {margin-top:8px;}
#interview-chat .iv-wait {display:flex;gap:10px;align-items:center;margin:8px 0 0;}
#interview-chat .iv-wait .video-loading-spinner {width:18px;height:18px;}
#interview-chat .iv-fixed {color:#9a948c;font-size:14px;margin:6px 0 12px;}
@media (max-width:640px){#interview-chat .iv-beat {grid-template-columns:56px minmax(0,1fr);}#interview-chat .iv-beat select,#interview-chat .iv-line {grid-column:2;}#interview-chat .iv-music-item {grid-template-columns:auto minmax(0,1fr);}#interview-chat .iv-music-item audio {grid-column:2;}}
#interview-chat .iv-busy {display:inline-flex;align-items:center;gap:8px;}
#interview-chat .iv-busy .video-loading-spinner {width:16px;height:16px;border-width:2px;border-color:rgba(255,255,255,.5);border-top-color:#fff;}
#interview-chat .iv-pic-wrap {display:block;cursor:zoom-in;border-radius:6px;}
#interview-chat .iv-pic-wrap:focus-visible {outline:2px solid #89392f;outline-offset:2px;}
#interview-chat .iv-pic-big {display:none;position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);height:min(82vh,720px);width:auto;max-width:90vw;object-fit:contain;border-radius:12px;box-shadow:0 12px 40px rgba(0,0,0,.35);background:#000;z-index:1000;pointer-events:none;}
#interview-chat .iv-pic-wrap:hover .iv-pic-big,#interview-chat .iv-pic-wrap:focus .iv-pic-big {display:block;}
#interview-chat .iv-cam {display:inline-flex;align-items:center;gap:6px;margin:0;font-size:13px;color:var(--muted);}
#interview-chat .iv-cam input {margin:0;}
#interview-chat button.iv-busy:not(.primary) .video-loading-spinner {width:16px;height:16px;border-width:2px;border-color:#d8c4b8;border-top-color:#87372e;}
#interview-chat #iv-status {position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;}
#interview-chat label.iv-cam {display:inline-flex;justify-self:start;width:auto;white-space:nowrap;}
#interview-chat label.iv-cam input {width:auto;flex:none;height:auto;min-height:0;}

/* Brand setup (Mirasona): the steps on the left, the current step on the right. */
.setup {display:grid;grid-template-columns:260px 1fr;gap:22px;align-items:start;}
.setup-steps {list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px;counter-reset:step;}
.setup-steps button {width:100%;display:flex;align-items:center;gap:12px;text-align:left;line-height:1.4;}
.setup-steps button.active {background:#eee4d8;border-color:#b79b85;}
.setup-steps small {display:block;color:var(--muted);font-size:12px;}
.setup-mark {flex:none;width:22px;height:22px;border-radius:50%;border:1.5px solid #c9b8a8;display:grid;place-items:center;font-size:12px;color:var(--white);}
.setup-mark.done {background:#60704e;border-color:#60704e;}
.setup-current h2 {margin-top:0;}
.setup-form {display:flex;flex-direction:column;gap:14px;}
.setup-form label {display:flex;flex-direction:column;gap:6px;}
.setup-form label.check {flex-direction:row;align-items:center;}
.setup-form input:not([type=checkbox]),.setup-form select,.setup-form textarea {border:1px solid var(--line);border-radius:7px;padding:9px 11px;background:var(--white);}
.setup-row {display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:14px;}
.setup-tracks {margin:0 0 14px;padding-left:18px;color:var(--muted);}
.setup-finished {color:#60704e;font-weight:600;}
@media (max-width:760px){.setup{grid-template-columns:1fr;}}
.mirasona-link {display:block;margin-top:8px;font-size:12px;color:var(--red);text-decoration:none;}
.mirasona-link:hover {text-decoration:underline;}
.setup-site {margin-top:22px;display:flex;flex-direction:column;gap:22px;}
.setup-site h2 {margin:0;}
.setup-site fieldset {border:0;padding:0;margin:0;gap:14px;}
.setup-site legend {margin-bottom:6px;}
.setup-warn {color:var(--red);margin:0;}
.listing-pictures {margin-top:22px;display:flex;flex-direction:column;gap:16px;}
.listing-pictures h2 {margin:0;}
.listing-specs {display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:10px;align-items:end;}
.listing-specs label {display:flex;flex-direction:column;gap:4px;font-size:13px;}
.listing-photos {display:flex;gap:8px;flex-wrap:wrap;}
.listing-photos label {cursor:pointer;}
.listing-photos input {position:absolute;opacity:0;}
.listing-photos img {width:72px;height:72px;object-fit:contain;background:#fff;border:2px solid transparent;border-radius:6px;}
.listing-photos input:checked + img {border-color:var(--red);}
.listing-crop {position:relative;max-width:420px;touch-action:none;user-select:none;}
.listing-crop img {display:block;width:100%;cursor:crosshair;background:#fff;}
.listing-box {position:absolute;border:2px dashed var(--red);background:rgba(255,255,255,.12);pointer-events:none;}
.listing-controls {display:flex;flex-wrap:wrap;gap:14px;align-items:center;}
.listing-controls [role=group] {display:flex;gap:8px;align-items:center;}
.listing-controls [aria-pressed=true] {background:#eee4d8;border-color:#b79b85;}
.listing-results {display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:10px;}
.listing-results a {display:flex;flex-direction:column;gap:4px;font-size:12px;color:inherit;text-decoration:none;}
.listing-results img {width:100%;aspect-ratio:1;object-fit:contain;background:#fff;border:1px solid #e5ddd3;}
.article-products {display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:6px;max-height:220px;overflow:auto;border:1px solid #e5ddd3;border-radius:8px;padding:10px;}
.article-result {margin-top:18px;display:flex;flex-direction:column;gap:10px;}
.article-body {white-space:pre-wrap;line-height:1.6;}
.article-sources {font-size:13px;color:var(--muted);padding-left:22px;}
.article-earlier {margin-top:10px;}
/* Two characters (2026-11-10): whose settings, styles, notes, poses or pictures are shown. */
.character-tabs {display:flex;flex-wrap:wrap;gap:8px;margin:0 0 18px;}
.character-tabs button {display:flex;flex-direction:column;align-items:flex-start;gap:2px;line-height:1.3;min-width:120px;text-align:left;}
.character-tabs button.active {background:#eee4d8;border-color:#b79b85;}
.character-tabs small {color:var(--muted);font-size:12px;}
.setup-looks {border:0;padding:0;margin:0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;}
.setup-looks legend {margin-bottom:6px;}
.setup-form label.setup-look {flex-direction:row;align-items:center;gap:10px;border:1px solid var(--line);border-radius:10px;padding:16px;cursor:pointer;font-weight:600;}
.setup-form label.setup-look:has(input:checked) {background:#eee4d8;border-color:#b79b85;}
.setup-look-fixed {margin:0;color:var(--muted);}
.setup-remove {margin-top:22px;border-top:1px solid var(--line);padding-top:14px;}
.setup-remove summary {cursor:pointer;color:var(--red);}
.setup-remove .setup-form {margin-top:12px;}
button.danger {background:var(--red);border-color:var(--red);color:var(--white);}
.setup-form [hidden] {display:none !important;}
@media (max-width:640px){.setup-looks{grid-template-columns:1fr;}}
.style-pick {border:0;padding:0;margin:0;}
.style-pick .gallery {grid-template-columns:repeat(auto-fill,minmax(90px,1fr));max-height:320px;overflow:auto;}
.style-pick label.pick {position:relative;flex-direction:column;cursor:pointer;}
.style-pick label.pick input {position:absolute;top:6px;left:6px;}
.style-pick label.pick img {width:100%;aspect-ratio:1;object-fit:cover;border-radius:7px;border:2px solid transparent;}
.style-pick label.pick:has(input:checked) img {border-color:#b79b85;}
.setup-add {max-width:680px;}
.setup-form label.setup-look input {flex:none;width:auto;margin:0;padding:0;border:0;background:none;}
.setup-form label.setup-look span {flex:1;white-space:nowrap;}
.character-choices .character-choice {display:flex;flex-direction:column;gap:6px;align-items:flex-start;}
.character-choices .character-choice img,.character-choice-empty {width:100%;aspect-ratio:3/4;object-fit:cover;border-radius:8px;background:#eee4d8;display:block;}
.character-choices .character-choice small {color:var(--muted);font-size:12px;}
.character-choices .character-choice[disabled] {opacity:.55;cursor:not-allowed;}

/* Where a size works best, under each size choice (aspect-ratios.js ratioUses) */
.ratio-use{display:block;margin-top:2px;font-style:normal;font-size:11px;line-height:1.3;color:#80776e}

/* 參考圖與指引 (public/guide-picker.js): up to two of the person's own pictures, each with what to take from it. */
.guide-refs {display:grid;gap:10px;margin:14px 0;}
.guide-ref {display:grid;grid-template-columns:96px 1fr auto;gap:10px;align-items:start;}
.guide-ref img {width:96px;height:96px;object-fit:cover;border-radius:6px;background:#eee;}
.guide-ref textarea {min-height:96px;}
.guide-add {display:inline-flex;align-items:center;justify-content:center;width:max-content;padding:8px 14px;border:1px dashed #b79b85;border-radius:6px;cursor:pointer;}
@media (max-width:600px){.guide-ref{grid-template-columns:72px 1fr}.guide-ref img{width:72px;height:72px}.guide-ref button{grid-column:2}}
/* 品牌設定 → 表情照片: the character's own expression photos, large on hover or tap (like the 訪談 pictures). */
.setup-expressions {display:grid;grid-template-columns:repeat(auto-fill,minmax(96px,1fr));gap:10px;margin-top:14px;}
.setup-expression {margin:0;outline:none;}
.setup-expression img:first-child {width:100%;aspect-ratio:2/3;object-fit:cover;border-radius:8px;display:block;}
.setup-expression figcaption {font-size:12px;text-align:center;margin-top:4px;}
.setup-expression-big {display:none;position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);height:min(82vh,720px);width:auto;max-width:90vw;object-fit:contain;border-radius:12px;box-shadow:0 12px 40px rgba(0,0,0,.35);z-index:50;pointer-events:none;}
.setup-expression:hover .setup-expression-big,.setup-expression:focus .setup-expression-big {display:block;}
/* 書籍知識庫 (library-ui.js) */
.library-toolbar { display:flex; flex-wrap:wrap; gap:8px; }
.library-toolbar input[type=search] { flex:1 1 260px; min-width:0; }
.library .library-row { display:flex; gap:10px; align-items:flex-start; text-align:left; }
.library .library-row small { display:block; color:var(--muted); }
.library .pill { white-space:nowrap; flex:none; }
.library-original { white-space:pre-wrap; background:#f7f3ec; border:1px solid var(--line); border-radius:8px; padding:14px; line-height:1.8; }
.library-quote { font-size:1.15rem; line-height:1.7; }
.library-links { list-style:none; padding-left:0; display:grid; gap:4px; }
.library-chapters li { margin-bottom:6px; }
.library-cover { max-width:160px; border-radius:6px; border:1px solid var(--line); }
.library-link-form { display:flex; gap:8px; margin-top:12px; }
.library-link-form input { flex:1; min-width:0; }
button.link { background:none; border:0; padding:0; color:inherit; text-decoration:underline; cursor:pointer; }
.library-add, .library-jobs { margin-bottom:16px; }
.library-jobs p { margin:6px 0; }
/* Social accounts per country (social-studio.js) */
.social-countries { display:grid; grid-template-columns:repeat(auto-fit,minmax(280px,1fr)); gap:16px; align-items:start; }
.social-country h2 { font-size:1.15rem; margin:0; }
.social-country .social-row { display:grid; grid-template-columns:36px 1fr auto; gap:10px; align-items:center; padding:10px 0; border-top:1px solid var(--line); }
.social-country .social-row .actions { margin:0; gap:6px; flex-wrap:wrap; justify-content:flex-end; }
.social-avatar { width:32px; height:32px; border-radius:50%; object-fit:cover; }
.social-country-menu { position:relative; }
.social-country-menu > summary { list-style:none; cursor:pointer; padding:2px 8px; border-radius:6px; }
.social-country-menu[open] > :not(summary) { display:block; margin-top:6px; }
.social-country-add { display:grid; gap:10px; align-content:start; }

.social-country .social-row > span:nth-child(2) { min-width:0; overflow-wrap:anywhere; }
.social-country .social-row strong { white-space:nowrap; }
.social-country .social-row button { padding:6px 10px; font-size:13px; }
/* Platform marks (platform-icons.js): brand colour on a light tile; Threads follows the text colour. */
.platform-icon { display:inline-grid; place-items:center; flex:none; border-radius:8px; background:var(--sand); color:var(--ink); font-weight:700; line-height:1; }
.platform-icon svg { display:block; }
.platform-icon-sm { width:22px; height:22px; border-radius:6px; font-size:11px; }
.platform-icon-sm svg { width:14px; height:14px; }
.platform-icon-md { width:36px; height:36px; border-radius:10px; font-size:15px; }
.platform-icon-md svg { width:20px; height:20px; }
.platform-facebook { color:#0866FF; background:#0866FF14; }
.platform-instagram { color:#E4405F; background:#E4405F14; }
.platform-threads { color:var(--ink); background:#302a2612; }
.platform-linkedin { color:#0A66C2; background:#0A66C214; }
.platform-youtube { color:#FF0000; background:#FF000012; }
.platform-label { display:inline-flex; align-items:center; gap:8px; vertical-align:middle; }
.social-country .social-row { grid-template-columns:36px minmax(0,1fr) auto; column-gap:12px; }
.social-row .social-avatar-sm { width:18px; height:18px; border-radius:50%; object-fit:cover; vertical-align:-4px; margin-right:6px; }
.social-account-cards { display:grid; gap:8px; }
.social-account-card { display:flex; align-items:center; gap:10px; text-align:left; padding:10px 12px; }
.social-account-card[aria-pressed=true] { border-color:var(--red); box-shadow:0 0 0 1px var(--red) inset; }
.sd-switch .platform-label { gap:6px; }
/* 社群設定 (social-studio.js): head with 「＋ 新增國家」, a card per country, a tile per platform. */
.page-head.social-head { display:flex; flex-wrap:wrap; align-items:flex-end; gap:12px 24px; margin-bottom:24px; }
.page-head.social-head .eyebrow { flex-basis:100%; }
.page-head.social-head h1 { margin:0; flex:1 1 auto; }
.page-head-actions { display:flex; gap:8px; flex-wrap:wrap; align-items:center; position:relative; }
.social-add { position:relative; }
.social-add > summary { list-style:none; cursor:pointer; }
.social-add > summary::-webkit-details-marker, .social-menu > summary::-webkit-details-marker { display:none; }
summary.button.primary { display:inline-block; padding:10px 16px; border-radius:7px; background:var(--red); color:var(--white); border:1px solid var(--red); }
.social-add-list { position:absolute; right:0; top:calc(100% + 6px); z-index:20; display:grid; gap:4px; min-width:180px; max-height:320px; overflow:auto; padding:8px; background:var(--white); border:1px solid var(--line); border-radius:9px; box-shadow:0 8px 24px #302a261f; }
.social-add-list button { text-align:left; border:0; }
.social-locked { display:flex; align-items:center; gap:8px; margin:0 0 18px; padding:12px 16px; border-radius:9px; background:var(--sand); color:var(--ink); }
.social-lock { width:14px; height:14px; flex:none; }
button .social-lock { margin-right:6px; vertical-align:-2px; }
.social-countries { display:grid; grid-template-columns:1fr; gap:20px; }
.social-country { padding:24px; }
.social-country-head { display:flex; align-items:center; gap:12px; margin-bottom:18px; }
.social-flag { font-size:2.2rem; line-height:1; }
.social-country-head h2 { margin:0; font-size:1.35rem; }
.social-country-tools { margin-left:auto; display:flex; align-items:center; gap:8px; }
.social-platforms { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.social-platform-tile { display:grid; grid-template-columns:36px minmax(0,1fr) auto; align-items:center; column-gap:14px; padding:14px 16px; border:1px solid var(--line); border-radius:9px; background:var(--paper); }
.social-platform-info { min-width:0; display:grid; gap:3px; }
.social-platform-info strong { white-space:nowrap; }
.social-status { color:var(--muted); font-size:13px; overflow-wrap:anywhere; }
.social-status.on { color:var(--ink); }
.social-status > span { display:block; color:var(--muted); white-space:nowrap; }
.social-status.on > span::before { content:'● '; color:#2e7d4f; }
.social-platform-actions { display:flex; align-items:center; gap:6px; }
.social-platform-actions button, .social-country-tools button { padding:7px 12px; font-size:13px; }
button.secondary { background:var(--white); border-color:#c9bba9; }
button.quiet { background:none; border-color:transparent; color:var(--red); }
.social-menu { position:relative; }
.social-menu > summary { list-style:none; cursor:pointer; padding:4px 10px; border-radius:7px; color:var(--muted); }
.social-menu > summary:hover { background:var(--sand); }
.social-menu-body { position:absolute; right:0; top:calc(100% + 4px); z-index:20; display:grid; gap:6px; min-width:160px; padding:10px; background:var(--white); border:1px solid var(--line); border-radius:9px; box-shadow:0 8px 24px #302a261f; }
.social-menu-body > label, .social-menu-body > button { white-space:nowrap; }
@media (max-width: 760px) {
  .social-platforms { grid-template-columns:1fr; }
  .social-country { padding:18px; }
  .social-flag { font-size:1.8rem; }
}
.bk-empty { max-width:560px; padding:40px 0; }
.bk-empty p { color:var(--muted); margin:8px 0 20px; }
.library-mark { margin-right:10px; color:var(--red); font-family:inherit; }

/* 書籍知識庫 reading library (library-ui.js, 2026-11-15): home shelf, book page, chapter reading page. */
.bk { max-width: 1080px; }
.bk-head { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.bk-head h1 { margin:0; }
.bk-search { display:flex; gap:8px; margin:18px 0 10px; }
.bk-search input { flex:1; min-width:0; font-size:17px; padding:14px 18px; border:1px solid var(--line); border-radius:12px; background:var(--white); }
.bk-search button { white-space:nowrap; border-radius:12px; }
.bk-search button.active { border-color:var(--red); color:var(--red); }
.bk-filters { display:flex; flex-wrap:wrap; gap:8px; align-items:center; padding:12px; margin-bottom:12px; background:var(--white); border:1px solid var(--line); border-radius:12px; }
.bk-filters select { min-width:0; max-width:100%; flex:1 1 160px; }
.bk-shelf { display:grid; grid-template-columns:repeat(auto-fill,minmax(180px,1fr)); gap:24px; margin-top:18px; }
.bk-book { display:flex; flex-direction:column; gap:4px; text-align:left; padding:0; border:0; background:none; }
.bk-book:hover { background:none; }
.bk-book:hover .bk-cover { transform:translateY(-3px); box-shadow:0 10px 24px rgba(48,42,38,.18); }
.bk-book strong { font-family:Georgia,"Songti TC",serif; font-size:17px; font-weight:400; margin-top:10px; line-height:1.4; }
.bk-book span { color:var(--ink); font-size:13px; }
.bk-book small { font-size:12px; }
.bk-cover { display:block; width:100%; aspect-ratio:2/3; object-fit:cover; border-radius:4px 8px 8px 4px; border:1px solid var(--line); box-shadow:0 4px 14px rgba(48,42,38,.12); transition:transform .15s, box-shadow .15s; background:var(--sand); }
.bk-cover-blank { display:flex; flex-direction:column; justify-content:space-between; padding:18px 16px; background:linear-gradient(160deg,var(--red),#5e231f); color:var(--paper); border:0; border-left:6px solid rgba(0,0,0,.18); }
.bk-cover-blank span, .bk-book .bk-cover-blank span { color:var(--paper); font-family:Georgia,"Songti TC",serif; font-size:21px; line-height:1.35; overflow-wrap:anywhere; }
.bk-cover-blank small, .bk-book .bk-cover-blank small { color:rgba(247,245,240,.75); font-size:12px; }
.bk-cover-large { width:200px; flex:none; }
.bk-counts { display:flex; flex-wrap:wrap; gap:8px; margin:6px 0 4px; }
.bk-counts button, .bk-tabs button { padding:7px 14px; border-radius:999px; font-size:13px; }
.bk-counts b, .bk-tabs b { font-weight:500; color:var(--muted); margin-left:2px; }
.bk-group { margin-top:22px; }
.bk-group h2, .bk-section h2 { font-size:20px; margin:0 0 10px; }
.bk-count { font-family:-apple-system,BlinkMacSystemFont,"PingFang TC",sans-serif; font-size:13px; color:var(--muted); margin-left:6px; }
.bk-rows { display:grid; gap:8px; }
.bk-row, .bk-card { display:flex; flex-direction:column; gap:3px; text-align:left; padding:12px 16px; border-radius:10px; }
.bk-row strong, .bk-card strong { font-weight:500; }
.bk-row span, .bk-card span { color:var(--ink); opacity:.8; font-size:13px; line-height:1.6; }
.bk-row small, .bk-card small { font-size:12px; }
.bk-more { margin-top:8px; }
.bk-none { margin-top:24px; }
.bk-quotes { display:grid; grid-template-columns:repeat(auto-fill,minmax(260px,1fr)); gap:10px; }
.bk-quote { text-align:left; padding:16px 18px; border-radius:10px; background:var(--white); border-left:3px solid var(--red); }
.bk-quote blockquote { margin:0 0 8px; font-family:Georgia,"Songti TC",serif; font-size:16px; line-height:1.7; }
.bk-quote small { font-size:12px; }
.bk-crumbs { display:flex; flex-wrap:wrap; align-items:center; gap:4px 8px; font-size:13px; color:var(--muted); margin-bottom:18px; }
.bk-crumbs .link { padding:0; border:0; background:none; color:var(--muted); }
.bk-crumbs .link:hover { color:var(--red); }
.bk-crumbs [aria-current] { color:var(--ink); }
.bk-sep { color:var(--line); }
.bk-book-head { display:flex; gap:32px; align-items:flex-start; margin-bottom:24px; }
.bk-book-info { flex:1; min-width:0; }
.bk-book-info h1 { margin:4px 0 6px; }
.bk-authors { margin:0 0 14px; font-size:15px; }
.bk-facts { display:grid; grid-template-columns:max-content 1fr; gap:8px 18px; margin:0 0 14px; }
.bk-facts dt { color:var(--muted); font-size:13px; padding-top:2px; }
.bk-facts dd { margin:0; line-height:1.7; }
.bk-kicker { display:flex; align-items:center; gap:10px; flex-wrap:wrap; color:var(--muted); font-size:13px; letter-spacing:.3px; }
.bk-kicker button { margin-left:auto; padding:6px 14px; }
.bk-version { font-size:12px; opacity:.7; }
.bk-badge { display:inline-block; padding:2px 10px; border-radius:999px; background:#f6e7c8; color:#7a5a17; font-size:12px; border:1px solid #e6cf9b; }
.bk-badge-button { padding:4px 12px; cursor:pointer; }
.bk-badge-button:hover, .bk-badge-button[aria-pressed=true] { background:#f0dcae; border-color:#c9a65a; }
.bk-tabs { display:flex; gap:8px; flex-wrap:wrap; border-bottom:1px solid var(--line); padding-bottom:12px; margin-bottom:16px; }
.bk-tabs [aria-selected=true] { background:var(--ink); color:var(--paper); border-color:var(--ink); }
.bk-tabs [aria-selected=true] b { color:inherit; opacity:.7; }
.bk-part { font-family:Georgia,"Songti TC",serif; font-size:18px; font-weight:400; color:var(--red); margin:22px 0 8px; }
.bk-toc { list-style:none; padding:0; margin:0; }
.bk-toc button { display:flex; align-items:baseline; gap:14px; width:100%; text-align:left; border:0; border-bottom:1px solid var(--line); border-radius:0; background:none; padding:12px 4px; }
.bk-toc button:hover { background:#f1ece4; }
.bk-num { font-family:Georgia,serif; font-size:18px; color:var(--muted); min-width:28px; text-align:right; }
.bk-toc-text { flex:1; min-width:0; display:flex; flex-direction:column; gap:2px; }
.bk-toc-text strong { font-weight:500; }
.bk-toc-text span { color:var(--muted); font-size:13px; line-height:1.6; }
.bk-toc small { white-space:nowrap; font-size:12px; }
.bk-read { max-width:720px; }
.bk-read > h1 { margin:6px 0 10px; line-height:1.3; }
.bk-read > p { font-size:15px; line-height:1.95; }
.bk-lead { font-family:Georgia,"Songti TC",serif; font-size:20px !important; line-height:1.7 !important; color:var(--ink); border-left:3px solid var(--red); padding-left:16px; margin:0 0 18px; }
.bk-section { margin-top:30px; }
.bk-section p { font-size:15px; line-height:1.9; }
.bk-takeaways ol { counter-reset:take; list-style:none; padding:0; margin:0; display:grid; gap:10px; }
.bk-takeaways li { counter-increment:take; position:relative; padding-left:40px; line-height:1.8; font-size:15px; }
.bk-takeaways li::before { content:counter(take); position:absolute; left:0; top:1px; width:26px; height:26px; border-radius:50%; background:var(--sand); color:var(--red); font-family:Georgia,serif; display:flex; align-items:center; justify-content:center; font-size:14px; }
.bk-chips { display:flex; flex-wrap:wrap; gap:8px; }
.bk-chip { padding:7px 14px; border-radius:999px; font-size:13px; text-align:left; line-height:1.5; }
.bk-chip-static { border:1px solid var(--line); background:var(--white); }
.bk-cards { display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:10px; }
.bk-angles { list-style:none; padding:0; margin:0; display:grid; gap:8px; }
.bk-angles li { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 16px; background:var(--white); border:1px solid var(--line); border-radius:10px; }
.bk-angles button { white-space:nowrap; padding:8px 14px; font-size:13px; }
.bk-page { margin-top:12px; }
.bk-page small { display:block; margin-bottom:4px; }
.bk-pager { display:flex; justify-content:space-between; gap:12px; margin-top:36px; padding-top:18px; border-top:1px solid var(--line); }
.bk-pager button { display:flex; flex-direction:column; gap:2px; text-align:left; max-width:48%; }
.bk-pager .bk-next { text-align:right; margin-left:auto; }
.bk-pager small { font-size:12px; }
.bk-quote-big { font-family:Georgia,"Songti TC",serif; font-size:26px; line-height:1.6; margin:10px 0 16px; padding-left:20px; border-left:3px solid var(--red); }
.bk-places { padding-left:18px; line-height:1.9; }
.bk-places .link { padding:0; border:0; background:none; text-align:left; color:var(--ink); text-decoration:underline; text-decoration-color:var(--line); }
.bk-history { margin-top:32px; color:var(--muted); font-size:13px; }
.bk-edit { margin-top:12px; }
.bk-edit-cover { display:block; width:90px; margin:6px 0; border-radius:4px; border:1px solid var(--line); }
@media (max-width:700px) {
  .bk-book-head { flex-direction:column; gap:18px; }
  .bk-cover-large { width:140px; }
  .bk-shelf { grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
  .bk-facts { grid-template-columns:1fr; gap:2px; }
  .bk-facts dd { margin-bottom:8px; }
  .bk-angles li { flex-direction:column; align-items:stretch; }
  .bk-lead { font-size:18px !important; }
  .bk-quote-big { font-size:21px; }
  .bk-pager { flex-direction:column; }
  .bk-pager button { max-width:none; }
  .bk-search input { font-size:16px; padding:12px 14px; }
}
.bk-more-chips { margin-top:8px; }
.bk-more-chips summary { cursor:pointer; color:var(--muted); font-size:13px; margin-bottom:8px; }
/* Video wizard 選擇主題 (knowledge route only): the chosen topic shows as chosen. */
.video-topic-ideas, .video-topic-list { display:flex; flex-wrap:wrap; gap:8px; margin:10px 0; }
.video-topic-ideas button, .video-topic-list button { padding:8px 14px; border-radius:999px; font-size:13px; text-align:left; }
.video-topic-list [aria-pressed=true] { background:#eee3d6; border-color:#843329; color:#843329; }
.library-empty { max-width:560px; padding:40px 0; }
.library-empty p { color:var(--muted); margin:8px 0 20px; }

/* Chat mode (對話模式, chat-mode.js): the same modal, tokens, cards, chips and buttons as the wizards. */
#modal:has(#creative-chat) { max-width: 1180px; width: 94%; }
.mode-switch { display: inline-flex; gap: 4px; padding: 4px; margin: 2px 0 18px; width: fit-content; background: #eee8df; border-radius: 24px; }
.mode-switch button { display: inline-flex; align-items: center; gap: 7px; padding: 8px 16px; border: 0; border-radius: 20px; background: transparent; color: #75695e; }
.mode-switch button:hover { background: #e6ddd1; }
.mode-switch button[aria-pressed=true] { background: var(--white); color: var(--red); box-shadow: 0 1px 3px rgb(48 42 38 / 12%); }
.mode-switch svg { flex: none; }
.chat-mode { display: flex; flex-direction: column; height: calc(92vh - 80px); min-height: 520px; }
.chat-mode h2 { margin-bottom: 12px; }
.chat-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.chat-head .mode-switch { margin: 0; }
.chat-head button, .chat-composer-actions button { display: inline-flex; align-items: center; gap: 6px; }
.chat-panel-toggle { display: none !important; }
.chat-layout { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 18px; align-items: stretch; }
.chat-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--white); overflow: hidden; }
.chat-main.dragging { outline: 2px dashed #b69b86; outline-offset: -6px; }
.chat-thread { flex: 1; min-height: 0; overflow-y: auto; padding: 22px 22px 8px; scroll-behavior: smooth; }
.chat-history { flex: 1; min-height: 0; overflow-y: auto; }
.chat-msg { display: flex; gap: 10px; margin: 0 0 14px; }
.chat-msg.user { justify-content: flex-end; }
.chat-bubble { max-width: 78%; padding: 11px 15px; border-radius: 14px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; background: #f4efe7; }
.chat-msg.user .chat-bubble { background: #ede3d6; border-bottom-right-radius: 4px; }
.chat-msg.ai .chat-bubble { border-bottom-left-radius: 4px; }
.chat-avatar { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #f1dfda; color: var(--red); }
.chat-ai-body { display: flex; flex-direction: column; gap: 10px; min-width: 0; flex: 1; align-items: flex-start; }
.chat-ai-body .chat-bubble { max-width: 90%; }
.chat-question p { margin: 0 0 6px; color: var(--ink); }
.chat-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chat-chip { padding: 7px 13px; border-radius: 18px; border-color: #dccbb8; background: var(--white); color: #6e5a4b; }
.chat-chip:hover:not(:disabled) { border-color: var(--red); color: var(--red); background: #fbf6f2; }
.chat-typing { display: inline-flex; align-items: center; gap: 4px; }
.chat-typing span { width: 6px; height: 6px; border-radius: 50%; background: #b69b86; animation: chat-dot 1.2s infinite ease-in-out; }
.chat-typing span:nth-child(2) { animation-delay: .15s; } .chat-typing span:nth-child(3) { animation-delay: .3s; }
.chat-typing em { font-style: normal; color: var(--muted); font-size: 12px; margin-left: 6px; }
@keyframes chat-dot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .chat-typing span { animation: none; } .chat-thread { scroll-behavior: auto; } }
.chat-error { margin: 6px 0 12px; }
.chat-empty { height: 100%; min-height: 260px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px; color: var(--muted); }
.chat-empty-icon { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: #f1dfda; color: var(--red); margin-bottom: 8px; }
.chat-empty h3 { font-family: Georgia, "Songti TC", serif; font-size: 21px; font-weight: 400; color: var(--ink); margin-bottom: 12px; }
.chat-empty .chat-chips { justify-content: center; }
.chat-composer { border-top: 1px solid var(--line); padding: 12px 14px; background: #fcfaf6; }
.chat-composer textarea { border: 0; background: transparent; resize: none; padding: 6px 4px; min-height: 44px; max-height: 180px; line-height: 1.6; }
.chat-composer textarea:focus { outline: none; }
.chat-composer:focus-within { box-shadow: inset 0 2px 0 #e9d5cc; }
.chat-composer-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chat-composer-actions button { padding: 8px 12px; }
.chat-spacer { flex: 1; }
.chat-refs { list-style: none; display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 10px; margin: 0; }
.chat-ref { position: relative; flex: none; display: flex; gap: 8px; align-items: center; padding: 5px 30px 5px 5px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); max-width: 220px; }
.chat-ref img, .chat-ref .chat-ref-glyph { width: 44px; height: 44px; border-radius: 7px; object-fit: cover; flex: none; }
.chat-ref > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.chat-ref-name { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px; }
.chat-ref select { padding: 2px 6px; font-size: 12px; width: auto; border-radius: 12px; background: #f4efe7; border-color: transparent; color: #6e5a4b; }
.chat-ref-remove { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); font-size: 11px; line-height: 22px; }
.chat-ref-remove:hover { background: #f1dfda; color: var(--red); }
.chat-ref-glyph { display: grid; place-items: center; background: #f4efe7; color: #9a8270; font-size: 18px; }
.chat-panel { border: 1px solid var(--line); border-radius: 12px; background: var(--white); padding: 18px; overflow-y: auto; align-self: start; max-height: 100%; }
.chat-panel header { display: flex; justify-content: space-between; align-items: center; }
.chat-panel h3 { margin: 0 0 10px; font-family: Georgia, "Songti TC", serif; font-size: 18px; font-weight: 400; }
.chat-panel h4 { margin: 16px 0 8px; font-size: 12px; color: var(--muted); font-weight: 500; letter-spacing: 1px; }
.chat-panel dl { margin: 0; display: grid; gap: 9px; }
.chat-panel dl div, .chat-settings div { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 8px; }
.chat-panel dt, .chat-settings dt { color: var(--muted); font-size: 12px; }
.chat-panel dd, .chat-settings dd { margin: 0; overflow-wrap: anywhere; }
.chat-panel-close { display: none; padding: 4px 9px; border: 0; background: transparent; }
.chat-panel-refs { list-style: none; padding: 0; margin: 0; display: grid; gap: 7px; }
.chat-panel-refs li { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 8px; align-items: center; font-size: 12px; }
.chat-panel-refs img, .chat-panel-refs .chat-ref-glyph { width: 36px; height: 36px; border-radius: 6px; object-fit: cover; }
.chat-panel-refs li > span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-card { width: 100%; max-width: 620px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); padding: 18px 20px; }
.chat-card h3 { font-family: Georgia, "Songti TC", serif; font-size: 19px; font-weight: 400; margin: 0 0 12px; }
.chat-card section { margin-top: 14px; }
.chat-card h4 { margin: 0 0 6px; font-size: 12px; color: var(--muted); font-weight: 500; letter-spacing: 1px; }
.chat-card section > p { margin: 0; }
.chat-card textarea { line-height: 1.7; background: var(--white); }
.chat-card .actions { margin-top: 16px; justify-content: flex-end; }
.chat-inline-field { display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: center; gap: 8px; margin-bottom: 6px; color: var(--muted); font-size: 12px; }
.chat-inline-field input { padding: 8px 10px; color: var(--ink); font-size: 14px; }
.chat-confirm-refs { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.chat-confirm-refs li { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 10px; align-items: start; }
.chat-confirm-refs img, .chat-confirm-refs .chat-ref-glyph { width: 52px; height: 52px; border-radius: 8px; object-fit: cover; }
.chat-confirm-refs strong { font-weight: 500; margin-right: 6px; }
.chat-confirm-refs p { margin: 3px 0 0; font-size: 12px; line-height: 1.6; color: #6e625a; }
.chat-settings { margin: 0; display: grid; gap: 6px; }
.chat-rules { margin: 0; padding-left: 18px; color: #526348; }
.chat-shots { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 8px; }
.chat-shots li { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 10px; padding: 9px 10px; background: var(--white); border-radius: 8px; border: 1px solid var(--line); }
.chat-shot-time { font-size: 12px; color: var(--red); }
.chat-shots p { margin: 2px 0; line-height: 1.6; }
.chat-shot-line { color: #6e5a4b; }
.chat-shots small { color: var(--muted); }
.chat-card pre { white-space: pre-wrap; font-size: 12px; background: var(--white); padding: 10px; border-radius: 8px; }
.chat-points-figures { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.chat-points-figures div { background: var(--white); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.chat-points-figures span { color: var(--muted); font-size: 12px; }
.chat-points-figures strong { font-size: 26px; font-weight: 500; font-variant-numeric: tabular-nums; }
.chat-points-figures div:first-child strong { color: var(--red); }
.chat-progress p { margin: 0; }
.chat-result-media { display: block; width: 100%; max-height: 460px; object-fit: contain; border-radius: 8px; background: #efe9e0; }
.chat-card a.button, .chat-history a.button { display: inline-block; padding: 10px 16px; border: 1px solid var(--line); border-radius: 7px; background: var(--white); color: var(--ink); text-decoration: none; }
.chat-card a.button:hover { border-color: #ac8c77; background: #f1ece4; }
.chat-badge { background: #f1dfda; color: var(--red); }
.chat-history-head { margin-bottom: 12px; }
.chat-history-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.chat-history-item { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 10px 14px 10px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--white); }
.chat-history-item > img, .chat-history-item > .chat-ref-glyph { width: 64px; height: 64px; border-radius: 8px; object-fit: cover; }
.chat-history-text { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.chat-history-text strong { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-history-text small { color: var(--muted); }
.chat-history-text input { padding: 7px 10px; }
.chat-history-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.chat-history-actions button { padding: 7px 12px; }
.chat-picker { width: min(860px, 94vw); max-width: 94vw; max-height: 88dvh; padding: 20px; border-radius: 16px; }
.chat-picker[open] { display: flex; flex-direction: column; gap: 12px; }
.chat-picker header, .chat-picker footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-shrink: 0; }
.chat-picker footer { justify-content: flex-end; }
.chat-picker footer .muted { margin-right: auto; }
.chat-picker h2 { margin: 0; font-size: 22px; }
.chat-picker header button { border: 0; background: transparent; }
.chat-picker-tabs { display: flex; gap: 4px; overflow-x: auto; flex-shrink: 0; border-bottom: 1px solid var(--line); }
.chat-picker-tabs button { border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; padding: 9px 12px; white-space: nowrap; color: #75695e; }
.chat-picker-tabs button[aria-selected=true] { border-bottom-color: var(--red); color: var(--red); }
.chat-picker-grid { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 10px; align-content: start; min-height: 240px; }
.chat-picker-grid > p { grid-column: 1 / -1; }
.chat-pick { display: flex; flex-direction: column; gap: 6px; padding: 6px; text-align: left; border-radius: 10px; position: relative; }
.chat-pick img, .chat-pick .chat-ref-glyph { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 7px; }
.chat-pick.text .chat-ref-glyph { aspect-ratio: auto; height: 46px; }
.chat-pick span { font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.chat-pick small { color: var(--muted); font-size: 11px; }
.chat-pick[aria-pressed=true] { border-color: var(--red); box-shadow: 0 0 0 2px #e7c9c2; }
.chat-pick[aria-pressed=true]::after { content: '✓'; position: absolute; top: 10px; right: 10px; width: 22px; height: 22px; border-radius: 50%; background: var(--red); color: white; display: grid; place-items: center; font-size: 12px; }
@media (max-width: 860px) {
  .chat-layout { grid-template-columns: minmax(0, 1fr); }
  .chat-panel-toggle { display: inline-flex !important; }
  .chat-panel { display: none; }
  .chat-panel.open { display: block; position: fixed; inset: auto 0 0 0; z-index: 20; max-height: 70dvh; overflow-y: auto; border-radius: 16px 16px 0 0; box-shadow: 0 -8px 30px rgb(36 26 24 / 22%); }
  .chat-panel-close { display: inline-block; }
}
@media (max-width: 600px) {
  #modal:has(#creative-chat) { width: 100%; max-width: 100%; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; padding: 14px 12px; }
  .chat-mode { height: calc(100dvh - 72px); min-height: 0; }
  .chat-mode h2 { font-size: 21px; margin-bottom: 8px; }
  .chat-mode .eyebrow { margin-bottom: 8px; }
  .chat-thread { padding: 14px 12px 4px; }
  .chat-head #chat-open-history, .chat-head #chat-new, .chat-head .chat-panel-toggle { padding: 8px 10px; }
  .chat-bubble { max-width: 88%; }
  .chat-composer-actions button span { display: none; }
  .chat-composer-actions #chat-summarize, .chat-composer-actions #chat-send span { display: inline; }
  .chat-history-item { grid-template-columns: 52px minmax(0, 1fr); }
  .chat-history-item > img, .chat-history-item > .chat-ref-glyph { width: 52px; height: 52px; }
  .chat-history-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .chat-points-figures strong { font-size: 22px; }
}
#modal:has(#creative-chat) > .close { position: absolute; top: 24px; right: 24px; float: none; margin: 0; z-index: 2; }
#modal:has(#creative-chat) .chat-head { padding-right: 0; }
@media (max-width: 600px) { #modal:has(#creative-chat) > .close { top: 10px; right: 10px; padding: 8px 12px; } .chat-mode .eyebrow, .chat-mode h2 { padding-right: 52px; } .chat-head .mode-switch { flex-basis: 100%; } }
/* 我的背景 in the 訪談 / 知識短講 場景 step (background-picker.js, 2026-11-16). */
.bg-panel { margin-top:14px; padding:14px; background:var(--white); border:1px solid var(--line); border-radius:12px; display:grid; gap:12px; }
.bg-row { display:flex; flex-wrap:wrap; gap:10px; }
.bg-drop { width:132px; height:96px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:4px; border:1.5px dashed #c9b8a6; border-radius:10px; cursor:pointer; color:var(--red); text-align:center; background:var(--paper); }
.bg-drop small { color:var(--muted); font-size:11px; }
.bg-drop:hover, .bg-drop:focus, .bg-drop.bg-over { border-color:var(--red); background:#f6ede4; outline:none; }
.bg-thumb { width:132px; padding:0; border-radius:10px; overflow:hidden; display:flex; flex-direction:column; text-align:left; }
.bg-thumb img { width:100%; height:76px; object-fit:cover; display:block; }
.bg-thumb span { padding:4px 8px; font-size:12px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.bg-thumb[aria-pressed=true] { border:2px solid var(--red); }
.bg-from .bg-thumb { width:96px; }
.bg-from .bg-thumb img { height:64px; }
.bg-from summary { cursor:pointer; color:var(--muted); font-size:13px; margin-bottom:8px; }
.bg-chosen { display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.bg-chosen img { width:120px; height:80px; object-fit:cover; border-radius:8px; border:1px solid var(--line); }
.bg-chosen label { display:flex; flex-direction:column; gap:4px; font-size:13px; flex:1 1 200px; }
.bg-chosen small { color:var(--muted); font-size:12px; }
.bg-chip { display:flex; align-items:center; gap:10px; margin:8px 0; font-size:13px; color:var(--muted); }
.bg-chip img { width:64px; height:42px; object-fit:cover; border-radius:6px; border:1px solid var(--line); }
@media (max-width:600px) { .bg-drop, .bg-thumb { width:calc(50% - 5px); } }
/* Video font chips (font-picker.js, 2026-11-16): each sample drawn in its own font by the server. */
.font-picker { border:1px solid var(--line); border-radius:12px; padding:12px 14px; margin:12px 0; display:grid; gap:10px; }
.font-picker legend { padding:0 6px; font-size:13px; color:var(--muted); }
.font-group { display:grid; grid-template-columns:44px 1fr; gap:10px; align-items:start; }
.font-group-name { font-size:12px; color:var(--muted); padding-top:12px; }
.font-chips { display:flex; flex-wrap:wrap; gap:8px; }
.font-chip { display:flex; flex-direction:column; align-items:flex-start; gap:2px; padding:6px 10px; border-radius:10px; background:var(--white); }
.font-chip img { height:30px; width:auto; max-width:220px; display:block; }
.font-chip span { font-size:11px; color:var(--muted); }
.font-chip[aria-pressed=true] { border:2px solid var(--red); background:#f9efe8; }
@media (max-width:600px) { .font-group { grid-template-columns:1fr; } .font-group-name { padding-top:0; } .font-chip img { max-width:150px; } }
