/* Buckla PWA — Mobile-first styles */

:root {
  --blue: #1a56db;
  --blue-dark: #1444a8;
  --blue-light: #e8eefb;
  --customer-color: #795238;
  --service-color: #16a34a;
  --order-color: #1a56db;
  --green: var(--service-color);
  --red: #dc2626;
  --orange: #f59e0b;
  --order: #ea580c;
  --order-dark: #c2410c;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.15);
  
  /* Error and warning states */
  --error: #dc2626;
  --error-bg: #fee2e2;
  --error-text: #991b1b;
  --warning: #f59e0b;
  --warning-bg: #fef3c7;
  --warning-text: #92400e;
  --nav-bar-height: 48px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--gray-50);
  color: var(--gray-900);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  min-height: 100dvh;
}

.hidden { display: none !important; }

/* Header */
.header {
  background: var(--blue);
  color: #fff;
  height: 46px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 90;
}
.dev-mode .header {
  background: var(--red);
}
.header h1 {
  font-size: 16px;
  flex: 0 1 auto;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 52vw;
  min-width: 0;
}
.header h1.hidden { display: none !important; }
.header-center-title {
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  pointer-events: none;
}
.header-right-slot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-left: auto;
  flex: 0 0 auto;
  flex-shrink: 0;
  gap: 8px;
  min-width: 0;
}
.header-reg-input {
  width: 96px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  letter-spacing: 1px;
  text-transform: uppercase;
  outline: none;
}
.header-reg-input::placeholder {
  color: rgba(255, 255, 255, 0.8);
}
.header-reg-input:focus {
  border-color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.24);
}
.header-reg-input.is-clickable {
  cursor: pointer;
}
.damage-header-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  width: 100%;
  min-width: 0;
}
.damage-header-offering-buttons {
  display: flex;
  align-items: stretch;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.12);
}
.damage-header-offering-btn {
  border: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.18);
  background: transparent;
  color: rgba(255, 255, 255, 0.92);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  padding: 0 10px;
  min-height: 34px;
  white-space: nowrap;
}
.damage-header-offering-btn:last-child {
  border-right: 0;
}
.damage-header-offering-btn.active {
  background: rgba(255, 255, 255, 0.28);
  color: #fff;
}
.damage-header-offering-btn:disabled {
  opacity: 0.7;
}
.damage-header-offering-select {
  width: min(180px, 100%);
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 0 32px 0 10px;
}
.damage-header-offering-select option {
  color: var(--gray-900);
}
.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;
}
.header-status {
  position: absolute;
  right: 12px;
  top: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--orange);
  color: #111827;
  border: 1px solid #d97706;
  border-radius: 999px;
  padding: 2px 10px;
  pointer-events: none;
}
.header-menu-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.12));
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}
.header-menu-btn:hover,
.header-menu-btn:focus-visible {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.16));
  border-color: rgba(255, 255, 255, 0.78);
}
.header-menu-btn:active {
  transform: translateY(1px);
}
.header-menu-btn:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.86);
  outline-offset: 1px;
}
.header-menu-icon {
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
}

/* Menu page */
.menu-row {
  width: 100%;
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 8px;
  padding: 10px 16px;
  border: none;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
  color: var(--gray-900);
  font-size: 16px;
  text-align: left;
  cursor: pointer;
}
.menu-row:active { background: var(--gray-100); }
.menu-row:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.menu-row-icon { font-size: 22px; width: 28px; text-align: center; }
.menu-row-label { flex: 1; }
.menu-row-chevron { color: var(--gray-400); font-size: 20px; }

/* The service the active order already has */
.home-offering-button.is-selected {
  box-shadow: inset 0 0 0 2px var(--service-color);
  font-weight: 700;
}

.btn-icon {
  background: none;
  border: none;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  padding: 4px 8px;
}

/* Unsaved-state lamp */
.unsaved-lamp {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #22c55e; /* green = no unsaved work */
  flex-shrink: 0;
  transition: background 0.2s;
}
.unsaved-lamp.dirty {
  background: #ef4444; /* red = unsaved work in memory */
}

/* Upgrade banner */
.upgrade-banner {
  background: #1a56db;
  color: #fff;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 16px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.upgrade-banner-debug {
  font-size: 10px;
  font-weight: 400;
  opacity: 0.75;
  margin-top: 2px;
  word-break: break-all;
}

/* Main */
main {
  padding: 16px;
  padding-bottom: 80px;
  max-width: 480px;
  margin: 0 auto;
}

main:has(> .login-container > [data-flow-instance="session-error"]) {
  align-items: center;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100dvh;
  position: relative;
  padding-bottom: 16px;
}

main:has(> .login-container > [data-flow-instance="session-error"]) > .app-build-footer {
  left: 0;
  position: absolute;
  right: 0;
  bottom: 16px;
}

/* Bottom nav */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  min-height: var(--nav-bar-height);
  background: #fff;
  border-top: 1px solid var(--gray-200);
  display: flex;
  justify-content: space-around;
  padding: 3px 0;
  padding-bottom: max(3px, env(safe-area-inset-bottom));
  z-index: 90;
}
.bottom-nav button {
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 3px 14px;
  font-size: 10px;
  color: var(--gray-500);
  cursor: pointer;
  border-radius: 8px;
}
.bottom-nav button.active {
  color: var(--blue);
  font-weight: 600;
}
.bottom-nav button[data-view="new-order"].active {
  color: var(--gray-500);
  font-weight: 400;
}
.nav-icon { font-size: 20px; }

