/* 5. Экраны сдачи теста. Порядок файлов менять нельзя: следующий перекрывает предыдущий. */
/* —— Экраны работника: светлая тема ИНК (белый + зелёный) —— */
html:has(body.page-worker) {
  background: var(--bg);
}

body.page-worker {
  --ink-green: #1e6b4b;
  --ink-green-hover: #17563c;
  --ink-green-soft: #f7f6f5;
  --ink-green-border: #D5D2CF;
  --bg: #F3F1EF;
  --surface: rgba(255, 255, 255, 0.65);
  --surface-2: #f7f6f5;
  --text: #292C33;
  --muted: #898584;
  --accent: #1e6b4b;
  --accent-2: #17563c;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --shadow: 0 8px 32px rgba(15, 23, 42, 0.04);
  background: var(--bg);
  color: var(--text);
}

body.page-worker a {
  color: var(--ink-green-hover);
}

.worker-page {
  min-height: 100vh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

/* Верхняя панель — те же стили, что у .worker-footer (зеркально) */
.worker-topbar {
  flex-shrink: 0;
  width: 100%;
  border-bottom: 1px solid rgba(30, 107, 75, 0.14);
  background: #ffffff;
  box-shadow: 0 4px 24px rgba(30, 107, 75, 0.06);
}

body.page-worker nav img.site-logo {
  height: 44px;
  width: auto;
  max-width: min(320px, 52vw);
  object-fit: contain;
  object-position: left center;
}

body.page-manager nav img.site-logo,
body.page-manager .sidebar-logo-container img.site-logo {
  height: 44px;
  width: auto;
  max-width: min(320px, 52vw);
  object-fit: contain;
  object-position: left center;
}

body.page-manager nav .site-logo-wrap {
  display: flex;
  align-items: center;
  line-height: 0;
}

nav .site-logo-wrap a.site-logo-link,
.sidebar-logo-container a.site-logo-link,
body.page-worker nav a.site-logo-link,
a.site-logo-link {
  display: inline-flex;
  align-items: center;
  line-height: 0;
  border-radius: 6px;
  cursor: pointer !important;
  outline: none !important;
  box-shadow: none !important;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

nav .site-logo-wrap a.site-logo-link img.site-logo,
.sidebar-logo-container a.site-logo-link img.site-logo,
body.page-worker nav a.site-logo-link img.site-logo,
a.site-logo-link img.site-logo {
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  user-drag: none;
}

nav .site-logo-wrap a.site-logo-link:focus,
nav .site-logo-wrap a.site-logo-link:active,
nav .site-logo-wrap a.site-logo-link:focus-visible,
.sidebar-logo-container a.site-logo-link:focus,
.sidebar-logo-container a.site-logo-link:active,
.sidebar-logo-container a.site-logo-link:focus-visible,
body.page-worker nav a.site-logo-link:focus,
body.page-worker nav a.site-logo-link:active,
body.page-worker nav a.site-logo-link:focus-visible,
a.site-logo-link:focus,
a.site-logo-link:active,
a.site-logo-link:focus-visible {
  outline: none !important;
  box-shadow: none !important;
  cursor: pointer !important;
}

.worker-topbar__logo {
  display: flex;
  align-items: center;
  max-width: min(280px, 48vw);
  line-height: 0;
}

.worker-topbar__logo img.site-logo {
  display: block;
  height: 46px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  object-position: left center;
}

.worker-topbar__logo::before {
  display: none !important;
  content: none !important;
}

.worker-main {
  flex: 1;
  min-width: 0;
  width: 100%;
  display: flex;
  justify-content: flex-start;
  align-items: stretch;
  padding-top: 20px;
}

body.page-worker .worker-container {
  width: 100%;
  max-width: none;
  flex: 1;
  min-width: 0;
  margin: 0 auto;
  padding: 0 clamp(16px, 3vw, 40px) 40px;
  box-sizing: border-box;
}

.worker-logo-shine,
.worker-topbar__logo {
  max-width: 100%;
}

.worker-profile {
  margin-bottom: 20px;
}

.worker-profile--compact {
  margin-bottom: 16px;
}

.worker-profile__name {
  margin: 8px 0 0;
  font-size: clamp(1.15rem, 3.5vw, 1.45rem);
  line-height: 1.25;
}

body.page-worker .logo-shine img {
  filter: none;
}

body.page-worker .logo-shine::before {
  background: linear-gradient(
    105deg,
    transparent 0%,
    transparent 34%,
    rgba(30, 107, 75, 0.08) 42%,
    rgba(30, 107, 75, 0.22) 48%,
    rgba(30, 107, 75, 0.35) 50%,
    rgba(30, 107, 75, 0.22) 52%,
    rgba(30, 107, 75, 0.08) 58%,
    transparent 66%,
    transparent 100%
  );
}

body.page-worker h1,
body.page-worker h2,
body.page-worker h3 {
  color: var(--text);
}

body.page-worker .subtitle {
  color: var(--muted);
}

body.page-worker .badge {
  background: var(--ink-green-soft);
  color: var(--ink-green);
  border: 1px solid var(--ink-green-border);
}

body.page-worker .card {
  background: var(--surface);
  border: var(--glass-border);
  box-shadow: var(--shadow);
  color: var(--text);
}

body.page-worker .btn-primary {
  background: var(--accent);
  color: #ffffff !important;
  box-shadow: 0 2px 4px rgba(160, 195, 196, 0.15) !important;
}

body.page-worker .btn-primary:hover {
  background: var(--accent-2);
}

body.page-worker .btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border: var(--glass-border);
}

body.page-worker .btn-secondary:hover {
  background: var(--bg);
}

body.page-worker #tests-refresh {
  width: auto;
  max-width: 100%;
  min-height: 36px;
  margin-top: 10px;
  padding: 6px 14px;
  font-size: 0.875rem;
  line-height: 1.25;
  border-radius: 10px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.12s ease, background 0.12s ease, background-color 0.12s ease !important;
}

body.page-worker #tests-refresh:active:not(:disabled) {
  transform: scale(0.96);
}

body.page-worker #tests-refresh.is-pressed,
body.page-worker #tests-refresh:active:not(:disabled) {
  background: #a9cbb8 !important;
  background-color: #a9cbb8 !important;
  color: #17563c !important;
}

body.page-worker #tests-refresh.is-pressed {
  animation: tests-refresh-press 0.28s ease;
}

body.page-worker #tests-refresh.is-busy {
  background: #c5ddd0 !important;
  background-color: #c5ddd0 !important;
  color: #17563c !important;
  opacity: 1;
}

body.page-worker #tests-refresh.is-busy::before {
  content: "";
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: tests-refresh-spin 0.6s linear infinite;
}

html.dark body.page-worker #tests-refresh.is-pressed,
html.dark body.page-worker #tests-refresh:active:not(:disabled) {
  background: #5a5e60 !important;
  background-color: #5a5e60 !important;
  color: #f8fafc !important;
}

html.dark body.page-worker #tests-refresh.is-busy {
  background: #3e4244 !important;
  background-color: #3e4244 !important;
  color: #f8fafc !important;
}

@keyframes tests-refresh-press {
  0% { transform: scale(0.96); }
  65% { transform: scale(0.96); }
  100% { transform: scale(1); }
}

@keyframes tests-refresh-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  body.page-worker #tests-refresh.is-pressed,
  body.page-worker #tests-refresh.is-busy::before {
    animation: none;
  }
}

body.page-worker .alert-error {
  background: rgba(239, 68, 68, 0.15) !important;
  border: 1px solid rgba(239, 68, 68, 0.28) !important;
  color: var(--danger-text);
}

body.page-worker .finish-review,
body.page-worker .answer-problem {
  margin: 0 0 16px;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.28);
  color: var(--danger-text);
  font-size: 1rem;
  line-height: 1.5;
}

body.page-worker .finish-review p,
body.page-worker .answer-problem p {
  margin: 0 0 8px;
}

