:root {
  --bg: #0f1117;
  --bg-2: #17131b;
  --panel: rgba(28, 31, 38, 0.78);
  --panel-strong: rgba(38, 40, 47, 0.95);
  --line: rgba(232, 209, 142, 0.18);
  --text: #f6efe0;
  --muted: #a9acb6;
  --gold: #d7b45b;
  --ember: #cf5d42;
  --verdant: #5e9f79;
  --arcane: #4f93b8;
  --violet: #8b5fbf;
  --danger: #b94d56;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background:
    radial-gradient(circle at 20% 0%, rgba(215, 180, 91, 0.08), transparent 28%),
    radial-gradient(circle at 86% 18%, rgba(79, 147, 184, 0.08), transparent 24%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(135deg, #0f1117 0%, #191410 42%, #101819 100%);
  background-size:
    46px 46px,
    46px 46px,
    auto;
  overflow-x: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
.mini-upload,
.file-drop {
  border: 1px solid rgba(247, 231, 179, 0.18);
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  cursor: pointer;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

button {
  min-height: 38px;
  padding: 0 14px;
}

button:hover,
.mini-upload:hover,
.file-drop:hover {
  transform: translateY(-1px);
  border-color: rgba(247, 231, 179, 0.44);
  background: rgba(255, 255, 255, 0.11);
}

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

button.primary {
  border-color: rgba(215, 180, 91, 0.9);
  color: #19140b;
  background: linear-gradient(135deg, #f3d68a, #c8923c);
  box-shadow: 0 12px 34px rgba(215, 180, 91, 0.22);
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 8px;
  color: var(--text);
  background: rgba(7, 9, 13, 0.56);
  outline: none;
  padding: 9px 10px;
}

textarea {
  resize: vertical;
  line-height: 1.45;
}

input[type="color"] {
  min-height: 40px;
  padding: 4px;
}

input[type="range"] {
  height: 30px;
  padding: 0;
  accent-color: var(--gold);
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0;
}

h2 {
  margin: 0 0 12px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1rem;
  letter-spacing: 0;
}

.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 72px;
  padding: 10px clamp(16px, 3vw, 34px);
  border-bottom: 1px solid rgba(247, 231, 179, 0.16);
  background:
    linear-gradient(180deg, rgba(24, 20, 18, 0.94), rgba(8, 10, 14, 0.86)),
    rgba(10, 12, 17, 0.88);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 340px;
  max-width: 680px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  border-radius: 50%;
  box-shadow:
    0 0 0 4px rgba(215, 180, 91, 0.045),
    0 12px 30px rgba(0, 0, 0, 0.34);
}

.brand-mark svg {
  display: block;
  width: 52px;
  height: 52px;
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.14rem;
  font-weight: 900;
  letter-spacing: 0;
}

.brand span:not(.brand-mark) {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.25;
}

.tabs,
.segmented {
  display: flex;
  gap: 8px;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.32);
}

.tab-button,
.segmented button {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.tab-button {
  min-height: 40px;
  padding-inline: 18px;
}

.tab-button.active,
.segmented button.active {
  color: #19140b;
  background: linear-gradient(135deg, #e8d18e, #bd8439);
}

main {
  flex: 1;
  padding: clamp(14px, 2vw, 24px);
}

.ad-slot {
  display: grid;
  place-items: center;
  min-height: 72px;
  margin: 0 auto clamp(14px, 2vw, 22px);
  max-width: 1180px;
  border: 1px dashed rgba(215, 180, 91, 0.3);
  border-radius: 8px;
  color: rgba(246, 239, 224, 0.62);
  background:
    linear-gradient(135deg, rgba(215, 180, 91, 0.055), rgba(79, 147, 184, 0.045)),
    rgba(0, 0, 0, 0.18);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ad-slot-bottom {
  margin-top: clamp(14px, 2vw, 22px);
  margin-bottom: 0;
}

.project-session {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  max-width: 1180px;
  margin: 0 auto clamp(14px, 2vw, 22px);
  padding: 14px 16px;
  border: 1px solid rgba(215, 180, 91, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(215, 180, 91, 0.08), rgba(79, 147, 184, 0.07)),
    rgba(9, 12, 18, 0.72);
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.24);
}

.project-session h2 {
  margin: 0 0 4px;
  font-size: 0.92rem;
}

.project-session p {
  margin: 0;
  max-width: 660px;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.45;
}

.project-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.project-import-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(215, 180, 91, 0.24);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
}

.project-import-button:hover {
  border-color: rgba(232, 209, 142, 0.55);
  background: rgba(255, 255, 255, 0.08);
}

.project-import-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.workspace {
  display: none;
  grid-template-columns: minmax(240px, 300px) minmax(340px, 1fr) minmax(250px, 310px);
  gap: clamp(12px, 1.5vw, 20px);
  align-items: start;
}

.workspace.active {
  display: grid;
}

.tool-panel,
.canvas-stage {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.025)),
    var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.tool-panel {
  max-height: calc(100vh - 112px);
  overflow: auto;
  padding: 14px;
}

.panel-section {
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.panel-section:first-child {
  padding-top: 0;
}

.panel-section:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.panel-section > * + * {
  margin-top: 10px;
}

.control-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.control-row > button,
.control-row > .mini-upload {
  flex: 1 1 auto;
}

.control-row.compact {
  justify-content: flex-end;
}

.control-row.compact > button {
  flex: 0 0 auto;
}

.control-row.compact > select {
  flex: 0 0 78px;
  width: auto;
  min-height: 38px;
  padding-inline: 8px;
}

.control-row.utility-row > button,
.control-row.preset-row > button {
  min-height: 34px;
  padding-inline: 10px;
  font-size: 0.78rem;
  font-weight: 800;
}

.two-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.field-hidden {
  display: none;
}

.quick-help ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.preset-gallery {
  display: grid;
  gap: 9px;
}

.preset-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 62px;
  padding: 9px;
  text-align: left;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.035)),
    rgba(0, 0, 0, 0.22);
}

.preset-card.active {
  border-color: rgba(243, 215, 122, 0.78);
  box-shadow:
    inset 0 0 0 1px rgba(243, 215, 122, 0.14),
    0 0 24px rgba(243, 215, 122, 0.16);
}

.preset-preview {
  position: relative;
  display: block;
  width: 44px;
  height: 44px;
  background: var(--preset-gradient);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.18),
    0 8px 22px rgba(0, 0, 0, 0.32);
}

