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

:root {
  --blue: #185FA5;
  --blue-light: #E6F1FB;
  --blue-dark: #0C447C;
  --green: #3B6D11;
  --green-light: #EAF3DE;
  --amber: #854F0B;
  --amber-light: #FAEEDA;
  --purple-light: #CECBF6;
  --purple-text: #3C3489;
  --bg: #f5f4f0;
  --surface: #ffffff;
  --surface2: #f0efe9;
  --border: rgba(0,0,0,0.12);
  --border-strong: rgba(0,0,0,0.22);
  --text: #1a1a18;
  --text2: #5a5a56;
  --text3: #9a9a94;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --danger: #c0392b;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #181816;
    --surface: #232320;
    --surface2: #2c2c28;
    --border: rgba(255,255,255,0.10);
    --border-strong: rgba(255,255,255,0.20);
    --text: #f0efe9;
    --text2: #a0a09a;
    --text3: #606058;
    --blue-light: #0c2a44;
    --green-light: #162908;
    --amber-light: #2e1c04;
    --purple-light: #2a2660;
  }
}

html, body {
  height: 100%;
  background: var(--bg);
  font-family: -apple-system, 'Helvetica Neue', Arial, sans-serif;
  font-size: 16px;
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

#app {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

/* ── Topbar ── */
.topbar {
  background: var(--surface);
  border-bottom: 0.5px solid var(--border);
  padding: env(safe-area-inset-top, 14px) 16px 10px;
  padding-top: max(env(safe-area-inset-top), 14px);
  display: flex;
  align-items: center;
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-back {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--blue);
  font-size: 22px;
  padding: 4px 6px 4px 0;
  display: none;
  line-height: 1;
}

.topbar-logo {
  width: 32px;
  height: 32px;
  background: var(--blue);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.5px;
  flex-shrink: 0;
}

.topbar-title { font-size: 17px; font-weight: 600; color: var(--text); }
.topbar-sub { font-size: 12px; color: var(--text2); margin-top: 1px; }

/* ── Home ── */
.home, .tab-content {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

/* ── Tab bar ── */
.tab-bar {
  display: flex;
  border-bottom: 0.5px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}

.tab-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 4px 8px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font-size: 11px;
  font-weight: 500;
  color: var(--text3);
  cursor: pointer;
  position: relative;
}

.tab-btn i { font-size: 18px; }

.tab-btn.active {
  color: var(--blue, #185FA5);
  border-bottom-color: var(--blue, #185FA5);
}

.tab-btn.disabled {
  color: var(--text3);
  opacity: 0.5;
  cursor: not-allowed;
}

.tab-badge {
  font-size: 8px;
  font-weight: 600;
  color: var(--text3);
  white-space: nowrap;
  line-height: 1;
}

.tech-badge {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin: 12px 16px 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.tech-avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--purple-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; color: var(--purple-text);
  flex-shrink: 0;
}

.tech-name { font-size: 15px; font-weight: 500; }
.tech-meta { font-size: 12px; color: var(--text2); margin-top: 2px; }

.online-dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #3B6D11;
  margin-right: 4px;
  vertical-align: middle;
}

.section-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 4px 2px 2px;
}

.form-tile {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  transition: background 0.12s;
}

.form-tile:active { background: var(--surface2); }

.form-list {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.form-list-item {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  transition: background 0.12s;
  border-bottom: 0.5px solid var(--border);
}

.form-list-item:last-child { border-bottom: none; }
.form-list-item:active { background: var(--surface2); }

.field-locked {
  background: var(--surface2) !important;
  color: var(--text2) !important;
  cursor: not-allowed;
}

.site-group-header {
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
  background: var(--surface2);
  padding: 6px 10px;
  border-radius: var(--radius-sm, 6px);
  margin-top: 8px;
}


.tile-icon {
  width: 46px; height: 46px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.tile-icon.job { background: var(--blue-light); color: var(--blue); }
.tile-icon.hs  { background: var(--green-light); color: var(--green); }
.tile-icon.spare { background: var(--amber-light); color: var(--amber); }

.tile-title { font-size: 15px; font-weight: 500; }
.tile-sub { font-size: 12px; color: var(--text2); margin-top: 2px; }
.tile-chevron { margin-left: auto; font-size: 18px; color: var(--text3); }

.offline-banner {
  background: var(--amber-light);
  color: var(--amber);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 16px;
  text-align: center;
  display: none;
}

/* ── Form screens ── */
.form-screen {
  display: none;
  flex-direction: column;
  flex: 1;
}

.form-body {
  flex: 1;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 24px;
}

.sdiv {
  font-size: 13px;
  font-weight: 600;
  color: var(--text2);
  padding: 6px 0 4px;
  border-bottom: 0.5px solid var(--border);
}

.fg { display: flex; flex-direction: column; gap: 5px; }
.fg label { font-size: 13px; color: var(--text2); }

.fg input, .fg select, .fg textarea {
  width: 100%;
  background: var(--surface);
  border: 0.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  font-size: 15px;
  color: var(--text);
  font-family: inherit;
  appearance: none;
  -webkit-appearance: none;
  outline: none;
}

.fg input:focus, .fg select:focus, .fg textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(24,95,165,0.12);
}

.fg textarea { resize: none; line-height: 1.5; }

.fg select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235a5a56' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ── Signature ── */
.sig-box {
  background: var(--surface2);
  border: 0.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  height: 110px;
  position: relative;
  overflow: hidden;
  touch-action: none;
}

.sig-box canvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.sig-hint {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: var(--text3); pointer-events: none; z-index: 1;
}

.sig-clear {
  position: absolute; top: 6px; right: 8px;
  font-size: 12px; color: var(--text2);
  background: var(--surface); border: 0.5px solid var(--border);
  border-radius: 6px; padding: 3px 8px;
  cursor: pointer; z-index: 2;
}

/* ── Checklist ── */
.checklist-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px;
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.checklist-item input[type=checkbox] {
  width: 20px; height: 20px;
  accent-color: var(--green);
  flex-shrink: 0;
  cursor: pointer;
}

.checklist-item label { font-size: 14px; cursor: pointer; }

/* ── Submit bar ── */
.submit-bar {
  padding: 12px 16px;
  padding-bottom: max(env(safe-area-inset-bottom), 16px);
  background: var(--surface);
  border-top: 0.5px solid var(--border);
}

.submit-btn {
  width: 100%;
  padding: 14px;
  border-radius: var(--radius-md);
  border: none;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-family: inherit;
  transition: opacity 0.15s, transform 0.1s;
  color: #fff;
}

.submit-btn:active { opacity: 0.85; transform: scale(0.98); }
.submit-btn.job   { background: var(--blue); }
.submit-btn.hs    { background: var(--green); }
.submit-btn.spare { background: var(--amber); }

/* ── Part cards ── */
.part-card {
  background: var(--surface);
  border: 0.5px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.part-header {
  display: flex; align-items: center; justify-content: space-between;
}

.part-num {
  font-size: 12px; font-weight: 600;
  color: var(--amber);
  background: var(--amber-light);
  padding: 3px 10px; border-radius: 99px;
}

.part-remove {
  background: none; border: none;
  font-size: 18px; color: var(--text3);
  cursor: pointer; padding: 2px 4px;
  line-height: 1;
}

.part-remove:hover { color: var(--danger); }

.expand-toggle {
  font-size: 13px; color: var(--text2);
  background: none; border: none;
  cursor: pointer;
  display: flex; align-items: center; gap: 6px;
  padding: 0; font-family: inherit;
  -webkit-user-select: none; user-select: none;
}

.expand-toggle i { font-size: 14px; transition: transform 0.2s; }
.expand-toggle.open i { transform: rotate(90deg); }

.expand-section {
  display: none;
  flex-direction: column;
  gap: 10px;
}

.expand-section.open { display: flex; }

.photo-strip {
  display: flex; gap: 8px; flex-wrap: wrap;
}

.photo-thumb {
  width: 64px; height: 64px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 0.5px solid var(--border);
}

.photo-add {
  width: 64px; height: 64px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border-strong);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 2px; cursor: pointer;
  background: var(--surface2);
  color: var(--text3);
  font-size: 11px;
  transition: background 0.12s;
}

.photo-add:active { background: var(--border); }
.photo-add i { font-size: 22px; }

.add-part-btn {
  background: none;
  border: 0.5px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 11px;
  font-size: 14px;
  color: var(--text2);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%;
  font-family: inherit;
  transition: background 0.12s;
}

.add-part-btn:active { background: var(--surface2); }

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom) + 24px);
  left: 50%;
  transform: translateX(-50%);
  background: #1a1a18;
  color: #f0efe9;
  padding: 11px 22px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  z-index: 100;
  transition: opacity 0.25s, transform 0.25s;
  transform: translateX(-50%) translateY(8px);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Install prompt ── */
