/* =============================================
   PROJEKT HEIZTECHNIK – Zähleraustausch App
   Style Sheet
   ============================================= */

/* --- RESET & BASE --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --blue-dark:    #1a4a8a;
  --blue-mid:     #1e5fad;
  --blue-light:   #2d7dd2;
  --blue-pale:    #e8f0fb;
  --white:        #ffffff;
  --gray-100:     #f5f6f8;
  --gray-200:     #e8eaed;
  --gray-400:     #9aa0ab;
  --gray-600:     #5f6672;
  --gray-800:     #2c3340;
  --green:        #28a745;
  --green-light:  #d4edda;
  --red:          #dc3545;
  --red-light:    #f8d7da;
  --orange:       #fd7e14;
  --shadow-sm:    0 1px 3px rgba(0,0,0,0.12);
  --shadow-md:    0 4px 12px rgba(0,0,0,0.15);
  --shadow-lg:    0 8px 24px rgba(0,0,0,0.18);
  --radius:       12px;
  --radius-sm:    8px;
  --font-base:    -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --transition:   0.2s ease;
  --header-h:     60px;
  --safe-top:     env(safe-area-inset-top, 0px);
  --safe-bottom:  env(safe-area-inset-bottom, 0px);
}

html {
  height: 100%;
  font-size: 16px;
}

body {
  font-family: var(--font-base);
  background: var(--gray-100);
  color: var(--gray-800);
  height: 100%;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* --- SCREENS --- */
.screen {
  display: none;
  flex-direction: column;
  min-height: 100vh;
  min-height: -webkit-fill-available;
}
.screen.active {
  display: flex;
}

/* --- APP HEADER --- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  background: var(--blue-dark);
  color: var(--white);
  height: calc(var(--header-h) + var(--safe-top));
  padding: calc(var(--safe-top) + 8px) 16px 8px;
  box-shadow: var(--shadow-md);
  gap: 12px;
}

.header-title {
  flex: 1;
  font-size: 1.05rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-logo {
  width: 36px;
  height: 36px;
  background: var(--white);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.header-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.header-logo-text {
  font-size: 0.55rem;
  font-weight: 700;
  color: var(--blue-dark);
  text-align: center;
  line-height: 1.1;
}

.btn-back {
  background: rgba(255,255,255,0.15);
  border: none;
  color: var(--white);
  font-size: 1.4rem;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--transition);
}
.btn-back:active { background: rgba(255,255,255,0.3); }

.btn-logout {
  background: rgba(255,255,255,0.15);
  border: none;
  color: var(--white);
  font-size: 1.2rem;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--transition);
}
.btn-logout:active { background: rgba(255,255,255,0.3); }

.step-badge {
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(255,255,255,0.2);
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* --- SCREEN CONTENT --- */
.screen-content {
  flex: 1;
  padding: 20px 16px calc(24px + var(--safe-bottom));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* --- LOGIN --- */
.login-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: -webkit-fill-available;
  padding: 32px 24px calc(32px + var(--safe-bottom));
  background: linear-gradient(160deg, var(--blue-dark) 0%, var(--blue-mid) 50%, var(--blue-light) 100%);
}

.logo-box {
  width: 180px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
}
.logo-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.logo-placeholder {
  width: 180px;
  height: 80px;
  background: rgba(255,255,255,0.15);
  border: 2px solid rgba(255,255,255,0.4);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
}
.logo-placeholder span {
  color: var(--white);
  font-size: 0.95rem;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.05em;
}

.login-title {
  color: var(--white);
  font-size: 1.6rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 8px;
}
.login-subtitle {
  color: rgba(255,255,255,0.75);
  font-size: 0.95rem;
  text-align: center;
  margin-bottom: 32px;
}

.pin-display {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}
.pin-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  border: 2px solid rgba(255,255,255,0.6);
  transition: background var(--transition), transform var(--transition);
}
.pin-dot.filled {
  background: var(--white);
  transform: scale(1.1);
}

.pin-error {
  color: #ffb3b3;
  font-size: 0.85rem;
  text-align: center;
  margin-bottom: 16px;
  min-height: 20px;
  opacity: 0;
  transition: opacity var(--transition);
}
.pin-error.visible { opacity: 1; }

.pin-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
  max-width: 280px;
}

