:root {
  --navy: #0b1f3a;
  --navy-dark: #071526;
  --blue: #1661d4;
  --blue-soft: #e9f1ff;
  --yellow: #ffd84d;
  --orange: #ff6b35;
  --teal: #13a89e;
  --page: #f3f5f8;
  --white: #ffffff;
  --border: #dce2e9;
  --muted: #5f6b78;
  --danger: #c83e42;
  --shadow: 0 18px 55px rgba(7, 21, 38, 0.12);
  --font: "Manrope", "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  color-scheme: light;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--navy);
  background: var(--page);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}

button,
select,
input[type="color"] {
  cursor: pointer;
}

button,
input,
select,
textarea {
  border-radius: 0;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex="0"]:focus-visible {
  outline: 3px solid rgba(22, 97, 212, 0.36);
  outline-offset: 2px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 12px;
  left: 12px;
  padding: 12px 16px;
  color: var(--white);
  background: var(--blue);
  font-size: 13px;
  font-weight: 800;
  transform: translateY(-140%);
}

.skip-link:focus {
  transform: translateY(0);
}

.studio-header {
  position: sticky;
  z-index: 50;
  top: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 78px;
  padding: 0 28px;
  border-top: 4px solid var(--navy);
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 6px 24px rgba(7, 21, 38, 0.05);
  backdrop-filter: blur(16px);
}

.back-link,
.brand {
  color: inherit;
  text-decoration: none;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: max-content;
  min-height: 44px;
  font-size: 13px;
  font-weight: 800;
}

.back-link svg {
  width: 22px;
  height: 22px;
}

.brand {
  display: inline-flex;
  align-items: center;
}

.brand__logo {
  display: block;
  width: 180px;
  max-width: none;
  height: auto;
}

.brand__logo--mark {
  display: none;
  width: 40px;
}

.studio-header__actions {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 8px;
}

.draft-status__dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #20aa75;
  box-shadow: 0 0 0 4px rgba(32, 170, 117, 0.12);
}

.icon-button,
.header-generate,
.header-save {
  min-height: 44px;
  border: 0;
  font-size: 12px;
  font-weight: 800;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  background: transparent;
}

.icon-button:hover:not(:disabled) {
  background: var(--page);
}

.icon-button svg {
  width: 19px;
  height: 19px;
}

.header-generate,
.header-save {
  padding: 0 16px;
  border-radius: 8px;
}

.header-generate {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--navy);
  background: var(--yellow);
  box-shadow: 0 8px 22px rgba(255, 216, 77, 0.35);
}

.header-generate:hover {
  background: #ffe47f;
  transform: translateY(-1px);
}

.header-save {
  color: var(--white);
  background: var(--blue);
}

.header-save:hover {
  background: #0d51bd;
}

.studio-main {
  max-width: 1680px;
  margin: 0 auto;
  padding: 16px 22px 38px;
}

.studio-intro {
  margin-bottom: 12px;
}

.studio-intro h1,
.studio-intro p,
.panel-heading h2,
.render-bar h2 {
  margin: 0;
}

.studio-intro h1 {
  font-size: clamp(25px, 2.4vw, 34px);
  line-height: 1;
  letter-spacing: -0.045em;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.workbench {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(240px, 282px) minmax(480px, 1fr) minmax(252px, 302px);
  min-height: 660px;
  overflow: visible;
  background: transparent;
}

.tool-panel {
  position: relative;
  z-index: 3;
  min-width: 0;
  padding: 18px;
  border-radius: 12px;
  background: var(--white);
  box-shadow: 0 8px 28px rgba(7, 21, 38, 0.07);
}

.tool-panel--left {
  display: flex;
  flex-direction: column;
}

.tool-panel--right {
  display: flex;
  flex-direction: column;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-heading__step,
.properties__heading span {
  display: block;
  margin-bottom: 4px;
  color: var(--blue);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.panel-heading h2 {
  font-size: 15px;
  line-height: 1.25;
}

.panel-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
}

.panel-toggle svg {
  width: 20px;
  margin: auto;
  transition: transform 180ms ease;
}

.panel-toggle[aria-expanded="false"] svg {
  transform: rotate(-90deg);
}

.panel-content {
  margin-top: 10px;
}

.tool-panel--left > .panel-heading:not(:first-child) {
  margin-top: 24px;
}

.field-label,
.property-field > span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.select-control,
.property-field select,
.property-field input,
.property-field textarea,
.account-dialog input {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 7px;
  background-color: #f2f5f9;
}

.select-control,
.property-field select,
.property-field input,
.account-dialog input {
  min-height: 44px;
  padding: 0 11px;
}

.select-control,
.property-field select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--navy) 50%), linear-gradient(135deg, var(--navy) 50%, transparent 50%);
  background-position: calc(100% - 16px) 19px, calc(100% - 11px) 19px;
  background-repeat: no-repeat;
  background-size: 5px 5px, 5px 5px;
}

