/* refactored with chatGPT - 20 May 2026, UK time */
:root {
  --app-bg: #d8dde3;
  --panel-bg: #f7f8fa;
  --panel-strong: #ffffff;
  --ink: #20252d;
  --muted: #68717d;
  --line: #d9dee5;
  --line-strong: #c6cdd6;
  --accent: #1f7a68;
  --accent-dark: #176454;
  --accent-soft: #e3f3ef;
  --danger: #b83f37;
  --shadow-soft: 0 18px 48px rgba(28, 35, 45, 0.16);
  --shadow-tight: 0 8px 24px rgba(28, 35, 45, 0.12);
  --radius: 8px;
  --topbar-height: 72px;
  --sidebar-width: 310px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  color: var(--ink);
  background: var(--app-bg);
  font-family: var(--font);
}

button,
input,
select {
  font: inherit;
}

button {
  border: 1px solid #d6e0ec;
  border-radius: 7px;
  background: var(--panel-strong);
  color: var(--ink);
  min-height: 36px;
  padding: 0 12px;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

button:hover {
  border-color: var(--line-strong);
  box-shadow: 0 3px 10px rgba(26, 32, 39, 0.08);
}

button:active {
  transform: translateY(1px);
}

.app-shell {
  display: grid;
  grid-template-rows: var(--topbar-height) 1fr;
  width: 100vw;
  height: 100vh;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: var(--topbar-height);
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(250, 251, 252, 0.94);
  backdrop-filter: blur(14px);
  z-index: 10;
}

.top-left,
.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.top-actions > [data-action="reset"],
.top-actions > [data-action="undo"],
.top-actions > [data-action="redo"] {
  display: none;
}

.account-login-button,
.account-menu summary,
.global-help-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(28, 35, 45, 0.08);
  cursor: pointer;
}

.account-login-button:hover,
.account-menu summary:hover,
.global-help-button:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.global-help-button {
  width: 38px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.global-help-button img {
  display: block;
  width: 32px;
  height: 32px;
}

.account-menu {
  position: relative;
}

.account-menu summary {
  gap: 8px;
  list-style: none;
}

.account-menu summary::-webkit-details-marker {
  display: none;
}

.account-avatar {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.account-menu-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 40;
  display: grid;
  gap: 4px;
  min-width: 210px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow-tight);
}

.account-menu-panel p {
  margin: 0 0 6px;
  padding: 0 2px 8px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.account-menu-panel a,
.account-menu-panel button {
  width: 100%;
  min-height: 34px;
  padding: 0 9px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.account-menu-panel a {
  display: inline-flex;
  align-items: center;
}

.account-menu-panel a:hover,
.account-menu-panel button:hover {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.account-auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(18, 25, 34, 0.48);
  backdrop-filter: blur(8px);
}

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

.account-page-overlay,
.help-page-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: block;
  padding: 0;
  background: rgba(18, 25, 34, 0.5);
  backdrop-filter: blur(8px);
}

.account-page-overlay[hidden],
.help-page-overlay[hidden] {
  display: none;
}

.account-page-dialog,
.help-page-dialog {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: transparent;
}

.account-page-frame-wrap,
.help-page-frame-wrap {
  width: 100%;
  height: 100%;
}

.account-page-frame-wrap iframe,
.help-page-frame-wrap iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
}

.account-page-title,
.help-page-title {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.account-auth-dialog {
  position: relative;
  width: min(100%, 640px);
  max-height: min(720px, calc(100vh - 40px));
  overflow: auto;
  padding: 34px;
  border: 1px solid rgba(148, 163, 184, 0.36);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 30px 90px rgba(15, 23, 42, 0.34);
}

.account-auth-dialog[data-account-view="logout"] {
  width: min(100%, 590px);
}

.account-auth-close {
  position: absolute;
  top: 24px;
  right: 24px;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: #637083;
  font-size: 0;
  line-height: 1;
  box-shadow: 0 8px 20px rgba(16, 24, 40, 0.08);
  cursor: pointer;
}

.account-auth-close:hover {
  border-color: #2563eb;
  color: #1747b8;
}

.account-auth-header {
  display: grid;
  grid-template-columns: 112px 1fr;
  align-items: center;
  gap: 26px;
  margin-bottom: 30px;
  padding-right: 54px;
}

.account-auth-hero-icon {
  display: grid;
  place-items: center;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0) 38%),
    #dfeee8;
  color: #08725d;
}

.account-auth-hero-icon::before,
.account-auth-hero-icon::after {
  content: "";
  display: block;
  position: absolute;
}

.account-auth-hero-icon {
  position: relative;
}

.account-auth-hero-icon::before {
  width: 34px;
  height: 34px;
  top: 33px;
  left: 38px;
  border: 5px solid currentColor;
  border-radius: 50%;
}

.account-auth-hero-icon::after {
  width: 42px;
  height: 28px;
  left: 30px;
  bottom: 31px;
  border: 5px solid currentColor;
  border-top: 0;
  border-radius: 0 0 42px 42px;
  transform: rotate(-12deg);
}

.account-auth-dialog[data-account-view="login"] .account-auth-hero-icon::after,
.account-auth-dialog[data-account-view="signup"] .account-auth-hero-icon::after,
.account-auth-dialog[data-account-view="reset"] .account-auth-hero-icon::after {
  box-shadow: 34px 0 0 -12px #dfeee8, 34px 0 0 -7px currentColor;
}

.account-auth-dialog[data-account-view="logout"] .account-auth-hero-icon::before {
  width: 30px;
  height: 44px;
  top: 34px;
  left: 33px;
  border: 5px solid currentColor;
  border-right: 0;
  border-radius: 8px 0 0 8px;
}

.account-auth-dialog[data-account-view="logout"] .account-auth-hero-icon::after {
  width: 40px;
  height: 18px;
  left: 52px;
  top: 47px;
  border: 0;
  border-top: 5px solid currentColor;
  border-right: 5px solid currentColor;
  border-radius: 0;
  transform: rotate(45deg);
}

.account-auth-header h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(34px, 4.6vw, 44px);
  line-height: 1.04;
  font-weight: 900;
  letter-spacing: 0;
}

.account-auth-header p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.45;
  max-width: 380px;
}

.account-auth-message {
  margin-bottom: 14px;
  padding: 11px 12px;
  border-radius: 8px;
  background: #edf4ff;
  color: #1747b8;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}

.account-auth-message.is-error {
  background: #fff0ee;
  color: #b42318;
}

.account-auth-message.is-success {
  background: #ebf8f4;
  color: #0f6f5f;
}

.account-auth-form {
  display: none;
  gap: 20px;
}

.account-auth-form.is-active {
  display: grid;
}

.account-auth-form label {
  display: grid;
  gap: 9px;
}

.account-auth-form label > span {
  color: var(--ink);
  font-size: 16px;
  font-weight: 850;
}

.account-auth-form em,
.account-auth-form small {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
}

.account-auth-form input {
  width: 100%;
  min-height: 54px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 18px;
}

.account-auth-form input:focus {
  border-color: #08725d;
  outline: 3px solid rgba(31, 122, 104, 0.16);
}

.account-auth-field {
  position: relative;
  display: block;
}

.account-auth-field input {
  padding-left: 52px;
  padding-right: 52px;
}

.account-auth-field-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  width: 24px;
  height: 24px;
  color: #465260;
  font-size: 0;
  transform: translateY(-50%);
  pointer-events: none;
}

.account-auth-field-icon::before {
  content: "";
  position: absolute;
  inset: 3px 1px;
  border: 2px solid currentColor;
  border-radius: 3px;
}

.account-auth-field-icon::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 7px;
  width: 14px;
  height: 9px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
}

label:nth-of-type(2) .account-auth-field-icon::before {
  top: 9px;
  height: 12px;
  border-radius: 2px;
}

label:nth-of-type(2) .account-auth-field-icon::after {
  left: 6px;
  top: 1px;
  width: 10px;
  height: 12px;
  border: 2px solid currentColor;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  transform: none;
}

.account-auth-field-ok {
  position: absolute;
  right: 19px;
  top: 50%;
  width: 20px;
  height: 12px;
  border-left: 4px solid #08725d;
  border-bottom: 4px solid #08725d;
  transform: translateY(-62%) rotate(-45deg);
  pointer-events: none;
}

.account-auth-field-eye {
  position: absolute;
  right: 17px;
  top: 50%;
  width: 25px;
  height: 16px;
  border: 2px solid #465260;
  border-radius: 50% 50% 50% 50% / 65% 65% 65% 65%;
  transform: translateY(-50%);
  pointer-events: none;
}

.account-auth-field-eye::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 4px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #465260;
}