.pin-key {
  height: 68px;
  background: rgba(255,255,255,0.15);
  border: none;
  border-radius: var(--radius);
  color: var(--white);
  font-size: 1.6rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-user-select: none;
  user-select: none;
}
.pin-key:active {
  background: rgba(255,255,255,0.35);
  transform: scale(0.95);
}
.pin-key--clear { font-size: 1rem; }
.pin-key--del   { font-size: 1.4rem; }

/* --- HOME --- */
.welcome-box {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--blue-mid);
}
.welcome-text {
  font-size: 0.85rem;
  color: var(--gray-400);
  margin-bottom: 4px;
}
.welcome-name {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--blue-dark);
}

.sync-status {
  margin-bottom: 16px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  display: none;
}
.sync-status.online {
  display: block;
  background: var(--green-light);
  color: #155724;
}
.sync-status.offline {
  display: block;
  background: var(--red-light);
  color: #721c24;
}

.home-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* --- BUTTONS --- */
.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--blue-mid);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  padding: 14px 20px;
  box-shadow: var(--shadow-sm);
  transition: background var(--transition), transform var(--transition), opacity var(--transition);
  -webkit-user-select: none;
  user-select: none;
  text-decoration: none;
  width: 100%;
}
.btn-primary:active { background: var(--blue-dark); transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.45; pointer-events: none; }

.btn-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--white);
  color: var(--blue-mid);
  border: 2px solid var(--blue-mid);
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  padding: 14px 20px;
  box-shadow: var(--shadow-sm);
  transition: background var(--transition), transform var(--transition);
  -webkit-user-select: none;
  user-select: none;
  width: 100%;
}
.btn-secondary:active { background: var(--blue-pale); transform: scale(0.98); }

.btn-ghost {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--gray-600);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 0.95rem;
  cursor: pointer;
  padding: 12px 20px;
  transition: background var(--transition);
  width: 100%;
}
.btn-ghost:active { background: var(--gray-200); }

.btn-danger {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--red);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  padding: 14px 20px;
  transition: background var(--transition), transform var(--transition);
  width: 100%;
}
.btn-danger:active { background: #b02a37; transform: scale(0.98); }

.btn-large { min-height: 56px; font-size: 1.05rem; }
.btn-small { padding: 8px 14px; font-size: 0.85rem; min-height: 36px; width: auto; }

.btn-icon {
  font-size: 1.4rem;
  line-height: 1;
  font-weight: 400;
}

.btn-confirm {
  font-size: 1.1rem;
  min-height: 64px;
  background: var(--green);
  box-shadow: 0 4px 12px rgba(40,167,69,0.3);
}
.btn-confirm:active { background: #1e7e34; }

/* Badge */
.badge {
  background: var(--red);
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 12px;
  min-width: 20px;
  text-align: center;
}
.badge.zero { background: var(--gray-400); }

/* --- OBJECT LIST --- */
.search-box { margin-bottom: 12px; }
.search-input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 1rem;
  background: var(--white);
  outline: none;
  transition: border-color var(--transition);
  -webkit-appearance: none;
}
.search-input:focus { border-color: var(--blue-mid); }

.object-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.object-item {
  background: var(--white);
  border: 2px solid transparent;
  border-radius: var(--radius);
  padding: 14px 16px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition), box-shadow var(--transition);
  display: flex;
  align-items: center;
  gap: 12px;
}
.object-item:active { border-color: var(--blue-mid); box-shadow: var(--shadow-md); }

.object-item-id {
  background: var(--blue-pale);
  color: var(--blue-dark);
  font-weight: 700;
  font-size: 0.8rem;
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}
.object-item-info { flex: 1; }
.object-item-ort  { font-size: 0.95rem; font-weight: 600; color: var(--gray-800); }
.object-item-str  { font-size: 0.85rem; color: var(--gray-600); margin-top: 2px; }

/* --- MODAL --- */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal.hidden { display: none; }

.modal-content {
  background: var(--white);
  border-radius: var(--radius);
  padding: 28px 24px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
}
.modal-label {
  font-size: 0.85rem;
  color: var(--gray-400);
  margin-bottom: 8px;
}
.modal-value {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--blue-dark);
  line-height: 1.4;
}

