:root {
  --ink: #11110f;
  --muted: rgba(17, 17, 15, .58);
  --faint: rgba(17, 17, 15, .34);
  --paper: #f3f3ef;
  --raised: #fafaf7;
  --line: rgba(17, 17, 15, .18);
  --line-strong: rgba(17, 17, 15, .62);
  --blue: #3827c7;
  --blue-soft: rgba(56, 39, 199, .09);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --shadow-card: 0 1px 2px rgba(17, 17, 15, .04), 0 12px 34px rgba(17, 17, 15, .06);
  --shadow-float: 0 28px 90px rgba(7, 7, 7, .22);
  font-family: -apple-system, BlinkMacSystemFont, Inter, ui-sans-serif, system-ui, "Segoe UI", sans-serif;
  font-optical-sizing: auto;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
button, a, label { touch-action: manipulation; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid rgba(56, 39, 199, .26); outline-offset: 3px; }

.topbar {
  position: sticky;
  z-index: 12;
  top: 0;
  height: 72px;
  padding: 0 clamp(20px, 4vw, 64px);
  display: flex;
  align-items: center;
  gap: 24px;
  background: rgba(243, 243, 239, .78);
  border-bottom: 1px solid rgba(17, 17, 15, .1);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .62);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
}
.brand { width: 86px; height: 18px; display: block; }
.brand img { width: 100%; height: 100%; display: block; object-fit: contain; object-position: left center; }
.topbar__label { padding-left: 24px; border-left: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.account { margin-left: auto; color: var(--muted); font-size: 12px; }
.signout { min-height: 38px; padding: 0 12px; color: var(--ink); background: transparent; border: 1px solid var(--line); font-size: 12px; }
.new-button {
  min-height: 44px;
  margin-left: auto;
  padding: 0 18px;
  color: white;
  background: var(--blue);
  border: 1px solid var(--blue);
  border-radius: var(--radius-sm);
  font-weight: 720;
  box-shadow: 0 8px 22px rgba(56, 39, 199, .18);
  transition: transform 160ms cubic-bezier(.2,.8,.2,1), background 160ms ease, box-shadow 160ms ease;
}
.assistant-button {
  min-height: 44px;
  margin-left: auto;
  padding: 0 16px;
  color: var(--blue);
  background: rgba(56,39,199,.06);
  border: 1px solid rgba(56,39,199,.24);
  border-radius: var(--radius-sm);
  font-weight: 720;
  transition: transform 150ms ease, background 150ms ease, border-color 150ms ease;
}
.assistant-button:hover { background: var(--blue-soft); border-color: var(--blue); }
.assistant-button span { margin-right: 7px; }
.account:not([hidden]) + .signout + .new-button { margin-left: 0; }
.account:not([hidden]) + .signout + .assistant-button { margin-left: 12px; }
.assistant-button + .new-button { margin-left: 0; }
.new-button:hover, .create-submit:hover { background: #2f20ad; }
.new-button span { margin-right: 8px; }

main { width: min(1500px, 100%); margin: 0 auto; padding: 0 clamp(20px, 4vw, 64px) 96px; }
.hero {
  min-height: 390px;
  padding: 88px 0 56px;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, .55fr);
  align-items: end;
  gap: 64px;
  border-bottom: 1px solid var(--line-strong);
}
.eyebrow { margin: 0 0 18px; color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(76px, 10vw, 150px); line-height: .79; letter-spacing: -.075em; font-weight: 690; }
.hero__intro { max-width: 490px; margin: 0; font-size: clamp(21px, 2vw, 30px); line-height: 1.15; letter-spacing: -.035em; }

.workspace { padding-top: 48px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 32px; margin-bottom: 30px; }
.section-head .eyebrow { margin-bottom: 10px; }
.section-head h2 { margin: 0; font-size: clamp(30px, 3vw, 48px); line-height: 1; letter-spacing: -.045em; }
.section-count { color: var(--muted); font-size: 13px; }
.rail { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.workshop-row { min-width: 0; }
.workshop-index {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--ink);
  font-size: 14px;
  font-weight: 800;
}
.workshop-card {
  min-height: 390px;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: rgba(250, 250, 247, .55);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: transform 280ms cubic-bezier(.2,.8,.2,1), box-shadow 280ms cubic-bezier(.2,.8,.2,1), border-color 180ms ease;
  cursor: pointer;
}
.workshop-card:hover { transform: translateY(-4px); border-color: rgba(17,17,15,.42); box-shadow: 0 2px 4px rgba(17,17,15,.04), 0 22px 54px rgba(17,17,15,.1); }
.workshop-card:focus-visible { outline: 3px solid rgba(56,39,199,.28); outline-offset: 4px; }
.workshop-card__head { padding: 20px 22px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; border-bottom: 1px solid var(--line); }
.workshop-type { min-width: 0; overflow: hidden; color: var(--muted); font-size: 10px; font-weight: 780; letter-spacing: .09em; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.workshop-name { min-height: 142px; padding: 26px 22px 30px; }
.workshop-name h3 { margin: 0; overflow-wrap: anywhere; font-size: clamp(27px, 2.25vw, 38px); line-height: .98; letter-spacing: -.05em; }
.session-tag { width: max-content; padding: 5px 7px; color: var(--blue); border: 1px solid var(--blue); font: 700 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .08em; text-transform: uppercase; }
.session-tag.is-stopped { color: var(--muted); border-color: var(--line-strong); }
.card-details { margin-top: auto; display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); }
.card-meta { min-height: 88px; padding: 18px 22px; display: flex; flex-direction: column; justify-content: space-between; gap: 12px; }
.card-meta + .card-meta { border-left: 1px solid var(--line); }
.card-meta span { color: var(--muted); font-size: 11px; font-weight: 780; letter-spacing: .11em; text-transform: uppercase; }
.card-meta strong { font-size: 13px; font-weight: 620; }
.saved-dot { display: inline-block; width: 7px; height: 7px; margin-right: 8px; background: var(--blue); border-radius: 50%; }
.card-actions { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); }
.card-actions a, .card-actions button {
  min-height: 54px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--blue);
  background: transparent;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-weight: 720;
  text-decoration: none;
  text-align: left;
  transition: background 150ms ease, color 150ms ease, transform 100ms ease;
}
.card-actions > :nth-child(2n) { border-right: 0; }
.card-actions > :last-child { grid-column: 1 / -1; color: var(--muted); border-right: 0; border-bottom: 0; }
.card-actions a:hover, .card-actions button:hover { background: var(--blue-soft); }
.card-actions .danger-action:hover { color: #9d2f22; background: rgba(157, 47, 34, .07); }

.rail-create {
  width: 100%;
  min-height: 112px;
  margin: 18px 0 0;
  padding: 24px 28px;
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 20px;
  color: var(--ink);
  background: transparent;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  text-align: left;
  transition: transform 220ms cubic-bezier(.2,.8,.2,1), border-color 160ms ease, background 160ms ease;
}
.rail-create:hover { color: var(--blue); background: var(--blue-soft); border-color: var(--blue); transform: translateY(-2px); }
.rail-create__number { font-size: 30px; font-weight: 300; }
.rail-create b, .rail-create small { display: block; }
.rail-create b { margin-bottom: 8px; font-size: 18px; }
.rail-create small { color: var(--muted); font-size: 13px; }
.rail-create i { font-size: 24px; font-style: normal; }
.empty { padding: 50px 28px 50px 66px; border: 1px solid var(--line); color: var(--muted); }
.empty b { display: block; margin-bottom: 8px; color: var(--ink); font-size: 22px; }
.error { color: #9d2f22; }

.modal { position: fixed; z-index: 20; inset: 0; padding: 24px; display: grid; place-items: center; background: rgba(7,7,7,.44); backdrop-filter: blur(14px) saturate(120%); -webkit-backdrop-filter: blur(14px) saturate(120%); animation: modal-scrim-in 220ms ease-out both; }
.dialog { position: relative; width: min(1040px, 100%); max-height: calc(100svh - 48px); overflow: auto; padding: clamp(32px, 5vw, 64px); background: rgba(250,250,247,.94); border: 1px solid rgba(255,255,255,.6); border-radius: var(--radius-lg); box-shadow: var(--shadow-float); animation: dialog-in 360ms cubic-bezier(.16,1,.3,1) both; transform-origin: 82% 8%; }
.dialog__close { position: absolute; top: 18px; right: 18px; width: 42px; height: 42px; background: rgba(243,243,239,.72); border: 1px solid var(--line); border-radius: 50%; font-size: 25px; transition: transform 180ms cubic-bezier(.2,.8,.2,1), background 150ms ease; }
.dialog__close:hover { background: var(--paper); transform: scale(1.05); }
.dialog h2 { max-width: 520px; margin: 0; font-size: clamp(50px, 7vw, 88px); line-height: .91; letter-spacing: -.065em; }
.dialog__copy { max-width: 500px; margin: 26px 0 38px; color: var(--muted); font-size: 17px; line-height: 1.45; }
.dialog label span { display: block; margin-bottom: 10px; font-size: 12px; font-weight: 780; letter-spacing: .1em; text-transform: uppercase; }
.dialog input { width: 100%; height: 64px; padding: 0 18px; color: var(--ink); background: rgba(255,255,255,.48); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); font-size: 18px; transition: background 150ms ease, border-color 150ms ease, box-shadow 150ms ease; }
.dialog input:focus { background: white; border-color: var(--blue); box-shadow: 0 0 0 4px var(--blue-soft); outline: 0; }
.dialog textarea, .dialog select { width: 100%; padding: 16px 18px; color: var(--ink); background: rgba(255,255,255,.48); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); font-size: 16px; }
.dialog textarea { min-height: 190px; resize: vertical; line-height: 1.45; }
.dialog select { min-height: 64px; }
.dialog textarea:focus, .dialog select:focus { background: white; border-color: var(--blue); box-shadow: 0 0 0 4px var(--blue-soft); outline: 0; }
.template-picker { margin: 0 0 30px; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; border: 0; }
.template-picker legend { margin-bottom: 10px; font-size: 12px; font-weight: 780; letter-spacing: .1em; text-transform: uppercase; }
.template-option { position: relative; min-height: 190px; padding: 22px; display: grid; grid-template-rows: auto auto 1fr; align-content: start; gap: 16px; background: rgba(255,255,255,.24); border: 1px solid var(--line); border-radius: var(--radius-md); cursor: pointer; transition: transform 220ms cubic-bezier(.2,.8,.2,1), background 180ms ease, color 180ms ease, border-color 180ms ease, box-shadow 220ms ease; }
.template-option:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.template-option input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.template-option__number { color: var(--muted); font: 700 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.template-option strong { font-size: 20px; line-height: 1.05; letter-spacing: -.025em; }
.template-option small { color: var(--muted); font-size: 13px; line-height: 1.4; }
.template-option:has(input:checked) { z-index: 1; color: white; background: var(--blue); border-color: var(--blue); box-shadow: 0 14px 32px rgba(56,39,199,.22); transform: translateY(-2px); }
.template-option:has(input:checked) .template-option__number,
.template-option:has(input:checked) small { color: rgba(255,255,255,.7); }
.create-submit { width: 100%; min-height: 60px; margin-top: 14px; padding: 0 20px; display: flex; align-items: center; justify-content: space-between; color: white; background: var(--blue); border: 1px solid var(--blue); border-radius: var(--radius-sm); box-shadow: 0 10px 26px rgba(56,39,199,.18); font-weight: 760; transition: transform 150ms cubic-bezier(.2,.8,.2,1), background 150ms ease, box-shadow 150ms ease; }
.create-submit:disabled { opacity: .5; cursor: wait; }

.toast { position: fixed; z-index: 30; left: 50%; bottom: 24px; padding: 12px 16px; color: white; background: rgba(17,17,15,.88); border: 1px solid rgba(255,255,255,.14); border-radius: 999px; box-shadow: 0 12px 36px rgba(0,0,0,.22); backdrop-filter: blur(18px); opacity: 0; pointer-events: none; transform: translate(-50%, 14px) scale(.96); transition: opacity 180ms ease, transform 280ms cubic-bezier(.16,1,.3,1); }
.toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); }

