.cm-seat-map {
  --cm-seat-bg: radial-gradient(
    circle at top,
    #f8f1e6 0%,
    #fbfaf7 45%,
    #edf4f1 100%
  );
  --cm-seat-panel: rgba(255, 255, 255, 0.9);
  --cm-seat-border: rgba(21, 39, 34, 0.12);
  --cm-seat-text: #152722;
  --cm-seat-muted: #5a6c66;
  --cm-seat-accent: #14664a;
  --cm-seat-available: #203f52;
  --cm-seat-hold: #c0392b;
  --cm-seat-in-cart: #27ae60;
  --cm-seat-blocked: #c4c7c8;
  --cm-seat-error: #ac3b2f;
  position: relative;
  margin: 32px 0;
  color: var(--cm-seat-text);
}

.cm-seat-map__header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.cm-seat-map__eyebrow {
  margin: 0 0 8px;
  color: var(--cm-seat-accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cm-seat-map__title {
  margin: 0;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1;
}

.cm-seat-map__intro {
  max-width: 62ch;
  color: var(--cm-seat-muted);
}

/* Public renewal page wrapper: breathing room above the guide box and a
   generous gap below so the footer doesn't crowd the chart/notice. */
.cm-renewal-page {
  margin-top: 50px;
  margin-bottom: 100px;
}

/* Renewal guidance: branded, stepped 1-2-3 block at the top of the
   public renewal view. */
.cm-seat-map__renewal-guide {
  margin: 0 0 18px;
  padding: 16px 20px;
  border: 1px solid #bcd4df;
  border-left: 4px solid rgb(0, 57, 79);
  border-radius: 14px;
  background: #e9f1f5;
  text-align: left;
}

.cm-seat-map__renewal-guide-title {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 800;
  color: rgb(0, 57, 79);
  text-align: left !important;
}

.cm-seat-map__renewal-guide-quota {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 600;
  color: rgba(0, 57, 79, 0.72);
}

/* Notice variant: same box, heading + message only (no steps) — used for
   gate / already-renewed / no-chart states. */
.cm-seat-map__renewal-guide-text {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
  color: rgb(0, 57, 79);
}

.cm-seat-map__renewal-guide-link {
  color: rgb(0, 57, 79);
  font-weight: 700;
  text-decoration: underline;
}

.cm-seat-map__renewal-guide-steps {
  list-style: none;
  counter-reset: cm-step;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.cm-seat-map__renewal-guide-steps li {
  counter-increment: cm-step;
  position: relative;
  padding-left: 34px;
  font-size: 14px;
  line-height: 1.45;
}

.cm-seat-map__renewal-guide-steps li::before {
  content: counter(cm-step);
  position: absolute;
  left: 0;
  top: -1px;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgb(0, 57, 79);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Warn banner — still used by RenewalAutoSelect when some prior seats could not
   be re-added (no longer available / no matching ticket type). */
.cm-seat-map__renewal-banner {
  margin: 0 0 16px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--cm-seat-border);
  background: var(--cm-seat-panel);
  font-size: 14px;
}

.cm-seat-map__renewal-banner--warn {
  border-color: #e0b34d;
  background: #fff7e6;
  color: #7a5300;
}

.cm-seat-map__layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.45fr);
  gap: 18px;
  align-items: start;
}

/* No-chart event: same seat-map panel chrome as a charted event, but a
   single full-width column (no sidebar) with an info notice instead of a map. */
.cm-seat-map__layout--no-chart {
  grid-template-columns: 1fr;
}

.cm-seat-map__no-chart-notice {
  padding: 48px 24px;
  text-align: center;
  color: var(--cm-seat-muted);
  font-size: 16px;
  font-weight: 600;
}

.cm-seat-map__minimap-slot {
  display: contents;
}

.cm-seat-map__minimap {
  width: 100%;
  margin-top: 12px;
  border-radius: 8px;
  border: 1px solid rgba(21, 39, 34, 0.22);
  background: rgba(246, 250, 248, 0.92);
  overflow: hidden;
}

.cm-seat-map__stage-wrap,
.cm-seat-map__sidebar {
  position: relative;
  padding: 18px;
  border: 1px solid var(--cm-seat-border);
  border-radius: 24px;
  background: var(--cm-seat-panel);
}

.cm-seat-map__sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: sticky;
  top: 10px;
}

.cm-seat-map__sidebar-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.cm-seat-map__sidebar-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 60px;
}

.cm-seat-map__sidebar-timer {
  margin: 0 0 10px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(20, 102, 74, 0.08);
  color: var(--cm-seat-accent);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: center;
  white-space: pre-line;
}