body.page-worker .finish-review .btn,
body.page-worker .answer-problem .btn {
  width: auto;
  max-width: 100%;
  min-height: 44px;
  margin: 8px 8px 0 0;
  padding: 8px 14px;
  font-size: 0.875rem;
}

body.page-worker .finish-review .btn.finish-review__submit {
  width: 100%;
  margin-right: 0;
}

body.page-worker .alert-success {
  background: rgba(74, 222, 128, 0.15) !important;
  border: 1px solid rgba(74, 222, 128, 0.28) !important;
  color: var(--success-text);
}

body.page-worker .test-card-wrap {
  display: flex;
  align-items: stretch;
  width: 100%;
  min-width: 0;
  max-width: none;
}

body.page-worker .test-card-wrap .test-card {
  width: 100%;
  max-width: none;
  flex: 1 1 auto;
}

body.page-worker .test-card {
  background: var(--surface);
  border: var(--glass-border);
  color: var(--text);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

body.page-worker .test-card:hover,
body.page-worker .test-card-locked:hover,
body.page-worker .tests-grid .test-card:hover,
body.page-worker .tests-grid .test-card:focus-visible {
  transform: none !important;
}

body.page-worker .test-card-wrap:hover > .test-card {
  transform: translateY(-6px) !important;
  box-shadow:
    0 10px 18px rgba(15, 23, 42, 0.08),
    0 18px 36px rgba(15, 23, 42, 0.12) !important;
}

body.page-worker .test-card-locked {
  background: var(--surface-2);
  border: var(--glass-border);
  opacity: 0.65 !important;
}

body.page-worker .test-card-locked.has-review {
  opacity: 1 !important;
}

body.page-worker .test-card-results-btn {
  color: #0f172a;
}

html.dark body.page-worker .test-card-results-btn {
  color: #e2e8f0;
}

html.dark body.page-worker .test-card-start-btn {
  color: #dcfce7;
  border-color: rgba(74, 222, 128, 0.45);
  background: rgba(34, 197, 94, 0.18);
}

html.dark .test-card-done--fail .test-card-locked-reason,
html.dark .test-card-done--fail-muted .test-card-locked-reason {
  color: #fca5a5;
}

body.page-worker .test-card-title {
  color: var(--text);
}

body.page-worker .test-card-desc,
body.page-worker .test-card-meta {
  color: var(--muted);
}

body.page-worker .test-card-meta strong {
  color: var(--text);
}

body.page-worker .test-card-status-pass,
body.page-worker .test-card-status-pass-muted {
  background: #4ade80;
  color: #14532d;
  border: 1px solid #16a34a;
  font-weight: 700;
  box-shadow: 0 1px 5px rgba(34, 197, 94, 0.35);
}

body.page-worker .test-card-status-fail,
body.page-worker .test-card-status-fail-muted {
  background: #f87171;
  color: #7f1d1d;
  border: 1px solid #dc2626;
  font-weight: 700;
  box-shadow: 0 1px 5px rgba(239, 68, 68, 0.35);
}

body.page-worker .test-card-status-new {
  background: var(--ink-green-soft);
  color: var(--ink-green);
}

body.page-worker .test-card-priority--required {
  background: #fef3c7;
  border: 1px solid rgba(180, 83, 9, 0.35);
  color: var(--warning-text);
}

body.page-worker .test-card-priority--additional {
  background: var(--ink-green-soft);
  border: 1px solid var(--ink-green-border);
  color: var(--ink-green);
}

body.page-worker .test-card-score-badge {
  background: var(--ink-green-soft);
  color: var(--ink-green);
}

body.page-worker .test-card-retake-notice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.28);
  color: #334155;
  font-size: 0.88rem;
  line-height: 1.45;
  font-weight: 600;
}

body.page-worker .test-card-retake-notice__icon {
  flex-shrink: 0;
  line-height: 1.3;
  color: #dc2626;
}

body.page-worker .test-card-retake-notice__text {
  flex: 1;
  min-width: 0;
}

body.page-worker .test-card-retake-notice strong {
  color: #0f172a;
  font-weight: 700;
}

html.dark body.page-worker .test-card-retake-notice {
  color: #cbd5e1;
  background: rgba(251, 191, 36, 0.08);
  border-color: rgba(251, 191, 36, 0.22);
}

html.dark body.page-worker .test-card-retake-notice__icon {
  color: #f87171;
}

html.dark body.page-worker .test-card-retake-notice strong {
  color: #f8fafc;
}

body.page-worker .test-card-time-limit {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--ink-green-soft);
  border: 1px solid rgba(30, 107, 75, 0.2);
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--ink-green);
  font-weight: 600;
}

body.page-worker .test-card-time-limit__icon {
  flex-shrink: 0;
  line-height: 1.3;
}

