:root {
  --bg: #eef3f8;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --surface-2: #e9eff5;
  --ink: #0d1520;
  --muted: #647384;
  --line: #d8e2eb;
  --line-strong: #bfccd8;
  --blue: #0b6bff;
  --blue-soft: #edf5ff;
  --green: #167a55;
  --green-soft: #edf7f2;
  --red: #c33124;
  --gold: #936600;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 18px 42px rgba(15, 23, 42, 0.06);
  --shadow-soft: 0 1px 2px rgba(15, 23, 42, 0.05);
}

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  background: linear-gradient(180deg, #f8fbff 0, var(--bg) 330px, #f5f7fa 100%) fixed;
  color: var(--ink);
  font: 14px/1.45 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.auth-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% 18%, rgba(11, 107, 255, 0.18), transparent 34%),
    linear-gradient(180deg, #f8fbff 0, #edf3f8 100%);
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-panel {
  width: min(100%, 380px);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.auth-mark {
  width: 58px;
  height: 58px;
  margin-bottom: 18px;
}

.auth-mark img {
  display: block;
  width: 100%;
  height: 100%;
}

.auth-copy h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.1;
  letter-spacing: 0;
}

.auth-copy p {
  margin: 7px 0 20px;
  color: var(--muted);
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.auth-form input {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

.auth-form input:focus {
  outline: 3px solid rgba(11, 107, 255, 0.16);
  border-color: var(--blue);
}

.auth-form button {
  min-height: 42px;
  margin-top: 4px;
  border: 0;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.auth-error {
  margin: 0 0 16px;
  padding: 10px 12px;
  border: 1px solid #f2c3bd;
  border-radius: 8px;
  background: #fff1ef;
  color: var(--red);
  font-weight: 700;
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 54px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(248, 251, 255, 0.86);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 850;
  letter-spacing: 0;
}

.brand::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--blue);
  box-shadow: 0 0 0 4px rgba(11, 107, 255, 0.1);
}

.topnav,
.export-menu div,
.exports,
.actions,
.tabs,
.dossier-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.topnav {
  justify-content: flex-end;
  gap: 4px;
}

.topnav a,
.export-menu summary,
.btn,
.tabs a,
.icon-btn,
.logout-form button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.topnav a,
.export-menu summary,
.tabs a,
.logout-form button {
  padding: 8px 10px;
  font-size: 13px;
  line-height: 1;
}

.topnav a,
.export-menu summary,
.logout-form button {
  min-height: 34px;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.logout-form {
  margin: 0;
}

.logout-form button {
  font: inherit;
  cursor: pointer;
}

.topnav a:hover,
.export-menu summary:hover,
.btn:hover,
.tabs a:hover,
.icon-btn:hover {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

.topnav a.active {
  border-color: rgba(11, 107, 255, 0.28);
  background: #ffffff;
  color: #064fbf;
  box-shadow: var(--shadow-soft);
}

.export-menu {
  position: relative;
}

.export-menu summary {
  display: inline-flex;
  align-items: center;
  list-style: none;
  cursor: pointer;
}

.export-menu summary::-webkit-details-marker {
  display: none;
}

.export-menu div {
  display: block;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 20;
  min-width: 170px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.export-menu div a {
  display: block;
  padding: 8px 10px;
  border-radius: 6px;
}

.export-menu div a:hover {
  background: var(--surface-2);
}

.page {
  width: min(1840px, calc(100% - 48px));
  margin: 22px auto 56px;
  min-width: 0;
}

.run-head,
.dossier-head,
.notebook-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 16px;
  margin-bottom: 12px;
}

.run-head {
  display: grid;
  grid-template-columns: minmax(220px, 0.58fr) minmax(560px, 1.42fr);
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
  min-width: 0;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 4px;
  font-size: 28px;
  line-height: 1.12;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 10px;
  font-size: 17px;
}

h3 {
  margin: 16px 0 8px;
  font-size: 15px;
}

.run-head p,
.muted,
.card-meta,
.status-line,
.dossier-meta,
.kicker {
  color: var(--muted);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.stats-grid.compact {
  gap: 10px;
  margin-bottom: 0;
}

.legacy-stats {
  display: none;
}

.quick-lists {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(360px, 1.1fr);
  gap: 10px;
  align-items: start;
  margin-bottom: 12px;
  min-width: 0;
}

.stat,
.panel,
.quick-list,
.notebook,
.video-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.stat {
  padding: 14px;
}

.stats-grid.compact .stat {
  min-height: 56px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-soft);
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.stat strong {
  font-size: 28px;
  letter-spacing: 0;
}

.stat small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1;
}

.stats-grid.compact .stat span {
  font-size: 11px;
  text-transform: uppercase;
}

.stats-grid.compact .stat strong {
  display: block;
  margin-top: 1px;
  font-size: 23px;
  line-height: 1;
}

.danger-stat strong {
  color: var(--red);
}

.notebook,
.quick-list {
  padding: 0;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.quick-list summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding: 0 13px;
  cursor: pointer;
  font-weight: 800;
  list-style: none;
}

.quick-list summary::-webkit-details-marker {
  display: none;
}

.quick-list summary small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.notebook-body,
.quick-list-body {
  padding: 0 13px 13px;
  margin-bottom: 0;
  min-width: 0;
}

.quick-list-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 16px;
}

.notebook pre {
  white-space: pre-wrap;
  margin: 0;
  color: var(--blue);
}

.notebook-actions {
  display: flex;
  gap: 8px;
  align-items: start;
}

.title-list-items {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 0;
  font-size: 14px;
}

.title-list-line {
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.btn,
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  cursor: pointer;
  font: inherit;
}

.btn {
  max-width: 100%;
  white-space: normal;
  text-align: center;
}

.btn.primary {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
  box-shadow: none;
}

.tabs {
  margin: 10px 0 12px;
  padding: 4px;
  border: 1px solid #dbe5ee;
  border-radius: 8px;
  background: rgba(232, 239, 246, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), var(--shadow-soft);
  width: fit-content;
  gap: 3px;
}

.tabs a {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: #223142;
}

.tabs a.active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
  box-shadow: none;
}

.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: start;
  gap: 14px;
  min-width: 0;
}

.video-card {
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  min-width: 0;
}

.thumb-link {
  display: block;
  background: var(--surface-2);
  aspect-ratio: 16 / 9;
}

.video-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
}

