:root {
  --af-accent: #6d3df5;
  --af-accent-strong: #5427d8;
  --af-accent-soft: #eee9ff;
  --af-pink: #d83e8d;
  --af-ink: #201a2d;
  --af-muted: #746d82;
  --af-border: #e8e3ef;
  --af-surface: #ffffff;
  --af-canvas: #f7f5fa;
  --af-success: #138a63;
  --af-danger: #c33f55;
  --af-radius-xl: 26px;
  --af-radius-lg: 18px;
  --af-radius-md: 13px;
  --af-shadow: 0 22px 70px rgba(45, 31, 70, 0.09);
}

* {
  box-sizing: border-box;
}

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

body.afrodita-console {
  margin: 0;
  color: var(--af-ink);
  background:
    radial-gradient(circle at 0 0, rgba(109, 61, 245, 0.08), transparent 28rem),
    radial-gradient(circle at 100% 18%, rgba(216, 62, 141, 0.06), transparent 25rem),
    var(--af-canvas);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

.console-shell {
  width: min(1480px, calc(100% - 40px));
  max-width: none;
  margin: 0 auto;
  padding: 36px 0 56px;
}

.console-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 28px;
}

.hero-copy {
  max-width: 760px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--af-accent-strong);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eyebrow::before {
  width: 22px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--af-accent), var(--af-pink));
  content: "";
}

.console-hero h1 {
  margin: 0;
  max-width: 700px;
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1.05;
  letter-spacing: -0.045em;
}

.console-hero p {
  margin: 13px 0 0;
  max-width: 680px;
  color: var(--af-muted);
  font-size: 1rem;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid rgba(19, 138, 99, 0.18);
  border-radius: 999px;
  color: #106a4d;
  background: rgba(224, 247, 239, 0.8);
  font-size: 0.82rem;
  font-weight: 750;
  white-space: nowrap;
}

.sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--af-success);
  box-shadow: 0 0 0 4px rgba(19, 138, 99, 0.12);
}

.sync-pill.is-saving {
  color: #7c5812;
  border-color: rgba(181, 128, 25, 0.2);
  background: #fff6d9;
}

.sync-pill.is-saving .sync-dot {
  background: #d39720;
  box-shadow: 0 0 0 4px rgba(211, 151, 32, 0.14);
  animation: af-pulse 1.2s infinite;
}

.sync-pill.is-error {
  color: #9f3044;
  border-color: rgba(195, 63, 85, 0.2);
  background: #ffedf1;
}

.sync-pill.is-error .sync-dot {
  background: var(--af-danger);
  box-shadow: 0 0 0 4px rgba(195, 63, 85, 0.12);
}

.secondary-action,
.primary-action {
  min-height: 42px;
  margin: 0;
  padding: 0 17px;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 750;
}

.secondary-action {
  color: var(--af-ink);
  border: 1px solid var(--af-border);
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 8px 24px rgba(45, 31, 70, 0.06);
}

.secondary-action:hover {
  color: var(--af-accent-strong);
  border-color: #d8cffa;
  background: #fff;
}

.console-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.75fr);
  align-items: start;
  gap: 24px;
}

.settings-column,
.preview-column {
  display: grid;
  gap: 20px;
}

.preview-column {
  position: static;
}

.appearance-card {
  overflow: visible;
  backdrop-filter: none;
}

.panel-card {
  position: relative;
  overflow: hidden;
  padding: 25px;
  border: 1px solid rgba(225, 218, 235, 0.9);
  border-radius: var(--af-radius-xl);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 55px rgba(45, 31, 70, 0.07);
  backdrop-filter: blur(16px);
}

.panel-card.appearance-card {
  overflow: visible;
  backdrop-filter: none;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 22px;
}

.panel-icon {
  display: grid;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 14px;
  color: var(--af-accent-strong);
  background: linear-gradient(145deg, #f1edff, #faf8ff);
  box-shadow: inset 0 0 0 1px rgba(109, 61, 245, 0.08);
}

.panel-icon svg {
  width: 20px;
  height: 20px;
}

.panel-heading h2 {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: -0.015em;
}

.panel-heading p {
  margin: 4px 0 0;
  color: var(--af-muted);
  font-size: 0.83rem;
}

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

.field-group {
  min-width: 0;
}

.field-label,
.field-group > label:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 8px;
  color: #3a3347;
  font-size: 0.79rem;
  font-weight: 750;
}