body.page-worker .test-card-time-limit--live {
  border-color: color-mix(in srgb, var(--ink-primary, #4a90d9) 55%, transparent);
}

body.page-worker .test-card-time-limit--live .test-card-time-limit__value {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  letter-spacing: 0.02em;
}

body.page-worker .test-card-time-limit--warn {
  border-color: #d4a017;
}

body.page-worker .test-card-time-limit--urgent {
  border-color: #e05252;
}

body.page-worker .test-card-time-limit--urgent .test-card-time-limit__value {
  color: #ffb4b4;
}

body.page-worker .test-card-status-progress {
  color: #7ec8ff;
  border-color: color-mix(in srgb, #7ec8ff 45%, transparent);
}

body.page-worker .test-card-active {
  border-color: color-mix(in srgb, var(--ink-primary, #4a90d9) 65%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--ink-primary, #4a90d9) 25%, transparent);
}

body.page-worker .test-card-pass-progress {
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(148, 163, 184, 0.14);
  border: 1px solid rgba(148, 163, 184, 0.32);
}

body.page-worker .test-card-pass-progress__labels {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 12px;
  margin-bottom: 8px;
  font-size: 0.84rem;
  color: var(--muted, #64748b);
}

body.page-worker .test-card-pass-progress__labels strong {
  color: var(--text, #0f172a);
  font-weight: 700;
}

body.page-worker .test-card-pass-progress__track {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.35);
  overflow: visible;
}

body.page-worker .test-card-pass-progress__fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #2e8b62, #22c55e);
  transition: width 0.35s ease;
}

body.page-worker .test-card-pass-progress__mark {
  position: absolute;
  top: -3px;
  bottom: -3px;
  width: 2px;
  margin-left: -1px;
  background: #f59e0b;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.18);
  pointer-events: none;
}

html.dark body.page-worker .test-card-pass-progress {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
}

html.dark body.page-worker .test-card-pass-progress__labels {
  color: var(--muted, #94a3b8);
}

html.dark body.page-worker .test-card-pass-progress__labels strong {
  color: var(--text, #f1f5f9);
}

html.dark body.page-worker .test-card-pass-progress__track {
  background: rgba(255, 255, 255, 0.08);
}

html.dark body.page-worker .test-card-pass-progress__mark {
  background: #fbbf24;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
}

body.page-worker .question-timer--inline {
  border-color: rgba(30, 107, 75, 0.35);
  background: var(--ink-green-soft);
}

body.page-worker .question-timer--inline .question-timer__value {
  color: var(--ink-green);
}

body.page-worker .option {
  background: #ffffff;
  border: 1px solid rgba(30, 107, 75, 0.18);
  color: var(--text);
}

body.page-worker .option:hover {
  border-color: rgba(30, 107, 75, 0.35);
  background: var(--ink-green-soft);
}

body.page-worker .option.selected {
  border-color: var(--ink-green);
  background: #e9f3ed;
  box-shadow: 0 0 0 1px var(--ink-green);
  font-weight: 600;
}

body.page-worker .option--multi.selected {
  border-color: rgba(30, 107, 75, 0.55);
  background: var(--ink-green-soft);
  box-shadow: 0 0 0 1px rgba(30, 107, 75, 0.15);
}

body.page-worker .option--multi.selected .option-multi__mark {
  border-color: var(--ink-green);
  background: linear-gradient(145deg, #4cb782, var(--ink-green));
  color: #ffffff;
  box-shadow: 0 0 0 2px rgba(30, 107, 75, 0.15);
}

body.page-worker .option-multi__mark {
  border-color: rgba(30, 107, 75, 0.35);
}

body.page-worker .question-hint {
  border-left-color: var(--ink-green);
  background: var(--ink-green-soft);
  color: #292C33;
}

body.page-worker .question-hint strong {
  color: var(--ink-green);
}

body.page-worker .progress {
  background: var(--surface-2);
}

body.page-worker .progress-bar {
  background: linear-gradient(90deg, var(--ink-green), #4cb782);
}

body.page-worker .question-timer {
  background: var(--ink-green-soft);
  border-color: rgba(30, 107, 75, 0.22);
  color: var(--text);
}

body.page-worker .question-timer--warn {
  border-color: rgba(180, 83, 9, 0.45);
  background: #fffbeb;
}

body.page-worker .question-timer--warn .question-timer__value {
  color: #b45309;
}

body.page-worker .question-timer--urgent {
  border-color: rgba(185, 28, 28, 0.45);
  background: #fef2f2;
}

body.page-worker .question-timer--urgent .question-timer__value {
  color: #b91c1c;
}

body.page-worker .result-hero--pass {
  background: linear-gradient(160deg, #dcfce7, #f0fdf4);
  border: 1px solid rgba(21, 128, 61, 0.35);
}

body.page-worker .result-hero--fail {
  background: linear-gradient(160deg, #fee2e2, #fef2f2);
  border: 1px solid rgba(185, 28, 28, 0.35);
}

body.page-worker .result-hero--void {
  background: var(--surface-2, #f1f5f9);
  border: 1px solid var(--border, rgba(148, 163, 184, 0.45));
  color: var(--text);
}

body.page-worker .result-next {
  background: var(--ink-green-soft);
  border: 1px solid var(--ink-green-border);
}

body.page-worker #question-text {
  color: var(--text);
}

/* Нижняя панель работника (те же кнопки — .worker-footer-btn) */
.worker-footer {
  width: 100%;
  margin-top: auto;
  border-top: none;
  background: transparent;
  box-shadow: none;
}

.worker-footer__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  padding: 14px clamp(16px, 3vw, 40px);
  max-width: 960px;
  margin: 0 auto;
}

a.worker-footer-btn {
  text-decoration: none;
}

.worker-footer-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 9999px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: #f8fafc;
  color: #334155;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.12s ease;
  box-shadow: none;
}

.worker-footer-btn:hover {
  background: #f1f5f9;
  border-color: rgba(0, 0, 0, 0.18);
  box-shadow: none;
}

.worker-footer-btn:active {
  transform: scale(0.98);
}

body.page-worker .worker-feedback-overlay {
  background: rgba(15, 31, 24, 0.45);
}

body.page-worker .worker-feedback-dialog {
  background: #ffffff;
  border: 1px solid rgba(30, 107, 75, 0.2);
  box-shadow: 0 20px 48px rgba(30, 107, 75, 0.18);
}

body.page-worker .worker-feedback-dialog .spvt-confirm-title {
  color: var(--text);
}

body.page-worker .worker-feedback-dialog .spvt-confirm-message {
  color: var(--muted);
}

.worker-feedback-hint {
  margin: 0 0 20px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--ink-green-soft);
  border: 1px solid var(--ink-green-border);
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--ink-green);
}

body.page-worker .worker-feedback-dialog .spvt-confirm-actions {
  justify-content: center;
}

body.page-worker .worker-feedback-dialog .spvt-confirm-actions .btn {
  min-width: 140px;
}

.worker-error-report-dialog .spvt-confirm-message {
  margin-bottom: 14px;
}

.worker-error-report-form .form-field {
  margin-bottom: 14px;
}

.worker-error-report-form label {
  display: block;
  margin-bottom: 4px;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: normal;
  text-transform: none;
  color: var(--text);
}

.worker-error-report-form .form-field-hint {
  display: block;
  margin: 0 0 8px;
  font-size: 0.8125rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
  color: var(--muted);
  line-height: 1.45;
}

.worker-error-report-intro {
  line-height: 1.5;
}

.worker-error-report-form select,
.worker-error-report-form input,
.worker-error-report-form textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--input-border, #cbd5e1);
  background: var(--input-bg, #fff);
  color: var(--text);
  font: inherit;
}

.worker-error-report-form textarea {
  resize: vertical;
  min-height: 96px;
}

.worker-error-report-actions {
  justify-content: flex-end;
  gap: 10px;
}

.worker-error-report-status {
  margin: 0 0 10px;
  font-size: 0.875rem;
}

.worker-error-report-status--ok {
  color: var(--success-text, #059669);
}

.worker-error-report-status--error {
  color: var(--danger-text, #dc2626);
}

.worker-error-screenshots-note {
  font-weight: 400;
  color: var(--muted);
}

.worker-error-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 132px;
  padding: 16px 14px;
  border: 2px dashed var(--input-border, #cbd5e1);
  border-radius: 12px;
  background: var(--input-bg, #fff);
  color: var(--text);
  cursor: pointer;
  text-align: center;
  font: inherit;
  touch-action: manipulation;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.worker-error-dropzone:hover,
.worker-error-dropzone:focus-visible {
  border-color: var(--accent);
  background: rgba(30, 107, 75, 0.06);
}

.worker-error-dropzone:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(30, 107, 75, 0.28);
}

.worker-error-dropzone.is-dragover {
  border-color: var(--accent);
  border-style: solid;
  background: rgba(30, 107, 75, 0.12);
}

.worker-error-dropzone-icon {
  width: 32px;
  height: 32px;
  color: var(--accent);
  flex-shrink: 0;
}

.worker-error-dropzone-title {
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.35;
}

.worker-error-dropzone-ways {
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.45;
}

.worker-error-dropzone-ways kbd {
  display: inline-block;
  padding: 1px 6px;
  border: 1px solid var(--input-border, #cbd5e1);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: var(--surface-2, #f7f6f5);
  color: var(--text);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
}

html.dark .worker-error-dropzone {
  background: rgba(15, 23, 42, 0.35);
}

html.dark .worker-error-dropzone:hover,
html.dark .worker-error-dropzone:focus-visible,
html.dark .worker-error-dropzone.is-dragover {
  background: rgba(76, 183, 130, 0.12);
}

@media (prefers-reduced-motion: reduce) {
  .worker-error-dropzone {
    transition: none;
  }}

.worker-error-screenshots-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.worker-error-screenshot-item {
  position: relative;
  width: 88px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(148, 163, 184, 0.08);
}

.worker-error-screenshot-thumb {
  display: block;
  width: 88px;
  height: 66px;
  object-fit: cover;
}

.worker-error-screenshot-name {
  display: block;
  padding: 4px 6px;
  font-size: 0.68rem;
  line-height: 1.2;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.worker-error-screenshot-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.actions-screenshot-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.actions-screenshot-link {
  display: block;
  padding: 0;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 8px;
  overflow: hidden;
  background: none;
  color: inherit;
  font: inherit;
  cursor: zoom-in;
  touch-action: manipulation;
}

.actions-screenshot-link:hover .actions-screenshot-thumb,
.actions-screenshot-link:focus-visible .actions-screenshot-thumb {
  transform: scale(1.06);
}

.actions-screenshot-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.actions-screenshot-thumb {
  display: block;
  width: 72px;
  height: 54px;
  object-fit: cover;
  transition: transform 0.2s ease;
}

.actions-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(8, 12, 20, 0);
  backdrop-filter: blur(0);
  cursor: zoom-out;
  opacity: 0;
  perspective: 1400px;
  transition: background 0.32s ease, opacity 0.32s ease, backdrop-filter 0.32s ease;
}

.actions-lightbox.is-open {
  background: rgba(8, 12, 20, 0.82);
  opacity: 1;
  backdrop-filter: blur(10px);
}

.actions-lightbox-img {
  position: relative;
  z-index: 1;
  max-width: min(92vw, 1400px);
  max-height: 88vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.5);
  cursor: default;
  transform-origin: center center;
  will-change: transform;
}

.actions-lightbox-close {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  z-index: 2;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
}

.actions-lightbox-close:hover,
.actions-lightbox-close:focus-visible {
  background: rgba(15, 23, 42, 0.92);
}

.actions-lightbox-close:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.actions-lightbox-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 44px;
  height: 44px;
  margin-top: -22px;
  border: none;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  cursor: pointer;
  touch-action: manipulation;
  display: flex;
  align-items: center;
  justify-content: center;
}

.actions-lightbox-nav[hidden] {
  display: none;
}

.actions-lightbox-nav:hover,
.actions-lightbox-nav:focus-visible {
  background: rgba(15, 23, 42, 0.92);
}

.actions-lightbox-nav:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.actions-lightbox-prev {
  left: max(12px, env(safe-area-inset-left));
}

.actions-lightbox-next {
  right: max(12px, env(safe-area-inset-right));
}

.actions-lightbox-nav svg {
  width: 22px;
  height: 22px;
}

body.actions-lightbox-open {
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .actions-lightbox,
  .actions-lightbox-img,
  .actions-screenshot-thumb {
    transition: none !important;
  }}

body.page-worker .tests-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  align-items: stretch;
  gap: 18px;
  width: 100%;
  overflow: visible;
}

@media (max-width: 900px) {
  .worker-main {
    justify-content: stretch;
  }

  .worker-main {
    padding-top: 6px;
  }

  body.page-worker .worker-container {
    width: 100%;
    max-width: none;
    margin: 0 auto;
    margin-left: 0;
    padding: 8px clamp(16px, 3vw, 24px) 36px;
  }}

@media (max-width: 560px) {

  .worker-topbar__logo {
    max-width: min(200px, 46vw);
  }

  .worker-topbar__logo img.site-logo {
    height: 38px;
  }

  body.page-worker nav img.site-logo {
    height: 38px;
    max-width: min(240px, 48vw);
  }

  body.page-manager nav img.site-logo,
  body.page-manager .sidebar-logo-container img.site-logo {
    height: 38px;
    max-width: min(240px, 48vw);
  }

  .worker-footer__inner {
    padding: 12px;
  }

  .worker-footer-btn {
    flex: 1 1 140px;
    max-width: 280px;
  }

  body.page-worker .worker-container {
    padding: 8px 12px 32px;
  }

  body.page-worker .tests-grid .test-card-wrap {
    width: 100%;
    max-width: none;
  }

  body.page-worker .tests-grid .test-card {
    padding: 16px 14px 14px;
  }

  .card, .login-card {
    padding: 20px 16px;
  }
  .login-card {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }}

.theme-dark {
  --ink-card-bg: rgba(30, 41, 59, 0.7);
  --ink-card-border: rgba(255, 255, 255, 0.1);
  --ink-text-main: #f8fafc;
  --ink-text-muted: var(--muted);
  --ink-input-bg: rgba(15, 23, 42, 0.6);
  --ink-input-border: rgba(255, 255, 255, 0.2);
  --ink-btn-bg: #00f2fe;
  --ink-btn-text: #0b0f19;
  --ink-link: #4facfe;
}

/* --- INK LOGIN CARD --- */
.ink-center-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

.ink-login-card {
  width: 100%;
  max-width: 440px;
  background: var(--ink-card-bg) !important;
  border: 1px solid var(--ink-card-border) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  border-radius: 20px !important;
  padding: 40px !important;
  color: var(--ink-text-main) !important;
  box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.3), inset 0 0 40px rgba(255,255,255,0.2) !important;
  margin: 0 auto;
}

.login-setup-hint {
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink-text-muted);
}

.ink-card-header {
  text-align: center;
  margin-bottom: 32px;
}

.ink-card-header h1 {
  font-family: 'Outfit', 'Inter', sans-serif;
  font-size: 24px;
  font-weight: 600;
  margin: 0 0 4px;
  color: var(--ink-text-main);
  letter-spacing: 0.02em;
}

.ink-login-form .form-field label {
  color: var(--ink-text-main) !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  margin-bottom: 8px !important;
  text-transform: none;
  user-select: none !important;
  -webkit-user-select: none !important;
}

.ink-login-form input[type="text"],
.ink-login-form input[type="password"] {
  background: #faf8f6 !important;
  border: 2px solid #cbd5e1 !important;
  color: #1e293b !important;
  border-radius: 12px !important;
  padding: 11px 15px !important;
  font-size: 16px !important;
  transition: all 0.2s ease !important;
}

.login-no-account {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  text-align: center;
}

.login-no-account__title {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-text-main);
}

.login-no-account__text {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink-text-muted);
}

.ink-login-form input[type="text"]:focus,
.ink-login-form input[type="password"]:focus,
.ink-login-form input[type="text"]:active,
.ink-login-form input[type="password"]:active {
  border-color: #4cb782 !important;
  box-shadow: 0 0 0 3px rgba(76, 183, 130, 0.25) !important;
  outline: none !important;
  background: #faf8f6 !important;
}

.ink-form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 16px 0 24px;
  font-size: 13px;
}

.ink-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--ink-text-muted);
  font-weight: 500;
  margin: 0 !important;
}

.ink-checkbox-label input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: #ffffff !important;
  cursor: pointer;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  outline: none !important;
}

