* {
  box-sizing: border-box;
}

:root {
  --download-btn-blue: #1e3a8a;
  --download-btn-blue-dark: #1e3a8a;
  --download-btn-blue-rgb: 30, 58, 138;
  --app-bg-grad-start: #f5f5f5;
  --app-bg-grad-mid: #ebebeb;
  --app-bg-grad-end: #e0e0e0;
  --panel-surface-color: #fff;
  --preview-surface-color: #f0f0f0;
  --preview-border-color: #e0e0e0;
  --app-ink-strong: #111;
  --app-ink-soft: #666;
  --app-line-soft: #e5e5e5;
  --app-line-strong: #d5d5d5;
  --panel-tint: #f9f9f9;
  --panel-tint-strong: #f5f5f5;
}

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #fafafa;
  min-height: 100vh;
  color: var(--app-ink-strong);
}

.app {
  display: grid;
  grid-template-columns: minmax(290px, 360px) minmax(290px, 360px) minmax(290px, 360px);
  gap: 1.2rem;
  padding: 1.2rem;
  max-width: 1900px;
  margin: 0 auto;
  height: 100vh;
  align-items: start;
  justify-content: center;
}

.panel {
  background: var(--panel-surface-color);
  border: 1px solid var(--app-line-soft);
  border-radius: 14px;
  padding: 1rem;
  display: grid;
  gap: 0.6rem;
  align-content: start;
  max-height: calc(100vh - 3rem);
  overflow-y: auto;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

h1 {
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
  display: inline-block;
  padding: 0.5rem 0.8rem;
  border-radius: 10px;
  background: #1e3a8a;
  color: #fff;
  border: none;
  box-shadow: none;
  text-shadow: none;
  letter-spacing: -0.02em;
  font-weight: 700;
}

.panel-brand-btn {
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
  display: inline-block;
  text-align: left;
  padding: 0.5rem 0.8rem;
  border-radius: 10px;
  background: #1e3a8a;
  color: #fff;
  border: none;
  box-shadow: none;
  text-shadow: none;
  letter-spacing: -0.02em;
  font-weight: 700;
}

.panel-brand-btn .brand-subline {
  display: block;
  margin-top: 0.06rem;
  font-size: 0.7rem;
  font-weight: 600;
  font-style: normal;
  letter-spacing: 0.01em;
  color: #ffffff;
  opacity: 0.95;
  text-shadow: none;
}

.panel-brand-btn:hover {
  filter: brightness(1.05);
}

.panel-brand-hint {
  margin: -0.15rem 0 0.45rem;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--app-ink-soft);
}

.panel-brand-hint-link {
  color: #666;
  text-decoration: underline;
  text-underline-offset: 0.12em;
  cursor: pointer;
}

.panel-brand-hint-link:hover,
.panel-brand-hint-link:focus-visible {
  color: var(--download-btn-blue);
}

.studio-mode-btn {
  width: 100%;
  margin: -0.1rem 0 0.55rem;
  padding: 0.48rem 0.75rem;
  border-radius: 10px;
  border: 1px solid #e5e5e5;
  background: #fff;
  color: var(--app-ink-strong);
  font-size: 0.84rem;
  font-weight: 800;
  text-align: left;
}

.studio-mode-btn:hover {
  background: #f9f9f9;
  filter: none;
}

.studio-mode-value {
  color: var(--download-btn-blue);
}

.brand-subtitle {
  margin: -0.25rem 0 0.55rem;
  font-size: 0.82rem;
  font-weight: 400;
  font-style: italic;
  color: var(--app-ink-soft);
}

.tm-mark {
  font-size: 0.52em;
  vertical-align: super;
  font-weight: 700;
  margin-left: 0.08em;
}

h2 {
  margin: 0;
  font-size: 1rem;
}

.start-heading-red {
  color: var(--download-btn-blue);
}

label,
legend {
  font-weight: 600;
  font-size: 0.92rem;
}

input[type="text"],
select,
input[type="file"],
input[type="range"],
button {
  width: 100%;
}

input[type="text"],
select {
  padding: 0.6rem 0.7rem;
  border-radius: 8px;
  border: 1px solid #ddd;
  background: #fff;
  color: var(--app-ink-strong);
}

#designStartSavedSetupSelect {
  min-height: 2.85rem;
  padding: 0.62rem 0.8rem;
  font-size: 0.88rem;
  line-height: 1.05;
}

#topText,
#centerText,
#bottomText,
#tagLineText {
  padding: 0.38rem 0.62rem;
  min-height: 1.8rem;
}

.extra-text-card input[type="text"],
.extra-text-card select {
  padding: 0.38rem 0.62rem;
  min-height: 1.8rem;
}

.extra-text-card input[type="text"] {
}

input[type="checkbox"] {
  accent-color: #1e3a8a;
}

input[type="range"] {
  accent-color: var(--download-btn-blue);
  --range-thumb-size: 22px;
  --range-thumb-progress: 50%;
}

.range-scale,
.range-scale-current {
  display: none !important;
}

input[type="file"] {
  font-size: 0.9rem;
}

.hint {
  margin: -0.2rem 0 0.2rem;
  font-size: 0.82rem;
  color: var(--app-ink-soft);
}

.hint.accent-hint {
  color: var(--download-btn-blue-dark) !important;
  font-weight: 400;
}

#activeTextField {
  display: none !important;
}

input[type="color"] {
  width: 100%;
  height: 2.2rem;
  border: none;
  background: transparent;
  padding: 0;
}

.outline-palette {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.2rem;
}

.inline-used-colors-divider {
  width: 1px;
  height: 16px;
  background: #ddd;
  margin: 0 0.1rem 0 0.15rem;
}

.inline-used-colors {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.28rem;
}

.inline-used-color-swatch {
  width: 16px;
  height: 16px;
  min-width: 16px;
}

.outline-swatch {
  width: 16px;
  height: 16px;
  min-width: 16px;
  padding: 0;
  border-radius: 2px;
  border: 1px solid #ddd;
  cursor: pointer;
  position: relative;
}

.outline-swatch.is-selected {
  outline: 2px solid #0b6e35;
  outline-offset: 1px;
}

.palette-picker-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  overflow: hidden;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: linear-gradient(90deg, #ff4d4d 0%, #ff9f1c 18%, #ffe66d 34%, #4cd964 50%, #45b7ff 68%, #7b61ff 84%, #ff4fd8 100%);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.72) inset;
}

.palette-picker-wrap .palette-picker {
  width: 18px;
  height: 16px;
  min-width: 18px;
  padding: 0;
  border: 0;
  border-radius: 2px;
  background: transparent;
  opacity: 0;
  cursor: pointer;
}

.palette-picker-wrap .palette-picker::-webkit-color-swatch-wrapper {
  padding: 0;
}

.palette-picker-wrap .palette-picker::-webkit-color-swatch {
  border: 0;
  border-radius: inherit;
  background: transparent;
}

.palette-picker-wrap .palette-picker::-moz-color-swatch {
  border: 0;
  border-radius: inherit;
  background: transparent;
}

.palette-picker-hint {
  position: absolute;
  left: 4px;
  right: 4px;
  top: 50%;
  height: 2px;
  background: #666;
  transform: translateY(-50%);
  pointer-events: none;
  z-index: 2;
}

#photoPanelEnhancementRingSlot {
  margin-top: 0.25rem;
}

.photo-enhancement-ring-slot {
  display: grid;
}

.photo-enhancement-ring-toggle {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  margin-top: 0;
}

.photo-enhancement-ring-toggle input[type="checkbox"] {
  width: auto;
  accent-color: #1e3a8a;
  flex: 0 0 auto;
}

#photoPanelToggleSlot {
  margin-top: 0.35rem;
}

.photo-panel-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  margin-bottom: 0.2rem;
}

.photo-panel-header-row label {
  margin: 0;
}