/* Attention blink — used for support alerts */
@keyframes blink-attention {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.15; }
}
.blink-attention {
  animation: blink-attention 1s ease-in-out infinite;
}
.btn-attention {
  border-color: var(--orange);
  color: var(--orange);
  background: var(--warning-bg);
  animation: blink-attention 1s ease-in-out infinite;
}
.history-item.support-waiting {
  background: var(--warning-bg);
  border-left: 4px solid var(--orange);
  padding-left: 12px;
}

/* Cards */
.card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 12px;
}
.card-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--gray-800);
}

.pricing-model-top-tabs {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #fff;
  margin: 0 0 12px;
  padding: 0;
  border-top: 1px solid var(--gray-200);
  border-bottom: 1px solid var(--gray-200);
}

#offering-picker.pricing-model-top-tabs {
  margin: -16px -16px 12px;
  top: 46px;
  border-top: 0;
}

.pricing-model-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 0;
  min-height: var(--nav-bar-height);
}

.pricing-model-tabs .btn {
  border-radius: 0;
  border: 0;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
  min-height: var(--nav-bar-height);
  padding: 0 12px;
  width: auto;
}

#offering-picker .pricing-model-tabs .btn {
  flex: 1 1 0;
  margin: 0;
  border-right: 1px solid var(--gray-200);
}

#offering-picker .pricing-model-tabs .btn:last-child {
  border-right: 0;
}

.profile-tabs-bar {
  position: sticky;
  top: 46px;
  margin: -16px -16px 12px;
  border-top: 0;
}

.profile-tabs-bar .pricing-model-tabs .btn {
  flex: 1 1 0;
  margin: 0;
  border-right: 1px solid var(--gray-200);
}

.profile-tabs-bar .pricing-model-tabs .btn:last-child {
  border-right: 0;
}

/* Profile — Moduler tab */
.profile-fortnox-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  font-size: 14px;
  border-bottom: 1px solid var(--gray-100);
}
.profile-fortnox-status-row .profile-field-label { color: var(--gray-500); }
.profile-module-status {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--gray-100);
  white-space: nowrap;
}
.profile-module-detail {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--gray-600);
}
.profile-fortnox-card .btn { margin-top: 12px; }
.profile-active-modules ul,
.profile-inactive-modules ul {
  list-style: none;
}
.profile-active-modules li,
.profile-inactive-modules li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  font-size: 14px;
  border-bottom: 1px solid var(--gray-100);
}
.profile-active-modules li:last-child,
.profile-inactive-modules li:last-child { border-bottom: 0; }
.profile-active-modules li::before,
.profile-inactive-modules li::before {
  content: '';
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
}
.profile-inactive-modules li::before { background: var(--gray-300); }
.profile-module-item.inactive { color: var(--gray-500); }
.profile-module-empty { font-size: 14px; color: var(--gray-500); }
.profile-active-modules .profile-module-detail {
  margin-top: 8px;
  padding: 8px 10px;
  font-size: 12px;
  color: var(--gray-500);
  background: var(--gray-50);
  border-radius: 8px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 20px;
  min-height: 40px;
  border: none;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  transition: background 0.15s;
}
.btn-primary {
  background: var(--blue);
  color: #fff;
}
.btn-primary:active { background: var(--blue-dark); }
.btn-success {
  background: var(--service-color);
  color: #fff;
}
.btn-warning {
  background: var(--warning);
  color: var(--warning-text);
}
.btn-order {
  background: var(--order-color);
  color: #fff;
}
.btn-order:active { filter: brightness(0.9); }
.btn-customer, [data-flow-button="active-order-customer"] { background: var(--customer-color); color: #fff; }
.btn-customer:active, [data-flow-button="active-order-customer"]:active { filter: brightness(0.9); }
.btn-secondary {
  background: var(--gray-700);
  color: #fff;
}
.btn-danger {
  background: var(--red);
  color: #fff;
}
.btn-outline {
  background: #fff;
  color: var(--blue);
  border: 2px solid var(--blue);
}
.btn-sm {
  padding: 8px 14px;
  font-size: 14px;
}
.h4-row-delete {
  width: 32px;
  min-width: 32px;
  height: 32px;
  padding: 0;
}
.btn + .btn { margin-top: 8px; }

.pdf-reader-bar .btn {
  flex: 1 1 0;
  width: 50%;
  min-width: 0;
  min-height: 48px;
  margin: 0;
}
.pdf-reader-back-button {
  min-width: 0;
  padding: 4px 12px;
  font-size: 30px;
  line-height: 1;
}
.pdf-reader-download-action {
  padding: 12px 20px;
}

/* Forms */
.form-group {
  margin-bottom: 16px;
}
/* Vehicle registration, its known-numbers picker and camera share one compact row. */
.vehicle-card-row { display: flex; gap: 6px; align-items: stretch; margin-bottom: 12px; }
.vehicle-card-field { position: relative; flex: 1; min-width: 0; }
.vehicle-card-field .form-input { height: 40px; padding-top: 6px; padding-bottom: 6px; }
.vehicle-card-field:has(.vehicle-card-picker-toggle) .form-input { padding-right: 48px; }
.vehicle-card-picker-toggle { align-items: center; display: flex; justify-content: center; line-height: 1; position: absolute; right: 4px; top: 4px; bottom: 4px; width: 40px; border: none; background: transparent; color: var(--gray-500); font-size: 20px; cursor: pointer; border-radius: 8px; }
.vehicle-card-picker { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 20; background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius); box-shadow: var(--shadow-lg); overflow: hidden; }
.vehicle-card-picker-option { display: block; width: 100%; height: 48px; padding: 0 16px; border: none; border-bottom: 1px solid var(--gray-100); background: #fff; font-size: 18px; font-weight: 600; letter-spacing: 2px; text-align: left; cursor: pointer; color: var(--gray-900); }
.vehicle-card-picker-option:last-child { border-bottom: none; }
.vehicle-card-picker-option.is-selected { background: var(--blue-light); color: var(--blue-dark); }
#customer-form { position: relative; }
.customer-registration-search { margin-bottom: 16px; }
.customer-registration-search-toggle { position: absolute; top: 12px; right: 16px; z-index: 1; }
.customer-registration-card { position: relative; padding: 16px; border: 1px solid var(--gray-200); border-radius: var(--radius); background: var(--white, #fff); }
.customer-registration-search-toggle { width: auto; min-height: 32px; margin: 0; }
.customer-registration-search-close { position: absolute; top: 6px; right: 8px; width: 32px; min-height: 32px; padding: 0; border: 0; background: transparent; color: var(--gray-500); font-size: 26px; line-height: 1; cursor: pointer; }
.customer-registration-card .customer-registration-search-row { margin-top: 28px; }
.customer-registration-search-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.customer-order-registrations { display: flex; flex-wrap: wrap; gap: 6px 12px; margin: 8px 0 12px; }
.customer-registration-link, .customer-registration-plain { border: 0; background: none; padding: 0; color: var(--gray-900); font: inherit; font-weight: 600; letter-spacing: 1px; }
.customer-registration-link { color: var(--blue-dark); text-decoration: underline; cursor: pointer; }
.customer-registration-results { display: grid; gap: 8px; margin-top: 12px; }
.customer-registration-match { padding: 12px; border: 1px solid var(--gray-200); border-radius: var(--radius); }
.customer-registration-match p { margin: 0 0 8px; }
.vehicle-card-camera { flex: 0 0 48px; width: 48px; height: 40px; min-height: 40px; margin: 0; padding: 0; font-size: 20px; }
.order-details-status-message { color: var(--gray-500); font-size: 13px; margin-top: 8px; text-align: center; }
.form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 6px;
}
.form-input {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 16px;
  background: #fff;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 0.15s;
}
.form-input:focus {
  outline: none;
  border-color: var(--blue);
}
select.form-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='%236b7280' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}

/* Toggle */
.toggle-group {
  display: flex;
  gap: 8px;
}
.toggle-btn {
  flex: 1;
  padding: 10px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  background: #fff;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-600);
  cursor: pointer;
  text-align: center;
}
.toggle-btn.active {
  border-color: var(--blue);
  background: var(--blue-light);
  color: var(--blue);
}

/* Slider */
.slider-container {
  display: flex;
  align-items: center;
  gap: 12px;
}
.slider-container input[type="range"] {
  flex: 1;
  height: 8px;
  appearance: none;
  -webkit-appearance: none;
  background: var(--gray-200);
  border-radius: 4px;
  outline: none;
}
.slider-container input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--blue);
  cursor: pointer;
}
.slider-value {
  font-size: 20px;
  font-weight: 700;
  min-width: 60px;
  text-align: center;
  color: var(--blue);
}