.product-summary {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 11px;
  align-items: center;
  margin-top: 12px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fafbfc;
}

.product-summary img {
  width: 70px;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: 6px;
}

.product-summary strong,
.product-summary span {
  display: block;
}

.product-summary strong {
  font-size: 12px;
  line-height: 1.35;
}

.product-summary span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.process-note {
  margin-top: 12px;
  padding: 12px;
  border-left: 4px solid var(--yellow);
  background: #fff8d8;
}

.process-note span,
.process-note strong,
.process-note small {
  display: block;
}

.process-note span {
  color: #6e5c17;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.process-note strong {
  margin-top: 3px;
  font-size: 12px;
}

.process-note small {
  margin-top: 3px;
  color: #6d6450;
  font-size: 9px;
  line-height: 1.45;
}

.tool-divider {
  display: none;
}

.upload-button,
.add-text-button {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 62px;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: #f2f5f9;
  text-align: left;
  transition: border-color 160ms ease, background 160ms ease;
}

.upload-button:hover,
.add-text-button:hover {
  border-color: var(--blue);
  background: #f6f9ff;
}

.upload-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.upload-button__icon,
.add-text-button > span:first-child {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 7px;
  color: var(--white);
  background: var(--blue);
}

.upload-button__icon svg {
  width: 20px;
}

.add-text-button {
  margin-top: 8px;
}

.add-text-button > span:first-child {
  color: var(--navy);
  background: var(--yellow);
  font-size: 20px;
  font-weight: 800;
}

.upload-button strong,
.upload-button small,
.add-text-button strong,
.add-text-button small {
  display: block;
}

.upload-button strong,
.add-text-button strong {
  font-size: 12px;
}

.upload-button small,
.add-text-button small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.35;
}

.ownership-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.45;
}

.draft-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 22px;
}

.draft-status {
  display: flex;
  align-items: center;
  gap: 9px;
}

.draft-status__dot {
  margin-top: 0;
}

.draft-status strong,
.draft-status small {
  display: block;
}

.draft-status strong {
  font-size: 11px;
}

.draft-status small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.text-button {
  min-height: 44px;
  padding: 0;
  border: 0;
  color: var(--blue);
  background: transparent;
  font-size: 10px;
  font-weight: 800;
}

.text-button--danger {
  min-height: 36px;
  color: var(--danger);
}

.stage-column {
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  min-width: 0;
  overflow: hidden;
  border-radius: 12px;
  background: #e8ecf1;
  box-shadow: 0 8px 28px rgba(7, 21, 38, 0.09);
}

.stage-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 48px;
  padding: 7px 15px;
  border-bottom: 0;
  background: var(--white);
}

.stage-product-title strong {
  display: block;
}

.stage-product-title strong {
  font-size: 12px;
}