.thumb-link img,
.dossier-head img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-body {
  padding: 13px 14px 14px;
  min-width: 0;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  font-size: 12px;
}

.publish-line {
  color: var(--muted);
  font-size: 12px;
  margin: -1px 0 7px;
}

.stage {
  color: var(--gold);
  font-weight: 800;
  white-space: nowrap;
}

.stage.new {
  color: var(--blue);
}

.video-card h2 {
  font-size: 16px;
  line-height: 1.25;
  margin-bottom: 7px;
  font-weight: 780;
}

.ru-title {
  color: var(--green);
  font-size: 14px;
  margin-bottom: 10px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 12px;
}

.tag-row.small {
  margin-bottom: 10px;
}

.insight-toggles {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 7px;
  margin: 0 0 10px;
}

.tag-details,
.points-details {
  margin: 0 0 10px;
}

.tag-details summary,
.points-details summary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 3px 10px;
  border: 1px solid rgba(22, 122, 85, 0.18);
  border-radius: 999px;
  background: var(--green-soft);
  color: #265b3d;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  list-style: none;
}

.tag-details summary::-webkit-details-marker,
.points-details summary::-webkit-details-marker {
  display: none;
}

.tag-details summary small,
.points-details summary small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.tag-details[open] summary,
.points-details[open] summary {
  margin-bottom: 8px;
}

.tag-details .tag-row {
  margin-bottom: 0;
}

.points-details {
  flex: 1 1 112px;
  min-width: 0;
}

.points-details[open] {
  flex-basis: 100%;
}

.points-details summary {
  border-color: rgba(11, 107, 255, 0.18);
  background: var(--blue-soft);
  color: #1458c7;
}

.card-points {
  display: grid;
  gap: 9px;
  max-height: 520px;
  overflow: auto;
  padding: 10px;
  border: 1px solid rgba(216, 226, 235, 0.88);
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.82);
}

.card-takeaway {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.card-points ol {
  display: grid;
  gap: 12px;
  margin: 0;
  padding-left: 18px;
}

.card-points li {
  padding-left: 2px;
}

.card-points strong {
  display: block;
  margin-bottom: 5px;
  font-size: 13px;
  line-height: 1.25;
}

.card-points p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.card-points b {
  color: #334155;
}

.card-points a {
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 8px;
  border: 1px solid rgba(22, 122, 85, 0.18);
  border-radius: 999px;
  background: var(--green-soft);
  color: #265b3d;
  font-size: 12px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 10px;
}

.metrics div {
  padding: 8px 9px;
  border: 1px solid rgba(216, 226, 235, 0.88);
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.78);
  min-width: 0;
}