.field-help {
  display: block;
  margin-top: 7px;
  color: #8a8395;
  font-size: 0.72rem;
}

.afrodita-console select,
.afrodita-console input[type="text"],
.afrodita-console textarea {
  width: 100%;
  border: 1px solid var(--af-border);
  border-radius: var(--af-radius-md);
  color: var(--af-ink);
  background: #fbfafd;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9), inset 0 1px 2px rgba(45, 31, 70, 0.02);
  font: inherit;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}

.afrodita-console select,
.afrodita-console input[type="text"] {
  min-height: 48px;
  padding: 0 42px 0 14px;
  font-size: 0.87rem;
}

.afrodita-console select {
  cursor: pointer;
}

.afrodita-console textarea {
  min-height: 112px;
  padding: 14px 42px 14px 14px;
  resize: vertical;
  font-size: 0.84rem;
  line-height: 1.55;
}

.afrodita-console select:focus,
.afrodita-console input[type="text"]:focus,
.afrodita-console textarea:focus {
  border-color: rgba(109, 61, 245, 0.55);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(109, 61, 245, 0.1);
}

.editable-field {
  position: relative;
}

.editable-field::after {
  position: absolute;
  top: 39px;
  right: 12px;
  padding: 3px 7px;
  border-radius: 999px;
  color: var(--af-accent-strong);
  background: var(--af-accent-soft);
  content: "Editar";
  font-size: 0.65rem;
  font-weight: 800;
  pointer-events: none;
}

.editable-field textarea[readonly] {
  cursor: pointer;
}

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

.choice-card {
  position: relative;
  display: block;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--af-border);
  border-radius: var(--af-radius-lg);
  background: #fbfafd;
  transition: border-color 0.18s, transform 0.18s, box-shadow 0.18s;
}

.choice-card:has(input:checked) {
  border-color: rgba(109, 61, 245, 0.42);
  background: linear-gradient(145deg, #faf8ff, #f4f0ff);
  box-shadow: 0 10px 30px rgba(109, 61, 245, 0.08);
}

.choice-title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 10px;
  color: #332b41;
  font-size: 0.81rem;
  font-weight: 800;
}

.choice-card input[type="radio"] {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--af-accent);
}

.choice-card textarea {
  min-height: 92px;
  background: rgba(255, 255, 255, 0.72);
}

.preview-card {
  padding: 0;
}

.preview-card .panel-heading {
  padding: 23px 23px 0;
  margin-bottom: 18px;
}

.preview-canvas {
  position: relative;
  min-height: 410px;
  overflow: hidden;
  margin: 0 14px 14px;
  border: 1px solid #e4deeb;
  border-radius: 20px;
  background:
    radial-gradient(circle at 82% 20%, rgba(216, 62, 141, 0.18), transparent 12rem),
    radial-gradient(circle at 8% 92%, rgba(109, 61, 245, 0.2), transparent 13rem),
    linear-gradient(150deg, #fcfbfd 0%, #f3eff9 100%);
}

.preview-browser-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 13px;
  border-bottom: 1px solid rgba(108, 94, 125, 0.12);
  background: rgba(255, 255, 255, 0.65);
}

.preview-address {
  width: 48%;
  height: 20px;
  margin-left: 7px;
  padding: 2px 10px;
  border: 1px solid rgba(108, 94, 125, 0.09);
  border-radius: 7px;
  color: #958da1;
  background: rgba(255, 255, 255, 0.68);
  font-size: 0.55rem;
  line-height: 14px;
}

.preview-browser-bar span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #d9d3e1;
}

.preview-copy {
  padding: 30px 28px;
}

.preview-site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 48px;
  padding: 0 22px;
  border-bottom: 1px solid rgba(108, 94, 125, 0.08);
  color: #3e354a;
  background: rgba(255, 255, 255, 0.5);
}