.install-banner {
  background: var(--blue-light);
  border-bottom: 0.5px solid var(--border);
  padding: 10px 16px;
  display: none;
  align-items: center;
  gap: 10px;
}

.install-banner p { font-size: 13px; color: var(--blue-dark); flex: 1; }
.install-btn {
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}

.install-dismiss {
  background: none; border: none;
  font-size: 18px; color: var(--blue-dark);
  cursor: pointer; padding: 2px;
}

/* ── Login screen ── */
.login-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  gap: 0;
}

.login-logo {
  width: 64px; height: 64px;
  background: var(--blue);
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; font-weight: 700; color: #fff;
  letter-spacing: -1px;
  margin-bottom: 20px;
}

.login-heading {
  font-size: 22px; font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  text-align: center;
}

.login-sub {
  font-size: 14px; color: var(--text2);
  text-align: center;
  margin-bottom: 32px;
}

.login-card {
  width: 100%;
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.login-error {
  background: #fcebeb;
  color: #a32d2d;
  border: 0.5px solid #f09595;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  display: none;
}

.login-error.show { display: block; }

.pw-wrap {
  position: relative;
}

.pw-wrap input {
  padding-right: 44px;
}

.pw-toggle {
  position: absolute;
  right: 12px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none;
  color: var(--text3); cursor: pointer;
  font-size: 18px; padding: 2px;
  line-height: 1;
}

.login-btn {
  width: 100%;
  padding: 14px;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 16px; font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: opacity 0.15s, transform 0.1s;
}

.login-btn:active { opacity: 0.85; transform: scale(0.98); }
.login-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.login-hint {
  font-size: 12px; color: var(--text3);
  text-align: center;
  margin-top: 4px;
}

/* ── Topbar user menu ── */
.topbar-user {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--purple-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; color: var(--purple-text);
  cursor: pointer;
  border: none;
  flex-shrink: 0;
  position: relative;
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--surface);
  border: 0.5px solid var(--border-strong);
  border-radius: var(--radius-md);
  min-width: 200px;
  z-index: 50;
  display: none;
  overflow: hidden;
}

