.agent-view--poster {
  --poster-ink: #171717;
  --poster-muted: #6b7280;
  --poster-line: #e5e7eb;
  --poster-accent: #dc2626;
}

.poster-workbench,
.poster-workbench * { box-sizing: border-box; }

.poster-workbench {
  display: grid;
  gap: 18px;
  color: var(--poster-ink);
}

.poster-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-block: 1px solid var(--poster-line);
  background: #fff;
}

.poster-steps button {
  position: relative;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 72px;
  padding: 12px 18px;
  border: 0;
  border-right: 1px solid var(--poster-line);
  background: transparent;
  color: #9ca3af;
  text-align: left;
  cursor: pointer;
}

.poster-steps button:last-child { border-right: 0; }
.poster-steps button::after { content: ""; position: absolute; inset: auto 16px -1px; height: 2px; background: transparent; }
.poster-steps button.is-active { color: var(--poster-ink); }
.poster-steps button.is-active::after { background: var(--poster-accent); }
.poster-steps button.is-complete b { color: #fff; border-color: #15803d; background: #15803d; }
.poster-steps button b { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid #d1d5db; border-radius: 50%; font-size: 12px; }
.poster-steps button span { display: grid; min-width: 0; }
.poster-steps button strong { font-size: 14px; letter-spacing: 0; }
.poster-steps button small { margin-top: 2px; font-size: 11px; font-weight: 400; }

.poster-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, .7fr);
  gap: 24px;
  align-items: start;
}

.poster-editor {
  min-height: 610px;
  padding: 6px 4px 0;
}

.poster-step-panel { min-height: 490px; animation: poster-fade-in .18s ease-out; }
@keyframes poster-fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.poster-section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--poster-line);
}

.poster-section-head div { display: grid; gap: 5px; }
.poster-section-head span,
.poster-plan header > span { color: var(--poster-accent); font-size: 10px; font-weight: 800; letter-spacing: .12em; }
.poster-section-head h3 { margin: 0; font-size: 20px; letter-spacing: 0; }
.poster-section-head > small { max-width: 240px; color: var(--poster-muted); font-size: 12px; text-align: right; }

