:root {
  --bg: #eef4ff;
  --panel: rgba(255, 255, 255, 0.92);
  --panel-strong: #ffffff;
  --line: #d7e3f4;
  --ink: #122033;
  --muted: #5b6780;
  --primary: #2563eb;
  --primary-strong: #1d4ed8;
  --soft: #dbeafe;
  --brand: #b97d8e;
  --shadow: 0 24px 70px rgba(37, 99, 235, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.18), transparent 30%),
    radial-gradient(circle at bottom left, rgba(185, 125, 142, 0.22), transparent 28%),
    linear-gradient(180deg, #f5f9ff 0%, var(--bg) 100%);
  color: var(--ink);
}

.page-shell {
  display: grid;
  grid-template-columns: minmax(360px, 430px) minmax(0, 1fr);
  gap: 22px;
  padding: 22px;
  min-height: 100vh;
}

.control-panel,
.preview-panel {
  background: var(--panel);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.control-panel {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.brand-card {
  display: grid;
  grid-template-columns: 122px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 18px;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 248, 255, 0.92)),
    linear-gradient(135deg, rgba(37, 99, 235, 0.05), rgba(185, 125, 142, 0.1));
  border: 1px solid var(--line);
}

.brand-logo {
  width: 100%;
  height: auto;
  object-fit: contain;
}

.eyebrow,
.section-eyebrow {
  margin: 0 0 8px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--primary);
  font-weight: 700;
}

.brand-card h1,
.preview-header h2,
.section-head h2 {
  margin: 0;
}

.brand-copy {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.7;
  font-size: 14px;
}

.panel-section {
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px;
  background: var(--panel-strong);
}

.section-head,
.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.settings-grid,
.statement-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.collapsed {
  display: none;
}

label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.checkbox-field {
  justify-content: space-between;
  align-items: center;
  flex-direction: row;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: #fbfdff;
}

.checkbox-field input {
  width: 20px;
  height: 20px;
  accent-color: var(--primary);
}

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fbfdff;
  border-radius: 14px;
  padding: 12px 14px;
  color: var(--ink);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

textarea {
  resize: vertical;
  min-height: 100px;
  direction: ltr;
}

.full {
  grid-column: 1 / -1;
}

.date-grid,
.action-grid,
.settings-actions,
.summary-grid {
  display: grid;
  grid-column: 1 / -1;
  gap: 12px;
}

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

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

button {
  border: 0;
  border-radius: 14px;
  padding: 12px 16px;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

button:hover {
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.6;
  cursor: wait;
  transform: none;
}

.primary-btn {
  background: linear-gradient(180deg, var(--primary), var(--primary-strong));
  color: #fff;
  box-shadow: 0 18px 34px rgba(37, 99, 235, 0.26);
}

.secondary-btn {
  background: var(--soft);
  color: var(--primary-strong);
}

.ghost-btn {
  background: transparent;
  color: var(--primary-strong);
  border: 1px solid var(--line);
}

.status-card {
  grid-column: 1 / -1;
  border: 1px dashed var(--line);
  border-radius: 16px;
  padding: 13px 14px;
  background: linear-gradient(180deg, #fbfdff 0%, #f5f9ff 100%);
  color: var(--muted);
  min-height: 50px;
}

.summary-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.summary-card span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
}

.summary-card strong {
  display: block;
  font-size: 20px;
  direction: ltr;
}

.preview-panel {
  padding: 18px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.preview-chip {
  padding: 8px 12px;
  border-radius: 999px;
  background: #eef4ff;
  color: var(--primary-strong);
  font-size: 12px;
  font-weight: 700;
}

#previewFrame {
  width: 100%;
  flex: 1;
  min-height: 760px;
  border: 0;
  border-radius: 20px;
  background: #f8fbff;
}

@media (max-width: 1200px) {
  .page-shell {
    grid-template-columns: 1fr;
  }

  .preview-panel {
    min-height: 920px;
  }
}

@media (max-width: 720px) {
  .page-shell {
    padding: 14px;
    gap: 14px;
  }

  .control-panel,
  .preview-panel,
  .panel-section,
  .brand-card {
    border-radius: 20px;
  }

  .brand-card,
  .settings-grid,
  .statement-form,
  .date-grid,
  .action-grid,
  .summary-grid {
    grid-template-columns: 1fr;
  }
}
