:root {
  color: #1f2742;
  background: #f5f2ea;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

/* Class display rules would otherwise override the UA's [hidden] rule. */
[hidden] {
  display: none !important;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 15% 12%, rgb(255 215 95 / 24%), transparent 28rem),
    #f5f2ea;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(19rem, 24rem) minmax(0, 1fr);
  gap: clamp(1.25rem, 3vw, 3rem);
  width: min(100%, 94rem);
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(1rem, 3vw, 2.5rem);
}

.control-panel,
.preview-panel {
  background: rgb(255 255 255 / 82%);
  border: 1px solid rgb(31 39 66 / 10%);
  border-radius: 1.5rem;
  box-shadow: 0 1.5rem 4rem rgb(35 39 52 / 9%);
  backdrop-filter: blur(18px);
}

/* ---------- Left panel: fixed header/footer, scrollable body ---------- */

.control-panel {
  display: flex;
  flex-direction: column;
  align-self: stretch;
  max-height: calc(100vh - clamp(2rem, 6vw, 5rem));
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: clamp(1.25rem, 3vw, 1.75rem) clamp(1.25rem, 3vw, 2rem) 0.9rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex: none;
  padding-top: 0.2rem;
}

.by-ajigu {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 2.4rem;
  padding: 0.3rem 0.65rem;
  color: #697087;
  background: #fff;
  border: 1px solid #dcdfea;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
  transition: color 150ms ease, border-color 150ms ease;
}

.by-ajigu img {
  width: 18px;
  height: 18px;
  border-radius: 50%;
}

.by-ajigu span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.by-ajigu:hover {
  color: #1f2742;
  border-color: #b9c4f5;
}

.panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 0 clamp(1.25rem, 3vw, 2rem) 1.25rem;
}

.panel-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.7rem;
  padding: 0.9rem clamp(1.25rem, 3vw, 2rem) 1.1rem;
  background: rgb(255 255 255 / 94%);
  border-top: 1px solid rgb(31 39 66 / 8%);
}

.eyebrow {
  margin: 0;
  color: #657ff1;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

h1 {
  margin: 0.3rem 0 0.35rem;
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
}

h2 {
  margin: 0;
}

.subtitle {
  margin: 0;
  color: #697087;
  font-size: 0.8rem;
  line-height: 1.5;
}

.dropdown {
  position: relative;
  min-width: 0;
}

.dropdown-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  min-width: 100%;
  min-height: 2.4rem;
  padding: 0.35rem 0.65rem;
  color: #252c44;
  background: #fff;
  border: 1px solid #dcdfea;
  border-radius: 0.7rem;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 750;
  text-align: left;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.dropdown-button:hover {
  border-color: #b9c4f5;
}

.dropdown-button:focus-visible {
  border-color: #6a83f0;
  box-shadow: 0 0 0 4px rgb(106 131 240 / 15%);
  outline: none;
}

.dropdown-button:disabled {
  color: #9aa1b5;
  background: #f4f5f8;
  cursor: default;
}

.dropdown-button:disabled:hover {
  border-color: #dcdfea;
}

.dropdown-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dropdown-chevron {
  flex: none;
  color: #7b8295;
  font-size: 0.8rem;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  z-index: 40;
  min-width: 100%;
  width: max-content;
  max-width: 16rem;
  padding: 0.35rem;
  background: #fff;
  border: 1px solid #e4e6ee;
  border-radius: 0.8rem;
  box-shadow: 0 0.8rem 2rem rgb(20 26 45 / 18%);
}

.dropdown.align-right .dropdown-menu {
  left: auto;
  right: 0;
}

.dropdown-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem 0.65rem;
  color: #31405f;
  background: none;
  border: 0;
  border-radius: 0.55rem;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
  text-align: left;
}

.dropdown-option:hover {
  background: #f0f2f7;
}

.dropdown-option.selected {
  background: #eef1ff;
}

.dropdown-option.selected::after {
  content: "✓";
  color: #4f6ae8;
  font-weight: 850;
}

/* ---------- Sections ---------- */

.panel-section {
  margin-top: 1.35rem;
}

