.background-trigger-preview.is-empty,
.no-background-option,
.canvas-wrap.transparent-preview {
  background-color: #111824;
  background-image:
    linear-gradient(45deg, rgba(255, 255, 255, .07) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255, 255, 255, .07) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, .07) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, .07) 75%);
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-size: 16px 16px;
}

.no-background-option {
  display: grid;
  place-items: center;
  min-height: 70px;
  color: #dbe7f3;
  font-weight: 800;
}

@font-face {
  font-family: ArmoryBotFont;
  src: url('/armorybot/editor/fonts/DejaVuSans-Bold.ttf') format('truetype');
  font-display: swap;
  font-weight: 700 900;
}

.control-note {
  margin: 0 0 12px;
  color: #91a6ba;
  font-size: 0.84rem;
  line-height: 1.45;
}

.style-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 9px;
  padding: 5px;
  border: 1px solid rgba(143, 214, 255, .18);
  border-radius: 13px;
  background: rgba(5, 8, 14, .6);
}

.style-option {
  min-height: 43px;
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 9px 12px;
  color: #aebdcd;
  background: transparent;
  font: inherit;
  font-size: .87rem;
  font-weight: 750;
  cursor: pointer;
}

.style-option:hover { color: #eef6ff; background: rgba(143, 214, 255, .06); }
.style-option.active { color: #06111d; background: var(--studio-blue); }
.style-option:disabled { cursor: wait; opacity: .55; }
.style-option:focus-visible { outline: 2px solid var(--studio-gold); outline-offset: 2px; }
.style-description { margin-bottom: 18px; }
#newLayoutSettings[hidden] { display: none; }

.upload-card {
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid rgba(247, 198, 109, .35);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(247, 198, 109, .09), rgba(143, 214, 255, .04));
}

.upload-card .eyebrow { margin: 0 0 5px; color: var(--studio-gold) !important; }
.upload-card h2 { margin: 0; color: #f5f8fc; font-size: 1.05rem; }
.upload-intro { margin: 6px 0 13px; color: #b2c1d0; font-size: .84rem; }
.saved-photo-toggle { display: flex; align-items: center; gap: 9px; color: #dcefff; font-size: .88rem; font-weight: 700; cursor: pointer; }
.saved-photo-toggle input { width: 18px; height: 18px; margin: 0; accent-color: var(--studio-blue); }
.saved-photo-toggle input:disabled { cursor: not-allowed; opacity: .5; }
.saved-photo-toggle input:focus-visible { outline: 2px solid var(--studio-gold); outline-offset: 3px; }
.saved-photo-status { margin: 7px 0 15px; color: #91a6ba; font-size: .77rem; line-height: 1.5; }
.upload-label { display: block; margin-bottom: 6px; color: #dcefff; font-size: .82rem; font-weight: 700; }

.upload-card #backgroundUpload {
  display: block;
  width: 100%;
  min-width: 0;
  padding: 7px;
  border: 1px solid rgba(143, 214, 255, .24);
  border-radius: 9px;
  background: rgba(5, 8, 14, .5);
  color: #dcefff;
  font: inherit;
  font-size: .82rem;
}

.upload-card #backgroundUpload::file-selector-button {
  margin-right: 10px;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: var(--studio-blue);
  color: #06111d;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.upload-card #backgroundUpload:disabled { opacity: .5; cursor: not-allowed; }
.upload-card #backgroundUpload:disabled::file-selector-button { cursor: not-allowed; }
.upload-card #backgroundUpload:focus-visible,
.upload-remove:focus-visible { outline: 2px solid var(--studio-gold); outline-offset: 3px; }
.upload-limits,
.upload-fit,
.upload-privacy { margin: 8px 0 0; font-size: .76rem; line-height: 1.5; }
.upload-limits { color: #c1cfdd; }
.upload-fit { color: #91a6ba; }
.upload-privacy { color: #d6c39d; }
.upload-feedback { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.upload-status { flex: 1 1 190px; margin: 0; color: #a4bfce; font-size: .78rem; overflow-wrap: anywhere; }
.upload-status.is-error { color: #ffb3bd; }
.upload-remove { border: 1px solid rgba(143, 214, 255, .2); border-radius: 7px; padding: 7px 9px; background: rgba(143, 214, 255, .08); color: #dcefff; font: inherit; font-size: .77rem; cursor: pointer; }
.upload-remove:hover { background: rgba(143, 214, 255, .15); }
.upload-remove:disabled { opacity: .5; cursor: wait; }
.upload-remove[hidden] { display: none; }

.account-character-picker {
  display: grid;
  gap: 8px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.account-character-picker > label {
  color: #aebdcd;
  font-size: 0.84rem;
}

.save-requirement {
  margin: -4px 0 12px;
  padding: 9px 12px;
  border-radius: 8px;
  background: rgba(88, 101, 242, 0.1);
  color: #aeb8ff;
  font-size: 0.8rem;
}

.save-requirement.is-linked {
  background: rgba(91, 224, 149, 0.08);
  color: #8ee8b5;
}

.save-requirement button {
  margin: 0 4px;
  padding: 4px 8px;
  border: 0;
  border-radius: 4px;
  background: #5865f2;
  color: white;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.toolbar-actions button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}
.region-picker {
  margin: 12px 0;
  padding: 0;
  border: 0;
}

.region-picker legend {
  margin-bottom: 7px;
  color: #aebdcd;
  font-size: .84rem;
}

.region-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.region-button {
  padding: 10px;
  border: 1px solid rgba(143, 214, 255, .16);
  border-radius: 10px;
  background: #0a101a;
  color: #aebdcd;
  font: 800 .9rem system-ui;
  cursor: pointer;
}

.region-button.active {
  border-color: var(--studio-blue);
  background: rgba(143, 214, 255, .16);
  color: #eef6ff;
  box-shadow: inset 0 0 0 1px var(--studio-blue);
}

.empty-preview[hidden],
.background-chooser[hidden],
.studio-grid[hidden],
.auth-gate[hidden],
.draft-restore[hidden],
.connect-card[hidden] {
  display: none;
}

.background-trigger {
  width: 100%;
  display: grid;
  grid-template-columns: 64px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 9px;
  border: 1px solid rgba(143, 214, 255, .18);
  border-radius: 12px;
  background: rgba(255, 255, 255, .035);
  color: #eef6ff;
  text-align: left;
  cursor: pointer;
}

.background-trigger-preview {
  width: 64px;
  aspect-ratio: 16 / 10;
  border-radius: 8px;
  background-position: center;
  background-size: cover;
}

.background-trigger > span:nth-child(2) {
  display: grid;
  gap: 3px;
}

.background-trigger small {
  color: #91a6ba;
}

.background-chooser {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 38px;
  align-items: center;
  gap: 8px;
  margin: -3px 0 12px;
  padding: 10px;
  border: 1px solid rgba(143, 214, 255, .16);
  border-radius: 12px;
  background: #080e18;
  box-shadow: 0 18px 45px rgba(0, 0, 0, .32);
}

.background-grid {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  outline: none;
}

.background-option {
  position: relative;
  flex: 0 0 150px;
  padding: 3px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 9px;
  background: #05080e;
  cursor: pointer;
  scroll-snap-align: center;
}

.background-option img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 6px;
  object-fit: cover;
}

.background-option > span {
  position: absolute;
  right: 8px;
  bottom: 7px;
  min-width: 22px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(4, 8, 14, .78);
  color: white;
  font-size: .72rem;
}

.no-background-option > span {
  position: static;
  background: rgba(4, 8, 14, .72);
}

.background-arrow {
  width: 38px;
  height: 64px;
  border: 1px solid rgba(143, 214, 255, .16);
  border-radius: 9px;
  background: rgba(143, 214, 255, .08);
  color: #dcefff;
  font-size: 1.7rem;
  cursor: pointer;
}

.background-arrow:hover {
  background: rgba(143, 214, 255, .16);
}

.background-extras {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 12px;
  padding-top: 2px;
}

.background-extras label {
  margin: 0;
  font-size: .78rem;
}

#backgroundTrigger[aria-expanded="true"] {
  border-color: var(--studio-blue);
  color: white;
}

@media (max-width: 620px) {
  .background-chooser {
    grid-template-columns: 32px minmax(0, 1fr) 32px;
  }

  .background-arrow {
    width: 32px;
  }

  .background-option {
    flex-basis: 125px;
  }

  .background-extras {
    grid-template-columns: 1fr;
  }
}

.background-option:hover,
.background-option.active {
  border-color: var(--studio-blue);
  box-shadow: 0 0 0 1px var(--studio-blue);
}

.draft-notice {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.draft-restore {
  padding: 0;
  border: 0;
  background: none;
  color: var(--studio-blue);
  font: inherit;
  font-size: .8rem;
  cursor: pointer;
  text-decoration: underline;
}

.layout-settings {
  margin-top: 12px;
  border: 1px solid rgba(143, 214, 255, .12);
  border-radius: 12px;
  background: rgba(255, 255, 255, .018);
}

.layout-settings > summary {
  padding: 13px 14px;
  color: #dbe8f5;
  font-size: .87rem;
  font-weight: 650;
}

.layout-settings[open] > summary {
  border-bottom: 1px solid rgba(143, 214, 255, .1);
}

.settings-fields {
  display: grid;
  gap: 15px;
  padding: 15px 14px;
}

.settings-fields label {
  color: #aebdcd;
  font-size: .8rem;
}

.setting-range {
  display: grid;
  gap: 6px;
}

.setting-range > span {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.setting-range output {
  color: #eef6ff;
  font-variant-numeric: tabular-nums;
}

.setting-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
}

.settings-fields .color-grid {
  grid-template-columns: repeat(3, 1fr);
}

.settings-fields .color-grid > label {
  display: grid;
  gap: 5px;
}

.save-status {
  color: #8ee8b5;
  font-size: .82rem;
  line-height: 1.5;
}

.save-status:not(:empty) {
  margin: 0 2px 12px;
}

.save-status.is-error,
.inline-status.is-error {
  color: #ff9f9f;
}

.connected-account {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px solid rgba(72, 190, 130, .24);
  border-radius: 10px;
  background: rgba(72, 190, 130, .08);
  color: #9ce4bd;
  font-size: .84rem;
}

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

.account-unlink {
  border: 1px solid rgba(255, 159, 159, .3);
  border-radius: 7px;
  padding: 6px 9px;
  background: rgba(220, 80, 98, .1);
  color: #ffb3bd;
  font: inherit;
  font-size: .78rem;
  cursor: pointer;
}

.account-unlink:hover { background: rgba(220, 80, 98, .18); }
.account-unlink:disabled { cursor: wait; opacity: .55; }

.preview-toolbar {
  gap: 12px;
  flex-wrap: wrap;
}

.toolbar-actions {
  flex-wrap: wrap;
}

.toolbar-actions button:focus-visible,
.background-option:focus-visible,
.background-arrow:focus-visible,
.draft-restore:focus-visible,
.layout-settings > summary:focus-visible {
  outline: 2px solid var(--studio-blue);
  outline-offset: 3px;
}

@media (max-width: 950px) {
  .draft-notice { justify-items: start; }
}

@media (max-width: 560px) {
  .toolbar-actions { flex-direction: row; }
  .canvas-wrap { min-height: 0; }
}

/* Sign-in is a save notice above the public workspace. */
.studio-shell > .auth-gate {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 18px;
  row-gap: 4px;
  max-width: none;
  margin: 0 0 20px;
  padding: 20px 24px;
  text-align: left;
}
.studio-shell > .auth-gate .gate-icon { grid-column: 1; grid-row: 1 / 3; font-size: 1.8rem; }
.studio-shell > .auth-gate h2 { grid-column: 2; grid-row: 1; margin: 0; font-size: 1.12rem; }
.studio-shell > .auth-gate p { grid-column: 2; grid-row: 2; margin: 0; font-size: .92rem; }
.studio-shell > .auth-gate .primary-action { grid-column: 3; grid-row: 1 / 3; white-space: nowrap; }
@media (max-width: 640px) {
  .studio-shell > .auth-gate { grid-template-columns: auto minmax(0, 1fr); padding: 18px; }
  .studio-shell > .auth-gate .primary-action { grid-column: 2; grid-row: 3; justify-self: start; margin-top: 10px; }
}
.studio-shell > .auth-gate[hidden] { display: none; }

.connection-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 0 0 20px;
  padding: 16px 20px;
  border: 1px solid rgba(143, 214, 255, .16);
  border-radius: 16px;
  background: var(--studio-panel);
}
.connection-panel h2 { margin: 0 0 4px; font-size: 1rem; }
.connection-panel p { margin: 0; color: #a9b8c8; font-size: .9rem; }
.connection-panel p.is-error { color: #ffb3bd; }
.connection-panel button { flex-shrink: 0; cursor: pointer; font: inherit; }
.connection-panel button:disabled { opacity: .5; cursor: wait; }
@media (max-width: 600px) {
  .connection-panel { align-items: stretch; flex-direction: column; padding: 16px; }
}