.cm-seat-map__sidebar-timer.is-warning {
  background: rgba(240, 168, 160, 0.25);
  color: var(--cm-seat-error);
}

.cm-seat-map__sidebar-notice {
  margin: 0 0 10px;
  font-size: 13px;
}

/* Sold-out banner (e.g. away tickets) — same box as the best-seats CTA
   (padding/radius/margin) but in the error palette. */
.cm-seat-map__sidebar-notice--soldout {
  padding: 12px;
  border-radius: 10px;
  background: #fcf0f1;
  color: #8a1f11;
  border: 1px solid #e6b3b0;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 12px;
}

/* Info banner (e.g. expired hold removed) — same shape as .cm-sc-modal-error,
   info palette instead of error red. */
.cm-seat-map__sidebar-notice--info {
  padding: 8px 10px;
  border-radius: 8px;
  background: #f0f6fc;
  color: #1d4f7c;
  border: 1px solid #b6d2ea;
  font-weight: 500;
}

/* Error banner — printer connection failure (no PDF fallback). */
.cm-seat-map__sidebar-notice--error {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fcf0f1;
  color: #8a1f11;
  border: 1px solid #e6b3b0;
  font-weight: 600;
}

/* Retry button inside the error banner — WP's .button radius isn't loaded on
   the public page, so style it explicitly to match the banner. */
.cm-seat-map__notice-retry {
  flex: 0 0 auto;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid #8a1f11;
  background: #fff;
  color: #8a1f11;
  font-weight: 600;
  font-size: 12px;
  line-height: 1.4;
  cursor: pointer;
}

.cm-seat-map__notice-retry:hover {
  background: #8a1f11;
  color: #fff;
}

/* Empty-cart / pick-a-section hint. Soft info banner tinted from the navy
   button colour (rgb(0,57,79)), with a navy left accent bar. */
.cm-seat-map__sidebar-empty-notice {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid #bcd4df;
  border-left: 3px solid rgb(0, 57, 79);
  border-radius: 10px;
  background: #e9f1f5;
  color: rgb(0, 57, 79);
  font-size: 16px;
  font-weight: 600;
}

.cm-seat-map__sidebar-toast {
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #1f8a4c;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  animation: cm-seat-map-toast-in 120ms ease-out;
}

@keyframes cm-seat-map-toast-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.cm-seat-map__sidebar-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--cm-seat-border);
  border-radius: 14px;
  background: #fff;
}

