:root {
  --ink: #17201b;
  --muted: #64706a;
  --paper: #fffaf0;
  --panel: rgba(255, 255, 255, 0.74);
  --line: rgba(23, 32, 27, 0.13);
  --accent: #f06b34;
  --accent-dark: #9f3518;
  --mint: #96d8b8;
  --sky: #91c9e8;
  --shadow: 0 30px 80px rgba(50, 40, 25, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Manrope", sans-serif;
  background:
    radial-gradient(circle at 12% 8%, rgba(240, 107, 52, 0.35), transparent 28rem),
    radial-gradient(circle at 86% 18%, rgba(145, 201, 232, 0.6), transparent 24rem),
    linear-gradient(135deg, #fff1d7 0%, #f7f0df 44%, #d7eddd 100%);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  opacity: 0.33;
  background-image:
    linear-gradient(rgba(23, 32, 27, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 32, 27, 0.08) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, #000, transparent 92%);
}

button,
select,
input {
  font: inherit;
}

.hidden {
  display: none !important;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 44px 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 34px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  box-shadow: 0 18px 50px rgba(50, 40, 25, 0.12);
  backdrop-filter: blur(18px);
}

.brand {
  color: var(--ink);
  padding-left: 12px;
  font-family: "Unbounded", sans-serif;
  font-weight: 700;
  text-decoration: none;
}

.auth-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.small-button {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
}

.user-pill {
  max-width: 320px;
  overflow: hidden;
  padding: 10px 14px;
  color: var(--muted);
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stock-toggle {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 253, 247, 0.78);
  color: var(--ink);
  font-weight: 900;
}

.stock-toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.stock-note {
  max-width: 560px;
  margin: 8px auto 0;
  padding: 10px 14px;
  border: 1px solid rgba(240, 107, 52, 0.24);
  border-radius: 999px;
  background: rgba(255, 244, 225, 0.92);
  color: #8a4a18;
  font-size: 0.9rem;
  font-weight: 900;
  text-align: center;
}

.stock-note.hidden {
  display: none;
}

.hero {
  display: grid;
  grid-template-columns: 1fr minmax(220px, 360px);
  gap: 28px;
  align-items: end;
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent-dark);
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1 {
  max-width: 820px;
  margin: 0;
  font-family: "Unbounded", sans-serif;
  font-size: clamp(2.35rem, 6vw, 5.35rem);
  line-height: 0.96;
  letter-spacing: -0.06em;
}

.lead {
  max-width: 640px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.7;
}

.hero-card,
.panel,
.preview-wrap {
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.hero-card {
  position: relative;
  overflow: hidden;
  padding: 24px;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.52);
}

.hero-card p {
  position: relative;
  margin: 0;
  font-weight: 700;
  line-height: 1.55;
}

.pulse {
  position: absolute;
  width: 180px;
  height: 180px;
  right: -70px;
  top: -80px;
  border-radius: 999px;
  background: var(--mint);
  animation: breathe 4s ease-in-out infinite;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(300px, 380px) 1fr;
  gap: 28px;
  align-items: stretch;
}

.panel,
.preview-wrap {
  border-radius: 34px;
  background: var(--panel);
}

.admin-view {
  display: grid;
  gap: 24px;
}

.admin-view .hidden {
  display: none !important;
}

.admin-hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 28px;
}

.admin-hero h2,
.auth-card h2 {
  margin: 0;
  font-family: "Unbounded", sans-serif;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1;
  letter-spacing: -0.05em;
}

.admin-hero p,
.auth-copy {
  max-width: 620px;
  color: var(--muted);
  line-height: 1.65;
}

.admin-switcher {
  display: grid;
  grid-template-columns: minmax(180px, 280px) minmax(240px, 1fr);
  gap: 14px;
  align-items: center;
  padding: 18px;
  border: 1px solid var(--line);
}

.admin-switcher span {
  font-weight: 900;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(420px, 1.25fr) minmax(280px, 0.75fr);
  gap: 24px;
  align-items: start;
}

.controls {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 26px;
}

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

.section-heading span {
  font-weight: 900;
}

.section-heading small,
.admin-message {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.template-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  max-height: 360px;
  overflow: auto;
  padding-right: 4px;
}

.template-card {
  display: grid;
  gap: 8px;
  padding: 10px;
  cursor: pointer;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 253, 247, 0.78);
}

.template-card:hover,
.template-card.is-active {
  outline: 4px solid rgba(240, 107, 52, 0.18);
  transform: translateY(-2px);
}

.template-card img,
.template-preview {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 14px;
  background: #eee;
}

.template-card strong {
  color: var(--ink);
  font-size: 0.88rem;
}

.template-card span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.admin-box {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 250, 240, 0.58);
}

