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

:root {
  --cream: var(--aloe-color-cream, #f8f2e8);
  --paper: var(--aloe-color-paper, #fffaf4);
  --sand: #eadbc8;
  --copper: var(--aloe-color-action, #c46339);
  --amber: #edb66a;
  --ink: var(--aloe-color-ink, #211b18);
  --stone: var(--aloe-color-text-muted, #71665e);
  --line: var(--aloe-color-border, rgba(56, 38, 25, .13));
  --success: var(--aloe-color-success, #26785c);
  --danger: var(--aloe-color-danger, #b5392e);
  --shadow: var(--aloe-shadow-md, 0 24px 70px rgba(66, 35, 14, .12));
  --radius-xl: var(--aloe-radius-xl, 32px);
  --radius-lg: var(--aloe-radius-lg, 22px);
  --radius-md: var(--aloe-radius-md, 15px);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--cream); }
body { margin: 0; min-height: 100vh; color: var(--ink); }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
:focus-visible { outline: 3px solid rgba(196, 99, 57, .5); outline-offset: 3px; }
[hidden] { display: none !important; }

.creator-body {
  font-family: var(--aloe-font-sans, "Space Grotesk", sans-serif);
  background:
    radial-gradient(circle at 8% 8%, rgba(237, 182, 106, .25), transparent 24rem),
    radial-gradient(circle at 94% 20%, rgba(196, 99, 57, .11), transparent 22rem),
    linear-gradient(180deg, #fdf8f1, #f6ecdf);
}

.skip-link { position: fixed; left: 16px; top: -80px; z-index: 999; background: var(--ink); color: white; padding: 12px; }
.skip-link:focus { top: 16px; }
.creator-header {
  width: calc(100% - 8px);
  min-height: 76px;
  margin: 8px auto 0;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 22px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 12px 40px rgba(54,31,18,.09);
  backdrop-filter: blur(18px);
}
.brand, .account-pill { display: flex; align-items: center; gap: 11px; text-decoration: none; }
.brand-mark, .account-avatar {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px;
  color: white; background: linear-gradient(145deg, #172033, #2d5670 58%, #d66022);
  box-shadow: 0 10px 24px rgba(24,33,54,.2);
}
.brand strong, .brand small, .account-pill strong, .account-pill small { display: block; }
.brand small, .account-pill small { margin-top: 2px; font-size: 11px; color: var(--stone); }
.account-pill { padding: 5px 10px 5px 5px; border: 1px solid var(--line); border-radius: 17px; }
.account-avatar { width: 34px; height: 34px; border-radius: 12px; font-size: 13px; }

.creator-global-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.creator-session-nav {
  display: contents;
}

.creator-nav-link,
.creator-nav-cta {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 1px solid rgba(23, 32, 51, .12);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 255, 255, .74);
  font-size: 12px;
  font-weight: 750;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}

.creator-nav-link:hover,
.creator-nav-cta:hover {
  transform: translateY(-1px);
}

.creator-nav-link:hover {
  border-color: rgba(196, 99, 57, .34);
  background: #fff;
}

.creator-nav-cta {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(135deg, #e46b2b, #d28a5f);
  box-shadow: 0 10px 24px rgba(214, 96, 34, .2);
}

.page-shell, .wizard-shell { width: min(1320px, calc(100% - 36px)); margin: 58px auto 90px; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
.page-heading-actions, .empty-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.page-heading-actions { justify-content: flex-end; }
.empty-actions { justify-content: center; }
.eyebrow {
  margin: 0 0 7px; color: var(--copper); font-size: 11px; line-height: 1.2;
  letter-spacing: .17em; text-transform: uppercase; font-weight: 700;
}
.page-heading h1, .empty-state h1, .empty-state h2, .wizard-step legend {
  margin: 0; font-family: var(--aloe-font-display, "Fraunces", serif); font-weight: 600; line-height: .98;
}
.page-heading h1 { font-size: clamp(2.7rem, 6vw, 5.5rem); max-width: 850px; }
.page-heading p:not(.eyebrow) { margin: 16px 0 0; color: var(--stone); font-size: 17px; }

.button {
  min-height: 45px; padding: 11px 18px; display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; border: 1px solid transparent; border-radius: 14px; cursor: pointer; text-decoration: none;
  font-weight: 700; transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.button-primary { color: white; background: linear-gradient(135deg, #ab4d2d, var(--copper)); box-shadow: 0 10px 24px rgba(196,99,57,.24); }
.button-light { color: var(--ink); border-color: var(--line); background: rgba(255,255,255,.66); }
.icon-button { border: 0; background: transparent; min-width: 42px; min-height: 42px; border-radius: 12px; cursor: pointer; font-size: 20px; }
.icon-button:hover { background: rgba(196,99,57,.09); }

.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 22px; }
.project-card { position: relative; overflow: visible; border: 1px solid rgba(255,255,255,.78); border-radius: var(--radius-xl); background: rgba(255,250,244,.83); box-shadow: var(--shadow); }
.project-card.is-archived { opacity: .74; }
.project-thumb {
  height: 210px; margin: 10px; display: grid; place-items: center; overflow: hidden; position: relative;
  border-radius: 24px; color: white; background: linear-gradient(145deg, #b95d37, #edae69 45%, #322421);
}
.project-thumb > span { font: 700 74px/1 "Fraunces", serif; opacity: .9; }
.project-device { position: absolute; right: 18px; bottom: 16px; width: 34%; padding: 11px; border-radius: 12px; background: rgba(255,255,255,.83); box-shadow: 0 10px 24px rgba(0,0,0,.16); }
.project-device i { display: block; height: 5px; margin: 5px 0; border-radius: 4px; background: rgba(55,36,30,.35); }
.project-device i:nth-child(2) { width: 76%; }
.project-card-body { padding: 14px 20px 20px; }
.project-title-row { display: flex; justify-content: space-between; gap: 10px; }
.project-title-row h2 { margin: 9px 0 0; font-size: 22px; }
.status { display: inline-block; padding: 5px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; color: #775246; background: #f4e2d6; }
.status-published { color: var(--success); background: #dcf2e9; }
.project-meta { margin: 17px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.project-meta div { min-width: 0; }
.project-meta dt { color: var(--stone); font-size: 11px; }
.project-meta dd { margin: 2px 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 600; }
.project-actions { display: flex; gap: 8px; }
.project-actions .button { flex: 1; font-size: 13px; }
.project-menu {
  position: absolute; z-index: 5; top: 255px; right: 16px; width: 190px; padding: 8px;
  border: 1px solid var(--line); border-radius: 16px; background: var(--paper); box-shadow: var(--shadow);
}
.project-menu button, .project-menu a { width: 100%; padding: 10px; display: block; border: 0; text-align: left; border-radius: 10px; background: transparent; cursor: pointer; text-decoration: none; }
.project-menu button:hover, .project-menu a:hover { background: #f3e7db; }
.danger-text { color: var(--danger); }

.empty-state { width: min(760px, calc(100% - 36px)); margin: 90px auto; padding: 56px; text-align: center; border: 1px solid rgba(255,255,255,.8); border-radius: var(--radius-xl); background: rgba(255,250,244,.78); box-shadow: var(--shadow); }
.empty-state h1, .empty-state h2 { font-size: clamp(2.2rem, 5vw, 4rem); }
.empty-state p:not(.eyebrow) { max-width: 580px; margin: 18px auto 26px; color: var(--stone); line-height: 1.65; }
.empty-illustration { width: 180px; height: 120px; margin: 0 auto 28px; display: flex; align-items: end; justify-content: center; gap: 8px; }
.empty-illustration span { width: 42px; border-radius: 18px 18px 7px 7px; background: linear-gradient(#efb26e,#bc5a34); }
.empty-illustration span:nth-child(1) { height: 65px; }.empty-illustration span:nth-child(2) { height: 110px; }.empty-illustration span:nth-child(3) { height: 82px; }
.error-state { border-color: rgba(181,57,46,.2); }

.wizard-shell { width: min(1120px, calc(100% - 36px)); }
.onboarding-intro { max-width: 820px; margin: 0 auto 34px; text-align: center; }
.onboarding-intro h1 { margin: 8px 0 14px; font: 600 clamp(2.5rem,6vw,5rem)/.98 "Fraunces",serif; letter-spacing: -.045em; }
.onboarding-description { max-width: 680px; margin: 0 auto; color: var(--stone); line-height: 1.65; }
.onboarding-access-note { margin-top: 14px !important; padding: 10px 14px; border: 1px solid rgba(38,120,92,.2); border-radius: 14px; color: var(--success) !important; background: rgba(227,243,237,.72); font-size: 13px; }
.wizard-progress { display: grid; grid-template-columns: 140px 1fr 140px; align-items: center; margin-bottom: 38px; }
.back-link { color: var(--stone); text-decoration: none; }
.wizard-progress ol { grid-column: 2; margin: 0; padding: 0; display: flex; list-style: none; }
.wizard-progress li { flex: 1; position: relative; display: flex; align-items: center; gap: 9px; color: #a99c91; font-size: 12px; font-weight: 700; }
.wizard-progress li::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.wizard-progress li:last-child::after { display: none; }
.wizard-progress li span { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; }
.wizard-progress li.is-active, .wizard-progress li.is-done { color: var(--ink); }
.wizard-progress li.is-active span { color: white; border-color: var(--copper); background: var(--copper); }
.wizard-progress li.is-done span { color: var(--success); border-color: rgba(38,120,92,.35); background: #e4f3ed; }
.wizard-step { margin: 0; padding: 40px; border: 1px solid rgba(255,255,255,.8); border-radius: var(--radius-xl); background: rgba(255,250,244,.78); box-shadow: var(--shadow); }
.wizard-step:not(.is-active) { display: none; }
.wizard-step legend { float: left; width: 100%; font-size: clamp(2.2rem, 5vw, 4rem); }
.wizard-step > p { clear: both; padding-top: 14px; margin-bottom: 28px; color: var(--stone); }
.choice-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 13px; }
.choice-card, .style-card {
  position: relative; min-height: 128px; padding: 19px; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto 1fr;
  column-gap: 14px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: rgba(255,255,255,.55); cursor: pointer;
}
.choice-card:has(input:checked), .style-card:has(input:checked) { border-color: var(--copper); box-shadow: 0 0 0 3px rgba(196,99,57,.12); background: white; }
.choice-card input, .style-card input { position: absolute; opacity: 0; pointer-events: none; }
.choice-icon { grid-row: 1 / 3; width: 48px; height: 48px; display: grid; place-items: center; border-radius: 16px; color: var(--copper); background: #f4e1d3; font-size: 24px; }
.choice-card strong, .style-card strong { font-size: 16px; }
.choice-card small, .style-card small { margin-top: 7px; color: var(--stone); line-height: 1.45; }
.question-flow { display: grid; grid-template-columns: 1fr 1fr; gap: 17px; }
.question-flow label, .media-upload label { display: grid; gap: 8px; color: #4d4039; font-size: 13px; font-weight: 700; }
.field-wide { grid-column: 1 / -1; }
input, textarea, select {
  width: 100%; padding: 13px 14px; border: 1px solid rgba(56,38,25,.19); border-radius: 13px;
  color: var(--ink); background: rgba(255,255,255,.74);
}
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--copper); outline: 3px solid rgba(196,99,57,.12); }
.style-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 15px; }
.style-card { display: block; }
.style-preview { height: 100px; margin-bottom: 14px; padding: 16px; display: block; border-radius: 16px; background: linear-gradient(135deg,var(--swatch-pale),#fff); }
.style-preview i { display: block; height: 8px; margin: 7px 0; border-radius: 8px; background: var(--swatch); }
.style-preview i:nth-child(2) { width: 72%; opacity: .55; }.style-preview i:nth-child(3) { width: 40%; height: 24px; margin-top: 15px; }
.style-card strong, .style-card small { display: block; }
.wizard-finishing-fields { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--line); }
.wizard-finishing-fields input[type="color"] { min-height: 52px; padding: 6px; cursor: pointer; }
.wizard-actions { min-height: 70px; padding: 20px 4px; display: flex; align-items: center; gap: 12px; }
.wizard-actions [data-wizard-error],
.wizard-actions [data-onboarding-error] { flex: 1; margin: 0; color: var(--danger); font-size: 13px; }
.wizard-actions .button:last-child { margin-left: auto; }

.creator-toast {
  position: fixed; z-index: 1000; right: 22px; bottom: 22px; max-width: 380px; padding: 13px 17px;
  border-radius: 14px; color: white; background: #2e2825; box-shadow: 0 16px 45px rgba(0,0,0,.25);
  opacity: 0; transform: translateY(12px); pointer-events: none; transition: .2s ease;
}
.creator-toast.is-visible { opacity: 1; transform: none; }
.creator-toast.is-error { background: var(--danger); }

.creator-editor-body { padding-top: 74px; }
.creator-editor-bar {
  position: fixed; z-index: 80; inset: 10px 18px auto; min-height: 58px; padding: 7px 10px;
  display: flex; align-items: center; gap: 14px; border: 1px solid var(--line); border-radius: 19px;
  font-family: "Space Grotesk", sans-serif; background: rgba(255,250,244,.94); box-shadow: 0 10px 34px rgba(55,30,18,.13); backdrop-filter: blur(16px);
}
.editor-back { min-width: 95px; text-decoration: none; font-weight: 700; }
.editor-project { min-width: 0; margin-right: auto; }
.editor-project small, .editor-project strong { display: block; }.editor-project small { color: var(--stone); font-size: 10px; }.editor-project strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.editor-extra-actions { display: flex; gap: 7px; }
.editor-extra-actions .button { min-height: 40px; padding: 8px 12px; font-size: 12px; }
.creator-editor-body .dev-builder-app { min-height: calc(100vh - 74px); }
.creator-editor-body .dev-builder-shell { min-height: calc(100vh - 110px); }
.creator-editor-body .dev-builder-topbar { top: 84px; }

.creator-dialog {
  width: min(900px, calc(100% - 30px)); max-height: 82vh; padding: 22px; border: 1px solid var(--line);
  border-radius: 28px; color: var(--ink); background: var(--paper); box-shadow: 0 28px 100px rgba(38,19,10,.3);
}
.creator-dialog::backdrop { background: rgba(39,29,24,.48); backdrop-filter: blur(5px); }
.creator-dialog--compact { width: min(620px, calc(100% - 30px)); }
.dialog-heading { display: flex; align-items: start; justify-content: space-between; margin-bottom: 18px; }
.dialog-heading h2 { margin: 0; font: 600 32px/1 "Fraunces",serif; }
.guided-page-form { display: grid; gap: 16px; }
.guided-page-form label { display: grid; gap: 8px; font-size: 13px; font-weight: 700; }
.guided-page-form p { margin: 0; color: var(--stone); line-height: 1.55; }
.assistant-proposal { padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.68); }
.assistant-proposal h3 { margin: 7px 0 14px; font: 600 24px/1.2 "Fraunces",serif; }
.assistant-proposal ul { margin: 0; padding-left: 20px; color: var(--stone); line-height: 1.6; }
.onboarding-auth-content { display: grid; gap: 18px; }
.onboarding-auth-content > p { margin: 0; color: var(--stone); line-height: 1.65; }
.onboarding-auth-actions { flex-wrap: wrap; }
.media-upload { padding: 15px; display: grid; grid-template-columns: 1.3fr 1fr auto; gap: 12px; align-items: end; border-radius: 18px; background: #f4e7db; }
.media-grid { margin-top: 18px; display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; }
.media-item { overflow: hidden; padding: 0; border: 1px solid var(--line); border-radius: 15px; background: white; cursor: pointer; text-align: left; }
.media-item img { width: 100%; aspect-ratio: 4/3; display: block; object-fit: cover; }
.media-item span { display: block; padding: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.media-card { display: grid; gap: 8px; min-width: 0; }
.media-card-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.media-card-actions .button { min-height: 38px; padding: 0 10px; font-size: 12px; }
.media-crop-panel { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.media-crop-panel[hidden] { display: none; }
.media-crop-heading { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.media-crop-heading h3 { margin: 3px 0 0; font: 600 25px/1.1 "Fraunces",serif; }
.media-crop-layout { display: grid; grid-template-columns: minmax(0,1.15fr) minmax(280px,.85fr); gap: 22px; align-items: start; }
.media-crop-stage { position: relative; display: grid; place-items: center; min-height: 360px; margin: 0; overflow: hidden; border-radius: 22px; background: #1f1b18; }
.media-crop-stage img { display: block; width: 100%; height: 100%; min-height: inherit; object-fit: cover; }
.media-crop-target { position: absolute; left: 50%; top: 50%; width: 28px; height: 28px; border: 2px solid white; border-radius: 999px; box-shadow: 0 0 0 1px rgba(0,0,0,.45), 0 4px 18px rgba(0,0,0,.3); transform: translate(-50%,-50%); pointer-events: none; }
.media-crop-target::before,.media-crop-target::after { content: ""; position: absolute; background: white; }
.media-crop-target::before { left: 50%; top: -8px; bottom: -8px; width: 1px; }
.media-crop-target::after { top: 50%; left: -8px; right: -8px; height: 1px; }
.media-crop-form { display: grid; gap: 15px; }
.media-crop-form > label,.media-focal-control { display: grid; gap: 7px; color: var(--stone); font-size: 13px; font-weight: 800; }
.media-crop-form input[type="text"],.media-crop-form input:not([type]) { width: 100%; }
.media-crop-form fieldset { min-width: 0; margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 14px; }
.media-crop-form legend { padding: 0 6px; font-size: 13px; font-weight: 800; }
.media-ratio-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.media-ratio-options label { display: flex; align-items: center; gap: 7px; min-height: 38px; padding: 8px; border-radius: 10px; background: white; font-size: 12px; font-weight: 700; }
.media-ratio-options input { width: auto; }
.media-focal-control > span { display: flex; justify-content: space-between; gap: 12px; }
.media-focal-control output { color: var(--ink); }
.media-focal-control input[type="range"] { width: 100%; min-height: 32px; accent-color: var(--terracotta); }
.media-crop-help { margin: 0; color: var(--stone); font-size: 12px; line-height: 1.55; }
.media-crop-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.versions-list, .checklist { display: grid; gap: 10px; max-height: 55vh; overflow: auto; }
.version-row, .check-item { padding: 13px; display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.version-row > div { flex: 1; }.version-row strong, .version-row small { display: block; }.version-row small { margin-top: 4px; color: var(--stone); }
.check-item span { width: 28px; height: 28px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 9px; background: #f3e5d7; }
.check-item.is-error span { color: var(--danger); background: #fbe3df; }.check-item.is-warning span { color: #8a631a; background: #f8e9c6; }
.check-success { padding: 30px; text-align: center; border-radius: 18px; color: var(--success); background: #e3f3ed; }
.warning-ack { margin: 16px 0; display: flex; gap: 9px; font-size: 13px; }.warning-ack input { width: auto; }
.dialog-actions { margin-top: 16px; display: flex; justify-content: end; }

@media (max-width: 980px) {
  .project-grid { grid-template-columns: repeat(2,1fr); }
  .style-grid { grid-template-columns: repeat(2,1fr); }
  .wizard-progress { grid-template-columns: 1fr; gap: 20px; }
  .wizard-progress ol { grid-column: 1; }
  .editor-extra-actions .button-light:not(:last-of-type) { display: none; }
}
@media (max-width: 680px) {
  .creator-header {
    width: calc(100% - 12px);
    margin-top: 6px;
    padding: 10px;
    align-items: stretch;
    flex-wrap: wrap;
  }
  .creator-global-nav {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }
  .creator-nav-link,
  .creator-nav-cta {
    width: 100%;
    min-height: 44px;
    padding-inline: 10px;
    font-size: 11px;
  }
  .account-pill span:last-child { display: none; }
  .page-shell, .wizard-shell { width: calc(100% - 20px); margin-top: 35px; }
  .page-heading { align-items: stretch; flex-direction: column; }
  .page-heading h1 { font-size: 3rem; }
  .project-grid, .choice-grid, .style-grid, .question-flow { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
  .wizard-step { padding: 24px 17px; }
  .wizard-progress li { font-size: 0; }.wizard-progress li span { font-size: 12px; }
  .empty-state { margin-top: 45px; padding: 36px 20px; }
  .creator-editor-bar { inset: 6px 7px auto; }
  .editor-back { min-width: 38px; }.editor-back span { display: none; }
  .editor-extra-actions .button-light { display: none; }
  .creator-editor-body { padding-top: 66px; }
  .media-upload, .media-grid { grid-template-columns: 1fr 1fr; }
  .media-upload .button { grid-column: 1 / -1; }
  .media-crop-heading { align-items: flex-start; flex-direction: column; }
  .media-crop-layout { grid-template-columns: 1fr; }
  .media-crop-stage { min-height: 260px; }
  .media-crop-actions { display: grid; }
}