/* Price display */
.price-display {
  text-align: center;
  padding: 18px;
  background: linear-gradient(180deg, #f7faff 0%, #edf4ff 100%);
  border: 1px solid #d7e5ff;
  border-radius: calc(var(--radius) + 2px);
  margin: 12px 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.85);
}
.price-label {
  font-size: 12px;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}
.price-amount {
  font-size: 32px;
  font-weight: 800;
  color: var(--blue);
  letter-spacing: -0.03em;
}
.price-based {
  display: none;
}
.price-vat { font-size: 13px; color: var(--gray-500); margin-top: 2px; }

.price-display.price-display--inline-compact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 8px 0 12px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  text-align: left;
}

.price-display.price-display--inline-compact .price-label {
  display: none;
}

.price-display.price-display--inline-compact .price-amount,
.price-display.price-display--inline-compact .price-vat,
.price-display.price-display--inline-compact .price-based {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--gray-600);
  margin: 0;
}

.price-display.price-display--inline-compact .price-based {
  display: block;
  flex: 1 1 auto;
  text-align: center;
}

.price-display.price-display--inline-compact .price-vat {
  text-align: right;
  margin-left: auto;
}

.damage-intro {
  background:
    radial-gradient(circle at top right, rgba(59, 130, 246, 0.16), transparent 42%),
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border: 1px solid #dbe7fb;
}

.damage-intro-eyebrow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 8px;
}

.damage-intro-title {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.15;
  color: var(--gray-900);
}

.damage-intro-text {
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--gray-600);
}

