:root {
  color: #e5eefc;
  background: #070a12;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --surface: rgba(14, 20, 35, 0.76);
  --surface-strong: rgba(17, 25, 42, 0.9);
  --surface-bright: rgba(255, 255, 255, 0.08);
  --line: rgba(148, 163, 184, 0.2);
  --line-strong: rgba(226, 232, 240, 0.28);
  --text: #e5eefc;
  --muted: #93a4bc;
  --muted-strong: #b8c4d8;
  --accent: #8b5cf6;
  --accent-2: #06b6d4;
  --accent-3: #22c55e;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.38);
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 12% 12%, rgba(124, 58, 237, 0.42), transparent 32rem),
    radial-gradient(circle at 82% 8%, rgba(6, 182, 212, 0.3), transparent 30rem),
    radial-gradient(circle at 50% 92%, rgba(34, 197, 94, 0.16), transparent 34rem),
    linear-gradient(135deg, #070a12 0%, #0b1020 48%, #111827 100%);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent 75%);
}

button, input { font: inherit; }

#app {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 56px 0;
}

.hero {
  position: relative;
  margin-bottom: 28px;
  text-align: center;
}

.hero::after {
  position: absolute;
  right: 12%;
  bottom: -10px;
  width: 150px;
  height: 150px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.36), rgba(6, 182, 212, 0.18));
  filter: blur(20px);
  content: "";
  opacity: 0.7;
  pointer-events: none;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding: 8px 14px 8px 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 16px 40px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(18px);
}

.brand-mark {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 12px;
  color: #07111f;
  background: linear-gradient(135deg, #a7f3d0, #67e8f9 45%, #c4b5fd);
  box-shadow: 0 10px 24px rgba(6, 182, 212, 0.28);
  font-weight: 900;
}

.brand-name {
  color: #f8fbff;
  font-size: 0.92rem;
  font-weight: 900;
  letter-spacing: -0.01em;
}

.eyebrow {
  margin: 0 0 10px;
  color: #67e8f9;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1, h2, p { margin-top: 0; }

h1 {
  max-width: 880px;
  margin: 0 auto 16px;
  color: #f8fafc;
  font-size: clamp(2.7rem, 8vw, 6.4rem);
  line-height: 0.88;
  letter-spacing: -0.075em;
  text-wrap: balance;
}

.lede {
  max-width: 700px;
  margin: 0 auto;
  color: var(--muted-strong);
  font-size: clamp(1.05rem, 2vw, 1.28rem);
  line-height: 1.55;
}

.fallback-card {
  margin-top: 80px;
  padding: 40px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.fallback-card code {
  padding: 0.12em 0.35em;
  border-radius: 6px;
  background: rgba(103, 232, 249, 0.16);
  color: #67e8f9;
  font-size: 0.92em;
}

.toolbar, .options-card, .summary-card, .panel {
  border: 1px solid var(--line);
  border-radius: 30px;
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
  padding: 14px;
  flex-wrap: wrap;
}

.button {
  min-height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 0 20px;
  cursor: pointer;
  font-weight: 900;
  letter-spacing: -0.01em;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, border-color 160ms ease;
}

.button:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.22);
}

.button-primary {
  color: #07111f;
  background: linear-gradient(135deg, #a7f3d0, #67e8f9 48%, #c4b5fd);
  box-shadow: 0 18px 38px rgba(6, 182, 212, 0.28);
}

.button-secondary {
  color: #e0f2fe;
  background: rgba(14, 165, 233, 0.14);
}

.button-ghost {
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.06);
}

.status {
  margin: 0 0 0 auto;
  color: var(--muted-strong);
  font-weight: 800;
}

.status[data-tone="success"] { color: #86efac; }
.status[data-tone="warning"] { color: #fbbf24; }

.panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  margin-bottom: 22px;
}

.panel {
  overflow: hidden;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.02));
}

.panel-header label {
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 950;
}

.panel-header span {
  color: var(--muted);
  font-size: 0.88rem;
  text-align: right;
}

.editor {
  min-height: 420px;
  max-height: 65vh;
  overflow: auto;
  padding: 22px;
  outline: none;
  background: rgba(3, 7, 18, 0.58);
  color: #edf5ff;
  line-height: 1.62;
}

.editor:focus {
  box-shadow: inset 0 0 0 3px rgba(103, 232, 249, 0.18);
}

.editor:empty::before {
  content: attr(data-placeholder);
  color: #64748b;
}

.editor table {
  width: 100%;
  border-collapse: collapse;
}

.editor th, .editor td {
  border: 1px solid rgba(203, 213, 225, 0.34);
  padding: 8px;
}

.editor a { color: #67e8f9; }

.editor-output { background: rgba(8, 13, 26, 0.78); }

.options-card, .summary-card {
  padding: 24px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.section-heading h2, .summary-card h2 {
  margin-bottom: 0;
  color: var(--text);
  font-size: 1.3rem;
  letter-spacing: -0.03em;
}

.section-heading p {
  max-width: 560px;
  margin-bottom: 0;
  color: var(--muted);
}

.options-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.option {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 11px;
  align-items: start;
  min-height: 92px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface-bright);
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.option:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.105);
}

.option input {
  width: 19px;
  height: 19px;
  margin-top: 3px;
  accent-color: var(--accent-2);
}

.option strong {
  display: block;
  margin-bottom: 4px;
  color: #f8fafc;
}

.option small {
  display: block;
  color: var(--muted);
  line-height: 1.4;
}

.summary-card {
  margin-top: 22px;
}

.summary-card ul {
  margin: 14px 0 0;
  padding-left: 20px;
  color: #cbd5e1;
}

@media (max-width: 900px) {
  #app { width: min(100% - 24px, 760px); padding: 32px 0; }
  .panels, .options-grid { grid-template-columns: 1fr; }
  .toolbar { align-items: stretch; }
  .button { flex: 1 1 180px; }
  .status { width: 100%; margin-left: 0; }
  .section-heading, .panel-header { display: block; }
  .panel-header span { display: block; margin-top: 4px; text-align: left; }
  .editor { min-height: 300px; }
}
