:root {
  --bg: #eef2f6;
  --bg-soft: #f7f9fc;
  --text: #0f1723;
  --subtext: #4a5568;
  --line: rgba(15, 23, 35, 0.1);
  --glass: rgba(255, 255, 255, 0.7);
  --glass-soft: rgba(255, 255, 255, 0.55);
  --shadow: 0 24px 44px rgba(15, 23, 35, 0.08);
  --radius-lg: 24px;
  --radius-md: 16px;
  --accent: #3f78ff;
  --success: #0d9f6f;
  --error: #bc2f3f;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "SF Pro Display", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #f9fbff 0%, var(--bg) 42%, #ecf1f8 100%);
}

body {
  position: relative;
  overflow-x: hidden;
}

.bg-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.bg-grid {
  opacity: 0.35;
  background-image: linear-gradient(rgba(23, 45, 77, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 45, 77, 0.05) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(circle at center, black, transparent 78%);
}

.bg-glow {
  border-radius: 999px;
  filter: blur(68px);
}

.glow-a {
  width: 360px;
  height: 360px;
  top: -130px;
  right: 6%;
  background: rgba(114, 193, 255, 0.4);
}

.glow-b {
  width: 320px;
  height: 320px;
  left: 10%;
  bottom: -120px;
  background: rgba(142, 224, 193, 0.25);
}

.app-shell {
  position: relative;
  z-index: 1;
  max-width: 1320px;
  margin: 0 auto;
  padding: 24px 18px 48px;
  display: grid;
  gap: 16px;
}

.glass {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.topbar {
  padding: 20px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.eyebrow {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--subtext);
}

h1 {
  margin: 8px 0 6px;
  font-size: clamp(1.5rem, 3.4vw, 2.3rem);
  font-weight: 660;
}

h2 {
  margin: 0;
  font-size: 1.25rem;
}

h3 {
  margin: 0;
  font-size: 1.02rem;
}

h4 {
  margin: 0;
  font-size: 0.95rem;
}

p {
  margin: 0;
}

.lead {
  color: var(--subtext);
  max-width: 520px;
}

.status-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.82);
}

.status-pill.ok {
  color: var(--success);
  border-color: color-mix(in srgb, var(--success), white 70%);
}

.status-pill.error {
  color: var(--error);
  border-color: color-mix(in srgb, var(--error), white 70%);
}

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

.stat-card {
  padding: 14px 16px;
}

.stat-card p {
  font-size: 12px;
  color: var(--subtext);
  margin-bottom: 6px;
}

.stat-card strong {
  font-size: 1.3rem;
  font-weight: 650;
}

.workspace-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: 320px minmax(0, 1fr);
}

.sidebar {
  padding: 14px;
  align-self: start;
  position: sticky;
  top: 12px;
  display: grid;
  gap: 12px;
}

.tab-nav {
  display: grid;
  gap: 8px;
}

.tab-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  border-radius: 12px;
  padding: 10px 12px;
  text-align: left;
  font: inherit;
  font-weight: 520;
  color: var(--text);
  cursor: pointer;
  line-height: 1.25;
  white-space: normal;
  overflow-wrap: anywhere;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}

.tab-btn:hover {
  transform: translateY(-1px);
}

.tab-btn.is-active {
  border-color: rgba(63, 120, 255, 0.4);
  background: linear-gradient(180deg, #ffffff 0%, #eef4ff 100%);
}

.side-block {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px;
  background: rgba(255, 255, 255, 0.56);
  display: grid;
  gap: 10px;
}

.side-hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
  color: var(--subtext);
}

.side-block.muted p {
  color: var(--subtext);
  line-height: 1.4;
  font-size: 13px;
}

.btn-row {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr;
}

.panels {
  display: grid;
}

.panel {
  padding: 18px;
  display: none;
}

.panel.is-active {
  display: grid;
  gap: 14px;
  animation: fadeInUp 160ms ease;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.panel-header {
  display: flex;
  gap: 12px;
  align-items: start;
  justify-content: space-between;
}

.panel-header p {
  margin-top: 4px;
  color: var(--subtext);
  font-size: 13px;
}

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

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

.stack {
  display: grid;
  gap: 10px;
}

.wizard-form {
  gap: 14px;
}

.helper-note {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(63, 120, 255, 0.3);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--subtext);
  font-size: 13px;
  line-height: 1.35;
}