.photo-dtf-btn {
  margin-top: 0;
  align-self: center;
  min-width: 2.3rem;
  padding-inline: 0.45rem;
}

#photoPanelAddExtraSlot,
#photoPanelFontSlot {
  margin-top: 0.35rem;
}

#fontPanelHomeSlot:empty,
#fontInlineHelpHome:empty,
#photoPanelFontSlot:empty,
#photoPanelAddExtraSlot:empty,
#photoPanelToggleSlot:empty {
  display: none;
}

#photoToggleHome,
#textControlsToggleHome,
#advancedFeatureToggleHome,
#addExtraTextHome,
#fontInlineHelpHome,
#fontPanelHomeSlot {
  display: contents;
}

.background-panel {
  display: grid;
  gap: 0.45rem;
  border: 1px solid var(--app-line-strong);
  border-radius: 10px;
  padding: 0.7rem;
  background: var(--panel-tint);
}

.bg-option {
  display: grid;
  gap: 0.35rem;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
  font-weight: 500;
}

.bg-option-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.bg-option-head input[type="radio"] {
  width: auto;
}

.bg-option-head span {
  flex: 1;
}

.bg-swatch-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 0.5rem;
  border: 1px solid var(--download-btn-blue);
  border-radius: 6px;
  padding: 0.45rem 0.5rem;
  background: #f9f9f9;
}

.bg-swatch-help {
  font-size: 0.8rem;
  color: var(--download-btn-blue-dark);
  font-weight: 400;
  line-height: 1.2;
}

.bg-swatch-inputs {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.5rem;
  width: 100%;
}

.bg-focus-selector {
  display: grid;
  gap: 0.35rem;
  width: min(100%, 360px);
}

.split-row .bg-focus-selector {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.three-row .bg-focus-selector {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.bg-focus-btn {
  margin: 0;
  min-width: 0;
  padding: 0.24rem 0.44rem;
  border: 1px solid #e5e5e5;
  border-radius: 999px;
  background: #fff;
  color: var(--app-ink-strong);
  font-size: 0.68rem;
  font-weight: 800;
}

.bg-focus-btn.is-active {
  background: #1e3a8a;
  color: #fff;
  border-color: transparent;
}

.bg-color-block {
  display: grid;
  gap: 0.2rem;
}

.bg-color-label {
  font-size: 0.76rem;
  font-weight: 700;
  color: #111;
}

.bg-outline-palette {
  gap: 0.3rem;
}

.background-panel [hidden] {
  display: none !important;
}

.background-swatch {
  width: 58px !important;
  min-width: 58px;
  height: 26px !important;
  padding: 0;
  border-radius: 4px;
  border: 2px solid var(--download-btn-blue);
  box-shadow: 0 0 0 1px #ffffff inset;
  background: transparent;
}

.background-swatch {
  appearance: none;
  -webkit-appearance: none;
  overflow: hidden;
}

.background-swatch::-webkit-color-swatch-wrapper {
  padding: 0;
}

.background-swatch::-webkit-color-swatch {
  border: 2px solid var(--download-btn-blue);
  border-radius: 2px;
}

.background-swatch::-moz-color-swatch {
  border: 2px solid var(--download-btn-blue);
  border-radius: 2px;
}

.bg-outline-palette .palette-picker-wrap .background-swatch {
  background: transparent;
  opacity: 0;
}

.bg-outline-palette .palette-picker-wrap .background-swatch::-webkit-color-swatch {
  background: transparent !important;
}

.bg-outline-palette .palette-picker-wrap .background-swatch::-moz-color-swatch {
  background: transparent !important;
}

.background-swatch:disabled {
  opacity: 0.65;
  cursor: default;
}

button {
  margin-top: 0.4rem;
  border: none;
  background: #1e3a8a;
  color: #fff;
  padding: 0.72rem 0.9rem;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
}

.secondary-btn {
  margin-top: 0.02rem;
  background: #1e3a8a;
  color: #fff;
}

#advancedFeatureToggleBtn.advanced-feature-toggle-open {
  background: #1e3a8a;
  border: 1px solid #1e3a8a;
}

#advancedFeatureToggleBtn.advanced-feature-toggle-open:hover {
  background: #333;
}

#downloadBtn {
  background: #1e3a8a;
  color: #fff;
}

#downloadBtn.download-pdf-state {
  background: #1e3a8a;
  color: #fff;
}


.preview-instructions-btn {
  display: block;
  width: min(94%, 720px);
  margin: 0.35rem auto 0;
  border: none;
  border-radius: 10px;
  text-decoration: none;
  text-align: center;
  color: #ffffff;
  font-weight: 700;
  padding: 0.72rem 0.9rem;
}

button:hover {
  filter: brightness(1.06);
}

body[data-studio-mode="pro"] .panel-brand-btn,
body.studio-mode-pro .panel-brand-btn {
  background: #1e3a8a;
  border: none;
  box-shadow: none;
}

body[data-studio-mode="pro"] button,
body[data-studio-mode="pro"] .preview-instructions-btn,
body.studio-mode-pro button,
body.studio-mode-pro .preview-instructions-btn {
  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    filter 140ms ease,
    background 140ms ease,
    border-color 140ms ease;
}

body[data-studio-mode="pro"] button:not(.outline-swatch):not(.compact-toggle-btn):not(.bg-focus-btn):not(.studio-mode-btn):not(.danger-btn):not(.delete-text-btn):not(.delete-all-text-btn):not(.close-text-control-btn-danger):not(.demo-inline-link),
body.studio-mode-pro button:not(.outline-swatch):not(.compact-toggle-btn):not(.bg-focus-btn):not(.studio-mode-btn):not(.danger-btn):not(.delete-text-btn):not(.delete-all-text-btn):not(.close-text-control-btn-danger):not(.demo-inline-link) {
  background: #1e3a8a;
  border: 1px solid #1e3a8a;
  border-radius: 8px;
  box-shadow: none;
  text-shadow: none;
  color: #fff;
}

body[data-studio-mode="pro"] button:not(.outline-swatch):not(.compact-toggle-btn):not(.bg-focus-btn):not(.studio-mode-btn):not(.danger-btn):not(.delete-text-btn):not(.delete-all-text-btn):not(.close-text-control-btn-danger):not(.demo-inline-link):hover,
body[data-studio-mode="pro"] .preview-instructions-btn:hover,
body.studio-mode-pro button:not(.outline-swatch):not(.compact-toggle-btn):not(.bg-focus-btn):not(.studio-mode-btn):not(.danger-btn):not(.delete-text-btn):not(.delete-all-text-btn):not(.close-text-control-btn-danger):not(.demo-inline-link):hover,
body.studio-mode-pro .preview-instructions-btn:hover {
  filter: none;
  transform: none;
  background: #333;
  box-shadow: none;
}

body[data-studio-mode="pro"] button:not(.outline-swatch):not(.compact-toggle-btn):not(.bg-focus-btn):not(.studio-mode-btn):not(.danger-btn):not(.delete-text-btn):not(.delete-all-text-btn):not(.close-text-control-btn-danger):not(.demo-inline-link):active,
body.studio-mode-pro button:not(.outline-swatch):not(.compact-toggle-btn):not(.bg-focus-btn):not(.studio-mode-btn):not(.danger-btn):not(.delete-text-btn):not(.delete-all-text-btn):not(.close-text-control-btn-danger):not(.demo-inline-link):active {
  transform: none;
  background: #152b6b;
  box-shadow: none;
}

body[data-studio-mode="pro"] .secondary-btn,
body[data-studio-mode="pro"] .instruction-toggle,
body.studio-mode-pro .secondary-btn,
body.studio-mode-pro .instruction-toggle {
  background: #fff;
  color: #111;
  border: 1px solid #d5d5d5;
}