.preview-logo {
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.preview-nav-items {
  color: #8c8497;
  font-size: 0.49rem;
  font-weight: 650;
}

.preview-site-content {
  width: 78%;
  padding: 39px 24px 28px;
}

.preview-site-eyebrow {
  display: block;
  margin-bottom: 12px;
  color: var(--primary-color, var(--af-accent));
  font-size: 0.52rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.preview-cta {
  display: block;
  width: 70px;
  height: 24px;
  margin-top: 18px;
  border-radius: 7px;
  background: rgba(44, 34, 59, 0.13);
}

.preview-kicker {
  width: 86px;
  height: 8px;
  margin-bottom: 15px;
  border-radius: 999px;
  background: rgba(109, 61, 245, 0.2);
}

.preview-line {
  height: 10px;
  margin-bottom: 9px;
  border-radius: 999px;
  background: rgba(44, 34, 59, 0.09);
}

.preview-line.is-title {
  width: 62%;
  height: 17px;
  background: rgba(44, 34, 59, 0.18);
}

.preview-line.is-short {
  width: 72%;
}

#chat-button {
  position: absolute;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  right: 18px;
  bottom: 18px;
  min-width: 124px;
  min-height: 46px;
  margin: 0;
  padding: 0 18px;
  border: 0;
  border-radius: var(--button-border-radius, 12px);
  color: #fff;
  background: var(--primary-color, var(--af-accent));
  box-shadow: 0 12px 26px rgba(64, 40, 114, 0.22);
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  isolation: isolate;
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
}

#chat-button:hover {
  transform: translateY(-2px);
}

#chat-button[data-position="left"] {
  right: auto;
  left: 18px;
}

#chat-button[data-layout="icon"] {
  gap: 0;
  min-width: 46px;
  width: 46px;
  padding: 0;
  border-radius: 50%;
}

#chat-button[data-layout="icon"] .launcher-label,
#chat-button[data-layout="text"] .launcher-icon,
#compactChatButton[data-layout="icon"] .launcher-label,
#compactChatButton[data-layout="text"] .launcher-icon {
  display: none;
}

.launcher-icon {
  display: grid;
  flex: 0 0 auto;
  width: calc(var(--launcher-icon-size, 20px) + 4px);
  height: calc(var(--launcher-icon-size, 20px) + 4px);
  place-items: center;
  border-radius: 50%;
  transition: color 0.2s, background 0.2s, transform 0.2s;
}

.launcher-icon svg {
  display: block;
  width: var(--launcher-icon-size, 20px);
  height: var(--launcher-icon-size, 20px);
  background: transparent;
}

.launcher-icon img {
  display: block;
  width: var(--launcher-icon-size, 20px);
  height: var(--launcher-icon-size, 20px);
  object-fit: contain;
  border-radius: 22%;
  background: transparent;
}

.launcher-icon.is-soft {
  background: rgba(255, 255, 255, 0.18);
}

.launcher-icon.is-contrast {
  color: var(--primary-color, var(--af-accent));
  background: #fff;
  box-shadow: 0 3px 10px rgba(32, 26, 45, 0.13);
}

#chat-button.is-outline .launcher-icon.is-soft,
#chat-button.is-ghost .launcher-icon.is-soft,
#compactChatButton.is-outline .launcher-icon.is-soft,
#compactChatButton.is-ghost .launcher-icon.is-soft {
  background: color-mix(in srgb, var(--primary-color, var(--af-accent)) 13%, transparent);
}

#chat-button.is-outline .launcher-icon.is-contrast,
#chat-button.is-ghost .launcher-icon.is-contrast,
#compactChatButton.is-outline .launcher-icon.is-contrast,
#compactChatButton.is-ghost .launcher-icon.is-contrast {
  color: #fff;
  background: var(--primary-color, var(--af-accent));
}

.launcher-label {
  overflow: hidden;
  min-width: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.launcher-status {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 10px;
  height: 10px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #2dcf82;
  box-shadow: 0 2px 7px rgba(25, 116, 77, 0.28);
}

#chat-button.has-animation:not(:hover) .launcher-icon,
#compactChatButton.has-animation:not(:hover) .launcher-icon {
  animation: af-launcher-breathe 2.8s ease-in-out infinite;
}

.compact-preview-slot {
  min-height: 116px;
  margin: -5px -4px 19px;
}

.compact-preview-slot.is-floating {
  min-height: 26px;
}