.admin-box[data-admin-editor] {
  width: 1180px;
  max-width: 100%;
  grid-column: 1 / -1;
  justify-self: center;
}

.mask-editor[data-admin-editor] {
  width: 1180px;
  max-width: 100%;
  grid-column: 1 / -1;
  justify-self: center;
}

.admin-box input,
.admin-box select {
  min-height: 44px;
  width: 100%;
  padding: 0 13px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: none;
  background: #fffdf7;
}

.admin-box input[type="file"] {
  padding: 10px 13px;
}

.admin-message {
  min-height: 1.2em;
  margin: 0;
}

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

.admin-row.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-file-field,
.range-field {
  display: grid;
  gap: 8px;
}

.admin-file-field span,
.range-field span {
  font-weight: 900;
}

.control-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.control-label output {
  min-width: 58px;
  padding: 5px 9px;
  text-align: center;
  color: var(--accent-dark);
  border-radius: 999px;
  background: rgba(240, 107, 52, 0.13);
}

.admin-file-field small {
  color: var(--muted);
  font-weight: 800;
  line-height: 1.45;
}

.mask-editor {
  display: grid;
  position: relative;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
  overflow: visible;
  min-height: 980px;
  background:
    linear-gradient(90deg, rgba(255, 250, 240, 0.96) 0%, rgba(255, 250, 240, 0.78) 18%, rgba(255, 250, 240, 0.58) 42%),
    radial-gradient(circle at 0% 12%, rgba(240, 107, 52, 0.14), transparent 18rem),
    rgba(255, 250, 240, 0.58);
}

.mask-editor::before {
  content: "";
  position: absolute;
  top: 18px;
  bottom: 18px;
  left: -82px;
  width: 150px;
  pointer-events: none;
  border-radius: 28px 0 0 28px;
  background: linear-gradient(90deg, rgba(255, 250, 240, 0), rgba(255, 250, 240, 0.84));
}

.mask-tool-sidebar {
  position: sticky;
  top: 12px;
  width: 300px;
  transform: translateX(-120px);
  display: grid;
  align-content: start;
  gap: 12px;
  height: 820px;
  max-height: 820px;
  overflow: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    radial-gradient(circle at 0% 0%, rgba(240, 107, 52, 0.16), transparent 13rem),
    rgba(255, 250, 240, 0.94);
  box-shadow: 18px 0 34px rgba(23, 32, 27, 0.06), 0 14px 30px rgba(23, 32, 27, 0.08);
}

.mask-tool-sidebar button {
  min-height: 44px;
}

.mask-icon-actions {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.icon-tool-button {
  min-height: 36px !important;
  width: 100%;
  padding: 0;
  font-size: 1.35rem;
  font-weight: 1000;
  line-height: 1;
  letter-spacing: 0;
}

.purple-tool-button {
  color:rgba(138, 43, 226, 0.58);
  border-color: rgba(138, 43, 226, 0.58);
  background: linear-gradient(135deg, #a855f7, #6d28d9);
  box-shadow: 0 10px 20px rgba(138, 43, 226, 0.58);
}

.purple-tool-button:hover {
  background: linear-gradient(135deg, #b66bff, #7c3aed);
}

.mask-workspace {
  min-width: 0;
  min-height: 940px;
}

.mask-canvas-wrap {
  position: relative;
  width: 100%;
  min-height: 900px;
  max-height: 1400px;
  justify-self: center;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background-color: #fff;
  background-image:
    linear-gradient(45deg, rgba(23, 32, 27, 0.12) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(23, 32, 27, 0.12) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(23, 32, 27, 0.12) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(23, 32, 27, 0.12) 75%);
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-size: 20px 20px;
}

#cameraMaskCanvas,
#cameraToolOverlayCanvas {
  display: block;
  width: var(--mask-display-width, 320px);
  max-width: none;
  max-height: none;
  touch-action: none;
}

#cameraMaskCanvas {
  height: auto;
}

#cameraToolOverlayCanvas {
  position: absolute;
  top: 0;
  left: 0;
  height: var(--mask-display-height, auto);
  cursor: crosshair;
}