body[data-studio-mode="pro"] #downloadBtn,
body[data-studio-mode="pro"] #downloadBtn.download-pdf-state,
body.studio-mode-pro #downloadBtn,
body.studio-mode-pro #downloadBtn.download-pdf-state {
  background: #1e3a8a;
  border-color: #1e3a8a;
  box-shadow: none;
  color: #fff;
}

body[data-studio-mode="pro"] .danger-btn,
body[data-studio-mode="pro"] .delete-text-btn,
body[data-studio-mode="pro"] .delete-all-text-btn,
body[data-studio-mode="pro"] .close-text-control-btn.close-text-control-btn-danger,
body[data-studio-mode="pro"] .instruction-toggle.is-active,
body.studio-mode-pro .danger-btn,
body.studio-mode-pro .delete-text-btn,
body.studio-mode-pro .delete-all-text-btn,
body.studio-mode-pro .close-text-control-btn.close-text-control-btn-danger,
body.studio-mode-pro .instruction-toggle.is-active {
  background: #dc2626;
  border-color: #dc2626;
  color: #fff;
  box-shadow: none;
}

.editor-panel {
  display: grid;
  gap: 0.6rem;
  border: 1px solid var(--app-line-strong);
  border-radius: 10px;
  padding: 0.7rem;
  background: var(--panel-tint);
}

#textControlsPanel.editor-panel {
  gap: 0.45rem;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
}

.text-field-chooser-panel {
  margin-top: -0.1rem;
}

.text-field-chooser-grid {
  display: grid;
  gap: 0.35rem;
}

.text-choose-extra-buttons {
  display: grid;
  gap: 0.35rem;
}

.field-controls {
  display: grid;
  gap: 0.45rem;
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  padding: 0.6rem;
  background: #f9f9f9;
}

.text-control-pair-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  align-items: start;
}

.text-control-triple-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.text-control-pair-item {
  display: grid;
  gap: 0.45rem;
  min-width: 0;
}

.top-font-style-row {
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.85fr);
}

.text-control-pair-slot > #selectedTextHeightControl {
  display: grid;
  gap: 0.45rem;
  min-width: 0;
}

.text-control-pair-slot:empty {
  min-height: 0;
}

.text-field-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.text-field-head-row > label,
.text-field-head-row > span {
  margin: 0;
}

.text-pill-group {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  flex-shrink: 0;
}

.text-pill-btn {
  width: auto;
  min-width: 2.05rem;
  padding: 0.12rem 0.42rem;
  border-radius: 999px;
  border: 1px solid #1e3a8a;
  background: #1e3a8a;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.05em;
  box-shadow: none;
}

.text-pill-btn:hover,
.text-pill-btn:focus-visible {
  filter: brightness(1.07);
}

.text-pill-btn:focus-visible {
  outline: 2px solid #1e3a8a;
  outline-offset: 1px;
}

@media (max-width: 640px) {
  .text-control-pair-row,
  .text-control-triple-row {
    grid-template-columns: 1fr;
  }
}

.field-controls.outline-collapsed > :not(.outline-keep) {
  display: none !important;
}

.extra-text-card.outline-collapsed > :not(.outline-keep) {
  display: none !important;
}

.editor-panel [hidden] {
  display: none !important;
}

.advanced-feature-toggle-slot {
  display: grid;
  margin-top: 0.85rem;
}

.extra-text-section {
  display: grid;
  gap: 0.6rem;
}

.extra-text-card {
  border: 1px solid var(--app-line-strong);
  border-radius: 10px;
  padding: 0.6rem;
  display: grid;
  gap: 0.45rem;
  background: #f9f9f9;
}

.extra-text-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-weight: 600;
}

.delete-text-btn {
  margin-top: 0.2rem;
  background: #1e3a8a;
  color: #fff;
  border: 1px solid #1e3a8a;
  padding: 0.38rem 0.58rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
}

.delete-text-btn:hover {
  filter: none;
  background: #333;
}

.delete-all-text-btn {
  margin-top: 0.2rem;
  background: #1e3a8a;
  color: #fff;
  border: 1px solid #1e3a8a;
  box-shadow: none;
  padding: 0.42rem 0.58rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
}

.delete-all-text-btn:hover {
  filter: brightness(1.04);
}

.preview-delete-all-btn {
  width: min(100%, 520px);
  margin: 1.4rem auto 0;
}

.close-text-control-btn {
  margin-top: 0.2rem;
  background: var(--download-btn-blue);
  color: #ffffff;
  border: 1px solid var(--download-btn-blue);
  padding: 0.38rem 0.58rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
}

.close-text-control-btn:hover {
  filter: none;
  background: var(--download-btn-blue-dark);
}

.close-text-control-btn.close-text-control-btn-danger {
  background: #1e3a8a;
  border-color: #1e3a8a;
}

.close-text-control-btn.close-text-control-btn-danger:hover {
  background: #333;
}

.close-text-control-btn.advance-to-next-panel-btn {
  background: #1e3a8a;
  border-color: #1e3a8a;
  box-shadow: none;
}

.close-text-control-btn.advance-to-next-panel-btn:hover {
  background: #333;
}

#photoPanelClosePanelBtn {
  margin-top: 0.8rem;
}

.compact-toggle-btn {
  margin-top: 0.15rem;
  background: #fff;
  color: var(--app-ink-strong);
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  padding: 0.5rem 0.62rem;
  font-size: 0.82rem;
  font-weight: 700;
  text-align: left;
}

.compact-toggle-btn:hover {
  filter: none;
  background: #f9f9f9;
}

.preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0.85rem;
  padding: 0.55rem 0.75rem 0.9rem;
  background: var(--panel-surface-color);
  border: 1px solid var(--preview-border-color);
  border-radius: 16px;
  position: sticky;
  top: 1.5rem;
  min-height: calc(100vh - 3rem);
  max-height: calc(100vh - 3rem);
  overflow-y: auto;
}

.preview-title {
  margin: 0;
  padding: 0.38rem 0.8rem;
  border-radius: 999px;
  border: 1px solid #1e3a8a;
  background: #1e3a8a;
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  box-shadow: none;
}

.preview-title-btn {
  border: 2px solid #1e3a8a;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: transform 140ms ease, box-shadow 180ms ease, filter 140ms ease;
}

.preview-title-btn:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.preview-title-btn:focus-visible {
  outline: 2px solid #1e3a8a;
  outline-offset: 2px;
}

.layout-canvas-hint {
  margin: -0.3rem 0 0.15rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--download-btn-blue);
}

@keyframes canvasTogglePulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.35), 0 5px 14px rgba(0, 0, 0, 0.08);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(220, 38, 38, 0.12), 0 8px 18px rgba(0, 0, 0, 0.1);
  }
}

.badge-stage {
  position: relative;
  width: min(100%, 520px);
  aspect-ratio: 1 / 1;
  height: auto;
}

.badge-stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.preview-main-group {
  display: grid;
  gap: 0.7rem;
  width: 100%;
  justify-items: center;
}

.preview-dock {
  width: 100%;
}

.preview-viewer-block {
  display: grid;
  gap: 0.7rem;
  justify-items: center;
  width: 100%;
}

.center-design-save-panel {
  width: min(100%, 620px);
  display: grid;
  padding: 0.25rem 0;
}

.center-design-save-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  width: min(84%, 520px);
  margin: 0 auto;
}

.center-design-save-btn,
.center-feature-finder-btn {
  width: 100%;
  min-height: 34px;
  padding: 0.18rem 0.55rem;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.02;
  border-radius: 0;
}

.center-feature-finder-btn.instruction-toggle {
  padding-top: 0.18rem;
  padding-bottom: 0.18rem;
  font-size: 0.74rem;
}

.center-design-save-btn {
  font-size: 0.74rem;
  font-weight: 800;
}


.right-preview-dock {
  margin-bottom: 0.65rem;
}