.metrics .metric-leader {
  border-color: rgba(11, 107, 255, 0.36);
  background: var(--blue-soft);
  box-shadow: inset 0 0 0 1px rgba(11, 107, 255, 0.14);
}

.metrics .metric-leader dt {
  color: #1458c7;
  font-weight: 800;
}

.metrics dt {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.1;
}

.metrics dd {
  margin: 2px 0 0;
  font-weight: 850;
  font-size: 15px;
  overflow-wrap: anywhere;
}

.sparkline {
  width: 100%;
  margin: 4px 0 10px;
}

.status-line {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 3px 0 8px;
  font-size: 12px;
}

.icon-btn {
  width: 34px;
  min-height: 34px;
  padding: 0;
  background: rgba(255, 255, 255, 0.8);
}

.icon-btn.disabled {
  opacity: 0.42;
  cursor: default;
}

.panel {
  padding: 15px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-soft);
  min-width: 0;
}

.panel.danger {
  border-color: #f1b5ae;
  background: #fff8f6;
}

.leaders-grid,
.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.points-list {
  display: grid;
  gap: 0;
}

.point {
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.point:first-child {
  padding-top: 0;
  border-top: 0;
}

.point:last-child {
  padding-bottom: 0;
}

.point-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.point h3 {
  margin-top: 0;
}

.point p {
  margin-bottom: 9px;
}

.leader-row {
  display: grid;
  grid-template-columns: 24px 88px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-top: 1px solid rgba(216, 226, 235, 0.82);
  min-width: 0;
}

.leader-row img {
  width: 88px;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  object-fit: cover;
  background: var(--surface-2);
}

.leader-rank {
  color: var(--muted);
  font-weight: 800;
}

.leader-text {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.leader-row strong,
td a {
  color: var(--blue);
}

.leader-row small {
  color: var(--muted);
}

.leader-value {
  min-width: 76px;
  padding: 7px 9px;
  border: 1px solid rgba(11, 107, 255, 0.36);
  border-radius: 8px;
  background: var(--blue-soft);
  color: #1458c7;
  text-align: right;
  font-weight: 900;
  white-space: nowrap;
}

.transcript-list {
  display: grid;
  gap: 0;
}

.transcript-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  border-top: 1px solid rgba(216, 226, 235, 0.82);
  min-width: 0;
}

.transcript-row:first-child {
  border-top: 0;
}

.transcript-thumb img {
  width: 96px;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  object-fit: cover;
  background: var(--surface-2);
  display: block;
}

.transcript-text {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.transcript-text a {
  color: var(--blue);
  font-weight: 800;
}

.transcript-text small {
  color: var(--muted);
}

.transcript-statuses {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.transcript-download {
  white-space: nowrap;
}

.archive-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 520px);
  align-items: center;
  gap: 14px;
  margin-bottom: 8px;
}

.archive-head h2 {
  margin: 0;
}

.archive-search {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.archive-search input {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  font: inherit;
}

.archive-list {
  display: grid;
  gap: 0;
}

.archive-row {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 11px 0;
  border-top: 1px solid rgba(216, 226, 235, 0.82);
  min-width: 0;
}

.archive-row:first-child {
  border-top: 0;
}

.archive-thumb img {
  display: block;
  width: 132px;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  object-fit: cover;
  background: var(--surface-2);
}

.archive-text {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.archive-text h3,
.archive-text p {
  margin: 0;
}

.archive-text h3 {
  font-size: 15px;
  line-height: 1.3;
}

.archive-text h3 a {
  color: var(--blue);
}

.archive-text p {
  color: var(--green);
}

.archive-text small {
  color: var(--muted);
}

.archive-metrics,
.archive-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.archive-metrics span {
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(248, 250, 252, 0.78);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.archive-actions {
  justify-content: flex-end;
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

th,
td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.status {
  display: inline-flex;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 12px;
}

.empty {
  grid-column: 1 / -1;
  padding: 32px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
}

.dossier-head {
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
  align-items: start;
  min-width: 0;
}

.dossier-head img {
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface-2);
}

.compact-dossier {
  margin-bottom: 12px;
}

.compact-dossier img {
  height: 180px;
  max-height: 180px;
  object-fit: cover;
}

.compact-dossier h1 {
  max-width: 1120px;
  margin-bottom: 6px;
  font-size: 25px;
  line-height: 1.16;
}

.compact-dossier .ru-title {
  max-width: 1120px;
  margin-bottom: 8px;
}

.dossier-info {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 0.55fr);
  align-items: start;
  gap: 18px;
  min-width: 0;
}

.dossier-copy {
  min-width: 0;
}

.hero-chart {
  width: 100%;
  min-width: 0;
  margin-top: 12px;
  padding: 11px 12px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
}

.hero-chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
}

.hero-chart-head strong {
  color: var(--ink);
}

.hero-chart canvas {
  width: 100%;
  display: block;
}

.stage-badge {
  color: #1458c7;
  border-color: rgba(11, 107, 255, 0.28) !important;
  background: var(--blue-soft) !important;
  font-weight: 800;
}

.kicker {
  margin-bottom: 6px;
  font-weight: 800;
  text-transform: uppercase;
  font-size: 12px;
}

.dossier-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 10px;
}

.dossier-meta span {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
}

.actions.wide .btn {
  min-width: 0;
}

.support-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.75fr) minmax(520px, 1.25fr);
  gap: 16px;
  min-width: 0;
}