.compact-preview-dock {
  position: relative;
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(110px, 0.7fr) minmax(200px, 1.3fr);
  align-items: center;
  gap: 12px;
  padding: 11px;
  border: 1px solid rgba(219, 211, 231, 0.92);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 16px 38px rgba(40, 27, 62, 0.15);
  backdrop-filter: blur(18px);
}

.compact-preview-dock.is-floating {
  position: fixed;
  top: 10px;
  right: 12px;
  width: min(620px, calc(100% - 24px));
  animation: af-dock-in 0.2s ease;
}

.compact-preview-copy span,
.compact-preview-copy small {
  display: block;
}

.compact-preview-copy span {
  color: #332b41;
  font-size: 0.78rem;
  font-weight: 850;
}

.compact-preview-copy small {
  margin-top: 3px;
  color: var(--af-muted);
  font-size: 0.65rem;
}

.compact-preview-stage {
  position: relative;
  min-height: 92px;
  overflow: hidden;
  border: 1px solid rgba(109, 61, 245, 0.12);
  border-radius: 16px;
  background:
    radial-gradient(circle at 90% 20%, rgba(216, 62, 141, 0.12), transparent 7rem),
    linear-gradient(145deg, #fff, #f4f0fa);
}

.compact-preview-page,
.compact-preview-page::before,
.compact-preview-page::after {
  position: absolute;
  left: 13px;
  height: 6px;
  border-radius: 999px;
  background: rgba(44, 34, 59, 0.1);
  content: "";
}

.compact-preview-page {
  top: 17px;
  width: 42%;
}

.compact-preview-page::before {
  top: 12px;
  left: 0;
  width: 145%;
}

.compact-preview-page::after {
  top: 24px;
  left: 0;
  width: 105%;
}

#compactChatButton {
  position: absolute;
  z-index: 2;
  right: 12px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin: 0;
  border: 0;
  color: #fff;
  font-weight: 800;
  cursor: default;
}

#compactChatButton[data-position="left"] {
  right: auto;
  left: 12px;
}

#compactChatButton[data-layout="icon"] {
  gap: 0;
  padding: 0;
}

.preview-chat-panel {
  position: absolute;
  z-index: 3;
  right: 18px;
  bottom: 78px;
  width: min(270px, calc(100% - 36px));
  overflow: hidden;
  border: 1px solid rgba(226, 219, 235, 0.95);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(38, 25, 57, 0.2);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px) scale(0.97);
  transform-origin: bottom right;
  transition: opacity 0.2s, transform 0.2s;
}

.preview-chat-panel[data-position="left"] {
  right: auto;
  left: 18px;
  transform-origin: bottom left;
}

.preview-chat-panel.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.preview-chat-head {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 9px;
  padding: 12px;
  color: #fff;
  background: var(--primary-color, var(--af-accent));
}

.preview-avatar {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 12px;
  color: var(--primary-color, var(--af-accent));
  background: #fff;
}

.preview-avatar svg {
  width: 20px;
  height: 20px;
}

.preview-avatar .launcher-icon,
.preview-avatar .launcher-icon img {
  width: 20px;
  height: 20px;
}

.preview-chat-head strong,
.preview-chat-head small {
  display: block;
}

.preview-chat-head strong {
  font-size: 0.72rem;
}

.preview-chat-head small {
  margin-top: 1px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.58rem;
}

#previewChatClose {
  display: grid;
  width: 28px;
  height: 28px;
  margin: 0;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 9px;
  color: #fff;
  background: rgba(255, 255, 255, 0.13);
  font-size: 1rem;
  cursor: pointer;
}

.preview-chat-body {
  min-height: 124px;
  padding: 16px 13px 12px;
  background: linear-gradient(180deg, #fbfafd, #f7f4fa);
}

.preview-chat-body p {
  width: 78%;
  margin: 0 0 16px;
  padding: 9px 11px;
  border: 1px solid #ebe6f0;
  border-radius: 5px 13px 13px 13px;
  color: #4a4155;
  background: #fff;
  font-size: 0.64rem;
  line-height: 1.45;
}

.preview-chat-body span {
  display: block;
  padding: 9px 11px;
  border: 1px solid #e6e0ec;
  border-radius: 999px;
  color: #aaa2b2;
  background: #fff;
  font-size: 0.59rem;
}

#chat-button.is-previewing,
#compactChatButton.is-previewing {
  animation: af-preview-pop 0.65s ease;
}