.admin-preview-canvas {
  width: 100%;
  max-width: 260px;
  justify-self: center;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.58);
  filter: drop-shadow(0 18px 24px rgba(23, 32, 27, 0.16));
}

.admin-list-box {
  align-self: start;
  align-content: start;
}

.admin-list {
  display: grid;
  align-content: start;
  gap: 10px;
  max-height: 520px;
  overflow: auto;
  padding-right: 4px;
}

.admin-list-item {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 253, 247, 0.72);
}

.admin-list-item img {
  width: 74px;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 12px;
  background: #eee;
}

.admin-list-content {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.admin-list-content strong,
.admin-list-content span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-list-content span,
.admin-empty {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.wide-list-item {
  grid-template-columns: 54px 1fr;
}

.admin-order-card {
  grid-template-columns: 64px 1fr;
}

.admin-order-card > img {
  width: 64px;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 16px;
  background: #eee;
}

.admin-order-list {
  max-height: none;
}

.admin-filter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.admin-filter-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.admin-inline-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.avatar-option-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.avatar-admin-card > img {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  object-fit: cover;
}

.role-avatar {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 16px;
  color: white;
  font-weight: 1000;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
}

.mini-select {
  min-height: 32px !important;
  width: auto !important;
  padding: 0 10px !important;
  border-radius: 999px !important;
  font-size: 0.78rem;
  font-weight: 900;
}

.admin-list-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mini-button {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.78rem;
}

.danger {
  color: #8f1f14;
  border: 1px solid rgba(143, 31, 20, 0.22);
  background: rgba(255, 233, 228, 0.78);
}

.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.executor-toggle {
  align-self: flex-start;
  margin-bottom: 12px;
}

.executor-toggle.is-active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.executor-order-list {
  max-height: none;
}

.executor-order-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 253, 247, 0.86);
}