.account-auth-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.account-auth-options button {
  padding: 0;
  border: 0;
  background: transparent;
  color: #08725d;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}

.account-auth-checkbox {
  display: inline-flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 10px !important;
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
}

.account-auth-checkbox input {
  width: 24px;
  min-height: 24px;
  height: 24px;
  accent-color: #08725d;
}

.account-auth-confirm-text {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 16px;
  margin: 0;
  padding: 22px;
  border: 1px solid #b8d9d0;
  border-radius: 9px;
  background: #eff8f5;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.6;
}

.account-auth-confirm-text span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #08725d;
  color: #fff;
}

.account-auth-confirm-text span::before {
  content: "";
  width: 14px;
  height: 8px;
  border-left: 3px solid currentColor;
  border-bottom: 3px solid currentColor;
  transform: rotate(-45deg) translate(1px, -1px);
}

.account-auth-form .primary-button {
  min-height: 58px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, #08725d, #00684f);
  color: #fff;
  box-shadow: 0 16px 28px rgba(0, 104, 79, 0.22);
  font-size: 18px;
  font-weight: 900;
}

.account-auth-form .primary-button:hover {
  background: linear-gradient(135deg, #09856c, #08725d);
}

.account-auth-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.account-auth-button-icon {
  position: relative;
  width: 26px;
  height: 26px;
}

.account-auth-button-icon::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 3px;
  width: 13px;
  height: 13px;
  border: 3px solid currentColor;
  border-radius: 50%;
}

.account-auth-button-icon::after {
  content: "";
  position: absolute;
  left: 1px;
  bottom: 2px;
  width: 18px;
  height: 11px;
  border: 3px solid currentColor;
  border-top: 0;
  border-radius: 0 0 18px 18px;
}

.account-auth-actions {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 28px;
  padding-top: 24px;
  border-top: 1px solid #d8dee8;
}

.account-auth-secondary {
  min-height: 58px;
  border: 1px solid #bfc9d8;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
}

.account-auth-secondary:hover {
  border-color: #08725d;
  color: #08725d;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.account-auth-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 10px;
  padding-top: 22px;
  border-top: 1px solid #d8dee8;
}

.account-auth-links button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #08725d;
  font: inherit;
  font-size: 16px;
  font-weight: 850;
  cursor: pointer;
}

.account-auth-links button::before {
  content: "+";
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  color: #08725d;
  font-size: 28px;
  font-weight: 500;
  line-height: 1;
}

.account-auth-links button[data-account-view-button="resend"]::before {
  content: "";
  width: 22px;
  height: 16px;
  border: 2px solid currentColor;
  border-radius: 3px;
}

@media (max-width: 640px) {
  .account-auth-dialog {
    padding: 28px 20px;
  }

  .account-auth-header {
    grid-template-columns: 78px 1fr;
    gap: 16px;
    margin-bottom: 22px;
    padding-right: 44px;
  }

  .account-auth-hero-icon {
    width: 78px;
    height: 78px;
  }

  .account-auth-hero-icon::before {
    width: 24px;
    height: 24px;
    top: 23px;
    left: 27px;
    border-width: 4px;
  }

  .account-auth-hero-icon::after {
    width: 30px;
    height: 20px;
    left: 22px;
    bottom: 20px;
    border-width: 4px;
  }

  .account-auth-header h2 {
    font-size: 30px;
  }

  .account-auth-header p {
    font-size: 15px;
  }

  .account-auth-options,
  .account-auth-links {
    align-items: flex-start;
    flex-direction: column;
  }

  .account-auth-actions {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

.account-auth-links button:hover {
  text-decoration: underline;
}

.account-auth-close::before,
.account-auth-close::after,
.account-auth-hero-icon::before,
.account-auth-hero-icon::after,
.account-auth-field-icon::before,
.account-auth-field-icon::after,
.account-auth-field-ok::before,
.account-auth-field-ok::after,
.account-auth-field-eye::before,
.account-auth-field-eye::after,
.account-auth-button-icon::before,
.account-auth-button-icon::after,
.account-auth-confirm-text span::before,
.account-auth-links button::before {
  display: none !important;
  content: none !important;
}

.account-auth-close img {
  display: block;
  width: 20px;
  height: 20px;
}

.account-auth-hero-icon img,
.account-auth-field-icon img,
.account-auth-field-ok img,
.account-auth-field-eye img,
.account-auth-button-icon img,
.account-auth-confirm-text img,
.account-auth-links img,
.account-auth-checkbox img {
  display: block;
  max-width: 100%;
  max-height: 100%;
}

.account-auth-hero-icon {
  position: relative;
  overflow: hidden;
}

.account-auth-hero-icon img {
  width: 78px;
  height: 78px;
  object-fit: contain;
}

.account-auth-hero-logout {
  display: none !important;
}

.account-auth-dialog[data-account-view="logout"] .account-auth-hero-login {
  display: none !important;
}

.account-auth-dialog[data-account-view="logout"] .account-auth-hero-logout {
  display: block !important;
}

.account-auth-field-icon,
.account-auth-field-ok,
.account-auth-field-eye,
.account-auth-button-icon {
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  transform: translateY(-50%);
}

.account-auth-field-icon img {
  width: 24px;
  height: 24px;
}

.account-auth-field-ok {
  width: 24px;
  height: 24px;
  transform: translateY(-50%);
}

.account-auth-field-ok img {
  width: 22px;
  height: 22px;
}

.account-auth-field-eye {
  width: 28px;
  height: 28px;
}

.account-auth-field-eye img {
  width: 26px;
  height: 26px;
}

.account-auth-checkbox {
  position: relative;
}

.account-auth-checkbox input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.account-auth-checkbox img {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
}

.account-auth-checkbox input:not(:checked) + img {
  opacity: 0.28;
  filter: grayscale(1);
}

.account-auth-button-icon {
  position: static;
  width: 28px;
  height: 28px;
  transform: none;
}

.account-auth-button-icon img {
  width: 28px;
  height: 28px;
}

.account-auth-confirm-text span img {
  width: 34px;
  height: 34px;
}

.account-auth-links img {
  width: 28px;
  height: 28px;
}

.top-left {
  min-width: 190px;
}

.site-logo-link {
  display: block;
  width: 190px;
  height: 54px;
  background: url("/projects/assets/brand/vectormaps_logo.svg") left center / contain no-repeat;
  flex: 0 0 auto;
}

.site-logo-link:focus-visible {
  outline: 3px solid rgba(20, 89, 255, 0.28);
  outline-offset: 4px;
  border-radius: 8px;
}

.top-bar .top-left > .back-button,
.top-bar .project-title {
  display: none;
}

.manual-payment-type {
  height: 36px;
  width: 108px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-strong);
  color: var(--ink);
  padding: 0 10px;
}

.vm-live-test-controls-hidden [data-live-test-control] {
  display: none !important;
}

.project-title {
  display: grid;
  gap: 2px;
}

.project-eyebrow {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 38px;
  min-width: 38px;
  height: 38px;
  padding: 0;
  font-size: 20px;
}

.back-button {
  font-size: 22px;
}

.start-new-map-button,
.select-area-back-button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  background: var(--panel-strong);
  color: #20252d;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0;
  box-shadow: none;
}

.preview-history-panel .start-new-map-button + .select-area-back-button {
  margin-top: 8px;
}

.start-new-map-button {
  border-color: var(--line-strong);
  background: #ffffff;
  color: #20252d;
}

.start-new-map-button:hover {
  border-color: var(--accent);
  background: #fbfcfd;
  box-shadow: 0 4px 12px rgba(28, 35, 45, 0.08);
}

.select-area-back-button:hover {
  border-color: var(--accent);
  background: #fbfcfd;
  box-shadow: 0 4px 12px rgba(28, 35, 45, 0.08);
}

.replace-map-side-button {
  background: #ffffff;
}

.select-area-back-icon {
  display: grid;
  place-items: center;
  width: 32px;
  min-width: 32px;
  height: 32px;
  border-radius: 7px;
  background: #edf5f2;
}

.start-new-map-icon {
  background: #ffffff;
}

.start-new-map-icon img,
.replace-map-icon img {
  width: 23px;
  height: 23px;
  object-fit: contain;
}

.replace-map-icon {
  width: 32px;
  min-width: 32px;
  height: 32px;
  background: #ffffff;
}

.preview-history-panel .select-area-back-icon.start-new-map-icon,
.preview-history-panel .select-area-back-icon.replace-map-icon {
  width: 32px;
  min-width: 32px;
  height: 32px;
  background: #ffffff;
}

.preview-history-panel .select-area-back-icon.start-new-map-icon img,
.preview-history-panel .select-area-back-icon.replace-map-icon img {
  width: 23px;
  height: 23px;
  object-fit: contain;
}

.select-area-back-icon img {
  display: block;
  width: 23px;
  height: 23px;
  object-fit: contain;
}

.text-button.strong {
  border-color: #b9c5ce;
  font-weight: 700;
}

.primary-button {
  border-color: var(--accent-dark);
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 9px 20px rgba(31, 122, 104, 0.22);
}

.primary-button:hover {
  border-color: var(--accent-dark);
  background: var(--accent-dark);
}

