:root {
  --bg: #090B0F;
  --top: rgba(15, 18, 24, 0.94);
  --panel: #111620;
  --panel-2: #171D27;
  --field: #0B0F16;
  --line: #29313D;
  --line-soft: #202833;
  --text: #F4F6F8;
  --muted: #A5AFBE;
  --muted-2: #7F8A9B;
  --accent: #58D68D;
  --accent-2: #D8B35A;
  --blue: #78CFE3;
  --danger: #F05A5A;
  --focus: #8AB4FF;
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.24);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: Poppins, Montserrat, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

body {
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease, transform 140ms ease;
}

button:disabled,
input:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

button:hover:not(:disabled) {
  border-color: var(--focus);
  background: #202837;
}

select,
input[type="text"],
input[type="number"] {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  color: var(--text);
  padding: 0 11px;
  outline: none;
}

.nativeFontSelect {
  display: none !important;
}

select:focus,
input:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 2px rgba(110, 168, 255, 0.18);
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  touch-action: pan-y;
}

input[type="color"] {
  width: 100%;
  min-width: 48px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--field);
  padding: 2px;
}

label {
  display: block;
  margin: 13px 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.topbar {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--top);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.20);
  backdrop-filter: blur(16px);
}

.brandBlock {
  min-width: 220px;
}

.brand {
  font-size: 18px;
  font-weight: 760;
  line-height: 1.1;
}

.subtitle {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.topActions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.button {
  min-height: 38px;
  border-radius: 8px;
  padding: 0 14px;
  font-weight: 760;
}

.buttonPrimary {
  background: linear-gradient(180deg, #2BA96B, #1D8052);
  border-color: rgba(104, 230, 151, 0.72);
  box-shadow: 0 8px 22px rgba(45, 203, 123, 0.12);
}

.buttonGhost {
  background: #171F2A;
}

.floatingToolbox {
  position: fixed;
  z-index: 35;
  left: 330px;
  top: 82px;
  display: grid;
  gap: 5px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 11px;
  background: rgba(8, 10, 15, 0.92);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(16px);
}

.toolButton {
  width: 37px;
  height: 37px;
  display: grid;
  place-items: center;
  border-color: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(22, 27, 36, 0.94);
  color: #EAF0F7;
  font-weight: 820;
  line-height: 1;
}

.toolButton span {
  font-size: 17px;
}

.toolButton small {
  display: none;
}

.toolButton:hover:not(:disabled),
.toolButton.isActive {
  border-color: rgba(88, 214, 141, 0.64);
  background: linear-gradient(180deg, rgba(55, 145, 102, 0.92), rgba(34, 101, 74, 0.92));
  color: #FFFFFF;
}

.toolButton:hover:not(:disabled) small,
.toolButton.isActive small {
  color: rgba(255, 255, 255, 0.88);
}

.toolButton.isDisabled {
  color: var(--muted-2);
}

.bucketColorPopover {
  position: absolute;
  top: 220px;
  left: calc(100% + 10px);
  width: 132px;
  display: grid;
  gap: 9px;
  padding: 11px;
  border: 1px solid rgba(216, 179, 90, 0.36);
  border-radius: 12px;
  background: rgba(10, 14, 22, 0.96);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.36);
}

.bucketColorPopover strong {
  font-size: 12px;
  font-weight: 820;
}

.bucketColorPopover span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 680;
  line-height: 1.35;
}

.bucketColorRow {
  display: block;
  align-items: center;
}

.bucketColorRow input[type="color"] {
  min-width: 100%;
  height: 38px;
}

.studioShell {
  height: calc(100vh - 68px);
  display: grid;
  grid-template-columns: 318px minmax(460px, 1fr) 292px;
  min-height: 0;
}

.sidePanel {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px;
  background: var(--panel);
}

.leftPanel {
  border-right: 1px solid var(--line);
}

.rightPanel {
  border-left: 1px solid var(--line);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 9px 8px 190px;
  scroll-padding-bottom: 190px;
  overscroll-behavior: contain;
}

.rightPanel::after {
  content: "";
  display: block;
  height: 190px;
}

.toolSection {
  margin-bottom: 10px;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(18, 24, 34, 0.96), rgba(12, 17, 25, 0.96));
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.025) inset;
}

.toolSection h1,
.toolSection h2 {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 760;
  line-height: 1.2;
}

