:root {
  --bg: #f8f7f3;
  --card: #ffffff;
  --ink: #1f2328;
  --muted: #6e7781;
  --line: #e3dec3;
  --line-light: #ece8dc;
  --accent: #2563eb;
  --accent-soft: #eff6ff;
  --accent-border: #bfdbfe;
  --ok: #16a34a;
  --ok-soft: #f0fdf4;
  --ok-border: #bbf7d0;
  --warn: #d97706;
  --warn-soft: #fffbeb;
  --warn-border: #fde68a;
  --err: #dc2626;
  --err-soft: #fef2f2;
  --err-border: #fecaca;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow: 0 1px 3px rgba(31, 35, 40, .07), 0 8px 24px rgba(31, 35, 40, .04);
  --shadow-hover: 0 4px 12px rgba(31, 35, 40, .1), 0 12px 32px rgba(31, 35, 40, .06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 24px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand {
  font-weight: 750;
  font-size: 21px;
  letter-spacing: -.03em;
  color: var(--ink);
}

.page {
  max-width: 1400px;
  margin: 0 auto;
  padding: 18px 20px 64px;
}

h1 { font-size: 24px; margin: 4px 0 2px; letter-spacing: -.02em; font-weight: 750; }
h2 { font-size: 18px; margin: 0 0 4px; font-weight: 700; }
h3 { font-size: 15px; margin: 0 0 6px; font-weight: 650; }
h4 { font-size: 13.5px; margin: 0 0 4px; font-weight: 650; }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.back { display: inline-flex; align-items: center; gap: 4px; font-size: 13.5px; color: var(--muted); font-weight: 500; }
.back:hover { color: var(--ink); }

.top-nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s ease;
  white-space: nowrap;
}
.btn:hover { border-color: #b0a996; background: #faf9f6; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #1d4ed8; border-color: #1d4ed8; }
.btn.secondary { background: var(--card); border-color: var(--accent-border); color: var(--accent); }
.btn.secondary:hover { background: var(--accent-soft); }
.btn.small { padding: 5px 10px; font-size: 12.5px; }
.btn.big { padding: 13px 22px; font-size: 16px; border-radius: var(--radius); }
.btn.err { color: var(--err); border-color: var(--err-border); background: var(--err-soft); }
.btn.err:hover { background: #fee2e2; }
.btn.full-width { width: 100%; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: #eee;
  white-space: nowrap;
}
.pill.tiny { font-size: 11px; padding: 2px 8px; }
.pill.muted { background: #ecebe7; color: #57606a; }
.pill.busy { background: var(--accent-soft); color: var(--accent); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.err { background: var(--err-soft); color: var(--err); }

.mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  padding: 0 6px;
  border-radius: 7px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 750;
  font-size: 13px;
  border: 1px solid var(--accent-border);
}
.mark.big { min-width: 48px; height: 48px; font-size: 24px; border-radius: 10px; }

/* История */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 14px;
}
.card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  color: inherit;
  transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.thumb {
  aspect-ratio: 4 / 3;
  background: #f1efe9;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.thumb-empty { color: var(--muted); font-size: 13px; }
.card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; }
.card-title { font-weight: 700; font-size: 15px; }
.card-sub { color: var(--muted); font-size: 12.5px; }
.card-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; }

.empty {
  background: var(--card);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
}

/* Формы */
.form { display: flex; flex-direction: column; gap: 16px; max-width: 680px; }
.form.tight { gap: 10px; }
.form-fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.form-fieldset legend { font-size: 13.5px; color: var(--muted); font-weight: 600; padding: 0 0 4px; }
.field-label { font-size: 14px; font-weight: 600; margin-bottom: 6px; display: block; }
.field-label .required { color: var(--err); }

.choice-group { display: flex; flex-wrap: wrap; gap: 8px; }
.choice-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all .15s ease;
}
.choice-pill:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}
.choice-pill input { accent-color: var(--accent); margin: 0; }

.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; }
.field > span { color: var(--muted); font-weight: 500; }
.field.inline { flex-direction: row; align-items: center; gap: 8px; }
.field.grow { flex: 1; }

input[type="text"], input[type="number"], input[type="date"], select, textarea {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
  font: inherit;
  color: var(--ink);
  width: 100%;
  font-size: 14px;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent-border);
  border-color: var(--accent);
}