.damage-form-card {
  border: 1px solid #e7eef8;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

/* H4 keeps its rows in its own form: the form card is split into the picker card and the rows card below it, as the other
   price models show their order rows (#dent-list) in a card of their own under the form card. */
.damage-form-card:has(#h4-form-root) {
  background: none;
  border: 0;
  box-shadow: none;
  padding: 0;
}
.h4-add-row-block { margin-bottom: 10px; }
.damage-form-card:has(#h4-form-root) .h4-add-row-block {
  background: #fff;
  border: 1px solid #e7eef8;
  border-radius: var(--radius);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
  padding: 16px;
  margin-bottom: 12px;
}
@media (max-width: 420px) {
  .damage-form-card:has(#h4-form-root) .h4-add-row-block { padding: 14px; }
}

.f1-manual-price-input { appearance: textfield; -moz-appearance: textfield; }
.f1-manual-price-input::-webkit-outer-spin-button,
.f1-manual-price-input::-webkit-inner-spin-button { margin: 0; -webkit-appearance: none; }

/* The add-on row (factor-add-row): [Tillägg ▾ | +]. One part, drawn by the dent-map forms (P5, T5), whose "+" is the
   page's own add button moved into the row's slot, and by the hail matrix (H4), whose "+" the part draws itself. */
.factor-add-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 8px;
  align-items: start;
  margin-top: 8px;
}
.factor-add-row > .factor-add-row__menu { margin: 0; min-width: 0; }
.factor-add-row .multi-select > summary {
  min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 6px;
  padding: 0 10px; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.factor-add-row .multi-select > summary::after { float: none; flex: 0 0 auto; }
.factor-add-row .multi-select[open] .multi-select-options {
  position: absolute; left: 0; right: 0; z-index: 5; background: #fff;
  border: 1px solid var(--gray-200); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 4px 12px;
}
.factor-add-row > .factor-add-row__add,
.factor-add-row > .factor-add-row__action > .btn {
  width: auto; min-width: 44px; min-height: 44px; margin: 0; padding: 0 12px; font-size: 24px; line-height: 1; white-space: nowrap;
}
.factor-add-row__action:empty { display: none; }
@media (max-width: 340px) {
  .factor-add-row .multi-select > summary { font-size: 13px; }
}

/* Dent-map form (P5, T5): the place the dent is on, its sizes, the add-on row, then the price row. */
.dent-map-zone {
  display: flex; align-items: baseline; gap: 6px; margin-bottom: 10px; min-width: 0;
}
.dent-map-zone__label { font-size: 13px; color: var(--gray-600); }
.dent-map-zone__name { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dent-map-zone__name:empty { display: none; }
.damage-form-card:has(.dent-map-form) .t3-process-times .form-group { margin-bottom: 12px; }
.damage-form-card:has(.dent-map-form) .price-display--inline-compact { margin: 12px 0 0; }
.damage-form-card:has(.dent-map-form) .price-display--inline-compact > * { white-space: nowrap; }
@media (max-width: 340px) {
  .damage-form-card:has(.dent-map-form) { padding: 12px; }
  .damage-form-card:has(.dent-map-form) .price-display--inline-compact > * { font-size: 11px; }
}

.damage-section-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 20px 0 8px;
}

.damage-section-bar .section-heading {
  margin: 0;
}

.damage-section-count {
  min-width: 28px;
  height: 28px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #eaf2ff;
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
}

.damage-dent-list {
  display: grid;
  gap: 10px;
}

/* RegisteredRowsCard */
.registered-rows-card {
  display: grid;
  gap: 8px;
  padding: 10px;
  background: #fff;
  border: 1px solid #e8edf5;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.registered-row-card {
  background: #fff;
  border: 1px solid #e8edf5;
  border-radius: 10px;
}

.registered-rows-card > .registered-row-card {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  border-bottom: 1px solid #edf1f6;
}

.registered-rows-card > .registered-row-card:last-child {
  border-bottom: 0;
}

.registered-row-card.h4-compact-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 10px;
  margin: 0 0 8px;
  cursor: pointer;
}

.registered-rows-card > .registered-row-card.h4-compact-row {
  margin: 0;
}

.registered-row-card.dent-item {
  display: flex;
  align-items: center;
  padding: 14px 14px 14px 16px;
  background: linear-gradient(180deg, #ffffff 0%, #fcfdff 100%);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 0;
}
.registered-row-card .dent-info { flex: 1; }
.registered-row-card .dent-zone { font-weight: 700; font-size: 15px; color: var(--gray-900); }
.registered-row-card .dent-details { font-size: 12px; color: var(--gray-500); margin-top: 3px; line-height: 1.45; }
.registered-row-card .dent-price {
  font-weight: 800;
  color: var(--blue);
  font-size: 16px;
  padding-left: 10px;
  white-space: nowrap;
}
.registered-row-card .dent-remove {
  background: none;
  border: none;
  color: var(--red);
  font-size: 12px;
  cursor: pointer;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  padding: 0;
  margin-left: 10px;
}
.registered-row-card .dent-remove:hover,
.registered-row-card .dent-remove:focus-visible {
  background: #fef2f2;
  outline: none;
}

/* Car diagram */
#zone-selector {
  padding: 12px 12px 10px;
  border: 1px solid #e8edf5;
}

#zone-selector .card-title {
  margin-bottom: 6px;
}