.executor-order-images {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.executor-order-images img,
.executor-photo-placeholder {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 16px;
  background: rgba(23, 32, 27, 0.08);
}

.executor-photo-placeholder {
  display: grid;
  place-items: center;
  padding: 14px;
  color: var(--muted);
  font-weight: 900;
  text-align: center;
}

.executor-order-body {
  display: grid;
  gap: 5px;
}

.executor-order-body span {
  color: var(--muted);
  font-weight: 800;
  font-size: 0.9rem;
}

.model-swatch {
  width: 58px;
  height: 92px;
  justify-self: center;
  border: 4px solid rgba(255, 255, 255, 0.9);
  border-radius: 18px;
  box-shadow: inset 0 0 0 2px rgba(23, 32, 27, 0.15);
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.auth-dialog {
  width: min(460px, calc(100% - 28px));
  padding: 0;
  border: 0;
  border-radius: 30px;
  background: transparent;
}

.auth-dialog::backdrop {
  background: rgba(23, 32, 27, 0.46);
  backdrop-filter: blur(7px);
}

.auth-card {
  position: relative;
  display: grid;
  gap: 12px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background:
    radial-gradient(circle at 100% 0%, rgba(240, 107, 52, 0.24), transparent 14rem),
    #fffaf0;
  box-shadow: var(--shadow);
}

.auth-card input {
  min-height: 50px;
  width: 100%;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 16px;
  outline: none;
  background: #fffdf7;
}

.dialog-close {
  position: absolute;
  top: 14px;
  right: 14px;
  min-height: 38px;
  width: 38px;
  border-radius: 999px;
  background: rgba(23, 32, 27, 0.08);
}

.profile-button {
  display: grid;
  width: 42px;
  min-width: 42px;
  height: 42px;
  place-items: center;
  overflow: hidden;
  padding: 0;
  color: white;
  font-size: 1rem;
  font-weight: 1000;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
}

.profile-button img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-dialog {
  width: min(980px, calc(100% - 24px));
  padding: 0;
  border: 0;
  border-radius: 30px;
  background: transparent;
}

.profile-dialog::backdrop {
  background: rgba(23, 32, 27, 0.46);
  backdrop-filter: blur(7px);
}

.profile-card {
  position: relative;
  display: grid;
  gap: 14px;
  max-height: 88vh;
  overflow: auto;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: #fffaf0;
  box-shadow: var(--shadow);
}

.profile-card h2 {
  margin: 0;
  font-family: "Unbounded", sans-serif;
}

.profile-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.profile-avatar-panel {
  display: flex;
  align-items: center;
  padding: 0;
}

.profile-avatar-preview {
  display: grid;
  width: 76px;
  height: 76px;
  place-items: center;
  overflow: hidden;
  color: white;
  font-size: 1.5rem;
  font-weight: 1000;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.profile-avatar-preview:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 14px 26px rgba(240, 107, 52, 0.18);
}

.profile-avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.public-avatar-preview {
  justify-self: center;
}

.avatar-choice-list {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.avatar-choice {
  display: grid;
  min-width: 92px;
  gap: 6px;
  justify-items: center;
  padding: 8px;
  color: var(--ink);
  font-weight: 900;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 253, 247, 0.78);
  cursor: pointer;
}

.avatar-choice img {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  object-fit: cover;
}

.avatar-choice span {
  max-width: 82px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.avatar-choice.is-selected {
  border-color: rgba(240, 107, 52, 0.68);
  box-shadow: 0 12px 24px rgba(240, 107, 52, 0.12);
}

.link-button {
  border: 0;
  padding: 0;
  color: var(--accent-dark);
  background: transparent;
  font: inherit;
  font-weight: 1000;
  text-align: left;
  cursor: pointer;
}

.link-button:hover {
  text-decoration: underline;
}

.profile-link-button {
  display: inline;
}

.profile-visibility-button {
  position: relative;
  min-width: 44px;
}

.profile-visibility-button.is-private::after {
  content: "";
  position: absolute;
  left: 11px;
  right: 11px;
  top: 50%;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transform: rotate(-34deg);
}

.profile-password-panel,
.profile-executor-panel,
.profile-selection-bar,
.profile-single-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 253, 247, 0.72);
}

.profile-password-panel {
  display: grid;
  justify-content: stretch;
}

.profile-executor-panel {
  display: grid;
  justify-content: stretch;
}

.profile-executor-list {
  display: grid;
  gap: 10px;
}

.profile-executor-order {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 253, 247, 0.86);
}

.profile-executor-order img {
  width: 72px;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 14px;
  background: #eee;
}

.profile-executor-order div {
  display: grid;
  gap: 4px;
}

.profile-executor-order strong {
  font-size: 0.9rem;
}

.profile-executor-order span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.profile-password-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.profile-selection-bar span {
  font-weight: 900;
  color: var(--ink);
}

.profile-design-list {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.public-profile-designs {
  min-height: 110px;
}

.public-profile-card {
  max-width: 760px;
}

.public-profile-design-card {
  min-width: 170px;
}

.profile-design-card {
  position: relative;
  display: grid;
  min-width: 150px;
  gap: 8px;
  padding: 10px;
  text-align: left;
  cursor: pointer;
  user-select: none;
  touch-action: none;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 253, 247, 0.86);
}

.profile-design-card:focus-visible {
  outline: 3px solid rgba(240, 107, 52, 0.38);
  outline-offset: 3px;
}

.profile-design-card img,
.profile-preview-grid img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 14px;
  background: #eee;
}

.profile-design-card.is-active {
  outline: 4px solid rgba(240, 107, 52, 0.18);
}

.profile-design-card.is-selected {
  border-color: rgba(240, 107, 52, 0.64);
  box-shadow: 0 12px 24px rgba(240, 107, 52, 0.12);
}

.profile-preview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.profile-preview-grid figure {
  display: grid;
  gap: 8px;
  margin: 0;
}

.profile-preview-grid figcaption {
  color: var(--muted);
  font-weight: 900;
  font-size: 0.86rem;
}

