:root {
  --paper: #f6f7f2;
  --panel: #ffffff;
  --ink: #1f211f;
  --muted: #686b62;
  --line: #d9ddd0;
  --line-strong: #a9b19d;
  --accent: #b8d63a;
  --accent-ink: #12150b;
  --coral: #c94b32;
  --teal: #187a6d;
  --yellow: #e0c62f;
  --shadow: 0 18px 60px rgba(31, 33, 31, 0.12);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
  background:
    linear-gradient(90deg, rgba(31, 33, 31, 0.04) 1px, transparent 1px),
    linear-gradient(0deg, rgba(31, 33, 31, 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: 44px 44px;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  font-family: "Aptos", "Segoe UI", "Helvetica Neue", sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}

html.sidebar-open,
html.sidebar-open body {
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
  transition: grid-template-columns 180ms ease;
}

.app-shell.sidebar-collapsed {
  grid-template-columns: 0 minmax(0, 1fr);
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 14;
  padding: 0;
  background: rgba(31, 33, 31, 0.34);
  border: 0;
  border-radius: 0;
  backdrop-filter: blur(2px);
}

.rail {
  position: sticky;
  top: 0;
  min-width: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 26px;
  padding: 22px;
  background: #20241f;
  color: #f7f8ef;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
  transition: opacity 160ms ease, padding 180ms ease, transform 180ms ease;
}

.app-shell.sidebar-collapsed .rail {
  padding-right: 0;
  padding-left: 0;
  border-right: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-18px);
}

.rail-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  background: var(--accent);
  color: var(--accent-ink);
  border: 2px solid #f7f8ef;
  border-radius: var(--radius);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
}

.brand-name {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  line-height: 1;
}

.nav-tabs {
  display: grid;
  gap: 8px;
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 12px;
  color: #eef2e5;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  text-align: left;
}

.nav-tab:hover,
.nav-tab.is-active {
  color: var(--accent-ink);
  background: var(--accent);
  border-color: var(--accent);
}

.nav-icon {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-weight: 700;
}

.rail-stats {
  display: grid;
  gap: 12px;
  margin-top: auto;
}

.rail-stats div {
  display: grid;
  gap: 2px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
}

.rail-stats span {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
  line-height: 1;
}

.rail-stats small {
  color: #cbd2bd;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.workspace {
  min-width: 0;
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 0 0 18px;
}

.title-block {
  display: flex;
  align-items: flex-end;
  min-width: 0;
  gap: 12px;
}

.headline-block {
  display: grid;
  gap: 7px;
}

.view-label {
  width: fit-content;
  margin: 0;
  padding: 5px 9px;
  color: var(--teal);
  background: #ecf7f4;
  border: 1px solid #b8ded7;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(34px, 4vw, 58px);
  line-height: 0.95;
}

h2 {
  font-size: 24px;
  line-height: 1;
}

.top-actions {
  display: flex;
  align-items: end;
  gap: 10px;
}

.search-box,
.filter-band label,
.action-strip label,
.format-editor label {
  display: grid;
  gap: 6px;
}

.search-box span,
.filter-band span,
.action-strip label span,
.format-editor span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

input,
select,
textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: none;
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0;
  accent-color: var(--teal);
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(24, 122, 109, 0.14);
}

.search-box input {
  width: min(360px, 38vw);
}

.icon-button,
.primary-button,
.ghost-button,
.sort-button,
.mini-action {
  min-height: 38px;
  padding: 8px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
  font-weight: 800;
}

.icon-button {
  width: 42px;
  padding: 0;
}

.sidebar-toggle {
  display: none;
  position: relative;
  z-index: 16;
  flex: 0 0 auto;
}

.app-shell.sidebar-collapsed .sidebar-toggle {
  display: inline-block;
}

.sidebar-toggle span,
.sidebar-toggle span::before,
.sidebar-toggle span::after {
  position: absolute;
  left: 12px;
  width: 16px;
  height: 2px;
  content: "";
  background: currentColor;
  border-radius: 999px;
}

.sidebar-toggle span {
  top: 18px;
}

.sidebar-toggle span::before {
  top: -6px;
  left: 0;
}

