:root {
  color-scheme: dark;
  --ink: #080b0e;
  --panel: #11161b;
  --panel-2: #171e24;
  --line: #2a343d;
  --text: #f4f7f8;
  --muted: #95a2ad;
  --cyan: #45bde5;
  --yellow: #f4ea18;
  --orange: #f08a20;
  --red: #ef2f31;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--ink);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

.outlook-entry-link {
  color: #9ed4ff;
  font-size: 13px;
  text-decoration: none;
  border: 1px solid #36536a;
  border-radius: 5px;
  padding: 8px 12px;
}

button,
input {
  font: inherit;
}

.topbar {
  min-height: 72px;
  padding: 14px clamp(18px, 4vw, 52px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #0c1014;
}

.employee-production-ui .dev-only {
  display: none !important;
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
}

.brand-mark {
  width: 44px;
  height: 24px;
  border-top: 4px solid var(--cyan);
  border-bottom: 4px solid var(--cyan);
  transform: skewX(-22deg);
}

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

.brand strong {
  font-size: 17px;
}

.brand div > span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.environment {
  border-left: 3px solid var(--yellow);
  padding-left: 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
}

.workspace {
  width: min(1440px, 100%);
  margin: 0 auto;
  min-height: calc(100vh - 72px);
  display: grid;
  grid-template-columns: minmax(300px, 380px) 1fr;
}

.control-panel {
  padding: 30px;
  border-right: 1px solid var(--line);
  background: var(--panel);
}

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

.section-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
}

.section-heading span {
  color: var(--cyan);
  font-size: 11px;
  font-weight: 800;
}

.section-heading h1,
.section-heading h2 {
  margin: 0;
  font-size: 14px;
  letter-spacing: 0;
}

.zone-groups {
  display: grid;
  gap: 14px;
}

.zone-group {
  display: grid;
  gap: 10px;
}

.zone-group h3 {
  margin: 6px 0 1px;
  color: #dbe8ee;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.zone-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.zone-button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 9px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  cursor: pointer;
}

.zone-button.active {
  background: var(--cyan);
  border-color: var(--cyan);
  color: #071015;
}

.zone-name {
  display: none;
}

.dropzone {
  min-height: 126px;
  border: 1px dashed #50606d;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: #0d1216;
  cursor: pointer;
  text-align: center;
}

.dropzone.dragging {
  border-color: var(--cyan);
  background: #101b20;
}

.dropzone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.upload-symbol {
  color: var(--cyan);
  font-size: 28px;
  line-height: 1;
}

.dropzone strong {
  max-width: 90%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.dropzone small {
  color: var(--muted);
  font-size: 11px;
}

.screenshot-guide-button {
  width: 100%;
  min-height: 36px;
  margin-top: 10px;
  border: 1px solid #3a4852;
  border-radius: 4px;
  background: #121920;
  color: #d8e7ee;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.screenshot-guide-button:hover,
.screenshot-guide-button:focus-visible {
  border-color: var(--cyan);
  color: var(--text);
  outline: none;
}

.field-stack {
  display: grid;
  gap: 12px;
}

.optional-notes-help {
  margin: -4px 0 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.optional-notes.hidden {
  display: none;
}

.anchor-calibration {
  position: fixed;
  inset: 0;
  z-index: 20;
  padding: 24px;
  overflow: auto;
  background: rgba(3, 5, 7, .92);
}

.anchor-dialog {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0a0e11;
}

.anchor-progress {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
}

.anchor-progress span {
  color: var(--yellow);
  font-weight: 900;
}

.anchor-dialog > p {
  min-height: 30px;
  margin: 7px 0 12px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.anchor-canvases {
  display: grid;
  grid-template-columns: minmax(260px, 36%) minmax(420px, 64%);
  gap: 10px;
  align-items: start;
}

.anchor-canvases figure {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.anchor-canvases canvas {
  display: block;
  width: 100%;
  height: auto;
  background: #fff;
}

#reference-anchor-canvas {
  max-height: 520px;
  object-fit: contain;
}

#weatherbell-anchor-canvas {
  cursor: crosshair;
}

.anchor-canvases figcaption {
  padding: 7px 9px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 9px;
}

.anchor-actions {
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.reset-anchor-button,
.open-anchor-button,
.auto-anchor-button,
.complete-anchor-button {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 7px 9px;
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
}

.open-anchor-button {
  width: 100%;
  margin-top: 10px;
  border-color: var(--cyan);
}

.auto-anchor-button {
  width: 100%;
  margin-top: 10px;
  border-color: var(--yellow);
  color: var(--yellow);
}

.auto-anchor-button:disabled {
  cursor: wait;
  opacity: .55;
}

.auto-anchor-result {
  margin-top: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #080c0f;
}

.auto-anchor-result > div {
  padding: 9px 10px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  font-size: 10px;
}

.auto-anchor-result strong {
  color: var(--yellow);
}

.auto-anchor-result span {
  color: var(--muted);
  text-align: right;
}

.auto-anchor-result img {
  display: block;
  width: 100%;
  max-height: 260px;
  object-fit: contain;
  background: #fff;
}

.screenshot-preflight {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  background: #0b1014;
}

.preflight-heading {
  display: grid;
  gap: 4px;
  margin-bottom: 9px;
}

.preflight-heading strong {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
}

.preflight-heading strong::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--muted);
}

.screenshot-preflight.pass .preflight-heading strong::before {
  background: #36d27e;
}

.screenshot-preflight.warning .preflight-heading strong::before {
  background: var(--yellow);
}

.screenshot-preflight.error .preflight-heading strong::before {
  background: var(--red);
}

.preflight-heading span,
.screenshot-preflight p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.preflight-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin: 0 0 9px;
}

.preflight-metrics div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 6px;
  background: #080c0f;
}

.preflight-metrics dt {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 900;
  text-transform: uppercase;
}

.preflight-metrics dd {
  margin: 0;
  color: var(--text);
  font-size: 10px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.complete-anchor-button {
  border-color: var(--yellow);
  background: var(--yellow);
  color: #080b0e;
}

.complete-anchor-button:disabled {
  cursor: not-allowed;
  opacity: .4;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field-grid label:first-child {
  grid-column: 1 / -1;
}

.field-grid label span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.field-grid input {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 11px;
  background: #0b1014;
  color: var(--text);
  outline: none;
}

.field-grid input:focus {
  border-color: var(--cyan);
}

.generate-button {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 5px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--yellow);
  color: #090b0d;
  font-weight: 900;
  cursor: pointer;
}

.generate-button:disabled {
  cursor: wait;
  opacity: .62;
}

.form-status {
  min-height: 18px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.form-status.error {
  color: #ff7a7b;
}

.form-status.warning {
  color: var(--yellow);
}

.preview-panel {
  min-width: 0;
  padding: clamp(22px, 4vw, 52px);
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(90deg, transparent 49.9%, rgba(255,255,255,.025) 50%, transparent 50.1%),
    #0a0e11;
}

.preview-toolbar,
.preview-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.override-panel {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.override-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.override-header h2 {
  margin: 5px 0 0;
  font-size: 18px;
}

.override-state {
  border-left: 3px solid var(--yellow);
  padding-left: 9px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
}

.override-columns,
.override-row {
  display: grid;
  grid-template-columns: minmax(120px, 1.2fr) minmax(90px, .65fr) minmax(150px, 1.05fr);
  gap: 12px;
  align-items: center;
}

.override-columns {
  padding: 0 12px 8px;
  color: var(--cyan);
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.override-list {
  border-top: 1px solid var(--line);
}

.override-row {
  min-height: 54px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
}

.override-row strong {
  font-size: 13px;
}

.auto-range {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.override-row select {
  width: 100%;
  height: 38px;
  border: 1px solid rgba(244, 234, 24, .72);
  border-radius: 4px;
  padding: 0 9px;
  background: #10140c;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.override-row select:focus {
  border-color: var(--yellow);
  outline: none;
}

.override-row select:disabled {
  opacity: .55;
}

.finalize-button {
  width: 100%;
  min-height: 48px;
  margin-top: 18px;
  border: 0;
  border-radius: 5px;
  background: var(--cyan);
  color: #071015;
  font-weight: 900;
  cursor: pointer;
}

.finalize-button:disabled {
  cursor: wait;
  opacity: .55;
}

.secondary-action-button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0 14px;
  background: var(--panel-2);
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
}

.calibration-panel {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 14px;
  background: #080c0f;
}

.calibration-header,
.calibration-actions,
.calibration-save-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.calibration-header h3 {
  margin: 4px 0 0;
  font-size: 16px;
}

#calibration-state {
  color: var(--yellow);
  font-size: 10px;
  font-weight: 900;
}

.calibration-help {
  margin: 10px 0;
  color: var(--muted);
  font-size: 11px;
}

.calibration-readout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 10px 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #05080a;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

#calibration-selected-readout {
  color: var(--text);
}

#calibration-collision-readout.warning {
  color: var(--yellow);
}

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

.calibration-controls label,
.calibration-toggle {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.calibration-controls input {
  width: 100%;
  height: 32px;
  margin-top: 4px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 8px;
  background: #0b1014;
  color: var(--text);
}

.calibration-town-visibility {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  max-height: 190px;
  overflow: auto;
  margin: 12px 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #05080a;
}

.calibration-town-visibility label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.calibration-town-visibility select {
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 8px;
  background: #0b1014;
  color: var(--text);
  font-weight: 800;
}

.calibration-town-visibility label.hidden-town {
  color: #6c7782;
}

.calibration-actions button,
.calibration-save-actions button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 10px;
  background: var(--panel-2);
  color: var(--text);
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.calibration-save-actions {
  margin-top: 12px;
}

.calibration-save-actions button:last-child {
  border-color: var(--yellow);
  color: var(--yellow);
}

.calibration-viewer {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.calibration-viewer figure {
  min-width: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 5px;
  overflow: hidden;
  background: #05080a;
}

.calibration-viewer img {
  display: block;
  width: 100%;
  height: auto;
}

.calibration-viewer figcaption {
  padding: 7px 9px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 9px;
}

.calibration-map-wrap {
  position: relative;
}

.calibration-overlay {
  position: absolute;
  inset: 0;
}

.calibration-handle {
  position: absolute;
  width: 22px;
  height: 22px;
  border: 2px solid #050708;
  border-radius: 50%;
  background: var(--yellow);
  transform: translate(-50%, -50%);
  cursor: grab;
  box-shadow: 0 0 0 2px rgba(255,255,255,.75);
  color: #050708;
  font-size: 9px;
  font-weight: 900;
  line-height: 17px;
  text-align: center;
  user-select: none;
  touch-action: none;
}

.calibration-handle.range {
  background: var(--cyan);
}

.calibration-handle.calendar {
  border-radius: 4px;
  background: var(--orange);
}

.calibration-handle.calendar-text {
  width: 42px;
  height: 18px;
  border-radius: 3px;
  background: #f5f5f5;
  color: #111;
  font-size: 8px;
  line-height: 13px;
}

.calibration-handle.selected {
  box-shadow: 0 0 0 4px var(--red);
}

.calibration-handle.collision {
  outline: 2px solid var(--red);
}

.calibration-handle.protected-hit {
  box-shadow: 0 0 0 4px var(--yellow), 0 0 18px rgba(244,234,24,.7);
}

.calibration-handle.hidden-town {
  opacity: 0.38;
  border-style: dashed;
}

.calibration-region {
  position: absolute;
  border: 1px dashed rgba(244,234,24,.8);
  background: rgba(244,234,24,.08);
  pointer-events: none;
}

.calibration-active-area {
  position: absolute;
  border: 1px solid rgba(69,189,229,.8);
  pointer-events: none;
}

.final-output {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #070b0e;
  overflow: hidden;
}

.final-output-header,
.final-output-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
}

.final-output-header {
  border-bottom: 1px solid var(--line);
}

.final-output-header h3 {
  margin: 4px 0 0;
  font-size: 17px;
}

.final-output-header span:last-child {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-align: right;
  text-transform: uppercase;
}

.final-output-stage {
  min-height: 280px;
  display: grid;
  place-items: center;
  background:
    linear-gradient(45deg, rgba(255,255,255,.035) 25%, transparent 25% 75%, rgba(255,255,255,.035) 75%),
    #050708;
  background-size: 18px 18px;
}

.final-output-stage:has(.final-output-image:not(.hidden)) {
  min-height: 0;
  display: block;
  line-height: 0;
  background: #000;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
  padding-bottom: 1px;
}

.final-output.loading .final-output-stage::before {
  content: "Rendering final PNG";
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.final-output-image {
  display: block;
  vertical-align: top;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: none;
  object-fit: fill;
  border: 0;
  outline: 0;
  box-shadow: none;
  border-radius: 0;
}

.final-output-actions {
  border-top: 1px solid var(--line);
}

.secondary-action-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 13px;
  background: transparent;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.secondary-action-button:hover {
  border-color: var(--yellow);
}

.preview-toolbar {
  margin-bottom: 18px;
}

.eyebrow {
  color: var(--red);
  font-size: 10px;
  font-weight: 900;
}

.preview-toolbar h2 {
  margin: 5px 0 0;
  font-size: 20px;
}

.download-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
}

.download-button:hover {
  border-color: var(--cyan);
}

.preview-stage {
  position: relative;
  width: 100%;
  min-height: 420px;
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #050708;
}

.preview-stage:has(.generated-image:not(.hidden)) {
  min-height: 0;
  border: 0;
  border-radius: 0;
  display: block;
  line-height: 0;
  overflow: visible;
  background: #000;
  box-shadow: none;
  padding-bottom: 1px;
}

.generated-image {
  display: block;
  vertical-align: top;
  width: auto;
  max-width: 100%;
  height: auto;
  object-fit: fill;
  border: 0;
  outline: 0;
  box-shadow: none;
  border-radius: 0;
}

.weather-placement-master-layer,
.weather-placement-outline-layer,
.weather-placement-container-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  user-select: none;
  pointer-events: none;
}

.weather-placement-master-layer.hidden,
.weather-placement-outline-layer.hidden,
.weather-placement-container-layer.hidden {
  display: none;
}

.weather-placement-master-layer {
  object-fit: fill;
}

.weather-placement-container-layer {
  overflow: hidden;
}

.weather-placement-outline-layer {
  border: 1px solid #8b38ff;
  box-shadow: 0 0 0 1px rgba(139, 56, 255, .28);
  box-sizing: border-box;
  z-index: 3;
}

.weather-placement-drag-layer {
  position: absolute;
  display: block;
  opacity: .52;
  will-change: transform;
  max-width: none;
  object-fit: fill;
  user-select: none;
  pointer-events: none;
}

.preview-stage.weather-placement-ready .generated-image {
  cursor: grab;
}

.preview-stage.weather-placement-dragging .generated-image {
  opacity: 1;
}

.preview-stage.weather-placement-dragging .weather-placement-container-layer {
  cursor: grabbing;
}

.preview-diagnostics {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #070b0e;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.preview-diagnostics.hidden {
  display: none;
}

.preview-diagnostics-header {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

.preview-diagnostics pre {
  margin: 0;
  padding: 10px;
  overflow: auto;
  white-space: pre-wrap;
}

.empty-state,
.loading-state {
  display: grid;
  justify-items: center;
  gap: 18px;
  color: var(--muted);
  text-align: center;
}

.empty-map {
  width: min(280px, 86%);
  display: grid;
  place-items: center;
  border-top: 3px solid var(--cyan);
  border-bottom: 3px solid var(--orange);
  padding: 20px 12px;
}

.empty-map span {
  color: #7f929f;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: .05em;
  text-align: center;
}

.screenshot-guide-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(4, 7, 9, .78);
}

.screenshot-guide-card {
  width: min(1120px, 96vw);
  max-height: 92vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d1216;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .55);
}

.screenshot-guide-header,
.screenshot-guide-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.screenshot-guide-actions {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.screenshot-guide-header h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0;
}

.screenshot-guide-close {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #151d24;
  color: var(--text);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.screenshot-guide-dismiss {
  min-height: 36px;
  border: 1px solid var(--cyan);
  border-radius: 4px;
  padding: 0 18px;
  background: var(--cyan);
  color: #071015;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.screenshot-guide-body {
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
  gap: 8px;
  padding: 16px;
  text-align: center;
}

.screenshot-guide-body img {
  max-width: 100%;
  max-height: min(68vh, 760px);
  width: auto;
  height: auto;
  justify-self: center;
  align-self: center;
  object-fit: contain;
  border: 1px solid #26323b;
  background: #e9eef2;
}

.screenshot-guide-body p {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
}

.screenshot-guide-body small {
  color: var(--muted);
  font-size: 12px;
}

.loading-line {
  width: 180px;
  height: 4px;
  background: linear-gradient(90deg, var(--yellow) 0 33%, var(--orange) 33% 66%, var(--red) 66%);
  animation: pulse 1s ease-in-out infinite alternate;
}

.preview-footer {
  padding-top: 12px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.weather-placement-panel {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.weather-placement-panel.authoring-inline {
  margin: 18px 0 10px;
  border: 1px solid var(--yellow);
  border-radius: 6px;
  padding: 14px;
  background: rgba(255, 245, 0, .06);
  box-shadow: 0 0 0 1px rgba(255, 245, 0, .08) inset;
}

.weather-placement-panel.hidden {
  display: none;
}

.weather-placement-header,
.weather-placement-controls,
.weather-placement-readout {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
}

.weather-placement-header h2 {
  margin: 4px 0 0;
  font-size: 16px;
}

#weather-placement-state {
  border: 1px solid var(--yellow);
  padding: 5px 8px;
  color: var(--yellow);
  font-size: 11px;
  font-weight: 900;
}

.weather-placement-controls {
  margin-top: 14px;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.weather-placement-controls label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.weather-placement-controls input {
  width: 96px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 7px 8px;
  background: #080b0e;
  color: var(--text);
}

.weather-placement-controls button {
  border: 0;
  border-radius: 4px;
  padding: 10px 14px;
  background: var(--yellow);
  color: #07090a;
  font-weight: 900;
  cursor: pointer;
}

.weather-placement-controls button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.weather-placement-advanced {
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
}

.weather-placement-advanced summary {
  cursor: pointer;
  font-weight: 800;
}

.weather-placement-readout {
  align-items: stretch;
  margin-top: 14px;
}

.weather-placement-readout > div {
  flex: 1;
  min-width: 0;
}

.weather-placement-readout strong {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
}

.weather-placement-readout pre {
  min-height: 54px;
  max-height: 120px;
  overflow: auto;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 8px;
  background: #080b0e;
  color: #dbe8ee;
  font-size: 10px;
  white-space: pre-wrap;
}

.weather-placement-status {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.diagnostic-panel {
  margin-top: 34px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.diagnostic-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.diagnostic-header h2 {
  margin: 5px 0 0;
  font-size: 18px;
}

.diagnostic-status {
  border: 1px solid var(--red);
  border-radius: 4px;
  padding: 7px 9px;
  color: #ff7778;
  font-size: 10px;
  font-weight: 900;
}

.diagnostic-status.pass {
  border-color: var(--cyan);
  color: var(--cyan);
}

.diagnostic-status.warning {
  border-color: var(--yellow);
  color: var(--yellow);
}

.normalization-summary {
  margin: 14px 0 18px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  line-height: 1.6;
}

.alignment-residuals {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: -7px 0 17px;
}

.alignment-residuals span {
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 5px 7px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
}

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

.diagnostic-images figure {
  min-width: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 5px;
  overflow: hidden;
  background: #050708;
}

.diagnostic-images img {
  display: block;
  width: 100%;
  aspect-ratio: 808 / 667;
  object-fit: contain;
}

.diagnostic-images figcaption {
  padding: 9px 11px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
}

.diagnostic-table-wrap {
  margin-top: 14px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 5px;
}

.diagnostic-table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
  font-size: 11px;
}

.diagnostic-table th,
.diagnostic-table td {
  padding: 9px 11px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.diagnostic-table th {
  color: var(--cyan);
  font-size: 9px;
  text-transform: uppercase;
}

.diagnostic-table tbody tr:last-child td {
  border-bottom: 0;
}

.diagnostic-table tbody tr:hover {
  background: var(--panel-2);
}

.hidden {
  display: none !important;
}

@keyframes pulse {
  from { opacity: .35; }
  to { opacity: 1; }
}

@media (max-width: 860px) {
  .workspace {
    display: block;
  }

  .control-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .preview-panel {
    min-height: 650px;
  }

  .anchor-canvases {
    grid-template-columns: 1fr;
  }

  .calibration-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .calibration-viewer {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .topbar {
    padding: 12px 16px;
  }

  .environment {
    display: none;
  }

  .control-panel,
  .preview-panel {
    padding: 22px 16px;
  }

  .preview-toolbar {
    align-items: flex-start;
    gap: 14px;
  }

  .download-button {
    padding: 0 10px;
  }

  .zone-switch {
    display: grid;
    grid-template-columns: 1fr;
  }

  .final-output-header,
  .final-output-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .final-output-header span:last-child {
    text-align: left;
  }

  .final-output-actions .download-button,
  .secondary-action-button {
    justify-content: center;
    width: 100%;
  }

  .preview-stage {
    min-height: 300px;
  }

  .diagnostic-images {
    grid-template-columns: 1fr;
  }

  .override-columns {
    display: none;
  }

  .override-row {
    grid-template-columns: 1fr 1fr;
  }

  .override-row strong {
    grid-column: 1 / -1;
  }
}