.user-dropdown.open { display: block; }

.user-dropdown-header {
  padding: 12px 14px;
  border-bottom: 0.5px solid var(--border);
}

.user-dropdown-name { font-size: 14px; font-weight: 500; }
.user-dropdown-meta { font-size: 12px; color: var(--text2); margin-top: 2px; }

.user-dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px;
  font-size: 14px; color: var(--text);
  cursor: pointer;
  border: none; background: none;
  width: 100%; text-align: left;
  font-family: inherit;
  transition: background 0.1s;
}

.user-dropdown-item:hover { background: var(--surface2); }
.user-dropdown-item.danger { color: var(--danger); }
.user-dropdown-item i { font-size: 17px; color: var(--text2); }
.user-dropdown-item.danger i { color: var(--danger); }

/* ── Spinner ── */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

/* ── SAMD Logo ── */
.login-logo-wrap {
  width: 100%;
  max-width: 260px;
  margin: 0 auto 4px;
}

.login-logo-img {
  width: 100%;
  height: auto;
  display: block;
}

.login-logo-dark  { display: none; }
.login-logo-light { display: block; }

.topbar-logo-wrap {
  height: 28px;
  flex-shrink: 0;
}

.topbar-logo-img {
  height: 28px;
  width: auto;
  display: block;
}

.topbar-logo-dark  { display: none; }
.topbar-logo-light { display: block; }

/* Dark mode: swap logos */
@media (prefers-color-scheme: dark) {
  .login-logo-light { display: none; }
  .login-logo-dark  { display: block; }
  .topbar-logo-light { display: none; }
  .topbar-logo-dark  { display: block; }

  /* Dark login screen gets navy background to match dark logo */
  #loginScreen {
    background: #0d1b2e;
  }

  .login-sub {
    color: rgba(255,255,255,0.55);
  }
}

/* ── Fulfilment section ── */
.required-star {
  color: var(--danger);
  font-size: 14px;
  margin-left: 1px;
}

.fulfilment-block {
  display: none;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
  background: var(--surface);
  border: 0.5px solid var(--border-strong);
  border-radius: var(--radius-md);
  margin-top: -4px;
}

.fulfilment-block.open {
  display: flex;
}

/* Validation error state */
.fg input.invalid,
.fg select.invalid,
.fg textarea.invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(192,57,43,0.12);
}

.field-error {
  font-size: 12px;
  color: var(--danger);
  margin-top: 2px;
  display: none;
}

.field-error.show {
  display: block;
}

/* ── Task queue ── */
.task-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
  font-size: 13px;
  color: var(--text2);
}

.task-empty {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
  font-size: 13px;
  color: var(--text2);
}

.incident-group {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.incident-header {
  padding: 10px 14px;
  background: var(--blue-light);
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 0.5px solid var(--border);
}

.incident-number {
  font-size: 13px;
  font-weight: 600;
  color: var(--blue-dark);
  flex: 1;
}

.incident-desc {
  font-size: 11px;
  color: var(--blue);
  flex: 2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.task-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--blue-dark);
  background: var(--blue);
  color: #fff;
  padding: 2px 8px;
  border-radius: 99px;
  flex-shrink: 0;
}

.task-count.warn {
  background: #854F0B;
}

.task-row {
  padding: 10px 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border-bottom: 0.5px solid var(--border);
  cursor: pointer;
  transition: background 0.12s;
  -webkit-user-select: none;
  user-select: none;
}