.profile-sources {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  min-height: 180px;
  padding: 8px;
  border-radius: 14px;
  background: rgba(23, 32, 27, 0.06);
}

.profile-sources img {
  aspect-ratio: 1;
}

.field {
  display: grid;
  gap: 10px;
}

.field > span,
.range-label {
  color: var(--ink);
  font-weight: 800;
}

.range-label {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

select,
input[type="range"] {
  width: 100%;
}

select {
  min-height: 52px;
  padding: 0 16px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 18px;
  outline: none;
  background: #fffdf7;
}

select:focus,
button:focus-visible,
.upload-zone:focus-within {
  outline: 4px solid rgba(240, 107, 52, 0.22);
}

input[type="range"] {
  accent-color: var(--accent);
}

.upload-zone {
  display: grid;
  gap: 6px;
  min-height: 132px;
  padding: 22px;
  cursor: pointer;
  place-content: center;
  text-align: center;
  border: 2px dashed rgba(23, 32, 27, 0.25);
  border-radius: 24px;
  background: rgba(255, 250, 240, 0.72);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.upload-zone:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  background: #fffaf0;
}

.upload-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.upload-zone strong {
  font-size: 1.05rem;
}

.upload-zone span,
.hint {
  color: var(--muted);
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 12px;
}

button {
  min-height: 52px;
  cursor: pointer;
  border: 0;
  border-radius: 18px;
  font-weight: 800;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

button:hover {
  transform: translateY(-2px);
}

.primary {
  color: white;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  box-shadow: 0 18px 36px rgba(159, 53, 24, 0.28);
}

.ghost {
  color: var(--ink);
  background: rgba(23, 32, 27, 0.08);
}

.hint {
  margin: auto 0 0;
  font-size: 0.95rem;
  line-height: 1.55;
}

.preview-wrap {
  position: relative;
  display: grid;
  min-height: 680px;
  overflow: hidden;
  place-items: center;
  padding: 32px;
}

.preview-wrap::before,
.preview-wrap::after {
  position: absolute;
  content: "";
  border-radius: 999px;
  filter: blur(2px);
}

.preview-wrap::before {
  width: 320px;
  height: 320px;
  left: 6%;
  bottom: 8%;
  background: rgba(150, 216, 184, 0.35);
}

.preview-wrap::after {
  width: 220px;
  height: 220px;
  right: 9%;
  top: 12%;
  background: rgba(240, 107, 52, 0.22);
}

.model-name {
  position: absolute;
  top: 28px;
  left: 32px;
  z-index: 2;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  font-weight: 800;
}

canvas {
  position: relative;
  z-index: 1;
  width: min(100%, 520px);
  height: auto;
  touch-action: none;
  filter: drop-shadow(0 38px 40px rgba(23, 32, 27, 0.24));
}

@keyframes breathe {
  0%,
  100% {
    transform: scale(0.94);
  }

  50% {
    transform: scale(1.08);
  }
}

@media (max-width: 860px) {
  .hero,
  .workspace,
  .admin-grid,
  .admin-switcher {
    grid-template-columns: 1fr;
  }

  .admin-hero,
  .topbar {
    align-items: stretch;
    flex-direction: column;
    border-radius: 28px;
  }

  .preview-wrap {
    min-height: 560px;
    padding: 72px 18px 24px;
  }

  .profile-preview-grid {
    grid-template-columns: 1fr;
  }

  .profile-password-grid {
    grid-template-columns: 1fr;
  }

  .admin-inline-form,
  .admin-filter-grid {
    grid-template-columns: 1fr;
  }

  .mask-editor {
    grid-template-columns: 1fr;
    width: 100%;
    min-height: 0;
  }

  .mask-editor::before {
    display: none;
  }

  .mask-tool-sidebar {
    position: static;
    width: 100%;
    transform: none;
    max-height: none;
  }

  .mask-workspace {
    width: 100%;
    min-height: 0;
  }
}

@media (max-width: 520px) {
  .shell {
    width: min(100% - 20px, 1180px);
    padding: 24px 0;
  }

  .actions {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: clamp(2rem, 14vw, 3.6rem);
  }
}