.rightPanel .toolSection {
  background: linear-gradient(180deg, rgba(22, 29, 41, 0.98), rgba(13, 18, 27, 0.98));
}

.panelCard {
  border-color: rgba(255, 255, 255, 0.08);
}

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

.rightPanel label {
  margin-top: 8px;
  margin-bottom: 4px;
  font-size: 10px;
}

.rightPanel input[type="text"],
.rightPanel input[type="number"],
.rightPanel select {
  min-height: 31px;
  border-radius: 7px;
  padding: 0 9px;
  font-size: 12px;
}

.rightPanel input[type="color"] {
  height: 30px;
}

.compactTitle {
  margin-top: 14px;
}

.compactTitle h2 {
  margin-bottom: 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid rgba(216, 179, 90, 0.55);
  border-radius: 999px;
  color: #F6D77C;
  background: rgba(216, 179, 90, 0.10);
  padding: 0 8px;
  font-size: 11px;
  font-weight: 800;
}

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

.measureItem {
  min-height: 58px;
  padding: 9px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: #0D121A;
}

.measureItem span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.measureItem strong {
  display: block;
  margin-top: 6px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.2;
}

.productionNotes {
  min-height: 150px;
  margin: 0;
  white-space: pre-wrap;
  color: #D9DEE8;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
}

.canvasPanel {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at 50% -20%, rgba(120, 207, 227, 0.06), transparent 42%), #080B0F;
}

.canvasHeader {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: #0C1017;
}

.canvasInfo {
  margin-left: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.toggleRow,
.inlineSwitches {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.inlineSwitches {
  margin-bottom: 2px;
}

.checkLabel {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.checkLabel input {
  accent-color: var(--accent);
}

.checkLine {
  margin-top: 12px;
  justify-content: flex-start;
}

.canvasViewport {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: grid;
  place-items: center;
  padding: 20px;
}

#coverCanvas {
  width: min(100%, 1500px);
  height: auto;
  max-height: 100%;
  background: #090C11;
  border: 1px solid #202936;
  border-radius: 8px;
  box-shadow: var(--shadow);
  cursor: default;
}

#coverCanvas.isDraggable {
  cursor: grab;
}

#coverCanvas.isDragging {
  cursor: grabbing;
}

.inlineTextEditor {
  position: absolute;
  z-index: 24;
  min-height: 38px;
  border: 1px solid rgba(138, 180, 255, 0.88);
  border-radius: 9px;
  background: rgba(8, 12, 18, 0.94);
  color: #FFFFFF;
  padding: 0 11px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.34), 0 0 0 3px rgba(138, 180, 255, 0.18);
  outline: none;
}

.layersList {
  display: grid;
  gap: 6px;
}

.layerRow {
  display: grid;
  grid-template-columns: 27px 27px minmax(0, 1fr) 26px 26px;
  gap: 4px;
  align-items: center;
  min-height: 40px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: rgba(12, 17, 25, 0.92);
  padding: 5px;
}

.layerRow.isActiveLayer {
  border-color: var(--focus);
  box-shadow: 0 0 0 1px rgba(110, 168, 255, 0.22) inset;
}