.token-ring-preview {
  border-radius: 50%;
}

.token-ring-preview::before {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.24),
    inset 0 0 0 6px rgba(0, 0, 0, 0.14),
    inset 0 0 14px rgba(255, 255, 255, 0.16);
}

.token-ring-preview::after {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 33%, rgba(255, 255, 255, 0.22), transparent 38%),
    radial-gradient(circle at 50% 72%, rgba(79, 147, 184, 0.18), transparent 48%),
    rgba(4, 6, 10, 0.74);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.2),
    inset 0 0 10px rgba(0, 0, 0, 0.52),
    0 0 9px rgba(0, 0, 0, 0.36);
}

.card-mini-preview {
  overflow: hidden;
  border-radius: 6px;
}

.mini-card-frame,
.mini-card-art,
.mini-card-panel {
  position: absolute;
  border-radius: 4px;
}

.mini-card-frame {
  inset: 3px;
  border: 2px solid rgba(255, 255, 255, 0.28);
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.42);
}

.mini-card-art {
  inset: 8px 8px 20px;
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.mini-card-panel {
  right: 8px;
  bottom: 8px;
  left: 8px;
  height: 8px;
  background: rgba(0, 0, 0, 0.54);
}

.preset-meta {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.preset-meta strong,
.preset-meta small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preset-meta strong {
  color: var(--text);
  font-size: 0.82rem;
  line-height: 1.15;
}

.preset-meta small {
  color: var(--muted);
  font-size: 0.7rem;
}

.preset-action {
  padding: 5px 7px;
  border: 1px solid rgba(243, 215, 122, 0.28);
  border-radius: 6px;
  color: #f3d77a;
  background: rgba(215, 180, 91, 0.08);
  font-size: 0.68rem;
  font-weight: 900;
}

.file-drop,
.mini-upload {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 76px;
  padding: 14px;
  text-align: center;
  color: #f3dfab;
  background:
    linear-gradient(135deg, rgba(215, 180, 91, 0.14), rgba(79, 147, 184, 0.08)),
    rgba(0, 0, 0, 0.2);
}

.file-drop.small {
  min-height: 56px;
}

.file-drop input,
.mini-upload input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.mini-upload {
  min-height: 38px;
  padding: 8px 12px;
  font-size: 0.82rem;
}

.canvas-stage {
  min-width: 0;
  padding: 14px;
}

.card-manager {
  display: grid;
  grid-template-columns: minmax(180px, 1.1fr) minmax(180px, 1fr) auto;
  align-items: end;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.card-manager-actions {
  justify-content: flex-end;
}

.canvas-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
  margin-bottom: 12px;
}

.canvas-toolbar span {
  color: var(--muted);
  font-size: 0.86rem;
}

.canvas-wrap {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 420px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 8px;
  background:
    linear-gradient(45deg, rgba(255, 255, 255, 0.025) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255, 255, 255, 0.025) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.025) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.025) 75%),
    rgba(2, 4, 7, 0.34);
  background-position:
    0 0,
    0 12px,
    12px -12px,
    -12px 0;
  background-size: 24px 24px;
  overflow: hidden;
}