.ink-checkbox-label input[type="checkbox"]:checked {
  background: #ffffff !important;
  border-color: #1e293b !important;
}

.ink-checkbox-label input[type="checkbox"]:checked::after {
  content: "";
  width: 9px;
  height: 5px;
  border-left: 2px solid #000000 !important;
  border-bottom: 2px solid #000000 !important;
  transform: rotate(-45deg) translate(0px, -1px);
}

.ink-btn-auth {
  width: 100%;
  background: var(--accent);
  color: #ffffff !important;
  border: none !important;
  border-radius: 12px !important;
  padding: 14px !important;
  font-weight: 600 !important;
  font-size: 14px !important;
  transition: all 0.2s ease !important;
  letter-spacing: 0;
  margin-bottom: 12px;
}

.ink-btn-auth:hover {
  background: var(--accent-2);
  opacity: 1 !important;
  box-shadow: 0 4px 12px rgba(30, 107, 75, 0.2) !important;
}

.ink-card-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.3) !important;
}

.ink-card-footer a {
  font-size: 11px !important;
  font-weight: 600 !important;
  color: #64748b !important;
  text-decoration: none;
  letter-spacing: 0.05em;
  transition: color 0.2s ease !important;
}

.ink-card-footer a:hover {
  color: #1e293b !important;
}

.login-help-footer {
  justify-content: center;
}

.login-help {
  margin: 0;
  max-width: 28rem;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: 0;
  color: var(--ink-text-muted);
}

/* ==========================================================================
   ФИКСЫ ВЫРАВНИВАНИЯ И ТЕМ В ПАНЕЛИ АДМИНА/РУКОВОДИТЕЛЯ
   ========================================================================== */

/* 1. Убираем нижний отступ у полей ввода и селектов в фильтрах/тулбарах */
.personnel-toolbar input,
.personnel-toolbar select,
.workers-filters-grid input,
.workers-filters-grid select,
.results-grid-filters input,
.results-grid-filters select {
  margin-bottom: 0 !important;
}

.personnel-toolbar .workers-date-wrap,
.workers-filters-grid .workers-date-wrap,
.results-grid-filters .workers-date-wrap {
  margin-bottom: 0 !important;
}

/* 2. Приводим все кнопки в тулбарах и фильтрах к единой высоте (52px) */
.personnel-toolbar .btn,
.workers-filters-grid .btn,
.results-grid-filters .btn,
.results-grid-filters button,
.personnel-toolbar button,
.workers-filters-grid button {
  height: 52px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  margin-bottom: 0 !important;
}