.car-diagram {
  position: relative;
  width: 100%;
  max-width: 320px;
  margin: 0 auto 8px;
}
.car-diagram .t3-map-wrap {
  position: relative;
  width: 100%;
  max-width: 600px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.car-diagram .t3-map-image {
  display: block;
  width: 100%;
  height: auto;
}

.car-diagram .t3-map-hotspots {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.car-diagram .t3-map-labels {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.car-diagram .t3-zone-label {
  position: absolute;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 5px;
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 0 0 3px #fff;
  color: #111827;
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
}

.car-diagram .t3-zone-label--side {
  min-width: 40px;
  min-height: 18px;
}

.car-diagram .t3-zone-label--rear {
  min-width: 56px;
  min-height: 20px;
}

.car-diagram .t3-map-click-surface {
  position: absolute;
  inset: 0;
  cursor: crosshair;
  z-index: 3;
}

.car-diagram .t3-zone-hotspot {
  position: absolute;
  transform: none;
  border: 1px solid transparent;
  background: transparent;
  color: transparent;
  border-radius: 6px;
  padding: 0;
  pointer-events: auto;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.car-diagram .t3-zone-hotspot:hover,
.car-diagram .t3-zone-hotspot:focus-visible {
  border-color: rgba(29, 78, 216, 0.55);
  background: rgba(59, 130, 246, 0.12);
  outline: none;
}

.car-diagram .t3-zone-hotspot.selected {
  background: rgba(37, 99, 235, 0.24);
  border-color: #1d4ed8;
}

.app-build-footer {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid var(--gray-200);
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--gray-500);
}

body.dev-mode .app-build-footer {
  color: var(--red);
}

body.dev-mode {
  background-image: linear-gradient(rgba(255, 0, 0, 0.03), rgba(255, 0, 0, 0.03));
}

.app-debug-footer {
  position: relative;
  z-index: 1;
  margin-top: 12px;
  margin-bottom: 8px;
  padding: 6px 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
  font-size: 11px;
  line-height: 1.3;
  background: #111827;
  color: #f9fafb;
  border: 1px solid #374151;
  border-radius: 8px;
  white-space: normal;
  overflow: visible;
  word-break: break-word;
}

/* Quote */
.quote-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 10px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.quote-header {
  text-align: center;
  margin-bottom: 2px;
  padding-bottom: 2px;
}
.quote-header h2 { font-size: 18px; margin-bottom: 2px; }
.quote-customer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px 16px;
  margin-bottom: 2px;
  font-size: 13px;
  color: var(--gray-600);
}
.quote-customer-column {
  min-width: 0;
}
.quote-customer-column-right {
  text-align: left;
}
.quote-customer-row {
  margin-bottom: 2px;
}
.quote-customer-missing {
  color: var(--gray-500);
}
.quote-customer-missing-link {
  background: none;
  border: 0;
  color: var(--blue);
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  font: inherit;
}
@media (max-width: 390px) {
  .quote-customer {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}
.quote-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.quote-table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  margin-bottom: 4px;
  font-size: 12px;
  table-layout: auto;
}
.quote-table th {
  text-align: left;
  padding: 6px 3px;
  border-bottom: 2px solid var(--gray-200);
  font-size: 10px;
  color: var(--gray-500);
  text-transform: uppercase;
  overflow-wrap: anywhere;
}
.quote-table td {
  padding: 4px 3px 2px;
  overflow-wrap: anywhere;
}
.quote-table .text-right { text-align: right; vertical-align: top; }
.quote-table td.text-right { white-space: nowrap; overflow-wrap: normal; }
/* An order line that holds several rows (H4): the service as its title, one line per row under it. */
.quote-table .quote-row-title { font-weight: 600; margin-bottom: 2px; }
.quote-table .quote-row-detail { color: var(--gray-700); padding: 1px 0 1px 8px; border-left: 2px solid var(--gray-200); margin: 2px 0; }
.quote-totals {
  margin-top: 2px;
  padding-top: 4px;
  border-top: 2px solid var(--gray-200);
}
.quote-total-line {
  display: flex;
  justify-content: space-between;
  padding: 2px 0;
  font-size: 13px;
  color: var(--gray-600);
}
.quote-total-line.rebate {
  color: var(--ok);
  font-weight: 700;
}
.quote-total-line.total {
  font-size: 18px;
  font-weight: 800;
  color: var(--gray-900);
  padding-top: 4px;
}

/* History list */
.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 8px;
  cursor: pointer;
}
.history-info { flex: 1; }
.history-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  gap: 4px;
  min-width: max-content;
}
.history-side .badge {
  display: block;
  text-align: right;
  padding-left: 0;
  padding-right: 0;
}
.history-name { font-weight: 600; font-size: 15px; }
.history-meta { font-size: 12px; color: var(--gray-500); }
.history-amount { font-weight: 700; color: var(--blue); font-size: 16px; }

/* Login page */
.login-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 80dvh;
  text-align: center;
  padding: 32px 16px;
}
.login-logo {
  font-size: 48px;
  margin-bottom: 8px;
}
.login-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--blue);
  margin-bottom: 4px;
}
.login-subtitle {
  font-size: 14px;
  color: var(--gray-500);
  margin-bottom: 32px;
}
.login-form {
  width: 100%;
  max-width: 320px;
  margin-inline: auto;
}
.install-instructions {
  margin-top: 24px;
  padding: 16px;
  background: var(--blue-light);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--gray-700);
  text-align: left;
  max-width: 320px;
}
.install-instructions h3 {
  font-size: 14px;
  margin-bottom: 8px;
  color: var(--blue);
}
.install-instructions ol {
  margin-left: 20px;
}
.install-instructions li {
  margin-bottom: 4px;
}

.ios-share-icon {
  display: inline-flex;
  width: 14px;
  height: 14px;
  vertical-align: -2px;
}

/* Auth flow shared components */
.auth-links {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.btn-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--blue);
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.btn-link:hover { color: var(--blue-dark); }
.auth-message {
  font-size: 13px;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  text-align: left;
  white-space: pre-line;
  line-height: 1.5;
}
.auth-message--error {
  background: var(--error-bg);
  color: var(--error-text);
}
.auth-message--success {
  background: #dcfce7;
  color: #166534;
}
.auth-message--info {
  background: var(--blue-light);
  color: var(--blue-dark);
}
.auth-policy-hint {
  font-size: 12px;
  color: var(--gray-500);
  margin-bottom: 12px;
  margin-top: -8px;
  line-height: 1.4;
}
.auth-info-text {
  font-size: 14px;
  color: var(--gray-600);
  line-height: 1.5;
  margin-bottom: 16px;
  text-align: center;
}

/* Section heading */
.section-heading {
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 20px 0 8px;
}