.wizard-head {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.52);
}

.wizard-step-row {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.wizard-step {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.74);
  border-radius: 12px;
  padding: 8px 10px;
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.25;
  white-space: normal;
  overflow-wrap: anywhere;
}

.wizard-step span {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
}

.wizard-step.is-active {
  border-color: rgba(63, 120, 255, 0.45);
  background: linear-gradient(180deg, #ffffff 0%, #eef4ff 100%);
}

.wizard-step.is-done {
  border-color: rgba(13, 159, 111, 0.35);
}

.wizard-step.is-done span {
  border-color: rgba(13, 159, 111, 0.55);
}

.progress-track {
  height: 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  overflow: hidden;
}

.progress-fill {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #3f78ff 0%, #6fa3ff 100%);
  transition: width 180ms ease;
}

.progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: var(--subtext);
}

.wizard-pane {
  display: none;
  gap: 12px;
}

.wizard-pane.is-active {
  display: grid;
}

.wizard-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.hint-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
}

.hint-list li {
  color: var(--subtext);
  font-size: 12px;
}

.review-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.5);
  padding: 12px;
  display: grid;
  gap: 10px;
}

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

.review-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px 10px;
  background: rgba(255, 255, 255, 0.7);
}

.review-item p {
  font-size: 11px;
  color: var(--subtext);
  margin-bottom: 4px;
}

.review-item strong {
  font-size: 14px;
  display: block;
  overflow-wrap: anywhere;
}

.review-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
}

.review-list li {
  color: var(--subtext);
  font-size: 13px;
}

label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: var(--subtext);
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 11px;
  font: inherit;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: rgba(63, 120, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(63, 120, 255, 0.12);
}

textarea {
  resize: vertical;
}

.btn {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--text);
  font: inherit;
  font-weight: 560;
  padding: 10px 14px;
  cursor: pointer;
  line-height: 1.25;
  white-space: normal;
  overflow-wrap: anywhere;
  transition: transform 120ms ease, border-color 120ms ease;
}

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

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn.primary {
  border-color: rgba(63, 120, 255, 0.35);
  background: linear-gradient(180deg, #ffffff 0%, #eaf1ff 100%);
}

.btn.ghost {
  background: transparent;
}

.btn.danger {
  color: #ab3242;
  border-color: rgba(171, 50, 66, 0.35);
}

.btn.tiny {
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 12px;
}

.event-input {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.soft {
  background: var(--glass-soft);
}

.inline-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.event-suggest {
  border: 1px dashed rgba(63, 120, 255, 0.3);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.6);
  padding: 10px;
}

.suggest-title {
  font-size: 12px;
  color: var(--subtext);
  margin-bottom: 4px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.55);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  text-align: left;
  padding: 11px 10px;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

th {
  color: var(--subtext);
  font-weight: 600;
  background: rgba(255, 255, 255, 0.78);
}

td:last-child,
th:last-child {
  min-width: 120px;
}

.divider {
  height: 1px;
  background: var(--line);
}

.meta {
  margin: 0;
  color: var(--subtext);
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.small-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.small-inline input {
  width: 280px;
}

.export-box {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px;
  background: rgba(255, 255, 255, 0.45);
}

.list {
  margin: 6px 0 0;
  padding-left: 18px;
  color: var(--subtext);
  font-size: 12px;
}

.notice {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: 360px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
  font-size: 13px;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 150ms ease, transform 150ms ease;
  z-index: 12;
}

.notice.show {
  opacity: 1;
  transform: translateY(0);
}

.notice.success {
  border-color: color-mix(in srgb, var(--success), white 70%);
}

.notice.error {
  border-color: color-mix(in srgb, var(--error), white 70%);
}

@media (max-width: 1080px) {
  .workspace-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

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

  .tab-btn {
    text-align: center;
  }
}

@media (max-width: 860px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .stats-row,
  .two-col,
  .btn-row,
  .wizard-step-row,
  .review-grid {
    grid-template-columns: 1fr;
  }

  .small-inline {
    display: grid;
  }

  .small-inline input {
    width: 100%;
  }

  .tab-nav {
    grid-template-columns: 1fr;
  }

  .progress-meta {
    flex-direction: column;
    align-items: flex-start;
  }

  .wizard-actions {
    justify-content: stretch;
    flex-wrap: wrap;
  }
}
