@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,600;9..144,700&family=IBM+Plex+Mono:wght@400;500&family=Space+Grotesk:wght@400;500;600;700&display=swap");

:root {
  color-scheme: light;
  --bg: #f5efe6;
  --bg-soft: #efe5d8;
  --panel: rgba(255, 255, 255, 0.78);
  --panel-strong: rgba(255, 255, 255, 0.92);
  --panel-border: rgba(45, 34, 24, 0.12);
  --text: #1b1a18;
  --muted: #5f5349;
  --accent: #ff7d4f;
  --accent-2: #2c9ea6;
  --accent-3: #f5c06a;
  --accent-soft: rgba(255, 125, 79, 0.16);
  --accent-ink: #6a2f1a;
  --shadow: 0 24px 60px rgba(26, 20, 14, 0.18);
  --shadow-soft: 0 16px 36px rgba(26, 20, 14, 0.12);
  --font-body: "Space Grotesk", "Segoe UI", sans-serif;
  --font-display: "Fraunces", "Times New Roman", serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", "Consolas", monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 12%, rgba(255, 204, 111, 0.32), transparent 45%),
    radial-gradient(circle at 80% 10%, rgba(43, 158, 166, 0.2), transparent 48%),
    linear-gradient(120deg, #f6efe4 0%, #faefe6 38%, #f0f4ef 100%);
  color: var(--text);
  font-family: var(--font-body);
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.4) 1px, transparent 1px);
  background-size: 4px 4px;
  opacity: 0.12;
  mix-blend-mode: soft-light;
  pointer-events: none;
  z-index: 0;
}

.bg-orb {
  position: fixed;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(6px);
  opacity: 0.6;
  z-index: 0;
  pointer-events: none;
}

.orb-a {
  top: -80px;
  left: -120px;
  background: radial-gradient(circle at 30% 30%, rgba(255, 204, 111, 0.8), rgba(255, 204, 111, 0));
  animation: float 18s ease-in-out infinite;
}

.orb-b {
  bottom: -140px;
  right: -120px;
  background: radial-gradient(circle at 35% 35%, rgba(43, 158, 166, 0.75), rgba(43, 158, 166, 0));
  animation: float 22s ease-in-out infinite reverse;
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(28, 27, 25, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(28, 27, 25, 0.06) 1px, transparent 1px);
  background-size: 44px 44px;
  opacity: 0.28;
  pointer-events: none;
  z-index: 1;
}

.container {
  position: relative;
  z-index: 2;
  width: min(1200px, 92vw);
  margin: 0 auto;
  padding: 48px 0 72px;
}

.mast {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.mast-actions {
  position: sticky;
  top: 24px;
  align-self: start;
}

.mast-text h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.4rem, 2.4vw + 1.6rem, 3.6rem);
  margin: 10px 0 12px;
  letter-spacing: -0.02em;
}

.mast-text p {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 34rem;
}

.quick-start {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
}

.quick-step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.66);
  border: 1px dashed rgba(45, 34, 24, 0.12);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(8px);
}

.step-index {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-weight: 700;
  display: grid;
  place-items: center;
  font-size: 0.85rem;
}

.step-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.step-desc {
  font-size: 0.82rem;
  color: var(--muted);
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-size: 0.72rem;
}

.status-card {
  background: var(--panel-strong);
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  padding: 18px 20px;
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(16px);
  position: relative;
  overflow: hidden;
}

.status-card::after {
  content: "";
  position: absolute;
  top: -90px;
  right: -80px;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(255, 204, 111, 0.4), transparent 70%);
  opacity: 0.7;
  pointer-events: none;
}

.status-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.98rem;
  margin-bottom: 10px;
  color: var(--muted);
  gap: 8px;
  flex-wrap: wrap;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  background: rgba(28, 27, 25, 0.08);
  color: var(--muted);
  gap: 6px;
}

.status-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.6;
}

.status-badge.is-good {
  background: rgba(43, 158, 166, 0.2);
  color: #0b4f53;
}

.status-badge.is-bad {
  background: rgba(255, 122, 75, 0.22);
  color: #7c2c17;
}

.status-badge.is-warn {
  background: rgba(255, 204, 111, 0.4);
  color: #6a4510;
}

.status-message {
  margin: 10px 0 0;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.4;
}

.status-message[data-state="error"] {
  color: #b44324;
}

.status-message[data-state="info"] {
  color: #8a5a1f;
}