.checkout-confirm-overlay,
.order-checkout-overlay,
.payment-success-overlay,
.contact-sent-overlay,
.info-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  background: rgba(20, 25, 32, 0.62);
}

.checkout-confirm-overlay,
.payment-success-overlay,
.contact-sent-overlay,
.info-dialog-overlay {
  padding: 24px;
}

.checkout-confirm-overlay[hidden],
.order-checkout-overlay[hidden],
.payment-success-overlay[hidden],
.contact-sent-overlay[hidden],
.info-dialog-overlay[hidden] {
  display: none;
}

.order-checkout-overlay {
  background: rgba(20, 25, 32, 0.22);
}

.order-checkout-overlay iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
}

.checkout-confirm-dialog {
  position: relative;
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 20px 24px;
  width: min(620px, 100%);
  padding: 30px;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.24);
}

.checkout-confirm-close {
  position: absolute;
  top: 20px;
  right: 20px;
  display: inline-grid;
  place-items: center;
  width: 44px;
  min-width: 44px;
  height: 44px;
  padding: 0;
  font-size: 24px;
  line-height: 1;
}

.checkout-confirm-warning {
  width: 112px;
  max-width: 100%;
  align-self: start;
}

.checkout-confirm-copy {
  padding-right: 22px;
}

.checkout-confirm-copy h2 {
  margin: 0 0 10px;
  font-size: 24px;
  line-height: 1.15;
}

.checkout-confirm-copy p {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.5;
}

.checkout-confirm-copy p:last-child {
  margin-bottom: 0;
}

.checkout-confirm-check {
  grid-column: 1 / -1;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f8fa;
  color: #303842;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
}

.checkout-confirm-check input {
  width: 18px;
  min-width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--accent);
}

.checkout-confirm-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.checkout-confirm-actions .primary-button:disabled {
  border-color: #aeb8c3;
  background: #aeb8c3;
  box-shadow: none;
  cursor: not-allowed;
}

.payment-success-dialog,
.contact-sent-dialog {
  width: min(420px, 100%);
  padding: 28px;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.24);
  text-align: center;
}

.payment-success-dialog {
  position: relative;
  display: grid;
  gap: 14px;
  width: min(980px, 100%);
  max-height: min(760px, calc(100vh - 28px));
  overflow: auto;
  padding: 28px 32px 32px;
  text-align: left;
}

.payment-success-dialog h2,
.contact-sent-dialog h2 {
  margin: 0 0 10px;
  font-size: 24px;
}

.payment-success-dialog p,
.contact-sent-dialog p {
  margin: 0 0 22px;
  color: var(--muted);
  line-height: 1.5;
}

.payment-success-close {
  position: absolute;
  top: 20px;
  right: 20px;
  display: inline-grid;
  place-items: center;
  width: 44px;
  min-width: 44px;
  height: 44px;
  padding: 0;
  font-size: 26px;
  line-height: 1;
}

.payment-success-close:disabled,
.payment-address-copy .primary-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.payment-confirmation-header {
  padding-right: 58px;
}

.payment-confirmation-title-row {
  display: flex;
  align-items: center;
  gap: 20px;
}

.payment-confirmation-header h2 {
  margin: 0;
  font-size: 32px;
  line-height: 1.1;
}

.payment-confirmation-header p:last-child,
.payment-address-panel p,
.payment-resource-note {
  margin: 0;
}

.payment-status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  margin: 0;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 900;
  text-transform: uppercase;
}

.payment-status-badge.is-success {
  background: #e7f6ef;
  color: #146349;
}

.payment-status-badge.is-pending {
  background: #fff3d1;
  color: #7a4f00;
}

.payment-status-badge.is-failed {
  background: #fde8e8;
  color: #9b1c1c;
}

.payment-confirmation-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 16px;
}

.payment-confirmation-panel {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.payment-confirmation-panel h3 {
  margin: 0 0 18px;
  color: var(--ink);
  font-size: 18px;
}

.payment-summary-list,
.payment-totals-list {
  display: grid;
  gap: 18px;
  margin: 0;
}

.payment-summary-list div,
.payment-totals-list div {
  display: grid;
  grid-template-columns: minmax(155px, 0.72fr) minmax(0, 1.28fr);
  gap: 18px;
  align-items: start;
}

.payment-summary-list dt,
.payment-totals-list dt {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
}

.payment-summary-list dd,
.payment-totals-list dd {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.35;
}

.payment-total-row {
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.payment-total-row dd {
  font-size: 28px;
}

.payment-order-reference {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  min-width: 170px;
  padding: 3px 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: #f3f6f8;
}

.payment-order-reference.is-preparing {
  border-color: #87d3b3;
  background:
    linear-gradient(90deg, rgba(87, 174, 139, 0.36), rgba(38, 132, 94, 0.54)) left / 0% 100% no-repeat,
    #eef9f3;
  color: #174f3b;
  animation: paymentPreparingGauge 2.2s linear infinite;
}

.payment-order-reference.is-complete {
  background: #e7f6ef;
  color: #146349;
}

.payment-order-reference.is-error {
  background: #fde8e8;
  color: #9b1c1c;
}

@keyframes paymentPreparingGauge {
  0% {
    background-size: 0% 100%, 100% 100%;
  }

  85% {
    background-size: 100% 100%, 100% 100%;
  }

  100% {
    background-size: 100% 100%, 100% 100%;
  }
}

.payment-resource-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 34px;
}

.payment-resource-links:empty {
  display: none;
}

.payment-resource-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 9px 14px;
  border: 1px solid var(--accent);
  border-radius: 7px;
  background: #ffffff;
  color: var(--accent-dark);
  font-size: 15px;
  font-weight: 900;
  text-decoration: none;
}

.payment-resource-links a:hover {
  background: var(--accent-soft);
}

.payment-resource-links a.is-disabled,
.payment-resource-links a.is-disabled:hover {
  border-color: #c7d3e2;
  background: #eef3f8;
  color: #7a8797;
  cursor: not-allowed;
  opacity: 0.74;
  pointer-events: auto;
}