/* Layout Selector & Layout Styles */
#layout-container {
  display: flex;
  flex: 1;
  width: 100%;
}

/* Layout: Left Sidebar (Locked) */


#layout-container aside {
  width: var(--sidebar-width-expanded) !important;
  min-width: var(--sidebar-width-expanded);
  height: calc(100vh - 64px) !important;
  position: sticky !important;
  top: 64px !important;
  border-right: var(--glass-border);
  background-color: var(--surface-2);
  padding: 16px !important;
  display: flex;
  flex-direction: column;
  contain: layout style;
}

#layout-container main {
  flex: 1;
  min-width: 0;
}

/* Sidebar Navigation Links */
.sidebar-link {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  padding: 10px 14px !important;
  border-radius: 8px !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  color: var(--muted);
  border: 1px solid transparent !important;
  background-color: transparent !important;
  transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease !important;
}

.sidebar-link:hover {
  color: var(--text);
}

.sidebar-link.active {
  background-color: rgba(160, 195, 196, 0.15) !important;
  color: var(--text);
  border-color: transparent !important;
  font-weight: 600 !important;
}

/* Light theme Glassmorphic panels & Bento inside layout container */
#layout-container .bg-white,
#layout-container .bg-slate-50,
#layout-container .bg-slate-100\/50,
#layout-container .card,
#layout-container aside {
  background: var(--surface-2);
  border: var(--glass-border);
  color: var(--text);
  box-shadow: var(--shadow);
  border-radius: var(--radius) !important;
}

#layout-container .bg-white:hover,
#layout-container .bg-slate-50:hover {
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.06) !important;
}

/* Sub-panels and stats metric boxes in Light theme */
#layout-container #stats-grid a {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  aspect-ratio: 1 / 1 !important;
  text-align: center !important;
  padding: 16px !important;
  background: var(--surface-2);
  border: var(--glass-border);
  color: var(--text);
  border-radius: var(--radius) !important;
  transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.15s ease !important;
}

#layout-container #stats-grid a:hover {
  background-color: var(--surface);
  transform: translateY(-4px) scale(1.015) !important;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.12) !important;
}

#layout-container .test-card-metric,
#layout-container .bg-slate-50.border-slate-200 {
  background: var(--surface-2);
  border: var(--glass-border);
  color: var(--text);
  border-radius: 12px !important;
}

/* Global Tailwind Utility Color Sync (DesignArena Light / Gemini Dark) */
.bg-white, 
body.page-manager .bg-white, 
body.page-worker .bg-white,
nav.bg-white\/80 {
  background-color: var(--surface);
}
.bg-slate-50, 
.bg-slate-100, 
.bg-slate-100\/50,
body.page-manager .bg-slate-50,
body.page-worker .bg-slate-50,
body.bg-slate-100 {
  background-color: var(--bg);
}
.text-slate-800, 
.text-slate-900, 
.text-on-surface,
.text-on-background {
  color: var(--text);
}
.text-slate-500, 
.text-slate-600, 
.text-on-surface-variant {
  color: var(--muted);
}
.border-slate-200,
.border-slate-300,
.border-outline-variant,
.border-outline-variant\/30 {
  border-color: var(--glass-border);
}

/* Custom global accent classes */
.text-accent,
.hover\:text-accent:hover {
  color: var(--accent);
}
.bg-accent,
.hover\:bg-accent:hover {
  background-color: var(--accent);
}


/* Tailwind replacement classes */
.surface-card { background-color: var(--surface-2); border: var(--glass-border); }

/* Force visible borders for inputs and dropdowns inside filter panels */
.results-grid-filters input,
.results-grid-filters select,
.workers-filters-grid input,
.workers-filters-grid select {
  border: 1.5px solid var(--border) !important;
  background-color: var(--input-bg) !important;
}

/* JS replaced classes */
.result-score--pass { color: var(--success-text); }
.result-score--fail { color: var(--danger-text); }

/* Theme Toggle (Slider) & Logout custom styling */
.theme-slider-container {
  --theme-thumb-size: 24px;
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr;
  align-items: center;
  justify-items: center;
  box-sizing: border-box;
  background-color: rgba(226, 232, 240, 0.8) !important;
  padding: 4px !important;
  border-radius: 999px !important;
  width: 64px !important;
  height: 34px !important;
  cursor: pointer;
  user-select: none;
  border: var(--glass-border) !important;
  box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06) !important;
  transition: background-color 0.3s !important;
}

html.dark .theme-slider-container {
  background-color: rgba(0, 0, 0, 0.25) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

.theme-slider-thumb,
.theme-sun-icon {
  grid-column: 1;
  grid-row: 1;
}

.theme-moon-icon {
  grid-column: 2;
  grid-row: 1;
}

html.dark .theme-slider-thumb {
  grid-column: 2;
}

.theme-slider-thumb {
  width: var(--theme-thumb-size) !important;
  height: var(--theme-thumb-size) !important;
  border-radius: 999px !important;
  background-color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.15) !important;
  transition: grid-column 0.3s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s !important;
  z-index: 0;
  pointer-events: none;
}

html.dark .theme-slider-thumb {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4) !important;
}

.theme-sun-icon,
.theme-moon-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--theme-thumb-size);
  height: var(--theme-thumb-size);
  z-index: 1;
  pointer-events: none;
  line-height: 0;
}

.theme-sun-icon svg,
.theme-moon-icon svg {
  display: block;
  width: 16px;
  height: 16px;
}

.theme-sun-icon {
  color: var(--text) !important;
  transition: color 0.3s ease !important;
}

.theme-moon-icon {
  color: var(--text-secondary) !important;
  transition: color 0.3s ease !important;
}

html.dark .theme-sun-icon {
  color: var(--text-secondary) !important;
}

html.dark .theme-moon-icon {
  color: #2d2f31 !important;
}

.btn-logout {
  background: transparent !important;
  color: var(--text-secondary) !important;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08) !important;
  border-radius: 999px !important;
  border: none !important;
}
.btn-logout:hover {
  background: rgba(0, 0, 0, 0.05) !important;
  color: var(--text) !important;
}
html.dark .btn-logout {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}
html.dark .btn-logout:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  color: var(--text) !important;
}

/* Focus & Selection custom styles */
::selection { background-color: rgba(76, 183, 130, 0.25) !important; }
a:focus:not(.site-logo-link), button:focus, input:focus, select:focus, textarea:focus { outline: none !important; box-shadow: 0 0 0 3px rgba(76, 183, 130, 0.25) !important; }
a.sidebar-link:focus,
a.sidebar-link:focus-visible,
#mobile-menu-btn:focus,
#mobile-menu-btn:focus-visible,
.test-folder-menu__list a:focus,
.test-folder-menu__list a:focus-visible,
.test-folder-menu__list button:focus,
.test-folder-menu__list button:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}

/* 100vh Sidebar Layout adjustments */
:root {
  --sidebar-width-expanded: 288px;
  --sidebar-width-collapsed: 76px;
  --sidebar-layout-gap: 16px;
  --sidebar-motion-duration: 0.3s;
  --sidebar-motion-ease: cubic-bezier(0.4, 0, 0.2, 1);
}

#layout-container aside,
#layout-container aside.bg-white,
#layout-container aside.bg-slate-50 {
  width: var(--sidebar-width-expanded) !important;
  min-width: var(--sidebar-width-expanded);
  height: 100vh !important;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  border-right: var(--glass-border) !important;
  border-radius: 0 !important;
  background-color: var(--surface);
  padding: 24px 16px !important;
  display: flex;
  flex-direction: column;
  z-index: 100 !important;
  overflow: hidden;
  transition:
    width var(--sidebar-motion-duration) var(--sidebar-motion-ease),
    min-width var(--sidebar-motion-duration) var(--sidebar-motion-ease),
    padding var(--sidebar-motion-duration) var(--sidebar-motion-ease) !important;
}