.canvas-wrap::after {
  content: "Solte a imagem aqui";
  position: absolute;
  inset: 14px;
  display: grid;
  place-items: center;
  border: 2px dashed rgba(243, 215, 122, 0.64);
  border-radius: 8px;
  color: #f3d77a;
  background: rgba(8, 10, 14, 0.72);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
  font-weight: 800;
}

.canvas-wrap.drag-over::after {
  opacity: 1;
}

.canvas-wrap.square canvas {
  width: min(72vh, 100%);
  max-width: 760px;
  aspect-ratio: 1;
}

.canvas-wrap.card-ratio canvas {
  width: min(60vh, 100%);
  max-width: 490px;
  aspect-ratio: 744 / 1039;
}

canvas {
  display: block;
  height: auto;
  border-radius: 8px;
  touch-action: none;
}

.border-palette {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  max-height: 300px;
  overflow: auto;
}

.border-category-title {
  grid-column: 1 / -1;
  margin-top: 4px;
  color: #f3d77a;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.border-swatch {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  min-height: 40px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.18);
  box-shadow:
    inset 0 0 0 9px rgba(0, 0, 0, 0.5),
    0 8px 24px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.border-swatch.active {
  border-color: #f4d77d;
  box-shadow:
    inset 0 0 0 9px rgba(0, 0, 0, 0.42),
    0 0 0 2px rgba(244, 215, 125, 0.34),
    0 0 28px rgba(244, 215, 125, 0.22);
}

.border-swatch::after {
  content: "";
  position: absolute;
  inset: 24%;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.38);
}

.border-swatch .swatch-name {
  position: absolute;
  z-index: 2;
  right: 4px;
  bottom: 5px;
  left: 4px;
  display: -webkit-box;
  overflow: hidden;
  color: #fff4c8;
  font-size: 0.52rem;
  font-weight: 900;
  line-height: 1.05;
  text-align: center;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.9);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.sticker-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.sticker-grid button {
  min-height: 44px;
  padding: 0;
  font-size: 1.24rem;
}

.card-gallery,
.layers-list {
  display: grid;
  gap: 8px;
  max-height: 180px;
  overflow: auto;
}

.card-gallery {
  width: 100%;
}

.rich-layers {
  max-height: 260px;
}

.gallery-item,
.layer-item,
.template-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 42px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
  text-align: left;
}

.layer-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.layer-title {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.layer-title span,
.layer-title small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.layer-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 4px;
}

.layer-actions button {
  display: grid;
  place-items: center;
  width: 28px;
  min-width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  border-radius: 7px;
  color: var(--muted);
  font-size: 0.78rem;
}

.layer-item.locked .layer-title span,
.layer-item.hidden .layer-title span {
  color: var(--muted);
}

.layer-item.hidden .layer-title span {
  text-decoration: line-through;
}

.gallery-item.active,
.layer-item.active,
.template-button.active {
  border-color: rgba(215, 180, 91, 0.76);
  background: rgba(215, 180, 91, 0.14);
}

.gallery-item span,
.layer-item span,
.template-button span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gallery-item small,
.layer-item small,
.template-button small {
  color: var(--muted);
  font-size: 0.72rem;
}

.template-grid {
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow: auto;
}

.compact-grid .template-button {
  min-height: 38px;
}

.template-button span {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  line-height: 1.2;
}

.template-button small {
  flex: 0 0 74px;
  text-align: right;
  white-space: normal;
  line-height: 1.2;
}

.template-button::before {
  content: "";
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 50%;
  background: var(--template-gradient);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.2);
}

.preset-row button {
  min-width: 0;
  padding-inline: 8px;
  font-size: 0.74rem;
}

.canvas-text-editor {
  position: fixed;
  z-index: 50;
  min-width: 120px;
  border: 1px solid rgba(243, 215, 122, 0.9);
  border-radius: 8px;
  color: var(--text);
  background: rgba(9, 10, 13, 0.94);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
  resize: none;
}