.support-grid.snapshots-only {
  grid-template-columns: 1fr;
}

.points-panel {
  padding-top: 12px;
}

.points-panel h2,
.context-panel h2 {
  margin-bottom: 8px;
}

.transcript,
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.transcript {
  max-height: 620px;
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.transcript-panel {
  padding: 0;
  overflow: hidden;
}

.transcript-panel summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
  padding: 0 15px;
  cursor: pointer;
  font-weight: 800;
  list-style: none;
}

.transcript-panel summary::-webkit-details-marker {
  display: none;
}

.transcript-panel summary small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.transcript-tools {
  display: flex;
  justify-content: flex-end;
  padding: 0 15px 10px;
}

.transcript-panel .transcript {
  margin: 0 15px 15px;
}

@media (max-width: 1100px) {
  .cards,
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1101px) and (max-width: 1400px) {
  .cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .run-head,
  .dossier-head,
  .dossier-info {
    grid-template-columns: 1fr;
  }

  .stats-grid.compact {
    width: 100%;
  }

  .compact-dossier img {
    height: auto;
    max-height: none;
    aspect-ratio: 16 / 9;
  }

  .hero-chart {
    margin-top: 0;
  }
}

@media (max-width: 760px) {
  .topbar,
  .run-head,
  .quick-lists,
  .notebook-body,
  .transcript-row,
  .archive-head,
  .archive-row,
  .dossier-head,
  .dossier-info,
  .leaders-grid,
  .summary-grid,
  .support-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
  }

  .topnav,
  .tabs {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .topnav a,
  .export-menu summary,
  .tabs a {
    flex: 0 0 auto;
  }

  .page {
    width: min(100% - 20px, 1480px);
    margin-top: 14px;
  }

  .cards,
  .stats-grid,
  .metrics {
    grid-template-columns: 1fr;
  }

  .archive-search,
  .archive-actions {
    justify-content: flex-start;
  }

  .archive-search,
  .notebook-actions,
  .actions.wide {
    width: 100%;
  }

  .archive-search input,
  .archive-search .btn,
  .actions.wide .btn,
  .transcript-download {
    width: 100%;
  }

  .compact-dossier img {
    height: auto;
    max-height: none;
    aspect-ratio: 16 / 9;
  }

  .leader-row {
    grid-template-columns: 22px 72px minmax(0, 1fr);
    align-items: start;
  }

  .leader-row img {
    width: 72px;
  }

  .leader-value {
    grid-column: 2 / -1;
    justify-self: start;
    min-width: 0;
    text-align: left;
  }

  .transcript-row,
  .archive-row {
    align-items: start;
  }

  .transcript-statuses,
  .archive-actions {
    justify-content: flex-start;
  }

  .table-wrap {
    margin-inline: -6px;
    padding-inline: 6px;
  }

  th,
  td {
    padding: 8px;
    white-space: nowrap;
  }

  h1 {
    font-size: 22px;
  }
}