.status-message[data-state="success"] {
  color: #1b6a70;
}

.action-row {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
  align-items: center;
}

button {
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
  position: relative;
}

button.primary {
  color: #fff;
  background: linear-gradient(120deg, #ff7a4b 0%, #ffb347 100%);
  box-shadow: 0 12px 24px rgba(255, 122, 75, 0.3);
}

button.ghost {
  color: var(--text);
  background: rgba(28, 27, 25, 0.08);
}

button.small {
  padding: 8px 14px;
  font-size: 0.82rem;
}

button.danger {
  color: #7c2c17;
  background: rgba(255, 122, 75, 0.2);
}

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

button:active {
  transform: translateY(1px);
}

button:focus-visible {
  outline: 2px solid rgba(43, 158, 166, 0.55);
  outline-offset: 2px;
}

button[data-loading="true"] {
  cursor: progress;
  opacity: 0.7;
  pointer-events: none;
  padding-right: 36px;
}

button[data-loading="true"]::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 14px;
  width: 12px;
  height: 12px;
  margin-top: -6px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-top-color: transparent;
  animation: spin 0.8s linear infinite;
}

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

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  padding: 20px 22px;
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(14px);
  opacity: 0;
  transform: translateY(18px);
  animation: panelIn 0.6s ease forwards;
  animation-delay: var(--delay, 0s);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.panel:hover,
.panel:focus-within {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: rgba(255, 125, 79, 0.28);
}

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

.panel-header h2 {
  margin: 0;
  font-size: 1.2rem;
}

.panel-hint {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 14px 0 12px;
  font-size: 0.95rem;
}

input,
textarea,
select {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(28, 27, 25, 0.12);
  padding: 10px 12px;
  font-size: 0.95rem;
  font-family: var(--font-body);
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: rgba(255, 122, 75, 0.6);
  box-shadow: 0 0 0 3px rgba(255, 122, 75, 0.18);
}

input::placeholder,
textarea::placeholder {
  color: rgba(95, 83, 73, 0.6);
}

textarea {
  resize: vertical;
  min-height: 120px;
}

input[type="number"] {
  max-width: 200px;
}

.input-with-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
}

.input-with-toggle input {
  flex: 1;
}

.input-with-toggle.compact {
  gap: 8px;
}

.input-with-toggle .toggle-visibility {
  white-space: nowrap;
}

.field-note {
  font-size: 0.82rem;
  color: var(--muted);
}

.field-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.field-row select {
  flex: 1;
}

.meta-line {
  font-size: 0.85rem;
  color: var(--muted);
}

.meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--muted);
  gap: 12px;
  flex-wrap: wrap;
}

.warn {
  color: #b44324;
}

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

.session-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.session-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(28, 27, 25, 0.1);
  background: rgba(255, 255, 255, 0.82);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.session-row:hover,
.session-row:focus-within {
  border-color: rgba(43, 158, 166, 0.4);
  box-shadow: 0 10px 24px rgba(27, 23, 18, 0.12);
  transform: translateY(-1px);
}

.session-info {
  display: flex;
  align-items: center;
  gap: 6px;
}

.session-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}

.session-input {
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.95);
}

.switch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.switch {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.92rem;
  color: var(--text);
  position: relative;
}

.switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.switch span {
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: rgba(28, 27, 25, 0.2);
  position: relative;
  transition: background 0.2s ease;
}

.switch span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease;
}

.switch:hover span {
  background: rgba(28, 27, 25, 0.28);
}

.switch input:focus-visible + span {
  box-shadow: 0 0 0 3px rgba(43, 158, 166, 0.25);
}

.switch input:checked + span {
  background: rgba(43, 158, 166, 0.7);
}

.switch input:checked + span::after {
  transform: translateX(20px);
}

.mono {
  font-family: var(--font-mono);
}

.footer {
  margin-top: 32px;
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-row {
  padding: 12px 0;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0) translateX(0);
  }
  50% {
    transform: translateY(18px) translateX(12px);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

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

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

  .mast-actions {
    position: static;
  }

  .quick-start {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 640px) {
  .container {
    padding: 32px 0 48px;
  }

  .action-row {
    flex-direction: column;
  }

  .status-line {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .field-row {
    flex-direction: column;
    align-items: stretch;
  }

  .session-row {
    grid-template-columns: 1fr;
  }

  .session-row .remove-session {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition: none !important;
  }
}