/* Status badge */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
}
.badge-demo { background: #fef3c7; color: #92400e; }
.badge-draft { background: var(--gray-100); color: var(--gray-600); }
.badge-quoted { background: var(--blue-light); color: var(--blue); }
.badge-completed { background: #dcfce7; color: #166534; }

/* Checkbox toggle */
.checkbox-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  cursor: pointer;
}
.checkbox-toggle input[type="checkbox"] {
  width: 22px;
  height: 22px;
  accent-color: var(--blue);
}
.checkbox-toggle.compact {
  padding: 8px 0;
}
.checkbox-toggle.compact span {
  font-size: 14px;
}

.multi-select {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  background: #fff;
}
.multi-select > summary {
  list-style: none;
  cursor: pointer;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-700);
}
.multi-select > summary::-webkit-details-marker {
  display: none;
}
.multi-select > summary::after {
  content: '▾';
  float: right;
  color: var(--gray-500);
}
.multi-select[open] > summary::after {
  content: '▴';
}
.multi-select-options {
  border-top: 1px solid var(--gray-200);
  padding: 0 12px 8px;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 34px 18px;
  color: var(--gray-500);
  background: linear-gradient(180deg, #ffffff 0%, #f9fbfe 100%);
  border: 1px dashed #d9e3f2;
  border-radius: var(--radius);
}
.empty-state .icon { font-size: 48px; margin-bottom: 8px; }
.empty-state p { font-size: 14px; line-height: 1.5; }

/* PriceSummaryCard */
.price-summary-card {
  margin-top: 14px;
  box-shadow: 0 12px 28px rgba(26, 86, 219, 0.12);
}

/* DiscountControlsCard */
.discount-controls-card {
  padding: 12px;
  background: #fff;
  border: 1px solid #e8edf5;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.price-summary-card.damage-total-card--split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 16px 12px;
  background: linear-gradient(180deg, #f7faff 0%, #edf4ff 100%);
  border: 1px solid #d7e5ff;
  border-radius: calc(var(--radius) + 2px);
  text-align: center;
}
.price-summary-card .damage-total-col {
  min-width: 0;
}
.price-summary-card .damage-total-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--blue);
  letter-spacing: -0.02em;
  line-height: 1.1;
  word-break: break-word;
}
.price-summary-card .damage-total-caption {
  margin-top: 4px;
  font-size: 12px;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}

/* Compact order total: the value and its caption sit on one line, so the card is a slim strip. */
.price-summary-card--compact.damage-total-card--split {
  margin-top: 8px;
  padding: 8px 12px;
  gap: 4px 8px;
}
.price-summary-card--compact .damage-total-col {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  column-gap: 6px;
}
.price-summary-card--compact .damage-total-value {
  font-size: 18px;
}
.price-summary-card--compact .damage-total-caption {
  margin-top: 0;
  font-size: 11px;
}

/* The hourly rate card: the title, the rates to pick from and the field for the order's own. */
.hourly-price-picker__title {
  font-size: 14px;
  font-weight: 700;
  color: var(--gray-700);
  margin-bottom: 8px;
}
.hourly-price-picker__row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
}
.hourly-price-picker__row > .btn { min-width: 0; flex: 1 1 0; padding-left: 6px; padding-right: 6px; }
.hourly-price-picker__custom {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
}
.hourly-price-picker__custom .btn {
  width: auto;
  flex: 0 0 auto;
}
.hourly-price-picker__row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }

#rebate-control {
  margin-top: 12px;
}



#rebate-control .rebate-mode-btn,
#rebate-control .rebate-moms-btn {
  width: auto;
  flex: 0 0 auto;
  min-height: 42px;
  padding: 10px 18px;
  font-size: 14px;
  border-radius: 8px;
  white-space: nowrap;
}

#rebate-control .rebate-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

#rebate-control .rebate-chip {
  width: auto;
  min-height: 34px;
  padding: 6px 4px;
  font-size: 13px;
  flex: 1 1 0;
  min-width: 0;
  white-space: nowrap;
}

#rebate-control .btn + .btn {
  margin-top: 0;
}


#rebate-control .rebate-input-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 0 100%;
}

#rebate-control .rebate-input {
  width: 110px;
  min-height: 42px;
  padding: 10px 12px;
  border: 1.5px solid var(--gray-300);
  border-radius: 8px;
  font-size: 14px;
}

#rebate-control .rebate-input--sek {
  width: 120px;
}


#rebate-control .rebate-input--sek::-webkit-outer-spin-button,
#rebate-control .rebate-input--sek::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

#rebate-control .rebate-input--sek {
  -moz-appearance: textfield;
  appearance: textfield;
}

#rebate-control .rebate-input-unit {
  font-size: 13px;
  color: var(--gray-700);
  white-space: nowrap;
}

/* Order-entry destination buttons */
.order-entry-destinations {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 8px;
  margin-top: 12px;
}
.order-entry-destinations > .btn {
  box-sizing: border-box;
  min-height: 48px;
  margin-top: 0;
}