.right-preview-dock .preview-viewer-block {
  border: 1px solid var(--app-line-strong);
  border-radius: 14px;
  padding: 0.8rem;
  background: var(--panel-tint-strong);
}

.instruction-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
  width: min(84%, 620px);
  margin: 0 auto;
}

.instruction-actions-trimmed {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.instruction-actions-trimmed .instruction-toggle {
  min-height: 40px;
  padding-top: 0.34rem;
  padding-bottom: 0.34rem;
  line-height: 1.06;
  font-size: 0.74rem;
}

.instruction-site-link-wrap {
  margin: 0.7rem auto 0;
  text-align: center;
}

.instruction-site-link {
  color: #666;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.instruction-site-link:hover,
.instruction-site-link:focus-visible {
  text-decoration: underline;
}

.instruction-toggle {
  margin-top: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 54px;
  padding: 0.58rem 0.72rem;
  line-height: 1.15;
  font-size: 0.85rem;
  font-weight: 800;
}

.troubleshooting-link {
  text-decoration: none;
  color: #ffffff;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: keep-all;
  font-size: 0.74rem;
}

.instruction-toggle.is-active {
  background: #1e3a8a;
}

#openInstructionsBtn.is-active,
#showDemoBtn.is-active {
  background: #1e3a8a;
  border-color: #1e3a8a;
  color: #fff;
}

.instruction-drawer {
  width: min(100%, 720px);
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow: hidden;
}


.instruction-body {
  display: grid;
  gap: 0.45rem;
  min-height: 0;
  flex: 1 1 auto;
  max-height: none;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.instruction-list {
  margin: 0;
  padding-left: 1.2rem;
  display: grid;
  gap: 0.42rem;
  color: var(--app-ink-soft);
}

.instruction-note {
  margin: 0;
  font-size: 0.84rem;
  font-weight: 700;
  color: #666;
}


.demo-path-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  width: 100%;
}

.demo-path-btn {
  margin-top: 0;
  min-height: 46px;
}

.demo-path-btn.is-active {
  background: #1e3a8a;
}

.demo-path-content {
  display: grid;
  gap: 0.45rem;
}

.demo-inline-link {
  display: inline;
  width: auto;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: #111;
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

.shortcut-drawer-list .demo-inline-link {
  display: inline;
  width: auto;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none !important;
  box-shadow: none !important;
  text-shadow: none !important;
  color: #111;
  font-size: clamp(0.76rem, 1.08vw, 0.96rem);
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
  text-decoration: underline;
}

.demo-inline-link:hover,
.demo-inline-link:focus-visible,
.shortcut-drawer-list .demo-inline-link:hover,
.shortcut-drawer-list .demo-inline-link:focus-visible {
  color: #111;
}

.shortcut-drawer-list [data-shortcut="delete-fonts"],
.shortcut-drawer-list [data-shortcut="reset"],
[data-shortcut="delete-fonts"],
[data-shortcut="reset"] {
  color: #111;
}

.shortcut-drawer-list [data-shortcut="delete-fonts"]:hover,
.shortcut-drawer-list [data-shortcut="delete-fonts"]:focus-visible,
.shortcut-drawer-list [data-shortcut="reset"]:hover,
.shortcut-drawer-list [data-shortcut="reset"]:focus-visible,
[data-shortcut="delete-fonts"]:hover,
[data-shortcut="delete-fonts"]:focus-visible,
[data-shortcut="reset"]:hover,
[data-shortcut="reset"]:focus-visible {
  color: #111;
}


.feature-finder-panel {
  gap: 0.9rem;
}

.feature-finder-filter-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  width: min(100%, 560px);
  margin: 0.05rem auto 0;
  padding: 0.26rem;
  border: 1px solid #e5e5e5;
  border-radius: 18px;
  background: #f9f9f9;
  box-shadow: none;
}

.feature-finder-filter-btn {
  margin-top: 0;
  min-height: 40px;
  padding: 0.45rem 0.7rem;
  font-size: 0.8rem;
  line-height: 1.15;
  border-radius: 14px;
}

body[data-studio-mode="pro"] .feature-finder-filter-btn,
body.studio-mode-pro .feature-finder-filter-btn {
  background: transparent;
  border: 1px solid transparent;
  box-shadow: none;
  color: #666;
  text-shadow: none;
}

body[data-studio-mode="pro"] .feature-finder-filter-btn:hover,
body[data-studio-mode="pro"] .feature-finder-filter-btn:focus-visible,
body.studio-mode-pro .feature-finder-filter-btn:hover,
body.studio-mode-pro .feature-finder-filter-btn:focus-visible {
  transform: none;
  filter: none;
  box-shadow: none;
  background: rgba(0, 0, 0, 0.04);
  color: #111;
}

body[data-studio-mode="pro"] .feature-finder-filter-btn.is-active,
body.studio-mode-pro .feature-finder-filter-btn.is-active,
.feature-finder-filter-btn.is-active {
  background: #1e3a8a;
  border-color: #1e3a8a;
  color: #fff;
  box-shadow: none;
  text-shadow: none;
}

.feature-finder-support-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.34rem;
  margin-top: 0.34rem;
}

.feature-finder-support-links .demo-inline-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  width: 100%;
  padding: 0.34rem 0.38rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff !important;
  box-shadow: none !important;
  color: #111;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.1;
  text-decoration: none;
}

.feature-finder-support-links .demo-inline-link:hover,
.feature-finder-support-links .demo-inline-link:focus-visible {
  background: #f5f5f5 !important;
  color: #111;
  border-color: #1e3a8a;
}

.feature-finder-shortcuts {
  width: min(100%, 560px);
  margin: 0 auto;
  padding: 0.75rem 0.8rem;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  background: #f9f9f9;
  box-shadow: none;
  gap: 0.5rem;
  justify-items: stretch;
}

.shortcut-drawer-list.feature-finder-shortcuts .demo-inline-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 30px;
  padding: 0.12rem 0.72rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff !important;
  box-shadow: none !important;
  color: #111;
  font-size: clamp(0.78rem, 1.04vw, 0.94rem);
  font-weight: 600;
  line-height: 1.1;
  text-decoration: none;
}

.shortcut-drawer-list.feature-finder-shortcuts .demo-inline-link:hover,
.shortcut-drawer-list.feature-finder-shortcuts .demo-inline-link:focus-visible {
  background: #f5f5f5 !important;
  color: #111;
  border-color: #1e3a8a;
}

.shortcut-drawer-list.feature-finder-shortcuts [data-shortcut="delete-fonts"],
.shortcut-drawer-list.feature-finder-shortcuts [data-shortcut="reset"] {
  color: #111;
  border-color: #ddd;
  background: rgba(255, 255, 255, 0.94) !important;
}

.shortcut-drawer-list.feature-finder-shortcuts [data-shortcut="delete-fonts"]:hover,
.shortcut-drawer-list.feature-finder-shortcuts [data-shortcut="delete-fonts"]:focus-visible,
.shortcut-drawer-list.feature-finder-shortcuts [data-shortcut="reset"]:hover,
.shortcut-drawer-list.feature-finder-shortcuts [data-shortcut="reset"]:focus-visible {
  color: #111;
  background: #f9f9f9 !important;
  border-color: #ddd;
}

.feature-finder-close-btn {
  display: block;
  width: min(100%, 560px);
  margin: -0.1rem auto 0;
  min-height: 42px;
  padding: 0.5rem 0.8rem;
  border-radius: 14px;
}

body[data-studio-mode="pro"] .feature-finder-close-btn,
body.studio-mode-pro .feature-finder-close-btn,
.feature-finder-close-btn {
  background: #1e3a8a !important;
  border: 1px solid #1e3a8a;
  color: #fff;
  box-shadow: none;
  text-shadow: none;
}