.auth-pending main,
.auth-pending .new-button,
.auth-pending .topbar__label { visibility: hidden; }
.auth-gate { position: fixed; z-index: 50; inset: 72px 0 0; padding: clamp(20px, 5vw, 72px); display: grid; place-items: center; background: var(--paper); }
.auth-card { width: min(1180px, 100%); min-height: min(680px, calc(100svh - 144px)); padding: clamp(32px, 6vw, 80px); display: grid; grid-template-columns: minmax(180px, .42fr) minmax(0, 1fr); gap: clamp(48px, 8vw, 130px); align-items: start; background: var(--raised); border: 1px solid var(--line-strong); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); }
.auth-brand { display: grid; gap: 24px; color: var(--muted); font-size: 12px; }
.auth-brand img { width: 96px; height: 22px; object-fit: contain; object-position: left center; }
.auth-card h1 { max-width: 760px; font-size: clamp(58px, 7vw, 108px); }
.auth-copy { max-width: 640px; margin: 34px 0 42px; color: var(--muted); font-size: 18px; line-height: 1.45; }
.auth-card form { max-width: 620px; }
.auth-card label span { display: block; margin-bottom: 10px; font-size: 11px; font-weight: 780; letter-spacing: .12em; text-transform: uppercase; }
.auth-card input { width: 100%; height: 64px; padding: 0 18px; color: var(--ink); background: transparent; border: 1px solid var(--line-strong); border-radius: 0; font-size: 18px; }
.auth-card .otp-input { font: 650 28px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .24em; }
.form-error { min-height: 20px; margin: 9px 0 0; color: #9d2f22; font-size: 13px; }
.back-email { width: 100%; min-height: 44px; margin-top: 8px; color: var(--muted); background: transparent; border: 0; }
.back-email--bordered { max-width: 620px; min-height: 56px; margin-top: 0; border: 1px solid var(--line-strong); color: var(--ink); font-weight: 720; }

.assistant-dialog { width: min(1120px, 100%); }
.assistant-dialog h2 { max-width: 800px; }
.assistant-form { display: grid; gap: 22px; }
.assistant-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.assistant-privacy { margin: -8px 0 0; color: var(--faint); font-size: 12px; line-height: 1.4; }
.assistant-files { position: relative; }
.assistant-files > input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.assistant-files__drop { min-height: 104px; padding: 20px 22px; display: grid; align-content: center; gap: 7px; color: var(--blue); background: var(--blue-soft); border: 1px dashed rgba(56,39,199,.48); border-radius: var(--radius-md); cursor: pointer; transition: transform .18s cubic-bezier(.2,.8,.2,1),background .16s,border-color .16s; }
.assistant-files__drop:hover { transform: translateY(-2px); background: rgba(56,39,199,.13); border-color: var(--blue); }
.assistant-files__drop b { font-size: 17px; }
.assistant-files__drop small { color: var(--muted); font-size: 12px; }
.assistant-file-list { display: flex; flex-wrap: wrap; gap: 8px; }
.assistant-file { max-width: 100%; padding: 8px 10px; display: flex; align-items: center; gap: 8px; color: var(--ink); background: rgba(255,255,255,.45); border: 1px solid var(--line); border-radius: 999px; font-size: 12px; }
.assistant-file b { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.assistant-file button { width: 22px; height: 22px; padding: 0; color: var(--muted); background: transparent; border: 0; border-radius: 50%; }
.assistant-result__head { display: flex; align-items: start; justify-content: space-between; gap: 24px; padding-bottom: 26px; border-bottom: 1px solid var(--line); }
.assistant-result__head h3 { margin: 0; max-width: 720px; font-size: clamp(38px,5vw,68px); line-height: .92; letter-spacing: -.055em; }
.assistant-result__head .workshop-type { padding: 8px 10px; color: var(--blue); border: 1px solid var(--blue); border-radius: 999px; }
.assistant-summary { max-width: 800px; margin: 28px 0; color: var(--muted); font-size: 19px; line-height: 1.4; }
.assistant-result__metrics { margin: 0 0 12px; display: grid; grid-template-columns: repeat(3,1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.assistant-result__metrics span { min-height: 72px; padding: 14px; display: flex; align-items: center; gap: 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.assistant-result__metrics b { color: var(--blue); font-size: 22px; letter-spacing: -.04em; }
.assistant-result__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.assistant-result__grid > div { min-height: 220px; padding: 24px; background: rgba(255,255,255,.34); border: 1px solid var(--line); border-radius: var(--radius-md); }
.field-label { display: block; margin-bottom: 18px; color: var(--muted); font-size: 11px; font-weight: 780; letter-spacing: .1em; text-transform: uppercase; }
.assistant-result ul { margin: 0; padding-left: 20px; }
.assistant-result li { margin: 0 0 10px; line-height: 1.35; }
.assistant-result__actions { margin-top: 22px; display: grid; grid-template-columns: 1fr 1.5fr; gap: 10px; }
.assistant-readiness { margin-top: 12px; display: grid; grid-template-columns: repeat(2,1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.assistant-readiness article { min-height: 104px; padding: 15px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.assistant-readiness article span { font-size: 13px; font-weight: 680; }
.assistant-readiness article b { float: right; color: var(--muted); font-size: 9px; letter-spacing: .07em; text-transform: uppercase; }
.assistant-readiness article.is-ready b { color: #16794d; }
.assistant-readiness article.is-assumption b { color: var(--blue); }
.assistant-readiness article.is-blocking b { color: #9d2f22; }
.assistant-readiness article p { margin: 22px 0 0; color: var(--muted); font-size: 12px; line-height: 1.35; }
.assistant-result__actions .create-submit { margin: 0; }

.new-button:active, .create-submit:active, .rail-create:active, .card-actions a:active, .card-actions button:active, .template-option:active, .dialog__close:active { transform: scale(.98); transition-duration: 80ms; }
.signout, .back-email--bordered { border-radius: var(--radius-sm); transition: transform 120ms ease, background 150ms ease; }
.signout:active, .back-email--bordered:active { transform: scale(.97); }

@keyframes modal-scrim-in { from { opacity: 0; } }
@keyframes dialog-in { from { opacity: 0; transform: translateY(18px) scale(.975); filter: blur(6px); } to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); } }

@media (max-width: 980px) {
  .hero { min-height: 330px; grid-template-columns: 1fr; align-content: end; gap: 36px; }
  .rail { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth-card { grid-template-columns: 1fr; }
  .auth-brand { grid-auto-flow: column; justify-content: start; align-items: center; }
  .template-picker { grid-template-columns: 1fr; }
  .template-option { min-height: 140px; }
}
@media (max-width: 620px) {
  .topbar { gap: 12px; }
  .topbar__label { display: none; }
  .account { display: none !important; }
  .signout { display: none; }
  .new-button { padding-inline: 12px; font-size: 12px; }
  .assistant-button { width: 42px; padding: 0; font-size: 0; }
  .assistant-button span { margin: 0; font-size: 16px; }
  .hero { padding-top: 64px; }
  h1 { font-size: clamp(64px, 22vw, 96px); }
  .section-head { align-items: start; flex-direction: column; gap: 12px; }
  .rail { grid-template-columns: 1fr; }
  .workshop-card { min-height: 360px; }
  .rail-create { grid-template-columns: 1fr auto; }
  .rail-create__number { display: none; }
  .auth-gate { top: 64px; padding: 12px; }
  .auth-card { min-height: calc(100svh - 88px); padding: 32px 22px; gap: 52px; }
  .assistant-grid, .assistant-result__grid, .assistant-result__actions, .assistant-result__metrics, .assistant-readiness { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .workshop-card:hover, .rail-create:hover, .template-option:hover, .template-option:has(input:checked) { transform: none; }
}

@media (prefers-reduced-transparency: reduce) {
  .topbar, .dialog, .toast { backdrop-filter: none; -webkit-backdrop-filter: none; }
  .topbar { background: var(--paper); }
  .dialog { background: var(--raised); }
  .toast { background: var(--ink); }
}

@media (prefers-contrast: more) {
  :root { --line: rgba(17,17,15,.34); --line-strong: rgba(17,17,15,.82); }
  .topbar, .dialog { background: var(--raised); border-color: var(--line-strong); }
}