.payment-resource-note {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.payment-address-panel {
  display: grid;
  gap: 14px;
}

.payment-address-panel[hidden] {
  display: none;
}

.payment-address-picker {
  display: grid;
  grid-template-columns: 180px minmax(260px, 420px);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid #dbe7f7;
  border-radius: 8px;
  background: #f4f8ff;
}

.payment-address-picker[hidden] {
  display: none;
}

.payment-address-picker label {
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
}

.payment-address-picker select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 6px 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.payment-address-picker select:focus {
  outline: 3px solid rgba(37, 99, 235, 0.16);
  border-color: #2563eb;
}

.payment-address-form {
  display: grid;
  gap: 8px;
}

.payment-address-form label {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
}

.payment-address-form input {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 6px 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.payment-address-form input:focus {
  outline: 3px solid rgba(31, 122, 104, 0.14);
  border-color: var(--accent);
}

.payment-address-content {
  display: grid;
  grid-template-columns: minmax(420px, 0.95fr) minmax(300px, 1.05fr);
  gap: 34px;
  align-items: start;
}

.payment-address-copy {
  display: grid;
  gap: 28px;
  align-content: start;
}

.payment-address-copy p {
  max-width: 430px;
  color: var(--ink);
  font-size: 21px;
  line-height: 1.25;
}

.payment-address-copy .primary-button {
  justify-self: start;
  min-height: 42px;
  font-size: 16px;
}

.payment-address-status {
  min-height: 18px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.payment-address-status.is-error {
  color: #b42318;
}

.info-dialog {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(760px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.24);
}

.info-dialog-close {
  position: absolute;
  top: 20px;
  right: 20px;
  display: inline-grid;
  place-items: center;
  width: 44px;
  min-width: 44px;
  height: 44px;
  padding: 0;
  font-size: 24px;
  line-height: 1;
}

.info-dialog-header {
  padding: 30px 34px 18px;
  border-bottom: 1px solid var(--line);
}

.info-dialog-eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.info-dialog-header h2 {
  max-width: calc(100% - 48px);
  margin: 0;
  color: #1f2630;
  font-size: 25px;
  line-height: 1.16;
}

.info-dialog-body {
  min-height: 0;
  overflow: auto;
  padding: 24px 34px 32px;
  color: #303842;
  line-height: 1.58;
}

.info-dialog-body h3 {
  margin: 22px 0 8px;
  color: #20252d;
  font-size: 15px;
  line-height: 1.25;
}

.info-dialog-body h3:first-child {
  margin-top: 0;
}

.info-dialog-body p {
  margin: 0 0 12px;
  color: #56606c;
}

.faq-dialog-body {
  background: linear-gradient(#ffffff, #fbfcfd);
}

.faq-intro {
  padding: 16px 18px;
  border: 1px solid #cfe1db;
  border-radius: 8px;
  background: #f1faf7;
  color: #263c37;
  font-size: 14px;
  font-weight: 700;
}

.faq-section {
  padding: 18px 0 8px;
  border-bottom: 1px solid var(--line);
}

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

.faq-section h3 {
  margin: 0 0 12px;
  color: #20252d;
  font-size: 16px;
}

.faq-item {
  padding: 15px 16px;
  margin: 0 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 6px 18px rgba(28, 35, 45, 0.045);
}

.faq-item h4 {
  margin: 0 0 9px;
  color: #20252d;
  font-size: 14px;
  line-height: 1.32;
}

.faq-item p {
  margin-bottom: 10px;
}

.faq-item p:last-child,
.faq-item ul:last-child {
  margin-bottom: 0;
}

.faq-item ul {
  display: grid;
  gap: 6px;
  margin: 0 0 12px;
  padding: 0;
  color: #56606c;
  list-style: none;
}

.faq-item li {
  position: relative;
  padding-left: 18px;
}

.faq-item li::before {
  position: absolute;
  left: 0;
  top: 0.58em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  content: "";
}

.legal-dialog-body {
  background: linear-gradient(#ffffff, #fbfcfd);
}

.legal-intro {
  padding: 16px 18px;
  border: 1px solid #cfe1db;
  border-radius: 8px;
  background: #f1faf7;
  color: #263c37;
  font-size: 14px;
  font-weight: 700;
}

.legal-section {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

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

.legal-section h3 {
  margin: 0 0 10px;
  color: #20252d;
  font-size: 16px;
}

.legal-section h4 {
  margin: 0 0 8px;
  color: #303842;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

.legal-list-grid > div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.legal-list {
  display: grid;
  gap: 7px;
  margin: 0 0 14px;
  padding: 0;
  color: #56606c;
  list-style: none;
}

.legal-list li {
  position: relative;
  padding-left: 18px;
}

.legal-list li::before {
  position: absolute;
  left: 0;
  top: 0.58em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #8d98a5;
  content: "";
}

.legal-list-positive li::before {
  background: var(--accent);
}

.legal-list-negative li::before {
  background: var(--danger);
}

.legal-contact-note {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f8fa;
}

.info-dialog-image-placeholder {
  display: grid;
  place-items: center;
  min-height: 160px;
  margin: 20px 0 0;
  border: 1px dashed #aeb8c4;
  border-radius: 8px;
  background: #f7f8fa;
  color: #68717d;
  font-size: 13px;
  font-weight: 800;
}

.contact-dialog {
  width: min(820px, 100%);
}

.contact-dialog-grid {
  display: grid;
  grid-template-columns: minmax(190px, 0.75fr) minmax(0, 1.25fr);
  gap: 24px;
}

.contact-details {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f8fa;
  color: #56606c;
  font-style: normal;
  line-height: 1.45;
}

.contact-details strong {
  color: #20252d;
}

.contact-details a {
  color: var(--accent-dark);
  font-weight: 800;
  text-decoration: none;
}

.contact-form {
  display: grid;
  gap: 14px;
}

.contact-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.account-page-close,
.help-page-close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  line-height: 1;
}

.contact-form label {
  display: grid;
  gap: 7px;
  color: #4b5563;
  font-size: 12px;
  font-weight: 800;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
}

.contact-form input {
  height: 40px;
  padding: 0 11px;
}

.contact-form textarea {
  min-height: 150px;
  padding: 10px 11px;
  resize: vertical;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: 3px solid rgba(31, 122, 104, 0.14);
  border-color: var(--accent);
}

.contact-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

@media (max-width: 620px) {
  .checkout-confirm-dialog {
    grid-template-columns: 1fr;
    padding: 26px 22px 22px;
  }

  .checkout-confirm-warning {
    width: 76px;
  }

  .checkout-confirm-copy {
    padding-right: 0;
  }

  .checkout-confirm-actions {
    flex-direction: column-reverse;
  }

  .payment-success-overlay {
    padding: 14px;
  }

  .payment-success-dialog {
    max-height: calc(100vh - 28px);
    padding: 22px;
  }

  .payment-confirmation-grid,
  .payment-address-content {
    grid-template-columns: 1fr;
  }

  .payment-summary-list div,
  .payment-totals-list div,
  .payment-address-form label,
  .payment-address-picker {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .payment-confirmation-title-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .payment-confirmation-header h2 {
    font-size: 26px;
  }

  .payment-address-copy p {
    max-width: none;
    font-size: 17px;
  }

  .payment-resource-links {
    margin-top: 20px;
  }

  .payment-address-status {
    margin-right: 0;
  }

  .info-dialog {
    max-height: calc(100vh - 32px);
  }

  .info-dialog-header,
  .info-dialog-body {
    padding-left: 22px;
    padding-right: 22px;
  }

  .contact-dialog-grid {
    grid-template-columns: 1fr;
  }

  .legal-list-grid {
    grid-template-columns: 1fr;
  }

  .contact-form-actions {
    flex-direction: column-reverse;
  }
}

.workspace {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  min-height: 0;
}

.sidebar {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 14px;
  min-height: 0;
  overflow: hidden;
  padding: 18px 16px 28px;
  border-right: 1px solid var(--line);
  background: var(--panel-bg);
}

.sidebar-controls {
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

.sidebar-trust-footer {
  flex: none;
  padding: 12px 2px 2px;
  border-top: 1px solid var(--line);
  color: #68717d;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.45;
}

.sidebar-trust-footer p {
  margin: 0;
}

.sidebar-text-link {
  display: inline;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--accent-dark);
  font: inherit;
  font-weight: 850;
  text-decoration: underline;
  text-underline-offset: 2px;
  box-shadow: none;
}

.sidebar-text-link:hover {
  color: #124f42;
  box-shadow: none;
}

.sidebar-text-link:active {
  transform: none;
}

.inline-dialog-link {
  display: inline;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--accent-dark);
  font: inherit;
  font-weight: 850;
  text-decoration: underline;
  text-underline-offset: 2px;
  box-shadow: none;
}

.inline-dialog-link:hover {
  color: #124f42;
  box-shadow: none;
}

.inline-dialog-link:active {
  transform: none;
}

.control-section {
  padding: 0 0 10px;
  margin: 0 0 10px;
  border-bottom: 1px solid var(--line);
}

.control-section:last-child {
  margin-bottom: 0;
  border-bottom: 0;
}

.preview-history-panel {
  display: grid;
  gap: 8px;
  padding: 0 0 12px;
  margin: 0 0 12px;
  border-bottom: 1px solid var(--line);
}

.sidebar-layout-actions {
  display: grid;
  grid-template-columns: 1fr 40px 40px;
  gap: 8px;
  padding: 0 0 12px;
  margin: 0 0 12px;
  border-bottom: 1px solid var(--line);
}

.sidebar-layout-actions .text-button {
  width: 100%;
}

.sidebar-layout-actions .icon-button {
  width: 40px;
}

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

.preview-history-title {
  color: #303842;
  font-size: 13px;
  font-weight: 800;
}

.preview-history-count {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.preview-history-list {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 7px;
  min-height: 42px;
}

.preview-history-chip {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1 / 1;
  min-height: 40px;
  padding: 0;
  border: 3px solid transparent;
  border-radius: 8px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.32);
  box-shadow: none;
}

.preview-history-chip:hover {
  box-shadow: none;
}

.preview-history-chip.is-missing {
  border-color: var(--line-strong);
  background: #ffffff !important;
  color: var(--muted);
  text-shadow: none;
}

.preview-history-chip.is-selected {
  border-color: #101820;
  box-shadow: none;
  cursor: default;
}

.preview-history-chip.is-loading {
  color: transparent;
  text-shadow: none;
  cursor: wait;
}

.preview-history-chip.is-loading::after {
  content: "";
  width: 22px;
  height: 22px;
  border: 3px solid rgba(21, 119, 210, 0.22);
  border-top-color: #1577d2;
  border-radius: 50%;
  animation: preview-chip-spin 0.75s linear infinite;
}

.preview-history-chip:disabled {
  cursor: default;
}

.preview-history-chip:focus-visible {
  outline: 2px solid rgba(31, 122, 104, 0.42);
  outline-offset: 2px;
}

.spinner-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.35);
}

.spinner-overlay.is-open {
  display: flex;
}

.spinner-overlay.is-initial-load {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(2px);
}

.spinner-overlay.is-initial-load .render-gauge {
  display: grid;
  justify-items: center;
  width: min(88vw, 360px);
  padding: 30px 28px;
  text-align: center;
}

.spinner-overlay.is-initial-load .render-gauge::before {
  content: "";
  width: 72px;
  height: 72px;
  margin-bottom: 16px;
  border: 8px solid rgba(21, 119, 210, 0.18);
  border-top-color: #1577d2;
  border-radius: 50%;
  animation: preview-chip-spin 0.75s linear infinite;
}

.spinner-overlay.is-initial-load .render-gauge__title {
  margin-bottom: 8px;
  color: #1577d2;
  font-size: 18px;
}

.spinner-overlay.is-initial-load .render-gauge__log {
  width: 100%;
  min-height: 0;
  max-height: none;
  border: 0;
  background: transparent;
  color: #2d333b;
  font-weight: 700;
}

.spinner-overlay.is-initial-load .render-gauge__bar {
  width: 100%;
}

.render-gauge {
  width: min(92vw, 680px);
  padding: 14px 16px;
  border: 2px solid var(--accent);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow-tight);
  text-align: left;
}

.render-gauge__title {
  margin-bottom: 8px;
  color: #2d333b;
  font-size: 14px;
  font-weight: 800;
}

.render-gauge__log {
  max-height: 240px;
  min-height: 180px;
  overflow-y: auto;
  margin-bottom: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fafc;
  color: #111827;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.45;
}

.render-gauge__meta {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.render-gauge__bar {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5e7eb;
}

.render-gauge__fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 160ms ease;
}

.replace-map-overlay,
.preview-size-overlay {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(20, 25, 32, 0.62);
}

.replace-map-overlay[hidden],
.preview-size-overlay[hidden] {
  display: none;
}

.replace-map-dialog,
.preview-size-dialog {
  position: relative;
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 18px 22px;
  width: min(560px, 100%);
  padding: 28px;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.24);
}

.replace-map-dialog {
  display: block;
  width: min(620px, 100%);
  padding: 30px;
  border: 1px solid rgba(214, 224, 236, 0.95);
  box-shadow: 0 28px 76px rgba(15, 23, 42, 0.26);
}

.replace-map-close,
.preview-size-close {
  position: absolute;
  top: 20px;
  right: 20px;
  display: inline-grid;
  place-items: center;
  width: 44px;
  min-width: 44px;
  height: 44px;
  padding: 0;
  font-size: 24px;
  line-height: 1;
}

.replace-map-header {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 16px;
  padding-right: 48px;
}

.replace-map-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 15px;
  background: #eaf2ff;
  color: #2563eb;
}

.replace-map-icon svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.replace-map-header h2 {
  margin: 0;
  color: #101828;
  font-size: clamp(28px, 4vw, 38px);
  line-height: 1.05;
  letter-spacing: 0;
}

.replace-map-header p {
  margin: 8px 0 0;
  color: #53627c;
  font-size: 16px;
  line-height: 1.5;
}

.replace-map-options {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.replace-map-option {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 18px;
  border: 1px solid #dbe5f2;
  border-radius: 12px;
  background: #fbfdff;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.replace-map-option:hover,
.replace-map-option:focus-within {
  border-color: #2563eb;
  background: #f7fbff;
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.12);
}

.replace-map-option input {
  margin-top: 3px;
  accent-color: #2563eb;
}

.replace-map-option strong {
  display: block;
  color: #101828;
  font-size: 16px;
}

.replace-map-option small {
  display: block;
  margin-top: 4px;
  color: #66758f;
  font-size: 14px;
  line-height: 1.35;
}

.replace-map-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 26px;
}

.checkout-confirm-close,
.payment-success-close,
.info-dialog-close,
.replace-map-close,
.preview-size-close,
.account-page-close,
.help-page-close,
.account-auth-close {
  border: 1px solid #d6e0ec;
  border-radius: 50%;
  background: #fff;
  color: #637083;
  box-shadow: 0 8px 20px rgba(16, 24, 40, 0.08);
  cursor: pointer;
}

.checkout-confirm-close:hover,
.payment-success-close:hover,
.info-dialog-close:hover,
.replace-map-close:hover,
.preview-size-close:hover,
.account-page-close:hover,
.help-page-close:hover,
.account-auth-close:hover {
  border-color: #2563eb;
  color: #1747b8;
}

.checkout-confirm-close,
.payment-success-close,
.info-dialog-close,
.replace-map-close,
.preview-size-close,
.account-page-close,
.help-page-close,
.account-auth-close {
  font-size: 0;
  position: absolute;
  display: grid;
  place-items: center;
}

.checkout-confirm-close::before,
.checkout-confirm-close::after,
.payment-success-close::before,
.payment-success-close::after,
.info-dialog-close::before,
.info-dialog-close::after,
.replace-map-close::before,
.replace-map-close::after,
.preview-size-close::before,
.preview-size-close::after,
.account-page-close::before,
.account-page-close::after,
.help-page-close::before,
.help-page-close::after,
.account-auth-close::before,
.account-auth-close::after {
  position: absolute;
  width: 16px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  content: "";
}

.checkout-confirm-close::before,
.payment-success-close::before,
.info-dialog-close::before,
.replace-map-close::before,
.preview-size-close::before,
.account-page-close::before,
.help-page-close::before,
.account-auth-close::before {
  transform: rotate(45deg);
}

.checkout-confirm-close::after,
.payment-success-close::after,
.info-dialog-close::after,
.replace-map-close::after,
.preview-size-close::after,
.account-page-close::after,
.help-page-close::after,
.account-auth-close::after {
  transform: rotate(-45deg);
}

@media (max-width: 560px) {
  .replace-map-dialog {
    padding: 24px;
  }

  .replace-map-header {
    grid-template-columns: 1fr;
    padding-right: 44px;
  }

  .replace-map-actions {
    flex-direction: column-reverse;
  }

  .replace-map-actions .primary-button,
  .replace-map-actions .text-button {
    width: 100%;
    justify-content: center;
  }
}

.preview-size-warning {
  width: 86px;
  max-width: 100%;
}

.preview-size-copy {
  padding-right: 18px;
}

.preview-size-copy h2 {
  margin: 0 0 10px;
  font-size: 24px;
  line-height: 1.15;
}

.preview-size-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.preview-size-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.section-title {
  margin-bottom: 10px;
  color: #303842;
  font-size: 13px;
  font-weight: 800;
}

.menu-group {
  position: relative;
}

.group-toggle {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 46px;
  padding: 0 10px;
  border-color: var(--line-strong);
  background: var(--panel-strong);
  text-align: left;
}

.menu-group.is-open .group-toggle {
  border-color: var(--accent);
  border-bottom-color: var(--line-strong);
  border-bottom-right-radius: 0;
  border-bottom-left-radius: 0;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 800;
}

.group-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: #edf5f2;
  color: var(--accent-dark);
}

