:root {
  --rk-bg: #f5f1e9;
  --rk-paper: #fffdf9;
  --rk-paper-2: #faf7f0;
  --rk-ink: #20323a;
  --rk-muted: #68777b;
  --rk-line: #dcd7cd;
  --rk-brand: #2f6d63;
  --rk-brand-dark: #205249;
  --rk-brand-soft: #e5f0ed;
  --rk-gold: #c69a4b;
  --rk-danger: #a33d3d;
  --rk-warning: #8a5d12;
  --rk-success: #256744;
  --rk-shadow: 0 16px 45px rgba(32, 50, 58, .10);
  --rk-radius: 18px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--rk-ink);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body.rk-standalone,
body.rk-review-body {
  margin: 0;
  background: var(--rk-bg);
  color: var(--rk-ink);
}

button,
input,
select,
textarea { font: inherit; }

button,
input[type="radio"],
input[type="checkbox"],
label { -webkit-tap-highlight-color: transparent; }

a { color: var(--rk-brand-dark); }
a:hover { color: var(--rk-brand); }

.rk-app,
.rk-review {
  width: min(1160px, calc(100% - 30px));
  margin: 0 auto;
  padding: 28px 0 54px;
}

.rk-shell {
  overflow: hidden;
  border: 1px solid rgba(47, 109, 99, .14);
  border-radius: 24px;
  background: var(--rk-paper);
  box-shadow: var(--rk-shadow);
}

.rk-hero {
  padding: clamp(26px, 4vw, 48px);
  background:
    radial-gradient(circle at 88% 0, rgba(198, 154, 75, .15), transparent 32%),
    linear-gradient(135deg, #edf4f1 0%, #fffaf1 68%, #f8eee0 100%);
  border-bottom: 1px solid var(--rk-line);
}

.rk-hero h1,
.rk-review h1 {
  margin: 3px 0 10px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 5vw, 3.25rem);
  line-height: 1.05;
  font-weight: 500;
  letter-spacing: -.025em;
}