/* Floating Navigation Bar (Capsule Style) */
body > nav {
  margin: 16px auto !important;
  border-radius: 999px !important;
  border: var(--glass-border) !important;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.08) !important;
  max-width: calc(100% - 32px) !important;
  width: calc(100% - 32px) !important;
  position: sticky !important;
  top: 16px !important;
  z-index: 50;
  background: var(--surface-2) !important;
}

/* Adjust topbar in manager panel with sidebar */
body > nav.docked.full-width {
  width: calc(100% - var(--sidebar-width-expanded) - (var(--sidebar-layout-gap) * 2)) !important;
  margin-left: calc(var(--sidebar-width-expanded) + var(--sidebar-layout-gap)) !important;
  margin-right: var(--sidebar-layout-gap) !important;
  padding-left: 24px !important;
  transition:
    width var(--sidebar-motion-duration) var(--sidebar-motion-ease),
    margin-left var(--sidebar-motion-duration) var(--sidebar-motion-ease),
    margin-right var(--sidebar-motion-duration) var(--sidebar-motion-ease) !important;
}

html.hide-sidebar body > nav.docked.full-width {
  width: calc(100% - 32px) !important;
  margin-left: 16px !important;
  margin-right: 16px !important;
  padding-left: 24px !important;
}

/* Align navigation bar with page-worker containers */
body.page-worker > body > nav,
body.page-worker > nav {
  max-width: 1440px !important;
  width: calc(100% - 32px) !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* Push content right when sidebar is visible */
#layout-container main {
  margin-left: var(--sidebar-width-expanded);
  transition: margin-left var(--sidebar-motion-duration) var(--sidebar-motion-ease);
}

html.hide-sidebar #layout-container main {
  margin-left: 0;
}

/* Sidebar collapse (desktop): icons only */
.sidebar-top-row {
  display: flex;
  justify-content: flex-end;
  min-height: 40px;
  margin-bottom: 8px;
}

.sidebar-collapse-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  margin-left: auto;
  margin-right: 0;
  border: 1px solid var(--border-light, #e2e8f0);
  border-radius: 10px;
  background: var(--surface-2, #f8fafc);
  color: var(--muted, #64748b);
  cursor: pointer;
  transition:
    margin-right var(--sidebar-motion-duration) var(--sidebar-motion-ease),
    background 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease;
}

.sidebar-collapse-btn:hover {
  color: var(--text, #0f172a);
  border-color: var(--accent, #1e6b4b);
}

.sidebar-collapse-icon {
  position: absolute;
  width: 18px;
  height: 18px;
  transition:
    opacity 0.22s ease,
    transform var(--sidebar-motion-duration) var(--sidebar-motion-ease);
}

.sidebar-collapse-icon--menu {
  opacity: 1;
  transform: translateX(0);
}

.sidebar-collapse-icon--expand {
  opacity: 0;
  transform: translateX(8px);
}

html.sidebar-collapsed .sidebar-collapse-icon--menu {
  opacity: 0;
  transform: translateX(-10px);
}

html.sidebar-collapsed .sidebar-collapse-icon--expand {
  opacity: 1;
  transform: translateX(0);
}

.sidebar-link-label {
  min-width: 0;
  flex: 1;
  max-width: none;
  overflow: visible;
  white-space: normal;
  line-height: 1.25;
  opacity: 1;
  transition:
    max-width var(--sidebar-motion-duration) var(--sidebar-motion-ease),
    opacity 0.15s ease;
}

.sidebar-nav {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.sidebar-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 16px;
}

.sidebar-group-label {
  margin: 0 10px 2px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.2;
}

html.hide-admin-only .sidebar-group--results:not(:has(a.sidebar-link:not(.perm-denied):not(.manager-admin-only))) {
  display: none !important;
}

.sidebar-nav-bottom {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: auto;
  padding-top: 8px;
}

html.sidebar-drawer-open,
html.sidebar-drawer-open body {
  overflow: hidden !important;
  overscroll-behavior: none;
}

.sidebar-profile-text {
  flex: 1;
  min-width: 0;
  overflow: visible;
  white-space: normal;
  line-height: 1.3;
  opacity: 1;
  transition:
    max-width var(--sidebar-motion-duration) var(--sidebar-motion-ease),
    opacity 0.15s ease;
}

.sidebar-profile-text h3 {
  font-size: 0.9375rem;
  line-height: 1.3;
  font-weight: 600;
  hyphens: none;
  overflow-wrap: normal;
  word-break: normal;
}

html.sidebar-collapsed #layout-container aside,
html.sidebar-collapsed #layout-container aside.bg-white,
html.sidebar-collapsed #layout-container aside.bg-slate-50 {
  width: var(--sidebar-width-collapsed) !important;
  min-width: var(--sidebar-width-collapsed);
  padding: 16px 10px !important;
}

html.sidebar-collapsed .sidebar-top-row {
  justify-content: flex-end;
}

html.sidebar-collapsed .sidebar-profile {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}

html.sidebar-collapsed .sidebar-profile-text,
html.sidebar-collapsed .sidebar-group-label,
html.sidebar-collapsed .sidebar-link-label,
html.sidebar-collapsed .sidebar-logo-container {
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
}

html.sidebar-collapsed .sidebar-collapse-btn {
  width: 40px;
  height: 40px;
  margin-right: 8px;
}

html.sidebar-collapsed .sidebar-profile {
  justify-content: center;
  width: 40px;
  height: 40px;
  margin: 8px auto 6px;
  padding: 0;
  border-top: 0;
}

html.sidebar-collapsed .sidebar-profile > div:first-child,
html.sidebar-collapsed .sidebar-profile svg {
  width: 40px !important;
  height: 40px !important;
}

html.sidebar-collapsed .sidebar-profile svg {
  width: 20px !important;
  height: 20px !important;
}

html.sidebar-collapsed .sidebar-nav,
html.sidebar-collapsed .sidebar-group,
html.sidebar-collapsed .sidebar-nav-bottom {
  align-items: center;
  width: 100%;
  gap: 6px;
}

html.sidebar-collapsed .sidebar-group {
  margin-top: 10px;
}

html.sidebar-collapsed .sidebar-nav-bottom {
  margin-top: 6px;
  padding-top: 0;
}

html.sidebar-collapsed .sidebar-link {
  justify-content: center !important;
  align-items: center !important;
  gap: 0 !important;
  box-sizing: border-box;
  width: 40px;
  height: 40px;
  margin: 0 auto;
  padding: 0 !important;
}

html.sidebar-collapsed #layout-container main {
  margin-left: var(--sidebar-width-collapsed);
}

html.sidebar-collapsed body > nav.docked.full-width {
  width: calc(100% - var(--sidebar-width-collapsed) - (var(--sidebar-layout-gap) * 2)) !important;
  margin-left: calc(var(--sidebar-width-collapsed) + var(--sidebar-layout-gap)) !important;
}

html.dark .sidebar-collapse-btn {
  background: rgba(45, 47, 49, 0.75);
  border-color: rgba(255, 255, 255, 0.1);
  color: #94a3b8;
}

html.dark .sidebar-collapse-btn:hover {
  color: #e2e8f0;
  border-color: rgba(76, 183, 130, 0.45);
}

.sidebar-collapse-btn:focus-visible {
  outline: 2px solid var(--accent, #4cb782);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .sidebar-collapse-btn,
  .sidebar-collapse-icon {
    transition: none;
  }
}

#mobile-menu-btn {
  display: none;
}

@media (max-width: 1023px) {
  .sidebar-top-row {
    display: none;
  }

  #mobile-menu-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    border-radius: 10px;
    transition: background-color 0.15s ease, color 0.15s ease;
  }

  #mobile-menu-btn:hover {
    color: #4cb782 !important;
    background-color: rgba(76, 183, 130, 0.18);
  }

  body > nav.docked.full-width,
  html.sidebar-collapsed body > nav.docked.full-width {
    width: calc(100% - 32px) !important;
    margin-left: 16px !important;
    margin-right: 16px !important;
  }}