body[data-studio-mode="pro"] .feature-finder-close-btn:hover,
body[data-studio-mode="pro"] .feature-finder-close-btn:focus-visible,
body.studio-mode-pro .feature-finder-close-btn:hover,
body.studio-mode-pro .feature-finder-close-btn:focus-visible,
.feature-finder-close-btn:hover,
.feature-finder-close-btn:focus-visible {
  background: #333 !important;
  border-color: #333;
  color: #fff;
  box-shadow: none;
}

#openResetSettingsShortcutBtn {
  color: #111;
}

#openResetSettingsShortcutBtn:hover,
#openResetSettingsShortcutBtn:focus-visible {
  color: #111;
}


#displayMaskCanvas {
  pointer-events: none;
}

canvas {
  touch-action: none;
}

@media (max-width: 1200px) {
  .app {
    grid-template-columns: 1fr;
    height: auto;
  }

  body.design-layout-canvas .app {
    grid-template-columns: 1fr;
  }

  .panel {
    max-height: none;
    overflow-y: visible;
  }

  .preview {
    padding: 1rem;
    position: static;
    order: -1;
  }

  .right-preview-dock {
    margin-bottom: 0;
  }
}

#textColor {
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #ffffff;
  padding: 2px;
}

.extra-text-card input[type="color"]:not(.palette-picker) {
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #ffffff;
  padding: 2px;
}

[hidden] {
  display: none !important;
}

#advancedToggleBtn,
#advancedPanel {
  display: none !important;
}


.used-colors-panel {
  display: grid;
  gap: 0.45rem;
  border: 1px solid var(--app-line-strong);
  border-radius: 10px;
  padding: 0.7rem;
  background: var(--panel-tint);
}

.studio-color-panel {
  display: grid;
  gap: 0.45rem;
  border: 1px solid var(--app-line-strong);
  border-radius: 10px;
  padding: 0.7rem;
  background: var(--panel-tint-strong);
}

#bgGradientInlineSlot {
  display: grid;
  margin-top: 0.65rem;
}

.bg-gradient-inline-panel {
  margin-top: 0.1rem;
}

.bg-gradient-inline-panel h2 {
  font-size: 1.08rem;
}

.advanced-feature-actions {
  display: grid;
  gap: 0.2rem;
}

.advanced-feature-actions .secondary-btn {
  width: 100%;
  margin-top: 0;
  padding: 0.3rem 0.1rem;
  border: 0;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none !important;
  text-shadow: none !important;
  color: #111;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  transform: none !important;
  text-align: left;
  justify-content: flex-start;
}

.advanced-feature-actions .secondary-btn:hover,
.advanced-feature-actions .secondary-btn:focus-visible {
  background: rgba(0, 0, 0, 0.06) !important;
  box-shadow: none !important;
  filter: none;
  transform: none !important;
}

.advanced-feature-actions .secondary-btn:focus-visible {
  outline: 2px solid rgba(0, 0, 0, 0.2);
  outline-offset: 2px;
}

.design-setup-action-row {
  margin-top: 0.15rem;
}

.design-setup-action-row .secondary-btn {
  width: 100%;
}

.secondary-btn.design-setup-btn {
  width: 100%;
}

.secondary-btn.design-setup-delete-btn {
  border-color: #1e3a8a;
  color: #fff;
  background: #1e3a8a;
}

.secondary-btn.design-setup-delete-btn:hover,
.secondary-btn.design-setup-delete-btn:focus-visible {
  color: #fff;
  background: #333;
}

.design-setup-status {
  min-height: 1.2rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: #666;
}

.design-setup-status[data-tone="success"] {
  color: #14532d;
}

.design-setup-status[data-tone="warning"] {
  color: #b45309;
}

.design-setup-status[data-tone="error"] {
  color: #b91c1c;
}

#guideAdjustPanel {
  margin-top: 0.2rem;
}

.bg-gradient-two-col-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.55rem;
  align-items: start;
}

.bg-gradient-two-col-row .bg-gradient-direction-row {
  margin: 0;
}

@media (max-width: 720px) {
  .bg-gradient-two-col-row {
    grid-template-columns: 1fr;
  }

  .instruction-actions {
    grid-template-columns: 1fr;
  }

  .demo-path-actions {
    grid-template-columns: 1fr;
  }
}

#advancedFeaturePanel.gradient-only-view {
  padding-top: 0.2rem;
  gap: 0.35rem;
}

#advancedFeaturePanel.gradient-only-view #bgGradientControlsPanel {
  margin-top: 0;
}

#advancedFeaturePanel.gradient-only-view #bgGradientControlsPanel h2 {
  margin-top: 0;
}

.controls-left.gradient-only-mode > :not(#leftControlsCycleBtn):not(#advancedFeaturePanel):not(#ehRingTextPanel) {
  display: none !important;
}

.controls-left.compact-launcher-mode #advancedFeaturePanel,
.controls-left.compact-launcher-mode #addHexColorsPanel,
.controls-left.compact-launcher-mode #bgGradientControlsPanel {
  display: none !important;
}

.add-hex-saved-colors-label {
  display: flex;
  align-items: center;
  gap: 0.28rem;
  flex-wrap: wrap;
  margin-top: 0.55rem;
  margin-bottom: 0.12rem;
  color: var(--download-btn-blue-dark);
}

.add-hex-saved-colors-delete-hint {
  margin-top: 0;
  margin-bottom: 0.45rem;
  font-size: 0.78rem;
  color: var(--app-text-muted);
}

.add-hex-saved-colors-container {
  margin-top: 0.45rem;
  padding: 0.45rem 0.55rem 0.55rem;
  border: 1px solid var(--app-line-strong);
  border-radius: 10px;
  background: var(--panel-tint);
}

.studio-color-row {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr) 84px;
  gap: 0.45rem;
  align-items: center;
}

#studioColorPicker {
  width: 100%;
  height: 2.2rem;
  border: 1px solid var(--app-line-strong);
  border-radius: 6px;
  background: #ffffff;
  padding: 2px;
}

#studioColorHex {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  text-transform: uppercase;
}

#studioEyedropperHint {
  margin-top: -0.1rem;
}

.used-colors-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.32rem;
}

.used-color-swatch {
  min-height: 1.7rem;
  width: auto;
  min-width: 0;
  border: 1px solid var(--app-line-strong);
  border-radius: 999px;
  cursor: pointer;
  padding: 0.24rem 0.58rem;
  background: #fff;
  color: var(--app-ink-strong);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.used-color-swatch:focus-visible {
  outline: 2px solid var(--download-btn-blue);
  outline-offset: 1px;
}


.color-picker-group {
  display: grid;
  gap: 0.28rem;
}

.color-hex-input {
  padding: 0.38rem 0.45rem;
  border-radius: 6px;
  border: 1px solid #ddd;
  background: #ffffff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.78rem;
}

.bg-swatch-row .color-picker-group {
  min-width: 112px;
}


.pdf-preview-panel {
  display: grid;
  gap: 0.45rem;
  border: 1px solid var(--app-line-strong);
  border-radius: 10px;
  padding: 0.7rem;
  background: var(--panel-tint);
}

.preview .pdf-preview-panel {
  width: 100%;
  max-width: 520px;
}

#pdfPreviewCanvas {
  width: 100%;
  height: auto;
  max-height: 560px;
  border: 1px solid var(--app-line-strong);
  border-radius: 8px;
  background: #ffffff;
}

#sheetMockupCanvas {
  width: min(100%, 340px);
  height: auto;
  border: 1px solid var(--app-line-strong);
  border-radius: 8px;
  background: #f9f9f9;
  display: block;
  margin: 0 auto;
}

.controls-right .pdf-preview-panel {
  gap: 0.35rem;
  padding: 0.55rem;
}

.h2-note {
  font-weight: 400;
  font-size: 0.82em;
}