.cm-seat-map__sidebar-row-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.cm-seat-map__sidebar-row-label {
  font-weight: 400;
  font-size: 0.75rem;
  color: var(--cm-seat-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cm-seat-map__sidebar-row-meta {
  font-weight: 600;
  font-size: 14px;
  color: var(--cm-seat-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* In-cart ticket-type change: pencil toggle + inline type selector. */
.cm-seat-map__sidebar-row-edit,
.cm-seat-map__sidebar-row-edit:hover,
.cm-seat-map__sidebar-row-edit:focus {
  margin-left: 6px;
  padding: 0;
  border: 0;
  background: none !important;
  box-shadow: none;
  color: var(--cm-seat-muted);
  cursor: pointer;
  line-height: 0;
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  opacity: 0.7;
  transition: opacity 0.15s ease;
}

.cm-seat-map__sidebar-row-edit:hover:not(:disabled),
.cm-seat-map__sidebar-row-edit:focus:not(:disabled) {
  opacity: 1;
}

.cm-seat-map__sidebar-row-edit:disabled {
  opacity: 0.4;
  cursor: default;
}

.cm-seat-map__sidebar-row-typeselect {
  max-width: 100%;
  font-size: 13px;
  font-weight: 600;
  padding: 2px 4px;
}

/* "Oma paikkasi" badge on a renewer's own pre-claimed cart row. */
.cm-seat-map__sidebar-row-own {
  align-self: flex-start;
  margin-top: 2px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--cm-seat-renewal-own, #7fbce8);
  color: #0b3d5c;
  font-size: 11px;
  font-weight: 700;
}

.cm-seat-map__sidebar-row-price {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
}

.cm-seat-map__sidebar-row-remove {
  background: transparent;
  border: none;
  color: var(--cm-seat-muted);
  cursor: pointer;
  padding: 4px 6px;
  font-size: 18px;
  line-height: 1;
  border-radius: 6px;
}

.cm-seat-map__sidebar-row-remove:hover {
  color: var(--cm-seat-error);
  background: rgba(172, 59, 47, 0.08);
}

.cm-seat-map__sidebar-row-remove:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.cm-seat-map__sidebar-row.is-hold-lost {
  border-color: var(--cm-seat-error);
  background: rgba(172, 59, 47, 0.06);
}

.cm-seat-map__sidebar-row-warning {
  font-size: 0.7rem;
  color: var(--cm-seat-error);
  font-weight: 600;
  margin-top: 2px;
}

.cm-seat-map__sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid var(--cm-seat-border);
}

.cm-seat-map__sidebar-discount {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 14px;
  font-weight: 600;
  color: var(--cm-seat-accent);
  margin-bottom: 4px;
}

.cm-seat-map__sidebar-last-order {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  margin-top: 12px;
  border: 1px solid var(--cm-seat-border, #d8dde3);
  border-radius: 6px;
  background: var(--cm-seat-surface, #f6f7f9);
}

/* Collapsed by default — only the heading row is visible until expanded. */
.cm-seat-map__sidebar-last-order:not([open]) {
  gap: 0;
}

.cm-seat-map__sidebar-last-order-heading {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--cm-seat-muted);
  cursor: pointer;
  user-select: none;
}

.cm-seat-map__sidebar-last-order-summary {
  font-size: 14px;
  font-weight: 600;
}

/* Same shape as the primary confirm CTA (.cm-seat-map__sidebar-cta), only
   inverted colours: white fill + the same navy as the primary button for the
   border and text. Hover just dims, no fill swap. */
.cm-seat-map__sidebar-reprint {
  margin-top: 2px;
  background: #fff;
  color: rgb(0, 57, 79);
  border: 1px solid rgb(0, 57, 79);
  box-shadow: none;
}

.cm-seat-map__sidebar-reprint:hover,
.cm-seat-map__sidebar-reprint:focus {
  background: #fff;
  color: rgb(0, 57, 79);
  opacity: 0.7;
}

.cm-seat-map__sidebar-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 16px;
  font-weight: 700;
}

.cm-seat-map__sidebar-total-label {
  color: var(--cm-seat-muted);
  font-weight: 500;
  font-size: 14px;
}

.cm-seat-map__sidebar-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 600;
  text-decoration: none;
}

.cm-seat-map__status {
  min-height: 24px;
  margin-bottom: 12px;
  color: var(--cm-seat-muted);
  font-size: 14px;
}

.cm-seat-map__status.is-error {
  color: var(--cm-seat-error);
}

.cm-seat-map__status.is-empty {
  margin-bottom: 0;
  min-height: 0;
}

.cm-seat-map__reset:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.cm-seat-map__viewport {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  background: #f6faf8;
  min-height: 640px;
  contain: layout style paint;
}

.cm-seat-map__canvas {
  position: absolute;
  inset: 0;
  touch-action: none;
}

.cm-seat-map__canvas svg {
  width: 100%;
  height: 100%;
}

.cm-seat-map__zoom-controls {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 4;
}

.cm-seat-map__zoom-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid rgba(21, 39, 34, 0.22);
  border-radius: 8px;
  background: rgba(246, 250, 248, 0.92);
  color: var(--cm-seat-text);
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.cm-seat-map__zoom-btn:hover {
  opacity: 0.85;
  color: var(--cm-seat-text);
  background: rgba(246, 250, 248, 0.92);
}

.cm-seat-map__zoom-btn:active {
  transform: translateY(1px);
}

.cm-seat-map__interaction-preview {
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: 0;
  pointer-events: none;
}

.cm-seat-map__interaction-preview.is-active {
  opacity: 1;
}

.cm-seat-map__interaction-preview-image {
  position: absolute;
  transform-origin: 0 0;
  will-change: transform;
  backface-visibility: hidden;
  object-fit: fill;
}

.cm-seat-map__svg {
  display: block;
  backface-visibility: hidden;
  transform-origin: 0 0;
  will-change: transform;
}

.cm-seat-map__seat {
  cursor: pointer;
  transition:
    fill 120ms ease-out,
    opacity 120ms ease-out;
}

.cm-seat-map__seat[data-state="available"] {
  fill: var(--cm-seat-available) !important;
}

.cm-seat-map__seat[data-state="held"],
.cm-seat-map__seat[data-state="reserved_for_renewal"] {
  fill: var(--cm-seat-hold) !important;
}

.cm-seat-map__seat[data-state="in_cart"] {
  fill: var(--cm-seat-in-cart) !important;
}

/* Renewing holder's own reserved seat (available to them, not yet in cart) —
   light blue so it's distinct from generic available + others' reserved. */
.cm-seat-map__seat[data-state="renewal_own"] {
  fill: var(--cm-seat-renewal-own, #7fbce8) !important;
}

.cm-seat-map__seat[data-state="provisional"] {
  fill: var(--cm-seat-provisional, #f59e0b) !important;
}

.cm-seat-map__seat[data-state="sold"],
.cm-seat-map__seat[data-state="reserved_by_season"] {
  fill: var(--cm-seat-blocked) !important;
}

.cm-seat-map__seat[data-state="blocked"] {
  fill: var(--cm-seat-blocked) !important;
}

.cm-seat-map__svg:not(.is-panning) .cm-seat-map__seat:not([data-blocking="context"]):hover {
  opacity: 0.7;
}

.cm-seat-map__seat[data-state="sold"],
.cm-seat-map__seat[data-state="reserved_by_season"],
.cm-seat-map__seat[data-state="reserved_for_renewal"],
.cm-seat-map__seat[data-state="blocked"] {
  cursor: not-allowed;
}

.cm-seat-map__seat[data-blocking="context"],
.cm-seat-map__overlay--standing[data-blocking="context"],
.cm-seat-map__section-overlay[data-blocking="context"] {
  fill: var(--cm-seat-blocked) !important;
  cursor: default !important;
  pointer-events: none !important;
}

.cm-seat-map__svg [data-disabled="1"] {
  fill: var(--cm-seat-blocked) !important;
  pointer-events: none;
  cursor: not-allowed;
}

/* Sold-out section: greyed and not-allowed, but pointer-events stay so
   the native hover <title> ("Ei vapaita paikkoja") shows. Click/zoom is blocked
   in the stage click handler, not via CSS. */
.cm-seat-map__overlay--standing[data-soldout="1"],
.cm-seat-map__section-overlay[data-soldout="1"] {
  fill: var(--cm-seat-blocked) !important;
  cursor: not-allowed !important;
}

.cm-seat-map__svg.is-panning .cm-seat-map__seat,
.cm-seat-map__svg.is-panning .cm-seat-map__section-overlay {
  pointer-events: none;
  transition: none;
}

.cm-seat-map__section-overlay {
  cursor: pointer;
  transition: opacity 120ms ease-out;
}

.cm-seat-map__overlay--standing {
  cursor: pointer;
  transition:
    opacity 120ms ease-out,
    filter 120ms ease-out;
}

.cm-seat-map__overlay--standing[data-state="sold"],
.cm-seat-map__overlay--standing[data-state="blocked"] {
  fill: var(--cm-seat-blocked) !important;
  cursor: not-allowed;
}

.cm-seat-map__svg:not(.is-panning) .cm-seat-map__overlay--standing:hover {
  opacity: 0.9;
  filter: saturate(1.08);
}

.cm-seat-map__svg:not(.is-panning) .cm-seat-map__section-overlay:hover {
  opacity: 0.88;
}

.cm-seat-map__tooltip {
  position: absolute;
  pointer-events: none;
  background: #fff;
  color: var(--cm-seat-text);
  padding: 8px 12px;
  border: 1px solid var(--cm-seat-border);
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.3;
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(21, 39, 34, 0.12);
  z-index: 10;
  transform: translate(-50%, calc(-100% - 12px));
}

.cm-seat-map__tooltip[hidden] {
  display: none;
}

.cm-seat-map__tooltip-label {
  font-weight: 600;
}

.cm-seat-map__tooltip-price,
.cm-seat-map__tooltip-note {
  margin-top: 2px;
  color: var(--cm-seat-muted);
}

/* Seat labels + description on hover. */
.cm-seat-map__tooltip-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.cm-seat-map__tooltip-label-chip {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  background: #eef3f1;
  color: var(--cm-seat-text);
  font-size: 11px;
  font-weight: 600;
}

.cm-seat-map__tooltip-desc {
  margin-top: 3px;
  max-width: 220px;
  color: var(--cm-seat-muted);
  font-size: 11px;
}

.cm-seat-map.is-loading-seats .cm-seat-map__section-overlay {
  cursor: progress;
  pointer-events: none;
}

.cm-seat-map.is-loading-seats .cm-seat-map__viewport::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: rgba(246, 250, 248, 0.55);
  pointer-events: none;
}

.cm-seat-map.is-loading-seats .cm-seat-map__viewport::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  border-radius: 50%;
  border: 3px solid rgba(21, 39, 34, 0.18);
  border-top-color: var(--cm-seat-accent);
  animation: cm-seat-map-spin 0.8s linear infinite;
  z-index: 3;
  pointer-events: none;
}

@keyframes cm-seat-map-spin {
  to {
    transform: rotate(360deg);
  }
}

.cm-seat-map__legend ul {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
}

.cm-seat-map__legend li {
  display: flex;
  gap: 3px;
  align-items: center;
  margin-bottom: 10px;
  color: var(--cm-seat-muted);
}

.cm-seat-map__legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 1px solid rgba(21, 39, 34, 0.2);
}

.cm-seat-map__legend-swatch.is-available {
  background: var(--cm-seat-available);
}
.cm-seat-map__legend-swatch.is-held,
.cm-seat-map__legend-swatch.is-reserved_for_renewal {
  background: var(--cm-seat-hold);
}
.cm-seat-map__legend-swatch.is-in-cart,
.cm-seat-map__legend-swatch.is-in_cart {
  background: var(--cm-seat-in-cart);
}
.cm-seat-map__legend-swatch.is-sold,
.cm-seat-map__legend-swatch.is-reserved_by_season,
.cm-seat-map__legend-swatch.is-season,
.cm-seat-map__legend-swatch.is-blocked {
  background: var(--cm-seat-blocked);
}

/* Seat-colour legend under the chart — horizontal, wraps on mobile so it
   never covers the map. Shown on public store, box office and renewal views. */
.cm-seat-map__legend {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  padding: 0;
}

.cm-seat-map__legend-item {
  display: flex;
  align-items: center;
  gap: 3px;
  margin: 0;
  font-size: 13px;
  color: var(--cm-seat-muted);
}

.cm-seat-map__summary.is-hidden {
  display: none;
}

.cm-seat-map__summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.cm-seat-map__summary-item {
  padding: 12px;
  border: 1px solid var(--cm-seat-border);
  border-radius: 16px;
  background: #fff;
}

.cm-seat-map__summary-item strong {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  color: var(--cm-seat-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Native <dialog>: the browser provides the focus trap, background inerting,
   Esc-to-close and focus restore (WCAG 2.4.3, 2.1.1). We only style the box and
   its ::backdrop; the top margin pins it near the top like the old modal. */
.cm-seat-map__modal-dialog {
  position: fixed;
  inset: 0;
  margin: 8vh auto auto;
  max-width: 520px;
  width: 100%;
  padding: 26px;
  border: 0;
  border-radius: 24px;
  background: #fffdf9;
  color: var(--cm-seat-text);
  box-shadow: 0 30px 90px rgba(16, 28, 24, 0.24);
}

.cm-seat-map__modal-dialog::backdrop {
  background: rgba(16, 28, 24, 0.56);
}

.cm-seat-map__modal-close {
  position: absolute;
  top: 10px;
  right: 20px;
  border: 0;
  background: transparent;
  color: #203f52;
  font-size: 22px;
  line-height: 1;
  padding: 4px;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 120ms ease;
  box-shadow: none;
}

.cm-seat-map__modal-close:hover,
.cm-seat-map__modal-close:focus,
.cm-seat-map__modal-close:active {
  background: transparent !important;
  color: #203f52 !important;
  opacity: 0.9;
  box-shadow: none;
}

.cm-seat-map__modal-title {
  margin: 0 28px 4px 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--cm-seat-text);
  line-height: 1.35;
}

.cm-seat-map__modal-price-range {
  margin: 0 0 16px;
  font-size: 0.75rem;
  color: var(--cm-seat-muted);
  font-variant-numeric: tabular-nums;
}

/* Seat labels + description. */
.cm-seat-map__seat-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cm-seat-map__seat-label-chip {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--cm-seat-border);
  background: #eef3f1;
  color: var(--cm-seat-text);
  font-size: 12px;
  font-weight: 600;
}

.cm-seat-map__seat-description {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--cm-seat-muted);
}

