.cotw-pid-page {
  padding: 32px 0 64px;
}
.cotw-pid-page-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}
.cotw-pid-hero {
  margin-bottom: 28px;
  max-width: 620px;
}
.cotw-pid-kicker {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted, #71717a);
  margin-bottom: 8px;
}
.cotw-pid-hero h1 {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 10px;
}
.cotw-pid-lede {
  color: var(--text-muted, #71717a);
  font-size: 0.98rem;
}

.cotw-pid-gen {
  --cotw-pid-accent: #c4a484;
  --cotw-pid-surface: var(--surface, #f4f4f5);
  --cotw-pid-border: var(--border, #e4e4e7);
  --cotw-pid-text: var(--text, #09090b);
  --cotw-pid-muted: var(--text-muted, #71717a);
  color: var(--cotw-pid-text);
}

.cotw-pid-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
  gap: 28px;
  align-items: start;
}

.cotw-pid-form-col,
.cotw-pid-preview-col {
  min-width: 0;
}

.cotw-pid-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
}
.cotw-pid-steps button {
  appearance: none;
  border: 1px solid var(--cotw-pid-border);
  background: transparent;
  color: var(--cotw-pid-muted);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
}
.cotw-pid-steps button.is-active {
  background: var(--cotw-pid-text);
  color: var(--bg, #fff);
  border-color: var(--cotw-pid-text);
}

.cotw-pid-form {
  background: var(--cotw-pid-surface);
  border: 1px solid var(--cotw-pid-border);
  border-radius: 16px;
  padding: 22px;
  margin-bottom: 20px;
}
.cotw-pid-form h2 {
  font-size: 1.05rem;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}
.cotw-pid-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
  font-size: 0.86rem;
  font-weight: 500;
}
.cotw-pid-field input,
.cotw-pid-field select,
.cotw-pid-field textarea {
  appearance: none;
  width: 100%;
  border: 1px solid var(--cotw-pid-border);
  background: var(--bg, #fff);
  color: var(--cotw-pid-text);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  font-weight: 400;
}
.cotw-pid-field input:focus,
.cotw-pid-field select:focus,
.cotw-pid-field textarea:focus {
  outline: 2px solid var(--cotw-pid-accent);
  outline-offset: 1px;
}
.cotw-pid-field small {
  color: var(--cotw-pid-muted);
  font-weight: 400;
  font-size: 0.78rem;
}
.cotw-pid-photo-preview {
  margin-top: 8px;
}
.cotw-pid-photo-preview img {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--cotw-pid-border);
}
.cotw-pid-id-line {
  font-size: 0.9rem;
  color: var(--cotw-pid-muted);
  margin-top: 8px;
}
.cotw-pid-form-error {
  color: #b91c1c;
  background: rgba(185, 28, 28, 0.08);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.86rem;
  margin-bottom: 12px;
}
.cotw-pid-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.cotw-pid-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
  margin-bottom: 8px;
}
.cotw-pid-finish {
  display: none !important;
}
.cotw-pid-actions.is-ready .cotw-pid-finish {
  display: inline-flex !important;
}
.cotw-pid-btn {
  appearance: none;
  border: 1px solid var(--cotw-pid-text);
  background: var(--cotw-pid-text);
  color: var(--bg, #fff);
  border-radius: 999px;
  padding: 10px 18px;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}
.cotw-pid-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.cotw-pid-btn-ghost {
  background: transparent;
  color: var(--cotw-pid-text);
}
.cotw-pid-btn-primary {
  background: var(--cotw-pid-accent);
  border-color: var(--cotw-pid-accent);
  color: #1a1a1a;
}
.cotw-pid-status {
  width: 100%;
  font-size: 0.88rem;
  color: var(--cotw-pid-muted);
}
.cotw-pid-status.is-success {
  color: #15803d;
}
.cotw-pid-status.is-error {
  color: #b91c1c;
}

.cotw-pid-templates {
  margin-bottom: 20px;
}
.cotw-pid-templates h2 {
  font-size: 1.05rem;
  margin-bottom: 12px;
}
.cotw-pid-template-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.cotw-pid-template {
  appearance: none;
  border: 1px solid var(--cotw-pid-border);
  background: var(--cotw-pid-surface);
  border-radius: 12px;
  padding: 8px;
  cursor: pointer;
  text-align: left;
  color: inherit;
}
.cotw-pid-template img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  margin-bottom: 6px;
}
.cotw-pid-template span {
  font-size: 0.8rem;
  font-weight: 600;
}
.cotw-pid-template.is-selected {
  border-color: var(--cotw-pid-accent);
  box-shadow: 0 0 0 2px rgba(196, 164, 132, 0.35);
}

.cotw-pid-preview-col {
  position: sticky;
  top: 72px;
}
.cotw-pid-preview-title {
  font-size: 0.95rem;
  margin-bottom: 12px;
}
.cotw-pid-preview-stage .cotw-pid-sheet,
.cotw-pid-public-card .cotw-pid-sheet {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
}
.cotw-pid-sheet.is-3d {
  display: none;
}
.cotw-pid-3d {
  width: min(100%, 34rem);
  margin-inline: auto;
  user-select: none;
}
.cotw-pid-3d:focus-visible {
  outline: 2px solid currentcolor;
  outline-offset: 4px;
}
.cotw-pid-3d-view {
  cursor: grab;
  touch-action: none;
}
.cotw-pid-3d.is-dragging .cotw-pid-3d-view {
  cursor: grabbing;
}
.cotw-pid-3d-hint {
  margin: 0.35rem 0 0;
  text-align: center;
  font-size: 0.8rem;
  color: var(--cotw-pid-muted, #9a8d7c);
}
.cotw-pid-preview-stage .cotw-pid-copyright,
.cotw-pid-public-card .cotw-pid-copyright {
  position: static;
  display: block;
}
.cotw-pid-preview-stage .cotw-pid-copyright--back,
.cotw-pid-public-card .cotw-pid-copyright--back {
  text-align: center;
}
.cotw-pid-preview-stage.has-sample::after {
  content: "Sample preview. Your details replace it as you type.";
  display: block;
  margin-top: 0.6rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--cotw-pid-muted, #9a8d7c);
}
.cotw-pid-public-link {
  width: 100%;
  font-size: 0.86rem;
  color: var(--cotw-pid-muted);
  word-break: break-all;
}
.cotw-pid-public-link a {
  color: inherit;
  text-decoration: underline;
}
.cotw-pid-public {
  padding: 32px 0 64px;
}
.cotw-pid-public-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
}
.cotw-pid-public-card .cotw-pid-card {
  margin: 0 auto;
}
.cotw-pid-public-cta {
  text-align: center;
  margin-top: 20px;
}
.cotw-pid-disclaimer {
  margin-top: 14px;
  font-size: 0.78rem;
  color: var(--cotw-pid-muted);
  text-align: center;
}

@media (max-width: 900px) {
  .cotw-pid-layout {
    grid-template-columns: 1fr;
  }
  .cotw-pid-preview-col {
    position: static;
  }
  .cotw-pid-template-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