.layerIconButton,
.layerMoveButton {
  width: 26px;
  min-width: 26px;
  min-height: 26px;
  border-radius: 6px;
  padding: 0;
  background: #141C27;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.layerIconButton:hover:not(:disabled),
.layerMoveButton:hover:not(:disabled) {
  color: var(--text);
}

.layerTextBlock {
  min-width: 0;
}

.layerName {
  min-width: 0;
  overflow: hidden;
  font-size: 11px;
  font-weight: 760;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.layerDetail {
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted-2);
  font-size: 9px;
  font-weight: 700;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.layerEditor {
  overflow: hidden;
  border-left: 3px solid var(--accent);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.layerEditor.isActiveEditor {
  border-color: var(--focus);
  background: linear-gradient(180deg, rgba(28, 36, 50, 0.98), rgba(16, 22, 32, 0.98));
  box-shadow: 0 0 0 1px rgba(110, 168, 255, 0.18) inset;
}

.rightPanel.hasActiveEditor .layerEditor:not(.isActiveEditor) {
  padding-bottom: 9px;
}

.rightPanel.hasActiveEditor .layerEditor:not(.isActiveEditor) > :not(.sectionTitleRow) {
  display: none !important;
}

.rightPanel.hasActiveEditor .layerEditor:not(.isActiveEditor) .sectionTitleRow {
  margin-bottom: 0;
}

.rightPanel.hasActiveEditor .layerEditor:not(.isActiveEditor) h2::after {
  content: "recolhido";
  margin-left: 8px;
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 700;
}

.layerEditor.isContextTarget {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(88, 214, 141, 0.22) inset, 0 12px 30px rgba(0, 0, 0, 0.20);
}

.editorSubhead {
  margin: 12px 0 6px;
  padding-top: 9px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  color: #D7DEE9;
  font-size: 10px;
  font-weight: 820;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.sectionTitleRow + .editorSubhead {
  margin-top: 8px;
  padding-top: 0;
  border-top: 0;
}

.backColorControls {
  margin-top: 9px;
  padding: 9px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(8, 12, 18, 0.42);
}

.backColorControls h3 {
  margin: 0 0 8px;
  color: #D7DEE9;
  font-size: 10px;
  font-weight: 820;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.layerEditor[data-editor="phrase"] {
  border-left-color: var(--accent-2);
}

.layerEditor[data-editor="spine"] {
  border-left-color: var(--blue);
}

.photoEditor[data-editor="photoFront"] {
  border-left-color: var(--danger);
}

.photoEditor[data-editor="photoBack"] {
  border-left-color: var(--accent-2);
}

.decorativeEditor[data-editor="decorativePng"] {
  border-left-color: #A78BFA;
}

.objectEditor[data-editor="creativeObject"] {
  border-left-color: #78CFE3;
}

.objectEditor .fontPickerMenu {
  max-height: 260px;
}

.smallButton {
  min-height: 27px;
  border-radius: 6px;
  padding: 0 7px;
  background: #202938;
  color: var(--text);
  font-size: 11px;
  font-weight: 760;
  white-space: nowrap;
}

.uploadButton {
  border-color: rgba(255, 142, 52, 0.72);
  background: linear-gradient(180deg, #F39B42, #C86B1F);
  color: #FFFFFF;
  box-shadow: 0 8px 20px rgba(241, 130, 45, 0.14);
}

.uploadButton:hover:not(:disabled) {
  border-color: rgba(255, 181, 88, 0.92);
  background: linear-gradient(180deg, #FFAA52, #D87524);
}

.fullWidthButton {
  width: 100%;
  margin-top: 10px;
}

.dangerButton {
  border-color: rgba(240, 90, 90, 0.55);
  color: #FFB5B5;
}

.photoActions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 8px;
}

.photoActions .dangerButton {
  grid-column: 1 / -1;
}

.quickActions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 9px;
}

.quickActions .smallButton {
  white-space: normal;
}

.fileInput {
  display: none;
}

.modalOverlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(5, 7, 10, 0.76);
  backdrop-filter: blur(18px);
}

.mockupDialog {
  width: min(1420px, 96vw);
  max-height: 96vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 12px;
  background: #0E141D;
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.48);
}

.modalHeader,
.modalFooter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line-soft);
}

.modalFooter {
  border-top: 1px solid var(--line-soft);
  border-bottom: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.modalHeader h2 {
  margin: 0;
  font-size: 17px;
}

.modalHeader p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.modalCloseButton {
  width: 34px;
  min-width: 34px;
  min-height: 34px;
  border-radius: 50%;
  padding: 0;
  font-size: 20px;
  line-height: 1;
}

#mockup3dCanvas {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: calc(96vh - 128px);
  display: block;
  background: #090D13;
  margin: 0 auto;
}

.mockupBody {
  position: relative;
  display: block;
  min-height: 0;
  background: #090D13;
}

.mockupControls {
  position: absolute;
  top: 26px;
  right: 26px;
  width: 242px;
  padding: 18px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 16px;
  background: rgba(12, 17, 25, 0.72);
  box-shadow: 0 22px 54px rgba(0,0,0,0.34);
  backdrop-filter: blur(16px);
}

.mockupControls label {
  margin-top: 18px;
}

.mockupControls label:first-child {
  margin-top: 0;
}

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

@media (max-width: 760px) {
  .mockupControls {
    position: static;
    width: auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 14px;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .mockupControls label {
    margin-top: 0;
  }
}

.twoCols {
  display: grid;
  grid-template-columns: 1fr 70px;
  gap: 10px;
  align-items: end;
}

.layerEditor[data-editor="spine"] .twoCols {
  grid-template-columns: 1fr;
}

.threeCols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-items: end;
}

.spineColorGrid label {
  min-height: 30px;
  line-height: 1.25;
}

.fontPreviewBox {
  margin-top: 10px;
  padding: 11px;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 8px;
  background: rgba(8, 12, 18, 0.58);
}

.externalFontBox,
.libraryGroup {
  margin-top: 9px;
  padding: 10px;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 8px;
  background: rgba(8, 12, 18, 0.42);
}

.externalFontBox input + input {
  margin-top: 8px;
}

.appFontPreviewList {
  display: grid;
  gap: 10px;
  margin-top: 9px;
}

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

.fontCategoryBlock > span {
  grid-column: 1 / -1;
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 800;
}

.appFontChip {
  min-height: 58px;
  display: grid;
  gap: 3px;
  justify-items: start;
  padding: 8px 9px;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 8px;
  background: rgba(8, 12, 18, 0.46);
  color: var(--text);
}

.appFontChip:hover {
  border-color: rgba(138, 180, 255, 0.32);
  background: rgba(138, 180, 255, 0.10);
}

.appFontChip small {
  max-width: 100%;
  color: var(--muted-2);
  font-family: Poppins, Montserrat, sans-serif;
  font-size: 10px;
  font-weight: 760;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.appFontChip strong {
  max-width: 100%;
  font-size: 20px;
  font-weight: 500;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.libraryHint,
.futureNote {
  color: var(--muted);
  font-size: 12px;
  font-weight: 620;
  line-height: 1.45;
}

.backgroundLibraryList {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.backgroundPresetButton {
  min-height: 74px;
  display: grid;
  grid-template-columns: 36px 1fr;
  align-items: center;
  gap: 9px;
  padding: 9px;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 8px;
  background: rgba(8, 12, 18, 0.44);
  color: var(--text);
  text-align: left;
}

.backgroundPresetButton:hover,
.backgroundPresetButton.isSelected {
  border-color: rgba(43, 169, 107, 0.48);
  background: rgba(43, 169, 107, 0.10);
}

.backgroundPresetPreview {
  width: 36px;
  height: 48px;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 6px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.16);
}

.backgroundPresetButton strong {
  font-size: 12px;
  line-height: 1.25;
}

.fontPicker {
  position: relative;
}

.fontPickerTrigger {
  position: relative;
  width: 100%;
  min-height: 56px;
  display: grid;
  gap: 3px;
  justify-items: start;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--field);
}

.fontPickerTrigger::after {
  content: "⌄";
  position: absolute;
  right: 11px;
  top: 17px;
  color: var(--muted);
  font-size: 14px;
}

.fontPickerLabel {
  max-width: calc(100% - 26px);
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 760;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fontPickerTrigger strong {
  max-width: calc(100% - 26px);
  font-size: 20px;
  font-weight: 500;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fontPickerMenu {
  display: none;
  position: absolute;
  z-index: 60;
  left: 0;
  top: calc(100% + 6px);
  width: min(430px, calc(100vw - 32px));
  max-width: 100%;
  max-height: 420px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0;
  border: 1px solid #2F343A;
  border-radius: 3px;
  background: #EFEFEF;
  color: #171717;
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.52);
}

.fontPicker.isOpen .fontPickerMenu {
  display: block;
}

.fontPickerGroup + .fontPickerGroup {
  margin-top: 0;
  padding-top: 0;
  border-top: 1px solid #D0D0D0;
}

.fontPickerGroupTitle {
  margin: 0;
  padding: 5px 9px;
  color: #333333;
  background: #D8D8D8;
  font-size: 10px;
  font-weight: 800;
}

.fontPickerOption {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(82px, 0.92fr) minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  justify-items: start;
  min-height: 30px;
  margin: 0;
  padding: 4px 9px;
  border-color: transparent;
  border-radius: 0;
  background: transparent;
  color: #171717;
  overflow: hidden;
}

.fontPickerOption:hover,
.fontPickerOption.isSelected {
  border-color: transparent;
  background: #2B6DCE;
  color: #FFFFFF;
}

.fontPickerName {
  min-width: 0;
  max-width: 100%;
  color: inherit;
  font-family: Poppins, Montserrat, sans-serif;
  font-size: 11px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fontPickerPreview {
  min-width: 0;
  max-width: 100%;
  color: inherit;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.typeControlStrip {
  display: grid;
  grid-template-columns: 26px 26px auto minmax(0, 1fr);
  gap: 5px;
  align-items: center;
  margin-top: 6px;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 7px;
  background: rgba(7, 10, 15, 0.58);
}

.typeToggle {
  min-height: 23px;
  border-radius: 5px;
  padding: 0;
  background: #151B24;
  color: #DCE4EF;
  font-size: 12px;
  font-weight: 850;
}

.typeToggle.italicToggle {
  font-style: italic;
}

.typeToggle.isActive {
  border-color: rgba(138, 180, 255, 0.58);
  background: #2B6DCE;
  color: #FFFFFF;
}

.typeControlStrip label {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}

.typeControlStrip input[type="range"] {
  height: 12px;
}

.fontPreviewBox span {
  display: block;
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 700;
}

.fontPreviewBox strong {
  display: block;
  margin-top: 5px;
  color: var(--text);
  font-size: 22px;
  font-weight: 500;
  line-height: 1.25;
}

/* Compact right inspector: closer to a professional tools/properties palette. */
.studioShell {
  grid-template-columns: 318px minmax(520px, 1fr) 218px;
}

.rightPanel {
  padding: 6px 6px 150px;
  font-size: 10px;
  background: #0D121A;
  scroll-padding-bottom: 150px;
}

.rightPanel::after {
  height: 130px;
}

.rightPanel .toolSection {
  margin-bottom: 6px;
  padding: 7px;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(18, 23, 32, 0.98), rgba(10, 14, 21, 0.98));
}

.rightPanel .sectionTitleRow {
  gap: 6px;
}

.rightPanel .toolSection h1,
.rightPanel .toolSection h2 {
  margin-bottom: 6px;
  font-size: 12px;
  line-height: 1.05;
}

.rightPanel label {
  margin-top: 5px;
  margin-bottom: 3px;
  font-size: 9px;
  line-height: 1.15;
}

.rightPanel input[type="text"],
.rightPanel input[type="number"],
.rightPanel select {
  min-height: 25px;
  border-radius: 6px;
  padding: 0 7px;
  font-size: 10px;
}

.rightPanel input[type="color"] {
  height: 24px;
  min-width: 36px;
  padding: 1px;
  border-radius: 6px;
}

.rightPanel input[type="range"] {
  height: 14px;
}

.rightPanel .checkLabel {
  gap: 4px;
  font-size: 10px;
}

.rightPanel .inlineSwitches {
  gap: 7px;
  margin-bottom: 0;
}

.rightPanel .editorSubhead {
  margin: 8px 0 4px;
  padding-top: 6px;
  font-size: 9px;
  line-height: 1.1;
}

.rightPanel .sectionTitleRow + .editorSubhead {
  margin-top: 5px;
}

.rightPanel .smallButton {
  min-height: 23px;
  padding: 0 6px;
  border-radius: 5px;
  font-size: 9px;
  line-height: 1.05;
}

.rightPanel .layersList {
  gap: 4px;
}

.rightPanel .layerRow {
  grid-template-columns: 23px 23px minmax(0, 1fr) 22px 22px;
  min-height: 32px;
  gap: 3px;
  padding: 4px;
  border-radius: 6px;
}

.rightPanel .layerIconButton,
.rightPanel .layerMoveButton {
  width: 22px;
  min-width: 22px;
  min-height: 22px;
  border-radius: 5px;
  font-size: 10px;
}

.rightPanel .layerName {
  font-size: 10px;
}

.rightPanel .layerDetail {
  margin-top: 1px;
  font-size: 8px;
}

.rightPanel .photoActions,
.rightPanel .quickActions {
  gap: 4px;
  margin-top: 6px;
}

.rightPanel .fontPickerTrigger {
  min-height: 38px;
  gap: 1px;
  padding: 5px 8px;
  border-radius: 7px;
}

.rightPanel .fontPickerTrigger::after {
  right: 8px;
  top: 10px;
  font-size: 12px;
}

.rightPanel .fontPickerLabel {
  font-size: 9px;
}

.rightPanel .fontPickerTrigger strong {
  font-size: 14px;
  line-height: 1.05;
}

.rightPanel .fontPickerMenu {
  left: auto;
  right: 0;
  width: min(248px, calc(100vw - 28px));
  max-width: calc(100vw - 28px);
  max-height: 300px;
}

.rightPanel .fontPickerOption {
  grid-template-columns: minmax(78px, 0.72fr) minmax(0, 1.28fr);
  gap: 8px;
  padding: 5px 9px;
}

.rightPanel .fontPickerName {
  font-size: 10px;
  line-height: 1.1;
}

.rightPanel .fontPickerPreview {
  width: 100%;
  font-size: 15px;
  line-height: 1.08;
}

.rightPanel .fontPreviewBox {
  margin-top: 6px;
  padding: 7px;
  border-radius: 7px;
}

.rightPanel .fontPreviewBox span {
  font-size: 9px;
}

.rightPanel .fontPreviewBox strong {
  margin-top: 2px;
  font-size: 16px;
  line-height: 1.08;
}

.rightPanel .backColorControls,
.rightPanel .externalFontBox,
.rightPanel .libraryGroup {
  margin-top: 6px;
  padding: 7px;
  border-radius: 7px;
}

.rightPanel .fontCategoryBlock,
.rightPanel .backgroundLibraryList {
  grid-template-columns: 1fr;
  gap: 5px;
}

.rightPanel .appFontChip {
  min-height: 38px;
  padding: 6px;
}

.rightPanel .appFontChip strong {
  font-size: 15px;
}

.rightPanel.hasActiveEditor .layerEditor:not(.isActiveEditor) {
  padding-bottom: 7px;
}

.rightPanel.hasActiveEditor .layerEditor:not(.isActiveEditor) h2::after {
  font-size: 8px;
}

.fontLibraryPanel .fontGroups {
  display: none;
}

.fontLibraryPanel .statusText {
  margin: 5px 0 0;
  font-size: 9px;
}

.spineDisposition {
  margin-top: 12px;
  padding-top: 2px;
}

.roundedControls {
  margin-top: 14px;
}

.spineRotateControl {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.angleBadge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: #0D121B;
  color: var(--muted);
  padding: 0 9px;
  font-size: 12px;
  font-weight: 760;
  white-space: nowrap;
}

.resetBlockButton {
  width: 100%;
  margin-top: 14px;
}

.backColorControls {
  margin: 2px 0 14px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 8px;
  background: rgba(8, 12, 18, 0.40);
}

.backColorControls h3 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 760;
}

.suggestedColors {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.colorSwatch {
  width: 34px;
  height: 34px;
  min-height: 34px;
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,0.14);
  padding: 0;
  box-shadow: 0 8px 22px rgba(0,0,0,0.22);
}

.colorSwatch.isSelected {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(138, 180, 255, 0.18);
}

.emptyHint,
.futureNote,
.statusText {
  color: var(--muted-2);
  font-size: 12px;
  line-height: 1.45;
}

.statusText {
  min-height: 18px;
  margin: 10px 0 0;
}

.fontGroups {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.fontGroupTitle {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.futureTitle {
  margin-top: 4px;
}

.customFontsList {
  display: grid;
  gap: 8px;
}

.customFontRow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 9px;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 8px;
  background: rgba(8, 12, 18, 0.52);
}

.fontRowText {
  min-width: 0;
}

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

.fontRowText span {
  margin-top: 3px;
  color: var(--text);
  font-size: 20px;
}

.fontRowText small {
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 11px;
}

.fontRowActions {
  display: flex;
  gap: 6px;
  flex-direction: column;
}

.isHidden {
  display: none !important;
}

@media (max-width: 1280px) {
  body {
    overflow: auto;
  }

  .topbar {
    height: auto;
    align-items: flex-start;
    flex-direction: column;
  }

  .floatingToolbox {
    left: 12px;
    top: 92px;
  }

  .bucketColorPopover {
    top: 0;
    left: 62px;
  }

  .topActions {
    justify-content: flex-start;
  }

  .studioShell {
    height: auto;
    grid-template-columns: 1fr;
  }

  .sidePanel,
  .leftPanel,
  .rightPanel {
    border: 0;
    border-bottom: 1px solid var(--line);
  }

  .canvasPanel {
    min-height: 650px;
  }
}

@media (max-width: 720px) {
  .topActions,
  .toggleRow,
  .inlineSwitches {
    width: 100%;
  }

  .button {
    flex: 1 1 160px;
  }

  .canvasHeader {
    align-items: flex-start;
    flex-direction: column;
  }

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

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

  .layerRow {
    grid-template-columns: 32px 32px minmax(120px, 1fr) 30px 30px;
  }

  .layerMoveButton {
    min-height: 28px;
  }

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

  .photoActions .dangerButton {
    grid-column: auto;
  }
}
