
/* Loading / Spinner */
.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 60px 20px;
  color: #999;
}
.spinner {
  width: 24px; height: 24px;
  border: 3px solid #333;
  border-top-color: var(--tg-theme-link-color, #2481cc);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 10px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Score cards */
.score-cards {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  overflow-x: auto;
}
.score-card {
  flex: 1;
  min-width: 0;
  background: #1e2c3a;
  border-radius: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,0.06);
}
.score-card-emoji { font-size: 20px; margin-bottom: 4px; }
.score-card-title { font-size: 12px; color: #999; margin-bottom: 2px; }
.score-card-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
}
.score-card-badge.good { background: rgba(34,197,94,0.15); color: #22c55e; }
.score-card-badge.warning { background: rgba(234,179,8,0.15); color: #eab308; }
.score-card-badge.bad { background: rgba(239,68,68,0.15); color: #ef4444; }
.score-card-detail { font-size: 11px; color: #777; margin-top: 4px; }

/* Accordion */
.accordion-list { padding: 10px 0 0; }
.accordion {
  background: #1e2c3a;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 8px;
  overflow: hidden;
}
.accordion-header {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  cursor: pointer;
  gap: 10px;
  -webkit-tap-highlight-color: transparent;
}
.accordion-header:active { background: rgba(128,128,128,0.08); }
.accordion-emoji { font-size: 20px; flex-shrink: 0; }
.accordion-title { flex: 1; font-size: 15px; font-weight: 500; }
.accordion-subtitle { font-size: 12px; font-weight: 400; color: #eab308; margin-top: 2px; }
.accordion-chevron {
  width: 20px; height: 20px; color: #666;
  transition: transform 0.2s;
  flex-shrink: 0;
}
.accordion.open .accordion-chevron { transform: rotate(180deg); }
.accordion-body {
  display: none;
  padding: 0 16px 16px;
}
.accordion.open .accordion-body { display: block; }

/* Form fields */
.field-group { margin-bottom: 14px; }
.field-label {
  font-size: 12px;
  color: #999;
  margin-bottom: 4px;
  display: block;
}
.field-input {
  width: 100%;
  background: #263545;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 10px 12px;
  color: #e4e6eb;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}
.field-input:focus { border-color: var(--tg-theme-link-color, #2481cc); }
.field-input::placeholder { color: #555; }
textarea.field-input {
  resize: vertical;
  min-height: 120px;
  line-height: 1.5;
}
select.field-input { appearance: none; cursor: pointer; }
input[type="date"].field-input { appearance: none; -webkit-appearance: none; min-width: 0; max-width: 100%; }

/* Contact verification */
.contact-unconfirmed .field-input { border-color: rgba(250, 204, 21, 0.45); }
.contact-confirmed .field-input { border-color: rgba(74, 222, 128, 0.35); }
.contact-verify-row { display: flex; gap: 8px; align-items: stretch; }
.contact-verify-row .field-input { flex: 1; min-width: 0; }
.btn-verify-contact {
  flex-shrink: 0;
  background: rgba(250, 204, 21, 0.12);
  border: 1px solid rgba(250, 204, 21, 0.35);
  border-radius: 8px;
  color: #facc15;
  font-size: 12px;
  padding: 0 10px;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 5px;
  line-height: 1;
  transition: opacity 0.15s;
}
.btn-verify-contact:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-verify-contact svg { flex-shrink: 0; }
.contact-warn-badge { color: #facc15; font-size: 12px; margin-left: 4px; font-style: normal; }
.contact-ok-badge { color: rgba(74, 222, 128, 0.8); font-size: 12px; margin-left: 4px; }
.otp-verify-row { display: flex; gap: 8px; align-items: stretch; margin-top: 8px; }
.otp-code-input {
  width: 80px;
  text-align: center;
  letter-spacing: 6px;
  font-size: 18px;
  font-weight: 600;
  background: #263545;
  border: 1px solid rgba(250, 204, 21, 0.4);
  border-radius: 8px;
  padding: 8px 4px;
  color: #e4e6eb;
  outline: none;
  font-family: inherit;
}
.unconfirmed-accordion-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(250, 204, 21, 0.18);
  color: #facc15;
  border-radius: 50%;
  width: 17px;
  height: 17px;
  font-size: 10px;
  font-weight: 700;
  margin-left: 6px;
  vertical-align: middle;
  line-height: 1;
}
.accordion-badge-red {
  background: rgba(239, 68, 68, 0.18);
  color: #ef4444;
}
.accordion-badge-warn {
  background: rgba(234, 179, 8, 0.18);
  color: #eab308;
}

/* Tags input */
.tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  background: #263545;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  min-height: 42px;
  cursor: text;
}
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(36,129,204,0.2);
  color: #7bb8e8;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 13px;
}
.tag-remove {
  cursor: pointer;
  opacity: 0.6;
  font-size: 16px;
  line-height: 1;
}
.tag-remove:hover { opacity: 1; }
.tags-input {
  border: none;
  background: none;
  color: #e4e6eb;
  font-size: 13px;
  outline: none;
  flex: 1;
  min-width: 80px;
}

/* Repeatable rows (sea service, certificates) */
.repeatable-row {
  background: #263545;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 8px;
  position: relative;
  border: 1px solid rgba(255,255,255,0.06);
}
.repeatable-row .field-group { margin-bottom: 10px; }
.repeatable-row .field-group:last-child { margin-bottom: 0; }
.row-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  cursor: pointer;
  user-select: none;
}
.repeatable-row.collapsed .row-header { margin-bottom: 0; }
.repeatable-row.collapsed .row-body { display: none; }
.row-body { margin-top: 10px; }
.row-chevron {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3c7;
  flex-shrink: 0;
  transition: transform 0.2s;
  margin-right: 6px;
}
.repeatable-row.collapsed .row-chevron { transform: rotate(-90deg); }
.row-title { font-size: 13px; font-weight: 600; color: #e4e6eb; }
.row-title-sub { font-size: 11px; font-weight: 400; color: #9ca3c7; margin-top: 2px; }
.row-title-wrap { display: flex; flex-direction: column; flex: 1; min-width: 0; }
/* Кнопка удаления в заголовке строки — только на веб-странице (embedded) */
.row-delete-btn { display: none; }
.embedded-constructor .row-delete-btn {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; flex-shrink: 0; margin-left: 6px;
  border: none; background: transparent; cursor: pointer;
  color: #9ca3c7; border-radius: 6px; opacity: 0; transition: opacity 0.15s;
}
.embedded-constructor .row-header:hover .row-delete-btn,
.embedded-constructor .row-delete-btn:focus { opacity: 1; }
.embedded-constructor .row-delete-btn:hover { background: rgba(239,68,68,0.12); color: #ef4444; }
.embedded-constructor .row-delete-btn svg { width: 16px; height: 16px; }
.cert-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  margin-left: 8px;
  vertical-align: middle;
  letter-spacing: 0.3px;
}
.cert-group { margin-bottom: 2px; }
.cert-group-header {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #6b7280;
  padding: 10px 0 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  -webkit-tap-highlight-color: transparent;
}
.cert-group:first-child .cert-group-header { padding-top: 0; }
.cert-group-chevron {
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s;
  color: #6b7280;
}
.cert-group.collapsed .cert-group-chevron { transform: rotate(-90deg); }
.cert-group.collapsed .cert-group-items { display: none; }
.cert-group-items { padding-left: 20px; }
.cert-group-label { color: #6b7280; }
.cert-group-count {
  font-size: 11px;
  font-weight: 500;
  color: #9ca3c7;
  margin-left: auto;
}
.cert-group-summary { margin-left: auto; }
/* Alert dot for groups/accordions with expiring/expired documents */
.cert-alert-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  font-size: 10px;
  font-weight: 700;
  padding: 0 5px;
  margin-left: 6px;
  flex-shrink: 0;
  line-height: 1;
}
.cert-alert-dot-warn { background: rgba(234,179,8,0.2); color: #eab308; }
.cert-alert-dot-exp  { background: rgba(239,68,68,0.2); color: #ef4444; }
.cert-group-header.needs-clarification,
.cert-group-header.needs-clarification .cert-group-label,
.cert-group-header.needs-clarification .cert-group-chevron { color: #818cf8; }
.cert-badge-ok  { background: rgba(34,197,94,0.15);  color: #22c55e; }
.cert-badge-unknown { background: rgba(99,102,241,0.15); color: #818cf8; }
.cert-badge-warn { background: rgba(234,179,8,0.15); color: #eab308; }
.cert-badge-exp { background: rgba(239,68,68,0.15);  color: #ef4444; }
/* Cert row status backgrounds — layered tint on dark base */
.cert-row-expired { background: linear-gradient(rgba(239,68,68,0.13), rgba(239,68,68,0.13)), #263545 !important; border-color: rgba(239,68,68,0.25) !important; }
.cert-row-warning { background: linear-gradient(rgba(234,179,8,0.13), rgba(234,179,8,0.13)), #263545 !important; border-color: rgba(234,179,8,0.25) !important; }
.cert-row-ok { background: linear-gradient(rgba(34,197,94,0.13), rgba(34,197,94,0.13)), #263545 !important; border-color: rgba(34,197,94,0.25) !important; }
/* Field-level highlighting for filled fields within status rows */
.cert-row-ok .field-input.field-filled,
.cert-row-ok .select-field-btn:not(.placeholder) {
  background: linear-gradient(rgba(34,197,94,0.18), rgba(34,197,94,0.18)), #263545;
  border-color: rgba(34,197,94,0.3);
}
.cert-row-warning .field-input.field-filled,
.cert-row-warning .select-field-btn:not(.placeholder) {
  background: linear-gradient(rgba(234,179,8,0.18), rgba(234,179,8,0.18)), #263545;
  border-color: rgba(234,179,8,0.3);
}
.cert-row-expired .field-input.field-filled,
.cert-row-expired .select-field-btn:not(.placeholder) {
  background: linear-gradient(rgba(239,68,68,0.18), rgba(239,68,68,0.18)), #263545;
  border-color: rgba(239,68,68,0.3);
}
/* Swipe to delete */
.swipe-container {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  margin-bottom: 8px;
}
.swipe-container .repeatable-row { margin-bottom: 0; border-radius: 10px; }
.swipe-content {
  position: relative;
  z-index: 1;
  background: #1e2c3a;
  border-radius: 10px;
}
.swipe-action {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #dc2626;
  z-index: 0;
  border-radius: 0 10px 10px 0;
}
.swipe-action svg { width: 22px; height: 22px; color: #fff; }
.btn-remove-row {
  background: none;
  border: none;
  color: #ef4444;
  font-size: 13px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}
.btn-remove-row:active { background: rgba(239,68,68,0.1); }
.row-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.row-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}
.row-full { grid-column: 1 / -1; }
.btn-add-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 12px;
  background: rgba(36,129,204,0.08);
  border: 1px dashed rgba(36,129,204,0.3);
  border-radius: 10px;
  color: var(--tg-theme-link-color, #2481cc);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  margin-bottom: 8px;
}
.btn-add-row:active { background: rgba(36,129,204,0.15); }

.btn-action {
  flex: 1;
  padding: 12px 16px;
  border-radius: 10px;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}
.btn-action:active { opacity: 0.8; }
.btn-primary {
  background: var(--tg-theme-button-color, #4f46e5);
  color: var(--tg-theme-button-text-color, #fff);
}
.btn-secondary {
  background: rgba(255,255,255,0.08);
  color: #e4e6eb;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  background: #1a2540;
  color: #e4e6eb;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 14px;
  z-index: 100;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.toast.visible { opacity: 1; }

/* Email modal */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 50;
  align-items: center;
  justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal-box {
  background: #0f1629;
  border-radius: 16px;
  padding: 24px;
  width: 90%;
  max-width: 360px;
  border: 1px solid rgba(255,255,255,0.1);
}
.modal-title { font-size: 17px; font-weight: 600; margin-bottom: 16px; }
.modal-actions { display: flex; gap: 8px; margin-top: 16px; }
.modal-actions .btn-action { flex: 1; }

/* Saving indicator */
.save-indicator {
  font-size: 12px;
  color: #22c55e;
  opacity: 0;
  transition: opacity 0.3s;
  margin-left: 8px;
}
.save-indicator.visible { opacity: 1; }

/* Select field (single / multi popup) */
.select-field-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}
.select-field-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 10px 14px;
  color: #e4e6eb;
  font-size: 15px;
  cursor: pointer;
  text-align: left;
  gap: 8px;
}
.select-field-btn.placeholder { color: #6b7280; }
.select-field-btn svg { flex-shrink: 0; opacity: 0.5; }
.select-field-btn.field-error { border-color: rgba(239,68,68,0.55); }
.cv-popup-lang-level-picker {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px 0 10px 20px;
}
.cv-popup-level-btn {
  padding: 5px 13px;
  border-radius: 14px;
  border: 1.5px solid rgba(59,130,246,0.45);
  background: rgba(59,130,246,0.10);
  color: #93c5fd;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}
.cv-popup-level-btn:active { transform: scale(0.96); }

/* Vessel & IMO autocomplete */
.vessel-autocomplete, .imo-autocomplete, .company-autocomplete { position: relative; }
.vessel-ac-input-wrap { position: relative; }
.vessel-ac-input-wrap .field-input { padding-right: 36px; }
.vessel-ac-icon {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.35;
  pointer-events: none;
}
.vessel-ac-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: #1e2740;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  z-index: 100;
  max-height: 240px;
  overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.vessel-ac-item {
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.vessel-ac-item:last-child { border-bottom: none; }
.vessel-ac-item:active { background: rgba(255,255,255,0.07); }
.vessel-ac-name { font-size: 14px; color: #e4e6eb; font-weight: 500; }
.vessel-ac-meta { font-size: 12px; color: #6b7280; margin-top: 2px; }

/* Universal CV popup overlay */
.cv-popup-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 200;
  align-items: flex-end;
  justify-content: center;
}
.cv-popup-overlay.active { display: flex; }
.cv-popup {
  width: 100%;
  max-width: 480px;
  background: #1e2c3a;
  border-radius: 20px 20px 0 0;
  display: flex;
  flex-direction: column;
  max-height: 80vh;
  animation: cvPopupSlideUp 0.25s ease-out;
}
@keyframes cvPopupSlideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
.cv-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.cv-popup-title {
  font-size: 17px;
  font-weight: 600;
  color: #f1f5f9;
}
.cv-popup-close {
  background: none;
  border: none;
  color: #9ca3c7;
  font-size: 22px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}
.cv-popup-hint {
  padding: 6px 20px 0;
  font-size: 12px;
  color: #9ca3c7;
  flex-shrink: 0;
}
.cv-popup-search-wrap {
  padding: 10px 16px 4px;
  flex-shrink: 0;
}
.cv-popup-search {
  width: 100%;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  padding: 8px 12px;
  color: #e4e6eb;
  font-size: 14px;
  outline: none;
}
.cv-popup-search::placeholder { color: #6b7280; }
.cv-popup-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px 20px 24px;
  overflow-y: auto;
}
.cv-popup-tag {
  display: inline-flex;
  align-items: center;
  padding: 7px 16px;
  border-radius: 20px;
  border: 1.5px solid rgba(148,163,184,0.3);
  background: transparent;
  color: #c9cfe0;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  user-select: none;
}
.cv-popup-tag:active { transform: scale(0.96); }
.cv-popup-tag.selected {
  background: #3b82f6;
  border-color: #3b82f6;
  color: #fff;
}
.cv-popup-tag.clear-tag {
  border-color: rgba(239,68,68,0.3);
  color: #ef4444;
}
.cv-popup-group-label {
  width: 100%;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6b7280;
  padding: 8px 0 2px;
}
.cv-popup-group-label:first-child { padding-top: 0; }
.cv-popup-tag.has-children {
  background: linear-gradient(135deg, rgba(59,130,246,0.10) 0%, rgba(99,102,241,0.08) 100%);
  border-color: rgba(99,102,241,0.25);
}
.cv-popup-tag.has-children::after {
  content: '›';
  margin-left: 6px;
  font-size: 16px;
  opacity: 0.5;
}
.cv-popup-back {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 6px 0 10px;
  font-size: 13px;
  color: #6b7280;
  cursor: pointer;
  user-select: none;
  border: none;
  background: none;
}
.cv-popup-back:active { opacity: 0.6; }
.cv-popup-back svg { flex-shrink: 0; }
.cv-popup-footer {
  padding: 12px 20px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.cv-popup-save {
  width: 100%;
  padding: 12px;
  background: #3b82f6;
  border: none;
  border-radius: 10px;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

/* ===== Light theme ===== */
body.light-theme .score-card {
  background: #eceff4;
  border-color: rgba(0,0,0,0.08);
}
body.light-theme .score-card-title { color: #6b7280; }
body.light-theme .score-card-detail { color: #6b7280; }
body.light-theme .score-card-badge.good { background: rgba(22,163,74,0.1); color: #15803d; }
body.light-theme .score-card-badge.warning { background: rgba(202,138,4,0.1); color: #a16207; }
body.light-theme .score-card-badge.bad { background: rgba(220,38,38,0.1); color: #dc2626; }

body.light-theme .accordion {
  background: #eceff4;
  border-color: rgba(0,0,0,0.08);
}
body.light-theme .accordion-title { color: #374151; }
body.light-theme .accordion-subtitle { color: #a16207; }
body.light-theme .accordion-chevron { color: #9ca3af; }
body.light-theme .accordion-header:active { background: rgba(0,0,0,0.03); }

body.light-theme .field-label { color: #6b7280; }
body.light-theme .field-input {
  background: #f3f4f6;
  border-color: rgba(0,0,0,0.10);
  color: #374151;
}
body.light-theme .field-input::placeholder { color: #9ca3af; }
body.light-theme .contact-unconfirmed .field-input { border-color: rgba(202, 138, 4, 0.5); }
body.light-theme .contact-confirmed .field-input { border-color: rgba(22, 163, 74, 0.4); }
body.light-theme .btn-verify-contact {
  background: rgba(202, 138, 4, 0.1);
  border-color: rgba(202, 138, 4, 0.35);
  color: #b45309;
}
body.light-theme .otp-code-input {
  background: #f3f4f6;
  color: #374151;
  border-color: rgba(202, 138, 4, 0.4);
}
body.light-theme .contact-warn-badge { color: #b45309; }
body.light-theme .contact-ok-badge { color: #16a34a; }
body.light-theme .unconfirmed-accordion-badge {
  background: rgba(202, 138, 4, 0.15);
  color: #b45309;
}
body.light-theme .accordion-badge-red {
  background: rgba(220, 38, 38, 0.12);
  color: #dc2626;
}
body.light-theme .accordion-badge-warn {
  background: rgba(202, 138, 4, 0.15);
  color: #b45309;
}

body.light-theme .tags-container {
  background: #f3f4f6;
  border-color: rgba(0,0,0,0.10);
}
body.light-theme .tag {
  background: rgba(59,130,246,0.1);
  color: #2563eb;
}
body.light-theme .tags-input { color: #374151; }

body.light-theme .repeatable-row {
  background: #f3f4f6;
  border-color: rgba(0,0,0,0.06);
}
body.light-theme .row-title { color: #374151; }
body.light-theme .row-title-sub { color: #6b7280; }
body.light-theme .row-chevron { color: #9ca3af; }

body.light-theme .cert-badge-ok { background: rgba(22,163,74,0.1); color: #15803d; }
body.light-theme .cert-badge-unknown { background: rgba(99,102,241,0.1); color: #6366f1; }
body.light-theme .cert-badge-warn { background: rgba(202,138,4,0.1); color: #a16207; }
body.light-theme .cert-badge-exp { background: rgba(220,38,38,0.1); color: #dc2626; }
body.light-theme .cert-row-expired { background: rgba(239,68,68,0.06) !important; border-color: rgba(239,68,68,0.18) !important; }
body.light-theme .cert-row-warning { background: rgba(234,179,8,0.06) !important; border-color: rgba(234,179,8,0.18) !important; }
body.light-theme .cert-row-ok { background: rgba(34,197,94,0.06) !important; border-color: rgba(34,197,94,0.18) !important; }
body.light-theme .cert-row-ok .field-input.field-filled,
body.light-theme .cert-row-ok .select-field-btn:not(.placeholder) {
  background: rgba(34,197,94,0.08); border-color: rgba(34,197,94,0.2);
}
body.light-theme .cert-row-warning .field-input.field-filled,
body.light-theme .cert-row-warning .select-field-btn:not(.placeholder) {
  background: rgba(234,179,8,0.08); border-color: rgba(234,179,8,0.2);
}
body.light-theme .cert-row-expired .field-input.field-filled,
body.light-theme .cert-row-expired .select-field-btn:not(.placeholder) {
  background: rgba(239,68,68,0.08); border-color: rgba(239,68,68,0.2);
}
body.light-theme .cert-group-count { color: #6b7280; }
body.light-theme .cert-alert-dot-warn { background: rgba(202,138,4,0.12); color: #a16207; }
body.light-theme .cert-alert-dot-exp  { background: rgba(220,38,38,0.12); color: #dc2626; }

body.light-theme .swipe-content { background: #eceff4; }

body.light-theme .select-field-btn {
  background: #f3f4f6;
  border-color: rgba(0,0,0,0.10);
  color: #374151;
}
body.light-theme .select-field-btn.placeholder { color: #9ca3af; }
body.light-theme .select-field-btn.field-error { border-color: rgba(220,38,38,0.5); }
body.light-theme .cv-popup-level-btn { background: rgba(59,130,246,0.07); border-color: rgba(59,130,246,0.35); color: #1d4ed8; }

body.light-theme .btn-add-row {
  background: rgba(59,130,246,0.05);
  border-color: rgba(59,130,246,0.25);
}

body.light-theme .btn-secondary {
  background: rgba(0,0,0,0.05);
  color: #374151;
}

body.light-theme .vessel-ac-dropdown {
  background: #eceff4;
  border-color: rgba(0,0,0,0.12);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}
body.light-theme .vessel-ac-item { border-bottom-color: rgba(0,0,0,0.06); }
body.light-theme .vessel-ac-item:active { background: rgba(0,0,0,0.04); }
body.light-theme .vessel-ac-name { color: #374151; }

body.light-theme .cv-popup {
  background: #eceff4;
}
body.light-theme .cv-popup-header { border-bottom-color: rgba(0,0,0,0.08); }
body.light-theme .cv-popup-title { color: #374151; }
body.light-theme .cv-popup-close { color: #9ca3af; }
body.light-theme .cv-popup-hint { color: #6b7280; }
body.light-theme .cv-popup-search {
  background: #f3f4f6;
  border-color: rgba(0,0,0,0.10);
  color: #374151;
}
body.light-theme .cv-popup-search::placeholder { color: #9ca3af; }
body.light-theme .cv-popup-tag {
  border-color: rgba(0,0,0,0.15);
  color: #374151;
}
body.light-theme .cv-popup-tag.has-children {
  background: rgba(59,130,246,0.06);
  border-color: rgba(99,102,241,0.2);
}
body.light-theme .cv-popup-footer { border-top-color: rgba(0,0,0,0.08); }

body.light-theme .modal-box {
  background: #eceff4;
  border-color: rgba(0,0,0,0.10);
}
body.light-theme .modal-title { color: #374151; }

body.light-theme .toast {
  background: #1a1a1a;
  color: #ffffff;
}

body.light-theme .loading { color: #6b7280; }
body.light-theme .spinner { border-color: #d1d5db; border-top-color: #3b82f6; }

/* =======================================================
   CV Анкета v2 — цветные иконки разделов, пульсация,
   левая акцентная полоса. Работает в dark + light.
   ======================================================= */

.accordion {
  --sec-c: #60a5fa;
  --sec-bg: linear-gradient(135deg, rgba(96,165,250,0.18), rgba(96,165,250,0.05));
  position: relative;
  transition: box-shadow 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}
.accordion::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--sec-c);
  opacity: 0.75;
  z-index: 1;
  border-top-left-radius: 12px;
  border-bottom-left-radius: 12px;
  pointer-events: none;
}
.accordion.open {
  box-shadow: 0 4px 16px rgba(0,0,0,0.25), 0 0 0 1px rgba(255,255,255,0.03);
}

/* Цветовые токены на раздел */
.accordion[data-section="personal_info"]    { --sec-c: #8b5cf6; --sec-bg: linear-gradient(135deg, rgba(139,92,246,0.22), rgba(139,92,246,0.06)); }
.accordion[data-section="body_measurements"]{ --sec-c: #14b8a6; --sec-bg: linear-gradient(135deg, rgba(20,184,166,0.22), rgba(20,184,166,0.06)); }
.accordion[data-section="professional"]     { --sec-c: #f59e0b; --sec-bg: linear-gradient(135deg, rgba(245,158,11,0.24), rgba(245,158,11,0.06)); }
.accordion[data-section="sea_service"]      { --sec-c: #0ea5e9; --sec-bg: linear-gradient(135deg, rgba(14,165,233,0.24), rgba(14,165,233,0.06)); }
.accordion[data-section="certificates"]     { --sec-c: #a78bfa; --sec-bg: linear-gradient(135deg, rgba(167,139,250,0.22), rgba(167,139,250,0.06)); }
.accordion[data-section="education"]        { --sec-c: #ec4899; --sec-bg: linear-gradient(135deg, rgba(236,72,153,0.22), rgba(236,72,153,0.06)); }
.accordion[data-section="next_of_kin"]      { --sec-c: #ef4444; --sec-bg: linear-gradient(135deg, rgba(239,68,68,0.22), rgba(239,68,68,0.06)); }
.accordion[data-section="additional"]       { --sec-c: #10b981; --sec-bg: linear-gradient(135deg, rgba(16,185,129,0.22), rgba(16,185,129,0.06)); }

/* Иконка-плитка вместо эмодзи */
.accordion-emoji {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--sec-bg);
  display: grid;
  place-items: center;
  color: var(--sec-c);
  flex-shrink: 0;
  position: relative;
  font-size: 0;
  line-height: 0;
  overflow: hidden;
}
.accordion-emoji svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: block;
}
.accordion-emoji .ic-wave {
  animation: cvIcWave 2.4s ease-in-out infinite;
  transform-origin: center;
}
.accordion-emoji .ic-pulse-dot {
  fill: currentColor;
  stroke: none;
  animation: cvIcPulseDot 2.4s ease-in-out infinite;
}
.accordion-emoji .ic-fill {
  fill: currentColor;
  stroke: none;
}
@keyframes cvIcWave {
  0%,100% { transform: translateX(0); }
  50%     { transform: translateX(1.4px); }
}
@keyframes cvIcPulseDot {
  0%,100% { opacity: 0.95; }
  50%     { opacity: 0.35; }
}

/* Пульсирующая точка вместо числового бейджа */
.unconfirmed-accordion-badge {
  width: 8px;
  height: 8px;
  min-width: 0;
  border-radius: 50%;
  background: #facc15;
  box-shadow: 0 0 0 2px rgba(250,204,21,0.18);
  display: inline-block;
  position: relative;
  margin-left: 6px;
  vertical-align: middle;
  color: transparent;
  font-size: 0;
  line-height: 0;
  flex-shrink: 0;
}
.unconfirmed-accordion-badge::before {
  content: "";
  position: absolute;
  left: -3px; top: -3px; right: -3px; bottom: -3px;
  border-radius: 50%;
  border: 2px solid rgba(250,204,21,0.5);
  animation: cvBadgePulse 1.8s ease-out infinite;
  pointer-events: none;
}
.accordion-badge-red {
  background: #ef4444;
  box-shadow: 0 0 0 2px rgba(239,68,68,0.2);
}
.accordion-badge-red::before { border-color: rgba(239,68,68,0.55); }
.accordion-badge-warn {
  background: #f59e0b;
  box-shadow: 0 0 0 2px rgba(245,158,11,0.2);
}
.accordion-badge-warn::before { border-color: rgba(245,158,11,0.55); }
@keyframes cvBadgePulse {
  0%   { transform: scale(0.7); opacity: 0.9; }
  100% { transform: scale(1.7); opacity: 0; }
}

/* Chevron подсвечивается цветом раздела при раскрытии */
.accordion.open .accordion-chevron { color: var(--sec-c); }

/* Заголовок раздела */
.accordion-header { gap: 12px; padding-left: 16px; }
.accordion-title { font-size: 15px; font-weight: 600; display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }

/* Light theme overrides */
body.light-theme .accordion {
  background: #ffffff;
  border: 1px solid rgba(15,23,42,0.06);
  box-shadow: 0 1px 2px rgba(15,23,42,0.04), 0 1px 3px rgba(15,23,42,0.04);
}
body.light-theme .accordion.open {
  box-shadow: 0 4px 14px rgba(15,23,42,0.08);
}
body.light-theme .accordion-title { color: #0f172a; }


/* =======================================================
   CV Анкета v2 — ring overlay (адаптивный к теме)
   ======================================================= */

.cv-progress-ring-wrap {
  position: relative;
  width: 104px;
  height: 104px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
}
.cv-ring-svg { display: block; }
.cv-ring-track { stroke: rgba(255,255,255,0.08); }
body.light-theme .cv-ring-track { stroke: rgba(15,23,42,0.08); }

.cv-ring-fill {
  transition: stroke-dashoffset 1.4s cubic-bezier(0.22,1,0.36,1);
  filter: drop-shadow(0 2px 6px rgba(34,197,94,0.28));
}
.cv-ring-warn .cv-ring-fill { filter: drop-shadow(0 2px 6px rgba(245,158,11,0.28)); }
.cv-ring-bad  .cv-ring-fill { filter: drop-shadow(0 2px 6px rgba(239,68,68,0.28)); }

.cv-ring-pulse {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(34,197,94,0.3);
  animation: cvRingPulse 2.4s ease-out infinite;
  pointer-events: none;
}
.cv-ring-warn .cv-ring-pulse { border-color: rgba(245,158,11,0.3); }
.cv-ring-bad  .cv-ring-pulse { border-color: rgba(239,68,68,0.3); }
@keyframes cvRingPulse {
  0%   { transform: scale(0.94); opacity: 0; }
  30%  { opacity: 0.6; }
  100% { transform: scale(1.14); opacity: 0; }
}

.cv-ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.cv-ring-pct {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 1px 2px rgba(0,0,0,0.08);
}
.cv-ring-warn .cv-ring-pct { background: linear-gradient(135deg, #f59e0b, #d97706); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cv-ring-bad  .cv-ring-pct { background: linear-gradient(135deg, #ef4444, #dc2626); -webkit-background-clip: text; background-clip: text; color: transparent; }

.cv-ring-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #9ca3c7;
  margin-top: 3px;
  font-weight: 600;
}
body.light-theme .cv-ring-label { color: #64748b; }

/* =======================================================
   CV Анкета v2 — действия (PDF / Email / Шаблон / Статус)
   ======================================================= */

.cv-constructor-actions {
  gap: 6px;
  padding: 6px 2px 16px;
}
.cv-constructor-btn {
  gap: 7px;
  padding: 6px 2px 4px;
  transition: transform 0.18s;
}
.cv-constructor-btn:active { transform: scale(0.94); }

.cv-btn-icon-circle {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, rgba(96,165,250,0.22), rgba(167,139,250,0.18));
  color: #cbd5e1;
  box-shadow:
    0 2px 6px rgba(0,0,0,0.18),
    inset 0 -2px 4px rgba(0,0,0,0.14),
    inset 0 1px 1px rgba(255,255,255,0.06);
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s;
  position: relative;
  overflow: hidden;
}
.cv-btn-icon-circle::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255,255,255,0.16) 0%, transparent 45%);
  pointer-events: none;
}
.cv-constructor-btn svg { opacity: 1; position: relative; z-index: 1; transition: transform 0.25s; }

/* Цвет на каждую кнопку */
.cv-constructor-btn[data-act="pdf"]    .cv-btn-icon-circle { background: linear-gradient(135deg, #ef4444, #dc2626); color: #fff; }
.cv-constructor-btn[data-act="email"]  .cv-btn-icon-circle { background: linear-gradient(135deg, #3b82f6, #1d4ed8); color: #fff; }
.cv-constructor-btn[data-act="tpl"]    .cv-btn-icon-circle { background: linear-gradient(135deg, #8b5cf6, #6d28d9); color: #fff; }
.cv-constructor-btn[data-act="status"] .cv-btn-icon-circle { background: linear-gradient(135deg, #10b981, #059669); color: #fff; }

/* Лёгкое парение — разные фазы */
.cv-constructor-btn[data-act="pdf"]    .cv-btn-icon-circle { animation: cvBtnBob 4.2s ease-in-out infinite; animation-delay: 0s; }
.cv-constructor-btn[data-act="email"]  .cv-btn-icon-circle { animation: cvBtnBob 4.2s ease-in-out infinite; animation-delay: 0.35s; }
.cv-constructor-btn[data-act="tpl"]    .cv-btn-icon-circle { animation: cvBtnBob 4.2s ease-in-out infinite; animation-delay: 0.7s; }
.cv-constructor-btn[data-act="status"] .cv-btn-icon-circle { animation: cvBtnBob 4.2s ease-in-out infinite; animation-delay: 1.05s; }
@keyframes cvBtnBob {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-2px); }
}

/* Мини-движение SVG внутри */
.cv-constructor-btn[data-act="pdf"]:hover svg    { transform: translateY(-1px) scale(1.06); }
.cv-constructor-btn[data-act="email"]:hover svg  { transform: translateY(-1px) scale(1.06); }
.cv-constructor-btn:active .cv-btn-icon-circle {
  transform: scale(0.92);
  box-shadow: 0 1px 3px rgba(0,0,0,0.25), inset 0 2px 4px rgba(0,0,0,0.2);
}

.cv-constructor-btn:disabled .cv-btn-icon-circle {
  opacity: 0.38;
  filter: grayscale(0.5);
  animation: none;
}
.cv-constructor-btn:disabled { opacity: 1; }
.cv-constructor-btn:disabled span:last-child { opacity: 0.4; }

/* Light theme — кнопки остаются цветными, только лейбл темный */
body.light-theme .cv-constructor-btn { color: #475569; }
body.light-theme .cv-btn-icon-circle {
  box-shadow: 0 2px 8px rgba(15,23,42,0.12), inset 0 -2px 4px rgba(0,0,0,0.08);
}


/* =======================================================
   CV Анкета v2 — таймлайн Морского стажа
   ======================================================= */

.ss-timeline {
  position: relative;
  padding-left: 22px;
  margin-top: 6px;
}
.ss-timeline::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 14px;
  bottom: 14px;
  width: 2px;
  background: linear-gradient(180deg, #0ea5e9 0%, rgba(14,165,233,0.25) 100%);
  border-radius: 2px;
}

/* Год-блок: без uppercase, крупнее, с круглым узлом слева */
.cert-group.ss-year { margin-bottom: 0; }
.cert-group.ss-year .cert-group-header {
  text-transform: none;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0;
  color: #e4e6eb;
  padding: 9px 0;
  position: relative;
}
body.light-theme .cert-group.ss-year .cert-group-header { color: #0f172a; }

.cert-group.ss-year .cert-group-label { color: inherit; font-weight: 700; }
.cert-group.ss-year .cert-group-summary {
  font-size: 11px;
  font-weight: 600;
  color: #9ca3c7;
  text-transform: none;
  letter-spacing: 0.02em;
}
body.light-theme .cert-group.ss-year .cert-group-summary { color: #64748b; }

/* Круглый узел — слева от заголовка года */
.cert-group.ss-year .cert-group-header::before {
  content: "";
  position: absolute;
  left: -22px;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #1e2c3a;
  border: 2px solid #0ea5e9;
  box-shadow: 0 0 0 4px rgba(14,165,233,0.12);
  transition: background 0.3s, box-shadow 0.3s;
  z-index: 1;
}
body.light-theme .cert-group.ss-year .cert-group-header::before { background: #ffffff; }

/* Раскрытый год — залитый узел с троббингом */
.cert-group.ss-year:not(.collapsed) .cert-group-header::before {
  background: #0ea5e9;
  box-shadow: 0 0 0 5px rgba(14,165,233,0.22);
  animation: ssNodeThrob 1.6s ease-out;
}
@keyframes ssNodeThrob {
  0%   { box-shadow: 0 0 0 0 rgba(14,165,233,0.6); }
  100% { box-shadow: 0 0 0 8px rgba(14,165,233,0); }
}

/* Chevron года — меньше и тоньше */
.cert-group.ss-year .cert-group-chevron { color: #64748b; }
.cert-group.ss-year:not(.collapsed) .cert-group-chevron { color: #0ea5e9; }

/* Рейсы внутри года — убираем лишний отступ слева */
.cert-group.ss-year .cert-group-items {
  padding-left: 0;
  padding-top: 4px;
  padding-bottom: 6px;
}

/* Voyage row внутри таймлайна — добавляем левый голубой акцент */
.ss-timeline .repeatable-row {
  position: relative;
  border-left: 2px solid rgba(14,165,233,0.28);
  background: linear-gradient(135deg, rgba(14,165,233,0.05), rgba(14,165,233,0.02));
  border-color: rgba(14,165,233,0.28);
  margin-bottom: 6px;
}
.ss-timeline .repeatable-row.cert-row-ok {
  border-left-color: #22c55e;
  background: linear-gradient(135deg, rgba(34,197,94,0.06), rgba(34,197,94,0.02));
}
.ss-timeline .repeatable-row.cert-row-warning {
  border-left-color: #f59e0b;
}
.ss-timeline .repeatable-row.cert-row-expired {
  border-left-color: #ef4444;
}

body.light-theme .ss-timeline::before {
  background: linear-gradient(180deg, #0ea5e9 0%, rgba(14,165,233,0.3) 100%);
}
body.light-theme .ss-timeline .repeatable-row {
  background: linear-gradient(135deg, rgba(14,165,233,0.08), rgba(14,165,233,0.02));
}


/* =======================================================
   CV Анкета v2 — фиксы: swipe padding + анимированная
   кнопка "+ Добавить рейс/документ"
   ======================================================= */

/* Swipe-контейнер сам держит отступ, у .repeatable-row внутри — 0. */
.ss-timeline .swipe-container .repeatable-row { margin-bottom: 0; }
.ss-timeline .swipe-container { margin-bottom: 6px; }

/* Анимированная add-row кнопка в стиле мокапа */
.btn-add-row {
  position: relative;
  overflow: hidden;
  border: 1.5px dashed rgba(14,165,233,0.45);
  background: linear-gradient(135deg, rgba(14,165,233,0.14), rgba(14,165,233,0.05));
  color: #38bdf8;
  font-weight: 700;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}
.btn-add-row:hover {
  background: linear-gradient(135deg, rgba(14,165,233,0.22), rgba(14,165,233,0.08));
  border-color: rgba(14,165,233,0.6);
}
.btn-add-row:active {
  background: linear-gradient(135deg, rgba(14,165,233,0.28), rgba(14,165,233,0.1));
  transform: scale(0.98);
}
.btn-add-row::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.22), transparent 70%);
  transform: translateX(-100%);
  animation: addBtnShimmer 3.2s ease-in-out infinite;
  pointer-events: none;
}
@keyframes addBtnShimmer {
  0%, 40%   { transform: translateX(-100%); }
  60%, 100% { transform: translateX(100%); }
}

body.light-theme .btn-add-row {
  background: linear-gradient(135deg, rgba(14,165,233,0.12), rgba(14,165,233,0.03));
  border-color: rgba(14,165,233,0.45);
  color: #0284c7;
}
body.light-theme .btn-add-row:hover {
  background: linear-gradient(135deg, rgba(14,165,233,0.2), rgba(14,165,233,0.05));
}
body.light-theme .btn-add-row::before {
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.7), transparent 70%);
}


/* =======================================================
   CV Анкета v2 — карточка рейса (voy-row) по состоянию
   ======================================================= */

/* Перекрываем старые .cert-row-* !important в контексте ss-timeline:
   цвет зависит НЕ от заполненности, а от collapsed/expanded. */

/* Свёрнутый рейс — пастельно-голубой */
.ss-timeline .swipe-container .repeatable-row.voy-row.collapsed,
.ss-timeline .swipe-container .repeatable-row.voy-row.collapsed.cert-row-ok,
.ss-timeline .swipe-container .repeatable-row.voy-row.collapsed.cert-row-warning,
.ss-timeline .swipe-container .repeatable-row.voy-row.collapsed.cert-row-expired {
  background: linear-gradient(135deg, rgba(14,165,233,0.10), rgba(14,165,233,0.03)) !important;
  border: 1px solid rgba(14,165,233,0.22) !important;
  border-left: 2px solid rgba(14,165,233,0.5) !important;
}

/* Развёрнутый рейс — пастельно-зелёный */
.ss-timeline .swipe-container .repeatable-row.voy-row:not(.collapsed),
.ss-timeline .swipe-container .repeatable-row.voy-row:not(.collapsed).cert-row-ok,
.ss-timeline .swipe-container .repeatable-row.voy-row:not(.collapsed).cert-row-warning,
.ss-timeline .swipe-container .repeatable-row.voy-row:not(.collapsed).cert-row-expired {
  background: linear-gradient(135deg, rgba(34,197,94,0.09), rgba(34,197,94,0.02)) !important;
  border: 1px solid rgba(34,197,94,0.28) !important;
  border-left: 2px solid #22c55e !important;
}

/* Точка-иконка слева */
.ss-timeline .voy-row .voy-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(14,165,233,0.18);
  color: #0ea5e9;
  flex-shrink: 0;
  transition: background 0.25s, color 0.25s;
}
.ss-timeline .voy-row .voy-dot svg { width: 14px; height: 14px; display: block; }
.ss-timeline .voy-row:not(.collapsed) .voy-dot {
  background: rgba(34,197,94,0.22);
  color: #16a34a;
}

/* Chevron — справа, мелкий */
.ss-timeline .voy-row .row-chevron {
  margin-left: auto;
  color: #64748b;
  transition: color 0.25s, transform 0.25s;
}
.ss-timeline .voy-row:not(.collapsed) .row-chevron { color: #16a34a; }

/* Title: vessel_name подсвечиваем */
.ss-timeline .voy-row .row-title { color: inherit; }
.ss-timeline .voy-row .voy-vessel {
  color: #0ea5e9;
  font-weight: 700;
}
.ss-timeline .voy-row:not(.collapsed) .voy-vessel { color: #16a34a; }

/* Light theme */
body.light-theme .ss-timeline .swipe-container .repeatable-row.voy-row.collapsed,
body.light-theme .ss-timeline .swipe-container .repeatable-row.voy-row.collapsed.cert-row-ok,
body.light-theme .ss-timeline .swipe-container .repeatable-row.voy-row.collapsed.cert-row-warning,
body.light-theme .ss-timeline .swipe-container .repeatable-row.voy-row.collapsed.cert-row-expired {
  background: linear-gradient(135deg, rgba(14,165,233,0.08), rgba(14,165,233,0.02)) !important;
  border-color: rgba(14,165,233,0.25) !important;
  border-left-color: rgba(14,165,233,0.55) !important;
}
body.light-theme .ss-timeline .swipe-container .repeatable-row.voy-row:not(.collapsed),
body.light-theme .ss-timeline .swipe-container .repeatable-row.voy-row:not(.collapsed).cert-row-ok,
body.light-theme .ss-timeline .swipe-container .repeatable-row.voy-row:not(.collapsed).cert-row-warning,
body.light-theme .ss-timeline .swipe-container .repeatable-row.voy-row:not(.collapsed).cert-row-expired {
  background: linear-gradient(135deg, rgba(34,197,94,0.08), rgba(34,197,94,0.02)) !important;
  border-color: rgba(34,197,94,0.3) !important;
  border-left-color: #22c55e !important;
}


/* =======================================================
   CV Анкета v2 — группы документов с цветными иконками
   ======================================================= */

.cert-group.cert-group-styled { margin-bottom: 2px; padding: 0; }
.cert-group.cert-group-styled .cert-group-header {
  gap: 10px;
  padding: 10px 4px;
  align-items: center;
  position: relative;
  cursor: pointer;
  text-transform: uppercase;
}

/* Иконка-плитка группы */
.cert-group-ic {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: #64748b;
  background: rgba(148,163,184,0.16);
}
.cert-group-ic svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: block;
}

/* Цвета иконок по группам */
.cert-group-ic[data-cg="attn"]   { background: rgba(139,92,246,0.18); color: #a78bfa; }
.cert-group-ic[data-cg="travel"] { background: rgba(239,68,68,0.16);  color: #ef4444; }
.cert-group-ic[data-cg="med"]    { background: rgba(16,185,129,0.18); color: #10b981; }
.cert-group-ic[data-cg="lic"]    { background: rgba(59,130,246,0.18); color: #60a5fa; }
.cert-group-ic[data-cg="stcw"]   { background: rgba(34,197,94,0.18);  color: #22c55e; }
.cert-group-ic[data-cg="spec"]   { background: rgba(245,158,11,0.22); color: #f59e0b; }

/* Лейбл группы */
.cert-group.cert-group-styled .cert-group-label {
  flex: 1;
  color: #e4e6eb;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
}
/* "Требуется уточнение" — акцент фиолетом */
.cert-group.cert-group-styled[data-cg="attn"] .cert-group-label,
.cert-group.cert-group-styled .cert-group-header.needs-clarification .cert-group-label { color: #a78bfa; }

/* Счётчик общего кол-ва */
.cert-group.cert-group-styled .cert-group-count {
  color: #9ca3c7;
  font-size: 13px;
  font-weight: 700;
  margin-left: 4px;
}

/* Chevron справа, маленький */
.cert-group.cert-group-styled .cert-group-chevron {
  color: #64748b;
  width: 14px;
  height: 14px;
  margin-left: 4px;
}
.cert-group.cert-group-styled:not(.collapsed) .cert-group-chevron {
  color: currentColor;
  transform: rotate(0deg);
}
.cert-group.cert-group-styled.collapsed .cert-group-chevron {
  transform: rotate(-90deg);
}

/* Alert-bubble рядом с лейблом: красный или жёлтый с числом */
.cert-group.cert-group-styled .cert-alert-dot {
  position: relative;
  margin-left: 4px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 800;
  box-shadow: 0 0 0 3px rgba(0,0,0,0.25);
}
.cert-group.cert-group-styled .cert-alert-dot-exp {
  background: #ef4444;
  color: #fff;
  animation: certAlertPulseRed 1.8s ease-out infinite;
}
.cert-group.cert-group-styled .cert-alert-dot-warn {
  background: #f59e0b;
  color: #fff;
  animation: certAlertPulseWarn 1.8s ease-out infinite;
}
@keyframes certAlertPulseRed {
  0%   { box-shadow: 0 0 0 0 rgba(239,68,68,0.55); }
  100% { box-shadow: 0 0 0 8px rgba(239,68,68,0); }
}
@keyframes certAlertPulseWarn {
  0%   { box-shadow: 0 0 0 0 rgba(245,158,11,0.55); }
  100% { box-shadow: 0 0 0 8px rgba(245,158,11,0); }
}

/* Разделитель между группами */
.cert-group.cert-group-styled + .cert-group.cert-group-styled .cert-group-header {
  border-top: 1px solid rgba(255,255,255,0.05);
}

/* Items внутри группы */
.cert-group.cert-group-styled .cert-group-items {
  padding-left: 0;
  padding-top: 4px;
  padding-bottom: 6px;
}

/* Light theme */
body.light-theme .cert-group.cert-group-styled .cert-group-label { color: #0f172a; }
body.light-theme .cert-group.cert-group-styled .cert-group-count { color: #64748b; }
body.light-theme .cert-group.cert-group-styled .cert-group-chevron { color: #64748b; }
body.light-theme .cert-group.cert-group-styled[data-cg="attn"] .cert-group-label,
body.light-theme .cert-group.cert-group-styled .cert-group-header.needs-clarification .cert-group-label { color: #7c3aed; }
body.light-theme .cert-group-ic[data-cg="attn"]   { background: rgba(139,92,246,0.14); color: #7c3aed; }
body.light-theme .cert-group-ic[data-cg="travel"] { background: rgba(239,68,68,0.12);  color: #dc2626; }
body.light-theme .cert-group-ic[data-cg="med"]    { background: rgba(16,185,129,0.14); color: #059669; }
body.light-theme .cert-group-ic[data-cg="lic"]    { background: rgba(59,130,246,0.14); color: #1f6feb; }
body.light-theme .cert-group-ic[data-cg="stcw"]   { background: rgba(34,197,94,0.14);  color: #16a34a; }
body.light-theme .cert-group-ic[data-cg="spec"]   { background: rgba(245,158,11,0.2);  color: #b45309; }
body.light-theme .cert-group.cert-group-styled .cert-alert-dot {
  box-shadow: 0 0 0 3px rgba(255,255,255,0.6);
}
body.light-theme .cert-group.cert-group-styled + .cert-group.cert-group-styled .cert-group-header {
  border-top-color: rgba(15,23,42,0.06);
}


/* =======================================================
   CV Анкета v2 — баннеры в стиле мокапа (alert-card)
   ======================================================= */

/* Slide: gradient bg + left stripe + icon tile + pulse + clock */
.cv-banner-slide {
  padding: 14px 40px 14px 60px !important;
  min-height: 62px;
  position: relative;
  border-left: none !important;
  border-radius: 0 !important;
  background: linear-gradient(135deg, rgba(234,179,8,0.14), rgba(234,179,8,0.05)) !important;
}
.cv-banner-slide::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, #eab308, #ca8a04);
  z-index: 1;
}
.cv-banner-slide.banner-green {
  background: #166534 !important;
}
.cv-banner-slide.banner-green::before {
  background: linear-gradient(180deg, #4ade80, #16a34a);
}
.cv-banner-slide.banner-red {
  background: #92400e !important;
}
.cv-banner-slide.banner-red::before {
  background: linear-gradient(180deg, #fbbf24, #b45309);
}

/* Icon tile — 32x32 с pulse-ring. Позиционирован абсолютно слева. */
.cv-banner-icon-wrap {
  position: absolute !important;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px !important;
  height: 34px !important;
  border-radius: 10px !important;
  background: rgba(234,179,8,0.2) !important;
  color: #ca8a04 !important;
}
.cv-banner-icon-wrap::before {
  content: "";
  position: absolute;
  left: -4px; top: -4px; right: -4px; bottom: -4px;
  border-radius: 14px;
  border: 2px solid rgba(234,179,8,0.35);
  animation: cvBannerPing 2s ease-out infinite;
  pointer-events: none;
}
.cv-banner-slide.banner-green .cv-banner-icon-wrap {
  background: rgba(255,255,255,0.20) !important;
  color: #fff !important;
}
.cv-banner-slide.banner-green .cv-banner-icon-wrap::before {
  border-color: rgba(255,255,255,0.45);
}
.cv-banner-slide.banner-red .cv-banner-icon-wrap {
  background: rgba(255,255,255,0.20) !important;
  color: #fff !important;
}
.cv-banner-slide.banner-red .cv-banner-icon-wrap::before {
  border-color: rgba(255,255,255,0.45);
}
@keyframes cvBannerPing {
  0%   { transform: scale(0.9);  opacity: 0.85; }
  100% { transform: scale(1.35); opacity: 0; }
}

/* Часы: стрелка вращается */
.cvb-clock { width: 18px; height: 18px; display: block; }
.cvb-clock-hand {
  transform-origin: 9px 9px;
  animation: cvBannerClockTick 3.2s linear infinite;
}
@keyframes cvBannerClockTick { to { transform: rotate(360deg); } }

/* Книжку Delta Test Pro показываем без pulse-кольца */
.cv-banner-slide[data-action="deltatest"] .cv-banner-icon-wrap::before { display: none; }
.cv-banner-slide[data-action="deltatest"] .cv-banner-icon-wrap {
  background: transparent !important;
  width: 50px !important;
  height: 50px !important;
  left: 8px;
}

/* Typography */
.cv-banner-body { padding-right: 4px; }
.cv-banner-title {
  font-size: 13px !important;
  font-weight: 800 !important;
  letter-spacing: 0.01em;
  color: #92400e !important;
}
.cv-banner-slide.banner-green .cv-banner-title { color: #f0fdf4 !important; }
.cv-banner-slide.banner-red .cv-banner-title { color: #fffbeb !important; }
.cv-banner-sub {
  font-size: 11px !important;
  font-weight: 500 !important;
  color: #b45309 !important;
  margin-top: 2px !important;
}
.cv-banner-slide.banner-green .cv-banner-sub { color: #dcfce7 !important; }
.cv-banner-slide.banner-red .cv-banner-sub { color: #fef3c7 !important; }

/* Chevron справа */
.cv-banner-arrow {
  position: absolute !important;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
}
.cv-banner-arrow svg { display: block; }

/* Dots — чуть ниже */
.cv-banners-dots {
  margin-top: 8px !important;
}

/* =======================================================
   CV Анкета v2 — Hero карточка с прогрессом: градиент фона
   ======================================================= */
.cv-hero-card {
  position: relative;
  background: linear-gradient(135deg, #ffffff 0%, #f6f8ff 100%);
  border-radius: 18px;
  padding: 14px 14px 14px 10px;
  margin: 6px 0 10px !important;
  box-shadow: 0 2px 10px rgba(15,23,42,0.04), 0 1px 3px rgba(15,23,42,0.04);
  overflow: hidden;
}
.cv-hero-card::before {
  content: "";
  position: absolute;
  top: -40px; right: -40px;
  width: 160px; height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(99,102,241,0.22), transparent 60%);
  filter: blur(20px);
  animation: cvHeroOrb 8s ease-in-out infinite;
  pointer-events: none;
}
@keyframes cvHeroOrb {
  0%,100% { transform: translate(0,0) scale(1); }
  50%     { transform: translate(-12px, 10px) scale(1.06); }
}
.cv-hero-card > * { position: relative; z-index: 1; }

body:not(.light-theme) .cv-hero-card {
  background: linear-gradient(135deg, #1e2c3a 0%, #263342 100%);
  box-shadow: 0 2px 14px rgba(0,0,0,0.3);
}
body:not(.light-theme) .cv-hero-card::before {
  background: radial-gradient(circle at 30% 30%, rgba(99,102,241,0.35), transparent 60%);
}

/* Light theme overrides for banners */
body.light-theme .cv-banner-slide {
  background: linear-gradient(135deg, rgba(234,179,8,0.14), rgba(234,179,8,0.03)) !important;
}
body.light-theme .cv-banner-slide.banner-green {
  background: #dcfce7 !important;
}
body.light-theme .cv-banner-slide.banner-green .cv-banner-icon-wrap {
  background: rgba(22,163,74,0.18) !important;
  color: #15803d !important;
}
body.light-theme .cv-banner-slide.banner-green .cv-banner-icon-wrap::before {
  border-color: rgba(22,163,74,0.4);
}
body.light-theme .cv-banner-slide.banner-green .cv-banner-title { color: #15803d !important; }
body.light-theme .cv-banner-slide.banner-green .cv-banner-sub { color: #166534 !important; }
body.light-theme .cv-banner-slide.banner-red {
  background: #fef3c7 !important;
}
body.light-theme .cv-banner-slide.banner-red .cv-banner-icon-wrap {
  background: rgba(217,119,6,0.18) !important;
  color: #b45309 !important;
}
body.light-theme .cv-banner-slide.banner-red .cv-banner-icon-wrap::before {
  border-color: rgba(217,119,6,0.4);
}
body.light-theme .cv-banner-slide.banner-red .cv-banner-title { color: #92400e !important; }
body.light-theme .cv-banner-slide.banner-red .cv-banner-sub { color: #b45309 !important; }


/* =======================================================
   CV Distribution banner — анимации
   ======================================================= */

.cv-dist-anim svg { overflow: visible; }

.cv-dist-plane {
  animation: cvDistPlaneFly 3.4s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  transform-origin: 46px 8px;
}
@keyframes cvDistPlaneFly {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  45%      { transform: translate(2px, -4px) rotate(-6deg); }
  50%      { transform: translate(2px, -4px) rotate(-6deg); opacity: 1; }
  55%      { transform: translate(4px, -8px) rotate(-12deg); opacity: 0; }
  56%      { transform: translate(-10px, 6px) rotate(0deg); opacity: 0; }
  65%      { transform: translate(-6px, 3px) rotate(0deg); opacity: 1; }
}

.cv-dist-env {
  animation: cvDistEnvLift 3.4s ease-in-out infinite;
  transform-origin: 26px 22px;
}
@keyframes cvDistEnvLift {
  0%, 100% { transform: translate(12px, 12px); }
  45%      { transform: translate(12px, 10px); }
  55%      { transform: translate(12px, 12px); }
}

.cv-dist-trail {
  stroke-dashoffset: 0;
  animation: cvDistTrail 3.4s linear infinite;
}
@keyframes cvDistTrail {
  0%   { stroke-dashoffset: 0;   opacity: 0.7; }
  50%  { stroke-dashoffset: -30; opacity: 1; }
  100% { stroke-dashoffset: -60; opacity: 0.2; }
}

.cv-dist-d1, .cv-dist-d2, .cv-dist-d3 {
  animation: cvDistDotPing 2.4s ease-out infinite;
  transform-origin: center;
}
.cv-dist-d1 { transform-box: fill-box; }
.cv-dist-d2 { transform-box: fill-box; animation-delay: 0.4s; }
.cv-dist-d3 { transform-box: fill-box; animation-delay: 0.8s; }
@keyframes cvDistDotPing {
  0%   { transform: scale(0.6); opacity: 0; }
  25%  { transform: scale(1);   opacity: 1; }
  60%  { transform: scale(1.25); opacity: 0.6; }
  100% { transform: scale(1.6); opacity: 0; }
}


/* === References card (#129) === */
.ref-card {
  background: var(--surface-2, #263545);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  padding: 14px 14px 12px;
  margin-bottom: 10px;
  position: relative;
  transition: border-color .2s, box-shadow .2s;
}
.ref-card.cert-row-ok      { border-left: 3px solid #22c55e; }
.ref-card.cert-row-warning { border-left: 3px solid #f59e0b; }
.ref-card.cert-row-expired { border-left: 3px solid #ef4444; }
.ref-card__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  cursor: pointer;
  user-select: none;
}
.ref-card__chev {
  color: var(--ink-soft, #94a3b8);
  flex-shrink: 0;
  transition: transform .2s;
}
.ref-card.collapsed .ref-card__chev { transform: rotate(-90deg); }
.ref-card.collapsed .ref-card__head { margin-bottom: 0; }
.ref-card.collapsed .ref-card__body { display: none; }
.ref-card__num {
  width: 32px; height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, rgba(14,165,233,0.22), rgba(14,165,233,0.08));
  color: #38bdf8;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-weight: 700; font-size: 13px;
}
.ref-card__title-wrap { flex: 1; min-width: 0; }
.ref-card__title {
  font-weight: 700; font-size: 14px;
  color: var(--ink, #e4e6eb);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ref-card__sub {
  font-size: 11px;
  color: var(--ink-soft, #94a3b8);
  margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ref-card__trash {
  background: none; border: none; cursor: pointer;
  color: var(--ink-soft, #94a3b8);
  padding: 6px 8px; border-radius: 6px;
  flex-shrink: 0;
  transition: background .15s, color .15s;
}
.ref-card__trash:hover { background: rgba(239,68,68,0.12); color: #ef4444; }
.ref-card__body .field-group { margin-bottom: 8px; }
.ref-card__body .row-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* Light theme */
body.light-theme .ref-card {
  background: #fafbff;
  border-color: rgba(15,23,42,0.08);
}
body.light-theme .ref-card__num {
  background: linear-gradient(135deg, rgba(14,165,233,0.12), rgba(14,165,233,0.04));
  color: #0284c7;
}
body.light-theme .ref-card__title { color: #0f172a; }
body.light-theme .ref-card__sub { color: #64748b; }
body.light-theme .ref-card__trash { color: #94a3b8; }
