.design-page { background: var(--cream); min-height: calc(100vh - 200px); }

.design-header {
  text-align: center;
  padding: 2rem 0 1rem;
}

.design-header h1 { font-size: 2rem; }
.design-header p { color: var(--muted); }

.design-workspace {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.5rem;
  padding-bottom: 3rem;
  align-items: start;
}

.design-toolbar {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  position: sticky;
  top: 100px;
}

.toolbar-section { margin-bottom: 1.25rem; }
.toolbar-section:last-child { margin-bottom: 0; }

.toolbar-section h3 {
  font-family: var(--font-body);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.toolbar-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}

.tool-btn {
  padding: 0.45rem 0.75rem;
  border: 1px solid #ddd;
  background: var(--white);
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  font-family: var(--font-body);
  transition: border-color 0.2s, background 0.2s;
}

.tool-btn:hover, .tool-btn.active {
  border-color: var(--pink);
  background: var(--pink-light);
}

.tool-btn-danger:hover { border-color: #c0392b; background: #fdecea; }

.toolbar-input, .toolbar-select {
  width: 100%;
  padding: 0.45rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 0.85rem;
}

.toolbar-range { width: 100%; accent-color: var(--pink); }

.color-swatches {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.35rem;
}

.swatch {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s;
}

.swatch:hover { transform: scale(1.1); }
.swatch.active { border-color: var(--charcoal); box-shadow: 0 0 0 2px var(--white), 0 0 0 4px var(--pink); }

.fan-colour-swatches {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.4rem;
}

.fan-colour-swatches .fan-swatch {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s;
}

.fan-colour-swatches .fan-swatch:hover { transform: scale(1.08); }

.fan-colour-swatches .fan-swatch.active {
  border-color: var(--charcoal);
  box-shadow: 0 0 0 2px var(--white), 0 0 0 4px var(--pink);
}

.color-picker-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.color-picker-row input[type="color"] {
  width: 36px;
  height: 36px;
  border: none;
  padding: 0;
  cursor: pointer;
  background: none;
}

.canvas-wrap {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.canvas-container {
  position: relative;
  max-width: 100%;
}

#fanCanvas {
  border: 1px solid #eee;
  border-radius: 8px;
  max-width: 100%;
  height: auto;
}

.canvas-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
  justify-content: center;
}

.admin-badge {
  display: inline-block;
  background: var(--pink);
  color: var(--white);
  font-size: 0.75rem;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  margin-bottom: 0.5rem;
}

@media (max-width: 900px) {
  .design-workspace { grid-template-columns: 1fr; }
  .design-workspace-full { grid-template-columns: 1fr; }
  .design-toolbar { position: static; }
}

.design-workspace-full {
  grid-template-columns: 120px 200px 1fr;
}

.design-workspace-no-slots {
  grid-template-columns: 200px 1fr;
}

.design-sidebar-tools {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  position: sticky;
  top: 100px;
}

.design-main {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.canvas-top-toolbar {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0.75rem 1rem;
}

.canvas-toolbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
}

.canvas-toolbar-row-top {
  justify-content: space-between;
  gap: 0.75rem;
}

.canvas-toolbar-row-actions {
  padding-top: 0.15rem;
  border-top: 1px solid #eee;
}

.preset-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 0 1 auto;
}

.preset-toolbar label {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.preset-toolbar .toolbar-select {
  min-width: 140px;
  max-width: 220px;
  width: auto;
}

.toolbar-label-field {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
  flex: 0 1 auto;
  min-width: 180px;
  max-width: 280px;
}

.toolbar-label-field label {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.toolbar-label-field .toolbar-input { flex: 1; }

.canvas-edit-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.75rem;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0.45rem 0.75rem;
}

.edit-toolbar-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
}

.edit-toolbar-group-text {
  flex: 1 1 auto;
  min-width: 0;
}

.edit-toolbar-font-section {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  margin-left: 0.25rem;
  padding-left: 0.65rem;
  border-left: 1px solid #e8e8e8;
}

#colorTools {
  flex: 1 1 100%;
}

.edit-toolbar-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  white-space: nowrap;
}

.edit-toolbar-text {
  width: auto;
  min-width: 100px;
  max-width: 180px;
  padding: 0.35rem 0.5rem;
  font-size: 0.8rem;
}