.group-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.group-title {
  min-width: 0;
  padding-right: 38px;
  overflow: hidden;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu-group-help {
  position: absolute;
  top: 8px;
  right: 38px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.menu-group-help img {
  display: block;
  width: 30px;
  height: 30px;
}

.menu-group-help:hover,
.menu-group-help:focus-visible {
  filter: brightness(0.96) saturate(1.08);
  outline: none;
  transform: translateY(-1px);
}

.hamburger-icon {
  display: grid;
  gap: 3px;
  justify-self: end;
  width: 16px;
}

.hamburger-icon span {
  display: block;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.72;
}

.group-panel {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 220ms ease, opacity 160ms ease;
}

.menu-group.is-open .group-panel {
  max-height: 760px;
  border: 1px solid var(--line-strong);
  border-top: 0;
  border-radius: 0 0 7px 7px;
  background: #eef4f2;
  opacity: 1;
}

.group-panel-inner {
  padding: 12px 10px 10px;
}

.group-panel-inner > .field-control:first-child,
.group-panel-inner > .range-control:first-child,
.group-panel-inner > .colour-control:first-child,
.group-panel-inner > .switch-row:first-child,
.group-panel-inner > .theme-grid:first-child,
.group-panel-inner > .text-object-controls:first-child {
  margin-top: 0;
}

.group-panel-inner > .text-object-controls:last-child {
  margin-bottom: 0;
}

.button-grid {
  display: grid;
  gap: 8px;
}

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

.button-grid.three {
  grid-template-columns: repeat(3, 1fr);
}

.stacked-buttons {
  display: grid;
  gap: 8px;
}

.button-grid + .stacked-buttons {
  margin-top: 8px;
}

.export-links {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

.export-links:empty {
  display: none;
}

.export-links a {
  display: block;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.export-links a:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.export-loading {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.export-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #d8dee6;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: export-spin 720ms linear infinite;
}

@keyframes export-spin {
  to {
    transform: rotate(360deg);
  }
}

.compact-theme-grid {
  margin: 10px 0 0;
}

.text-object-controls {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.text-object-control {
  display: grid;
  gap: 6px;
}

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

.text-entry-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.text-entry-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.text-object-control input[type="text"] {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
}

.advanced-textbox-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 8px;
  margin-top: 8px;
}

.advanced-textbox-visible-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 74px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.advanced-textbox-visible-toggle input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.advanced-textbox-visible-toggle:has(input:disabled) {
  color: var(--muted);
  opacity: 0.64;
}

.speech-controls {
  display: grid;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.field-control.compact {
  margin-top: 0;
}

.field-control input[type="text"] {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
}

.tail-control,
.tail-style-control {
  grid-template-columns: repeat(4, 1fr);
  margin: 0;
}

.tail-style-control {
  grid-template-columns: repeat(2, 1fr);
}

.tail-control button,
.tail-style-control button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 6px;
  gap: 5px;
  font-size: 12px;
}

.tail-style-icon {
  width: 30px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tail-style-icon circle {
  fill: currentColor;
  stroke: none;
}

.advanced-textbox-add-card {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.advanced-textbox-add-card strong {
  font-size: 13px;
}

.advanced-textbox-add-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
}

.speech-fit-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.speech-fit-actions button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.speech-fit-actions button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.speech-manual-height-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.speech-overflow-warning {
  display: none;
  padding: 8px 10px;
  border: 1px solid rgba(184, 63, 55, 0.34);
  border-radius: 7px;
  background: rgba(184, 63, 55, 0.08);
  color: #8e2f29;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.3;
}

.speech-overflow-warning.is-visible {
  display: block;
}

.mini-range-control {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.text-object-control input[type="text"]:focus,
.field-control input[type="text"]:focus,
select:focus,
input[type="color"]:focus {
  outline: 2px solid rgba(31, 122, 104, 0.22);
  border-color: var(--accent);
}

.wide-button {
  width: 100%;
}

.danger-button {
  border-color: #e1b5af;
  background: #fff6f4;
  color: #9d2f25;
  font-weight: 800;
}

.danger-button:hover {
  border-color: #d44b3e;
  background: #fff1ee;
}

.danger-button:disabled {
  border-color: var(--line);
  background: var(--panel-strong);
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.62;
  box-shadow: none;
}

.icon-text-button,
.icon-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.button-icon {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

.button-icon circle {
  fill: currentColor;
  stroke: none;
}

.filetype-icon text {
  fill: currentColor;
  stroke: none;
  font-family: Arial, sans-serif;
  font-size: 5px;
  font-weight: 900;
  text-anchor: middle;
}

.toggle-button[aria-pressed="true"],
.theme-grid button.active,
.segmented-control button.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 800;
}

.marker-type-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.marker-controls button {
  height: 42px;
  font-size: 22px;
}

.marker-controls button[data-marker="label-dot"] {
  font-size: 15px;
  font-weight: 900;
}

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

.marker-settings label {
  display: grid;
  grid-template-columns: minmax(88px, 1fr) minmax(0, 1.25fr);
  gap: 10px;
  align-items: center;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.marker-settings input[type="range"] {
  width: 100%;
}

.marker-settings input[type="text"],
.marker-settings input[type="color"] {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.marker-settings input[type="text"] {
  padding: 0 10px;
  text-transform: uppercase;
}

.marker-settings input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.theme-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 13px;
}

.theme-grid button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.theme-swatch {
  display: inline-grid;
  grid-template-columns: repeat(3, 1fr);
  width: 30px;
  height: 24px;
  overflow: hidden;
  border-radius: 2px;
  box-shadow: inset 0 0 0 1px rgba(32, 37, 45, 0.12);
}

.colour-swatch span:nth-child(1) {
  background: #d23b32;
}

.colour-swatch span:nth-child(2) {
  background: #fff23c;
}

.colour-swatch span:nth-child(3) {
  background: #9ac64a;
}

.greyscale-swatch span:nth-child(1) {
  background: #74777a;
}

.greyscale-swatch span:nth-child(2) {
  background: #a5a8ab;
}

.greyscale-swatch span:nth-child(3) {
  background: #d8dade;
}

.range-control,
.field-control,
.colour-control,
.switch-row {
  display: grid;
  gap: 7px;
  margin-top: 13px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.switch-row {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.switch-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.map-only-orientation-message {
  display: none;
  grid-column: 1 / -1;
  margin-top: 2px;
  padding: 9px 10px;
  border: 1px solid #bfdbfe;
  border-radius: 7px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
}

.map-only-orientation-message.is-visible {
  display: block;
}

.border-range-control {
  grid-template-columns: 54px 1fr;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.inline-colour-control {
  grid-template-columns: 38px 1fr;
  align-items: center;
  margin-top: 10px;
}

.colour-control-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  margin-top: 10px;
}

.colour-control-row .inline-colour-control {
  margin-top: 0;
}

.colour-control-row .inline-colour-control span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inline-colour-control input[type="color"] {
  width: 38px;
}

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

input[type="color"] {
  width: 100%;
  height: 38px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  cursor: pointer;
}

select {
  width: 100%;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
}

.segmented-control {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  margin: 12px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #edf0f3;
}

.segmented-control button {
  border-color: transparent;
  background: transparent;
}

.orientation-control {
  grid-template-columns: repeat(3, 1fr);
}

.orientation-button {
  display: grid;
  place-items: center;
  min-height: 34px;
  padding: 0;
}

.orientation-icon {
  position: relative;
  display: block;
  border: 2px solid currentColor;
  border-radius: 3px;
  background: #fff;
  overflow: hidden;
}

.orientation-icon::before {
  position: absolute;
  top: 0;
  right: 0;
  width: 9px;
  height: 9px;
  background: linear-gradient(225deg, #d9dee5 0 48%, currentColor 49% 56%, transparent 57%);
  clip-path: polygon(100% 0, 100% 100%, 0 0);
  content: "";
}

.orientation-icon::after {
  position: absolute;
  top: 1px;
  right: 1px;
  width: 7px;
  height: 7px;
  border-left: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  opacity: 0.55;
  content: "";
}

.portrait-icon {
  width: 14px;
  height: 22px;
}

.landscape-icon {
  width: 24px;
  height: 15px;
}

.square-icon {
  width: 19px;
  height: 19px;
}

.upload-button {
  display: grid;
  place-items: center;
  height: 40px;
  border: 1px dashed #aeb8c4;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.upload-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.stage-panel {
  --paper-grid-size: 22px;
  --paper-grid-major-size: 110px;
  display: grid;
  grid-template-rows: 1fr;
  min-width: 0;
  min-height: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.34) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.3) 1px, transparent 1px),
    #b4bdc8;
  background-size: var(--paper-grid-size) var(--paper-grid-size);
}

.stage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 26px;
  border-bottom: 1px solid rgba(119, 131, 146, 0.28);
  background: rgba(228, 232, 237, 0.72);
}

/* refactored with chatGPT - 15 May 2026, UK time */
.stage-header-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.stage-orientation-control {
  width: 160px;
  min-width: 160px;
  margin: 0;
  gap: 5px;
}

.stage-page-size-control {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #56606c;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.stage-page-size-control select {
  width: 92px;
  height: 34px;
  padding: 0 8px;
  font-size: 13px;
  font-weight: 800;
}

.stage-hint {
  max-width: 48ch;
  color: #56606c;
  font-size: 13px;
  text-align: right;
}

.stage-viewport {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  padding: 16px;
  overflow: auto;
}

.artboard-shell {
  display: grid;
  gap: 4px;
  justify-items: start;
}

.artboard-size-label {
  margin-left: 42px;
  color: #4b5563;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}

.artboard-ruler-layout {
  display: grid;
  grid-template-columns: 30px 12px auto;
  grid-template-rows: 24px 12px auto;
}

.artboard-ruler,
.artboard-ruler-corner {
  position: relative;
  overflow: hidden;
  background-color: #6f7780;
  box-shadow: 2px 2px 2px gray;
}

.artboard-ruler-corner {
  grid-column: 1;
  grid-row: 1;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 12px;
  font-weight: 400;
  text-transform: uppercase;
}

.artboard-ruler-horizontal {
  grid-column: 3;
  grid-row: 1;
  min-width: 0;
  border-radius: 4px 4px 2px 2px;
}

.artboard-ruler-vertical {
  grid-column: 1;
  grid-row: 3;
  min-height: 0;
  border-radius: 4px 2px 2px 4px;
}

.ruler-tick {
  position: absolute;
  background: #fff;
}

.ruler-tick.is-major {
  background: #fff;
}

.artboard-ruler-horizontal .ruler-tick {
  bottom: 0;
  width: 1px;
  height: 6px;
}

.artboard-ruler-horizontal .ruler-tick.is-major {
  height: 12px;
}

.artboard-ruler-vertical .ruler-tick {
  right: 0;
  width: 6px;
  height: 1px;
}

.artboard-ruler-vertical .ruler-tick.is-major {
  width: 12px;
}

.ruler-label {
  position: absolute;
  color: #fff;
  font-size: 12px;
  font-weight: 400;
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
}

.artboard-ruler-horizontal .ruler-label {
  top: 2px;
  transform: translateX(-50%);
}

.artboard-ruler-horizontal .ruler-label.is-start {
  transform: none;
}

.artboard-ruler-horizontal .ruler-label.is-end {
  transform: translateX(-100%);
}

.artboard-ruler-vertical .ruler-label {
  right: 17px;
  width: 24px;
  text-align: center;
  transform: translate(50%, -50%) rotate(-90deg);
  transform-origin: center center;
}

.artboard-ruler-vertical .ruler-label.is-start {
  transform: translate(50%, 0) rotate(-90deg);
}

.artboard-ruler-vertical .ruler-label.is-end {
  top: auto !important;
  bottom: 14px;
  transform: translate(50%, 0) rotate(-90deg);
}

.artboard {
  grid-column: 3;
  grid-row: 3;
  position: relative;
  width: min(66vh, calc(100vw - var(--sidebar-width) - 96px));
  aspect-ratio: 0.707 / 1;
  min-width: 520px;
  max-width: 960px;
  border-radius: 4px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.artboard[data-page="a3"] {
  width: min(68vh, calc(100vw - var(--sidebar-width) - 96px));
}

.artboard[data-orientation="landscape"] {
  width: min(126vh, calc(100vw - var(--sidebar-width) - 64px));
  aspect-ratio: 1.414 / 1;
  max-width: 1760px;
}

.artboard[data-orientation="square"] {
  width: min(calc(100vh - var(--topbar-height) - 76px), calc(100vw - var(--sidebar-width) - 96px));
  aspect-ratio: 1 / 1;
  max-width: 1280px;
}

.artboard.map-only-mode {
  width: min(calc((100vh - var(--topbar-height) - 76px) * var(--map-only-artboard-ratio, 1)), calc(100vw - var(--sidebar-width) - 64px));
  aspect-ratio: var(--map-only-artboard-aspect, 1 / 1);
  max-width: 1760px;
}

.page-background {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 4px;
  background: var(--page-bg, #f4f1e9);
}

.map-frame {
  position: absolute;
  top: 18%;
  left: 9%;
  width: 82%;
  aspect-ratio: var(--map-frame-aspect, 1 / 1);
  overflow: visible;
  border: var(--frame-width, 8px) solid var(--frame-color, #1e252d);
  border-radius: 2px;
  background: #f8f6ee;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
  cursor: grab;
  touch-action: none;
}

.map-frame.is-preview-loading::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 12;
  width: 58px;
  height: 58px;
  margin: -29px 0 0 -29px;
  border: 6px solid rgba(21, 119, 210, 0.18);
  border-top-color: #1577d2;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  box-shadow: 0 6px 18px rgba(21, 119, 210, 0.18);
  animation: preview-chip-spin 0.75s linear infinite;
}

@keyframes preview-chip-spin {
  to {
    transform: rotate(360deg);
  }
}

.map-frame::before {
  position: absolute;
  inset: 0;
  z-index: 6;
  border: var(--frame-width, 8px) solid var(--frame-color, #1e252d);
  border-radius: 2px;
  box-sizing: border-box;
  content: "";
  pointer-events: none;
}

.map-frame.no-border {
  border-width: 0;
}

.map-frame.no-border::before {
  display: none;
}

.map-frame.selected {
  box-shadow: 0 0 0 3px rgba(21, 119, 210, 0.18), inset 0 0 0 1px rgba(255, 255, 255, 0.4);
  outline: 1px solid #1577d2;
}

body.checkout-confirm-active .artboard {
  outline: 4px solid #d52626;
  outline-offset: 7px;
  box-shadow: 0 0 0 10px rgba(213, 38, 38, 0.12), var(--shadow-tight);
}

.map-frame.map-edit-enabled {
  cursor: move;
}

.map-frame.map-edit-enabled .map-content {
  cursor: grab;
}

.map-frame.panning {
  cursor: grabbing;
}

.map-content {
  position: absolute;
  inset: var(--frame-width, 8px);
  overflow: hidden;
}

.map-frame.no-border .map-content {
  inset: 0;
}

.map-transform {
  position: absolute;
  inset: 0;
  transform: translate(var(--map-x, 0%), var(--map-y, 0%)) scale(var(--map-zoom, 1));
  transform-origin: center;
}

.map-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  pointer-events: none;
  transition: filter 160ms ease;
}

.theme-dark .map-image {
  filter: invert(0.92) saturate(0.8) hue-rotate(170deg) contrast(1.02);
}

.theme-greyscale .map-image {
  filter: grayscale(1) contrast(1.05);
}

.theme-poster .map-image {
  filter: saturate(1.6) contrast(1.16);
}

.locked-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: #4d5965;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
  pointer-events: none;
}

.page-background.map-only-mode .locked-badge {
  display: none;
}

.overlay-layer {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

.map-marker-layer {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
}

.overlay-object {
  --overlay-scale: 1;
  position: absolute;
  display: grid;
  place-items: center;
  min-width: calc(18px * var(--overlay-scale));
  min-height: calc(18px * var(--overlay-scale));
  border: 1px solid transparent;
  border-radius: 4px;
  color: #20252d;
  line-height: 1.12;
  text-align: center;
  overflow-wrap: anywhere;
  white-space: normal;
  user-select: none;
  cursor: move;
  pointer-events: auto;
}

.overlay-object.selected {
  border-color: #1577d2;
  box-shadow: 0 0 0 3px rgba(21, 119, 210, 0.18);
}

.resize-handle {
  position: absolute;
  z-index: 4;
  width: 10px;
  height: 30px;
  border: 1px solid #1577d2;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(21, 119, 210, 0.22);
  transform: translateY(-50%);
  cursor: ew-resize;
}

.resize-handle.left {
  top: 50%;
  left: -6px;
  transform: translateY(-50%);
}

.resize-handle.right {
  top: 50%;
  right: -6px;
  transform: translateY(-50%);
}

.resize-handle.top,
.resize-handle.bottom {
  left: 50%;
  width: 30px;
  height: 10px;
  cursor: ns-resize;
  transform: translateX(-50%);
}

.resize-handle.top {
  top: -6px;
}

.resize-handle.bottom {
  bottom: -6px;
}

.map-frame-handle.corner-top-left,
.map-frame-handle.corner-top-right,
.map-frame-handle.corner-bottom-left,
.map-frame-handle.corner-bottom-right {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  transform: none;
  cursor: nwse-resize;
}

.map-frame-handle.corner-top-left {
  top: -8px;
  left: -8px;
}

.map-frame-handle.corner-top-right {
  top: -8px;
  right: -8px;
  cursor: nesw-resize;
}

.map-frame-handle.corner-bottom-left {
  bottom: -8px;
  left: -8px;
  cursor: nesw-resize;
}

.map-frame-handle.corner-bottom-right {
  right: -8px;
  bottom: -8px;
}

.control-help-text {
  margin: -4px 0 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.overlay-title {
  align-content: center;
  padding: calc(2px * var(--overlay-scale)) calc(10px * var(--overlay-scale));
  font-weight: 900;
}

.overlay-subtitle {
  align-content: center;
  padding: calc(2px * var(--overlay-scale)) calc(10px * var(--overlay-scale));
  color: #505a65;
  font-weight: 700;
}

.overlay-text {
  align-content: center;
  padding: calc(9px * var(--overlay-scale)) calc(12px * var(--overlay-scale));
  background: rgba(255, 255, 255, 0.78);
  font-weight: 700;
}

.overlay-advanced-textbox {
  box-sizing: border-box;
  display: block;
  place-items: initial;
  overflow: hidden;
  border-style: solid;
  box-shadow: 0 7px 20px rgba(28, 35, 45, 0.08);
  cursor: default;
  user-select: text;
  -webkit-user-select: text;
  touch-action: auto;
}

.overlay-advanced-textbox[data-editing="true"] {
  cursor: text;
}

.overlay-advanced-textbox.has-text-overflow {
  overflow: hidden;
}

.advanced-text-move-edge {
  position: absolute;
  z-index: 2;
  display: block;
  background: transparent;
}

.advanced-text-move-edge.top,
.advanced-text-move-edge.bottom {
  left: 12px;
  right: 12px;
  height: 8px;
  cursor: move;
}

.advanced-text-move-edge.top {
  top: -4px;
}

.advanced-text-move-edge.bottom {
  bottom: -4px;
}

.advanced-text-move-edge.left,
.advanced-text-move-edge.right {
  top: 12px;
  bottom: 12px;
  width: 8px;
  cursor: move;
}

.advanced-text-move-edge.left {
  left: -4px;
}

.advanced-text-move-edge.right {
  right: -4px;
}

.overlay-advanced-textbox[data-editing="true"],
.overlay-advanced-textbox[data-editing="true"] * {
  user-select: text;
  -webkit-user-select: text;
}

.advanced-text-editor-host,
.advanced-text-content {
  width: 100%;
  height: 100%;
  min-height: 1.2em;
  outline: none;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  overflow: hidden;
  user-select: text;
  -webkit-user-select: text;
  cursor: text;
  pointer-events: auto;
}

.overlay-advanced-textbox.selected .advanced-text-content,
.overlay-advanced-textbox[data-editing="true"] .advanced-text-editor-host {
  overflow: auto;
}

.overlay-advanced-textbox[data-editing="true"] .advanced-text-content {
  overflow: visible;
}

.advanced-text-editor-host,
.advanced-text-editor-host .advanced-text-content,
.advanced-text-editor-host .ProseMirror {
  min-height: 1.2em;
  outline: none;
  caret-color: #111827;
}

.advanced-text-editor-host .ProseMirror {
  height: auto;
  min-height: 100%;
  cursor: text;
  user-select: text;
  -webkit-user-select: text;
  pointer-events: auto;
}

.advanced-text-editor-host .ProseMirror * {
  user-select: text;
  -webkit-user-select: text;
}

.advanced-text-bold {
  font-weight: 800;
}

.advanced-text-italic {
  font-style: italic;
}

.advanced-text-underline {
  text-decoration: underline;
}

.advanced-text-content p,
.advanced-text-content div,
.advanced-text-editor-host .advanced-text-content p {
  line-height: inherit;
  margin: 0;
}

.advanced-text-content p:last-child,
.advanced-text-content div:last-child,
.advanced-text-editor-host .advanced-text-content p:last-child {
  margin-bottom: 0;
}

.advanced-text-content ul,
.advanced-text-content ol,
.advanced-text-editor-host .advanced-text-content ul,
.advanced-text-editor-host .advanced-text-content ol {
  margin: 0 0 0 1.35em;
  padding: 0;
}

.advanced-text-content li,
.advanced-text-editor-host .advanced-text-content li {
  line-height: inherit;
  margin: 0;
}

.advanced-text-content h2,
.advanced-text-content h3,
.advanced-text-editor-host .advanced-text-content h2,
.advanced-text-editor-host .advanced-text-content h3 {
  margin: 0;
  font-weight: 800;
  line-height: inherit;
}

.advanced-text-content h2,
.advanced-text-editor-host .advanced-text-content h2 {
  font-size: 1.45em;
}

.advanced-text-content h3,
.advanced-text-editor-host .advanced-text-content h3 {
  font-size: 1.18em;
}

.advanced-text-toolbar {
  position: fixed;
  z-index: 120;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  width: max-content;
  max-width: min(1120px, calc(100vw - var(--sidebar-width) - 48px));
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-tight);
  transform: translate(-50%, calc(-100% - 8px));
  pointer-events: auto;
  user-select: none;
}

.advanced-text-toolbar.is-below {
  transform: translate(-50%, 8px);
}

.advanced-text-toolbar.is-pinned {
  transform: translate(-50%, 0);
}

.advanced-text-toolbar button,
.advanced-text-toolbar span {
  height: 34px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.advanced-text-toolbar button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  padding: 0 8px;
  line-height: 1;
  cursor: pointer;
}

.advanced-text-toolbar button:hover {
  border-color: #c7d2df;
  background: #f6f8fb;
}

.advanced-text-toolbar button.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.advanced-icon-button {
  gap: 2px;
}

.advanced-icon-button svg,
.advanced-select-button svg,
.advanced-colour-button svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.advanced-icon-button .chevron {
  width: 13px;
  height: 13px;
  margin-left: 2px;
}

.advanced-text-toolbar .advanced-select-button,
.advanced-text-toolbar .advanced-framed-button {
  gap: 6px;
  border: 1px solid #8f98a6;
  border-radius: 5px;
  background: #fff;
}

.advanced-text-toolbar .advanced-select-button:hover,
.advanced-text-toolbar .advanced-framed-button:hover {
  border-color: #697386;
  background: #f8fafc;
}

.advanced-text-toolbar .advanced-colour-button {
  gap: 6px;
  border-color: transparent;
  background: transparent;
}

.advanced-text-toolbar .advanced-colour-button:hover {
  border-color: #c7d2df;
  background: #f6f8fb;
}

.advanced-toolbar-field-label {
  display: inline-flex;
  align-items: center;
  padding: 0 2px 0 6px;
  border: 0;
  background: transparent;
  line-height: 1;
}

.advanced-toolbar-field-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: auto;
  border: 0;
  background: transparent;
  white-space: nowrap;
}

.advanced-select-button span,
.advanced-colour-button span {
  display: inline-flex;
  align-items: center;
  height: 100%;
  border: 0;
  line-height: 1;
}

.advanced-text-toolbar .font-select {
  width: 210px;
  justify-content: space-between;
}

.advanced-text-toolbar .size-select {
  min-width: 70px;
  justify-content: space-between;
}

.advanced-text-button {
  border-color: #c7d2df;
}

.advanced-colour-button i {
  width: 22px;
  height: 4px;
  align-self: end;
  margin-left: -18px;
  border: 0;
  border-radius: 0;
  background: var(--current-colour, #20252d);
}

.advanced-colour-button span {
  min-height: 0;
  padding: 0;
  border: 0;
  font-size: 16px;
  background: transparent;
}

.advanced-colour-button[title="Box colour"] span {
  font-size: 12px;
}

.advanced-toolbar-dropdown {
  position: fixed;
  z-index: 80;
  display: grid;
  gap: 2px;
  max-height: 360px;
  overflow: auto;
  padding: 7px;
  border: 1px solid #9aa4b2;
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(28, 35, 45, 0.22);
}

.advanced-toolbar-dropdown button {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  min-height: 30px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.advanced-toolbar-dropdown .option-check {
  color: #16a34a;
  font-size: 16px;
  line-height: 1;
  text-align: center;
}

.advanced-toolbar-dropdown button:hover,
.advanced-toolbar-dropdown button.is-active {
  border-color: #d7e4f5;
  background: #edf5ff;
  color: #0f5797;
}

.advanced-toolbar-dropdown.compact-menu {
  grid-template-columns: 1fr;
}

.advanced-toolbar-dropdown.colour-menu {
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
  padding: 10px;
}

.advanced-toolbar-dropdown button.swatch {
  display: block;
  width: 28px;
  min-width: 28px;
  height: 28px;
  padding: 0;
  border-color: #d8dee7;
  background: var(--swatch);
}

.advanced-toolbar-dropdown button.swatch.is-active {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.advanced-text-measure {
  position: fixed;
  left: -10000px;
  top: 0;
  visibility: hidden;
  pointer-events: none;
}

.advanced-text-export-measure {
  position: fixed;
  left: -10000px;
  top: 0;
  z-index: -1;
  box-sizing: content-box;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.overlay-speech {
  align-content: center;
  --speech-padding: 2px;
  --speech-border-width: calc(2px * var(--overlay-scale));
  --speech-border-radius: calc(8px * var(--overlay-scale));
  min-width: var(--speech-min-width, calc(28px * var(--overlay-scale)));
  padding: var(--speech-padding);
  border: var(--speech-border-width) solid #20252d;
  border-radius: var(--speech-border-radius);
  background: rgba(255, 255, 255, 0.96);
  font-weight: 750;
  line-height: 1.08;
  filter: drop-shadow(0 7px 10px rgba(32, 37, 45, 0.16));
}

.overlay-speech.has-text-overflow {
  border-color: #b83f37;
  box-shadow: 0 0 0 calc(2px * var(--overlay-scale)) rgba(184, 63, 55, 0.2);
}

.speech-text {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.overlay-speech.is-image-bubble {
  display: flex;
  align-items: center;
  justify-content: center;
}

.speech-image {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.overlay-speech::before,
.overlay-speech::after {
  display: none;
}

.speech-tail-svg {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.speech-tail-line {
  stroke: #20252d;
  stroke-width: 1.5;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.speech-tail-arrow {
  fill: rgba(255, 255, 255, 0.96);
  stroke: #20252d;
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}

.speech-tail-dot {
  fill: #20252d;
  vector-effect: non-scaling-stroke;
}

.speech-tail-handle {
  position: absolute;
  z-index: 5;
  width: 10px;
  height: 10px;
  border: 0;
  border-radius: 50%;
  background: #20252d;
  box-shadow: 0 1px 5px rgba(32, 37, 45, 0.28);
  cursor: grab;
  transform: translate(-50%, -50%);
}

.speech-tail-handle:active {
  cursor: grabbing;
}

.overlay-marker,
.map-marker {
  width: 34px;
  height: 34px;
  color: #d44b3e;
  font-size: 30px;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.22));
}

.overlay-marker[data-marker="dot"],
.map-marker[data-marker="dot"] {
  color: #1f7a68;
  font-size: 22px;
}

.overlay-marker[data-marker="star"],
.map-marker[data-marker="star"] {
  color: #e2a72e;
  font-size: 28px;
}

.overlay-marker[data-marker="label-dot"],
.map-marker[data-marker="label-dot"] {
  border-radius: 50%;
  background: var(--marker-colour, #1f7a68);
  color: var(--marker-text-colour, #ffffff);
  font-family: Arial, sans-serif;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
  text-transform: uppercase;
}

.overlay-logo {
  overflow: visible;
  padding: 0;
  background: rgba(255, 255, 255, 0.9);
}

.overlay-logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 40;
  padding: 10px 14px;
  border-radius: 8px;
  background: #20252d;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  box-shadow: var(--shadow-tight);
}

@media (max-width: 1080px) {
  :root {
    --sidebar-width: 280px;
  }

  .top-actions {
    gap: 8px;
  }

  .artboard {
    min-width: 460px;
  }
}
