* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Inter", system-ui, sans-serif;
  min-height: 100vh;
  color: #14213d;
  background: radial-gradient(circle at 15% 10%, #e0e7ff 0%, #f8fbff 35%, #fef3f8 100%);
}

.landing {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  padding: 1.5rem;
  background: radial-gradient(circle at 20% 20%, #dbeafe 0%, #ede9fe 35%, #fce7f3 100%);
}

.landing-content {
  position: relative;
  z-index: 2;
  max-width: 760px;
  text-align: center;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 22px;
  padding: 2.4rem 2rem;
  box-shadow: 0 24px 50px rgba(79, 70, 229, 0.18);
}

.landing-kicker {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #4f46e5;
  font-weight: 700;
  margin-bottom: 0.8rem;
}

.landing-title {
  font-size: clamp(2rem, 5vw, 3.8rem);
  line-height: 1.06;
  color: #0f172a;
  margin-bottom: 0.9rem;
}

.landing-subtitle {
  color: #334155;
  font-size: 1.04rem;
  line-height: 1.7;
  margin-bottom: 1.3rem;
}

.landing-cta {
  border: none;
  border-radius: 999px;
  padding: 0.86rem 1.35rem;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  background: linear-gradient(135deg, #2563eb, #7c3aed 55%, #ec4899);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(79, 70, 229, 0.3);
  transition: transform 0.16s ease, filter 0.16s ease;
}

.landing-cta:hover {
  transform: translateY(-1px) scale(1.01);
  filter: saturate(1.12);
}

.landing-glow {
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 999px;
  filter: blur(44px);
  opacity: 0.7;
}

.landing-glow-one {
  top: -120px;
  left: -60px;
  background: #a5b4fc;
}

.landing-glow-two {
  bottom: -160px;
  right: -80px;
  background: #f9a8d4;
}

.app {
  min-height: 100dvh;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.2rem;
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 1.2rem;
}

.app-hidden {
  display: none;
}

.sidebar,
.preview-panel {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid #dbe5f5;
  border-radius: 18px;
  box-shadow: 0 14px 35px rgba(74, 85, 162, 0.12);
  backdrop-filter: blur(8px);
}

.sidebar {
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  position: relative;
  overflow: hidden;
}

.sidebar::before {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  top: -110px;
  right: -80px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(236, 72, 153, 0.24) 0%, rgba(236, 72, 153, 0) 70%);
  pointer-events: none;
}

.sidebar-title {
  font-size: 1.45rem;
  line-height: 1.1;
  color: #0f172a;
  background: linear-gradient(135deg, #1d4ed8, #7c3aed 55%, #db2777);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sidebar-hint {
  font-size: 0.88rem;
  color: #475569;
}

.btn-fetch {
  width: 100%;
  padding: 0.8rem 1rem;
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 55%, #ec4899 100%);
  color: #fff;
  border: none;
  border-radius: 12px;
  box-shadow: 0 10px 20px rgba(124, 58, 237, 0.25);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.btn-fetch:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 24px rgba(124, 58, 237, 0.35);
  filter: saturate(1.08);
}

.btn-fetch:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.status-message {
  min-height: 1.2rem;
  margin-top: -0.2rem;
  font-size: 0.82rem;
  color: #2563eb;
  font-weight: 600;
}

.status-message.is-error {
  color: #dc2626;
}

.panel {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 0.8rem;
  background: linear-gradient(180deg, #fbfdff 0%, #f5f9ff 100%);
  box-shadow: inset 0 1px 0 #ffffff;
}

.panel-title {
  font-size: 0.86rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 0.55rem;
}

.font-row {
  font-size: 0.92rem;
  margin-bottom: 0.28rem;
  color: #334155;
}

.font-row span {
  font-weight: 600;
  color: #0f172a;
  background: #eef2ff;
  border: 1px solid #dbe5ff;
  border-radius: 8px;
  padding: 0.08rem 0.4rem;
}

.slot-label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.45rem;
  font-size: 0.9rem;
  color: #334155;
  padding: 0.25rem 0.45rem;
  border-radius: 999px;
  transition: background-color 0.14s ease;
}

.slot-label:hover {
  background: #eef2ff;
}

.lock {
  accent-color: #4f46e5;
}

.input-label {
  display: block;
  font-size: 0.82rem;
  color: #64748b;
  margin: 0.52rem 0 0.3rem;
}

.text-input {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  padding: 0.55rem 0.65rem;
  font: inherit;
  font-size: 0.92rem;
  color: #0f172a;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.text-input:focus {
  outline: none;
  border-color: #818cf8;
  box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.2);
}

.preview-panel {
  padding: 2rem 2.3rem;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  position: relative;
  overflow: hidden;
}

.preview-panel::after {
  content: "";
  position: absolute;
  width: 300px;
  height: 300px;
  bottom: -140px;
  right: -120px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.18) 0%, rgba(56, 189, 248, 0) 72%);
  pointer-events: none;
}