.sidebar-toggle span::after {
  top: 6px;
  left: 0;
}

.sidebar-close {
  position: relative;
  flex: 0 0 auto;
  color: #f7f8ef;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.sidebar-close span,
.sidebar-close span::before {
  position: absolute;
  top: 18px;
  left: 12px;
  width: 16px;
  height: 2px;
  content: "";
  background: currentColor;
  border-radius: 999px;
}

.sidebar-close span {
  transform: rotate(45deg);
}

.sidebar-close span::before {
  top: 0;
  left: 0;
  transform: rotate(90deg);
}

.primary-button {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.primary-button:hover,
.icon-button:hover,
.ghost-button:hover,
.sort-button:hover,
.mini-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(31, 33, 31, 0.12);
}

.ghost-button {
  background: transparent;
}

.sort-button {
  min-height: 28px;
  padding: 3px 7px;
  border-color: transparent;
  background: transparent;
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

.filter-band,
.action-strip,
.formats-layout {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.filter-band {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 10px;
  align-items: end;
  padding: 14px;
}

.filter-band label,
.filter-band .ghost-button,
.segmented {
  min-width: 0;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  grid-column: span 2;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.segmented legend {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.segmented button {
  min-height: 38px;
  padding: 7px 9px;
  overflow: hidden;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 800;
}

.segmented button.is-active {
  background: var(--accent);
  border-color: var(--accent);
}

.action-strip {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
  padding: 12px 14px;
}

.selection-meter {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 108px;
  padding: 7px 10px;
  background: #f0f3e7;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.selection-meter strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 26px;
  line-height: 1;
}

.selection-meter span {
  color: var(--muted);
}

.action-strip label {
  width: min(260px, 38vw);
}

.result-count {
  margin-left: auto;
  color: var(--muted);
  font-weight: 800;
}

.table-wrap,
.mini-table-wrap {
  position: relative;
  margin-top: 14px;
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  height: 42px;
  padding: 0 10px;
  color: #363a34;
  background: #eef2e5;
  border-bottom: 1px solid var(--line-strong);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-align: left;
  text-transform: uppercase;
}

td {
  padding: 10px;
  border-bottom: 1px solid #ecefe5;
  vertical-align: top;
}

tbody tr:hover {
  background: #fbfcf6;
}

.check-cell {
  width: 42px;
}

.video-cell {
  display: grid;
  grid-template-columns: 72px minmax(220px, 1fr);
  gap: 12px;
  min-width: 360px;
}

.thumb {
  width: 72px;
  aspect-ratio: 9 / 12;
  object-fit: cover;
  background: #e9eddf;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.caption {
  display: -webkit-box;
  max-width: 620px;
  overflow: hidden;
  color: var(--ink);
  font-weight: 700;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.meta-line {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.format-cell {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  min-width: 190px;
}

.format-pill-row {
  align-items: center;
  flex: 1 1 146px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 7px;
  color: #263026;
  background: #eef2e5;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.pill.app {
  background: #ecf7f4;
  border-color: #b8ded7;
  color: #165c53;
}

.pill.format {
  background: #f8f0d0;
  border-color: #e8d46d;
}

.format-tag {
  gap: 4px;
  max-width: min(180px, calc(100% - 21px));
  padding-right: 4px;
}

.format-tag-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tag-remove {
  display: inline-grid;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  place-items: center;
  padding: 0;
  color: var(--coral);
  background: rgba(201, 75, 50, 0.12);
  border: 0;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.75);
  transition: opacity 120ms ease, transform 120ms ease, background-color 120ms ease, color 120ms ease;
}

.format-tag:hover .tag-remove,
.format-tag:focus-within .tag-remove {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.tag-remove:hover,
.tag-remove:focus-visible {
  color: #fff;
  background: var(--coral);
  outline: none;
}

.num {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  font-weight: 700;
  white-space: nowrap;
}

.subtle {
  color: var(--muted);
  font-size: 12px;
}

.row-format-trigger {
  display: inline-grid;
  place-items: center;
  padding: 0;
  color: var(--accent-ink);
  background: var(--accent);
  border: 1px solid #9bb82e;
  border-radius: 50%;
  cursor: pointer;
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  transition: transform 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
}

.row-format-trigger--empty {
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
}

.row-format-trigger--tag {
  width: 16px;
  min-width: 16px;
  height: 16px;
  min-height: 16px;
  flex: 0 0 16px;
  border: 0;
  font-size: 13px;
}

.row-format-trigger:hover,
.row-format-trigger:focus-visible,
.row-format-trigger[aria-expanded="true"] {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(31, 33, 31, 0.12);
  outline: none;
}

.row-format-trigger:disabled {
  cursor: not-allowed;
  opacity: 0.42;
  transform: none;
  box-shadow: none;
}

.row-format-menu {
  position: fixed;
  z-index: 40;
  max-height: min(320px, calc(100vh - 24px));
  padding: 6px;
  overflow: auto;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(169, 177, 157, 0.82);
  border-radius: var(--radius);
  box-shadow: 0 18px 52px rgba(31, 33, 31, 0.22);
  opacity: 0;
  transform: translateY(-4px) scale(0.98);
  transform-origin: top left;
  transition: opacity 120ms ease, transform 120ms ease;
}

.row-format-menu.is-above {
  transform-origin: bottom left;
}

.row-format-menu.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.row-format-menu-header {
  padding: 7px 9px 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.row-format-menu-list {
  display: grid;
  gap: 3px;
}

.row-format-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 36px;
  padding: 7px 9px;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 7px;
  font: inherit;
  text-align: left;
}

.row-format-option:hover,
.row-format-option:focus-visible {
  background: #f1f6dc;
  outline: none;
}

.row-format-option-name {
  min-width: 0;
  overflow: hidden;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-format-option-count {
  color: var(--teal);
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.video-meta-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.video-url-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 2px 7px;
  color: var(--teal);
  background: #ecf7f4;
  border: 1px solid #b8ded7;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
}

.video-url-button:hover {
  color: #fff;
  background: var(--teal);
  border-color: var(--teal);
}

.empty-state {
  display: grid;
  place-items: center;
  gap: 6px;
  min-height: 180px;
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 18px 0 8px;
}

#page-label {
  min-width: 120px;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.formats-layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(360px, 1fr);
  gap: 18px;
  padding: 16px;
}

.format-editor,
.format-list-panel {
  min-width: 0;
}

.format-editor form {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.form-actions,
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-heading span {
  color: var(--muted);
  font-weight: 800;
}

.format-list {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.format-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 5px solid var(--yellow);
  border-radius: var(--radius);
}

.format-item h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

.format-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.35;
}

.format-count {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 28px;
  margin-top: 10px;
  padding: 4px 8px;
  color: var(--accent-ink);
  background: rgba(184, 214, 58, 0.28);
  border: 1px solid rgba(184, 214, 58, 0.64);
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 800;
}

.format-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.mini-action {
  min-height: 32px;
  padding: 5px 8px;
  font-size: 12px;
}

.mini-action.delete {
  color: #8f2518;
  border-color: #e2afa6;
}

.mini-table-wrap {
  margin-top: 14px;
  box-shadow: none;
}

.mini-table td,
.mini-table th {
  padding: 9px 10px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 20;
  max-width: min(420px, calc(100vw - 40px));
  padding: 12px 14px;
  color: #fff;
  background: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .app-shell.sidebar-collapsed {
    grid-template-columns: 1fr;
  }

  .rail {
    position: fixed;
    z-index: 15;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(280px, calc(100vw - 32px));
    height: 100vh;
    display: flex;
    align-items: stretch;
    box-shadow: var(--shadow);
    transform: translateX(0);
  }

  .app-shell.sidebar-collapsed .rail {
    display: flex;
    padding-right: 22px;
    padding-left: 22px;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    transform: translateX(calc(-100% - 16px));
  }

  .nav-tabs {
    grid-auto-flow: row;
  }

  .rail-stats {
    grid-column: auto;
    grid-template-columns: 1fr;
  }

  .filter-band {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .table-wrap {
    overflow: visible;
    background: transparent;
    border: 0;
    box-shadow: none;
  }

  .video-table,
  .video-table tbody,
  .video-table tr,
  .video-table td {
    display: block;
    width: 100%;
  }

  .video-table thead {
    display: none;
  }

  .video-table tbody {
    display: grid;
    gap: 12px;
  }

  .video-table tr {
    position: relative;
    display: grid;
    gap: 10px;
    min-width: 0;
    margin: 0;
    padding: 14px 54px 14px 14px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-left: 5px solid var(--accent);
    border-radius: var(--radius);
    box-shadow: 0 12px 34px rgba(31, 33, 31, 0.1);
  }

  .video-table tr:hover {
    background: var(--panel);
  }

  .video-table td {
    padding: 0;
    border-bottom: 0;
  }

  .video-table td[colspan] {
    color: var(--muted);
    text-align: center;
  }

  .video-table .check-cell {
    position: absolute;
    top: 14px;
    right: 14px;
    width: auto;
  }

  .row-check[type="checkbox"] {
    width: 20px;
    height: 20px;
  }

  .video-detail-cell {
    min-width: 0;
  }

  .video-cell {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 10px;
    min-width: 0;
  }

  .thumb {
    width: 64px;
  }

  .caption {
    max-width: none;
    padding-right: 2px;
    -webkit-line-clamp: 4;
  }

  .video-table td[data-label] {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 10px;
    min-width: 0;
    padding-top: 10px;
    border-top: 1px solid #ecefe5;
  }

  .video-table td[data-label]::before {
    content: attr(data-label);
    grid-column: 1;
    grid-row: 1 / span 4;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.08em;
    line-height: 1.3;
    text-transform: uppercase;
  }

  .video-table td[data-label] > * {
    grid-column: 2;
  }

  .pill-row,
  .format-cell,
  .format-pill-row {
    min-width: 0;
  }

  .format-cell {
    width: 100%;
  }

  .format-tag {
    max-width: 100%;
  }

  .tag-remove {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
  }

  .row-format-trigger--tag {
    width: 28px;
    min-width: 28px;
    height: 28px;
    min-height: 28px;
    font-size: 18px;
  }

  .num {
    font-size: 20px;
  }

}

@media (max-width: 760px) {
  .workspace {
    padding: 14px;
  }

  .topbar,
  .top-actions,
  .action-strip,
  .formats-layout {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    display: grid;
  }

  .title-block {
    align-items: center;
  }

  h1 {
    font-size: clamp(32px, 12vw, 46px);
  }

  .top-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 42px;
    align-items: end;
  }

  .search-box input,
  .action-strip label {
    width: 100%;
  }

  .result-count {
    margin-left: 0;
  }

  .filter-band,
  .formats-layout {
    grid-template-columns: 1fr;
  }

  .filter-band,
  .action-strip,
  .formats-layout {
    box-shadow: 0 12px 34px rgba(31, 33, 31, 0.1);
  }

  .segmented {
    grid-column: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rail {
    padding: 16px;
  }

  .app-shell.sidebar-collapsed .rail {
    padding-right: 16px;
    padding-left: 16px;
  }

  .nav-tabs {
    grid-auto-flow: row;
  }

  .rail-stats {
    grid-template-columns: 1fr;
  }

  .action-strip .primary-button,
  .action-strip .ghost-button {
    width: 100%;
  }

  .formats-layout {
    gap: 14px;
    padding: 14px;
  }

  .format-item {
    grid-template-columns: 1fr;
  }

  .format-actions {
    justify-content: stretch;
  }

  .format-actions .mini-action {
    flex: 1 1 112px;
  }

  .toast {
    right: 14px;
    bottom: 14px;
    max-width: calc(100vw - 28px);
  }
}

@media (max-width: 480px) {
  .workspace {
    padding: 10px;
  }

  .topbar {
    gap: 16px;
  }

  .filter-band,
  .action-strip,
  .formats-layout {
    padding: 12px;
  }

  .video-table tr {
    padding: 12px 44px 12px 12px;
  }

  .video-table .check-cell {
    top: 12px;
    right: 12px;
  }

  .video-cell {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .thumb {
    width: 58px;
  }

  .video-table td[data-label] {
    grid-template-columns: 72px minmax(0, 1fr);
  }

}
