:root {
  --cr-bg: #070708;
  --cr-panel: #101014;
  --cr-border: rgba(201, 162, 39, 0.22);
  --cr-gold: #c9a227;
  --cr-gold-bright: #e8c547;
  --cr-text: #ece8df;
  --cr-muted: rgba(236, 232, 223, 0.62);
  --cr-accent: #8b1a2a;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--cr-bg);
  color: var(--cr-text);
  font-family: "Segoe UI", system-ui, sans-serif;
}

.cr-app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.cr-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--cr-border);
  background: rgba(0, 0, 0, 0.45);
}

.cr-brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.cr-brand-mark {
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--cr-gold-bright);
}

.cr-brand-sub {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--cr-muted);
}

.cr-steps {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.cr-step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
}

.cr-step-dot.is-active { background: var(--cr-gold); }
.cr-step-dot.is-done { background: rgba(201, 162, 39, 0.45); }

.cr-main {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 32px 20px 48px;
}

.cr-panel {
  width: min(640px, 100%);
  padding: 28px;
  border: 1px solid var(--cr-border);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,0.03), transparent), var(--cr-panel);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.cr-panel--hero { text-align: center; }
.cr-panel--done { text-align: center; }

.cr-kicker {
  margin: 0 0 8px;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cr-muted);
}

.cr-title {
  margin: 0 0 12px;
  font-size: clamp(2rem, 6vw, 2.8rem);
  letter-spacing: 0.08em;
  color: var(--cr-gold-bright);
}

.cr-lead {
  margin: 0 auto 20px;
  max-width: 34ch;
  line-height: 1.55;
  color: var(--cr-muted);
}

.cr-features {
  list-style: none;
  margin: 0 auto 24px;
  padding: 0;
  display: grid;
  gap: 8px;
  max-width: 280px;
  text-align: left;
  font-size: 0.92rem;
}

.cr-features li::before {
  content: "◆ ";
  color: var(--cr-gold);
}

.cr-footnote {
  margin: 18px 0 0;
  font-size: 0.78rem;
  color: var(--cr-muted);
}

.cr-footnote a { color: var(--cr-gold); }

.cr-panel h2 {
  margin: 0 0 8px;
  font-size: 1.35rem;
}

.cr-hint {
  margin: 0 0 18px;
  color: var(--cr-muted);
  line-height: 1.45;
}

.cr-input,
.cr-textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--cr-border);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.35);
  color: var(--cr-text);
  font: inherit;
}

.cr-textarea {
  min-height: 120px;
  resize: vertical;
}

.cr-input:focus,
.cr-textarea:focus {
  outline: none;
  border-color: var(--cr-gold);
}

.cr-count {
  margin: 8px 0 0;
  text-align: right;
  font-size: 0.78rem;
  color: var(--cr-muted);
}

.cr-chips,
.cr-templates {
  display: grid;
  gap: 10px;
}

.cr-chip,
.cr-template {
  text-align: left;
  padding: 12px 14px;
  border: 1px solid var(--cr-border);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
  color: var(--cr-text);
  cursor: pointer;
  font: inherit;
}

.cr-chip:hover,
.cr-template:hover {
  border-color: rgba(201, 162, 39, 0.45);
}

.cr-chip.is-selected,
.cr-template.is-selected {
  border-color: var(--cr-gold);
  background: rgba(201, 162, 39, 0.12);
}

.cr-template strong {
  display: block;
  margin-bottom: 4px;
  color: var(--cr-gold-bright);
}

.cr-template span {
  font-size: 0.86rem;
  color: var(--cr-muted);
}

.cr-actions,
.cr-done-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 22px;
}

.cr-done-actions {
  justify-content: center;
}

.cr-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border: 1px solid var(--cr-border);
  border-radius: 999px;
  background: transparent;
  color: var(--cr-text);
  text-decoration: none;
  cursor: pointer;
  font: inherit;
}

.cr-btn--primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--cr-gold), #9a7420);
  color: #120f08;
  font-weight: 700;
}

.cr-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.cr-progress {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-bottom: 16px;
}

.cr-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--cr-accent), var(--cr-gold));
  transition: width 0.35s ease;
}

.cr-log {
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: ui-monospace, monospace;
  font-size: 0.78rem;
  color: var(--cr-muted);
  display: grid;
  gap: 6px;
  max-height: 180px;
  overflow: auto;
}

.cr-done-desc {
  margin: 0 auto 10px;
  max-width: 40ch;
  color: var(--cr-muted);
  line-height: 1.5;
}

.cr-done-url {
  margin: 0 0 20px;
  font-family: ui-monospace, monospace;
  font-size: 0.82rem;
  color: var(--cr-gold);
}

@media (max-width: 520px) {
  .cr-top { flex-direction: column; align-items: flex-start; }
  .cr-panel { padding: 20px; }
}