/* Seat-label chips inside a sidebar row: denser than the modal, wraps
   on narrow screens without breaking the row layout. */
.cm-seat-map__sidebar-row-labels {
  margin: 4px 0 0;
  gap: 4px;
}

.cm-seat-map__sidebar-row-labels .cm-seat-map__seat-label-chip {
  padding: 1px 7px;
  font-size: 11px;
}

.cm-seat-map__modal-kicker {
  margin: 0 0 8px;
  color: var(--cm-seat-accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cm-seat-map__modal-head h3 {
  margin: 0 0 6px;
  font-size: 28px;
}

.cm-seat-map__modal-head p {
  margin: 0;
  color: var(--cm-seat-muted);
}

.cm-seat-map__modal-note {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--cm-seat-border);
  border-radius: 14px;
  background: #f7faf8;
  color: var(--cm-seat-muted);
}

.cm-seat-map__product-list {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cm-seat-map__product-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 8px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 120ms ease;
}

.cm-seat-map__product-row:hover {
  background: rgba(21, 39, 34, 0.04);
}

.cm-seat-map__product-row:has(input:checked) {
  background: rgba(20, 102, 74, 0.08);
}

.cm-seat-map__product-row--buy {
  grid-template-columns: 1fr auto auto auto;
  cursor: default;
}

.cm-seat-map__qty-select {
  padding: 4px 8px;
  border: 1px solid var(--cm-seat-border);
  border-radius: 6px;
  background: #fff;
  font-size: 14px;
  cursor: pointer;
}

.cm-seat-map__buy-btn {
  justify-self: end;
  align-self: center;
  padding: 6px 14px;
  font-size: 13px;
  line-height: 1.2;
  border-radius: 10px;
  font-weight: 600;
  min-width: 0;
}

.cm-seat-map__buy-btn.is-loading {
  cursor: wait;
}

.cm-seat-map__spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: cm-seat-spin 0.7s linear infinite;
  vertical-align: middle;
}

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