.label-note {
  font-weight: 400;
  font-size: 0.82em;
}

#topOutlineAmountReadout,
#centerOutlineAmountReadout,
#bottomOutlineAmountReadout {
  margin: 0.3rem 0 0.55rem;
  color: #666;
  font-weight: 700;
}

.extra-text-card .outline-keep > .outline-palette {
  margin-bottom: 0.45rem;
}

.extra-outline-amount-group {
  display: grid;
  gap: 0.5rem;
  margin: 0.45rem 0 1rem;
}

.extra-outline-amount-group input[type="range"] {
  margin: 0;
}

.extra-outline-amount-group .range-scale,
.extra-outline-amount-group .range-scale-current {
  display: none !important;
}

#topOutlineAmount + .range-scale,
#centerOutlineAmount + .range-scale,
#bottomOutlineAmount + .range-scale,
#topOutlineAmount + .range-scale .range-scale-current,
#centerOutlineAmount + .range-scale .range-scale-current,
#bottomOutlineAmount + .range-scale .range-scale-current {
  display: none !important;
}

.extra-outline-amount-readout {
  color: #666;
  font-weight: 700;
}

.inline-slider-readout {
  color: #666;
  font-weight: 700;
  font-size: 0.72em;
}

.hide-inline-slider-readouts .inline-slider-readout {
  display: none;
}

.background-toggle {
  margin-top: 0;
  background: #ffffff;
  color: var(--download-btn-blue);
  border: 1px solid var(--download-btn-blue);
  border-radius: 8px;
  padding: 0.58rem 0.72rem;
  text-align: left;
  font-weight: 700;
}

.background-toggle:hover {
  filter: none;
  background: #f9f9f9;
}

.background-panel-body {
  display: grid;
  gap: 0.45rem;
}

.bg-gradient-direction-row {
  display: grid;
  gap: 0.3rem;
}

.background-panel.is-open {
  border-color: #ddd;
}

.photo-toggle-btn {
  margin-top: 0.15rem;
  background: #1e3a8a;
  color: #fff;
  border: 1px solid #1e3a8a;
}

.photo-toggle-btn[aria-pressed="true"] {
  background: #1e3a8a;
}

.photo-toggle-btn.hide-photo-btn {
  background: #1e3a8a;
  border: 1px solid #1e3a8a;
}

.photo-toggle-btn.hide-photo-btn:hover {
  background: #333;
}

.photo-import-intro-text {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.35;
  color: var(--app-ink-soft);
}

.advanced-toggle-btn {
  margin-top: 0.15rem;
  background: #1e3a8a;
  color: #fff;
  border: 1px solid #1e3a8a;
}

.advanced-toggle-btn[aria-pressed="true"] {
  background: #1e3a8a;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.eh-ring-panel {
  margin-top: 0.15rem;
  padding-top: 0.2rem;
  border-top: 1px solid #ddd;
}

.eh-ring-controls {
  display: grid;
  gap: 0.36rem;
}

.eh-ring-toggle {
  color: var(--download-btn-blue);
  font-weight: 800;
}

#ehRingEnabled,
#ehRingEnabledMirror {
  accent-color: #1e3a8a;
}

.toggle-row .outline-toggle {
  margin: 0;
}
.text-style-toggle-row {
  margin-top: 0.32rem;
  margin-bottom: 0.32rem;
}
.tagline-visibility-row {
  justify-content: flex-start;
  gap: 1.1rem;
  flex-wrap: wrap;
  margin-top: -0.1rem;
}

.tagline-outline-row {
  display: grid;
  gap: 0.28rem;
  margin-top: 0.18rem;
}

#tagLinePanel.editor-panel {
  gap: 0.26rem;
  padding-top: 0.42rem;
  padding-bottom: 0.45rem;
}

#tagLinePanel .inline-help-row {
  margin-bottom: -0.05rem;
}

#tagLinePanel > input[type="text"] {
  margin-top: 0;
}

#tagLinePanel .tagline-visibility-row {
  margin-top: -0.05rem;
}

#tagLinePanel > .outline-palette {
  margin-top: 0.18rem;
}

.toggle-row.toggle-row-triple {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
}

.toggle-row.toggle-row-triple .outline-toggle:nth-child(1) {
  justify-self: start;
}

.toggle-row.toggle-row-triple .outline-toggle:nth-child(2) {
  justify-self: center;
}

.toggle-row.toggle-row-triple .outline-toggle:nth-child(3) {
  justify-self: end;
}

.field-controls .toggle-row.toggle-row-triple {
  margin-top: 0.55rem;
  margin-bottom: 0.9rem;
}

#topOutlineColorWrap,
#centerOutlineColorWrap,
#bottomOutlineColorWrap {
  margin-top: 0.18rem;
  padding-top: 0.18rem;
  border-top: 1px solid #e5e5e5;
}

#topOutlineColorWrap .outline-palette,
#centerOutlineColorWrap .outline-palette,
#bottomOutlineColorWrap .outline-palette {
  margin-top: 0.4rem;
  margin-bottom: 0.55rem;
}

label[for="topOutlineAmount"],
label[for="centerOutlineAmount"],
label[for="bottomOutlineAmount"] {
  display: block;
  margin-top: 0.45rem;
  margin-bottom: 0.35rem;
}

#topOutlineAmount,
#centerOutlineAmount,
#bottomOutlineAmount {
  margin-top: 0.15rem;
  margin-bottom: 1rem;
}

.download-choice-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

#designStartPanel .download-choice-row {
  margin-top: 0.75rem;
}

.design-start-saved-setup {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.8rem;
  padding-top: 0.8rem;
  border-top: 1px dashed #ddd;
}

.design-start-saved-setup-title {
  margin: 0;
}

#designStartPanel h2 {
  margin-bottom: 0.35rem;
}

.saved-colors-panel {
  display: grid;
  gap: 0.45rem;
  border: 1px solid var(--app-line-strong);
  border-radius: 10px;
  padding: 0.65rem;
  background: var(--panel-tint);
}

.custom-palette-add-row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(56px, 0.45fr) minmax(84px, 0.6fr);
  gap: 0.45rem;
  align-items: center;
}

#customPaletteHex {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  text-transform: uppercase;
}

.quick-custom-add-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.45rem;
  margin-top: 0.5rem;
  align-items: center;
}

.quick-custom-picker-row {
  display: grid;
  justify-items: start;
  gap: 0.2rem;
  margin-top: 0.35rem;
  margin-bottom: 0.9rem;
}

.quick-custom-palette-hex-input {
  transition: background 140ms ease, box-shadow 140ms ease, color 140ms ease;
}

.quick-custom-palette-hex-input.is-rainbow-idle {
  background: linear-gradient(90deg, #ff4d4d 0%, #ff9f1c 18%, #ffe66d 34%, #4cd964 50%, #45b7ff 68%, #7b61ff 84%, #ff4fd8 100%);
  color: transparent;
  caret-color: transparent;
  text-shadow: none;
}

.quick-custom-palette-hex-input.is-rainbow-idle::placeholder {
  color: transparent;
}

.quick-custom-palette-hex-input.is-color-preview {
  color: transparent;
  caret-color: transparent;
  text-shadow: none;
}

.quick-custom-palette-hex-input.is-color-preview::placeholder {
  color: transparent;
}

.quick-custom-palette-hex-input.is-manual-entry {
  background: #ffffff;
  color: var(--download-btn-blue-dark);
  caret-color: var(--download-btn-blue-dark);
}

.quick-custom-palette-hex-input.is-blank-idle {
  background: #ffffff;
  color: transparent;
  caret-color: transparent;
  text-shadow: none;
}

.quick-custom-palette-hex-input.is-blank-idle::placeholder {
  color: transparent;
}


.quick-custom-picker-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--download-btn-blue-dark);
}