@media (min-width: 1024px) {
  #mobile-menu-btn {
    display: none !important;
  }}

html.hide-sidebar #mobile-menu-btn {
  display: none !important;
}

/* Logo visibility management */
nav .site-logo-wrap {
  display: block;
}

.sidebar-logo-container {
  display: none !important;
}
.btn-logout:focus { box-shadow: none !important; }

.test-card-head,
.test-card-desc,
.test-card-meta,
.test-card-action,
.test-card-retake-notice,
.test-card-time-limit {
  position: relative;
  z-index: 2;
}

.test-card-done--pass {
  background: linear-gradient(135deg, rgba(74, 222, 128, 0.55) 0%, rgba(240, 253, 244, 0.98) 100%) !important;
  border: 2px solid #16a34a !important;
}

.test-card-done--fail {
  background: linear-gradient(135deg, rgba(248, 113, 113, 0.55) 0%, rgba(254, 242, 242, 0.98) 100%) !important;
  border: 2px solid #dc2626 !important;
}

/* Временное отключение переходов при переключении тем */
.no-transition,
.no-transition * {
  transition: none !important;
  animation: none !important;
}


/* Mobile Sidebar adjustments */
@media (max-width: 1023px) {
  :root {
    --manager-nav-height: 4rem;
    --manager-nav-gap: 12px;
    --manager-nav-offset: calc(var(--manager-nav-gap) + var(--manager-nav-height) + var(--manager-nav-gap));
  }

  html.sidebar-drawer-open,
  html.sidebar-drawer-open body {
    overflow: hidden !important;
    overscroll-behavior: none;
  }

  body.page-manager {
    padding-top: var(--manager-nav-offset);
  }

  body.page-manager > nav.docked.full-width,
  html.sidebar-collapsed body.page-manager > nav.docked.full-width {
    position: fixed !important;
    top: var(--manager-nav-gap) !important;
    left: 12px !important;
    right: 12px !important;
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    z-index: 200 !important;
  }

  body.page-manager > nav .site-logo-wrap {
    min-width: 0;
    flex: 1 1 auto;
  }

  body.page-manager > nav img.site-logo {
    max-width: min(11rem, 42vw);
  }

  body.page-manager > nav #user-name {
    display: none;
  }

  #sidebar-overlay {
    position: fixed !important;
    top: var(--manager-nav-offset) !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    z-index: 160 !important;
  }

  #layout-container aside,
  #layout-container aside.bg-white,
  #layout-container aside.bg-slate-50,
  html.sidebar-collapsed #layout-container aside,
  html.sidebar-collapsed #layout-container aside.bg-white,
  html.sidebar-collapsed #layout-container aside.bg-slate-50 {
    top: var(--manager-nav-offset) !important;
    height: calc(100dvh - var(--manager-nav-offset)) !important;
    width: min(288px, calc(100vw - 24px)) !important;
    min-width: min(288px, calc(100vw - 24px)) !important;
    padding: 16px 14px 20px !important;
    left: -110% !important;
    z-index: 180 !important;
    overflow: hidden;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  }

  #layout-container aside.sidebar-open {
    left: 0 !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
  }

  html.sidebar-collapsed .sidebar-profile-text,
  html.sidebar-collapsed .sidebar-link-label {
    max-width: 220px;
    opacity: 1;
    pointer-events: auto;
  }

  html.sidebar-collapsed .sidebar-link {
    justify-content: flex-start !important;
    align-items: center !important;
    gap: 12px !important;
    width: auto;
    height: auto;
    margin: 0;
    padding: 10px 14px !important;
  }

  html.sidebar-collapsed .sidebar-profile {
    justify-content: flex-start;
    width: auto;
    height: auto;
    margin: 0 0 2rem;
    padding: 0.5rem;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
  }

  html.sidebar-collapsed .sidebar-nav-bottom {
    margin-top: auto;
    padding-top: 8px;
  }

  html.sidebar-collapsed #layout-container main {
    margin-left: 0 !important;
  }

  #layout-container main {
    margin-left: 0 !important;
    padding: 12px !important;
  }

  .access-tabs {
    gap: 6px;
  }

  .access-tab {
    padding: 8px 12px;
    font-size: 0.9rem;
  }

  .roles-members-head .btn {
    width: 100%;
  }}

@media (max-width: 1200px) {
  .access-roles-card {
    overflow-x: auto;
  }

  .access-roles-table {
    min-width: 40rem;
  }}

/* Тестируемые: основной текст 16px, вспомогательный 14px, подписи плиток не меньше 12px. */
body.page-worker .test-ready__note,
body.page-worker .question-hint,
body.page-worker .result-extra,
body.page-worker .result-next__text,
body.page-worker .test-card-locked-reason,
body.page-worker .test-card-desc,
body.page-worker .worker-feedback-hint,
body.page-worker .test-card-retake-notice,
body.page-worker .test-card-time-limit {
  font-size: 1rem;
  line-height: 1.5;
}

body.page-worker .test-card-meta,
body.page-worker .test-card-attempts-hint,
body.page-worker .test-card-status,
body.page-worker .test-card-score-badge,
body.page-worker .test-card-pass-progress__labels,
body.page-worker .worker-review-item__mark,
body.page-worker .worker-review-item__note,
body.page-worker .worker-review-item__line span,
body.page-worker .result-facts dt,
body.page-worker .result-next__title,
body.page-worker .result-next__hint,
body.page-worker .result-card__eyebrow,
body.page-worker .test-ready__eyebrow,
body.page-worker .worker-tests-search__count,
body.page-worker .worker-footer-btn,
body.page-worker .worker-error-report-form .form-field-hint,
body.page-worker .worker-error-report-status,
body.page-worker .worker-error-dropzone-ways,
body.page-worker .question-timer--inline .question-timer__label,
body.page-worker .question-timer--card .question-timer__label,
body.page-worker #question-counter {
  font-size: 0.875rem;
}

body.page-worker .test-card-metric-label,
body.page-worker .test-card-metric--unlimited .test-card-metric-label,
body.page-worker .test-card-metric--retake .test-card-metric-label,
body.page-worker .worker-error-screenshot-name {
  font-size: 0.75rem;
}

body.page-worker .question-hint-wrap {
  margin: 0 0 16px;
}

/* Разделы сотрудника в шапке: «Мои тесты» и «Профиль». */
.worker-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.worker-nav__link {
  padding: 6px 12px;
  border-radius: 8px;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  white-space: nowrap;
}

.worker-nav__link:hover {
  color: var(--text);
  background: var(--surface-2);
}

.worker-nav__link[aria-current="page"] {
  color: var(--ink-green);
  background: var(--ink-green-soft);
  box-shadow: inset 0 -2px 0 var(--ink-green);
}

html.dark .worker-nav__link[aria-current="page"] {
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.12);
  box-shadow: inset 0 -2px 0 #34d399;
}

@media (max-width: 480px) {
  .worker-nav__link {
    padding: 6px 8px;
    font-size: 0.875rem;
  }
}

/* Узкие экраны (телефоны): верхняя полоса работника не шире экрана.
   Логотип и кнопки — в первой строке, разделы «Мои тесты / Профиль» — во второй. */
@media (max-width: 560px) {
  .worker-topbar {
    flex-wrap: wrap;
    height: auto;
    min-height: 4rem;
    padding: 8px 12px;
    row-gap: 4px;
    column-gap: 8px;
  }
  .worker-topbar__left {
    display: contents;
  }
  .worker-topbar__left .site-logo-link {
    order: 1;
    flex: 0 0 auto;
  }
  .worker-topbar__right {
    order: 2;
    gap: 10px;
    min-width: 0;
    margin-left: auto;
  }
  .worker-topbar__left .worker-nav {
    order: 3;
    flex: 1 1 100%;
    justify-content: center;
    min-width: 0;
  }
  .worker-topbar__right .theme-slider-container {
    margin-right: 0;
  }
  .worker-topbar__right #logout-btn,
  .worker-topbar__right #back-btn {
    padding-left: 10px;
    padding-right: 10px;
  }
}

