:root {
  --bg: #edf4ff;
  --bg-soft: #dceafe;
  --surface: rgba(247, 251, 255, 0.9);
  --surface-strong: rgba(255, 255, 255, 0.96);
  --text: #122033;
  --muted: #53657d;
  --line: rgba(41, 92, 164, 0.14);
  --line-strong: rgba(41, 92, 164, 0.24);
  --accent: #2e72d2;
  --accent-deep: #174b96;
  --accent-soft: rgba(46, 114, 210, 0.12);
  --accent-pale: rgba(46, 114, 210, 0.08);
  --shadow: 0 28px 80px rgba(21, 63, 120, 0.14);
  --radius-xl: 30px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Rubik", sans-serif;
  background:
    radial-gradient(circle at top right, rgba(80, 141, 231, 0.22), transparent 24%),
    radial-gradient(circle at bottom left, rgba(33, 93, 179, 0.14), transparent 26%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-soft) 100%);
}

button,
input,
textarea,
select {
  font: inherit;
}

.page-shell {
  width: min(1320px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 36px;
}

.hero {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 22px;
  margin-bottom: 18px;
}

.brand-block,
.hero-panel,
.card,
.tab-button,
.info-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, var(--surface), var(--surface-strong));
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.brand-block {
  padding: 34px;
}

.hero-panel {
  padding: 28px;
  background:
    linear-gradient(180deg, rgba(22, 50, 90, 0.96), rgba(26, 72, 138, 0.94)),
    linear-gradient(145deg, rgba(111, 168, 247, 0.18), transparent 50%);
  color: #f5fbff;
}

.eyebrow,
.panel-label {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--accent-deep);
}

.brand-name {
  font-size: 1.18rem;
}

.hero-panel .panel-label {
  color: rgba(232, 243, 255, 0.76);
}

h1,
h2,
h3,
legend {
  margin: 0;
  font-family: "Heebo", sans-serif;
}

h1 {
  margin-top: 10px;
  font-size: clamp(2.7rem, 6vw, 5.4rem);
  line-height: 0.92;
  letter-spacing: -0.04em;
}

.hero-text {
  margin-top: 18px;
  max-width: 60ch;
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.8;
}

.hero-list,
.playbook-list,
.brief-list {
  margin: 14px 0 0;
  padding: 0 18px 0 0;
  display: grid;
  gap: 10px;
  line-height: 1.7;
}

.tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
}

.tab-button {
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
  color: var(--text);
  background: rgba(255, 255, 255, 0.7);
}

.tab-button.active {
  background: linear-gradient(135deg, var(--accent-deep), var(--accent));
  color: #f8fbff;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.app-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 22px;
  align-items: start;
}

.app-grid.single-panel {
  grid-template-columns: 1fr 0.92fr;
}

.card {
  padding: 28px;
}

.section-head {
  margin-bottom: 18px;
}

.section-head h2 {
  margin-top: 8px;
  font-size: 1.95rem;
}

.content-form {
  display: grid;
  gap: 16px;
}

.grid {
  display: grid;
  gap: 14px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

label,
.style-bank {
  display: grid;
  gap: 8px;
}

label span,
legend {
  font-weight: 700;
  color: var(--accent-deep);
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.92);
  padding: 14px 16px;
  color: var(--text);
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

textarea {
  resize: vertical;
  line-height: 1.75;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(46, 114, 210, 0.12);
}

small {
  color: var(--muted);
  font-size: 0.82rem;
}

.style-bank {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px;
  background: rgba(244, 249, 255, 0.86);
}

.style-bank-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.style-bank-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.saved-styles,
.style-library {
  display: grid;
  gap: 12px;
}

.status-card {
  display: grid;
  gap: 6px;
  align-content: start;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.88);
  padding: 14px 16px;
}

.status-card span {
  color: var(--accent-deep);
  font-weight: 700;
}

.status-card strong {
  font-family: "Heebo", sans-serif;
  font-size: 1.05rem;
}

.saved-style-card,
.library-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.88);
  padding: 14px;
}

.saved-style-card label {
  display: flex;
  gap: 10px;
  align-items: start;
}

.saved-style-card input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 4px;
  accent-color: var(--accent);
}

.saved-style-card h4,
.library-card h4 {
  margin: 0;
  font-family: "Heebo", sans-serif;
  font-size: 1.05rem;
}

.saved-style-meta,
.library-meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.primary-button,
.secondary-button,
.mini-button {
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 180ms ease, opacity 180ms ease;
}

.primary-button {
  min-height: 48px;
  padding: 0 20px;
  background: linear-gradient(135deg, var(--accent-deep), var(--accent));
  color: #f8fbff;
  font-weight: 700;
}

.secondary-button,
.mini-button {
  min-height: 44px;
  padding: 0 16px;
  background: rgba(244, 249, 255, 0.95);
  color: var(--text);
  border: 1px solid var(--line-strong);
  font-weight: 600;
}

.primary-button:hover,
.secondary-button:hover,
.mini-button:hover,
.tab-button:hover {
  transform: translateY(-1px);
}

.panel-stack {
  display: grid;
  gap: 16px;
}

.info-panel {
  border-radius: var(--radius-lg);
  background: rgba(251, 253, 255, 0.9);
  padding: 18px;
}

.accent-panel {
  background:
    linear-gradient(180deg, rgba(241, 248, 255, 0.98), rgba(232, 243, 255, 0.96));
}

.panel-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.inline-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.brief-preview {
  color: var(--muted);
  line-height: 1.8;
}

.output-area,
.notes-area {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.94);
  padding: 14px 16px;
  line-height: 1.75;
}

.prompt-hidden {
  display: none;
}

.hidden-action {
  display: none;
}

.large-output {
  min-height: 320px;
}

.generation-meta {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.output-area[readonly] {
  color: #21324b;
}

.empty-state {
  color: var(--muted);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  padding: 16px;
  background: var(--accent-pale);
}

.library-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}

.danger-link {
  border: 0;
  background: transparent;
  color: #b42318;
  cursor: pointer;
  padding: 0;
  font-weight: 700;
}

@media (max-width: 1040px) {
  .hero,
  .app-grid,
  .app-grid.single-panel,
  .grid.two,
  .grid.three {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 20px, 100%);
    padding: 18px 0 28px;
  }

  .brand-block,
  .hero-panel,
  .card {
    padding: 20px;
    border-radius: 24px;
  }

  h1 {
    font-size: 2.3rem;
  }

  .section-head h2 {
    font-size: 1.65rem;
  }

  .style-bank-head,
  .panel-topline,
  .library-actions {
    align-items: start;
    flex-direction: column;
  }
}