.stage-help {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

.stage-help span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

.legend-dot--blue {
  border: 1px solid var(--blue);
}

.legend-dot--yellow {
  background: var(--yellow);
}

.stage-viewport {
  position: relative;
  display: grid;
  min-height: 558px;
  overflow: hidden;
  padding: 34px 32px;
  place-items: center;
  background-color: #e8ecf1;
  background-image: radial-gradient(circle, rgba(11, 31, 58, 0.12) 1px, transparent 1px);
  background-size: 18px 18px;
}

.canvas-frame {
  position: relative;
  width: min(100%, 900px);
  padding-top: 26px;
  padding-left: 26px;
  transform-origin: center;
}

.ruler-corner,
.ruler {
  position: absolute;
  color: #6f7b89;
  background-color: #f6f7f9;
  font-size: 7px;
  font-weight: 700;
  user-select: none;
}

.ruler-corner {
  top: 0;
  left: 0;
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-right: 1px solid #ccd3dc;
  border-bottom: 1px solid #ccd3dc;
}

.ruler--horizontal {
  top: 0;
  right: 0;
  left: 26px;
  height: 26px;
  border-bottom: 1px solid #ccd3dc;
  background-image: repeating-linear-gradient(90deg, transparent 0 9px, #aab3be 9px 10px), repeating-linear-gradient(90deg, transparent 0 49px, #717d8a 49px 50px);
  background-position: left bottom;
  background-size: auto 6px, auto 11px;
  background-repeat: repeat-x;
}

.ruler--vertical {
  top: 26px;
  bottom: 0;
  left: 0;
  width: 26px;
  border-right: 1px solid #ccd3dc;
  background-image: repeating-linear-gradient(180deg, transparent 0 9px, #aab3be 9px 10px), repeating-linear-gradient(180deg, transparent 0 49px, #717d8a 49px 50px);
  background-position: right top;
  background-size: 6px auto, 11px auto;
  background-repeat: repeat-y;
}

.ruler span {
  position: absolute;
  line-height: 1;
}

.ruler--horizontal span {
  top: 5px;
  transform: translateX(-50%);
}

.ruler--vertical span {
  left: 5px;
  transform: translateY(-50%) rotate(-90deg);
}

.product-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: var(--white);
  box-shadow: 0 12px 40px rgba(7, 21, 38, 0.18);
  container-type: inline-size;
  touch-action: none;
}

.product-stage__base {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  pointer-events: none;
}

.safe-area {
  position: absolute;
  z-index: 2;
  border: 1px dashed rgba(22, 97, 212, 0.92);
  background: rgba(22, 97, 212, 0.025);
  pointer-events: none;
}

.safe-area::before,
.safe-area::after {
  position: absolute;
  width: 8px;
  height: 8px;
  content: "";
  border-color: var(--blue);
}

.safe-area::before {
  top: -1px;
  left: -1px;
  border-top: 2px solid;
  border-left: 2px solid;
}

.safe-area::after {
  right: -1px;
  bottom: -1px;
  border-right: 2px solid;
  border-bottom: 2px solid;
}

.safe-area span {
  position: absolute;
  bottom: 5px;
  left: 7px;
  padding: 2px 4px;
  color: var(--blue);
  background: rgba(255, 255, 255, 0.86);
  font-size: 6px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.layer-canvas {
  position: absolute;
  z-index: 5;
  inset: 0;
}

.design-object {
  position: absolute;
  display: grid;
  min-width: 0;
  min-height: 0;
  place-items: center;
  transform-origin: center;
  touch-action: none;
  user-select: none;
}

.design-object__content {
  display: grid;
  width: 100%;
  height: 100%;
  overflow: hidden;
  place-items: center;
  pointer-events: none;
}

.design-object--logo .design-object__content img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.design-object--text .design-object__content {
  overflow: visible;
  white-space: pre-wrap;
  text-align: center;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.design-object.is-selected::after {
  position: absolute;
  z-index: 3;
  inset: -5px;
  content: "";
  border: 2px solid var(--yellow);
  box-shadow: 0 0 0 1px rgba(11, 31, 58, 0.45);
  pointer-events: none;
}

.design-object.is-outside::after {
  border-color: #ff4f55;
  box-shadow: 0 0 0 1px rgba(126, 17, 20, 0.55);
}

.object-handle {
  position: absolute;
  z-index: 8;
  display: none;
  width: 20px;
  height: 20px;
  border: 2px solid var(--navy);
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 2px 8px rgba(7, 21, 38, 0.2);
}

.design-object.is-selected:not(.is-locked) .object-handle {
  display: block;
}

.object-handle--resize {
  right: -15px;
  bottom: -15px;
  cursor: nwse-resize;
}

.object-handle--rotate {
  top: -36px;
  left: 50%;
  cursor: grab;
  transform: translateX(-50%);
}

.object-handle--rotate::after {
  position: absolute;
  top: 18px;
  left: 8px;
  width: 2px;
  height: 14px;
  content: "";
  background: var(--navy);
}

.design-object.is-locked::before {
  position: absolute;
  z-index: 6;
  top: -20px;
  right: -20px;
  display: grid;
  width: 22px;
  height: 22px;
  content: "L";
  place-items: center;
  border-radius: 50%;
  color: var(--white);
  background: var(--navy);
  font-size: 8px;
  font-weight: 800;
}

.alignment-guide {
  position: absolute;
  z-index: 20;
  display: none;
  background: var(--orange);
  pointer-events: none;
}

.alignment-guide.is-visible {
  display: block;
}

.alignment-guide--x {
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
}

.alignment-guide--y {
  top: 50%;
  right: 0;
  left: 0;
  height: 1px;
}

.stage-empty {
  position: absolute;
  z-index: 4;
  top: 50%;
  left: 50%;
  display: flex;
  width: 172px;
  flex-direction: column;
  align-items: center;
  padding: 15px;
  border: 0;
  border-radius: 10px;
  color: rgba(11, 31, 58, 0.84);
  background: rgba(255, 255, 255, 0.78);
  text-align: center;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.stage-empty[hidden] {
  display: none;
}

.stage-empty > span {
  display: grid;
  width: 30px;
  height: 30px;
  margin-bottom: 6px;
  place-items: center;
  border-radius: 50%;
  color: var(--navy);
  background: var(--yellow);
  font-size: 18px;
}

.stage-empty strong {
  font-size: 11px;
}

.stage-empty small {
  margin-top: 4px;
  font-size: 8px;
  line-height: 1.4;
}

.product-switcher {
  display: grid;
  grid-template-columns: 182px minmax(0, 1fr);
  gap: 8px;
  min-width: 0;
  padding: 8px 12px;
  background: var(--white);
}

.product-switcher__tools {
  display: grid;
  align-self: stretch;
  gap: 6px;
  min-width: 0;
}

.product-switcher__search {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 30px;
  min-width: 0;
  overflow: hidden;
  border-radius: 8px;
  background: #f2f5f9;
}

.product-switcher__search button,
.product-switcher__search input {
  min-width: 0;
  min-height: 42px;
  border: 0;
  background: transparent;
}

.product-switcher__search button {
  display: grid;
  padding: 0;
  place-items: center;
}

.product-switcher__search button:first-child {
  color: var(--blue);
}

.product-switcher__search button svg {
  width: 20px;
  height: 20px;
}

.product-switcher__search input {
  width: 100%;
  padding: 0 4px;
  outline: 0;
  font-size: 11px;
  font-weight: 700;
}

.product-switcher__search input::placeholder {
  color: #7c8794;
}

.product-switcher__clear {
  color: var(--muted);
  font-size: 18px;
}

.product-switcher__collection {
  display: grid;
  align-content: center;
  min-width: 0;
  min-height: 44px;
  padding: 6px 10px;
  border-radius: 8px;
  background: #eef3fa;
}

.product-switcher__collection span {
  color: var(--blue);
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.product-switcher__collection select {
  width: 100%;
  min-width: 0;
  margin-top: 3px;
  padding: 0;
  overflow: hidden;
  border: 0;
  outline: 0;
  color: var(--navy);
  background: transparent;
  font: inherit;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
  text-overflow: ellipsis;
}

.product-switcher__collection:focus-within {
  box-shadow: 0 0 0 2px var(--blue);
}

.product-switcher__results {
  display: flex;
  height: 92px;
  min-width: 0;
  gap: 8px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: inline proximity;
  scrollbar-color: #b9c4d0 transparent;
  scrollbar-width: thin;
}

.product-switcher__item {
  display: grid;
  width: 92px;
  min-width: 92px;
  padding: 4px;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #f6f7f9;
  scroll-snap-align: start;
  text-align: left;
}

.product-switcher__item:hover {
  border-color: #9abaf0;
  background: var(--blue-soft);
}

.product-switcher__item.is-current {
  border-color: var(--blue);
  background: var(--blue-soft);
  box-shadow: inset 0 0 0 1px var(--blue);
}

.product-switcher__item img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: 5px;
  background: var(--white);
}

.product-switcher__item span {
  display: block;
  padding: 5px 4px 3px;
  overflow: hidden;
  font-size: 8px;
  font-weight: 800;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-switcher__empty {
  align-self: center;
  margin: 0;
  padding: 0 12px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.product-variants {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 7px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--white);
  animation: variant-reveal 160ms ease-out both;
}

.product-variants[hidden] {
  display: none;
}

.product-variants__heading {
  display: grid;
  gap: 2px;
}

.product-variants__heading span {
  color: var(--blue);
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.product-variants__heading strong {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-variants__list {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 6px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
}

.product-variant {
  position: relative;
  display: grid;
  grid-template-columns: 48px auto;
  align-items: center;
  gap: 5px;
  min-width: 86px;
  min-height: 48px;
  padding: 3px 7px 3px 3px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #f4f6f9;
  text-align: left;
}

.product-variant:hover {
  border-color: #9abaf0;
}

.product-variant.is-current {
  border-color: var(--blue);
  background: var(--blue-soft);
  box-shadow: inset 0 0 0 1px var(--blue);
}

.product-variant img {
  width: 48px;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: 5px;
  background: var(--white);
}

.product-variant span {
  font-size: 8px;
  font-weight: 800;
}

@keyframes variant-reveal {
  from {
    opacity: 0;
    transform: translateY(5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.zoom-control {
  display: flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid #ccd4dd;
  border-radius: 7px;
  background: var(--white);
}

.zoom-control--floating {
  position: absolute;
  z-index: 40;
  bottom: 12px;
  left: 12px;
  box-shadow: 0 6px 20px rgba(7, 21, 38, 0.16);
}

.zoom-control button,
.zoom-control output {
  display: grid;
  min-width: 44px;
  height: 44px;
  padding: 0 9px;
  place-items: center;
  border: 0;
  border-right: 1px solid #dce2e9;
  background: transparent;
  font-size: 10px;
  font-weight: 800;
}

.zoom-control button:last-child {
  border: 0;
}

.zoom-control button:hover {
  background: var(--blue-soft);
}

.stage-status {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  text-align: right;
}

.stage-status--floating {
  position: absolute;
  z-index: 35;
  right: 12px;
  bottom: 12px;
  max-width: min(52%, 340px);
  padding: 6px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 4px 14px rgba(7, 21, 38, 0.08);
  pointer-events: none;
}

.stage-status--floating:empty {
  display: none;
}

.stage-status.is-warning {
  color: var(--danger);
}

.layer-count {
  display: grid;
  min-width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 999px;
  color: var(--navy);
  background: var(--yellow);
  font-size: 10px;
  font-weight: 800;
}

.layers-list {
  display: grid;
  gap: 6px;
  min-height: 82px;
  max-height: 210px;
  margin-top: 14px;
  overflow-y: auto;
}

.layers-empty {
  display: grid;
  place-items: center;
  align-content: center;
  min-height: 78px;
  padding: 12px;
  border: 0;
  border-radius: 9px;
  color: var(--muted);
  background: #f2f5f9;
  text-align: center;
}

.layers-empty > span {
  display: grid;
  width: 34px;
  height: 34px;
  margin-bottom: 6px;
  place-items: center;
  border-radius: 7px;
  color: var(--navy);
  background: var(--blue-soft);
  font-size: 13px;
  font-weight: 800;
}

.layers-empty p {
  max-width: 150px;
  margin: 0;
  font-size: 10px;
  line-height: 1.45;
}

.layer-row {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: #f7f8fa;
  text-align: left;
}

.layer-row:hover,
.layer-row.is-selected {
  border-color: #9abaf0;
  background: var(--blue-soft);
}

.layer-row__thumb {
  display: grid;
  width: 32px;
  height: 32px;
  overflow: hidden;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--white);
  font-size: 11px;
  font-weight: 800;
}

.layer-row__thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.layer-row strong,
.layer-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.layer-row strong {
  font-size: 10px;
}

.layer-row small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 8px;
}

.layer-row__lock {
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
}

.properties-empty {
  display: flex;
  min-height: 104px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-top: 12px;
  border-radius: 9px;
  color: var(--muted);
  background: #f2f5f9;
  text-align: center;
}

.properties-empty__icon {
  display: grid;
  width: 46px;
  height: 46px;
  margin-bottom: 10px;
  place-items: center;
  border-radius: 50%;
  background: #edf0f4;
}

.properties-empty__icon svg {
  width: 22px;
}

.properties-empty strong {
  color: var(--navy);
  font-size: 11px;
}

.properties-empty p {
  max-width: 190px;
  margin: 5px 0 0;
  font-size: 9px;
  line-height: 1.45;
}

.properties__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.properties__heading strong {
  display: block;
  max-width: 140px;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.properties__heading > div:last-child {
  display: flex;
  gap: 3px;
}

.properties__heading button {
  display: grid;
  width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: #f1f3f6;
}

.properties__heading button:hover,
.properties__heading button.is-active {
  color: var(--white);
  background: var(--navy);
}

.properties__heading svg {
  width: 17px;
  height: 17px;
}

.property-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.property-field {
  display: block;
  min-width: 0;
}

.property-field--wide {
  margin-bottom: 12px;
}

.property-field > div:not(.color-control) {
  position: relative;
}

.property-field input[type="number"] {
  padding-right: 30px;
}

.property-field i {
  position: absolute;
  top: 50%;
  right: 10px;
  color: var(--muted);
  font-size: 9px;
  font-style: normal;
  transform: translateY(-50%);
  pointer-events: none;
}

.property-field textarea {
  min-height: 68px;
  padding: 10px;
  resize: vertical;
}

.text-properties {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.color-control {
  display: grid;
  grid-template-columns: 44px 1fr;
  min-height: 44px;
  overflow: hidden;
  border: 1px solid #ccd4dd;
  border-radius: 7px;
}

.color-control input {
  width: 44px;
  min-height: 42px;
  padding: 4px;
  border: 0;
  border-right: 1px solid var(--border);
}

.color-control output {
  display: flex;
  align-items: center;
  padding: 0 8px;
  font-size: 8px;
  font-weight: 800;
}

.layer-order {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 14px;
}

.layer-order button {
  min-height: 40px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--white);
  font-size: 9px;
  font-weight: 800;
}

.layer-order button:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.render-bar {
  display: grid;
  grid-template-columns: 1.45fr 0.75fr;
  align-items: center;
  gap: 40px;
  margin-top: 18px;
  padding: 24px 28px;
  border-radius: 14px;
  color: var(--white);
  background: var(--navy);
}

.render-bar__copy {
  display: grid;
  grid-template-columns: 58px 1fr;
  align-items: center;
  gap: 18px;
}

.render-icon {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 12px;
  color: var(--navy);
  background: var(--yellow);
}

.render-icon svg {
  width: 28px;
  height: 28px;
}

.render-bar .eyebrow {
  color: var(--yellow);
}

.render-bar h2 {
  font-size: clamp(20px, 2vw, 28px);
  line-height: 1.12;
  letter-spacing: -0.03em;
}

.render-bar__copy > div > p:last-child {
  max-width: 720px;
  margin: 7px 0 0;
  color: #c7d0dc;
  font-size: 11px;
  line-height: 1.5;
}

.render-bar__action {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.render-bar__action > p {
  margin: 0 0 8px;
  color: #c7d0dc;
  font-size: 9px;
  line-height: 1.4;
}

.render-bar__action button,
.account-dialog form button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  padding: 0 17px;
  border: 0;
  border-radius: 8px;
  color: var(--navy);
  background: var(--yellow);
  font-size: 12px;
  font-weight: 800;
}

.render-bar__action button:hover,
.account-dialog form button:hover {
  background: #ffe47f;
}

.account-modal[hidden] {
  display: none;
}

.account-modal {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
}

.account-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 21, 38, 0.7);
  backdrop-filter: blur(8px);
}

.account-dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 470px);
  padding: 34px;
  border-top: 7px solid var(--yellow);
  border-radius: 14px;
  background: var(--white);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.3);
}

.account-dialog__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  font-size: 26px;
}

.account-dialog__close:hover {
  background: var(--page);
}

.account-dialog__mark {
  display: grid;
  width: 48px;
  height: 48px;
  margin-bottom: 20px;
  place-items: center;
  border-radius: 11px;
  color: var(--white);
  background: var(--navy);
}

.account-dialog__mark img {
  display: block;
  width: 29px;
  height: auto;
}

.account-dialog h2 {
  margin: 0;
  font-size: 34px;
  line-height: 1;
  letter-spacing: -0.045em;
}

.account-dialog > p:not(.eyebrow):not(.account-dialog__status) {
  margin: 13px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.account-dialog form {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.account-dialog label span {
  display: block;
  margin-bottom: 7px;
  font-size: 10px;
  font-weight: 800;
}

.account-dialog form button {
  color: var(--white);
  background: var(--blue);
}

.account-dialog form button:hover {
  background: #0d51bd;
}

.account-dialog__status {
  margin: 12px 0 0;
  color: var(--blue);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.45;
}

.account-dialog > small {
  display: block;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

.toast {
  position: fixed;
  z-index: 120;
  right: 24px;
  bottom: 24px;
  max-width: 360px;
  padding: 13px 16px;
  border-left: 5px solid var(--yellow);
  color: var(--white);
  background: var(--navy);
  box-shadow: 0 12px 34px rgba(7, 21, 38, 0.3);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.45;
}

.toast[hidden] {
  display: none;
}

@media (max-width: 1180px) {
  .studio-header {
    grid-template-columns: auto 1fr auto;
  }

  .brand {
    justify-self: center;
  }

  .icon-button span {
    display: none;
  }

  .icon-button {
    width: 44px;
    justify-content: center;
    padding: 0;
  }

  .workbench {
    grid-template-columns: 230px minmax(430px, 1fr) 250px;
  }

  .tool-panel {
    padding: 18px;
  }

  .tool-divider {
    margin-right: -18px;
    margin-left: -18px;
  }

  .stage-viewport {
    padding: 28px 22px;
  }
}

@media (max-width: 980px) {
  .studio-header {
    min-height: 70px;
    padding: 0 16px;
  }

  .brand__logo--full {
    display: none;
  }

  .brand__logo--mark {
    display: block;
  }

  .header-save {
    padding: 0 13px;
  }

  .studio-main {
    padding: 20px 18px 40px;
  }

  .studio-intro {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .studio-intro > p {
    max-width: 720px;
  }

  .workbench {
    display: flex;
    min-height: 0;
    flex-direction: column;
    overflow: visible;
  }

  .stage-column {
    order: 1;
  }

  .tool-panel--left {
    order: 2;
    border-top: 0;
    border-right: 0;
  }

  .tool-panel--right {
    order: 3;
    border-top: 0;
    border-left: 0;
  }

  .stage-viewport {
    min-height: 0;
    padding: 28px;
  }

  .canvas-frame {
    width: min(100%, 780px);
  }

  .tool-panel--left {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
    column-gap: 28px;
  }

  .panel-heading--product {
    grid-row: 1;
    grid-column: 1;
  }

  .panel-content--product {
    grid-row: 2;
    grid-column: 1;
  }

  .panel-heading--add {
    grid-row: 1;
    grid-column: 2;
    margin-top: 0 !important;
  }

  .panel-content--add {
    grid-row: 2;
    grid-column: 2;
  }

  .tool-panel--left > .draft-row {
    grid-row: 3;
    grid-column: 1 / -1;
  }

  .tool-panel--right {
    display: grid;
    grid-template-columns: minmax(220px, 0.8fr) minmax(380px, 1.2fr);
    gap: 22px;
  }

  .tool-panel--right > .panel-heading,
  .tool-panel--right > .layers-list {
    grid-column: 1;
  }

  .tool-panel--right > .tool-divider {
    display: none;
  }

  .properties-empty,
  .properties {
    grid-row: 1 / span 2;
    grid-column: 2;
  }

  .render-bar {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .render-bar__action {
    display: grid;
    grid-template-columns: 1fr minmax(240px, 340px);
    align-items: center;
    gap: 20px;
  }
}

@media (max-width: 720px) {
  .studio-header {
    grid-template-columns: auto auto 1fr;
    gap: 8px;
    min-height: 64px;
    padding: 0 10px;
  }

  .back-link span,
  .studio-header__actions .icon-button {
    display: none;
  }

  .brand {
    justify-self: start;
  }

  .brand__logo--mark {
    width: 36px;
  }

  .studio-header__actions {
    justify-self: end;
  }

  .header-save {
    min-height: 42px;
    font-size: 10px;
  }

  .header-generate {
    min-height: 42px;
    padding-inline: 13px;
    font-size: 10px;
  }

  .studio-main {
    padding: 16px 10px 30px;
  }

  .studio-intro {
    margin-bottom: 14px;
  }

  .studio-intro h1 {
    font-size: 32px;
  }

  .studio-intro > p {
    font-size: 12px;
  }

  .workbench {
    border-radius: 10px;
  }

  .stage-topbar {
    min-height: 46px;
    padding: 10px 12px;
  }

  .stage-help {
    gap: 10px;
  }

  .stage-viewport {
    padding: 18px 8px 20px;
  }

  .canvas-frame {
    width: 100%;
    padding-top: 22px;
    padding-left: 22px;
  }

  .ruler-corner {
    width: 22px;
    height: 22px;
  }

  .ruler--horizontal {
    left: 22px;
    height: 22px;
  }

  .ruler--vertical {
    top: 22px;
    width: 22px;
  }

  .ruler span {
    font-size: 6px;
  }

  .stage-empty {
    width: 150px;
    padding: 10px;
  }

  .product-switcher {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 9px 10px;
  }

  .product-switcher__tools {
    grid-template-columns: minmax(0, 1fr) minmax(150px, 0.72fr);
    gap: 8px;
  }

  .product-switcher__item {
    width: 90px;
    min-width: 90px;
  }

  .product-variants {
    grid-template-columns: 72px minmax(0, 1fr);
    padding: 7px 10px;
  }

  .zoom-control--floating {
    bottom: 8px;
    left: 8px;
  }

  .zoom-control button,
  .zoom-control output {
    min-width: 44px;
    height: 44px;
  }

  .stage-status--floating {
    right: 8px;
    bottom: 8px;
    max-width: 46%;
  }

  .tool-panel--left,
  .tool-panel--right {
    display: block;
    padding: 16px;
  }

  .tool-divider {
    display: block !important;
    margin: 18px -16px;
  }

  .panel-toggle {
    display: grid;
    place-items: center;
  }

  .panel-content[hidden] {
    display: none;
  }

  .tool-panel--right > .layers-list {
    max-height: 220px;
  }

  .properties-empty,
  .properties {
    margin-top: 18px;
  }

  .render-bar {
    padding: 20px 16px;
  }

  .render-bar__copy {
    grid-template-columns: 42px 1fr;
    gap: 11px;
  }

  .render-icon {
    width: 42px;
    height: 42px;
  }

  .render-icon svg {
    width: 22px;
  }

  .render-bar h2 {
    font-size: 19px;
  }

  .render-bar__action {
    display: flex;
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  .render-bar__action button {
    width: 100%;
  }

  .account-dialog {
    padding: 28px 20px 22px;
  }

  .toast {
    right: 12px;
    bottom: 12px;
    left: 12px;
    max-width: none;
  }
}

@media (max-width: 390px) {
  .header-generate {
    gap: 6px;
    padding: 0 9px;
  }

  .header-generate span {
    display: none;
  }

  .header-save {
    padding: 0 9px;
  }

  .studio-intro h1 {
    font-size: 29px;
  }

  .stage-help span:last-child {
    display: none;
  }

  .property-grid {
    gap: 7px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