@media (max-width: 480px) {
  .cm-seat-map__product-row--buy {
    grid-template-columns: 1fr auto auto;
    row-gap: 8px;
  }

  .cm-seat-map__product-row--buy .cm-seat-map__buy-btn {
    grid-column: 1 / -1;
    justify-self: stretch;
  }
}

.cm-seat-map__product-input {
  margin: 0;
  accent-color: var(--cm-seat-accent);
}

.cm-seat-map__product-input.is-hidden {
  display: none;
}

.cm-seat-map__product-name-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.cm-seat-map__product-name {
  font-weight: 600;
  color: #152722;
}

.cm-seat-map__product-description {
  font-size: 12px;
  font-weight: 400;
  line-height: 1.35;
  color: var(--cm-seat-muted);
}

.cm-seat-map__product-price {
  color: var(--cm-seat-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.cm-seat-map__qty {
  display: inline-grid;
  grid-template-columns: 36px 58px 36px;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
}

.cm-seat-map__qty-btn,
.cm-seat-map__qty-input {
  height: 36px;
  border: 1px solid var(--cm-seat-border);
  border-radius: 8px;
  background: #fff;
  color: var(--cm-seat-text);
  font: inherit;
}

.cm-seat-map__qty-btn {
  cursor: pointer;
  font-weight: 700;
}

.cm-seat-map__qty-input {
  width: 58px;
  text-align: center;
}

.cm-seat-map__modal-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid rgba(21, 39, 34, 0.08);
}

.cm-seat-map__modal-cta {
  min-width: 180px;
}

.cm-seat-map__modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.cm-seat-map-empty {
  padding: 16px;
  border: 1px solid rgba(21, 39, 34, 0.12);
  border-radius: 16px;
  background: #fff;
  color: var(--cm-seat-muted);
}

@media (max-width: 980px) {
  .cm-seat-map__layout {
    grid-template-columns: 1fr;
  }

  .cm-seat-map__header {
    flex-direction: column;
  }

  .cm-seat-map__viewport {
    min-height: 500px;
  }
}

@media (max-width: 640px) {
  .cm-seat-map {
    padding: 0;
  }

  .cm-seat-map__header,
  .cm-seat-map__sidebar {
    padding-left: 16px;
    padding-right: 16px;
  }

  .cm-seat-map__stage-wrap {
    padding: 12px;
    border: 1px solid var(--cm-seat-border);
    border-radius: 18px;
    background: var(--cm-seat-panel);
  }

  .cm-seat-map__viewport {
    min-height: 70vh;
    max-height: 80vh;
    border-radius: 14px;
  }

  .cm-seat-map__summary-grid {
    grid-template-columns: 1fr;
  }

  .cm-seat-map__modal-dialog {
    /* auto bottom margin + auto width: with the fixed-position <dialog> a fixed
       bottom margin would stretch the box to the viewport edge. */
    margin: 5vh 12px auto;
    width: auto;
  }

  .cm-seat-map__renewal-guide {
    padding: 14px 16px;
    border-radius: 12px;
  }

  .cm-seat-map__renewal-guide-title {
    font-size: 18px;
  }
}

/* ===== Box office kiosk — bold navy POS ===== */
.cm-box-office-body {
  margin: 0;
  background: #eef2f4;
}

/* Skip link: off-screen until focused, then pinned top-left (WCAG 2.4.1). */
.cm-box-office__skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 10000;
  padding: 10px 16px;
  background: rgb(0, 57, 79);
  color: #fff;
  font-weight: 600;
  border-radius: 0 0 8px 0;
}
.cm-box-office__skip:focus {
  left: 0;
}