.quick-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.chip {
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
}
.chip.active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); font-weight: 600; }

/* Зона мобильной загрузки */
.upload-section { margin-bottom: 8px; }
.dropzone {
  border: 2px dashed #cfc8b8;
  border-radius: var(--radius-lg);
  background: #fdfcf9;
  padding: 24px 20px;
  text-align: center;
  transition: all .15s ease;
}
.dropzone.drag-over {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.dropzone-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.dropzone-icon { font-size: 36px; line-height: 1; }
.dropzone-text strong { display: block; font-size: 16px; margin-bottom: 2px; }
.upload-buttons-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 6px;
}
.upload-action-btn {
  padding: 12px 20px;
  font-size: 15px;
  border-radius: 10px;
  cursor: pointer;
  min-height: 46px;
}
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}
.dropzone-desktop-hint { margin-top: 4px; }

/* Превью выбранных фото */
.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.preview-card {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #eae6db;
  border: 1px solid var(--line);
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.preview-img { width: 100%; height: 100%; object-fit: cover; }
.preview-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(31, 35, 40, .85);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 5px;
}
.preview-del-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 0;
  background: rgba(220, 38, 38, .9);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.preview-del-btn:hover { background: #b91c1c; }
.preview-meta {
  position: absolute;
  bottom: 0;
  inset-inline: 0;
  background: rgba(0,0,0,.6);
  color: #fff;
  font-size: 11px;
  padding: 3px 6px;
  text-align: center;
}
.preview-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 6px;
}

.alert { padding: 10px 14px; border-radius: var(--radius-sm); margin: 8px 0; font-size: 14px; }
.alert.err { background: var(--err-soft); color: var(--err); border: 1px solid var(--err-border); }
.alert.warn { background: var(--warn-soft); color: var(--warn); border: 1px solid var(--warn-border); }
.alert.note { background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-border); }
.alert.tight { padding: 8px 12px; margin: 4px 0 8px; }

/* Карточка работы (Шапка, табы) */
.work-head { margin-bottom: 12px; }
.work-topic { font-weight: 500; color: #374151; }

.status-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 14px;
}
.status-bar .alert { flex-basis: 100%; margin: 4px 0 0; }
.toolbar-hint { margin-left: auto; }

.progress {
  flex-basis: 100%;
  height: 6px;
  border-radius: 999px;
  background: #eeebe3;
  overflow: hidden;
}
.progress > span {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width .4s ease;
}

.spinner {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--accent-soft);
  border-top-color: var(--accent);
  animation: spin .8s linear infinite;
  display: inline-block;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Вкладки работы */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.tab {
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  transition: all .15s ease;
}
.tab:hover { border-color: #b0a996; color: var(--ink); }
.tab.active {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
  font-weight: 600;
}
.tab .dot {
  width: 7px; height: 7px; border-radius: 50%; margin-right: 6px;
  background: #cfcabd; display: inline-block;
}
.tab .dot.done { background: var(--ok); }
.tab .dot.warn { background: var(--warn); }
.tab .dot.failed { background: var(--err); }
.tab .dot.busy { background: var(--accent); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .3; } }

.tab.summary-tab { font-weight: 600; }
.tab.summary-tab.active { background: #fef3c7; border-color: #f59e0b; color: #b45309; }

/* Управление работой (меню настроек) */
.manage-details { position: relative; display: inline-block; }
.popover-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 6px;
  width: 290px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  padding: 10px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.popover-item { font-size: 13.5px; cursor: pointer; padding: 4px 6px; }
.popover-form { margin-top: 8px; }
.popover-del { width: 100%; text-align: center; }

/* Вкладка: Сводный итог работы (Dashboard) */
.summary-dashboard {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.summary-dash-head h2 { font-size: 20px; }

.summary-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}
.summary-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
}
.summary-card.good { border-top: 4px solid var(--ok); }
.summary-card.good h3 { color: var(--ok); }
.summary-card.attention { border-top: 4px solid var(--warn); }
.summary-card.attention h3 { color: var(--warn); }
.summary-card.goal { border-top: 4px solid var(--accent); }
.summary-card.goal h3 { color: var(--accent); }
.summary-card ul { margin: 6px 0 0; padding-left: 20px; }
.summary-card li { margin: 4px 0; font-size: 14px; }
.summary-card p { margin: 6px 0 0; font-size: 14px; }