.poster-upload {
  display: grid;
  place-items: center;
  min-height: 270px;
  padding: 30px;
  border: 1px dashed #c7cbd1;
  background: #fafafa;
  text-align: center;
  cursor: pointer;
}
.poster-upload.is-dragging { border-color: var(--poster-accent); background: #fef2f2; }
.poster-upload input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.poster-upload > span { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 14px; border: 1px solid #d1d5db; border-radius: 50%; background: #fff; font-size: 24px; }
.poster-upload strong { font-size: 15px; }
.poster-upload small { max-width: 440px; margin-top: 8px; color: var(--poster-muted); line-height: 1.6; }

.poster-materials { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.poster-material { position: relative; aspect-ratio: 1; overflow: hidden; border: 1px solid var(--poster-line); background: #f3f4f6; }
.poster-material img { width: 100%; height: 100%; object-fit: cover; }
.poster-material > span { position: absolute; inset: 6px auto auto 6px; padding: 2px 6px; background: rgba(17, 24, 39, .82); color: #fff; font-size: 10px; }
.poster-material button { position: absolute; inset: 5px 5px auto auto; display: grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 50%; background: rgba(255,255,255,.94); color: #111; font-size: 16px; cursor: pointer; }

.poster-inline-actions { display: flex; align-items: center; gap: 12px; min-height: 44px; margin-top: 12px; }
.poster-inline-actions > span { color: var(--poster-muted); font-size: 12px; }

.poster-choice-field { min-width: 0; margin: 0 0 20px; padding: 0; border: 0; }
.poster-choice-field legend,
.poster-field > span { display: block; margin-bottom: 8px; color: #374151; font-size: 12px; font-weight: 700; }
.poster-field > span small { color: #9ca3af; font-weight: 400; }

.poster-purpose-grid,
.poster-format-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.poster-purpose-grid label,
.poster-format-grid label { cursor: pointer; }
.poster-purpose-grid input,
.poster-format-grid input,
.poster-style-grid input { position: absolute; opacity: 0; pointer-events: none; }
.poster-purpose-grid label > span,
.poster-format-grid label > span {
  display: grid;
  min-height: 76px;
  align-content: center;
  gap: 4px;
  padding: 13px 14px;
  border: 1px solid var(--poster-line);
  background: #fff;
}
.poster-purpose-grid input:checked + span,
.poster-format-grid input:checked + span { border-color: var(--poster-ink); box-shadow: inset 0 0 0 1px var(--poster-ink); }
.poster-purpose-grid b,
.poster-format-grid b { font-size: 13px; }
.poster-purpose-grid small,
.poster-format-grid small { overflow: hidden; color: var(--poster-muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }

.poster-field { display: block; margin-bottom: 18px; }
.poster-field input,
.poster-field textarea,
.poster-field select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  background: #fff;
  color: var(--poster-ink);
  font: inherit;
  letter-spacing: 0;
  outline: none;
}
.poster-field textarea { min-height: 90px; resize: vertical; line-height: 1.55; }
.poster-field input:focus,
.poster-field textarea:focus,
.poster-field select:focus { border-color: #6b7280; box-shadow: 0 0 0 2px rgba(17, 24, 39, .08); }

.poster-form-grid { display: grid; grid-template-columns: 1fr; gap: 0 14px; }
.poster-form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.poster-form-grid .full { grid-column: 1 / -1; }

.poster-style-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.poster-style-grid label { cursor: pointer; }
.poster-style-grid label > span { display: flex; align-items: center; gap: 9px; min-height: 42px; padding: 9px 11px; border: 1px solid var(--poster-line); background: #fff; font-size: 12px; font-weight: 650; }
.poster-style-grid label i { width: 16px; height: 16px; border: 1px solid rgba(0,0,0,.12); border-radius: 50%; background: var(--poster-style-accent); }
.poster-style-grid input:checked + span { border-color: var(--poster-ink); box-shadow: inset 0 0 0 1px var(--poster-ink); }

.poster-rules { margin-top: 4px; border-top: 1px solid var(--poster-line); }
.poster-rules summary { padding: 14px 0; color: #374151; font-size: 12px; font-weight: 700; cursor: pointer; }
.poster-rules ul { margin: 0 0 16px; padding-left: 18px; color: var(--poster-muted); font-size: 12px; line-height: 1.8; }

.poster-editor-footer { display: flex; align-items: center; gap: 10px; min-height: 54px; padding-top: 14px; border-top: 1px solid var(--poster-line); }
.poster-editor-footer > span { margin-right: auto; color: var(--poster-muted); font-size: 12px; }
.poster-button { min-height: 40px; padding: 0 17px; border: 1px solid #d1d5db; border-radius: 4px; background: #fff; color: #1f2937; font-weight: 700; letter-spacing: 0; cursor: pointer; }
.poster-button.primary { border-color: var(--poster-ink); background: var(--poster-ink); color: #fff; }
.poster-button:disabled { cursor: not-allowed; opacity: .48; }
.poster-status { min-height: 24px; padding-top: 8px; color: var(--poster-muted); font-size: 12px; }
.poster-status.is-error { color: #b91c1c; }
.poster-status.is-success { color: #15803d; }

.poster-plan { position: sticky; top: 86px; min-width: 0; border-left: 1px solid var(--poster-line); padding: 4px 0 4px 24px; }
.poster-plan header { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 4px 12px; margin-bottom: 14px; }
.poster-plan header > span { grid-column: 1 / -1; }
.poster-plan header strong { font-size: 17px; }
.poster-plan header small { color: var(--poster-muted); font-size: 11px; }
.poster-preview { overflow: hidden; width: min(100%, 360px); margin-inline: auto; aspect-ratio: 4 / 5; border: 1px solid #d7d9dd; background: #f3f4f6; }
.poster-preview-art { position: relative; display: grid; align-content: end; width: 100%; height: 100%; padding: 10%; overflow: hidden; background: var(--poster-preview-accent, #dc2626); color: #fff; }
.poster-preview-art::before { content: ""; position: absolute; width: 62%; height: 48%; inset: 14% -12% auto auto; border: 1px solid rgba(255,255,255,.48); background: rgba(255,255,255,.12); }
.poster-preview-art::after { content: ""; position: absolute; width: 32%; height: 2px; inset: 10% auto auto 10%; background: rgba(255,255,255,.72); }
.poster-preview-art > * { position: relative; z-index: 1; }
.poster-preview-art > span { margin-bottom: auto; font-size: 9px; font-weight: 800; letter-spacing: .16em; }
.poster-preview-art strong { max-width: 92%; font-size: 28px; line-height: 1.15; overflow-wrap: anywhere; letter-spacing: 0; }
.poster-preview-art small { margin-top: 10px; font-size: 11px; opacity: .86; }

.poster-plan-list { margin: 16px 0 0; border-top: 1px solid var(--poster-line); }
.poster-plan-list div { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--poster-line); }
.poster-plan-list dt { color: var(--poster-muted); font-size: 11px; }
.poster-plan-list dd { margin: 0; color: #292d33; font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.poster-record-link { display: inline-block; margin-top: 13px; color: #374151; font-size: 12px; font-weight: 700; text-decoration: none; }

.poster-result { margin-top: 14px; }
.poster-result-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.poster-result-item { position: relative; display: grid; place-items: center; min-height: 116px; overflow: hidden; border: 1px solid var(--poster-line); background: #f4f4f5; }
.poster-result-item img { width: 100%; height: 100%; object-fit: cover; }
.poster-result-item span { padding: 8px; color: var(--poster-muted); font-size: 11px; text-align: center; }
.poster-result-item a { position: absolute; inset: auto 5px 5px auto; padding: 5px 8px; background: rgba(17,24,39,.88); color: #fff; font-size: 10px; text-decoration: none; }

html[data-theme="dark"] .poster-workbench { --poster-ink: #f4f4f5; --poster-muted: #a1a1aa; --poster-line: #34343a; }
html[data-theme="dark"] .poster-steps,
html[data-theme="dark"] .poster-purpose-grid label > span,
html[data-theme="dark"] .poster-format-grid label > span,
html[data-theme="dark"] .poster-style-grid label > span,
html[data-theme="dark"] .poster-field input,
html[data-theme="dark"] .poster-field textarea,
html[data-theme="dark"] .poster-field select { background: #202024; color: #f4f4f5; }
html[data-theme="dark"] .poster-upload { border-color: #48484f; background: #202024; }
html[data-theme="dark"] .poster-upload > span { border-color: #48484f; background: #29292e; }

@media (max-width: 980px) {
  .poster-layout { grid-template-columns: 1fr; }
  .poster-plan { position: static; border-top: 1px solid var(--poster-line); border-left: 0; padding: 22px 0 0; }
  .poster-preview { width: min(100%, 420px); }
}

@media (max-width: 680px) {
  .poster-steps button { grid-template-columns: 26px 1fr; min-height: 62px; padding: 9px 7px; gap: 6px; }
  .poster-steps button b { width: 24px; height: 24px; }
  .poster-steps button small { display: none; }
  .poster-steps button strong { font-size: 12px; }
  .poster-section-head { align-items: start; }
  .poster-section-head > small { display: none; }
  .poster-purpose-grid,
  .poster-format-grid { grid-template-columns: 1fr 1fr; }
  .poster-style-grid { grid-template-columns: 1fr 1fr; }
  .poster-materials { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .poster-form-grid.two { grid-template-columns: 1fr; }
  .poster-editor { min-height: 0; }
  .poster-step-panel { min-height: 0; }
  .poster-preview-art strong { font-size: 24px; }
}