.quick-custom-picker-hint {
  margin: 0 0 0.2rem;
  font-size: 0.78rem;
  color: var(--app-text-muted);
}

.quick-custom-palette-picker-wrap {
  width: 120px;
  height: 32px;
  border-radius: 14px;
  border: 2px solid #ddd;
  background: linear-gradient(90deg, #ff4d4d 0%, #ff9f1c 18%, #ffe66d 34%, #4cd964 50%, #45b7ff 68%, #7b61ff 84%, #ff4fd8 100%);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.92) inset;
  overflow: hidden;
}

#quickCustomPaletteColor {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 12px;
  background: transparent;
  padding: 0;
  opacity: 0;
  cursor: pointer;
}

#quickCustomPaletteColor::-webkit-color-swatch-wrapper {
  padding: 0;
}

#quickCustomPaletteColor::-webkit-color-swatch {
  border: 0;
  border-radius: 12px;
  background: transparent;
}

#quickCustomPaletteColor::-moz-color-swatch {
  border: 0;
  border-radius: 12px;
  background: transparent;
}

.quick-custom-palette-picker-wrap .palette-picker-hint {
  left: 12px;
  right: 12px;
  height: 4px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.5);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.28);
}

#quickCustomPaletteHex {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  text-transform: uppercase;
}

.persistent-custom-label {
  display: flex;
  align-items: center;
  gap: 0.28rem;
  flex-basis: 100%;
  width: 100%;
  margin: 0.04rem 0 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #666;
}

.persistent-custom-row {
  flex-basis: 100%;
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 0.26rem;
  margin-top: 0.06rem;
}

.persistent-custom-swatch {
  border-color: #1e3a8a;
}

.custom-palette-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.36rem;
}

.custom-palette-item {
  display: flex;
  align-items: center;
  gap: 0.28rem;
}

.custom-palette-swatch {
  min-height: 1.7rem;
}

.custom-palette-hex-btn,
.used-color-hex-btn {
  background: #fff;
  min-height: 1.7rem;
  padding: 0.24rem 0.58rem;
  font-size: 0.72rem;
}

.custom-palette-remove {
  width: auto;
  margin-top: 0;
  border: 1px solid #ddd;
  background: #ffffff;
  color: var(--download-btn-blue-dark);
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.22rem 0.5rem;
}


.non-printing-note {
  margin: 0.18rem 0 0;
  font-size: 0.72rem;
  font-weight: 500;
  color: #666;
  text-align: center;
}

.preview-text-controls-note {
  margin: 0.15rem auto 0;
  width: min(94%, 720px);
  padding: 0.38rem 0.65rem;
  border: 1px solid var(--app-line-strong);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.68);
  font-size: 0.78rem;
  font-weight: 600;
  color: #666;
  text-align: center;
  line-height: 1.22;
}

.main-preview-note {
  position: relative;
  top: auto;
  left: auto;
  transform: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  width: min(94%, 720px);
  margin: 0.15rem auto 0;
  white-space: normal;
  text-align: center;
  line-height: 1.3;
  font-size: 0.9rem;
}

.main-preview-note .safe-zone-print-note {
  display: inline-block;
  width: auto;
  text-align: inherit;
}

.main-preview-note .preview-safe-zone-tip {
  margin-top: 0;
  position: static;
  flex: 0 0 auto;
}

.main-preview-note .preview-safe-zone-tip::after {
  left: 50%;
  transform: translateX(-50%);
  top: calc(100% + 8px);
  min-width: 0;
  width: calc(100% - 16px);
  max-width: calc(100% - 16px);
  max-height: 520px;
  min-height: 140px;
  overflow-y: auto;
  box-sizing: border-box;
  white-space: pre-line;
  background: #ffffff;
  border: 1px solid #ddd;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.15);
}

body.design-layout-canvas .controls-left {
  display: none;
}

body.design-layout-canvas .app {
  grid-template-columns: minmax(320px, 560px) minmax(320px, 560px);
}

body.design-layout-canvas #addExtraTextBtn,
body.design-layout-canvas #fontToggleBtn,
body.design-layout-canvas #fontToggleTip,
body.design-layout-canvas #fontPanel,
body.design-layout-canvas #advancedToggleBtn,
body.design-layout-canvas #advancedPanel,
body.design-layout-canvas #tagLineToggleBtn {
  display: none !important;
}

.inline-help-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.font-action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
}

.font-action-row button {
  margin-top: 0;
}

.danger-btn {
  background: #1e3a8a;
}

.theme-dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.38);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  z-index: 3000;
}

.theme-dialog-card {
  width: min(560px, 100%);
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 22px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  padding: 1.4rem 1.4rem 1.1rem;
}

.theme-dialog-card h2 {
  margin: 0 0 0.65rem;
  color: var(--download-btn-blue);
}

.theme-dialog-card p {
  margin: 0 0 1rem;
  color: #666;
}

.studio-mode-dialog-card {
  width: min(680px, 100%);
}

.studio-mode-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.studio-mode-option {
  display: grid;
  gap: 0.32rem;
  padding: 1rem;
  border-radius: 16px;
  border: 1px solid var(--app-line-strong);
  background: #fff;
  text-align: left;
  color: #111;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.studio-mode-option:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.studio-mode-option.is-current {
  border-color: #1e3a8a;
  box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.1), 0 14px 30px rgba(0, 0, 0, 0.1);
}

.studio-mode-option-label {
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--download-btn-blue);
}

.studio-mode-option-copy {
  color: #666;
  line-height: 1.45;
}

.studio-mode-current {
  margin-bottom: 0;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--app-ink-soft);
}

body.studio-mode-essentials #advancedFeatureToggleBtn,
body.studio-mode-essentials #fontToggleBtn,
body.studio-mode-essentials #tagLineToggleBtn {
  display: none !important;
}

body.studio-mode-essentials #advancedPanel,
body.studio-mode-essentials #fontPanel,
body.studio-mode-essentials #tagLinePanel {
  display: none !important;
}

body.studio-mode-essentials #demoContent [data-shortcut="advanced"],
body.studio-mode-essentials #demoContent [data-shortcut="add-hex"],
body.studio-mode-essentials #demoContent [data-shortcut="gradient"],
body.studio-mode-essentials #demoContent [data-shortcut="delete-fonts"],
body.studio-mode-essentials #demoContent [data-shortcut="tagline"] {
  display: none !important;
}

.advanced-photo-adjust-controls {
  display: grid;
  gap: inherit;
}

body.studio-mode-essentials #advancedPhotoAdjustControls {
  display: none !important;
}

#pdfSetupDialogSelect {
  margin-bottom: 1rem;
}

@media (max-width: 700px) {
  .studio-mode-options {
    grid-template-columns: 1fr;
  }
}

.font-delete-panel {
  display: grid;
  gap: 0.5rem;
  border: 1px solid var(--app-line-strong);
  border-radius: 10px;
  padding: 0.55rem;
  background: rgba(255, 255, 255, 0.7);
}

.font-delete-list {
  display: grid;
  gap: 0.35rem;
  max-height: 180px;
  overflow-y: auto;
}

.font-delete-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--download-btn-blue);
}

.font-delete-item input[type="checkbox"] {
  width: auto;
  margin: 0;
}

.left-panel-bottom-actions {
  display: grid;
  gap: 0.55rem;
  order: 999;
}

.left-panel-bottom-actions-panel {
  margin-top: -0.25rem;
}

.inline-help-row #fontToggleBtn {
  flex: 1;
  margin-top: 0;
}

.inline-help-row .help-tip::after {
  left: auto;
  right: 0;
  top: auto;
  bottom: calc(100% + 8px);
  min-width: 220px;
  max-width: min(320px, calc(100vw - 32px));
}

.help-heading {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.help-tip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  border-radius: 999px;
  border: 1px solid var(--download-btn-blue);
  background: #ffffff;
  color: var(--download-btn-blue);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
  cursor: help;
}