.section-title { font-size: 17px; margin: 10px 0 -8px; font-weight: 700; }

.summary-pages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.summary-page-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.page-thumb-wrap {
  aspect-ratio: 16 / 10;
  background: #f1efe9;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.page-thumb-wrap img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.page-card-info { padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.page-card-title-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.page-card-link { color: var(--ink); font-size: 15px; }
.page-card-attention { margin: 0; font-size: 13px; color: var(--warn); }
.page-card-strength { margin: 0; font-size: 13px; color: var(--ok); }
.page-card-footer {
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--line-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Десктопный сплит-лейаут работы (2 просторные колонки) */
.work-split {
  display: grid;
  grid-template-columns: minmax(380px, 1.05fr) minmax(440px, 1.25fr);
  gap: 24px;
  align-items: start;
}

@media (min-width: 861px) {
  .viewer-col {
    position: sticky;
    top: 76px;
    max-height: calc(100vh - 96px);
    display: flex;
    flex-direction: column;
  }
  .viewer {
    flex: 1;
    min-height: 480px;
    max-height: calc(100vh - 146px);
  }
}

.viewer-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.viewer {
  background: #252830;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: auto;
  touch-action: pan-x pan-y;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 12px;
}
.viewer:active { cursor: grabbing; }
.viewer-canvas {
  position: relative;
  margin: auto;
  transform-origin: center top;
  box-shadow: 0 4px 20px rgba(0,0,0,.35);
  display: inline-block;
  line-height: 0;
  max-width: 100%;
}
.viewer-canvas img {
  display: block;
  user-select: none;
}
/* Режим по умолчанию: страница целиком помещается по высоте вьюера, низ ВСЕГДА виден */
.viewer.mode-fit-height .viewer-canvas img {
  max-height: calc(100vh - 180px);
  max-width: 100%;
  width: auto;
  height: auto;
}
/* Режим по ширине: растягивается на 100% ширины, страница плавно скроллится до самого низа */
.viewer.mode-fit-width .viewer-canvas img {
  width: 100%;
  max-height: none;
  height: auto;
}

.overlay { position: absolute; inset: 0; }
.box {
  position: absolute;
  border: 2px solid rgba(37, 99, 235, .6);
  background: rgba(37, 99, 235, .12);
  border-radius: 4px;
  transition: opacity .15s, box-shadow .15s;
  opacity: .5;
}
.box.assessment { border-color: rgba(22, 163, 74, .7); background: rgba(22, 163, 74, .14); }
.box.strength { border-color: rgba(22, 163, 74, .6); background: rgba(22, 163, 74, .1); }
.box.handwriting_observation { border-color: rgba(217, 119, 6, .7); background: rgba(217, 119, 6, .12); }
.box.is-active { opacity: 1; box-shadow: 0 0 0 3px rgba(37, 99, 235, .35); }

/* Правая панель разбора (свободная, просторная) */
.panel-col { display: flex; flex-direction: column; }
.panel { display: flex; flex-direction: column; gap: 14px; }

/* Шапка страницы в панели */
.page-header-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.page-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.page-title-block { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.page-actions-row { display: flex; align-items: center; gap: 8px; }
.btn-icon-del {
  background: transparent; border: 0; cursor: pointer; padding: 2px; font-size: 14px;
  opacity: .6; transition: opacity .15s;
}
.btn-icon-del:hover { opacity: 1; }

.rename-popover { position: relative; display: inline-block; font-size: 12px; }
.rename-trigger { cursor: pointer; color: var(--muted); user-select: none; }
.rename-trigger:hover { color: var(--ink); }
.inline-rename-form {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 4px;
  display: flex;
  gap: 6px;
  background: var(--card);
  border: 1px solid var(--line);
  padding: 6px;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
  z-index: 50;
  width: 220px;
}
.inline-rename-form input { padding: 4px 8px; font-size: 13px; }

/* Сетка сводки по странице (компактная 2-колоночная) */
.page-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 4px;
}
.summary-box {
  background: #fbfaf6;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.summary-box.full-width { grid-column: 1 / -1; }
.summary-box.good { border-left: 3px solid var(--ok); }
.summary-box.good h4 { color: var(--ok); }
.summary-box.attention { border-left: 3px solid var(--warn); }
.summary-box.attention h4 { color: var(--warn); }
.summary-box.goal { border-left: 3px solid var(--accent); }
.summary-box.goal h4 { color: var(--accent); }
.summary-box ul { margin: 4px 0 0; padding-left: 18px; }
.summary-box li { margin: 2px 0; font-size: 13px; }
.summary-box p { margin: 4px 0 0; font-size: 13px; }

/* Отметка учителя на странице */
.assessment-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 16px;
  box-shadow: var(--shadow);
}
.assessment-card.confirmed { border-color: var(--ok-border); }
.assessment-main { display: flex; align-items: center; gap: 14px; }
.assessment-texts { flex: 1; }
.assessment-status-badge { font-size: 12px; color: var(--muted); margin-top: 2px; }
.assessment-status-badge .dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; margin-right: 4px; }
.assessment-status-badge .dot.done { background: var(--ok); }
.assessment-status-badge .dot.warn { background: var(--warn); }
.comment { margin: 6px 0 0; font-size: 13.5px; }

.correct-details { margin-top: 8px; border-top: 1px solid var(--line-light); padding-top: 8px; font-size: 13px; }
.correct-details summary { cursor: pointer; color: var(--muted); }
.correct-details summary:hover { color: var(--ink); }
.form-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }

/* Список находок (компактные карточки) */
.findings-header { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.findings-header h3 { font-size: 16px; margin: 0; }
.badge-count {
  background: var(--line); color: var(--ink); padding: 1px 7px;
  border-radius: 999px; font-size: 12px; font-weight: 600;
}
.empty-findings {
  background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius);
  padding: 18px 16px; margin: 0; font-size: 14px;
}

.findings-list { display: flex; flex-direction: column; gap: 10px; }

.finding-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: all .12s ease;
}
.finding-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-hover); }
.finding-card.error { border-left-color: var(--err); }
.finding-card.strength { border-left-color: var(--ok); }
.finding-card.handwriting_observation { border-left-color: var(--warn); }
.finding-card.confirmed { background: #fbfefc; border-color: var(--ok-border); }
.finding-card.rejected { opacity: .55; }

.finding-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.kind-tag {
  font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em;
  padding: 1px 6px; border-radius: 4px;
}
.kind-tag.error { background: var(--err-soft); color: var(--err); }
.kind-tag.strength { background: var(--ok-soft); color: var(--ok); }
.kind-tag.handwriting_observation { background: var(--warn-soft); color: var(--warn); }

.status-tag { font-size: 11.5px; color: var(--muted); }
.status-tag.confirmed { color: var(--ok); font-weight: 600; }
.status-tag.rejected { color: var(--err); }
.confidence-tag { margin-left: auto; font-size: 11px; color: var(--muted); }

.finding-excerpt {
  margin: 0 0 6px;
  padding: 5px 8px;
  background: #f5f4ef;
  border-radius: 5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  border-left: 2px solid #ded9cc;
}
.finding-explanation { margin: 0 0 4px; font-size: 13.5px; }
.finding-suggestion { margin: 0 0 6px; font-size: 13.5px; color: var(--accent); }
.finding-user-note { margin: 0 0 6px; font-size: 13px; color: var(--ok); }

.finding-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--line-light);
}
.action-pill {
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #faf9f6;
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all .1s ease;
}
.action-pill:hover { border-color: #b0a996; }
.action-pill.ok:hover { background: var(--ok-soft); border-color: var(--ok-border); color: var(--ok); }
.action-pill.reject:hover { background: var(--err-soft); border-color: var(--err-border); color: var(--err); }

.action-details { display: inline-block; }
.action-details summary { list-style: none; cursor: pointer; }
.action-details summary::-webkit-details-marker { display: none; }
.action-details[open] { width: 100%; margin-top: 4px; }
.edit-finding-form { width: 100%; }

.goto-summary-bar { margin-top: 8px; }

/* Адаптив для планшетов и мобилок */
@media (max-width: 860px) {
  .page { padding: 12px 14px 48px; }
  .work-split { grid-template-columns: 1fr; gap: 16px; }
  .viewer { max-height: 60vh; }
  .viewer.mode-fit-height .viewer-canvas img { max-height: 55vh; }
  .page-summary-grid { grid-template-columns: 1fr; }
  .form-row-2 { grid-template-columns: 1fr; }
  .upload-buttons-row { flex-direction: column; width: 100%; }
  .upload-action-btn { width: 100%; }
}