.preview-header,
.preview-subheader,
.preview-body {
  overflow-wrap: anywhere;
}

.preview-header {
  font-size: clamp(2.1rem, 4.2vw, 3.4rem);
  font-weight: 700;
  line-height: 1.15;
  color: #0b1220;
}

.preview-subheader {
  font-size: clamp(1.3rem, 2.3vw, 1.9rem);
  font-weight: 600;
  color: #1e3a8a;
}

.preview-body {
  font-size: 1.08rem;
  line-height: 1.75;
  color: #243248;
}

.sample-line {
  font-size: 0.9rem;
  line-height: 1.5;
  color: #64748b;
  border-bottom: 1px dashed #cfd8ea;
  padding-bottom: 0.9rem;
}

@media (max-width: 880px) {
  .landing-content {
    padding: 1.55rem 1.1rem;
  }

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

  .preview-panel {
    padding: 1.3rem;
  }
}

/* Visual refresh v2 */
:root {
  --bg-a: #fff7ed;
  --bg-b: #f0f9ff;
  --card: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --primary: #7c3aed;
  --accent: #06b6d4;
  --pink: #ec4899;
}

body {
  background: radial-gradient(circle at 12% 10%, #ffe4e6 0%, #fff7ed 30%, #eef2ff 62%, #ecfeff 100%);
  color: var(--ink);
}

.landing {
  background: radial-gradient(circle at 8% 12%, #fecdd3 0%, #fde68a 30%, #c4b5fd 62%, #a5f3fc 100%);
}

.landing-content {
  background: rgba(255, 255, 255, 0.78);
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 24px 60px rgba(17, 24, 39, 0.15);
}

.landing-title {
  color: #111827;
  letter-spacing: -0.02em;
}

.landing-subtitle {
  color: #334155;
}

.landing-cta {
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary), var(--pink));
  box-shadow: 0 14px 30px rgba(124, 58, 237, 0.34);
}

.app {
  max-width: 1240px;
  gap: 1.5rem;
  padding-top: 1.6rem;
}

.sidebar,
.preview-panel {
  border-radius: 22px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.09);
}

.sidebar {
  background: linear-gradient(165deg, #ffffff 0%, #f8faff 100%);
  padding: 1.35rem;
  gap: 0.95rem;
}

.sidebar-title {
  font-size: 1.55rem;
}

.sidebar-hint {
  color: var(--muted);
}

.btn-fetch {
  border-radius: 14px;
  background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
  box-shadow: 0 10px 22px rgba(139, 92, 246, 0.32);
}

.btn-fetch:hover {
  transform: translateY(-2px) scale(1.01);
}

.panel {
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid #e2e8f0;
}

.panel-title {
  color: #475569;
}

.font-row span {
  background: #f5f3ff;
  border: 1px solid #ddd6fe;
  color: #4c1d95;
}

.slot-label {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.35rem 0.55rem;
}

.slot-label:hover {
  border-color: #ddd6fe;
  background: #f8f5ff;
}

.text-input {
  border-radius: 12px;
  border: 1px solid #d6deea;
}

.text-input:focus {
  border-color: #a78bfa;
  box-shadow: 0 0 0 4px rgba(167, 139, 250, 0.22);
}

.style-group + .style-group {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed #d7e1ee;
}

.style-group-title {
  font-size: 0.86rem;
  color: #334155;
  margin-bottom: 0.25rem;
}

.range-input {
  width: 100%;
  margin: 0.2rem 0 0.2rem;
  accent-color: #7c3aed;
}

.value-chip {
  float: right;
  font-size: 0.72rem;
  font-weight: 700;
  color: #4c1d95;
  background: #f3e8ff;
  border: 1px solid #e9d5ff;
  border-radius: 999px;
  padding: 0.1rem 0.4rem;
}

.color-input {
  width: 100%;
  height: 2rem;
  border: 1px solid #d6deea;
  border-radius: 10px;
  padding: 0.15rem;
  cursor: pointer;
  background: #fff;
}

.preview-panel {
  background:
    radial-gradient(circle at 95% 12%, rgba(236, 72, 153, 0.13) 0%, rgba(236, 72, 153, 0) 42%),
    radial-gradient(circle at 8% 90%, rgba(6, 182, 212, 0.12) 0%, rgba(6, 182, 212, 0) 38%),
    #ffffff;
  padding: 2.3rem 2.5rem;
  gap: 1.25rem;
}

.preview-header {
  color: #111827;
  letter-spacing: -0.02em;
}

.preview-subheader {
  color: #4f46e5;
}

.preview-body {
  color: #334155;
}

.text-editor-panel {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  padding: 0.85rem;
}

.editor-actions {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.65rem;
}

.editor-actions .btn-fetch {
  width: 100%;
}

.editor-actions .status-message {
  margin-top: 0;
}

.text-editor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
}