.section-title {
  color: #454d65;
  font-size: 0.82rem;
  font-weight: 850;
  letter-spacing: 0.02em;
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.section-title-actions {
  display: flex;
  gap: 0.4rem;
}

.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

/* ---------- Fields ---------- */

.field {
  display: grid;
  gap: 0.4rem;
}

.field > span {
  color: #555d74;
  font-size: 0.76rem;
  font-weight: 700;
}

.field-wide {
  grid-column: 1 / -1;
}

.field-note {
  display: block;
  margin: 0.1rem 0 0;
  color: #7b8295;
  font-size: 0.7rem;
  line-height: 1.45;
}

input,
select {
  width: 100%;
  min-height: 2.7rem;
  padding: 0.6rem 0.8rem;
  color: #252c44;
  background: #fff;
  border: 1px solid #dcdfea;
  border-radius: 0.8rem;
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

input:focus,
select:focus {
  border-color: #6a83f0;
  box-shadow: 0 0 0 4px rgb(106 131 240 / 15%);
}

.range-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 2.7rem;
  align-items: center;
  gap: 0.55rem;
  min-height: 2.7rem;
  padding: 0.4rem 0.65rem;
  background: #fff;
  border: 1px solid #dcdfea;
  border-radius: 0.8rem;
}

.range-control.compact {
  grid-template-columns: minmax(0, 1fr) 2.4rem;
}

.range-control input {
  min-height: auto;
  padding: 0;
  border: 0;
  box-shadow: none;
  accent-color: #627ef5;
}

.range-control output {
  color: #596178;
  font-size: 0.72rem;
  font-weight: 800;
  text-align: right;
}

.color-field input[type="color"] {
  min-height: 2.7rem;
  padding: 0.3rem;
  cursor: pointer;
}

.check-field {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: #555d74;
  font-size: 0.78rem;
  font-weight: 800;
}

.check-field input {
  width: 1rem;
  min-height: 1rem;
  accent-color: #627ef5;
}

.shadow-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  padding: 0.75rem;
}

.shadow-grid[aria-disabled="true"] {
  opacity: 0.45;
}

.shadow-section {
  overflow: hidden;
  background: #fff;
  border: 1px solid #e4e6ee;
  border-radius: 0.8rem;
}

.shadow-section summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.7rem;
  cursor: pointer;
  list-style: none;
}

.shadow-section summary::-webkit-details-marker {
  display: none;
}

.shadow-section summary .check-field {
  flex: 1;
}

.fold-chevron {
  flex: none;
  color: #7b8295;
  font-size: 0.8rem;
  transition: transform 150ms ease;
}

.shadow-section[open] .fold-chevron {
  transform: rotate(90deg);
}

.upload-field input {
  padding: 0.5rem;
  font-size: 0.76rem;
}

/* ---------- Buttons ---------- */

.button {
  min-height: 3rem;
  padding: 0.75rem 1rem;
  border: 0;
  border-radius: 0.85rem;
  cursor: pointer;
  font-weight: 800;
  transition: transform 150ms ease, box-shadow 150ms ease, opacity 150ms ease;
}

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

.button:active {
  transform: translateY(0);
}

.button-primary {
  color: #fff;
  background: #627ef5;
  box-shadow: 0 0.7rem 1.5rem rgb(98 126 245 / 28%);
}

.button-secondary {
  color: #434b63;
  background: #ebedf3;
}

.mini-button {
  min-height: 2.2rem;
  padding: 0.4rem 0.7rem;
  color: #46506a;
  background: #f0f2f7;
  border: 1px solid #e0e3ec;
  border-radius: 0.7rem;
  cursor: pointer;
  font-size: 0.74rem;
  font-weight: 800;
  white-space: nowrap;
}

.mini-button:hover {
  color: #315af5;
  background: #fff;
  border-color: #aebbf8;
}

.link-button {
  min-height: auto;
  padding: 0;
  color: #4f6ae8;
  background: none;
  border: 0;
  cursor: pointer;
  font-size: 0.74rem;
  font-weight: 800;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.link-button:hover {
  color: #2c47d8;
}

.icon-button {
  display: grid;
  width: 2rem;
  height: 2rem;
  padding: 0;
  color: #46506a;
  background: #f0f2f7;
  border: 1px solid #e0e3ec;
  border-radius: 0.55rem;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 850;
  line-height: 1;
  place-items: center;
}

.icon-button:hover {
  color: #315af5;
  background: #fff;
  border-color: #9dacf4;
}

.icon-button.danger:hover {
  color: #cf3b50;
  border-color: #efabb5;
}

/* ---------- Layer chips ---------- */

.layer-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  max-height: 8.5rem;
  margin-top: 0.7rem;
  overflow-y: auto;
}