/* --- FORMS --- */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.form-input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  background: var(--white);
  color: var(--gray-800);
  outline: none;
  transition: border-color var(--transition);
  -webkit-appearance: none;
  appearance: none;
}
.form-input:focus { border-color: var(--blue-mid); }
.form-input.pflicht:placeholder-shown { border-color: #ef4444; border-width: 2px; }
.form-input.pflicht:not(:placeholder-shown) { border-color: #22c55e; border-width: 2px; }
.form-input[readonly] { background: var(--gray-100); color: var(--gray-600); }
.form-input--large { font-size: 1.3rem; text-align: center; font-weight: 600; min-height: 60px; }

.input-with-photo {
  display: flex;
  gap: 8px;
}
.input-with-photo .form-input { flex: 1; }

.btn-photo {
  width: 56px;
  height: 56px;
  background: var(--blue-pale);
  border: 2px solid var(--blue-light);
  border-radius: var(--radius-sm);
  font-size: 1.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--transition);
}
.btn-photo:active { background: var(--blue-mid); }

.hidden-file-input { display: none; }

.photo-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.photo-thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 2px solid var(--gray-200);
}

.input-with-unit {
  display: flex;
  align-items: center;
  gap: 8px;
}
.input-with-unit .form-input { flex: 1; }
.unit-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--gray-600);
  white-space: nowrap;
  min-width: 36px;
}

/* --- METER TYPE SELECTION --- */
.meter-type-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}
.meter-type-item {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--white);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 16px 18px;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  min-height: 64px;
}
.meter-type-item input[type="checkbox"] { display: none; }
.meter-type-item:has(input:checked) {
  border-color: var(--blue-mid);
  background: var(--blue-pale);
}

.meter-type-check {
  width: 26px;
  height: 26px;
  border: 2px solid var(--gray-400);
  border-radius: 6px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), border-color var(--transition);
  position: relative;
}
.meter-type-item:has(input:checked) .meter-type-check {
  background: var(--blue-mid);
  border-color: var(--blue-mid);
}
.meter-type-item:has(input:checked) .meter-type-check::after {
  content: '✓';
  color: white;
  font-size: 0.85rem;
  font-weight: 700;
}
.meter-type-label {
  font-size: 1rem;
  color: var(--gray-800);
}
.meter-type-label strong { color: var(--blue-dark); }

/* --- METER ENTRY --- */
.meter-entry-header {
  text-align: center;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--blue-dark);
  padding: 12px;
  background: var(--blue-pale);
  border-radius: var(--radius);
  margin-bottom: 20px;
}

.meter-section {
  background: var(--white);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.meter-section-title {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 6px;
  text-align: center;
}
.meter-section-title--old {
  background: var(--red-light);
  color: #721c24;
}
.meter-section-title--new {
  background: var(--green-light);
  color: #155724;
}

/* --- CHECKLIST --- */
.checklist-type-label {
  text-align: center;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--blue-dark);
  padding: 12px;
  background: var(--blue-pale);
  border-radius: var(--radius);
  margin-bottom: 16px;
}

.checklist-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.checklist-item {
  display: flex;
  align-items: center;
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  min-height: 60px;
}
.checklist-item-label {
  flex: 1;
  padding: 14px 16px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--gray-800);
}
.checklist-toggle {
  display: flex;
  border-left: 1px solid var(--gray-200);
  flex-shrink: 0;
}
.checklist-btn {
  border: 2px solid var(--gray-200);
  font-size: 0.9rem;
  font-weight: 700;
  width: 70px;
  height: 44px;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  letter-spacing: 0.05em;
  border-radius: 8px;
}
.checklist-btn.ja   { background: var(--gray-100); color: var(--gray-500); margin-right: 6px; }
.checklist-btn.nein { background: var(--gray-100); color: var(--gray-500); }
.checklist-btn.ja.active   { background: var(--blue-mid); color: white; border-color: var(--blue-dark); }
.checklist-btn.nein.active { background: #ef4444; color: white; border-color: #dc2626; }

/* Invertiert: JA=Warnung(rot), NEIN=OK(blau) */
.checklist-btn.inv-ja.active  { background: #ef4444; color: white; border-color: #dc2626; }
.checklist-btn.inv-nein.active { background: var(--blue-mid); color: white; border-color: var(--blue-dark); }

/* --- SUMMARY --- */
.summary-data {
  background: var(--white);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}
.summary-section {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--gray-200);
}
.summary-section:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
.summary-section-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--blue-dark);
  margin-bottom: 10px;
}
.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 0.9rem;
}
.summary-row-label { color: var(--gray-600); flex-shrink: 0; }
.summary-row-value { color: var(--gray-800); font-weight: 500; text-align: right; }

/* --- SIGNATURE --- */
.signature-container {
  background: var(--white);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  position: relative;
  max-width: 600px;
  margin: 0 auto;
  box-shadow: var(--shadow-sm);
}