.preview-content {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.preview-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.preview-line-body {
  align-items: flex-start;
}

.edit-text-btn {
  border: 1px solid #d7def0;
  background: #ffffff;
  color: #4f46e5;
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.edit-text-btn:hover {
  background: #eef2ff;
  border-color: #c7d2fe;
}

.hidden {
  display: none !important;
}

.text-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.text-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(2px);
}

.text-modal-card {
  position: relative;
  z-index: 2;
  width: min(680px, 95vw);
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.24);
  padding: 1rem;
}

.text-modal-title {
  font-size: 1.15rem;
  color: #0f172a;
}

.text-modal-subtitle {
  margin-top: 0.15rem;
  font-size: 0.88rem;
  color: #64748b;
}

.text-modal-input {
  margin-top: 0.75rem;
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 0.75rem;
  font: inherit;
  font-size: 0.98rem;
  color: #0f172a;
  line-height: 1.5;
  resize: vertical;
}

.text-modal-input:focus {
  outline: none;
  border-color: #a78bfa;
  box-shadow: 0 0 0 4px rgba(167, 139, 250, 0.22);
}

.text-modal-actions {
  margin-top: 0.75rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.modal-btn {
  border: 1px solid #dbe3f3;
  border-radius: 10px;
  padding: 0.45rem 0.8rem;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}

.modal-btn-secondary {
  background: #fff;
  color: #334155;
}

.modal-btn-primary {
  background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
  color: #fff;
  border-color: transparent;
}

.under-preview-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
  margin-top: 0.35rem;
}

.sample-line {
  color: #64748b;
  border-bottom: 1px dashed #cbd5e1;
  padding-bottom: 1rem;
}

@media (max-width: 880px) {
  .app {
    gap: 1rem;
    padding: 1rem;
  }

  .sidebar,
  .preview-panel {
    border-radius: 16px;
  }

  .text-editor-grid {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }

  .under-preview-controls {
    grid-template-columns: 1fr;
  }
}

/* Layout update: separate preview and controls cards */
.generate-panel .btn-fetch {
  width: 100%;
}

.generate-panel .status-message {
  margin-top: 0.35rem;
  min-height: 1.05rem;
}

.preview-panel {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  padding: 0 !important;
  gap: 1rem !important;
  overflow: visible;
}

.preview-panel::after {
  display: none;
}

.preview-card,
.under-preview-card {
  background:
    radial-gradient(circle at 95% 12%, rgba(236, 72, 153, 0.1) 0%, rgba(236, 72, 153, 0) 42%),
    radial-gradient(circle at 8% 90%, rgba(6, 182, 212, 0.1) 0%, rgba(6, 182, 212, 0) 38%),
    #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 22px;
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.09);
}

.preview-card {
  padding: 2.3rem 2.5rem;
}

.under-preview-card {
  padding: 1rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.under-preview-section {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #ffffff;
  padding: 0.85rem;
}

@media (max-width: 880px) {
  .preview-card {
    padding: 1.3rem;
  }

  .under-preview-card {
    grid-template-columns: 1fr;
  }
}

/* Landing refresh: no boxed card */
.landing {
  background:
    radial-gradient(circle at 10% 14%, #f9a8d4 0%, rgba(249, 168, 212, 0) 30%),
    radial-gradient(circle at 88% 18%, #a5b4fc 0%, rgba(165, 180, 252, 0) 34%),
    radial-gradient(circle at 24% 88%, #67e8f9 0%, rgba(103, 232, 249, 0) 35%),
    linear-gradient(135deg, #fff7ed 0%, #fdf4ff 45%, #eef2ff 100%);
}

.landing-content {
  max-width: 860px;
  text-align: center;
  padding: 1.2rem;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.landing-kicker {
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  color: #7c3aed;
  margin-bottom: 0.7rem;
}

.landing-title {
  font-size: clamp(3rem, 9vw, 7rem);
  line-height: 0.95;
  margin-bottom: 0.75rem;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 45%, #ec4899 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.landing-subtitle {
  font-size: clamp(1.05rem, 2.1vw, 1.5rem);
  color: #334155;
  margin-bottom: 1.35rem;
}

.landing-subtitle em {
  font-style: italic;
  color: #be185d;
}

.landing-cta {
  padding: 0.95rem 1.6rem;
  font-size: 1.03rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 55%, #ec4899 100%);
  box-shadow: 0 18px 34px rgba(124, 58, 237, 0.35);
}

.landing-glow {
  opacity: 0.9;
  filter: blur(55px);
}

@media (max-width: 880px) {
  .landing-content {
    padding: 0.5rem;
  }
}