.layer-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.28rem 0.55rem 0.28rem 0.45rem;
  background: #f8f9fb;
  border: 1px solid #e5e7ee;
  border-radius: 999px;
}

.layer-chip.selected {
  background: #eef1ff;
  border-color: #aebbf8;
}

.layer-chip input[type="checkbox"] {
  width: 0.9rem;
  min-height: 0.9rem;
  padding: 0;
  accent-color: #627ef5;
}

.layer-chip {
  user-select: none;
}

.chip-select {
  touch-action: none;
  overflow: hidden;
  max-width: 11rem;
  padding: 0;
  color: #3d465f;
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Inspector ---------- */

.inspector {
  margin-top: 0.8rem;
  overflow: hidden;
  background: #f7f8fb;
  border: 1px solid #e4e6ee;
  border-radius: 1rem;
}

.inspector-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.65rem 0.9rem;
  background: rgb(255 255 255 / 60%);
  border-bottom: 1px solid #e9ebf2;
}

.inspector-title {
  overflow: hidden;
  color: #31405f;
  font-size: 0.8rem;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inspector-actions {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.action-group {
  display: flex;
  gap: 0.3rem;
}

.inspector-body {
  display: grid;
  gap: 0.8rem;
  padding: 0.9rem;
}

/* ---------- Font picker ---------- */

.font-picker-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  min-height: 2.7rem;
  padding: 0.55rem 0.8rem;
  color: #252c44;
  background: #fff;
  border: 1px solid #dcdfea;
  border-radius: 0.8rem;
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 750;
  text-align: left;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.font-picker-button:hover {
  border-color: #b9c4f5;
}

.font-picker-button:focus-visible {
  border-color: #6a83f0;
  box-shadow: 0 0 0 4px rgb(106 131 240 / 15%);
  outline: none;
}

#fontPickerLabel {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.font-picker-chevron {
  flex: none;
  color: #7b8295;
  font-size: 0.8rem;
}

.font-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 1.25rem;
}

.font-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgb(24 30 50 / 42%);
}

.font-modal-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(30rem, 100%);
  max-height: min(34rem, 92vh);
  overflow: hidden;
  background: #fff;
  border-radius: 1.25rem;
  box-shadow: 0 2rem 4rem rgb(20 26 45 / 30%);
}

.font-modal-header,
.font-modal-search,
.font-modal-footer {
  flex: none;
}

.font-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.9rem 1rem 0.5rem;
}

.font-modal-header h3 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.font-modal-header .icon-button {
  background: #f0f2f7;
}

.font-modal-search {
  padding: 0.25rem 1rem 0.75rem;
}

.font-modal-search input {
  min-height: 2.6rem;
}

.font-modal-list {
  flex: 1 1 auto;
  min-height: 5.5rem;
  overflow-y: auto;
  padding: 0 0.5rem 0.5rem;
  border-top: 1px solid #eef0f5;
}

