:root {
  --ink: #232136;
  --muted: #65637a;
  --purple: #6856e8;
  --purple-dark: #4937c7;
  --purple-soft: #eeebff;
  --line: #dddbea;
  --paper: #ffffff;
  --canvas: #f5f4fb;
  --danger: #b42318;
  --danger-soft: #fff1ef;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 15%, rgba(104, 86, 232, .16), transparent 31rem),
    linear-gradient(135deg, #f8f7fc 0%, #efedf8 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.shell {
  width: min(1180px, calc(100% - 40px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 54px 0;
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  gap: clamp(40px, 7vw, 90px);
  align-items: start;
}

.intro { padding: 48px 0 24px; }

.brand {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .13em;
}

.brand-mark {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: #fff;
  background: var(--purple);
  border-radius: 9px;
  box-shadow: 0 8px 20px rgba(104, 86, 232, .28);
}

.eyebrow, .step {
  margin: 50px 0 15px;
  color: var(--purple-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .16em;
}

h1 {
  margin: 0;
  font-size: clamp(42px, 5vw, 68px);
  line-height: .99;
  letter-spacing: -.055em;
}

h1 span { color: var(--purple); }

.lead {
  max-width: 500px;
  margin: 28px 0 40px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.65;
}

.feature-list { display: grid; gap: 22px; }

.feature-list div {
  position: relative;
  padding-left: 24px;
  display: grid;
  gap: 4px;
}

.feature-list div::before {
  content: "";
  position: absolute;
  top: 7px;
  left: 0;
  width: 9px;
  height: 9px;
  background: var(--purple);
  border-radius: 50%;
  box-shadow: 0 0 0 5px var(--purple-soft);
}

.feature-list strong { font-size: 14px; }
.feature-list span { color: var(--muted); font-size: 13px; }

.panel {
  padding: clamp(28px, 4vw, 48px);
  background: rgba(255, 255, 255, .93);
  border: 1px solid rgba(255, 255, 255, .75);
  border-radius: 28px;
  box-shadow: 0 28px 80px rgba(45, 39, 92, .14);
  backdrop-filter: blur(18px);
}

.panel-heading { padding-bottom: 26px; border-bottom: 1px solid var(--line); }
.panel-heading .step { margin: 0 0 8px; }
.panel-heading h2 { margin: 0; font-size: 30px; letter-spacing: -.035em; }
.panel-heading p:last-child { margin: 9px 0 0; color: var(--muted); font-size: 13px; }

.alert {
  margin-top: 24px;
  padding: 15px 17px;
  display: grid;
  gap: 4px;
  color: var(--danger);
  background: var(--danger-soft);
  border: 1px solid #f2c8c3;
  border-radius: 13px;
  font-size: 13px;
  line-height: 1.45;
}

.alert.warning {
  color: #7a4d00;
  background: #fff8e7;
  border-color: #efd797;
}

form { display: grid; gap: 24px; margin-top: 26px; }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
legend { margin-bottom: 12px; font-size: 13px; font-weight: 800; }
.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

input:not([type="checkbox"]), select {
  width: 100%;
  height: 46px;
  padding: 0 13px;
  color: var(--ink);
  background: #fbfaff;
  border: 1px solid var(--line);
  border-radius: 11px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  outline: none;
  transition: border-color .18s, box-shadow .18s, background .18s;
}

input:not([type="checkbox"]):focus, select:focus {
  background: #fff;
  border-color: var(--purple);
  box-shadow: 0 0 0 4px rgba(104, 86, 232, .12);
}

.space-picker {
  padding: 16px;
  background: #fbfaff;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.space-picker legend {
  margin: 0 0 0 -4px;
  padding: 0 4px;
}

.space-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.space-toolbar-actions {
  display: flex;
  gap: 7px;
}

.space-toolbar-actions button {
  min-height: 38px;
  padding: 8px 11px;
  display: block;
  color: var(--purple-dark);
  background: var(--purple-soft);
  border: 1px solid #d9d3ff;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 800;
}

.space-meta {
  margin: 12px 2px 8px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 11px;
}

.space-meta strong { color: var(--ink); }

.space-list {
  max-height: 206px;
  padding: 7px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  scrollbar-gutter: stable;
}

.space-option {
  min-width: 0;
  padding: 9px 10px;
  display: flex;
  gap: 9px;
  align-items: center;
  color: var(--ink);
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
}

.space-option:hover { background: var(--purple-soft); }
.space-option[hidden] { display: none; }
.space-option span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.space-option input[type="checkbox"] {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  margin: 0;
  accent-color: var(--purple);
}

.space-validation {
  margin: 9px 2px 0;
  color: var(--danger);
  font-size: 11px;
  font-weight: 700;
}

.empty-spaces { margin: 0; color: var(--muted); font-size: 12px; }
.task-type-filter { margin-top: 14px; }

.hint { margin: 9px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.actions { display: grid; grid-template-columns: 1.15fr .85fr; gap: 12px; padding-top: 4px; }

button {
  min-height: 56px;
  padding: 10px 18px;
  display: grid;
  gap: 2px;
  place-content: center;
  border-radius: 13px;
  cursor: pointer;
  font: inherit;
  transition: transform .16s, box-shadow .16s, border-color .16s;
}

button:hover { transform: translateY(-1px); }
button:active { transform: translateY(0); }
button span { font-size: 14px; font-weight: 800; }
button small { font-size: 10px; opacity: .74; }
button:disabled { cursor: wait; opacity: .68; transform: none; }
button.is-loading span { display: flex; align-items: center; gap: 8px; }
button.is-loading span::before {
  width: 13px;
  height: 13px;
  content: "";
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

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

@media (prefers-reduced-motion: reduce) {
  button.is-loading span::before { animation-duration: 1.4s; }
}

.primary {
  color: #fff;
  background: var(--purple);
  border: 1px solid var(--purple);
  box-shadow: 0 12px 26px rgba(104, 86, 232, .24);
}

.primary:hover { background: var(--purple-dark); box-shadow: 0 15px 30px rgba(104, 86, 232, .3); }
.secondary { color: var(--ink); background: #fff; border: 1px solid var(--line); }
.secondary:hover { border-color: #aaa5ce; box-shadow: 0 10px 20px rgba(45, 39, 92, .08); }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; padding: 32px 0 48px; }
  .intro { padding: 24px 0 0; }
  .eyebrow { margin-top: 36px; }
  .feature-list { display: none; }
  .lead { margin-bottom: 0; }
}

@media (max-width: 560px) {
  .shell { width: min(100% - 24px, 1180px); }
  .panel { padding: 24px 18px; border-radius: 20px; }
  .grid.two, .actions { grid-template-columns: 1fr; }
  .space-toolbar, .space-list { grid-template-columns: 1fr; }
  .space-toolbar-actions { flex-wrap: wrap; }
  .space-meta { display: grid; gap: 3px; }
  h1 { font-size: 42px; }
}