/* Длинное ФИО в шапке «Мои тесты» и профиля переносится, а не растягивает страницу. */
main #user-name {
  overflow-wrap: break-word;
}
@media (max-width: 560px) {
  main #user-name {
    font-size: 1.75rem;
    line-height: 1.2;
  }
}

.profile-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.worker-profile-page {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.worker-profile-page .card {
  margin: 0;
}

.profile-card__title,
.profile-results__title {
  margin: 0 0 16px;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
}

.profile-card__body {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 28px;
  align-items: start;
}

.profile-photo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.profile-photo__frame {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ink-green-soft);
  border: 1px solid var(--ink-green-border);
}

html.dark .profile-photo__frame {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(52, 211, 153, 0.35);
}

.profile-photo__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-photo__initials {
  font-size: 3rem;
  font-weight: 700;
  color: var(--ink-green);
  letter-spacing: 0.02em;
}

html.dark .profile-photo__initials {
  color: #6ee7b7;
}

.profile-photo__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.profile-photo__upload {
  cursor: pointer;
}

.profile-photo__upload.is-disabled {
  opacity: 0.6;
  pointer-events: none;
}

/* Редактор фото профиля: тёмная сцена, круг как в профиле, превью сбоку. */
.photo-crop-overlay .spvt-confirm-dialog.photo-crop {
  width: min(620px, 100%);
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  padding: 22px 24px 20px;
}

.photo-crop__body {
  display: grid;
  grid-template-columns: minmax(0, 340px) 1fr;
  gap: 22px;
  align-items: center;
  margin-top: 4px;
}

.photo-crop__stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 18px;
  overflow: hidden;
  background:
    repeating-conic-gradient(#1b1e24 0% 25%, #15181d 0% 50%) 50% / 22px 22px;
  cursor: grab;
  touch-action: none;
  user-select: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.photo-crop__stage.is-dragging {
  cursor: grabbing;
}

.photo-crop__stage:focus-visible {
  outline: 3px solid var(--ink-green);
  outline-offset: 3px;
}

.photo-crop__canvas {
  position: absolute;
  inset: 0;
  display: block;
}

.photo-crop__mask {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    circle at center,
    transparent calc(var(--photo-crop-radius, 150px) - 0.5px),
    rgba(9, 11, 15, 0.62) var(--photo-crop-radius, 150px)
  );
}

.photo-crop__ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  pointer-events: none;
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.92),
    0 0 0 6px rgba(0, 0, 0, 0.18);
}

.photo-crop__side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.photo-crop__side-title {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.photo-crop__previews {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.photo-crop__preview {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.photo-crop__thumb {
  border-radius: 50%;
  background: var(--surface-2);
  box-shadow: 0 0 0 1px var(--border-light), 0 6px 16px rgba(15, 23, 42, 0.12);
}

.photo-crop__tools {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 8px;
}

.photo-crop__zoom {
  flex: 1;
  min-width: 0;
  accent-color: var(--ink-green);
  height: 28px;
}

.photo-crop__icon-btn {
  flex: none;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border-light);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.photo-crop__icon-btn:hover {
  background: var(--ink-green-soft);
  color: var(--ink-green);
}

.photo-crop__icon-btn:active {
  transform: scale(0.94);
}

.photo-crop__icon-btn:focus-visible {
  outline: 2px solid var(--ink-green);
  outline-offset: 2px;
}

.photo-crop__icon-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.photo-crop__rotate {
  margin-left: 6px;
}

html.dark .photo-crop__icon-btn:hover {
  background: rgba(16, 185, 129, 0.14);
  color: #6ee7b7;
}

.photo-crop__hint {
  margin: 0 0 14px;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--muted);
}

.photo-crop .spvt-confirm-actions {
  flex-wrap: nowrap;
}

.photo-crop .spvt-confirm-actions .btn {
  width: auto;
  flex: 0 1 auto;
}

@media (max-width: 560px) {
  .photo-crop-overlay .spvt-confirm-dialog.photo-crop {
    padding: 18px 16px 16px;
  }

  .photo-crop .spvt-confirm-actions .btn {
    flex: 1 1 0;
    min-width: 0;
    padding-left: 10px;
    padding-right: 10px;
    white-space: nowrap;
  }

  .photo-crop__tools {
    margin-top: 14px;
  }

  .photo-crop__hint {
    font-size: 0.8125rem;
  }

  .photo-crop__body {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .photo-crop__side {
    flex-direction: row;
    justify-content: center;
  }

  .photo-crop__side-title {
    display: none;
  }

  .photo-crop__previews {
    flex-direction: row;
    gap: 24px;
  }
}

#profile-photo-input:focus-visible + .profile-photo__upload {
  outline: 2px solid var(--ink-green);
  outline-offset: 2px;
}

.profile-photo__hint,
.profile-photo__status,
.profile-data__note,
.profile-results__lead,
.profile-results__count,
.profile-blank__note {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--muted);
}

.profile-photo__status {
  color: var(--text-secondary);
  font-weight: 600;
}

.profile-data {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.profile-data__list {
  width: 100%;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 24px;
}

.profile-data__list dt {
  font-size: 0.875rem;
  color: var(--muted);
}

.profile-data__list dd {
  margin: 2px 0 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  overflow-wrap: anywhere;
}

.profile-results__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.profile-results__head .profile-results__title {
  margin-bottom: 4px;
}

.profile-results__lead {
  margin-bottom: 14px;
}

.profile-results__loading,
.profile-results__empty {
  margin: 8px 0;
  color: var(--text-secondary);
}

.profile-results__table th {
  white-space: nowrap;
}

.profile-results__table td {
  vertical-align: middle;
}

.profile-results__test {
  display: block;
  font-weight: 600;
  color: var(--text);
}

.profile-results__attempt,
.profile-results__muted {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
}

.profile-results__row--annulled td {
  color: var(--muted);
}

.profile-code,
.result-code {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-weight: 700;
  letter-spacing: 0.06em;
  user-select: all;
  white-space: nowrap;
}

.profile-code {
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text);
}

#profile-results-pager {
  margin-top: 14px;
}

.profile-blank-dialog {
  width: min(560px, 100%);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
}

.profile-blank__verdict {
  margin: 4px 0 14px;
  text-align: center;
  font-size: 1.25rem;
  font-weight: 700;
}

.profile-blank__verdict--ok {
  color: #16a34a;
}

.profile-blank__verdict--bad {
  color: #dc2626;
}

.profile-blank__facts dd {
  overflow-wrap: anywhere;
}

.profile-blank__note {
  margin-top: 8px;
}

.profile-blank__actions {
  flex-wrap: wrap;
}

@media (max-width: 720px) {
  .profile-card__body {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .profile-data__list {
    grid-template-columns: 1fr;
  }

  /* На телефоне таблица превращается в карточки, чтобы код проверки не уезжал за край. */
  .profile-results__table thead {
    display: none;
  }

  .profile-results__table,
  .profile-results__table tbody,
  .profile-results__table tr,
  .profile-results__table td {
    display: block;
    width: 100%;
  }

  .profile-results__table tr {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
  }

  .profile-results__table td {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 4px 0;
    border: 0;
    text-align: right;
  }

  .profile-results__table td::before {
    content: attr(data-label);
    color: var(--muted);
    text-align: left;
  }

  .profile-results__table td[data-label="Тест"] {
    display: block;
    text-align: left;
  }

  .profile-results__table td[data-label="Тест"]::before,
  .profile-results__table td[data-label="Бланк"]::before {
    content: none;
  }

  .profile-results__table td[data-label="Бланк"] {
    justify-content: flex-start;
  }
}


.sidebar-group--marinka:not(:has(a.sidebar-link:not(.perm-denied))) {
  display: none !important;
}

.sidebar-group--marinka a.sidebar-link.perm-denied {
  display: none !important;
}