.font-group-label {
  padding: 0.7rem 0.5rem 0.3rem;
  color: #8a90a3;
  font-size: 0.66rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.font-option {
  display: grid;
  grid-template-columns: minmax(6.5rem, 9rem) minmax(0, 1fr);
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.5rem 0.65rem;
  background: transparent;
  border: 0;
  border-radius: 0.7rem;
  cursor: pointer;
  text-align: left;
}

.font-option:hover {
  background: #f0f2f7;
}

.font-option.selected {
  background: #eef1ff;
}

.font-option-name {
  position: relative;
  overflow: hidden;
  padding-right: 1.1rem;
  color: #31405f;
  font-size: 0.78rem;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.font-option.selected .font-option-name::after {
  content: "✓";
  position: absolute;
  right: 0;
  color: #4f6ae8;
}

.font-option-preview {
  overflow: hidden;
  color: #252c44;
  font-size: 1.2rem;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.font-modal-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 1.1rem;
  padding: 0.7rem 1rem 0.85rem;
  background: #f7f8fb;
  border-top: 1px solid #e9ebf2;
}

.font-modal-footer .field-note {
  flex-basis: 100%;
  margin: 0;
}

/* ---------- Collapsible (batch) ---------- */

.collapsible {
  overflow: hidden;
  background: #f7f8fb;
  border: 1px solid #e4e6ee;
  border-radius: 1rem;
}

.collapsible summary {
  padding: 0.85rem 1rem;
  cursor: pointer;
  color: #454d65;
  font-size: 0.8rem;
  font-weight: 850;
  list-style-position: inside;
}

.collapsible-body {
  display: grid;
  gap: 0.75rem;
  padding: 0 1rem 1rem;
}

.batch-button {
  width: 100%;
}

.batch-bindings {
  display: grid;
  gap: 0.55rem;
}

.batch-binding {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  min-height: 2.4rem;
}

.batch-binding-name {
  overflow: hidden;
  color: #31405f;
  font-size: 0.78rem;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.batch-binding .dropdown {
  flex: none;
  min-width: 7.5rem;
}

.batch-binding .dropdown-button {
  min-height: 2.4rem;
}

progress {
  width: 100%;
  height: 0.5rem;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  accent-color: #627ef5;
}

/* ---------- Preview panel ---------- */

.preview-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: clamp(1rem, 2vw, 1.5rem);
  background: rgb(238 234 224 / 92%);
}

.preview-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.9rem;
}

.preview-heading h2 {
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}

.preview-heading-meta {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.custom-size {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.custom-size input {
  width: 5.4rem;
  min-height: 2.4rem;
  padding: 0.35rem 0.5rem;
  font-size: 0.78rem;
}

.custom-size[hidden] {
  display: none;
}

.switch-field {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 800;
  color: #6b7285;
}

.switch {
  flex: none;
  width: 2.1rem;
  height: 1.25rem;
  padding: 2px;
  background: #d7dae3;
  border-radius: 999px;
  transition: background 150ms ease;
}

.switch::after {
  content: "";
  display: block;
  width: 1.05rem;
  height: 1.05rem;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgb(0 0 0 / 25%);
  transition: transform 150ms ease;
}

.switch-field[aria-checked="true"] .switch {
  background: #627ef5;
}

.switch-field[aria-checked="true"] .switch::after {
  transform: translateX(0.85rem);
}

.switch-field[aria-checked="true"] .switch-label {
  color: #31405f;
}

.switch-field:focus-visible .switch {
  box-shadow: 0 0 0 4px rgb(106 131 240 / 20%);
}

.preview-view {
  display: none;
}

.preview-view.active {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.canvas-frame {
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
  overflow: hidden;
  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 0.6rem 2rem rgb(35 39 52 / 12%), inset 0 0 0 1px rgb(31 39 66 / 6%);
}

.canvas-frame canvas {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: min(62vh, 40rem);
  cursor: grab;
  touch-action: none;
}

.canvas-frame canvas:active {
  cursor: grabbing;
}

.canvas-hint {
  margin: 0.8rem 0 0;
  color: #7b8295;
  font-size: 0.76rem;
  text-align: center;
}

/* ---------- Template strip ---------- */

.template-section {
  flex: none;
  margin-top: 1.1rem;
  padding: 0.85rem 0.9rem 0.6rem;
  background: rgb(255 255 255 / 65%);
  border: 1px solid rgb(31 39 66 / 7%);
  border-radius: 1rem;
}

.template-section-title {
  margin: 0 0 0.55rem;
  color: #454d65;
  font-size: 0.76rem;
  font-weight: 850;
}

.template-strip {
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
  padding-bottom: 0.35rem;
}

.template-card {
  flex: none;
  display: grid;
  gap: 0.3rem;
  padding: 0.45rem;
  background: #fff;
  border: 1px solid #e4e6ee;
  border-radius: 0.8rem;
  cursor: pointer;
  text-align: center;
  transition: border-color 150ms ease, background 150ms ease;
}

.template-card:hover {
  border-color: #b9c4f5;
}

.template-card.selected {
  background: #eef1ff;
  border-color: #aebbf8;
}

.template-card img {
  display: block;
  width: 7.5rem;
  height: auto;
  border-radius: 0.5rem;
  box-shadow: inset 0 0 0 1px rgb(31 39 66 / 8%);
}

.template-card span {
  color: #3d465f;
  font-size: 0.72rem;
  font-weight: 750;
}

/* ---------- Image layer controls ---------- */

.image-controls {
  display: flex;
  align-items: flex-end;
  gap: 0.8rem;
}

.image-controls-side {
  display: grid;
  gap: 0.55rem;
  flex: 1;
  min-width: 0;
}

.image-thumb {
  flex: none;
  width: 4.8rem;
  height: 4.8rem;
  object-fit: contain;
  background-color: #fff;
  background-image:
    linear-gradient(45deg, #e4e6ee 25%, transparent 25%, transparent 75%, #e4e6ee 75%),
    linear-gradient(45deg, #e4e6ee 25%, transparent 25%, transparent 75%, #e4e6ee 75%);
  background-size: 12px 12px;
  background-position: 0 0, 6px 6px;
  border: 1px solid #e4e6ee;
  border-radius: 0.7rem;
}

.stepper-control {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  min-height: 2.7rem;
  padding: 0 0.6rem;
  background: #fff;
  border: 1px solid #dcdfea;
  border-radius: 0.8rem;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.stepper-control:focus-within {
  border-color: #6a83f0;
  box-shadow: 0 0 0 4px rgb(106 131 240 / 15%);
}

.stepper-control input {
  width: 100%;
  min-height: auto;
  padding: 0;
  background: none;
  border: 0;
  box-shadow: none;
  text-align: right;
}

.stepper-control input::-webkit-inner-spin-button,
.stepper-control input::-webkit-outer-spin-button {
  opacity: 1;
}

.stepper-suffix {
  flex: none;
  color: #596178;
  font-size: 0.75rem;
  font-weight: 800;
}

/* ---------- 3D preview ---------- */

.three-container {
  position: relative;
  flex: 1;
  width: 100%;
  min-height: 14rem;
}

.three-canvas {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  display: block;
  cursor: grab;
  touch-action: none;
  border-radius: 1rem;
  box-shadow: 0 0.6rem 2rem rgb(35 39 52 / 12%);
}

.three-canvas:active {
  cursor: grabbing;
}

.three-fallback {
  width: 100%;
  height: auto;
  border-radius: 1rem;
  box-shadow: 0 0.6rem 2rem rgb(35 39 52 / 12%);
}

/* ---------- SVG loader ---------- */

.svg-loader-wrap {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  background: rgb(243 240 232 / 96%);
  border-radius: 1rem;
}

.svg-loader-text {
  margin: 0;
  color: #5f6880;
  font-size: 0.8rem;
  font-weight: 750;
}

.tent-loader {
  width: 8.5rem;
  height: auto;
}

.tl-tent {
  transform-origin: 70px 88px;
  animation: tl-rock 1.1s ease-in-out infinite;
}

@keyframes tl-rock {
  0%, 100% { transform: rotate(-5deg); }
  50% { transform: rotate(5deg); }
}

.tl-sun {
  transform-origin: 22px 28px;
  animation: tl-spin 3.5s linear infinite;
}

@keyframes tl-spin {
  to { transform: rotate(360deg); }
}

.tl-spark {
  animation: tl-twinkle 1.2s ease-in-out infinite;
}

.tl-spark-2 {
  animation-delay: 0.6s;
}

@keyframes tl-twinkle {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 1; }
}

/* ---------- Toast ---------- */

.hidden-input {
  display: none;
}

.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  z-index: 50;
  max-width: min(90vw, 30rem);
  padding: 0.65rem 1.1rem;
  color: #fff;
  background: #252c44;
  border-radius: 999px;
  box-shadow: 0 0.8rem 2rem rgb(20 26 45 / 30%);
  font-size: 0.8rem;
  font-weight: 750;
  line-height: 1.45;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transform: translate(-50%, 0.6rem);
  transition: opacity 200ms ease, transform 200ms ease, visibility 0s linear 220ms;
}

.toast.show {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
  transition-delay: 0s;
}

.toast.success {
  background: #2c7a4b;
}

.toast.error {
  background: #b3372f;
}

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

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .control-panel {
    max-height: none;
  }
}

@media (max-width: 480px) {
  .two-col,
  .shadow-grid {
    grid-template-columns: 1fr;
  }

  .field-wide {
    grid-column: auto;
  }
}

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