.edit-toolbar-select {
  width: auto;
  min-width: 110px;
  max-width: 150px;
  padding: 0.35rem 0.5rem;
  font-size: 0.8rem;
}

.font-picker {
  position: relative;
  flex-shrink: 0;
}

.font-picker-btn {
  position: relative;
  display: block;
  min-width: 110px;
  max-width: 150px;
  padding: 0.35rem 1.5rem 0.35rem 0.5rem;
  font-size: 0.8rem;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: var(--white);
  border: 1px solid #ddd;
  border-radius: var(--radius);
  cursor: pointer;
  font-family: inherit;
}

.font-picker-btn::after {
  content: '▾';
  position: absolute;
  right: 0.45rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.65rem;
  color: var(--muted);
  pointer-events: none;
}

.font-picker-btn:hover {
  border-color: var(--accent, #E91E8C);
}

.font-picker-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 200;
  min-width: 200px;
  max-width: 260px;
  max-height: 280px;
  overflow-y: auto;
  background: var(--white);
  border: 1px solid #ddd;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.font-picker-menu[hidden] {
  display: none;
}

.font-picker-category {
  padding: 0.4rem 0.6rem 0.2rem;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  background: #fafafa;
  border-bottom: 1px solid #eee;
  position: sticky;
  top: 0;
}

.font-picker-option {
  display: block;
  width: 100%;
  padding: 0.45rem 0.65rem;
  font-size: 0.9rem;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.font-picker-option:hover {
  background: #fdf0f6;
}

.font-picker-option.active {
  background: #fce4ef;
  font-weight: 600;
}

.edit-toolbar-range {
  width: 72px;
  margin: 0;
}

.edit-toolbar-range-curve {
  width: 88px;
}

.edit-toolbar-value {
  font-size: 0.75rem;
  color: var(--muted);
  min-width: 1.75rem;
}

.edit-toolbar-color {
  width: 28px;
  height: 28px;
  border: none;
  padding: 0;
  cursor: pointer;
  background: none;
  flex-shrink: 0;
}

.tool-btn-compact {
  padding: 0.3rem 0.5rem;
  font-size: 0.7rem;
}

.tool-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.tool-btn:disabled:hover {
  border-color: #ddd;
  background: var(--white);
}

.edit-toolbar-hint {
  font-size: 0.8rem;
  color: var(--muted);
  font-style: italic;
}

.color-swatches-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
}

.sticker-tint-swatches {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  max-width: 200px;
}

.sticker-tint-swatches .sticker-tint-swatch {
  width: 20px;
  height: 20px;
  min-width: 20px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  flex-shrink: 0;
}

.sticker-tint-swatches .sticker-tint-swatch:hover {
  transform: scale(1.1);
}

.sticker-tint-swatches .sticker-tint-swatch.active {
  border-color: var(--charcoal);
  box-shadow: 0 0 0 1px var(--white), 0 0 0 3px var(--pink);
}

.color-swatches-toolbar .swatch {
  width: 20px;
  height: 20px;
  aspect-ratio: unset;
  flex-shrink: 0;
}

.context-panel {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 1.25rem;
}