.cm-box-office {
  --bo-navy: rgb(0, 57, 79);
  --bo-navy-700: #002a3a;
  --bo-accent: #f5b301;
  --bo-surface: #ffffff;
  --bo-muted: #5a7480;
  padding: 0 0 40px;
}

/* Branded header band */
.cm-box-office__header {
  background: rgb(0, 57, 79);
  color: #fff;
  box-shadow: 0 6px 22px rgba(0, 41, 58, 0.28);
}

.cm-box-office__header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 22px clamp(20px, 4vw, 48px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.cm-box-office__headings {
  min-width: 0;
}

.cm-box-office__title {
  margin: 0;
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.05;
  color: #fff;
}

.cm-box-office__subtitle {
  margin: 6px 0 0;
  font-size: clamp(13px, 1.2vw, 16px);
  font-weight: 500;
  color: rgba(255, 255, 255, 0.82);
  letter-spacing: 0.01em;
}

.cm-box-office__countdown {
  display: inline-block;
  margin: 12px 0 0;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--bo-accent);
  color: #3a2c00;
  font-size: clamp(13px, 1.2vw, 15px);
  font-weight: 700;
  letter-spacing: 0.01em;
}

.cm-box-office__countdown:empty {
  display: none;
}

/* Live clock — now sits inside the header band */
.cm-box-office__clock-wrap {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  pointer-events: none;
  flex: 0 0 auto;
}