/* Order page action stack (Phase 3) */
.order-actions-stack {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}
.order-actions-stack > button {
  width: 100%;
  min-height: 40px;
}
.order-actions-stack:has(> .order-action-split ~ .order-action-split) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.order-actions-stack:has(> .order-action-split ~ .order-action-split) > :not(.order-action-split) { grid-column: 1 / -1; }
.order-actions-stack > .order-action-split { width: 100%; }
.document-actions-stack > .order-media-action { grid-column: 1 / -1; }
.order-edit-buttons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.order-edit-buttons > button { width: 100%; min-height: 48px; }
.order-edit-buttons > .btn + .btn { margin-top: 0; }
.home-offering-button { background: var(--service-color); color: #fff; }
.home-offering-button.is-selected { box-shadow: inset 0 0 0 2px var(--service-color); }

/* Customer link row inside the Order summary card */
.quote-customer-link {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 4px 0 0 0;
  padding-top: 6px;
  border-top: 1px dashed var(--gray-200);
  font-size: 13px;
}
.quote-customer-link-label {
  font-weight: 600;
  color: var(--gray-700);
  flex-shrink: 0;
}
.quote-customer-link-url {
  flex: 0 0 auto;
  min-width: auto;
  color: var(--blue);
  font-weight: 600;
  text-decoration: underline;
}
.quote-customer-link-copy {
  margin-left: auto;
  flex-shrink: 0;
  font-size: 12px;
  padding: 4px 10px;
  min-height: 28px;
}

/* F1 VAT toggle link */
.f1-vat-toggle {
  display: inline-block;
  margin-left: 6px;
  font-size: 13px;
  color: var(--blue);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  text-decoration: underline;
}
.f1-vat-toggle:hover,
.f1-vat-toggle:focus {
  color: var(--blue-dark);
}

/* iPhone / narrow viewport adjustments */
@media (max-width: 420px) {
  .price-summary-card .damage-total-value {
    font-size: 20px;
  }



  #rebate-control .rebate-mode-btn,
  #rebate-control .rebate-moms-btn {
    min-height: 38px;
    padding: 8px 14px;
    font-size: 13px;
  }

  #rebate-control .rebate-chip {
    min-height: 32px;
    padding: 5px 2px;
    font-size: 12px;
  }

  #rebate-control .rebate-input {
    width: 96px;
  }


  #rebate-control .rebate-input--sek {
    width: 104px;
  }

  .header h1 {
    font-size: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
  }
}

.hagel-form {
  display: grid;
  gap: 10px;
}

.hagel-form .form-group {
  margin-bottom: 0;
}

.hagel-form .form-label {
  margin-bottom: 4px;
  font-size: 13px;
}

.hagel-form .form-input {
  padding: 10px 12px;
  font-size: 15px;
}

.hagel-form .checkbox-toggle {
  padding: 6px 0;
}

.hagel-form .checkbox-toggle span {
  font-size: 14px;
}

.hagel-form .checkbox-toggle input[type="checkbox"] {
  width: 20px;
  height: 20px;
}

.hagel-orientation-toggle .toggle-btn {
  padding: 9px 10px;
  font-size: 14px;
}

@media (max-width: 390px) {
  .damage-form-card {
    padding: 14px;
  }

  .hagel-form {
    gap: 8px;
  }

  .hagel-form .form-input {
    padding: 9px 11px;
    font-size: 14px;
  }

  .hagel-orientation-toggle .toggle-btn {
    padding: 8px;
    font-size: 13px;
  }
}

/* Hard update modal */
.update-modal {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.76);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 16px;
}
.update-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  padding: 20px;
}
.update-card h2 {
  font-size: 20px;
  margin-bottom: 8px;
}
.update-card p {
  color: var(--gray-600);
  margin-bottom: 16px;
  line-height: 1.4;
}

/* Inline messages shown next to the triggering control instead of dialogs */
.inline-message {
  margin: 10px 0;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
}
.inline-message--error {
  background: var(--error-bg);
  color: var(--error-text);
  border: 1px solid var(--error);
}
.inline-message--info {
  background: var(--gray-100);
  color: var(--gray-800);
  border: 1px solid var(--gray-300);
}
.inline-message .btn {
  margin: 8px 8px 0 0;
}
.inline-message .form-input {
  margin-top: 8px;
}