.context-panel h3 {
  font-family: var(--font-body);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.panel-label {
  font-size: 0.8rem;
  color: var(--muted);
  display: block;
  margin-bottom: 0.25rem;
}

.layers-panel {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 1.25rem;
}

.layers-panel h3 {
  font-family: var(--font-body);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.layers-hint {
  font-size: 0.7rem;
  color: var(--muted);
  margin: -0.25rem 0 0.5rem;
}

.layers-list { display: flex; flex-direction: column; gap: 0.35rem; max-height: 160px; overflow-y: auto; }

.layer-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem;
  border-radius: 6px;
  border: 1px solid #eee;
}

.layer-row.active { border-color: var(--pink); background: var(--pink-light); }

.layer-row.locked .layer-select { color: var(--muted); }

.layer-lock {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0.15rem 0.25rem;
  line-height: 1;
  flex-shrink: 0;
  opacity: 0.5;
}

.layer-lock.is-locked { opacity: 1; }

.layer-select {
  flex: 1;
  text-align: left;
  border: none;
  background: transparent;
  font-size: 0.8rem;
  cursor: pointer;
  font-family: var(--font-body);
  padding: 0.25rem;
}

.layer-actions { display: flex; gap: 0.2rem; }
.layer-actions .tool-btn { padding: 0.2rem 0.4rem; font-size: 0.75rem; }

.layers-empty { font-size: 0.8rem; color: var(--muted); margin: 0; }

.design-slot-wrap {
  position: relative;
}

.design-slot-wrap .slot-delete-btn {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 50%;
  background: #c0392b;
  color: white;
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 2;
}

.design-slot-wrap:hover .slot-delete-btn { opacity: 1; }

.forgot-ref-link { margin-top: 0.75rem; font-size: 0.85rem; }
.forgot-ref-link a { color: var(--pink); }

.success-note { color: var(--muted); max-width: 420px; margin: 0.5rem auto 1.5rem; }

.modal-card-center { text-align: center; }
.redirect-note { color: var(--muted); font-size: 0.9rem; }

@media (max-width: 900px) {
  .design-workspace-full { grid-template-columns: 1fr; }
  .design-sidebar-tools { position: static; }
  .design-slots-panel { position: static; }
  .toolbar-label-field { margin-left: 0; max-width: 100%; }
}


.design-landing { text-align: center; padding: 3rem 0; }
.landing-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; max-width: 700px; margin: 2rem auto; }
.landing-card {
  background: var(--white); border: 2px solid var(--pink-light); border-radius: var(--radius);
  padding: 2rem; cursor: pointer; text-align: center; font-family: var(--font-body);
  display: flex; flex-direction: column; gap: 0.5rem; transition: border-color 0.2s;
}
.landing-card:hover { border-color: var(--pink); }
.landing-card-form { cursor: default; }
.landing-icon { font-size: 2.5rem; color: var(--pink); }
.landing-card span { color: var(--muted); font-size: 0.85rem; }

.design-slots-panel {
  background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 0.75rem; position: sticky; top: 100px;
}
.design-slots-panel h3 { font-size: 0.75rem; text-transform: uppercase; color: var(--muted); margin-bottom: 0.5rem; font-family: var(--font-body); }
.design-slots { display: flex; flex-direction: column; gap: 0.5rem; max-height: 400px; overflow-y: auto; }
.design-slot {
  border: 2px solid #eee; border-radius: 8px; padding: 0.25rem; background: var(--white);
  cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 0.25rem;
}
.design-slot.active { border-color: var(--pink); }
.design-slot img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 4px; }
.slot-label { font-size: 0.65rem; color: var(--muted); text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.slot-add-btn {
  width: 100%; margin-top: 0.5rem; padding: 0.5rem; border: 2px dashed var(--pink);
  background: transparent; color: var(--pink); font-size: 1.5rem; border-radius: 8px; cursor: pointer;
}
.sticker-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.35rem; }
.sticker-btn { border: 1px solid #eee; border-radius: 6px; padding: 0.25rem; background: var(--white); cursor: pointer; }
.sticker-btn img { width: 100%; aspect-ratio: 1; object-fit: contain; }

.shape-section-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 0.5rem 0 0.35rem;
}

.shape-section-label:first-of-type { margin-top: 0; }

.shape-palette {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.3rem;
}

.shape-palette-btn {
  padding: 0.35rem 0.25rem;
  font-size: 0.68rem;
  width: 100%;
  min-height: 28px;
}

.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 2000;
  display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.modal-card {
  background: var(--white); border-radius: var(--radius); padding: 2rem;
  width: min(480px, 100%); max-height: 90vh; overflow-y: auto;
}
.modal-card-wide { width: min(640px, 100%); }
.terms-content { white-space: pre-wrap; font-size: 0.9rem; color: var(--muted); max-height: 50vh; overflow-y: auto; margin-bottom: 1rem; }
.terms-check { display: flex; align-items: flex-start; gap: 0.5rem; font-size: 0.85rem; cursor: pointer; }
.modal-actions { display: flex; gap: 0.75rem; justify-content: flex-end; margin-top: 1rem; }

.submit-success { text-align: center; padding: 4rem 0; }
.ref-display { font-size: 1.75rem; font-weight: 700; color: var(--pink); font-family: var(--font-heading); }

@media (max-width: 900px) {
  .landing-cards { grid-template-columns: 1fr; }
  .design-workspace-full { grid-template-columns: 1fr; }
}