.cm-box-office__clock {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: clamp(30px, 3.6vw, 52px);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: 12px;
  padding: 6px 16px;
  text-align: center;
}

.cm-box-office__inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 28px clamp(20px, 4vw, 48px) 0;
}

/* Box-office seat map: lighten the stage panel, lift the sidebar into a card.
   Scoped to .is-box-office so the public seat map / renewal views are unchanged. */
.is-box-office .cm-seat-map__sidebar {
  background: var(--bo-surface, #fff);
  border: 1px solid rgba(0, 57, 79, 0.12);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 10px 28px rgba(0, 41, 58, 0.1);
}

.is-box-office .cm-seat-map__sidebar-title {
  color: rgb(0, 57, 79);
  font-weight: 800;
}

.is-box-office .cm-seat-map__sidebar-total {
  font-size: 20px;
  color: rgb(0, 57, 79);
}

.is-box-office .cm-seat-map__best-seats--checkout {
  background: #f3f8fb;
  border-color: rgba(0, 57, 79, 0.18);
}

.is-box-office .cm-seat-map__sidebar-cta {
  background: rgb(0, 57, 79);
  border-color: rgb(0, 57, 79);
  color: #fff;
  font-size: 16px;
  padding: 14px 18px;
  border-radius: 12px;
}

.is-box-office .cm-seat-map__sidebar-cta:hover {
  background: rgb(0, 72, 99);
  border-color: rgb(0, 72, 99);
}

/* Larger, kiosk-friendly add button in the chart-less list mode. */
.is-box-office .cm-seat-map__list-add {
  padding: 10px 20px;
  font-size: 15px;
  border-radius: 8px;
}

.cm-seat-map__best-seats {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--cm-seat-border);
  border-radius: 10px;
  background: #f6faf8;
  margin-bottom: 12px;
}