.help-tip-link {
  cursor: pointer;
  text-decoration: none;
}

.help-tip-link.no-tooltip::after {
  display: none !important;
}

.tagline-help-inline {
  color: var(--download-btn-blue-dark);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.2;
}

#downloadTaglinePromptPanel .help-tip::after {
  background: #ffffff;
  left: auto !important;
  right: 0 !important;
  top: calc(100% + 8px) !important;
  bottom: auto !important;
  transform: none !important;
  min-width: 260px;
  max-width: min(340px, calc(100vw - 56px));
}

#downloadTaglinePromptPanel .help-heading {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: baseline;
  gap: 0.12rem;
}

#downloadTaglinePromptPanel .help-tip {
  border-color: var(--download-btn-blue-dark);
  color: var(--download-btn-blue-dark);
}

#tagLinePanel .help-tip {
  border-color: var(--download-btn-blue-dark);
  color: var(--download-btn-blue-dark);
}

.hex-colors-help-tip {
  border-color: var(--download-btn-blue-dark);
  color: var(--download-btn-blue-dark);
  margin-left: 0.2rem;
}

.hex-colors-help-tip.no-tooltip::after {
  display: none !important;
}

.help-tip::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  transform: none;
  min-width: 280px;
  max-width: 360px;
  max-height: 320px;
  overflow-y: auto;
  padding: 0.42rem 0.5rem;
  border-radius: 8px;
  background: #ffffff;
  color: var(--app-ink-soft);
  font-size: 0.74rem;
  font-weight: 500;
  line-height: 1.3;
  text-align: left;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease;
  z-index: 20;
}

.help-tip:hover::after,
.help-tip:focus-visible::after {
  opacity: 1;
}

.controls-right label[for="pdfSetup"] {
  display: inline-block;
  padding: 0.45rem 0.7rem;
  border-radius: 8px;
  background: #1e3a8a;
  color: #fff;
  border: 1px solid #1e3a8a;
  box-shadow: none;
  text-shadow: none;
}

#selectedTextColorControl .outline-palette,
#topOutlineColorWrap .outline-palette,
#centerOutlineColorWrap .outline-palette,
#bottomOutlineColorWrap .outline-palette,
.extra-text-card .outline-keep > .outline-palette {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 0.35rem;
}

#selectedTextColorControl .palette-picker-wrap,
#topOutlineColorWrap .palette-picker-wrap,
#centerOutlineColorWrap .palette-picker-wrap,
#bottomOutlineColorWrap .palette-picker-wrap,
.extra-text-card .outline-keep > .outline-palette .palette-picker-wrap {
  width: 58px;
  min-width: 58px;
  height: 24px;
  border: 2px solid #ddd;
  border-radius: 6px;
  background: linear-gradient(90deg, #ff4d4d 0%, #ff9f1c 18%, #ffe66d 34%, #4cd964 50%, #45b7ff 68%, #7b61ff 84%, #ff4fd8 100%);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.92) inset;
  justify-content: stretch;
}

#selectedTextColorControl .palette-picker-wrap .palette-picker,
#topOutlineColorWrap .palette-picker-wrap .palette-picker,
#centerOutlineColorWrap .palette-picker-wrap .palette-picker,
#bottomOutlineColorWrap .palette-picker-wrap .palette-picker,
.extra-text-card .outline-keep > .outline-palette .palette-picker-wrap .palette-picker {
  width: 100%;
  height: 100%;
  min-width: 100%;
  border: 0;
  border-radius: 4px;
  background: transparent;
}

#selectedTextColorControl .palette-picker-hint,
#topOutlineColorWrap .palette-picker-hint,
#centerOutlineColorWrap .palette-picker-hint,
#bottomOutlineColorWrap .palette-picker-hint,
.extra-text-card .outline-keep > .outline-palette .palette-picker-hint {
  left: 6px;
  right: 6px;
  height: 3px;
  border-radius: 999px;
  background: #666;
}

#selectedTextColorControl .inline-used-colors-divider,
#topOutlineColorWrap .inline-used-colors-divider,
#centerOutlineColorWrap .inline-used-colors-divider,
#bottomOutlineColorWrap .inline-used-colors-divider,
.extra-text-card .outline-keep > .outline-palette .inline-used-colors-divider {
  height: 18px;
  margin: 0;
}

#selectedTextColorControl .persistent-custom-label,
#topOutlineColorWrap .persistent-custom-label,
#centerOutlineColorWrap .persistent-custom-label,
#bottomOutlineColorWrap .persistent-custom-label,
.extra-text-card .outline-keep > .outline-palette .persistent-custom-label,
#selectedTextColorControl .persistent-custom-row,
#topOutlineColorWrap .persistent-custom-row,
#centerOutlineColorWrap .persistent-custom-row,
#bottomOutlineColorWrap .persistent-custom-row,
.extra-text-card .outline-keep > .outline-palette .persistent-custom-row {
  grid-column: 1 / -1;
}

#selectedTextColorControl .persistent-custom-label,
#topOutlineColorWrap .persistent-custom-label,
#centerOutlineColorWrap .persistent-custom-label,
#bottomOutlineColorWrap .persistent-custom-label,
.extra-text-card .outline-keep > .outline-palette .persistent-custom-label {
  margin-top: 0.02rem;
}

#selectedTextColorControl .persistent-custom-row,
#topOutlineColorWrap .persistent-custom-row,
#centerOutlineColorWrap .persistent-custom-row,
#bottomOutlineColorWrap .persistent-custom-row,
.extra-text-card .outline-keep > .outline-palette .persistent-custom-row {
  margin-top: 0.04rem;
  padding-top: 0;
}

#selectedTextColorControl .inline-used-colors,
#topOutlineColorWrap .inline-used-colors,
#centerOutlineColorWrap .inline-used-colors,
#bottomOutlineColorWrap .inline-used-colors,
.extra-text-card .outline-keep > .outline-palette .inline-used-colors {
  gap: 0.25rem;
}

#selectedTextColorControl .inline-used-color-swatch,
#topOutlineColorWrap .inline-used-color-swatch,
#centerOutlineColorWrap .inline-used-color-swatch,
#bottomOutlineColorWrap .inline-used-color-swatch,
.extra-text-card .outline-keep > .outline-palette .inline-used-color-swatch {
  width: 16px;
  height: 16px;
  min-width: 16px;
  border-radius: 4px;
}

@media (max-width: 640px) {
  #selectedTextColorControl .outline-palette,
  #topOutlineColorWrap .outline-palette,
  #centerOutlineColorWrap .outline-palette,
  #bottomOutlineColorWrap .outline-palette,
  #ehRingColorPalette,
  #ehRingGradientEndColorPalette,
  .extra-text-card .outline-keep > .outline-palette {
    grid-template-columns: 1fr;
  }

  #selectedTextColorControl .palette-picker-wrap,
  #topOutlineColorWrap .palette-picker-wrap,
  #centerOutlineColorWrap .palette-picker-wrap,
  #bottomOutlineColorWrap .palette-picker-wrap,
  #ehRingColorPalette .palette-picker-wrap,
  #ehRingGradientEndColorPalette .palette-picker-wrap,
  .extra-text-card .outline-keep > .outline-palette .palette-picker-wrap {
    width: 100%;
    min-width: 0;
  }

  #selectedTextColorControl .inline-used-colors-divider,
  #topOutlineColorWrap .inline-used-colors-divider,
  #centerOutlineColorWrap .inline-used-colors-divider,
  #bottomOutlineColorWrap .inline-used-colors-divider,
  #ehRingColorPalette .inline-used-colors-divider,
  #ehRingGradientEndColorPalette .inline-used-colors-divider,
  .extra-text-card .outline-keep > .outline-palette .inline-used-colors-divider {
    display: none;
  }
}