.seo-section {
  max-width: 1180px;
  margin: 0 auto clamp(14px, 2vw, 22px);
  padding: clamp(18px, 3vw, 30px);
  border: 1px solid rgba(247, 231, 179, 0.13);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(215, 180, 91, 0.06), rgba(79, 147, 184, 0.045)),
    rgba(9, 12, 18, 0.68);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.24);
}

.seo-section h2 {
  margin: 0 0 12px;
  color: #f3d77a;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.25rem, 2vw, 1.72rem);
  letter-spacing: 0;
}

.seo-section p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.68;
}

.seo-section p + p {
  margin-top: 12px;
}

.seo-section ol {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: howto;
}

.seo-section ol li {
  counter-increment: howto;
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(215, 180, 91, 0.16);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.86rem;
  line-height: 1.45;
}

.seo-section ol li::before {
  content: counter(howto);
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin: 0 8px 6px 0;
  border-radius: 50%;
  color: #1a140b;
  background: linear-gradient(135deg, #f3d77a, #bd8439);
  font-size: 0.75rem;
  font-weight: 900;
}

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

.faq-grid details {
  min-width: 0;
  border: 1px solid rgba(215, 180, 91, 0.15);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.faq-grid summary {
  cursor: pointer;
  padding: 13px 14px;
  color: var(--text);
  font-weight: 900;
  line-height: 1.35;
}

.faq-grid p {
  padding: 0 14px 14px;
  font-size: 0.88rem;
}

.site-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 22px clamp(16px, 3vw, 34px);
  border-top: 1px solid rgba(247, 231, 179, 0.14);
  color: var(--muted);
  background:
    radial-gradient(circle at 12% 0%, rgba(215, 180, 91, 0.08), transparent 26%),
    linear-gradient(180deg, rgba(8, 10, 14, 0.82), rgba(5, 6, 9, 0.96)),
    rgba(0, 0, 0, 0.34);
}

.footer-brand {
  display: grid;
  gap: 6px;
  max-width: 820px;
}

.footer-brand strong {
  color: #f3d77a;
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: 0;
}

.footer-brand span,
.footer-year {
  font-size: 0.82rem;
  line-height: 1.4;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(215, 180, 91, 0.18);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.045);
  font-size: 0.82rem;
  text-decoration: none;
}

.footer-links a:hover {
  color: #f3d77a;
}

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .canvas-stage {
    order: 1;
  }

  .tool-panel {
    order: 2;
  }

  .workspace > .tool-panel:last-child {
    order: 3;
  }

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

@media (max-width: 900px) {
  main {
    padding: 12px;
  }

  .workspace {
    gap: 12px;
  }

  .card-manager {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .canvas-wrap.square canvas,
  .canvas-wrap.card-ratio canvas {
    width: 100%;
    max-width: min(100%, 560px);
  }

  .tool-panel,
  .canvas-stage {
    border-radius: 8px;
  }

  .template-grid,
  .rich-layers,
  .border-palette {
    max-height: none;
  }
}

@media (max-width: 720px) {
  .topbar {
    position: static;
    align-items: stretch;
    flex-direction: column;
    min-height: 0;
    padding: 10px 12px;
  }

  .brand {
    min-width: 0;
    max-width: none;
  }

  .brand-mark {
    width: 46px;
    height: 46px;
    flex-basis: 46px;
  }

  .brand-mark svg {
    width: 46px;
    height: 46px;
  }

  .tabs,
  .segmented {
    width: 100%;
  }

  .tab-button,
  .segmented button {
    flex: 1;
  }

  .two-cols {
    grid-template-columns: 1fr;
  }

  .canvas-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .control-row.compact {
    justify-content: stretch;
  }

  .control-row.compact > button {
    flex: 1 1 auto;
  }

  .canvas-wrap {
    min-height: 310px;
  }

  button,
  input,
  select,
  textarea {
    min-height: 42px;
  }

  .ad-slot {
    min-height: 58px;
    margin-bottom: 12px;
  }

  .project-session {
    align-items: stretch;
    flex-direction: column;
  }

  .project-actions {
    justify-content: stretch;
  }

  .project-actions > button,
  .project-import-button {
    flex: 1 1 180px;
  }

  .seo-section ol,
  .faq-grid {
    grid-template-columns: 1fr;
  }

  .site-footer {
    align-items: flex-start;
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .control-row.compact,
  .card-manager-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .control-row.compact > select {
    width: 100%;
    flex-basis: auto;
  }
}