.rk-hero p { max-width: 760px; margin: 0; line-height: 1.6; }
.rk-eyebrow { margin: 0; color: var(--rk-brand); font-size: .78rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.rk-version { color: var(--rk-muted); font-size: .78rem; }

.rk-test-banner,
.rk-alert {
  margin: 18px 0 0;
  padding: 13px 16px;
  border-radius: 12px;
  line-height: 1.45;
}

.rk-test-banner { border: 1px solid #e4c77e; background: #fff7dd; color: #6b4a05; }
.rk-alert { border: 1px solid #bcd7d1; background: #eef7f5; }
.rk-alert-warning { border-color: #e3c47b; background: #fff8e5; color: #684800; }
.rk-alert-error { border-color: #e3b5b5; background: #fff0f0; color: #842f2f; }
.rk-alert-success { border-color: #b8d8c6; background: #eef9f2; color: #1e5d3b; }
.rk-alert-info { border-color: #b8d5d4; background: #f0f8f7; color: #285b57; }
.rk-compact-alert { margin-top: 5px; padding: 10px 12px; font-size: .82rem; }

.rk-stepper {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 18px clamp(18px, 4vw, 48px);
  border-bottom: 1px solid var(--rk-line);
  background: var(--rk-paper-2);
}

.rk-step-indicator {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--rk-muted);
  text-align: left;
  cursor: default;
}

.rk-step-indicator span {
  display: grid;
  place-items: center;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  border: 1px solid var(--rk-line);
  border-radius: 50%;
  background: #fff;
  font-weight: 800;
}

.rk-step-indicator.is-active { background: var(--rk-brand-soft); color: var(--rk-brand-dark); }
.rk-step-indicator.is-active span,
.rk-step-indicator.is-done span { border-color: var(--rk-brand); background: var(--rk-brand); color: white; }
.rk-step-indicator.is-done { color: var(--rk-brand); }

.rk-form { padding: clamp(22px, 4vw, 48px); }
.rk-step[hidden] { display: none !important; }
.rk-step h2,
.rk-card h2 { margin: 0 0 7px; font-size: clamp(1.35rem, 2.5vw, 1.8rem); }
.rk-lead { margin: 0 0 26px; color: var(--rk-muted); line-height: 1.55; }
.rk-required-note { color: var(--rk-muted); font-size: .85rem; }

.rk-section {
  margin: 26px 0;
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid var(--rk-line);
  border-radius: var(--rk-radius);
  background: #fff;
}

.rk-section h3 { margin: 0 0 18px; font-size: 1.08rem; }
.rk-section-intro { margin: -8px 0 16px; }
.rk-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.rk-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rk-field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.rk-field-full { grid-column: 1 / -1; }
.rk-field label,
.rk-group-label { font-weight: 700; font-size: .92rem; }
.rk-help { color: var(--rk-muted); font-size: .82rem; line-height: 1.4; }

.rk-field input,
.rk-field select,
.rk-field textarea,
.rk-link-box input {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid #bfc8c7;
  border-radius: 10px;
  background: #fff;
  color: var(--rk-ink);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.rk-field textarea { min-height: 105px; resize: vertical; }
.rk-field input:focus,
.rk-field select:focus,
.rk-field textarea:focus,
.rk-link-box input:focus { border-color: var(--rk-brand); box-shadow: 0 0 0 3px rgba(47, 109, 99, .15); }
.rk-field input:user-invalid,
.rk-field select:user-invalid { border-color: var(--rk-danger); }

.rk-check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.rk-check,
.rk-consent,
.rk-toggle {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.45;
}
.rk-check input,
.rk-consent input,
.rk-toggle input { flex: 0 0 auto; width: 19px; height: 19px; margin-top: 1px; accent-color: var(--rk-brand); }

.rk-radio-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.rk-choice-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 62px;
  padding: 15px;
  border: 1px solid #bdc8c5;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  line-height: 1.42;
}
.rk-choice-card:has(input:checked) { border-color: var(--rk-brand); background: var(--rk-brand-soft); box-shadow: 0 0 0 2px rgba(47,109,99,.1); }
.rk-choice-card input { flex: 0 0 auto; width: 19px; height: 19px; margin-top: 1px; accent-color: var(--rk-brand); }
.rk-third-party-consent { margin-top: 14px; padding: 14px; border: 1px solid #d9c488; border-radius: 12px; background: #fff9e9; }
.rk-time-row { display: grid; grid-template-columns: minmax(130px, .8fr) minmax(170px, 1fr); gap: 10px; align-items: center; }
.rk-time-unknown { align-items: center; min-height: 46px; padding: 9px 11px; border: 1px solid #cbd2d1; border-radius: 10px; background: var(--rk-paper-2); font-size: .86rem; }
.rk-conditional-field { margin-top: 14px; max-width: 720px; }
.rk-conditional-field textarea { min-height: 78px; }
.rk-char-count { align-self: flex-end; color: var(--rk-muted); font-size: .76rem; }

.rk-source-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.rk-source-card {
  position: relative;
  display: block;
  padding: 20px;
  border: 2px solid var(--rk-line);
  border-radius: 15px;
  background: #fff;
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .15s;
}
.rk-source-card:hover { transform: translateY(-1px); border-color: #a9c7c1; }
.rk-source-card input { position: absolute; opacity: 0; pointer-events: none; }
.rk-source-card strong { display: block; margin-bottom: 7px; font-size: 1.04rem; }
.rk-source-card small { display: block; color: var(--rk-muted); line-height: 1.45; }
.rk-source-card:has(input:checked) { border-color: var(--rk-brand); background: var(--rk-brand-soft); }

.rk-google-setup,
.rk-upload-setup { margin: 20px 0; padding: 18px; border-radius: 14px; background: var(--rk-paper-2); border: 1px solid var(--rk-line); }
.rk-google-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; margin-top: 14px; }
.rk-google-actions input { min-height: 46px; padding: 10px 12px; border: 1px solid #bfc8c7; border-radius: 10px; }
.rk-google-note { margin: 12px 0 0; color: var(--rk-muted); font-size: .8rem; line-height: 1.45; }

.rk-plan-workspace { margin-top: 20px; }
.rk-stage-wrap { position: relative; }
.rk-plan-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 2px solid #788988;
  border-radius: 15px;
  background:
    linear-gradient(45deg, #eef0ec 25%, transparent 25%),
    linear-gradient(-45deg, #eef0ec 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #eef0ec 75%),
    linear-gradient(-45deg, transparent 75%, #eef0ec 75%), #f7f8f5;
  background-size: 24px 24px;
  background-position: 0 0, 0 12px, 12px -12px, -12px 0;
  touch-action: auto;
  user-select: none;
}
.rk-plan-stage.is-upload { touch-action: none; cursor: grab; }
.rk-plan-stage.is-upload:active { cursor: grabbing; }
.rk-map,
.rk-upload-plan { position: absolute; inset: 0; width: 100%; height: 100%; }
.rk-upload-plan { inset: auto; max-width: none; pointer-events: none; transform-origin: center; }
.rk-map[hidden], .rk-upload-plan[hidden] { display: none; }

.rk-stage-badge {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 8;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .93);
  box-shadow: 0 3px 12px rgba(0,0,0,.15);
  font-size: .75rem;
  font-weight: 800;
  pointer-events: none;
}

.rk-north-marker {
  position: absolute;
  right: 12px;
  top: 12px;
  z-index: 9;
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border: 1px solid rgba(32, 50, 58, .45);
  border-radius: 50%;
  background: rgba(255, 255, 255, .93);
  box-shadow: 0 3px 12px rgba(0,0,0,.14);
  color: var(--rk-ink);
  pointer-events: none;
}
.rk-north-marker::before { content: ""; position: absolute; top: 7px; border-left: 7px solid transparent; border-right: 7px solid transparent; border-bottom: 20px solid #b74b42; }
.rk-north-marker span { position: absolute; bottom: 9px; font-size: .84rem; font-weight: 900; }

.rk-furniture {
  position: absolute;
  z-index: 7;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  min-height: 55px;
  transform-origin: center;
  cursor: move;
  touch-action: none;
  filter: drop-shadow(0 5px 8px rgba(0,0,0,.25));
}
.rk-furniture[hidden] { display: none; }
.rk-furniture-image { display: block; width: 100%; height: 100%; object-fit: contain; pointer-events: none; user-select: none; }
.rk-furniture-readonly { cursor: default; touch-action: auto; }
.rk-rotate-handle {
  position: absolute;
  left: 50%;
  top: -30px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  transform: translateX(-50%);
  border: 2px solid white;
  border-radius: 50%;
  background: var(--rk-brand-dark);
  color: white;
  box-shadow: 0 2px 7px rgba(0,0,0,.35);
  cursor: grab;
  font-size: 16px;
}

.rk-plan-rotate-handle {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 10;
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  padding: 4px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--rk-brand-dark);
  color: #fff;
  box-shadow: 0 4px 14px rgba(0,0,0,.32);
  cursor: grab;
  touch-action: none;
}
.rk-plan-rotate-handle:active { cursor: grabbing; }
.rk-plan-rotate-handle span { font-size: 1.55rem; line-height: 1; }
.rk-plan-rotate-handle small { font-size: .58rem; line-height: 1; }

.rk-plan-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--rk-line);
  border-radius: 14px;
  background: var(--rk-paper-2);
}
.rk-control { display: flex; flex-direction: column; gap: 7px; }
.rk-control label { font-size: .84rem; font-weight: 700; }
.rk-control input[type="range"] { width: 100%; accent-color: var(--rk-brand); }
.rk-north-confirm { margin-top: 17px; padding: 14px; border-radius: 12px; background: #fff9e9; border: 1px solid #e6cd91; }

.rk-review-summary { display: grid; gap: 11px; padding: 18px; border-radius: 14px; background: var(--rk-paper-2); border: 1px solid var(--rk-line); }
.rk-summary-row { display: grid; grid-template-columns: minmax(140px, .4fr) 1fr; gap: 12px; padding-bottom: 9px; border-bottom: 1px solid var(--rk-line); }
.rk-summary-row:last-child { border: 0; padding-bottom: 0; }
.rk-summary-row strong { color: var(--rk-muted); }
.rk-review-plan-card { margin-top: 18px; }
.rk-review-plan-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.rk-review-plan-heading h3 { margin-bottom: 5px; }
.rk-review-plan-heading p { margin: 0; }
.rk-review-plan-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 2px solid #788988;
  border-radius: 14px;
  background: #f4f3ef;
}
.rk-review-plan-stage > img { display: block; width: 100%; height: 100%; object-fit: contain; background: #f8f7f3; }
.rk-review-plan-stage .rk-map { position: absolute; inset: 0; }

.rk-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 30px;
  padding-top: 22px;
  border-top: 1px solid var(--rk-line);
}
.rk-actions-right { margin-left: auto; display: flex; gap: 10px; }
.rk-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 11px 20px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: var(--rk-brand);
  color: white;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s, transform .15s, opacity .15s;
}
.rk-button:hover { background: var(--rk-brand-dark); color: white; transform: translateY(-1px); }
.rk-button:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.rk-button-secondary { border-color: #aebbb8; background: white; color: var(--rk-brand-dark); }
.rk-button-secondary:hover { background: var(--rk-brand-soft); color: var(--rk-brand-dark); }
.rk-button-small { min-height: 42px; padding: 8px 14px; }

.rk-submit-status { margin-top: 15px; }
.rk-success-card { padding: clamp(28px, 6vw, 60px); text-align: center; }
.rk-success-mark { display: grid; place-items: center; width: 70px; height: 70px; margin: 0 auto 18px; border-radius: 50%; background: var(--rk-brand); color: white; font-size: 2rem; }
.rk-record-number { display: inline-block; margin: 14px 0; padding: 10px 16px; border-radius: 10px; background: var(--rk-brand-soft); font-weight: 900; letter-spacing: .04em; }

.rk-honeypot { position: absolute !important; left: -10000px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }

.rk-footer { padding: 18px clamp(20px, 4vw, 48px) 28px; color: var(--rk-muted); font-size: .8rem; text-align: center; }
.rk-footer a { margin: 0 5px; }

/* Geschützte Vorgangsansicht */
.rk-review { max-width: 1180px; }
.rk-review-header,
.rk-card { margin-bottom: 20px; padding: clamp(20px, 4vw, 34px); border: 1px solid var(--rk-line); border-radius: var(--rk-radius); background: var(--rk-paper); box-shadow: 0 8px 28px rgba(32,50,58,.06); }
.rk-review-header h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
.rk-status { display: inline-block; padding: 5px 9px; border-radius: 999px; background: #eef1f0; font-size: .75rem; font-weight: 800; }
.rk-status-sent { background: #e5f5eb; color: #1e653d; }
.rk-status-failed { background: #fde9e9; color: #8a3030; }
.rk-status-test_mode { background: #fff2cf; color: #765008; }
.rk-review-stage { max-width: 940px; margin: 18px auto; }
.rk-review-images { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; }
.rk-review-images figure { margin: 0; }
.rk-review-images img { display: block; width: 100%; border: 1px solid var(--rk-line); border-radius: 10px; }
.rk-review-images figcaption { padding-top: 7px; color: var(--rk-muted); font-size: .82rem; }
.rk-data-pre { max-height: 620px; overflow: auto; padding: 17px; border-radius: 10px; background: #f4f3ef; white-space: pre-wrap; word-break: break-word; line-height: 1.55; }
.rk-file-list { margin: 0; padding-left: 20px; line-height: 1.8; }
.rk-link-box { display: grid; gap: 8px; margin: 18px 0; }
.rk-table-wrap { overflow-x: auto; }
.rk-table { width: 100%; border-collapse: collapse; }
.rk-table th, .rk-table td { padding: 11px 10px; border-bottom: 1px solid var(--rk-line); text-align: left; vertical-align: top; white-space: nowrap; }
.rk-table th { background: var(--rk-paper-2); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; }
.rk-check-ok, .rk-check-open { display: inline-block; padding: 3px 8px; border-radius: 999px; font-size: .75rem; font-weight: 800; }
.rk-check-ok { background: #e3f4e9; color: #226541; }
.rk-check-open { background: #fff0d2; color: #7a5100; }

@media (max-width: 760px) {
  .rk-app, .rk-review { width: min(100% - 16px, 1160px); padding-top: 8px; }
  .rk-shell { border-radius: 16px; }
  .rk-hero { padding: 24px 20px; }
  .rk-stepper { padding: 12px; }
  .rk-step-indicator { justify-content: center; padding: 8px 4px; }
  .rk-step-indicator em { display: none; }
  .rk-form { padding: 20px 14px 28px; }
  .rk-grid, .rk-grid-3, .rk-source-grid, .rk-check-grid, .rk-radio-grid, .rk-review-images { grid-template-columns: 1fr; }
  .rk-time-row { grid-template-columns: 1fr; }
  .rk-plan-controls { grid-template-columns: 1fr; }
  .rk-google-actions { grid-template-columns: 1fr; }
  .rk-north-marker { width: 54px; height: 54px; }
  .rk-review-plan-heading { align-items: stretch; flex-direction: column; }
  .rk-review-plan-heading .rk-button { width: 100%; }
  .rk-summary-row { grid-template-columns: 1fr; gap: 3px; }
  .rk-actions { flex-wrap: wrap; }
  .rk-actions-right { width: 100%; }
  .rk-actions-right .rk-button { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
