:root {
  --bg: #f7f8fb;
  --panel: #ffffff;
  --text: #111827;
  --muted: #5b6472;
  --border: #d9dee8;
  --accent: #6d5dfc;
  --accent-dark: #4f46e5;
  --danger: #b42318;
  --shadow: 0 18px 45px rgba(17, 24, 39, .08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
}
a { color: inherit; text-decoration: none; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, .94);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand { display: flex; align-items: center; gap: .65rem; font-weight: 800; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  color: #fff;
  background: var(--accent);
  font-size: .8rem;
}
nav { display: flex; gap: .4rem; flex-wrap: wrap; }
nav a, .suite-pill {
  padding: .55rem .75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  background: #fff;
  font-size: .9rem;
}
.page { width: min(1180px, calc(100% - 2rem)); margin: 1.4rem auto 3rem; }
.hero, .page-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1.5rem;
  margin: 1.5rem 0;
}
h1 { font-size: clamp(2rem, 4vw, 4rem); line-height: 1; margin: 0 0 .8rem; letter-spacing: 0; }
h2 { margin: 0 0 1rem; font-size: 1.15rem; }
p { color: var(--muted); }
.hero p { max-width: 760px; font-size: 1.05rem; }
.hero-actions, .actions { display: flex; gap: .7rem; flex-wrap: wrap; }
.workspace { display: grid; grid-template-columns: 1fr; gap: 1rem; align-items: start; }
.workspace.compact { grid-template-columns: minmax(280px, .7fr) minmax(360px, 1fr); }
.panel, .prompt-card, .preset-card, .empty-state {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 1rem;
}
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; }
.wide { grid-column: 1 / -1; }
label { display: grid; gap: .35rem; font-weight: 700; color: #273142; font-size: .9rem; }
label.field-with-cycle > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
}
small { color: var(--muted); font-weight: 400; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .72rem .78rem;
  font: inherit;
  color: var(--text);
  background: #fff;
}
textarea { resize: vertical; }
.button, .icon-button {
  border: 0;
  border-radius: 8px;
  padding: .72rem .95rem;
  font-weight: 800;
  cursor: pointer;
}
.copy-link {
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #eef1f7;
  color: #273142;
  cursor: pointer;
  font-size: .82rem;
  font-weight: 800;
  padding: .46rem .62rem;
  white-space: nowrap;
}
.copy-link:hover {
  background: #e2e7f2;
}
.cycle-button {
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #eef1f7;
  color: #273142;
  cursor: pointer;
  font-size: .78rem;
  font-weight: 800;
  padding: .38rem .5rem;
  white-space: nowrap;
}
.cycle-button:hover {
  background: #e2e7f2;
}
.primary { color: #fff; background: var(--accent); }
.primary:hover { background: var(--accent-dark); }
.secondary { color: #273142; background: #eef1f7; border: 1px solid var(--border); }
.danger { color: #fff; background: var(--danger); }
.panel-heading, .prompt-card-header { display: flex; justify-content: space-between; gap: 1rem; align-items: center; }
.output-panel {
  display: grid;
  gap: .9rem;
}
.prompt-output-section {
  display: grid;
  gap: .55rem;
  padding: .95rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fafbfe;
}
.output-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.output-section-heading label {
  margin: 0;
}
.prompt-output-section textarea {
  min-height: 120px;
  line-height: 1.55;
}
.variant-list { display: grid; gap: .65rem; }
.variant-item {
  display: grid;
  gap: .5rem;
  padding: .8rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}
.variant-item textarea { min-height: 130px; }
.status-line, .warning { margin-top: .75rem; color: var(--muted); }
.warning { padding: .75rem; border: 1px solid #fed7aa; background: #fff7ed; border-radius: 8px; color: #9a3412; }
.prompt-list, .preset-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; }
.tag-row { color: var(--muted); font-size: .9rem; min-height: 1.2rem; }
.status-grid { display: grid; grid-template-columns: max-content 1fr; gap: .7rem 1rem; }
.status-grid dt { font-weight: 800; }
.status-grid dd { margin: 0; color: var(--muted); }
.messages { display: grid; gap: .5rem; margin-bottom: 1rem; }
.message { padding: .75rem; border-radius: 8px; background: #eef1f7; }
.message.error { background: #fef2f2; color: #991b1b; }
.message.success { background: #ecfdf3; color: #067647; }
.search-form { display: flex; gap: .5rem; min-width: min(100%, 420px); }
@media (max-width: 860px) {
  .topbar, .hero, .page-heading { align-items: stretch; flex-direction: column; }
  .workspace, .workspace.compact { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .output-section-heading { align-items: stretch; flex-direction: column; }
}
