/* The resort-map control on the authenticated maps (wwwroot/js/maps/resort-maps/resort-map-panel.js): a "Resort layers"
   button, its panel of per-resort category checkboxes, a status line and, on the trip replay, a caption. Panel
   surface, text and line come from the Ink v2 tokens, so the control follows the light and dark themes with the rest
   of the app. The fallbacks only matter in a harness page that does not load ink-v2.css. */

.rmh-control {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.375rem;
  max-width: min(22rem, calc(100vw - 2rem));
  font-size: 0.8125rem;
  line-height: 1.35;
  color: var(--v2-ink, #16181d);
  background: none;
  box-shadow: none;
}

.rmh-toggle,
.rmh-retry {
  min-height: 2.5rem;
  padding: 0 0.75rem;
  border: 1px solid var(--v2-line-strong, #c6cad2);
  border-radius: var(--radius-control, 0.5rem);
  font: inherit;
  font-weight: 600;
  color: var(--v2-ink, #16181d);
  background: var(--v2-surface-elevated, #ffffff);
  box-shadow: var(--v2-shadow-3, 0 4px 10px -2px rgba(18, 20, 26, 0.06));
  cursor: pointer;
}

.rmh-toggle[aria-expanded='true'] {
  background: var(--v2-action-soft, #e8f0fd);
  border-color: var(--v2-action, #1565d8);
}

.rmh-toggle:hover,
.rmh-retry:hover {
  background: var(--v2-surface-muted, #edeff3);
}

.rmh-toggle:focus-visible,
.rmh-retry:focus-visible,
.rmh-check input:focus-visible {
  outline: 2px solid var(--v2-focus, #1565d8);
  outline-offset: 2px;
}

@media (pointer: coarse) {
  .rmh-toggle,
  .rmh-retry {
    min-height: 2.75rem;
  }
}

.rmh-panel {
  box-sizing: border-box;
  width: 100%;
  max-height: min(24rem, 60vh);
  overflow: auto;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--v2-line, #dcdfe5);
  border-radius: var(--radius-control, 0.5rem);
  background: var(--v2-surface-elevated, #ffffff);
  box-shadow: var(--v2-shadow-4, 0 10px 20px -4px rgba(18, 20, 26, 0.08));
}

.rmh-panel[hidden],
.rmh-toggle[hidden],
.rmh-note[hidden],
.rmh-retry[hidden] {
  display: none;
}

.rmh-resort {
  margin: 0 0 0.5rem;
  padding: 0;
  border: 0;
  min-width: 0;
}

.rmh-resort:last-child {
  margin-bottom: 0;
}

.rmh-resort-name {
  padding: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.rmh-row {
  display: grid;
  grid-template-columns: minmax(5rem, 1fr) auto auto;
  align-items: center;
  gap: 0.25rem 0.75rem;
  min-height: 2.75rem;
}

.rmh-category {
  color: var(--v2-ink-secondary, #4b515a);
}

/* Touch targets are at least 44 x 44 px: the whole label (box and text) is the target. */
.rmh-check {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  min-height: 2.75rem;
  min-width: 2.75rem;
  cursor: pointer;
}

.rmh-check input {
  width: 1.125rem;
  height: 1.125rem;
  margin: 0;
  accent-color: var(--v2-action, #1565d8);
}

.rmh-hint {
  margin: 0.25rem 0 0;
  color: var(--v2-ink-muted, #636a73);
}

/* A caption on the map itself: it sits on tiles, so it carries its own surface. */
.rmh-note,
.rmh-status {
  margin: 0;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--v2-line, #dcdfe5);
  border-radius: var(--radius-control, 0.5rem);
  color: var(--v2-ink-secondary, #4b515a);
  background: var(--v2-surface-elevated, #ffffff);
  text-align: right;
}

.rmh-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.375rem 0.5rem;
}

.rmh-status-error {
  color: var(--v2-danger, #a11230);
  border-color: var(--v2-danger-line, #f3b7c0);
  background: var(--v2-danger-soft, #fdecee);
}

/* Nothing to say: collapsed but still in the accessibility tree, so the next message is announced. */
.rmh-status-idle {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* The author-supplied attribution the host appends to MapLibre's own attribution control (text only). */
.rmh-attribution {
  white-space: normal;
}

/* Resort authoring studio. Layout is native CSS: no dependency on generated utilities. */
.rme-studio-root {
  display: flex; flex-direction: column; height: 100%; min-height: 34rem;
  color: var(--v2-ink, #16181d); background: var(--v2-canvas, #f4f5f7);
  --rme-surface: var(--v2-surface-elevated, #fff);
  --rme-shadow: 0 4px 20px -4px rgb(18 20 26 / 16%);
}
.rme-studio-root *, .rme-studio-publish-dialog * { box-sizing: border-box; }
.rme-studio-header { display: flex; align-items: center; gap: .75rem; padding: .75rem 1rem; background: var(--rme-surface); border-bottom: 1px solid var(--v2-line); flex-shrink: 0; }
.rme-studio-identity { min-width: 8rem; flex: 1; max-width: 22rem; }
.rme-studio-eyebrow { display: block; color: var(--v2-ink-muted); font-size: .625rem; line-height: 1.6; font-weight: 650; letter-spacing: .12em; text-transform: uppercase; }
.rme-studio-name { display: block; width: 100%; min-height: 1.75rem; padding: 0; border: 0; border-radius: .25rem; background: transparent; color: var(--v2-ink); font-size: 1.0625rem; font-weight: 650; text-overflow: ellipsis; }
.rme-studio-name:hover:enabled { background: var(--v2-surface-muted); }
.rme-studio-save-state { display: flex; flex-direction: column; gap: .125rem; font-size: .6875rem; white-space: nowrap; }
.rme-studio-status { display: flex; align-items: center; gap: .375rem; color: var(--v2-ok); }
.rme-studio-status-dirty { color: var(--v2-warn); }
.rme-studio-status-dot { width: .375rem; height: .375rem; flex-shrink: 0; border-radius: 50%; background: currentColor; }
.rme-studio-revision { color: var(--v2-ink-muted); }
.rme-studio-header-actions { display: flex; align-items: center; gap: .5rem; margin-left: auto; }
.rme-studio-button, .rme-studio-icon-button, .rme-studio-tool, .rme-studio-tabs button, .rme-studio-text-button { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 2.75rem; border-radius: .5rem; border: 1px solid var(--v2-line-strong); background: var(--rme-surface, var(--v2-surface-elevated)); color: var(--v2-ink); font-family: inherit; font-size: .75rem; font-weight: 600; cursor: pointer; transition: background-color 120ms, border-color 120ms, color 120ms; }
.rme-studio-button { padding: 0 .875rem; white-space: nowrap; }
.rme-studio-icon-button { width: 2.75rem; flex-shrink: 0; border-color: transparent; }
.rme-studio-quiet { border-color: transparent; }
.rme-studio-publish-short { display: none; }
.rme-studio-primary { color: var(--v2-action-on); background: var(--v2-action); border-color: var(--v2-action); }
.rme-studio-root button:hover:enabled, .rme-studio-root a:hover, .rme-studio-publish-dialog .rme-studio-button:hover:enabled { background: var(--v2-surface-muted); }
.rme-studio-root .rme-studio-primary:hover:enabled { background: var(--v2-action-hover); border-color: var(--v2-action-hover); }
.rme-studio-root button:disabled, .rme-studio-publish-dialog button:disabled { opacity: .45; cursor: not-allowed; }
.rme-studio-root :is(button, a, input, select):focus-visible, .rme-studio-publish-dialog .rme-studio-button:focus-visible { outline: 2px solid var(--v2-focus); outline-offset: 2px; }
.rme-studio-divider { display: block; flex-shrink: 0; width: 1px; height: 1.5rem; background: var(--v2-line); margin: 0 .125rem; }
.rme-studio-workspace { position: relative; isolation: isolate; flex: 1; min-height: 0; overflow: hidden; container-type: inline-size; }
.rme-studio-workspace > .rme-studio-map { position: absolute; inset: 0; width: 100%; height: 100%; background: var(--v2-surface-muted); }
.rme-studio-palette { position: absolute; z-index: 3; top: .875rem; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: .125rem; max-width: calc(100% - 2rem); padding: .375rem; border: 1px solid var(--v2-line); border-radius: .875rem; background: var(--rme-surface); box-shadow: var(--rme-shadow); overflow-x: auto; scrollbar-width: thin; }
.rme-studio-tool { flex-direction: column; gap: .25rem; border-color: transparent; min-width: 3.625rem; padding: .375rem .5rem; font-size: .625rem; white-space: nowrap; }
.rme-studio-tool[aria-pressed='true'], .rme-studio-icon-button[aria-pressed='true'] { color: var(--v2-action-text); background: var(--v2-action-soft); border-color: var(--v2-action); }
.rme-studio-tool[aria-pressed='true'] span::after { content: ''; display: inline-block; width: .25rem; height: .25rem; margin-left: .25rem; border-radius: 50%; background: currentColor; vertical-align: middle; }
.rme-studio-rail { position: absolute; z-index: 4; left: .875rem; top: 5.75rem; display: flex; flex-direction: column; gap: .125rem; padding: .25rem; border: 1px solid var(--v2-line); border-radius: .75rem; background: var(--rme-surface); box-shadow: var(--rme-shadow); }
.rme-studio-dock, .rme-studio-inspector { position: absolute; z-index: 4; top: 5.75rem; bottom: 1rem; display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--v2-line); border-radius: .875rem; background: var(--rme-surface); box-shadow: var(--rme-shadow); }
.rme-studio-dock { left: 4.5rem; width: 18rem; }
.rme-studio-inspector { right: .875rem; width: 19.5rem; animation: rme-inspector-in 140ms ease-out; }
.rme-studio-root [hidden] { display: none !important; }
.rme-studio-panel-heading { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .875rem 1rem .625rem; flex-shrink: 0; }
.rme-studio-panel-heading h2 { margin: .125rem 0 0; font-size: .875rem; font-weight: 650; }
.rme-studio-tabs { display: flex; gap: .25rem; padding: 0 .75rem .75rem; border-bottom: 1px solid var(--v2-line); flex-shrink: 0; }
.rme-studio-tabs button { flex: 1; min-width: 0; min-height: 2.75rem; padding: .375rem; border-color: transparent; gap: .375rem; font-size: .6875rem; color: var(--v2-ink-secondary); }
.rme-studio-tabs button[aria-selected='true'] { color: var(--v2-action-text); background: var(--v2-action-soft); border-color: var(--v2-action); }
.rme-studio-panel-body { padding: 1rem; overflow: auto; min-height: 0; flex: 1; scrollbar-width: thin; overscroll-behavior: contain; }
.rme-studio-panel-body .form-label { font-size: .6875rem; }
.rme-studio-panel-body :is(input, select, textarea) { min-width: 0; max-width: 100%; }
.rme-studio-panel-body #resort-feature-list { max-height: none; }
.rme-studio-panel-footer { display: flex; align-items: flex-start; gap: .375rem; padding: .75rem 1rem; color: var(--v2-ink-muted); border-top: 1px solid var(--v2-line); font-size: .625rem; line-height: 1.5; flex-shrink: 0; }
.rme-studio-geometry-tools { display: flex; align-items: center; justify-content: space-between; gap: .25rem; padding: .25rem .75rem .625rem; border-bottom: 1px solid var(--v2-line); }
.rme-studio-component-tools { display: flex; flex-wrap: wrap; gap: .375rem; margin-bottom: 1rem; }
.rme-studio-danger { color: var(--v2-danger); }
.rme-studio-notices { position: absolute; z-index: 10; left: 50%; top: 5.75rem; transform: translateX(-50%); width: min(32rem, calc(100% - 2rem)); display: flex; flex-direction: column; gap: .5rem; pointer-events: none; }
.rme-studio-notices > * { pointer-events: auto; box-shadow: var(--rme-shadow); }
.rme-studio-notice { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .75rem 1rem; border-radius: .625rem; border: 1px solid var(--v2-line); background: var(--rme-surface); font-size: .75rem; }
.rme-studio-drawing-hud { position: absolute; z-index: 9; left: 50%; bottom: 1rem; transform: translateX(-50%); width: max-content; max-width: calc(100% - 2rem); display: flex; align-items: center; gap: .75rem; padding: .625rem .75rem; border: 1px solid var(--v2-line); border-radius: .75rem; background: var(--rme-surface); box-shadow: var(--rme-shadow); font-size: .75rem; }
.rme-studio-drawing-hud strong { font-size: .75rem; font-weight: 650; }
.rme-studio-drawing-hud div > span { display: block; color: var(--v2-ink-secondary); font-size: .625rem; margin-top: .25rem; }
.rme-studio-drawing-dot { width: .5rem; height: .5rem; border-radius: 50%; background: var(--v2-action); flex-shrink: 0; }
.rme-studio-onboarding { position: absolute; z-index: 2; top: 50%; left: 50%; transform: translate(-50%, -40%); width: min(26rem, calc(100% - 8rem)); text-align: center; padding: 1.75rem; border: 1px solid var(--v2-line); border-radius: 1rem; background: var(--rme-surface); box-shadow: var(--rme-shadow); }
.rme-studio-onboarding-icon { display: inline-flex; align-items: center; justify-content: center; width: 3rem; height: 3rem; margin-bottom: 1rem; color: var(--v2-action-text); background: var(--v2-action-soft); border-radius: .875rem; }
.rme-studio-onboarding h2 { font-size: 1.5rem; line-height: 1.2; font-weight: 650; letter-spacing: -.035em; margin: .5rem 0 .75rem; }
.rme-studio-onboarding p { color: var(--v2-ink-secondary); font-size: .8125rem; line-height: 1.7; margin: 0; }
.rme-studio-onboarding-actions { display: flex; justify-content: center; gap: .5rem; margin: 1.25rem 0 .5rem; flex-wrap: wrap; }
.rme-studio-text-button { border: 0; background: transparent; color: var(--v2-action-text); padding: .375rem .5rem; font-size: .6875rem; }
.rme-studio-footer { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem 1.25rem; padding: .5rem 1rem; min-height: 2.25rem; flex-shrink: 0; background: var(--rme-surface); color: var(--v2-ink-muted); border-top: 1px solid var(--v2-line); font-size: .625rem; }
.rme-studio-footer > span { display: inline-flex; align-items: center; gap: .375rem; }
.rme-studio-footer > span:first-child { color: var(--v2-action-text); font-weight: 600; }
.rme-studio-footer-private { margin-left: auto; }
.rme-studio-publish-dialog { --rme-surface: var(--v2-surface-elevated); }
.rme-studio-publish-intro { display: flex; align-items: center; gap: 1rem; padding: 1rem; margin-bottom: 1.5rem; border: 1px solid var(--v2-line); border-radius: .75rem; background: var(--v2-canvas); color: var(--v2-action-text); }
.rme-studio-publish-intro strong { display: block; color: var(--v2-ink); font-size: 1.125rem; overflow-wrap: anywhere; }
.rme-studio-publish-preflight { padding: 1rem; border: 1px solid var(--v2-warn-line); border-radius: .75rem; background: var(--v2-warn-soft); color: var(--v2-warn); margin-bottom: 1rem; font-size: .8125rem; }
.rme-studio-publish-preflight p { margin-bottom: .75rem; }
.rme-studio-publish-dialog #resort-versions-heading { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--v2-line); }
.rme-studio-map .maplibregl-ctrl-top-right { top: 5.75rem; right: .75rem; }
.rme-studio-workspace[data-inspector='true'] .maplibregl-ctrl-top-right { right: 20.75rem; }
@keyframes rme-inspector-in { from { opacity: 0; transform: translateX(.5rem); } to { opacity: 1; transform: translateX(0); } }
@container (max-width: 1100px) {
  .rme-studio-workspace[data-inspector='true'] .rme-studio-dock { z-index: 7; }
  .rme-studio-footer-hint { display: none; }
}
/* A compact canvas shows one sheet at a time; selection survives switching panels. */
@container (max-width: 900px) {
  .rme-studio-workspace[data-dock-open='true'] .rme-studio-inspector { display: none; }
  .rme-studio-workspace[data-dock-open='true'] .maplibregl-ctrl-top-right { right: .75rem; }
}
@media (max-width: 1439px) {
  .rme-studio-header { gap: .5rem; }
  .rme-studio-revision { display: none; }
  .rme-studio-header .rme-studio-quiet span { display: none; }
}
@media (max-width: 1023px) {
  .rme-studio-root { min-height: 30rem; }
  .rme-studio-header { padding: .5rem .75rem; flex-wrap: wrap; }
  .rme-studio-identity { max-width: none; }
  .rme-studio-header-actions { margin-left: auto; }
  .rme-studio-save-state { display: flex; }
  .rme-studio-dock, .rme-studio-inspector { top: 5.75rem; bottom: .75rem; width: min(22rem, calc(100% - 5.25rem)); }
  .rme-studio-inspector { z-index: 8; }
  .rme-studio-workspace[data-inspector='true'] .maplibregl-ctrl-top-right { right: 23.25rem; }
  .rme-studio-footer-hint, .rme-studio-footer-private { display: none !important; }
}
@media (max-width: 640px) {
  .rme-studio-header-actions { width: 100%; justify-content: flex-end; gap: .375rem; }
  .rme-studio-header .rme-studio-quiet span, .rme-studio-publish-label { display: none; }
  .rme-studio-header .rme-studio-quiet { width: 2.75rem; padding: 0; flex-shrink: 0; }
  .rme-studio-publish-short { display: inline; }
  .rme-studio-header-actions .rme-studio-divider { margin-left: auto; }
  .rme-studio-palette { left: .75rem; right: .75rem; transform: none; max-width: none; top: .75rem; }
  .rme-studio-tool { min-width: 3.25rem; }
  .rme-studio-rail { left: .75rem; top: 5.5rem; }
  .rme-studio-dock { left: 4.25rem; top: 5.5rem; width: calc(100% - 5rem); }
  .rme-studio-inspector { right: .75rem; left: 4.25rem; top: 5.5rem; width: auto; }
  .rme-studio-panel-body { padding: .75rem; }
  .rme-studio-onboarding { width: calc(100% - 6rem); left: 4.5rem; transform: translateY(-40%); padding: 1rem; }
  .rme-studio-onboarding h2 { font-size: 1.25rem; }
  .rme-studio-drawing-hud { gap: .5rem; bottom: .75rem; }
  .rme-studio-drawing-hud div > span { max-width: 10rem; }
  .rme-studio-map .maplibregl-ctrl-top-right, .rme-studio-workspace[data-inspector='true'] .maplibregl-ctrl-top-right { top: auto; bottom: .75rem; left: .75rem; right: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .rme-studio-root *, .rme-studio-publish-dialog * { animation: none !important; transition: none !important; }
}