/* Laptop/Desktop: größere Unterschriftsfläche */
@media (min-width: 768px) {
  .signature-canvas {
    height: 250px !important;
  }
  .signature-container {
    max-width: 700px;
  }
}
.signature-canvas {
  display: block;
  width: 100%;
  height: 180px;
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cpath d='M 24 2 L 30 8 L 10 28 L 2 30 L 4 22 Z' fill='%231a4a8a' stroke='white' stroke-width='1'/%3E%3C/svg%3E") 0 32, crosshair;
  touch-action: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  border-radius: var(--radius-sm);
}
.signature-clear {
  position: absolute;
  top: 8px;
  right: 8px;
}

/* --- PROTOCOLS LIST --- */
.protocols-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.protocol-item {
  background: var(--white);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.protocol-item-info { flex: 1; }
.protocol-item-title { font-size: 0.95rem; font-weight: 600; color: var(--gray-800); }
.protocol-item-meta  { font-size: 0.8rem; color: var(--gray-400); margin-top: 2px; }
.protocol-item-actions { display: flex; gap: 8px; }

.btn-action {
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
}
.btn-action.download { background: var(--blue-pale); color: var(--blue-dark); }
.btn-action.download:active { background: var(--blue-mid); color: white; }
.btn-action.mail { background: var(--green-light); color: #155724; }
.btn-action.mail:active { background: var(--green); color: white; }
.btn-action.sync { background: var(--orange); color: white; opacity: 0.85; }
.btn-action.sync:active { opacity: 1; }
.btn-action.delete { background: var(--red-light); color: var(--red); }
.btn-action.delete:active { background: var(--red); color: white; }

/* --- TOAST --- */
.toast {
  position: fixed;
  bottom: calc(24px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  background: var(--gray-800);
  color: var(--white);
  padding: 12px 24px;
  border-radius: 24px;
  font-size: 0.9rem;
  font-weight: 500;
  z-index: 999;
  box-shadow: var(--shadow-lg);
  max-width: calc(100vw - 32px);
  text-align: center;
  opacity: 1;
  transition: opacity 0.4s ease;
}
.toast.hidden { display: none; }
.toast.success { background: var(--green); }
.toast.error   { background: var(--red); }

/* --- LOADING OVERLAY --- */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26,74,138,0.75);
  z-index: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
}
.loading-overlay.hidden { display: none; }

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255,255,255,0.3);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-text {
  color: var(--white);
  font-size: 1rem;
  font-weight: 500;
}

/* --- HINTS & UTILITIES --- */
.screen-hint {
  font-size: 0.95rem;
  color: var(--gray-600);
  margin-bottom: 8px;
}
.screen-hint strong { color: var(--gray-800); }
.screen-hint-sub {
  font-size: 0.85rem;
  color: var(--gray-400);
  margin-bottom: 4px;
}

.empty-hint {
  text-align: center;
  color: var(--gray-400);
  font-size: 0.95rem;
  padding: 32px 16px;
}

.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }

/* --- RESPONSIVE TWEAKS FOR LARGER IPHONES --- */
@media (min-width: 390px) {
  .pin-keypad { gap: 14px; max-width: 300px; }
  .pin-key    { height: 74px; }
}

/* --- SAFE AREA (iPhone notch / Dynamic Island) --- */
@supports (padding: max(0px)) {
  .screen-content {
    padding-bottom: max(24px, calc(24px + var(--safe-bottom)));
  }
}

/* === UNTERSCHRIFT TABS === */
.sig-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.sig-tab {
  flex: 1;
  padding: 10px;
  border: 2px solid var(--gray-200);
  background: var(--gray-100);
  color: var(--gray-600);
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition);
}
.sig-tab.active {
  background: var(--blue-mid);
  color: white;
  border-color: var(--blue-dark);
}

/* === GESPEICHERTE UNTERSCHRIFTEN === */
.saved-sig-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.saved-sig-item {
  border: 2px solid var(--gray-200);
  border-radius: 10px;
  padding: 12px;
  background: var(--white);
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 12px;
}
.saved-sig-item:hover, .saved-sig-item.selected {
  border-color: var(--blue-mid);
  background: var(--blue-pale);
}
.saved-sig-item img {
  height: 50px;
  max-width: 200px;
  object-fit: contain;
}
.saved-sig-name {
  font-weight: 600;
  color: var(--gray-700);
}