.app-flow-recovery-notice {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  background: var(--gray-100);
  color: var(--gray-800);
  font-size: 13px;
}
.app-flow-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}
.app-flow-actions button {
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid var(--blue, #2563eb);
  border-radius: 8px;
  background: #fff;
  color: var(--blue, #2563eb);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}
.app-flow-actions button:disabled {
  cursor: wait;
  opacity: .6;
}
.app-flow-actions .flow-button { margin-bottom: 0; }
.app-flow-actions .flow-text,
.app-flow-actions .flow-selection { flex-basis: 100%; }
.app-flow-actions .flow-text { padding: 0; text-align: left; }

/* Flow document components (app/js/components/flow-components-dab6f388e4b0d0b28fa7c832bba479d97ec918ea.js). */
.flow-text { text-align: center; padding: 20px 0 10px; }
.flow-text h2 { font-size: 22px; margin: 4px 0; }
.flow-selection__items { display: flex; flex-direction: column; padding: 0 0 8px; }
.flow-button { margin-bottom: 8px; }
.home-services-selection .flow-selection__items { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 0; }
.home-services-selection .flow-button { margin: 0; }
[data-flow-inert] { pointer-events: none; }
.registration-scan-open { margin-bottom: 12px; }
.registration-scan-label { display: block; font-size: 13px; margin-bottom: 6px; }
.registration-scan-use { margin-top: 10px; width: 100%; }
.registration-scan-footer-button { flex: 1; }
.support-create-button,
.support-reply-button {
  margin-top: 10px;
}

.media-upload-label {
  display: inline-block;
  cursor: pointer;
}

.payment-method-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.payment-method-icon {
  font-size: 28px;
}

.payment-method-copy {
  display: block;
}

.payment-method-title {
  margin: 0;
}

.payment-method-description {
  margin: 0;
  font-size: 13px;
  color: var(--gray-500);
}

.c1-technician-form,
.c1-panels {
  display: grid;
  gap: 10px;
}
.c1-technician-form { gap: 4px; }
.c1-technician-form .form-label { margin-bottom: 0; }
.c1-technician-form #c1-price { appearance: textfield; -moz-appearance: textfield; }
.c1-technician-form #c1-price::-webkit-inner-spin-button,
.c1-technician-form #c1-price::-webkit-outer-spin-button { margin: 0; -webkit-appearance: none; }

.c1-price-presets {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
}

.c1-price-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  width: 100%;
  align-items: end;
}

.c1-price-row .c1-price-presets { flex: 0 0 160px; min-width: 0; }
.c1-price-row #btn-add-dent { flex: 0 0 56px; width: 56px; min-width: 56px; min-height: 56px; padding: 0; font-size: 36px; font-weight: 700; line-height: 1; }

.c1-own-price {
  display: grid;
  flex: 1 1 120px;
  gap: 4px;
  min-width: 0;
  font-size: 12px;
}

.c1-own-price .form-input { min-height: 42px; }

.c1-panels {
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  margin-bottom: 14px;
}

.c1-panels label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
}

.c1-price-presets button {
  min-height: 42px;
  min-width: 0;
  width: auto;
  flex: 0 1 auto;
  padding-inline: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.c1-price-presets .btn + .btn {
  margin-top: 0;
}

.c1-price-settings .form-hint {
  margin: 0 0 10px;
}

.c1-price-preset-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.c1-price-preset-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--gray-200);
  border-radius: 14px;
  background: var(--gray-50, #f9fafb);
}

.c1-price-preset-label {
  color: var(--gray-700);
  font-size: 14px;
  font-weight: 600;
}

.c1-price-preset-input {
  position: relative;
  display: block;
  width: 100%;
}

.c1-price-preset-input .form-input { box-sizing: border-box; width: 100%; min-width: 0; margin: 0; padding-right: 34px; font-size: 16px; }
.c1-price-preset-currency { position: absolute; top: 50%; right: 12px; color: var(--gray-500); transform: translateY(-50%); pointer-events: none; }
.c1-price-preset-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.c1-price-preset-actions .inline-message { margin: 0; }

@media (max-width: 520px) {
  .c1-price-preset-grid { grid-template-columns: 1fr; gap: 8px; }
  .c1-price-preset-card { flex-direction: row; align-items: center; justify-content: space-between; padding: 12px; }
  .c1-price-preset-input { width: min(58%, 190px); }
}



/* Review round: compact customer actions and shared camera treatment. */
.order-submit-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.order-submit-controls:not(.has-changes) #btn-start-order { grid-column: 1 / -1; }
.order-submit-controls > .btn { margin: 0; }
.order-submit-controls > #btn-start-order-direct { height: 48px; min-height: 48px; }
.order-submit-controls > .order-submit-error { grid-column: 1 / -1; }
#customer-offering-actions:empty { display: none !important; }
/* The Kund page's services: the home screen's services card (same selection component), full width. */
.order-submit-controls > #customer-offering-actions { grid-column: 1 / -1; }
.order-submit-controls > #customer-offering-actions > .home-services-card { margin: 0; }
.order-submit-controls:has(#customer-offering-actions) > #btn-undo-order-changes { grid-column: 1 / -1; }
/* An order bound to its service: the service's own button and Order side by side, no picker card. */
.order-submit-controls > #customer-offering-actions.is-bound { grid-column: auto; }
.order-submit-controls > #customer-offering-actions.is-bound .flow-selection__items { display: block; }
.order-submit-controls > #customer-offering-actions.is-bound .btn { width: 100%; height: 48px; min-height: 48px; margin: 0; }
.customer-registration-search-row .form-input { min-width: 0; font-size: 12px; }
.c1-price-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(64px, 1.2fr) 48px; gap: 4px; align-items: center; }
.c1-price-row .c1-price-presets { display: contents; }
.c1-price-presets button, .c1-price-row #btn-add-dent { min-width: 0; min-height: 48px; height: 48px; font-size: 16px; }
.c1-price-presets button { width: 100%; padding: 0 8px; }
.c1-own-price { min-width: 0; }
.c1-own-price .form-input { height: 48px; margin: 0; }
.c1-price-row #btn-add-dent { width: 48px; min-width: 48px; margin: 0; font-size: 28px; }
.c1-price-row #btn-add-dent:not([aria-label]) { flex: 0 0 auto; width: auto; min-width: 96px; padding-inline: 12px; font-size: 14px; }
/* F1 (manual): the add button ("+") sits next to the price. */
.f1-price-row { display: flex; gap: 8px; align-items: center; }
.f1-price-row .form-input { flex: 1 1 0; min-width: 0; height: 48px; margin: 0; }
.f1-price-row #btn-add-dent { flex: 0 0 48px; width: 48px; min-width: 48px; height: 48px; min-height: 48px; margin: 0; padding: 0; font-size: 28px; line-height: 1; }
.btn.camera-button, .btn.vehicle-card-camera, .btn.registration-scan-open, .btn.media-upload-label, #btn-c1-camera {
  background: var(--customer-color); border-color: var(--customer-color); color: #fff;
}
.btn.camera-button:disabled, .btn.vehicle-card-camera:disabled, .btn.registration-scan-open:disabled, #btn-c1-camera:disabled {
  background: var(--gray-300); border-color: var(--gray-300); color: var(--gray-600); opacity: 1; cursor: not-allowed;
}
.document-actions-stack > .camera-unavailable-note { margin: -4px 0 0; font-size: 12px; color: var(--gray-600); text-align: center; }