.preview-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 20px 20px;
  color: var(--af-muted);
  font-size: 0.72rem;
}

.preview-note svg {
  width: 15px;
  height: 15px;
  color: var(--af-accent);
}

.appearance-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(100px, 0.75fr);
  gap: 14px;
  margin-top: 14px;
}

.appearance-grid:first-of-type {
  margin-top: 0;
}

.icon-picker-fieldset {
  min-width: 0;
  margin: 18px 0 4px;
  padding: 0;
  border: 0;
}

.icon-picker-fieldset legend {
  margin-bottom: 9px;
  color: #3a3347;
  font-size: 0.79rem;
  font-weight: 750;
}

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

.icon-option {
  display: grid;
  min-width: 0;
  min-height: 64px;
  margin: 0;
  padding: 8px 4px 6px;
  place-items: center;
  gap: 3px;
  border: 1px solid var(--af-border);
  border-radius: 13px;
  color: #746d82;
  background: #fff;
  cursor: pointer;
  transition: color 0.18s, border-color 0.18s, background 0.18s, transform 0.18s;
}

.icon-option:hover {
  color: var(--af-accent-strong);
  border-color: #d8cffa;
  background: #fff;
  transform: translateY(-1px);
}

.icon-option[aria-pressed="true"] {
  color: var(--af-accent-strong);
  border-color: rgba(109, 61, 245, 0.42);
  background: color-mix(in srgb, var(--af-accent) 7%, #fff);
  box-shadow: 0 7px 20px rgba(109, 61, 245, 0.08);
}

.icon-option svg {
  width: 21px;
  height: 21px;
}

.icon-option span {
  overflow: hidden;
  max-width: 100%;
  font-size: 0.58rem;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-format-note {
  margin: 8px 1px 0;
  color: var(--af-muted);
  font-size: 0.66rem;
}

.icon-format-note::before {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin: 0 6px 1px 0;
  border-radius: 50%;
  background: #2dcf82;
  content: "";
}

.custom-icon-upload {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 11px 12px;
  border: 1px dashed #d8d1e5;
  border-radius: 15px;
  background: #fff;
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
}

.custom-icon-upload.is-selected {
  border-color: rgba(109, 61, 245, 0.5);
  background: color-mix(in srgb, var(--af-accent) 5%, #fff);
  box-shadow: 0 8px 22px rgba(109, 61, 245, 0.07);
}

.custom-icon-upload.is-error {
  border-color: rgba(207, 48, 69, 0.48);
  background: #fff8f9;
}

.custom-icon-preview {
  display: grid;
  width: 50px;
  height: 50px;
  overflow: hidden;
  place-items: center;
  border: 1px solid var(--af-border);
  border-radius: 13px;
  color: #82798f;
  background: #fff;
}

.custom-icon-preview svg {
  width: 23px;
  height: 23px;
}

.custom-icon-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.custom-icon-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.custom-icon-copy strong {
  color: #302a3a;
  font-size: 0.76rem;
}

.custom-icon-copy span,
.custom-icon-copy small {
  color: var(--af-muted);
  font-size: 0.63rem;
  line-height: 1.35;
}

.custom-icon-upload.is-error .custom-icon-copy small {
  color: #b42338;
}

.custom-icon-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

.custom-icon-upload [hidden] {
  display: none !important;
}

.custom-icon-upload-button,
.custom-icon-secondary,
.custom-icon-remove {
  min-height: 34px;
  margin: 0;
  padding: 0 11px;
  border: 1px solid #d7cffa;
  border-radius: 10px;
  color: var(--af-accent-strong);
  background: #fff;
  font-family: inherit;
  font-size: 0.65rem;
  font-weight: 750;
  line-height: 32px;
  cursor: pointer;
  white-space: nowrap;
}

.custom-icon-upload-button:hover,
.custom-icon-secondary:hover {
  border-color: var(--af-accent);
  background: color-mix(in srgb, var(--af-accent) 6%, #fff);
}

.custom-icon-remove {
  border-color: transparent;
  color: #a33849;
  background: transparent;
}

.custom-icon-remove:hover {
  background: #fff1f3;
}

.appearance-single-field {
  margin-top: 14px;
}

.dimension-controls {
  display: grid;
  gap: 9px;
  margin-top: 18px;
}

.dimension-controls-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 1px;
}

.dimension-controls-title strong {
  color: #302a3a;
  font-size: 0.83rem;
}

.dimension-controls-title span {
  color: var(--af-muted);
  font-size: 0.65rem;
}

.dimension-control {
  display: grid;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--af-border);
  border-radius: 15px;
  background: #fbfafd;
}

.icon-size-control-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.icon-size-control-head strong,
.icon-size-control-head span {
  display: block;
}

.icon-size-control-head strong {
  color: #302a3a;
  font-size: 0.76rem;
}

.icon-size-control-head span {
  margin-top: 2px;
  color: var(--af-muted);
  font-size: 0.63rem;
}

.icon-size-presets {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.icon-size-presets button {
  min-width: 0;
  min-height: 34px;
  margin: 0;
  padding: 0 8px;
  overflow: hidden;
  border: 1px solid #ded9e8;
  border-radius: 10px;
  color: #665e72;
  background: #fff;
  font-family: inherit;
  font-size: 0.62rem;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.icon-size-presets button:hover,
.icon-size-presets button[aria-pressed="true"] {
  color: var(--af-accent-strong);
  border-color: rgba(109, 61, 245, 0.42);
  background: color-mix(in srgb, var(--af-accent) 7%, #fff);
}

.icon-size-range > span {
  color: #7e758b;
  font-weight: 800;
  line-height: 1;
}

.icon-size-range > span:first-child {
  font-size: 0.62rem;
}

.icon-size-range > span:last-child {
  font-size: 1rem;
}

.text-size-gauge.is-small {
  font-size: 0.58rem !important;
}

.text-size-gauge.is-large {
  font-size: 1rem !important;
}

.background-size-range {
  gap: 10px;
}

.background-size-gauge {
  display: inline-block;
  flex: 0 0 auto;
  border: 2px solid #81788e;
  border-radius: 999px;
}

.background-size-gauge.is-small {
  width: 20px;
  height: 10px;
}

.background-size-gauge.is-large {
  width: 32px;
  height: 17px;
}

.color-field {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.afrodita-console input[type="color"] {
  width: 48px;
  height: 48px;
  padding: 4px;
  border: 1px solid var(--af-border);
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
}

.color-value {
  min-width: 0;
  color: var(--af-muted);
  font-size: 0.77rem;
  font-weight: 700;
}

.range-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.afrodita-console input[type="range"] {
  flex: 1;
  width: auto;
  accent-color: var(--af-accent);
}

#borderRadiusValue,
#buttonIconSizeValue,
#buttonTextSizeValue,
#buttonBackgroundSizeValue {
  min-width: 42px;
  padding: 4px 7px;
  border-radius: 8px;
  color: var(--af-accent-strong);
  background: var(--af-accent-soft);
  font-size: 0.7rem;
  font-weight: 800;
  text-align: center;
}

@keyframes af-launcher-breathe {
  0%, 70%, 100% { transform: scale(1); }
  82% { transform: scale(1.13) rotate(-4deg); }
  91% { transform: scale(0.98) rotate(2deg); }
}

@keyframes af-dock-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.toggle-list {
  display: grid;
  gap: 9px;
  margin-top: 16px;
}

.toggle-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 52px;
  padding: 10px 13px;
  border: 1px solid var(--af-border);
  border-radius: 14px;
  background: #fbfafd;
  cursor: pointer;
}

.toggle-copy strong,
.toggle-copy span {
  display: block;
}

.toggle-copy strong {
  color: #3a3347;
  font-size: 0.79rem;
}

.toggle-copy span {
  margin-top: 2px;
  color: var(--af-muted);
  font-size: 0.68rem;
}

.toggle-control input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle-track {
  position: relative;
  flex: 0 0 42px;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: #d9d3e1;
  transition: background 0.2s;
}

.toggle-track::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 7px rgba(45, 31, 70, 0.2);
  content: "";
  transition: transform 0.2s;
}

.toggle-control input:checked + .toggle-track {
  background: var(--af-accent);
}

.toggle-control input:checked + .toggle-track::after {
  transform: translateX(18px);
}

.panel-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10010;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(24, 16, 37, 0.58);
  backdrop-filter: blur(10px);
}

.panel-modal-overlay.active {
  display: flex;
}

.panel-modal-content {
  display: flex;
  width: min(820px, 100%);
  height: min(680px, 88vh);
  max-width: none;
  max-height: none;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 34px 100px rgba(18, 10, 31, 0.28);
}

.modal-header {
  padding: 22px 24px 17px;
  border-bottom: 1px solid var(--af-border);
}

.modal-header h2 {
  margin: 0;
  color: var(--af-ink);
  font-size: 1.12rem;
}

.modal-header p {
  margin: 5px 0 0;
  color: var(--af-muted);
  font-size: 0.76rem;
}

.modal-editor {
  display: flex;
  flex: 1;
  min-height: 0;
  padding: 18px 24px;
}

.afrodita-console .modal-textarea {
  flex: 1;
  min-height: 0;
  resize: none;
  background: #fbfafd;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px 20px;
  border-top: 1px solid var(--af-border);
}

.modal-actions button {
  min-height: 43px;
  margin: 0;
  padding: 0 17px;
  border-radius: 12px;
  font-size: 0.82rem;
  font-weight: 800;
}

.modal-actions .modal-cancel {
  color: var(--af-ink);
  border: 1px solid var(--af-border);
  background: #fff;
}

.modal-actions .modal-save {
  color: #fff;
  border: 1px solid transparent;
  background: linear-gradient(135deg, var(--af-accent), var(--af-accent-strong));
  box-shadow: 0 10px 24px rgba(109, 61, 245, 0.2);
}

.notification {
  position: fixed;
  top: 20px;
  left: 50%;
  z-index: 10020;
  max-width: min(420px, calc(100% - 32px));
  padding: 11px 16px;
  border: 1px solid rgba(19, 138, 99, 0.18);
  border-radius: 999px;
  color: #106a4d;
  background: rgba(238, 253, 247, 0.97);
  box-shadow: 0 16px 42px rgba(45, 31, 70, 0.14);
  font-size: 0.8rem;
  font-weight: 750;
}

.notification.error {
  color: #9f3044;
  border-color: rgba(195, 63, 85, 0.18);
  background: rgba(255, 239, 242, 0.97);
}

@keyframes af-pulse {
  50% { opacity: 0.45; }
}

@keyframes af-preview-pop {
  40% { transform: translateY(-5px) scale(1.04); }
}

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

  .preview-column {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .console-shell {
    width: min(100% - 24px, 1480px);
    padding-top: 22px;
  }

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

  .hero-actions,
  .secondary-action {
    width: 100%;
  }

  .hero-actions {
    justify-content: flex-start;
  }

  .secondary-action {
    flex: 1;
  }

  .field-grid,
  .choice-grid,
  .preview-column,
  .appearance-grid {
    grid-template-columns: 1fr;
  }

  .icon-picker {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .custom-icon-upload {
    grid-template-columns: 50px minmax(0, 1fr);
  }

  .custom-icon-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .dimension-controls-title {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .preview-column .preview-card {
    display: none;
  }

  .compact-preview-dock {
    grid-template-columns: minmax(130px, 0.75fr) minmax(220px, 1.25fr);
  }

  .panel-card {
    padding: 20px;
    border-radius: 21px;
  }

  .preview-card {
    padding: 0;
  }

  .console-hero h1 {
    font-size: 2rem;
  }

  .panel-modal-overlay {
    padding: 10px;
  }

  .panel-modal-content {
    height: 94vh;
    border-radius: 19px;
  }
}

@media (max-width: 460px) {
  .icon-size-presets {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .compact-preview-slot {
    min-height: 154px;
  }

  .compact-preview-slot.is-floating {
    min-height: 26px;
  }

  .compact-preview-dock {
    grid-template-columns: 1fr;
  }

  .compact-preview-copy {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
  }

  .compact-preview-copy small {
    margin-top: 0;
  }

  .compact-preview-stage {
    min-height: 84px;
  }
}

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