.task-row:last-child { border-bottom: none; }
.task-row:active { background: var(--surface2); }

.task-priority {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}

.priority-critical { background: #c0392b; }
.priority-high     { background: #854F0B; }
.priority-medium   { background: #185FA5; }
.priority-low      { background: #3B6D11; }

.task-body { flex: 1; min-width: 0; }

.task-id {
  font-size: 11px;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 2px;
}

.task-subcategory {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.task-site {
  font-size: 11px;
  color: var(--text2);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.task-sla {
  font-size: 11px;
  font-weight: 500;
  flex-shrink: 0;
  text-align: right;
}

.sla-ok      { color: #3B6D11; }
.sla-warn    { color: #854F0B; }
.sla-breach  { color: #c0392b; }

/* ── Task detail sheet ── */
.task-sheet {
  display: none;
  flex-direction: column;
  flex: 1;
}

.task-sheet-body {
  flex: 1;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.task-info-card {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.task-info-header {
  background: var(--blue-light);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.task-info-inc {
  font-size: 15px;
  font-weight: 600;
  color: var(--blue-dark);
}

.task-info-body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.task-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.task-field-label {
  font-size: 11px;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  font-weight: 600;
}

.task-field-value {
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
}

.task-notes-box {
  background: var(--surface2);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
}

.form-choice-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text2);
  padding: 4px 0;
}

.form-choice-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-choice-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: background 0.12s;
  -webkit-user-select: none;
  user-select: none;
}

.form-choice-btn:active { background: var(--surface2); }

.form-choice-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.form-choice-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.form-choice-sub {
  font-size: 12px;
  color: var(--text2);
  margin-top: 2px;
}

.multi-task-warning {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #FAEEDA;
  border: 0.5px solid #EF9F27;
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-size: 13px;
  color: #633806;
}

.multi-task-warning i {
  font-size: 18px;
  color: #854F0B;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ── Safety checklist Y/N ── */
.safety-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.safety-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 14px;
  border-bottom: 0.5px solid var(--border);
}

.safety-row:last-child { border-bottom: none; }

.safety-q {
  font-size: 13px;
  color: var(--text);
  flex: 1;
  line-height: 1.4;
}

.yn-group {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.yn-btn {
  cursor: pointer;
}

.yn-btn input[type=radio] {
  display: none;
}

.yn-btn span {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 99px;
  border: 0.5px solid var(--border-strong);
  font-size: 13px;
  font-weight: 500;
  color: var(--text2);
  background: var(--surface);
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  -webkit-user-select: none;
  user-select: none;
}

.yn-btn input[type=radio]:checked + span {
  border-color: transparent;
  font-weight: 600;
}

.yn-btn input[value=yes]:checked + span {
  background: #EAF3DE;
  color: #27500A;
}

.yn-btn input[value=no]:checked + span {
  background: #FCEBEB;
  color: #791F1F;
}

/* ── Asset card ── */
.asset-card {
  background: var(--surface);
  border: 0.5px solid var(--border-strong);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.asset-card-header {
  background: #E6F1FB;
  padding: 9px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.asset-card-num {
  font-size: 12px;
  font-weight: 600;
  color: #0C447C;
}

.asset-card-remove {
  background: none;
  border: none;
  font-size: 17px;
  color: #185FA5;
  cursor: pointer;
  padding: 2px 4px;
  line-height: 1;
}

.asset-card-remove:hover { color: var(--danger); }

.asset-card-body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.asset-params-header {
  font-size: 11px;
  font-weight: 600;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 6px 0 4px;
  border-bottom: 0.5px solid var(--border);
  margin-top: 2px;
}

.condition-report-block {
  background: #FAEEDA;
  border: 0.5px solid #EF9F27;
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: none;
  flex-direction: column;
  gap: 10px;
  margin-top: 2px;
}

.condition-report-block.open {
  display: flex;
}

.condition-report-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  color: #633806;
  margin-bottom: 2px;
}

.condition-report-label i {
  font-size: 16px;
  color: #854F0B;
}

.char-counter {
  font-size: 11px;
  color: var(--text3);
  text-align: right;
  margin-top: 2px;
}

.char-counter.warn { color: #854F0B; }
.char-counter.ok   { color: #3B6D11; }

/* Photo requirement indicator */
.photo-req-note {
  font-size: 12px;
  color: #854F0B;
  margin-top: 2px;
}

.photo-req-note.met { color: #3B6D11; }

/* ── Spare used row ── */
.spare-used-row {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 13px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.spare-used-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.spare-used-num {
  font-size: 12px;
  font-weight: 600;
  color: #185FA5;
  background: #E6F1FB;
  padding: 2px 9px;
  border-radius: 99px;
}