.cm-seat-map__best-seats-count {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cm-seat-map__best-seats-label {
  font-weight: 600;
  font-size: 14px;
}

.cm-seat-map__best-seats-stepper {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.cm-seat-map__best-seats-step {
  min-width: 32px;
  padding: 4px 10px;
  font-size: 16px;
  line-height: 1;
  border-radius: 10px;
}

.cm-seat-map__best-seats-value {
  min-width: 24px;
  text-align: center;
  font-weight: 700;
  font-size: 16px;
}

.cm-seat-map__best-seats-buttons {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.cm-seat-map__best-seats-cta {
  flex: 1;
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 600;
}

.cm-seat-map__best-seats-cta.is-active {
  background: var(--cm-seat-error, #b1303a);
}

.cm-seat-map__best-seats-cta.is-confirm {
  background: var(--cm-seat-in-cart, #1e7a3a);
}

.cm-seat-map__best-seats-secondary {
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 500;
}

.cm-seat-map__best-seats-status {
  margin: 0;
  padding: 6px 10px;
  border-radius: 8px;
  background: #fff3d6;
  color: #7a4a00;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}

.cm-seat-map__best-seats-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0;
  max-height: 60vh;
  overflow-y: auto;
  padding-right: 4px;
}

.cm-seat-map__best-seats-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--cm-seat-border);
  border-radius: 8px;
  background: #ffffff;
}

.cm-seat-map__best-seats-row-label {
  font-weight: 600;
}

.cm-seat-map__best-seats-row-select {
  min-width: 160px;
  padding: 4px 8px;
}

.cm-seat-map__best-seats-row-price {
  font-weight: 700;
  min-width: 60px;
  text-align: right;
}

.cm-seat-map__best-seats-row-empty {
  color: var(--cm-seat-muted);
  font-style: italic;
}

/* Chart-less box office ticket-type list: compact bordered "Lisää"
   button (WP's .button styles aren't loaded on the public page). */
.cm-seat-map__list-add {
  flex: 0 0 auto;
  padding: 6px 16px;
  border-radius: 6px;
  border: 1px solid rgb(0, 57, 79);
  background: rgb(0, 57, 79);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.5;
  cursor: pointer;
}

.cm-seat-map__list-add:hover {
  background: rgb(0, 72, 99);
  border-color: rgb(0, 72, 99);
}

.cm-seat-map__list-add:disabled {
  opacity: 0.5;
  cursor: default;
}

.cm-seat-map__best-seats-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
}

/* Same CTA shape as the sidebar confirm button, so modal and sidebar buttons
   share one look (radius/padding/weight). */
.cm-seat-map__best-seats-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 600;
  text-decoration: none;
}

.cm-seat-map__modal-notice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: 10px;
  background: #fff4f4;
  color: #7a1f2b;
  border: 1px solid #f2b8be;
  font-weight: 500;
  margin: 12px 0;
}

.cm-seat-map__modal-notice.is-error {
  background: #fff4f4;
  color: #7a1f2b;
  border-color: #f2b8be;
}

.cm-sc-modal-error {
  margin: 8px 0 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fff4f4;
  color: #7a1f2b;
  border: 1px solid #f2b8be;
  font-size: 13px;
  font-weight: 500;
}

.cm-seat-map__best-seats-toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  padding: 10px 16px;
  border-radius: 10px;
  background: #2a2a2a;
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Seat filter: non-matching seats/sections look sold-out (grey) instead
   of being removed, and stay clickable so the purchase path is unaffected —
   the filter is visual guidance only. The .cm-seat-map__svg ancestor lifts
   specificity over the [data-state] fill rules so grey wins. */
.cm-seat-map__svg .cm-seat-map__seat--filtered-out {
  fill: var(--cm-seat-blocked) !important;
}
.cm-seat-map__section-overlay--filtered-out {
  fill: var(--cm-seat-blocked) !important;
}

/* Filter + legend share one row above the map. */
.cm-seat-map__toolbar {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
}
.cm-seat-map__toolbar > .cm-seat-map__legend {
  margin-bottom: 0;
}

/* Inline "Suodata:" chip row under the legend, left-aligned with it. */
.cm-seat-map__filter {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: 20px;
}
.cm-seat-map__filter-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--site-primary-color, #00394f);
}
.cm-seat-map__filter-clear {
  border: 0;
  background: none;
  padding: 0;
  font-size: 13px;
  color: var(--site-primary-color, #00394f);
  text-decoration: underline;
  cursor: pointer;
}
.cm-seat-map__seat-label-chip.is-selected {
  background: var(--site-primary-color, #00394f);
  border-color: var(--site-primary-color, #00394f);
  color: #fff;
}
.cm-seat-map__seat-label-chip[aria-pressed] {
  cursor: pointer;
}

/* Visible keyboard focus for every interactive control (WCAG 2.4.7). The old
   styles cued focus only via opacity. Scoped to the map + its dialog (the
   dialog sits in the top layer but stays a DOM descendant). */
.cm-seat-map :is(button, a, select, input, summary, [tabindex]):focus-visible,
.cm-seat-map__modal-dialog :is(button, a, select, input, summary, [tabindex]):focus-visible {
  outline: 2px solid #00393f;
  outline-offset: 2px;
  border-radius: 2px;
}

/* Screen-reader-only helper for supplementary text on icon-only controls. */
.cm-seat-map .sr-only,
.cm-seat-map__sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Respect the OS "reduce motion" preference (WCAG 2.3.3). */
@media (prefers-reduced-motion: reduce) {
  .cm-seat-map *,
  .cm-seat-map__modal-dialog * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
