:root {
  color-scheme: light;
  --bg: #f4f7f7;
  --panel: #ffffff;
  --panel-soft: #f8fbfb;
  --ink: #111827;
  --ink-soft: #293544;
  --muted: #71808e;
  --faint: #9aa6b2;
  --line: #dce6e6;
  --line-strong: #c8d6d6;
  --accent: #11777b;
  --accent-dark: #0c6064;
  --navy: #10152c;
  --success: #0c7a5f;
  --success-bg: #eaf7f2;
  --warn-bg: #fff2dc;
  --warn: #926018;
  --shadow: 0 10px 28px rgba(22, 34, 45, 0.07);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

html {
  background: var(--bg);
}

body {
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(235, 244, 245, 0.82)),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

body.is-touch-dragging {
  overflow: hidden;
  user-select: none;
}

body.is-file-dragging {
  overflow: hidden;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

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

.ui-icon {
  display: block;
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.72;
  vector-effect: non-scaling-stroke;
}

.boot,
.login-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 20px;
}

.boot {
  gap: 10px;
  color: var(--navy);
  font-size: 13px;
  font-weight: 850;
}

.login-panel {
  width: min(440px, 100%);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.login-brand {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 22px;
}

.login-brand h1 {
  margin: 0 0 5px;
  color: var(--navy);
  font-size: 28px;
  line-height: 1.05;
}

.login-brand p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.login-error {
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px solid #f0c7c0;
  border-radius: var(--radius);
  background: #fff4f2;
  color: #9a3d32;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: var(--radius);
  background: var(--navy);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.brand-mark.large {
  width: 56px;
  height: 56px;
  font-size: 16px;
}

.shell {
  min-height: 100vh;
  padding: 12px;
}

.topbar {
  position: sticky;
  top: 12px;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 1680px;
  margin: 0 auto 12px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}

.brand-copy strong,
.profile-copy strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-copy small,
.profile-copy small {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.view-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
}

.view-tabs button,
.primary,
.secondary,
.icon-button,
.upload-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 34px;
  border-radius: 7px;
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 800;
}

.view-tabs button {
  padding: 0 10px;
  background: transparent;
  color: var(--muted);
}

.view-tabs button.active {
  background: var(--navy);
  color: #fff;
}

.profile {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  min-width: 0;
}

.profile-avatar {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: #d8eaeb;
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.profile-copy {
  min-width: 0;
  max-width: 130px;
}

.primary {
  padding: 0 13px;
  background: var(--accent);
  color: #fff;
}

.primary:hover,
.upload-button:hover {
  background: var(--accent-dark);
}

.secondary {
  padding: 0 13px;
  background: var(--navy);
  color: #fff;
}

.icon-button {
  width: 34px;
  height: 34px;
  padding: 0;
  border-color: var(--line);
  background: #fff;
  color: var(--ink-soft);
  transition:
    border-color 0.16s ease,
    background-color 0.16s ease,
    color 0.16s ease,
    transform 0.16s ease;
}

.icon-button:hover {
  border-color: var(--line-strong);
  background: #fbfdfd;
  color: var(--accent);
}

.icon-button:active {
  transform: translateY(1px);
}

.wide {
  width: 100%;
}

.notice {
  position: fixed;
  top: 74px;
  left: 50%;
  z-index: 100;
  transform: translateX(-50%);
  max-width: min(460px, calc(100% - 28px));
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--navy);
  color: #fff;
  box-shadow: var(--shadow);
  font-size: 12px;
}

.workspace {
  display: grid;
  grid-template-columns: 276px minmax(0, 1fr);
  gap: 12px;
  max-width: 1680px;
  margin: 0 auto;
}

.sidebar,
.content,
.users-list,
.create-user-panel {
  min-width: 0;
}

.sidebar {
  position: sticky;
  top: 78px;
  align-self: start;
  max-height: calc(100vh - 90px);
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.sidebar-head,
.content-head,
.preview-modal-head,
.preview-modal-foot,
.comments-head,
.user-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sidebar-head {
  margin-bottom: 10px;
}

.sidebar-head h2,
.content-head h1,
.empty-state h2,
.create-user-panel h2,
.soft-panel h3 {
  margin: 0;
  color: var(--ink);
  letter-spacing: 0;
}

.sidebar-head h2 {
  font-size: 16px;
}

.sidebar-head p,
.empty-state p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.folder-tree {
  display: grid;
  gap: 3px;
}

.folder-item {
  display: grid;
  width: 100%;
  min-height: 36px;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 6px 8px 6px calc(8px + var(--depth) * 14px);
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  text-align: left;
}

.folder-item:hover,
.folder-item.active,
.folder-item.drop-target {
  border-color: var(--line);
  background: var(--panel-soft);
}

.folder-item.drop-target {
  outline: 2px solid rgba(17, 119, 123, 0.24);
}

.folder-icon {
  color: var(--accent);
}

.folder-icon .ui-icon {
  width: 18px;
  height: 18px;
}

.folder-name {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.folder-count {
  display: grid;
  min-width: 22px;
  height: 20px;
  place-items: center;
  border-radius: 6px;
  background: #edf3f3;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.soft-panel,
.empty-state,
.user-card,
.create-user-panel form {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
}

.soft-panel {
  margin-top: 8px;
  overflow: hidden;
}

.collapsible-panel summary {
  display: flex;
  min-height: 40px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 10px;
  color: var(--ink);
  cursor: pointer;
  font-size: 12px;
  font-weight: 820;
  list-style: none;
}

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

.collapsible-panel summary span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.collapsible-panel[open] summary .ui-icon:last-child {
  transform: rotate(90deg);
}

.folder-form,
.access-panel,
.login-form,
.comment-form,
.user-card,
.create-user-panel form {
  display: grid;
  gap: 10px;
}

.folder-form,
.access-panel {
  padding: 0 10px 10px;
}

label {
  display: grid;
  gap: 5px;
}

label span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

input,
select,
textarea {
  width: 100%;
  min-height: 34px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  outline: 0;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
}

textarea {
  min-height: 84px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(17, 119, 123, 0.56);
  box-shadow: 0 0 0 3px rgba(17, 119, 123, 0.11);
}

.switch-line,
.mini-users label {
  display: flex;
  align-items: center;
  gap: 7px;
}

.switch-line input,
.mini-users input {
  width: auto;
  min-height: 0;
}

.switch-line span,
.mini-users span {
  color: var(--ink);
  font-size: 12px;
}

.mini-users {
  display: grid;
  gap: 7px;
  max-height: 160px;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-soft);
}

.content {
  display: grid;
  align-content: start;
  gap: 10px;
}

.content-head {
  min-height: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.eyebrow {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.content-head h1 {
  font-size: 22px;
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.content-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.content-title-row h1 {
  min-width: 0;
}

.upload-panel {
  display: flex;
  align-items: end;
  gap: 8px;
}

.date-compact {
  width: 150px;
}

.upload-button {
  position: relative;
  min-width: 142px;
  padding: 0 12px;
  overflow: hidden;
  background: var(--accent);
  color: #fff;
}

.upload-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.upload-button span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #fff;
  white-space: nowrap;
}

.drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 18px;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  background: rgba(244, 247, 247, 0.72);
  backdrop-filter: blur(5px);
  transition: opacity 0.16s ease, visibility 0.16s ease;
}

body.is-file-dragging .drop-overlay {
  opacity: 1;
  visibility: visible;
}

.drop-overlay-card {
  display: grid;
  justify-items: center;
  gap: 8px;
  width: min(420px, 100%);
  padding: 24px;
  border: 1px solid rgba(17, 119, 123, 0.34);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 22px 60px rgba(17, 24, 39, 0.16);
  text-align: center;
}

.drop-overlay-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  background: var(--navy);
  color: #fff;
}

.drop-overlay-card strong {
  font-size: 16px;
}

.drop-overlay-card small {
  color: var(--muted);
  font-size: 12px;
}

.upload-progress {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 130;
  width: min(360px, calc(100vw - 28px));
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 50px rgba(17, 24, 39, 0.16);
}

.upload-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 12px;
}

.upload-progress-head span {
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--muted);
  font-weight: 800;
}

.upload-progress-list {
  display: grid;
  gap: 7px;
}

.upload-progress-item {
  display: grid;
  gap: 6px;
  padding: 8px;
  border-radius: 7px;
  background: var(--panel-soft);
}

.upload-progress-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  font-size: 11px;
}

.upload-progress-copy strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-progress-copy span {
  flex: 0 0 auto;
  color: var(--muted);
  font-weight: 750;
}

.upload-progress-track {
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line);
}

.upload-progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 0.18s ease;
}

.upload-progress-item.done .upload-progress-track span {
  background: var(--success);
}

.upload-progress-item.error .upload-progress-copy span {
  color: #b42318;
}

.upload-progress-item.error .upload-progress-track span {
  width: 100%;
  background: #d92d20;
}

.library-stats,
.preview {
  display: none;
}

.file-list {
  display: grid;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.file-row,
.file-primary {
  display: grid;
  grid-template-columns: 54px minmax(170px, 1.15fr) 96px 124px repeat(3, minmax(104px, 0.72fr)) 118px;
  gap: 8px;
  align-items: center;
}

.file-head {
  min-width: 860px;
  padding: 0 10px 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.file-head span:first-child {
  grid-column: 1 / 3;
}

.file-card {
  min-width: 860px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  cursor: grab;
  touch-action: pan-y;
}

.file-card:hover,
.file-card.selected {
  border-color: rgba(17, 119, 123, 0.42);
}

.file-card:active {
  cursor: grabbing;
}

.video-thumb {
  position: relative;
  display: grid;
  width: 44px;
  height: 70px;
  place-items: center;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: var(--navy);
  color: #fff;
}

.video-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-thumb span {
  position: relative;
  z-index: 1;
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  background: rgba(12, 16, 40, 0.62);
  backdrop-filter: blur(4px);
}

.video-thumb .ui-icon {
  width: 13px;
  height: 13px;
  fill: currentColor;
  stroke: none;
}

.file-main {
  min-width: 0;
}

.file-main h3 {
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.22;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-title-area {
  min-width: 0;
}

.file-title-button {
  display: block;
  width: 100%;
  overflow: hidden;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: text;
  font: inherit;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.22;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-title-button:hover {
  color: var(--accent);
}

.file-title-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px 28px;
  gap: 4px;
  align-items: center;
}

.file-title-form input {
  width: 100%;
  min-width: 0;
  height: 30px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  border-radius: 8px;
  padding: 0 9px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.file-title-form .icon-button {
  width: 28px;
  height: 28px;
  min-height: 28px;
  border-radius: 8px;
}

.file-main p {
  margin: 3px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-status {
  display: inline-flex;
  margin-top: 5px;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--warn-bg);
  color: var(--warn);
  font-size: 10px;
  font-weight: 820;
}

.file-status.complete {
  background: var(--success-bg);
  color: var(--success);
}

.date-read {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.date-read span,
.date-read small {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.date-read strong {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.publication-inline {
  display: grid;
  gap: 4px;
  margin-top: 5px;
}

.publication-inline b {
  display: block;
  color: var(--ink);
  font-size: 11px;
  font-weight: 850;
  line-height: 1.15;
}

.publication-inline span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.publication-inline input {
  width: 100%;
  min-height: 30px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 8px;
  padding: 5px 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 10.5px;
}

.publication-inline input:disabled {
  opacity: 0.62;
  background: rgba(15, 23, 42, 0.03);
}

.date-cell span {
  display: none;
}

.date-cell input {
  min-height: 32px;
  padding: 6px 7px;
}

.approval {
  display: grid;
  min-height: 38px;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  padding: 6px 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-soft);
}

.approval.approved {
  border-color: rgba(12, 122, 95, 0.34);
  background: var(--success-bg);
}

.approval input {
  width: 14px;
  height: 14px;
  min-height: 0;
  accent-color: var(--success);
}

.approval-copy {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.approval strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 11px;
  font-weight: 820;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.approval small {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.approval.large {
  min-height: 42px;
}

.file-actions {
  display: flex;
  gap: 6px;
  justify-content: center;
}

.download-icon,
.file-actions .icon-button {
  width: 34px;
  height: 34px;
}

.danger-icon {
  color: #b42318;
}

.danger-icon:hover {
  border-color: rgba(180, 35, 24, 0.28);
  color: #b42318;
}

.share-icon {
  color: var(--ink-soft);
}

.mobile-move {
  display: none;
}

.file-comments-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: start;
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px solid rgba(128, 145, 161, 0.2);
}

.comment-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.comment-label .ui-icon {
  width: 13px;
  height: 13px;
}

.inline-comment {
  margin: 3px 0 0;
  color: #3b4652;
  font-size: 11px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.inline-comment strong {
  margin-right: 5px;
  color: var(--navy);
}

.inline-comment.muted {
  color: var(--faint);
}

.inline-comments-list {
  display: grid;
  gap: 8px;
  max-height: 168px;
  margin-top: 7px;
  overflow: auto;
  padding-right: 4px;
}

.inline-comment-item {
  padding: 0;
  border: 0;
  background: transparent;
}

.inline-comment-item .inline-comment {
  margin: 0;
}

.inline-comment-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.inline-comment-item time {
  display: block;
  margin-top: 3px;
  color: var(--faint);
  font-size: 9px;
  line-height: 1.2;
}

.comment-actions {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 3px;
}

.comment-actions button {
  display: inline-grid;
  width: 22px;
  height: 22px;
  place-items: center;
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
}

.comment-actions button:hover {
  background: rgba(17, 119, 123, 0.08);
  color: var(--accent);
}

.comment-actions button.danger:hover {
  background: #fff4f2;
  color: #b94437;
}

.comment-actions .ui-icon {
  width: 13px;
  height: 13px;
  stroke-width: 1.8;
}

.comment-replies {
  display: grid;
  gap: 7px;
  margin-top: 7px;
  padding-left: 16px;
}

.inline-comment-form {
  display: grid;
  gap: 6px;
  width: 100%;
}

.comment-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 6px;
}

.inline-comment-form input {
  min-height: 34px;
  font-size: 11px;
}

.inline-comment-form .icon-button {
  width: 34px;
  height: 34px;
}

.edit-comment-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px 34px;
  gap: 6px;
  margin-top: 6px;
}

.edit-comment-form input {
  min-height: 34px;
  font-size: 11px;
}

.edit-comment-form .icon-button {
  width: 34px;
  height: 34px;
}

.reply-context {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 24px;
  padding: 0 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.reply-context button {
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
}

.reply-context button:hover {
  color: var(--accent);
}

.empty-state {
  padding: 18px;
  box-shadow: var(--shadow);
}

.empty-state h2 {
  font-size: 15px;
}

.empty.small {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.preview-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(9, 13, 26, 0.64);
}

.preview-modal {
  display: grid;
  gap: 10px;
  width: min(760px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.28);
}

.preview-title-block {
  min-width: 0;
  flex: 1 1 auto;
}

.preview-modal-head h2,
.preview-modal-head h3,
.preview-modal-head .file-title-button {
  margin: 0;
  width: 100%;
  color: var(--ink);
  font-size: 15px;
  font-weight: 850;
  line-height: 1.25;
  white-space: normal;
  overflow-wrap: anywhere;
}

.preview-modal-head .file-title-button {
  cursor: text;
}

.preview-modal-head .file-title-button:hover {
  color: var(--accent);
}

.preview-modal-head .file-title-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px 30px;
  gap: 6px;
  align-items: center;
}

.preview-modal-head .file-title-form input {
  height: 32px;
  font-size: 14px;
}

.preview-modal-head p,
.preview-modal-foot span {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.preview-modal-head .icon-button {
  flex: 0 0 auto;
  font-size: 20px;
  line-height: 1;
}

.preview-modal video {
  display: block;
  width: min(280px, 100%);
  justify-self: center;
  aspect-ratio: 9 / 16;
  border-radius: var(--radius);
  background: #090d1a;
  object-fit: contain;
}

.preview-approval-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.preview-comments {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
}

.preview-modal-foot .primary {
  width: auto;
  min-width: 156px;
}

.users-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 12px;
  max-width: 1680px;
  margin: 0 auto;
}

.content-head.compact {
  margin-bottom: 10px;
}

.user-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}

.user-card,
.create-user-panel form {
  padding: 12px;
  box-shadow: var(--shadow);
}

.user-card-head strong {
  color: var(--ink);
  font-size: 13px;
}

.user-card-head span {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.create-user-panel {
  position: sticky;
  top: 78px;
  align-self: start;
}

.create-user-panel h2 {
  font-size: 16px;
}

.drag-ghost {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  max-width: 260px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--navy);
  color: #fff;
  box-shadow: var(--shadow);
  font-size: 12px;
  font-weight: 820;
  pointer-events: none;
  transform: translate(-999px, -999px);
}

.native-drag-ghost {
  transform: translate(0, 0);
}

.hidden-native-drag-ghost {
  opacity: 0;
}

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: 248px minmax(0, 1fr);
  }

  .file-row,
  .file-primary {
    grid-template-columns: 52px minmax(150px, 1fr) 90px 118px repeat(3, minmax(96px, 0.7fr)) 36px;
  }

  .file-head,
  .file-card {
    min-width: 820px;
  }
}

@media (max-width: 900px) {
  .shell {
    padding: 8px;
  }

  .topbar {
    top: 8px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    margin-bottom: 8px;
  }

  .brand {
    grid-column: 1;
    grid-row: 1;
  }

  .profile {
    grid-column: 2;
    grid-row: 1;
  }

  .brand-copy small,
  .profile-copy {
    display: none;
  }

  .view-tabs {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
  }

  .view-tabs button {
    flex: 1;
  }

  .workspace,
  .users-layout {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .sidebar,
  .create-user-panel {
    position: static;
    max-height: none;
  }

  .content-head {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .content-head h1 {
    font-size: 20px;
  }

  .upload-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .date-compact,
  .upload-button {
    width: 100%;
  }

  .file-head {
    display: none;
  }

  .file-list {
    overflow: visible;
  }

  .file-card {
    min-width: 0;
    padding: 10px;
  }

  .file-primary {
    min-width: 0;
    grid-template-columns: 50px minmax(0, 1fr) 118px;
    gap: 9px;
  }

  .video-thumb {
    width: 46px;
    height: 72px;
    grid-row: 1 / 4;
  }

  .file-main {
    align-self: start;
  }

  .file-main h3 {
    white-space: normal;
  }

  .file-actions {
    grid-column: 3;
    grid-row: 1;
  }

  .date-read,
  .date-cell {
    grid-column: 2 / 4;
  }

  .date-cell span {
    display: block;
  }

  .approval {
    grid-column: 1 / -1;
    min-height: 36px;
  }

  .file-comments-row,
  .preview-comments {
    grid-template-columns: 1fr;
  }

  .preview-backdrop {
    align-items: end;
    padding: 8px;
  }

  .preview-modal {
    width: 100%;
    max-height: calc(100vh - 16px);
  }

  .preview-modal video {
    width: min(240px, 100%);
  }

  .preview-approval-strip {
    grid-template-columns: 1fr;
  }

  .preview-modal-foot {
    align-items: stretch;
    flex-direction: column;
  }

  .preview-modal-foot .primary {
    width: 100%;
  }
}

/* Refined 2026 interface layer */
:root {
  --bg: #f7f7f8;
  --panel: #ffffff;
  --panel-soft: #fbfbfc;
  --ink: #0f1320;
  --ink-soft: #343946;
  --muted: #6f7480;
  --faint: #a4a9b3;
  --line: #e2e4e8;
  --line-strong: #d4d7de;
  --accent: #ef153e;
  --accent-dark: #d90f34;
  --navy: #111426;
  --success: #118062;
  --success-bg: #eaf7f2;
  --warn-bg: #ffe8ee;
  --warn: #ef153e;
  --shadow: 0 10px 28px rgba(15, 19, 32, 0.04);
  --shadow-strong: 0 18px 50px rgba(15, 19, 32, 0.08);
  --radius: 8px;
}

html {
  background: var(--bg);
}

body {
  background: var(--bg);
}

.shell {
  padding: 0 16px 24px;
}

.topbar {
  top: 0;
  max-width: none;
  margin: 0 -16px 20px;
  padding: 14px 24px;
  border-width: 0 0 1px;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: none;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: var(--accent);
  box-shadow: 0 8px 18px rgba(239, 21, 62, 0.16);
  font-size: 15px;
}

.brand-copy strong {
  font-size: 17px;
  letter-spacing: 0.01em;
}

.brand-copy strong span {
  color: var(--accent);
}

.brand-copy small,
.profile-copy small {
  margin-top: 3px;
  font-size: 12px;
}

.view-tabs {
  gap: 10px;
  padding: 0;
}

.view-tabs button,
.primary,
.secondary,
.icon-button,
.upload-button {
  min-height: 42px;
  border-radius: 8px;
  font-size: 13px;
}

.view-tabs button {
  padding: 0 20px;
  border-color: transparent;
  color: #5d626d;
  font-weight: 800;
}

.view-tabs button.active {
  border-color: var(--line);
  background: #fff;
  color: var(--accent);
  box-shadow: 0 8px 20px rgba(15, 19, 32, 0.04);
}

.profile {
  gap: 12px;
}

.notifications-wrap {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
}

.notification-button {
  position: relative;
}

.notification-button.active,
.notification-button:hover {
  border-color: rgba(239, 21, 62, 0.28);
  color: var(--accent);
}

.notification-button strong {
  position: absolute;
  top: -5px;
  right: -5px;
  display: grid;
  min-width: 17px;
  height: 17px;
  place-items: center;
  padding: 0 5px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
}

.notifications-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 80;
  width: min(340px, calc(100vw - 24px));
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 52px rgba(15, 19, 32, 0.14);
}

.notifications-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 2px 2px 8px;
  color: var(--ink);
  font-size: 12px;
}

.notifications-head span {
  display: grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 999px;
  background: #f2f3f5;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.notifications-list {
  display: grid;
  gap: 4px;
  max-height: 360px;
  overflow: auto;
}

.notification-item {
  display: grid;
  width: 100%;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  padding: 9px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  text-align: left;
}

.notification-item:hover {
  background: #f7f8fa;
}

.notification-item span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.notification-item b {
  color: var(--ink);
  font-size: 12px;
  line-height: 1.2;
}

.notification-item small,
.notification-item em,
.notifications-menu p {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.notification-item em {
  overflow: hidden;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notifications-menu p {
  margin: 6px 2px 2px;
}

.profile-avatar {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(239, 21, 62, 0.74);
  background: #fff;
  color: var(--accent);
  font-size: 13px;
}

.profile-copy strong {
  font-size: 14px;
}

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

.icon-button:hover {
  border-color: rgba(239, 21, 62, 0.32);
  color: var(--accent);
}

.primary,
.upload-button {
  background: var(--accent);
  color: #fff;
}

.primary:hover,
.upload-button:hover {
  background: var(--accent-dark);
}

.secondary {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
}

.workspace {
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 18px;
  max-width: none;
}

.sidebar,
.content-head,
.file-card,
.empty-state,
.soft-panel,
.user-card,
.create-user-panel form {
  border-color: var(--line);
  background: #fff;
  box-shadow: none;
}

.sidebar {
  top: 92px;
  padding: 18px;
}

.sidebar-head {
  margin-bottom: 18px;
}

.sidebar-head h2 {
  font-size: 21px;
}

.sidebar-head p {
  font-size: 14px;
}

.folder-tree {
  gap: 7px;
}

.folder-item {
  min-height: 42px;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  padding: 7px 12px 7px calc(12px + var(--depth) * 22px);
  border-radius: 8px;
}

.folder-item:hover,
.folder-item.active,
.folder-item.drop-target {
  border-color: transparent;
  background: #f6f7f9;
}

.folder-item.active {
  border-color: rgba(239, 21, 62, 0.12);
  background: #fff1f4;
}

.folder-item.active .folder-icon,
.folder-item.active .folder-name {
  color: var(--accent);
}

.folder-icon {
  color: var(--ink);
}

.folder-name {
  font-size: 14px;
  font-weight: 780;
}

.folder-count {
  min-width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f4f5f7;
  color: var(--ink-soft);
  font-size: 13px;
}

.collapsible-panel {
  margin-top: 14px;
}

.collapsible-panel summary {
  min-height: 48px;
  padding: 0 14px;
  font-size: 14px;
}

input,
select,
textarea {
  min-height: 42px;
  border-radius: 8px;
  font-size: 14px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(239, 21, 62, 0.42);
  box-shadow: 0 0 0 3px rgba(239, 21, 62, 0.08);
}

.content {
  gap: 14px;
}

.content-head {
  min-height: 108px;
  padding: 20px 26px;
}

.eyebrow {
  margin-bottom: 8px;
  font-size: 11px;
}

.content-head h1 {
  font-size: 24px;
}

.content-title-row .icon-button {
  width: 48px;
  height: 48px;
}

.upload-panel {
  gap: 14px;
}

.date-compact {
  width: 214px;
}

.upload-button {
  min-width: 166px;
  padding: 0 22px;
}

.file-list {
  gap: 8px;
  overflow-x: auto;
}

.file-row,
.file-primary {
  grid-template-columns: 74px minmax(190px, 1.25fr) 138px 154px repeat(3, minmax(148px, 0.82fr)) 150px;
  gap: 14px;
}

.file-head {
  min-width: 1240px;
  padding: 0 18px 2px;
  color: #5e6370;
  font-size: 11px;
}

.file-card {
  min-width: 1240px;
  padding: 18px;
  border-radius: 8px;
  cursor: default;
}

.file-card:hover,
.file-card.selected {
  border-color: var(--line-strong);
  box-shadow: 0 12px 26px rgba(15, 19, 32, 0.04);
}

.video-thumb {
  width: 58px;
  height: 78px;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, #f3f4f6, #e6e8ec);
  color: #000;
}

.video-thumb span {
  width: 28px;
  height: 28px;
  background: rgba(255, 255, 255, 0.72);
  color: #000;
}

.file-main h3 {
  font-size: 14px;
  font-weight: 850;
}

.file-main p {
  margin-top: 5px;
  font-size: 13px;
}

.file-status {
  margin-top: 7px;
  padding: 3px 8px;
  border-radius: 8px;
  background: #ffe8ee;
  color: var(--accent);
  font-size: 12px;
}

.date-read span {
  display: none;
}

.date-read strong {
  color: var(--ink);
  font-size: 13px;
}

.date-read small {
  margin-top: 4px;
  font-size: 12px;
}

.date-cell input {
  min-height: 42px;
  padding: 8px 12px;
}

.approval {
  min-height: 48px;
  padding: 0 12px;
  border-width: 0 0 0 1px;
  border-radius: 0;
  background: transparent;
}

.approval.approved {
  background: transparent;
}

.approval input {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
}

.approval strong {
  font-size: 12px;
}

.approval small {
  font-size: 11px;
}

.file-actions {
  justify-content: flex-end;
  gap: 8px;
}

.download-icon,
.file-actions .icon-button {
  width: 42px;
  height: 42px;
}

.danger-icon {
  color: var(--accent);
}

.danger-icon:hover {
  border-color: rgba(239, 21, 62, 0.24);
  background: #fff6f8;
  color: var(--accent);
}

.file-comments-row {
  margin-top: 14px;
  padding-top: 14px;
  border-top-color: var(--line);
}

.comment-label {
  font-size: 11px;
  letter-spacing: 0.04em;
}

.inline-comment,
.inline-comment-form input,
.edit-comment-form input {
  font-size: 12px;
}

.comment-input-row {
  grid-template-columns: minmax(0, 1fr) 42px;
  position: relative;
}

.inline-comment-form .icon-button,
.edit-comment-form .icon-button {
  width: 42px;
  height: 42px;
}

.mention-suggest {
  position: absolute;
  left: 0;
  right: 48px;
  bottom: calc(100% + 6px);
  z-index: 40;
  display: grid;
  gap: 3px;
  max-height: 240px;
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 14px 36px rgba(15, 19, 32, 0.12);
}

.mention-suggest[hidden] {
  display: none;
}

.mention-suggest button {
  display: grid;
  width: 100%;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 7px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  text-align: left;
}

.mention-suggest button:hover,
.mention-suggest button.active {
  background: #f6f7f9;
}

.mention-suggest button span {
  display: grid;
  min-width: 0;
}

.mention-suggest strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mention-suggest small {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mention-token {
  display: inline;
  color: var(--accent);
  font-weight: 850;
}

.inline-comment-item.highlighted .comment-bubble {
  animation: comment-highlight 2.4s ease;
}

@keyframes comment-highlight {
  0% {
    background: #fff1f4;
    box-shadow: 0 0 0 3px rgba(239, 21, 62, 0.09);
  }
  100% {
    background: transparent;
    box-shadow: none;
  }
}

.preview-backdrop {
  background: rgba(15, 19, 32, 0.58);
  backdrop-filter: blur(8px);
}

.preview-modal {
  width: min(860px, 100%);
  padding: 16px;
  border-color: var(--line);
  box-shadow: var(--shadow-strong);
}

.preview-modal video {
  width: min(310px, 100%);
}

.drop-overlay {
  background: rgba(255, 255, 255, 0.72);
}

.drop-overlay-card {
  border-color: rgba(239, 21, 62, 0.24);
}

.drop-overlay-icon,
.drag-ghost {
  background: var(--accent);
}

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: 300px minmax(0, 1fr);
  }

  .file-row,
  .file-primary {
    grid-template-columns: 70px minmax(180px, 1.1fr) 128px 146px repeat(3, minmax(136px, 0.78fr)) 142px;
  }

  .file-head,
  .file-card {
    min-width: 1160px;
  }
}

@media (max-width: 900px) {
  .shell {
    padding: 0 10px 18px;
  }

  .topbar {
    top: 0;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    margin: 0 -10px 12px;
    padding: 10px;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
    font-size: 12px;
  }

  .brand-copy strong {
    font-size: 14px;
  }

  .view-tabs {
    gap: 6px;
  }

  .view-tabs button {
    min-height: 40px;
    padding: 0 10px;
  }

  .profile-avatar {
    width: 38px;
    height: 38px;
  }

  .workspace,
  .users-layout {
    gap: 10px;
  }

  .sidebar {
    padding: 14px;
  }

  .sidebar-head h2 {
    font-size: 20px;
  }

  .content-head {
    min-height: 0;
    padding: 16px;
  }

  .content-head h1 {
    font-size: 22px;
  }

  .content-title-row {
    justify-content: space-between;
  }

  .content-title-row .icon-button {
    width: 42px;
    height: 42px;
  }

  .file-list {
    gap: 10px;
  }

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

  .file-primary {
    min-width: 0;
    grid-template-columns: 62px minmax(0, 1fr) auto;
    gap: 12px;
  }

  .video-thumb {
    width: 58px;
    height: 82px;
  }

  .file-actions {
    align-self: start;
    grid-column: 3;
    grid-row: 1;
    gap: 6px;
  }

  .download-icon,
  .file-actions .icon-button {
    width: 36px;
    height: 36px;
  }

  .date-read,
  .date-cell {
    grid-column: 1 / -1;
  }

  .date-read {
    grid-template-columns: auto auto;
    justify-content: start;
    gap: 6px 10px;
  }

  .date-read strong,
  .date-read small {
    font-size: 12px;
  }

  .approval {
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-soft);
  }

  .approval.approved {
    background: var(--success-bg);
  }

  .file-comments-row {
    gap: 8px;
  }
}

/* Compact fit layer */
.shell {
  padding: 0 12px 18px;
}

.topbar {
  margin: 0 -12px 14px;
  padding: 8px 18px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  font-size: 12px;
}

.brand-copy strong {
  font-size: 14px;
}

.brand-copy small,
.profile-copy small {
  font-size: 11px;
}

.view-tabs button,
.primary,
.secondary,
.icon-button,
.upload-button {
  min-height: 34px;
  border-radius: 7px;
  font-size: 12px;
}

.view-tabs button {
  padding: 0 14px;
}

.profile-avatar {
  width: 34px;
  height: 34px;
  font-size: 11px;
}

.profile-copy strong {
  font-size: 12px;
}

.workspace {
  grid-template-columns: 258px minmax(0, 1fr);
  gap: 12px;
}

.sidebar {
  top: 66px;
  padding: 12px;
}

.sidebar-head {
  margin-bottom: 10px;
}

.sidebar-head h2 {
  font-size: 17px;
}

.sidebar-head p {
  font-size: 12px;
}

.folder-tree {
  gap: 4px;
}

.folder-item {
  min-height: 34px;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  padding: 5px 8px 5px calc(8px + var(--depth) * 16px);
}

.folder-name {
  font-size: 12px;
}

.folder-count {
  min-width: 24px;
  height: 24px;
  font-size: 11px;
}

.collapsible-panel {
  margin-top: 8px;
}

.collapsible-panel summary {
  min-height: 38px;
  padding: 0 10px;
  font-size: 12px;
}

input,
select,
textarea {
  min-height: 34px;
  padding: 6px 9px;
  font-size: 12px;
}

.content {
  gap: 8px;
}

.content-head {
  min-height: 72px;
  padding: 12px 16px;
}

.eyebrow {
  margin-bottom: 4px;
  font-size: 9px;
}

.content-head h1 {
  font-size: 19px;
}

.content-title-row .icon-button {
  width: 36px;
  height: 36px;
}

.upload-panel {
  gap: 8px;
}

.date-compact {
  width: 170px;
}

.upload-button {
  min-width: 150px;
  padding: 0 14px;
}

.file-list {
  gap: 6px;
}

.file-row,
.file-primary {
  grid-template-columns: 50px minmax(160px, 1.08fr) 106px 118px repeat(3, minmax(112px, 0.7fr)) 116px;
  gap: 8px;
}

.file-head {
  min-width: 918px;
  padding: 0 10px 2px;
  font-size: 9px;
}

.file-card {
  min-width: 918px;
  padding: 9px 10px;
}

.video-thumb {
  width: 42px;
  height: 64px;
}

.video-thumb span {
  width: 24px;
  height: 24px;
}

.file-main h3 {
  font-size: 12px;
}

.file-main p {
  margin-top: 3px;
  font-size: 11px;
}

.file-status {
  margin-top: 4px;
  padding: 2px 6px;
  font-size: 10px;
}

.date-read strong {
  font-size: 11px;
}

.date-read small {
  margin-top: 2px;
  font-size: 10px;
}

.date-cell input {
  min-height: 34px;
  padding: 6px 8px;
}

.approval {
  min-height: 36px;
  padding: 0 8px;
  grid-template-columns: 15px minmax(0, 1fr);
}

.approval input {
  width: 13px;
  height: 13px;
}

.approval strong {
  font-size: 10px;
}

.approval small {
  font-size: 9px;
}

.file-actions {
  gap: 5px;
}

.download-icon,
.file-actions .icon-button {
  width: 34px;
  height: 34px;
}

.file-comments-row {
  margin-top: 8px;
  padding-top: 8px;
  gap: 6px;
}

.comment-label {
  font-size: 9px;
}

.inline-comment,
.inline-comment-form input,
.edit-comment-form input {
  font-size: 11px;
}

.comment-input-row {
  grid-template-columns: minmax(0, 1fr) 34px;
}

.inline-comment-form .icon-button,
.edit-comment-form .icon-button {
  width: 34px;
  height: 34px;
}

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: 238px minmax(0, 1fr);
  }

  .file-row,
  .file-primary {
    grid-template-columns: 48px minmax(145px, 1fr) 98px 112px repeat(3, minmax(102px, 0.68fr)) 108px;
  }

  .file-head,
  .file-card {
    min-width: 850px;
  }
}

@media (max-width: 900px) {
  .shell {
    padding: 0 8px 14px;
  }

  .topbar {
    margin: 0 -8px 8px;
    padding: 8px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
    font-size: 11px;
  }

  .brand-copy strong {
    font-size: 12px;
  }

  .view-tabs button {
    min-height: 34px;
    padding: 0 8px;
  }

  .profile-avatar {
    width: 32px;
    height: 32px;
  }

  .sidebar {
    padding: 10px;
  }

  .sidebar-head h2 {
    font-size: 17px;
  }

  .content-head {
    padding: 12px;
  }

  .content-head h1 {
    font-size: 18px;
  }

  .file-card {
    min-width: 0;
    padding: 10px;
  }

  .file-primary {
    min-width: 0;
    grid-template-columns: 50px minmax(0, 1fr) auto;
    gap: 8px;
  }

  .video-thumb {
    width: 46px;
    height: 68px;
  }

  .download-icon,
  .file-actions .icon-button {
    width: 32px;
    height: 32px;
  }

  .approval {
    min-height: 36px;
  }
}

@media (max-width: 560px) {
  .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .brand-copy strong {
    max-width: 150px;
  }

  .profile {
    gap: 6px;
  }

  .profile .icon-button {
    width: 32px;
    height: 32px;
  }

  .view-tabs button span {
    font-size: 11px;
  }

  .workspace,
  .content,
  .file-list {
    min-width: 0;
  }

  .folder-item {
    grid-template-columns: 22px minmax(0, 1fr) 24px;
  }

  .content-head {
    gap: 10px;
  }

  .upload-panel {
    gap: 8px;
  }

  .file-primary {
    grid-template-columns: 48px minmax(0, 1fr);
    align-items: start;
  }

  .video-thumb {
    grid-column: 1;
    grid-row: 1 / 3;
    width: 44px;
    height: 64px;
  }

  .file-main {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
  }

  .file-main h3 {
    font-size: 12px;
    white-space: normal;
  }

  .file-actions {
    grid-column: 2;
    grid-row: 2;
    justify-content: start;
    margin-top: 6px;
  }

  .date-read,
  .date-cell,
  .approval {
    grid-column: 1 / -1;
  }

  .date-read {
    margin-top: 4px;
  }

  .date-cell input {
    font-size: 12px;
  }

  .approval {
    padding: 7px 8px;
  }

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

  .approval small {
    white-space: normal;
  }

  .file-comments-row {
    overflow: hidden;
  }

  .inline-comment-form {
    min-width: 0;
    overflow: hidden;
  }

  .comment-input-row {
    grid-template-columns: minmax(0, 1fr) 36px;
    width: 100%;
    min-width: 0;
  }

  .inline-comment-form .icon-button,
  .edit-comment-form .icon-button {
    width: 36px;
    height: 36px;
  }

  .preview-modal {
    padding: 10px;
  }
}

/* Dedicated mobile UX */
@media (max-width: 760px) {
  body {
    overflow-x: hidden;
  }

  .shell {
    width: 100%;
    padding: 0 8px 14px;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 60;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    margin: 0 -8px 8px;
    padding: 8px;
  }

  .brand {
    min-width: 0;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 7px;
    font-size: 11px;
  }

  .brand-copy strong {
    max-width: 142px;
    font-size: 12px;
  }

  .brand-copy small {
    display: none;
  }

  .profile {
    gap: 6px;
  }

  .profile-avatar {
    width: 32px;
    height: 32px;
    font-size: 10px;
  }

  .profile-copy {
    display: none;
  }

  .profile .icon-button {
    width: 32px;
    height: 32px;
  }

  .view-tabs {
    grid-column: 1 / -1;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 1px;
  }

  .view-tabs button {
    flex: 1 0 auto;
    min-height: 34px;
    padding: 0 10px;
    font-size: 11px;
  }

  .workspace,
  .users-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    width: 100%;
    min-width: 0;
  }

  .sidebar {
    position: static;
    max-height: none;
    padding: 10px;
    border-radius: 8px;
  }

  .sidebar-head {
    margin-bottom: 8px;
  }

  .sidebar-head h2 {
    font-size: 16px;
  }

  .sidebar-head p {
    font-size: 11px;
  }

  .sidebar-head .icon-button {
    width: 34px;
    height: 34px;
  }

  .folder-tree {
    display: grid;
    gap: 4px;
    max-height: 220px;
    overflow: auto;
    padding-right: 2px;
  }

  .folder-item {
    min-height: 34px;
    grid-template-columns: 22px minmax(0, 1fr) 24px;
    gap: 7px;
    padding: 5px 8px 5px calc(8px + var(--depth) * 14px);
  }

  .folder-name {
    font-size: 12px;
  }

  .folder-count {
    min-width: 24px;
    height: 24px;
    font-size: 10px;
  }

  .collapsible-panel summary {
    min-height: 36px;
    font-size: 12px;
  }

  .mini-users {
    max-height: 128px;
  }

  .content {
    gap: 8px;
    min-width: 0;
  }

  .content-head {
    display: grid;
    gap: 10px;
    min-height: 0;
    padding: 12px;
    border-radius: 8px;
  }

  .eyebrow {
    margin-bottom: 3px;
    font-size: 9px;
  }

  .content-title-row {
    justify-content: space-between;
    gap: 8px;
  }

  .content-title-row h1 {
    font-size: 18px;
    line-height: 1.1;
  }

  .content-title-row .icon-button {
    width: 34px;
    height: 34px;
  }

  .upload-panel {
    display: grid;
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .date-compact,
  .upload-button {
    width: 100%;
    min-width: 0;
  }

  input,
  select,
  textarea {
    min-height: 36px;
    font-size: 16px;
  }

  .file-list {
    display: grid;
    gap: 8px;
    min-width: 0;
    overflow: visible;
  }

  .file-head {
    display: none;
  }

  .file-card {
    min-width: 0;
    width: 100%;
    padding: 10px;
    overflow: hidden;
    border-radius: 8px;
  }

  .file-row,
  .file-primary {
    min-width: 0;
  }

  .file-primary {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 8px;
    align-items: start;
  }

  .video-thumb {
    grid-column: 1;
    grid-row: 1 / 3;
    width: 44px;
    height: 64px;
  }

  .video-thumb span {
    width: 22px;
    height: 22px;
  }

  .file-main {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
  }

  .file-main h3 {
    display: -webkit-box;
    overflow: hidden;
    font-size: 12px;
    line-height: 1.25;
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .file-main p {
    font-size: 10px;
  }

  .file-status {
    font-size: 10px;
  }

  .file-actions {
    grid-column: 2;
    grid-row: 2;
    justify-content: start;
    gap: 5px;
    margin-top: 5px;
  }

  .download-icon,
  .file-actions .icon-button {
    width: 32px;
    height: 32px;
  }

  .date-read,
  .date-cell,
  .approval {
    grid-column: 1 / -1;
  }

  .date-read {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 8px;
    margin-top: 8px;
  }

  .date-read strong,
  .date-read small {
    font-size: 11px;
  }

  .date-cell {
    margin-top: 2px;
  }

  .date-cell span {
    display: block;
  }

  .date-cell input {
    min-height: 36px;
  }

  .approval {
    min-height: 38px;
    grid-template-columns: 18px minmax(0, 1fr);
    padding: 7px 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-soft);
  }

  .approval.approved {
    background: var(--success-bg);
  }

  .approval strong {
    font-size: 11px;
  }

  .approval small {
    display: block;
    overflow: hidden;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .file-comments-row {
    display: grid;
    gap: 7px;
    margin-top: 8px;
    padding-top: 8px;
    overflow: hidden;
  }

  .comment-label {
    font-size: 9px;
  }

  .inline-comments-list {
    max-height: 150px;
  }

  .inline-comment {
    font-size: 11px;
  }

  .comment-input-row {
    grid-template-columns: minmax(0, 1fr) 36px;
    gap: 5px;
    width: 100%;
    min-width: 0;
  }

  .inline-comment-form input {
    min-width: 0;
    min-height: 36px;
    padding: 6px 10px;
    font-size: 16px;
  }

  .inline-comment-form .icon-button,
  .edit-comment-form .icon-button {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
  }

  .preview-backdrop {
    align-items: end;
    padding: 6px;
  }

  .preview-modal {
    width: 100%;
    max-height: calc(100vh - 12px);
    padding: 10px;
  }

  .preview-modal-head,
  .preview-modal-foot {
    align-items: stretch;
    flex-direction: column;
  }

  .preview-modal video {
    width: min(220px, 100%);
  }

  .preview-approval-strip {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .upload-progress {
    right: 8px;
    bottom: 8px;
    width: calc(100vw - 16px);
  }
}

/* Comment decision marks */
.comment-actions button.accept:hover,
.comment-actions button.accept.active {
  background: #eaf7f2;
  color: var(--success);
}

.comment-actions button.reject:hover,
.comment-actions button.reject.active {
  background: #fff1f4;
  color: var(--accent);
}

.comment-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: fit-content;
  margin-top: 5px;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
  line-height: 1.2;
}

.comment-status .ui-icon {
  width: 11px;
  height: 11px;
}

.comment-status small {
  color: inherit;
  font-size: 9px;
  font-weight: 650;
  opacity: 0.72;
}

.comment-status.accepted {
  background: #eaf7f2;
  color: var(--success);
}

.comment-status.rejected {
  background: #fff1f4;
  color: var(--accent);
}

.video-thumb.thumb-pending::after {
  content: "Готовится";
  position: absolute;
  inset: auto 6px 6px;
  z-index: 2;
  padding: 3px 4px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  text-align: center;
}

.file-updated,
.file-published {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-published {
  color: #6b7280;
}

/* Full-height file thumbnails */
.file-primary {
  grid-template-columns: 108px minmax(170px, 1.16fr) 106px repeat(3, minmax(112px, 0.7fr)) 154px;
  align-items: stretch;
}

.file-card {
  padding: 8px 10px;
}

.video-thumb {
  position: relative;
  width: 98px;
  height: auto;
  min-height: 130px;
  align-self: stretch;
}

.file-thumb-stack {
  display: grid;
  align-self: start;
  gap: 6px;
  grid-template-rows: 130px 26px;
  width: 98px;
}

.file-thumb-stack .video-thumb {
  width: 100%;
  height: 130px;
  min-height: 130px;
}

.thumb-add-media {
  width: 100%;
  height: 26px;
  min-height: 26px;
  border-radius: 8px;
  color: var(--accent);
}

.thumb-add-media .ui-icon {
  width: 14px;
  height: 14px;
}

.video-thumb span {
  display: none;
}

.video-thumb img {
  object-fit: cover;
}

.video-thumb em {
  position: absolute;
  right: 6px;
  bottom: 6px;
  border-radius: 999px;
  padding: 3px 7px;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  font-size: 9px;
  font-style: normal;
  font-weight: 850;
  line-height: 1;
}

.file-main,
.date-read,
.date-cell,
.approval,
.file-actions {
  align-self: center;
}

.file-comments-row {
  margin-left: 108px;
}

.file-head {
  grid-template-columns: 108px minmax(170px, 1.16fr) 106px repeat(3, minmax(112px, 0.7fr)) 154px;
}

.file-head span:first-child {
  grid-column: 1 / 3;
}

@media (max-width: 1180px) {
  .file-primary,
  .file-head {
    grid-template-columns: 98px minmax(150px, 1fr) 98px repeat(3, minmax(102px, 0.68fr)) 146px;
  }

  .video-thumb {
    width: 88px;
  }

  .file-comments-row {
    margin-left: 98px;
  }
}

@media (max-width: 760px) {
  .file-primary {
    grid-template-columns: 92px minmax(0, 1fr);
    align-items: stretch;
  }

  .video-thumb {
    grid-column: 1;
    grid-row: 1 / 4;
    width: 84px;
    min-height: 160px;
  }

  .file-main {
    grid-column: 2;
    grid-row: 1;
  }

  .file-actions {
    grid-column: 2;
    grid-row: 2;
  }

  .date-read {
    grid-column: 2;
    grid-row: 3;
    margin-top: 4px;
  }

  .date-cell,
  .approval {
    grid-column: 1 / -1;
  }

  .file-comments-row {
    margin-left: 0;
  }
}

/* Fully approved video cards */
.file-card.fully-approved {
  border-color: rgba(245, 140, 32, 0.42);
  background:
    linear-gradient(90deg, rgba(245, 140, 32, 0.14), rgba(245, 140, 32, 0.045) 44%, rgba(255, 255, 255, 0.96));
  box-shadow: 0 8px 24px rgba(245, 140, 32, 0.09);
}

.file-card.fully-approved:hover,
.file-card.fully-approved.selected {
  border-color: rgba(245, 140, 32, 0.62);
  box-shadow: 0 10px 30px rgba(245, 140, 32, 0.13);
}

.file-card.fully-approved .file-status.complete {
  background: rgba(245, 140, 32, 0.14);
  color: #9a4d00;
}

.file-description-row {
  margin: 8px 0 0 108px;
}

.file-description-row:empty {
  display: none;
}

.preview-description {
  margin-top: 12px;
}

.description-form {
  display: grid;
  gap: 8px;
  padding: 9px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.68);
}

.description-form label {
  display: grid;
  gap: 6px;
}

.description-form label span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.description-form textarea {
  width: 100%;
  min-height: 74px;
  resize: vertical;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 9px;
  padding: 10px 11px;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  line-height: 1.45;
  background: #fff;
}

.description-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.description-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
}

.description-toggle,
.description-approval {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
}

.description-toggle {
  padding: 0 10px;
  cursor: pointer;
}

.description-toggle .ui-icon {
  width: 14px;
  height: 14px;
  color: var(--muted);
}

.description-approval {
  padding: 0 9px;
}

.description-approval input {
  width: 15px;
  height: 15px;
  accent-color: #14a99b;
}

.description-approval.approved {
  border-color: rgba(20, 169, 155, 0.34);
  background: rgba(20, 169, 155, 0.08);
  color: #0f766e;
}

.description-bar > small {
  flex: 1 1 auto;
  overflow: hidden;
  min-width: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.description-bar .description-approval {
  margin-left: auto;
}

.copy-description-icon {
  color: var(--muted);
}

.copy-description-icon:hover {
  color: var(--ink);
}

.description-body {
  display: grid;
  gap: 6px;
  margin-top: 8px;
  padding: 10px 11px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.035);
}

.description-body p {
  margin: 0;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.description-body small {
  color: var(--muted);
  font-size: 10px;
}

.file-card.description-approved {
  border-color: rgba(20, 169, 155, 0.44);
  background:
    linear-gradient(90deg, rgba(20, 169, 155, 0.13), rgba(20, 169, 155, 0.04) 46%, rgba(255, 255, 255, 0.96));
  box-shadow: 0 8px 24px rgba(20, 169, 155, 0.1);
}

.file-card.description-approved:hover,
.file-card.description-approved.selected {
  border-color: rgba(20, 169, 155, 0.62);
  box-shadow: 0 10px 30px rgba(20, 169, 155, 0.14);
}

.file-card.description-approved .file-status.complete {
  background: rgba(20, 169, 155, 0.12);
  color: #0f766e;
}

.content-tools {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.publication-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 9px;
  padding: 0 11px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.publication-filter .ui-icon {
  width: 14px;
  height: 14px;
}

.publication-filter strong {
  display: inline-grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  color: var(--muted);
  font-size: 11px;
}

.publication-filter.active {
  border-color: rgba(20, 169, 155, 0.36);
  background: rgba(20, 169, 155, 0.09);
  color: #0f766e;
}

.publication-filter.active strong {
  background: rgba(20, 169, 155, 0.16);
  color: #0f766e;
}

.global-filter-panel {
  display: grid;
  gap: 7px;
  width: 100%;
  box-sizing: border-box;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.88);
}

.global-filter-panel .publication-filter {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) 30px;
  justify-content: stretch;
  box-sizing: border-box;
  width: 100%;
  min-height: 34px;
  padding: 0 7px;
  font-size: 11px;
}

.global-filter-panel .publication-filter span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.global-filter-panel .publication-filter strong {
  justify-self: end;
}

.calendar-panel {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.88);
}

.calendar-head {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 28px;
  gap: 6px;
  align-items: center;
}

.calendar-head strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
  text-align: center;
  text-overflow: ellipsis;
  text-transform: capitalize;
  white-space: nowrap;
}

.calendar-head .icon-button {
  width: 28px;
  height: 28px;
  min-height: 28px;
  border-radius: 8px;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 3px;
}

.calendar-weekdays span {
  color: var(--faint);
  font-size: 9px;
  font-weight: 850;
  text-align: center;
}

.calendar-empty,
.calendar-day {
  height: 30px;
}

.calendar-day {
  display: grid;
  place-items: center;
  gap: 1px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 3px 1px 2px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.calendar-day:hover {
  border-color: rgba(244, 16, 62, 0.22);
  background: rgba(244, 16, 62, 0.045);
}

.calendar-day span {
  font-size: 11px;
  font-weight: 760;
  line-height: 1;
}

.calendar-day em {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px;
  max-width: 22px;
  min-height: 4px;
  font-style: normal;
}

.calendar-day em i {
  display: block;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--accent);
}

.calendar-day.today {
  color: var(--accent);
}

.calendar-day.today span {
  font-weight: 900;
}

.calendar-day.active {
  border-color: rgba(244, 16, 62, 0.34);
  background: rgba(244, 16, 62, 0.1);
}

.calendar-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.calendar-clear .ui-icon {
  width: 13px;
  height: 13px;
}

.publish-icon.active {
  border-color: rgba(107, 114, 128, 0.32);
  background: rgba(107, 114, 128, 0.1);
  color: #4b5563;
}

.file-card.published,
.file-card.published:hover,
.file-card.published.selected {
  border-color: rgba(107, 114, 128, 0.26);
  background:
    linear-gradient(90deg, rgba(107, 114, 128, 0.12), rgba(107, 114, 128, 0.045) 46%, rgba(255, 255, 255, 0.96));
  box-shadow: none;
}

.file-card.published .video-thumb,
.file-card.published .file-main,
.file-card.published .date-read,
.file-card.published .approval,
.file-card.published .file-description-row,
.file-card.published .file-comments-row {
  filter: grayscale(0.34);
}

.file-card.published .file-status {
  background: rgba(107, 114, 128, 0.12);
  color: #4b5563;
}

.gallery-preview {
  display: grid;
  gap: 12px;
  justify-items: center;
}

.gallery-stage {
  display: grid;
  width: 100%;
  min-height: 0;
  place-items: center;
  overflow: visible;
  border-radius: 12px;
  background: transparent;
}

.gallery-stage-media {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: min(68vh, 620px);
  object-fit: contain;
  border-radius: 12px;
  background: transparent;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.14s ease, transform 0.14s ease;
}

.gallery-stage-media.is-hidden {
  display: none;
}

.gallery-stage.is-switching .gallery-stage-media:not(.is-hidden) {
  opacity: 0;
  transform: translateY(3px);
}

.gallery-preload {
  position: fixed;
  left: -10000px;
  top: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.gallery-preload img,
.gallery-preload video {
  width: 1px;
  height: 1px;
}

.gallery-thumbs {
  display: flex;
  justify-content: center;
  gap: 10px;
  width: 100%;
  overflow-x: auto;
  padding: 8px 12px 12px;
  scroll-padding-inline: 16px;
}

.gallery-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.gallery-nav span {
  min-width: 44px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.upload-choice-modal {
  width: min(520px, calc(100vw - 28px));
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 14px;
  padding: 18px;
  background: #fff;
  box-shadow: 0 22px 70px rgba(15, 23, 42, 0.22);
}

.upload-choice-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.upload-choice-head strong {
  color: var(--ink);
  font-size: 18px;
  line-height: 1.2;
}

.upload-choice-modal p {
  margin: 12px 0 16px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.upload-choice-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.gallery-thumb {
  position: relative;
  flex: 0 0 58px;
  width: 58px;
  height: 82px;
  overflow: visible;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 9px;
  padding: 0;
  background: #fff;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
}

.gallery-thumb.active {
  border-color: rgba(20, 169, 155, 0.7);
  box-shadow: 0 0 0 2px rgba(20, 169, 155, 0.12);
}

.gallery-thumbs.is-sorting .gallery-thumb:not(.dragging) {
  opacity: 0.86;
}

.gallery-thumb[draggable="true"] {
  cursor: grab;
}

.gallery-thumb.dragging {
  opacity: 0.42;
  transform: scale(0.96);
}

.gallery-thumb.drop-before,
.gallery-thumb.drop-after {
  border-color: rgba(244, 16, 62, 0.72);
  box-shadow: 0 0 0 3px rgba(244, 16, 62, 0.14), 0 10px 24px rgba(244, 16, 62, 0.18);
  opacity: 1;
  transform: translateY(-2px);
}

.gallery-thumb.drop-before::before,
.gallery-thumb.drop-after::after {
  position: absolute;
  top: -7px;
  bottom: -7px;
  z-index: 2;
  width: 5px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(244, 16, 62, 0.14), 0 8px 20px rgba(244, 16, 62, 0.26);
  content: '';
}

.gallery-thumb.drop-before::before {
  left: -9px;
}

.gallery-thumb.drop-after::after {
  right: -9px;
}

.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

.gallery-thumb span {
  position: absolute;
  left: 4px;
  bottom: 4px;
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.74);
  color: #fff;
  font-size: 10px;
  font-weight: 850;
}

@media (max-width: 760px) {
  .file-card.fully-approved {
    background:
      linear-gradient(180deg, rgba(245, 140, 32, 0.14), rgba(245, 140, 32, 0.045) 46%, rgba(255, 255, 255, 0.96));
  }

  .file-card.description-approved {
    background:
      linear-gradient(180deg, rgba(20, 169, 155, 0.13), rgba(20, 169, 155, 0.04) 46%, rgba(255, 255, 255, 0.96));
  }

  .file-card.published,
  .file-card.published:hover,
  .file-card.published.selected {
    background:
      linear-gradient(180deg, rgba(107, 114, 128, 0.12), rgba(107, 114, 128, 0.045) 46%, rgba(255, 255, 255, 0.96));
  }

  .gallery-thumb {
    flex-basis: 52px;
    width: 52px;
    height: 74px;
  }

  .upload-choice-actions {
    grid-template-columns: 1fr;
  }

  .file-description-row {
    margin-left: 0;
  }

  .description-bar {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .description-bar > small {
    order: 3;
    flex-basis: 100%;
  }

  .description-bar .description-approval {
    margin-left: auto;
  }

  .content-tools {
    display: grid;
    grid-template-columns: 1fr;
    justify-content: stretch;
  }

  .publication-filter {
    justify-content: center;
    width: 100%;
  }
}

.approval small {
  display: block;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

@media (max-width: 1180px) {
  .approval small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@media (max-width: 760px) {
  .file-card {
    padding: 8px;
  }

  .file-primary {
    display: grid;
    grid-template-columns: 98px minmax(0, 1fr);
    gap: 4px 10px;
    align-items: start;
  }

  .file-thumb-stack {
    grid-column: 1;
    grid-row: 1 / 3;
    gap: 2px;
    width: 98px;
    grid-template-rows: 130px 26px;
  }

  .file-thumb-stack .video-thumb,
  .video-thumb {
    width: 98px;
    height: 130px;
    min-height: 130px;
  }

  .thumb-add-media {
    height: 26px;
    min-height: 26px;
    margin-top: -1px;
  }

  .file-main {
    grid-column: 2;
    grid-row: 1;
    align-self: start;
    min-width: 0;
    padding-bottom: 38px;
  }

  .file-main h3,
  .file-title-button {
    font-size: 13px;
    line-height: 1.18;
  }

  .file-main p {
    margin-top: 3px;
    font-size: 11px;
  }

  .file-updated,
  .file-published {
    margin-top: 2px;
    font-size: 9px;
  }

  .file-status {
    margin-top: 4px;
  }

  .file-actions {
    grid-column: 2;
    grid-row: 1;
    align-self: end;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin: 0;
    justify-content: flex-start;
  }

  .download-icon,
  .file-actions .icon-button {
    width: 30px;
    height: 30px;
    min-height: 30px;
    border-radius: 8px;
  }

  .file-actions .ui-icon {
    width: 15px;
    height: 15px;
  }

  .mobile-move {
    display: none;
  }

  .date-read {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 2px 8px;
    align-items: center;
    margin-top: 2px;
    padding-top: 6px;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
  }

  .date-read > span {
    display: none;
  }

  .date-read strong {
    font-size: 12px;
    line-height: 1.2;
  }

  .date-read small {
    justify-self: start;
    font-size: 11px;
  }

  .publication-inline {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 5px;
    margin-top: 4px;
  }

  .publication-inline b {
    grid-column: 1 / -1;
    font-size: 11px;
  }

  .publication-inline input {
    min-height: 34px;
    font-size: 14px;
  }

  .approval {
    grid-column: 1 / -1;
  }
}

/* Balanced post card composition */
@media (min-width: 761px) {
  .file-list {
    gap: 10px;
  }

  .file-head,
  .file-primary {
    grid-template-columns:
      108px
      minmax(230px, 0.92fr)
      minmax(150px, 0.52fr)
      minmax(390px, 1.2fr)
      max-content;
    column-gap: 18px;
  }

  .file-head {
    min-width: 1040px;
    padding: 0 20px 0;
  }

  .file-head span:first-child {
    grid-column: 1 / 3;
  }

  .file-card {
    min-width: 1040px;
    padding: 14px 18px 12px;
    border-radius: 10px;
  }

  .file-primary {
    align-items: start;
  }

  .file-thumb-stack {
    width: 108px;
    grid-template-rows: 148px 28px;
    gap: 8px;
  }

  .file-thumb-stack .video-thumb,
  .video-thumb {
    width: 108px;
    height: 148px;
    min-height: 148px;
    border-radius: 9px;
  }

  .thumb-add-media {
    height: 28px;
    min-height: 28px;
    border-radius: 9px;
  }

  .file-main,
  .date-read,
  .approval-group,
  .file-actions {
    align-self: start;
  }

  .file-main {
    padding-top: 34px;
  }

  .file-title-button,
  .file-main h3 {
    font-size: 14px;
    line-height: 1.18;
  }

  .file-main p {
    margin-top: 5px;
    font-size: 11.5px;
  }

  .file-updated,
  .file-published {
    display: block;
    margin-top: 3px;
    overflow: hidden;
    color: var(--muted);
    font-size: 10.5px;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .file-status {
    margin-top: 7px;
  }

  .date-read {
    padding-top: 28px;
  }

  .date-read > span {
    display: none;
  }

  .date-read strong {
    font-size: 12px;
    line-height: 1.2;
  }

  .date-read small {
    margin-top: 2px;
    font-size: 11px;
  }

  .publication-inline {
    gap: 6px;
    margin-top: 8px;
    max-width: 138px;
  }

  .publication-inline b {
    font-size: 11.5px;
    line-height: 1.15;
  }

  .publication-inline input {
    min-height: 34px;
    border-radius: 9px;
    font-size: 12px;
  }

  .approval-group {
    display: grid;
    grid-template-columns: repeat(3, minmax(118px, 1fr));
    align-items: stretch;
    margin-top: 54px;
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.58);
  }

  .approval-group .approval {
    min-height: 48px;
    border: 0;
    border-radius: 0;
    background: transparent;
    padding: 8px 12px;
  }

  .approval-group .approval + .approval {
    border-left: 1px solid rgba(15, 23, 42, 0.08);
  }

  .approval-group .approval.approved {
    background: rgba(20, 169, 155, 0.08);
  }

  .approval-group .approval input {
    width: 15px;
    height: 15px;
  }

  .approval-group .approval strong {
    font-size: 11px;
  }

  .approval-group .approval small {
    display: block;
    font-size: 9.5px;
    line-height: 1.25;
  }

  .file-actions {
    justify-content: flex-end;
    margin-top: 56px;
    min-width: max-content;
  }

  .download-icon,
  .file-actions .icon-button {
    width: 34px;
    height: 34px;
    min-height: 34px;
    border-radius: 9px;
  }

  .file-description-row,
  .file-comments-row {
    margin-left: 126px;
  }

  .file-description-row {
    margin-top: 12px;
  }

  .description-bar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto auto;
    gap: 8px;
    align-items: center;
  }

  .description-bar .description-approval {
    margin-left: 0;
  }

  .file-comments-row {
    margin-top: 10px;
    padding-top: 10px;
  }
}

@media (min-width: 761px) and (max-width: 1280px) {
  .file-head,
  .file-primary {
    grid-template-columns:
      98px
      minmax(200px, 0.9fr)
      minmax(136px, 0.5fr)
      minmax(330px, 1.1fr)
      max-content;
    column-gap: 14px;
  }

  .file-card,
  .file-head {
    min-width: 940px;
  }

  .file-thumb-stack {
    width: 98px;
    grid-template-rows: 136px 28px;
  }

  .file-thumb-stack .video-thumb,
  .video-thumb {
    width: 98px;
    height: 136px;
    min-height: 136px;
  }

  .approval-group {
    grid-template-columns: repeat(3, minmax(104px, 1fr));
  }

  .approval-group .approval {
    padding-inline: 9px;
  }

  .file-description-row,
  .file-comments-row {
    margin-left: 112px;
  }
}

@media (max-width: 760px) {
  .approval-group {
    grid-column: 1 / -1;
    display: grid;
    gap: 8px;
    margin-top: 4px;
  }

  .approval-group .approval {
    grid-column: 1 / -1;
  }
}

/* Reference-style post cards */
.file-list {
  gap: 14px;
  overflow: visible;
}

.file-card {
  min-width: 0;
  padding: 22px 26px;
  border-color: rgba(17, 24, 39, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: none;
}

.file-card:hover,
.file-card.selected {
  border-color: rgba(239, 23, 67, 0.2);
  box-shadow: 0 12px 34px rgba(17, 24, 39, 0.06);
}

.post-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.post-card-head-info {
  min-width: 0;
  flex: 1 1 auto;
}

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

.post-card-head .file-title-button,
.post-card-head h3 {
  max-width: min(520px, 100%);
  color: var(--ink);
  font-size: 17px;
  font-weight: 850;
  line-height: 1.18;
}

.post-card-grid,
.file-primary.post-card-grid {
  display: grid;
  grid-template-columns: 176px minmax(420px, 1fr) minmax(260px, 300px);
  gap: 34px 44px;
  align-items: start;
}

.post-media-panel {
  display: grid;
  gap: 10px;
  align-content: start;
}

.post-media-summary {
  display: grid;
  gap: 8px;
  justify-items: start;
}

.post-media-summary .thumb-add-media {
  width: 72px;
  height: 30px;
  min-height: 30px;
  margin-top: 2px;
  border-radius: 9px;
  color: #ef1743;
}

.post-media-panel .file-thumb-stack {
  width: 176px;
}

.post-media-panel .video-thumb,
.post-media-panel .file-thumb-stack .video-thumb {
  width: 176px;
  height: 228px;
  min-height: 228px;
  border-radius: 10px;
  background: #0b1018;
}

.post-media-meta,
.post-approval-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.post-media-panel .file-status {
  width: max-content;
  margin-top: 2px;
  padding: 5px 9px;
  border-radius: 9px;
  font-size: 11px;
}

.post-media-panel .file-actions {
  grid-column: auto;
  grid-row: auto;
  align-self: start;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
  min-width: 0;
}

.action-label {
  display: none;
}

.post-media-panel .download-icon,
.post-media-panel .file-actions .icon-button {
  width: 38px;
  height: 38px;
  min-height: 38px;
  border-radius: 10px;
  background: #fff;
}

.post-media-panel .file-actions .icon-button,
.post-media-panel .file-actions .download-icon {
  border-color: rgba(17, 24, 39, 0.1);
  color: #202938;
}

.post-media-panel .file-actions .ui-icon {
  width: 16px;
  height: 16px;
  stroke-width: 1.72;
}

.post-media-panel .file-actions .action-label {
  display: none;
}

/* Final desktop card lock: reference layout, approval on the right. */
@media (min-width: 761px) and (max-width: 1500px) {
  .post-card-grid,
  .file-primary.post-card-grid {
    display: grid;
    grid-template-columns: 190px minmax(260px, 1fr) minmax(205px, 240px);
    grid-template-rows: auto auto auto;
    gap: 24px;
    align-items: start;
  }

  .post-media-panel {
    grid-column: 1;
    grid-row: 1 / 4;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    align-content: start;
    min-width: 0;
  }

  .post-media-panel .file-thumb-stack {
    width: 190px;
    grid-template-rows: 248px;
    gap: 0;
  }

  .post-media-panel .video-thumb,
  .post-media-panel .file-thumb-stack .video-thumb {
    width: 190px;
    height: 248px;
    min-height: 248px;
    border-radius: 12px;
  }

  .post-media-summary {
    display: grid;
    gap: 7px;
    justify-items: start;
    transform: none;
  }

  .post-media-summary .thumb-add-media {
    width: 70px;
    height: 28px;
    min-height: 28px;
    margin-top: 2px;
  }

  .post-media-panel .file-actions {
    display: grid;
    grid-template-columns: repeat(5, 34px);
    gap: 5px;
    width: 190px;
    margin-top: 3px;
  }

  .post-media-panel .download-icon,
  .post-media-panel .file-actions .icon-button {
    width: 34px;
    height: 34px;
    min-height: 34px;
    border-radius: 9px;
  }

  .post-media-panel .file-actions .ui-icon {
    width: 15px;
    height: 15px;
  }

  .post-work-panel {
    display: contents;
  }

  .publication-card {
    grid-column: 2;
    grid-row: 1;
    gap: 12px;
    min-width: 0;
  }

  .publication-card .publication-inline {
    width: 100%;
    grid-template-columns: minmax(0, 1fr) minmax(112px, 0.55fr);
  }

  .publication-card .publication-field {
    min-height: 46px;
    padding: 0 12px;
  }

  .file-description-row {
    grid-column: 2;
    grid-row: 2;
    min-width: 0;
  }

  .description-input-shell textarea {
    min-height: 126px;
  }

  .post-approval-panel {
    grid-column: 3;
    grid-row: 1 / 3;
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    align-items: start;
    padding: 18px;
    border: 1px solid rgba(17, 24, 39, 0.12);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.78);
  }

  .post-approval-panel .approval-group {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    border: 0;
    background: transparent;
  }

  .post-approval-panel .approval {
    min-height: 64px;
    grid-template-columns: 26px minmax(0, 1fr);
    gap: 12px;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .post-approval-panel .approval + .approval {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(17, 24, 39, 0.1);
    border-left: 0;
  }

  .post-approval-panel .approval input {
    width: 23px;
    height: 23px;
  }

  .post-approval-panel .approval strong {
    font-size: 12px;
  }

  .post-approval-panel .approval small {
    font-size: 10.5px;
    white-space: normal;
  }

  .file-comments-row {
    grid-column: 2 / 4;
    grid-row: 3;
    gap: 14px;
    margin: 4px 0 0;
    padding-top: 20px;
    border-top: 1px solid rgba(17, 24, 39, 0.1);
  }

  .post-media-panel,
  .publication-card,
  .file-description-row,
  .post-approval-panel {
    align-self: start;
    margin-top: 0;
  }

  .publication-card.date-read {
    padding-top: 0;
    border-top: 0;
  }
}

/* Final desktop card lock: keep the reference-like three-column card on desktop widths. */
@media (min-width: 761px) and (max-width: 1500px) {
  .post-card-grid,
  .file-primary.post-card-grid {
    display: grid;
    grid-template-columns: 190px minmax(260px, 1fr) minmax(205px, 240px);
    grid-template-rows: auto auto auto;
    gap: 24px;
    align-items: start;
  }

  .post-media-panel {
    grid-column: 1;
    grid-row: 1 / 4;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    align-content: start;
    min-width: 0;
  }

  .post-media-panel .file-thumb-stack {
    width: 190px;
    grid-template-rows: 248px;
    gap: 0;
  }

  .post-media-panel .video-thumb,
  .post-media-panel .file-thumb-stack .video-thumb {
    width: 190px;
    height: 248px;
    min-height: 248px;
    border-radius: 12px;
  }

  .post-media-summary {
    display: grid;
    gap: 7px;
    justify-items: start;
    transform: none;
  }

  .post-media-summary .thumb-add-media {
    width: 70px;
    height: 28px;
    min-height: 28px;
    margin-top: 2px;
  }

  .post-media-panel .file-actions {
    display: grid;
    grid-template-columns: repeat(5, 34px);
    gap: 5px;
    width: 190px;
    margin-top: 3px;
  }

  .post-media-panel .download-icon,
  .post-media-panel .file-actions .icon-button {
    width: 34px;
    height: 34px;
    min-height: 34px;
    border-radius: 9px;
  }

  .post-media-panel .file-actions .ui-icon {
    width: 15px;
    height: 15px;
  }

  .post-work-panel {
    display: contents;
  }

  .publication-card {
    grid-column: 2;
    grid-row: 1;
    gap: 12px;
    min-width: 0;
  }

  .publication-card .publication-inline {
    width: 100%;
    grid-template-columns: minmax(0, 1fr) minmax(112px, 0.55fr);
  }

  .publication-card .publication-field {
    min-height: 46px;
    padding: 0 12px;
  }

  .file-description-row {
    grid-column: 2;
    grid-row: 2;
    min-width: 0;
  }

  .description-input-shell textarea {
    min-height: 126px;
  }

  .post-approval-panel {
    grid-column: 3;
    grid-row: 1 / 3;
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    align-items: start;
    padding: 18px;
    border: 1px solid rgba(17, 24, 39, 0.12);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.78);
  }

  .post-approval-panel .approval-group {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    border: 0;
    background: transparent;
  }

  .post-approval-panel .approval {
    min-height: 64px;
    grid-template-columns: 26px minmax(0, 1fr);
    gap: 12px;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .post-approval-panel .approval + .approval {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(17, 24, 39, 0.1);
    border-left: 0;
  }

  .post-approval-panel .approval input {
    width: 23px;
    height: 23px;
  }

  .post-approval-panel .approval strong {
    font-size: 12px;
  }

  .post-approval-panel .approval small {
    font-size: 10.5px;
    white-space: normal;
  }

  .file-comments-row {
    grid-column: 2 / 4;
    grid-row: 3;
    gap: 14px;
    margin: 4px 0 0;
    padding-top: 20px;
    border-top: 1px solid rgba(17, 24, 39, 0.1);
  }
}

@media (min-width: 761px) and (max-width: 1500px) {
  .post-card-grid,
  .file-primary.post-card-grid {
    display: grid;
    grid-template-columns: 190px minmax(260px, 1fr) minmax(205px, 240px);
    grid-template-rows: auto auto auto;
    gap: 24px;
    align-items: start;
  }

  .post-media-panel {
    grid-column: 1;
    grid-row: 1 / 4;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    align-content: start;
    min-width: 0;
  }

  .post-media-panel .file-thumb-stack {
    width: 190px;
    grid-template-rows: 248px;
    gap: 0;
  }

  .post-media-panel .video-thumb,
  .post-media-panel .file-thumb-stack .video-thumb {
    width: 190px;
    height: 248px;
    min-height: 248px;
    border-radius: 12px;
  }

  .post-media-summary {
    display: grid;
    gap: 7px;
    justify-items: start;
    transform: none;
  }

  .post-media-summary .thumb-add-media {
    width: 70px;
    height: 28px;
    min-height: 28px;
    margin-top: 2px;
  }

  .post-media-panel .file-actions {
    display: grid;
    grid-template-columns: repeat(5, 34px);
    gap: 5px;
    width: 190px;
    margin-top: 3px;
  }

  .post-media-panel .download-icon,
  .post-media-panel .file-actions .icon-button {
    width: 34px;
    height: 34px;
    min-height: 34px;
    border-radius: 9px;
  }

  .post-media-panel .file-actions .ui-icon {
    width: 15px;
    height: 15px;
  }

  .post-work-panel {
    display: contents;
  }

  .publication-card {
    grid-column: 2;
    grid-row: 1;
    gap: 12px;
    min-width: 0;
  }

  .publication-card .publication-inline {
    width: 100%;
    grid-template-columns: minmax(0, 1fr) minmax(112px, 0.55fr);
  }

  .publication-card .publication-field {
    min-height: 46px;
    padding: 0 12px;
  }

  .file-description-row {
    grid-column: 2;
    grid-row: 2;
    min-width: 0;
  }

  .description-input-shell textarea {
    min-height: 126px;
  }

  .post-approval-panel {
    grid-column: 3;
    grid-row: 1 / 3;
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    align-items: start;
    padding: 18px;
    border: 1px solid rgba(17, 24, 39, 0.12);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.78);
  }

  .post-approval-panel .approval-group {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    border: 0;
    background: transparent;
  }

  .post-approval-panel .approval {
    min-height: 64px;
    grid-template-columns: 26px minmax(0, 1fr);
    gap: 12px;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .post-approval-panel .approval + .approval {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(17, 24, 39, 0.1);
    border-left: 0;
  }

  .post-approval-panel .approval input {
    width: 23px;
    height: 23px;
  }

  .post-approval-panel .approval strong {
    font-size: 12px;
  }

  .post-approval-panel .approval small {
    font-size: 10.5px;
    white-space: normal;
  }

  .file-comments-row {
    grid-column: 2 / 4;
    grid-row: 3;
    gap: 14px;
    margin: 4px 0 0;
    padding-top: 20px;
    border-top: 1px solid rgba(17, 24, 39, 0.1);
  }
}

@media (max-width: 760px) {
  .post-media-panel .file-actions .action-label {
    display: block;
  }
}

.post-media-panel .file-actions .icon-button:hover,
.post-media-panel .file-actions .download-icon:hover {
  border-color: rgba(239, 23, 67, 0.22);
  background: rgba(239, 23, 67, 0.04);
  color: #ef1743;
}

.post-media-panel .file-actions .danger-icon {
  color: #ef1743;
}

.post-media-panel .file-actions .danger-icon:hover {
  border-color: rgba(239, 23, 67, 0.26);
  background: rgba(239, 23, 67, 0.06);
}

.post-media-panel .publish-icon.active {
  border-color: rgba(20, 169, 155, 0.28);
  background: rgba(20, 169, 155, 0.09);
  color: #0c7a5f;
}

.post-work-panel {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.publication-card {
  display: grid;
  gap: 12px;
}

.publication-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
}

.publication-card h4,
.post-approval-head h4 {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 850;
  line-height: 1.2;
}

.publication-card-head small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.publication-card .publication-inline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(130px, 0.52fr);
  gap: 0;
  width: min(100%, 620px);
  max-width: none;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(17, 24, 39, 0.12);
  border-radius: 10px;
  background: #fff;
}

.publication-card .publication-field {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 48px;
  padding: 0 16px;
}

.publication-card .publication-field + .publication-field {
  border-left: 1px solid rgba(17, 24, 39, 0.12);
}

.publication-card .publication-field .ui-icon {
  width: 18px;
  height: 18px;
  color: var(--ink);
}

.publication-card .publication-field input {
  width: 100%;
  min-height: 46px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
}

.file-description-row,
.file-comments-row {
  margin: 0;
}

.description-form {
  gap: 12px;
  padding: 0;
  border: 0;
  background: transparent;
}

.description-form label {
  gap: 10px;
}

.description-form label span,
.comment-label {
  color: var(--ink);
  font-size: 14px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: none;
}

.description-form textarea {
  min-height: 136px;
  border-color: rgba(17, 24, 39, 0.12);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
}

.description-form-actions {
  justify-content: flex-end;
}

.description-panel {
  padding: 0;
  border: 0;
  background: transparent;
}

.description-bar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto auto;
  gap: 10px;
  align-items: center;
}

.description-toggle {
  min-height: 38px;
  border-radius: 10px;
  background: #fff;
}

.description-body {
  margin-top: 10px;
  padding: 14px 16px;
  border: 1px solid rgba(17, 24, 39, 0.1);
  border-radius: 10px;
  background: #fff;
}

.description-body p {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.5;
}

.post-approval-panel {
  display: grid;
  gap: 22px;
  padding: 22px;
  border: 1px solid rgba(17, 24, 39, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
}

.post-approval-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.post-approval-head .file-status {
  margin: 0;
}

.post-approval-panel .approval-group {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  margin: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.post-approval-panel .approval {
  min-height: 74px;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 14px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.post-approval-panel .approval + .approval {
  border-top: 1px solid rgba(17, 24, 39, 0.1);
  padding-top: 18px;
  margin-top: 18px;
}

.post-approval-panel .approval.approved {
  background: transparent;
}

.post-approval-panel .approval input {
  width: 24px;
  height: 24px;
  accent-color: #14a99b;
}

.post-approval-panel .approval strong {
  font-size: 13px;
  line-height: 1.2;
}

.post-approval-panel .approval small {
  margin-top: 3px;
  font-size: 11px;
  line-height: 1.25;
  white-space: normal;
}

.file-comments-row {
  display: grid;
  gap: 14px;
  padding-top: 20px;
  border-top: 1px solid rgba(17, 24, 39, 0.1);
}

.comment-label {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.comment-label b {
  display: inline-grid;
  min-width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.06);
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
}

.comment-label .ui-icon {
  width: 16px;
  height: 16px;
  color: var(--muted);
}

.inline-comments-list {
  display: grid;
  gap: 14px;
  max-height: 420px;
  margin-top: 16px;
  overflow: auto;
  padding-right: 4px;
}

.inline-comment-item {
  display: grid;
  gap: 10px;
}

.comment-node {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.comment-avatar {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  background: #101010;
  color: #fff;
  font-size: 11px;
  font-weight: 850;
  line-height: 1;
}

.comment-bubble {
  min-width: 0;
}

.inline-comment-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.inline-comment-head strong {
  display: block;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.2;
}

.inline-comment-head time {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

.inline-comment {
  margin: 6px 0 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
}

.inline-comment.muted {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.comment-actions {
  gap: 5px;
}

.comment-actions button {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  transition:
    background-color 0.14s ease,
    color 0.14s ease,
    transform 0.14s ease;
}

.comment-actions .ui-icon {
  width: 14px;
  height: 14px;
  stroke-width: 1.65;
}

.comment-replies {
  display: grid;
  gap: 12px;
  margin: 2px 0 0 18px;
  padding-left: 30px;
  border-left: 1px solid rgba(17, 24, 39, 0.12);
}

.comment-status {
  width: max-content;
  margin-top: 8px;
}

.inline-comment-form {
  gap: 8px;
}

.comment-composer-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.composer-avatar {
  align-self: center;
}

.comment-input-row {
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 10px;
}

.inline-comment-form input,
.edit-comment-form input {
  min-height: 44px;
  border-color: rgba(17, 24, 39, 0.12);
  border-radius: 10px;
  background: #fff;
  font-size: 13px;
}

.inline-comment-form .icon-button,
.edit-comment-form .icon-button {
  width: 44px;
  height: 44px;
  border-radius: 10px;
}

.send-comment-button {
  border-color: rgba(17, 24, 39, 0.12);
  color: var(--ink);
}

.send-comment-button:hover {
  border-color: rgba(239, 23, 67, 0.26);
  background: rgba(239, 23, 67, 0.05);
  color: #ef1743;
}

.send-comment-button .ui-icon {
  width: 18px;
  height: 18px;
}

.reply-context {
  min-height: 28px;
  padding: 0 0 0 48px;
  font-size: 12px;
}

.file-card.fully-approved {
  border-color: rgba(245, 140, 32, 0.32);
  background: linear-gradient(90deg, rgba(245, 140, 32, 0.1), rgba(255, 255, 255, 0.98) 34%);
}

.file-card.description-approved {
  border-color: rgba(20, 169, 155, 0.34);
  background: linear-gradient(90deg, rgba(20, 169, 155, 0.11), rgba(255, 255, 255, 0.98) 36%);
}

.file-card.published,
.file-card.published:hover,
.file-card.published.selected {
  border-color: rgba(107, 114, 128, 0.18);
  background: #f5f6f7;
}

.file-card.published .post-media-panel,
.file-card.published .post-work-panel,
.file-card.published .post-approval-panel {
  opacity: 0.66;
}

@media (max-width: 1280px) and (min-width: 761px) {
  .post-card-grid,
  .file-primary.post-card-grid {
    grid-template-columns: 150px minmax(360px, 1fr) minmax(230px, 270px);
    gap: 28px;
  }

  .post-media-panel .file-thumb-stack,
  .post-media-panel .thumb-add-media {
    width: 150px;
  }

  .post-media-panel .file-thumb-stack {
    grid-template-rows: 198px 32px;
  }

  .post-media-panel .video-thumb,
  .post-media-panel .file-thumb-stack .video-thumb {
    width: 150px;
    height: 198px;
    min-height: 198px;
  }
}

@media (max-width: 760px) {
  .file-list {
    gap: 12px;
    overflow: visible;
  }

  .file-card {
    min-width: 0;
    padding: 14px;
    border-radius: 13px;
  }

  .post-card-head {
    margin-bottom: 12px;
  }

  .post-card-head .file-title-button,
  .post-card-head h3 {
    max-width: 100%;
    font-size: 15px;
  }

  .post-card-head p {
    font-size: 11px;
  }

  .post-card-grid,
  .file-primary.post-card-grid {
    display: grid;
    grid-template-columns: 98px minmax(0, 1fr);
    gap: 12px 14px;
    align-items: start;
  }

  .post-media-panel {
    grid-column: 1;
    grid-row: 1;
    gap: 8px;
  }

  .post-media-panel .file-thumb-stack {
    width: 98px;
    grid-template-rows: 130px 30px;
    gap: 6px;
  }

  .post-media-panel .video-thumb,
  .post-media-panel .file-thumb-stack .video-thumb {
    width: 98px;
    height: 130px;
    min-height: 130px;
    border-radius: 10px;
  }

  .post-media-panel .thumb-add-media {
    width: 98px;
    height: 30px;
    min-height: 30px;
  }

  .post-media-meta,
  .post-approval-note {
    font-size: 10.5px;
  }

  .post-media-panel .file-status {
    padding: 4px 8px;
    font-size: 11px;
  }

  .post-media-panel .file-actions {
    grid-column: auto;
    grid-row: auto;
    align-self: start;
    display: grid;
    grid-template-columns: repeat(3, 28px);
    gap: 5px;
    margin-top: 0;
  }

  .post-media-panel .download-icon,
  .post-media-panel .file-actions .icon-button {
    width: 28px;
    height: 28px;
    min-height: 28px;
    border-radius: 8px;
  }

  .post-media-panel .file-actions .ui-icon {
    width: 14px;
    height: 14px;
  }

  .post-work-panel {
    display: contents;
  }

  .publication-card {
    grid-column: 2;
    grid-row: 1;
    gap: 8px;
    min-width: 0;
  }

  .publication-card h4 {
    font-size: 13px;
  }

  .publication-card-head {
    display: grid;
    gap: 4px;
  }

  .publication-card-head small {
    font-size: 10px;
  }

  .publication-card .publication-inline {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .publication-card .publication-field {
    min-height: 38px;
    grid-template-columns: 18px minmax(0, 1fr);
    gap: 8px;
    padding: 0 10px;
  }

  .publication-card .publication-field + .publication-field {
    border-top: 1px solid rgba(17, 24, 39, 0.1);
    border-left: 0;
  }

  .publication-card .publication-field input {
    min-height: 38px;
    font-size: 16px;
  }

  .file-description-row {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .post-approval-panel {
    grid-column: 1 / -1;
    grid-row: 3;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
  }

  .post-approval-panel .approval {
    min-height: 52px;
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 10px;
  }

  .post-approval-panel .approval + .approval {
    margin-top: 10px;
    padding-top: 10px;
  }

  .post-approval-panel .approval input {
    width: 20px;
    height: 20px;
  }

  .post-approval-panel .approval strong {
    font-size: 13px;
  }

  .post-approval-panel .approval small {
    font-size: 11px;
  }

  .file-comments-row {
    grid-column: 1 / -1;
    grid-row: 4;
    gap: 12px;
    padding-top: 14px;
  }

  .description-form textarea {
    min-height: 120px;
    font-size: 16px;
  }

  .description-bar {
    grid-template-columns: 1fr auto auto auto;
  }

  .description-bar > small {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .inline-comments-list {
    max-height: none;
  }

  .comment-node,
  .comment-composer-row {
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 9px;
  }

  .comment-avatar {
    width: 30px;
    height: 30px;
    font-size: 10px;
  }

  .inline-comment-head {
    gap: 8px;
  }

  .comment-actions {
    gap: 2px;
  }

  .comment-actions button {
    width: 24px;
    height: 24px;
  }

  .inline-comment,
  .inline-comment-head strong {
    font-size: 13px;
  }

  .comment-replies {
    margin-left: 15px;
    padding-left: 18px;
  }

  .comment-input-row {
    grid-template-columns: minmax(0, 1fr) 42px;
    gap: 8px;
  }

  .inline-comment-form input,
  .edit-comment-form input {
    font-size: 16px;
  }

  .reply-context {
    padding-left: 39px;
  }
}

@media (min-width: 761px) and (max-width: 1500px) {
  .post-card-grid,
  .file-primary.post-card-grid {
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 24px 30px;
  }

  .post-media-panel .file-thumb-stack,
  .post-media-panel .thumb-add-media {
    width: 150px;
  }

  .post-media-panel .file-thumb-stack {
    grid-template-rows: 198px 32px;
  }

  .post-media-panel .video-thumb,
  .post-media-panel .file-thumb-stack .video-thumb {
    width: 150px;
    height: 198px;
    min-height: 198px;
  }

  .post-work-panel {
    min-width: 0;
  }

  .post-work-panel {
    display: contents;
  }

  .publication-card {
    grid-column: 2;
    grid-row: 1;
  }

  .file-description-row {
    grid-column: 2;
    grid-row: 2;
  }

  .post-approval-panel {
    grid-column: 1 / -1;
    grid-row: 3;
    grid-template-columns: 170px minmax(0, 1fr);
    align-items: start;
    gap: 18px;
    padding: 18px;
  }

  .file-comments-row {
    grid-column: 1 / -1;
    grid-row: 4;
  }

  .post-approval-panel .approval-group {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
  }

  .post-approval-panel .approval {
    min-height: 54px;
    padding: 0 14px;
  }

  .post-approval-panel .approval + .approval {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
    border-left: 1px solid rgba(17, 24, 39, 0.1);
  }
}

/* Mobile card layout from reference */
@media (max-width: 760px) {
  .file-card {
    padding: 14px 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .file-card:hover,
  .file-card.selected {
    border-color: transparent;
    box-shadow: none;
  }

  .post-card-head {
    padding: 0 2px;
    margin-bottom: 12px;
  }

  .post-card-head .file-title-button,
  .post-card-head h3 {
    font-size: 17px;
    line-height: 1.15;
  }

  .post-card-head p {
    margin-top: 6px;
    font-size: 12px;
  }

  .post-card-grid,
  .file-primary.post-card-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .post-media-panel {
    grid-column: 1 / -1;
    grid-row: 1;
    display: grid;
    grid-template-columns: 132px minmax(0, 1fr);
    gap: 0 14px;
    overflow: hidden;
    padding: 10px;
    border: 1px solid rgba(17, 24, 39, 0.12);
    border-radius: 13px;
    background: #fff;
  }

  .post-media-panel .file-thumb-stack {
    grid-column: 1;
    grid-row: 1;
    width: 132px;
    grid-template-rows: 150px 30px;
    gap: 6px;
  }

  .post-media-panel .video-thumb,
  .post-media-panel .file-thumb-stack .video-thumb {
    width: 132px;
    height: 150px;
    min-height: 150px;
    border-radius: 10px;
  }

  .post-media-panel .thumb-add-media {
    width: 132px;
    height: 30px;
    min-height: 30px;
  }

  .post-media-summary {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
    display: grid;
    gap: 6px;
    justify-items: start;
    transform: translateY(-34px);
  }

  .post-media-summary .post-media-meta {
    grid-column: auto;
    grid-row: auto;
    align-self: auto;
    margin: 0;
    font-size: 13px;
  }

  .post-media-summary .file-status {
    grid-column: auto;
    grid-row: auto;
    align-self: auto;
    width: max-content;
    margin: 0;
    padding: 7px 10px;
    border-radius: 10px;
    font-size: 12px;
  }

  .post-media-summary .post-approval-note {
    grid-column: auto;
    grid-row: auto;
    align-self: auto;
    margin: 0;
    font-size: 13px;
  }

  .post-media-panel .file-actions {
    grid-column: 1 / -1;
    grid-row: 2;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(58px, 1fr));
    gap: 0;
    align-self: stretch;
    margin: 10px -10px -10px;
    border-top: 1px solid rgba(17, 24, 39, 0.1);
  }

  .post-media-panel .download-icon,
  .post-media-panel .file-actions .icon-button {
    display: grid;
    width: 100%;
    height: 68px;
    min-height: 68px;
    place-items: center;
    gap: 2px;
    border: 0;
    border-left: 1px solid rgba(17, 24, 39, 0.1);
    border-radius: 0;
    background: transparent;
    color: var(--ink);
  }

  .post-media-panel .file-actions > :first-child {
    border-left: 0;
  }

  .post-media-panel .file-actions .ui-icon {
    width: 20px;
    height: 20px;
  }

  .post-media-panel .file-actions .danger-icon {
    color: #ef1743;
  }

  .action-label {
    display: block;
    max-width: 100%;
    overflow: visible;
    color: var(--muted);
    font-size: 9.5px;
    font-weight: 650;
    line-height: 1.08;
    text-align: center;
    text-overflow: clip;
    white-space: normal;
  }

  .danger-icon .action-label {
    color: #ef1743;
  }

  .post-work-panel {
    display: contents;
  }

  .publication-card {
    grid-column: 1 / -1;
    grid-row: 2;
    gap: 10px;
    min-width: 0;
  }

  .publication-card h4 {
    font-size: 16px;
  }

  .publication-card .publication-inline {
    grid-template-columns: minmax(0, 1fr) minmax(96px, 0.72fr);
    width: 100%;
  }

  .publication-card .publication-field {
    min-height: 52px;
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 10px;
    padding: 0 14px;
  }

  .publication-card .publication-field + .publication-field {
    border-top: 0;
    border-left: 1px solid rgba(17, 24, 39, 0.1);
  }

  .publication-card .publication-field input {
    min-height: 50px;
    font-size: 16px;
  }

  .file-description-row {
    grid-column: 1 / -1;
    grid-row: 3;
  }

  .description-form label span,
  .comment-label {
    font-size: 16px;
  }

  .description-form textarea {
    min-height: 146px;
    font-size: 16px;
  }

  .post-approval-panel {
    grid-column: 1 / -1;
    grid-row: 4;
    gap: 12px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  .post-approval-head h4 {
    font-size: 16px;
  }

  .post-approval-head .file-status {
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
  }

  .post-approval-panel .approval-group {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    overflow: hidden;
    border: 1px solid rgba(17, 24, 39, 0.12);
    border-radius: 12px;
    background: #fff;
  }

  .post-approval-panel .approval {
    grid-column: auto;
    min-height: 74px;
    grid-template-columns: 1fr;
    gap: 8px;
    align-content: center;
    justify-items: start;
    padding: 12px;
    border: 0;
  }

  .post-approval-panel .approval + .approval {
    margin-top: 0;
    padding-top: 12px;
    border-top: 0;
    border-left: 1px solid rgba(17, 24, 39, 0.1);
  }

  .post-approval-panel .approval input {
    width: 28px;
    height: 28px;
  }

  .post-approval-panel .approval strong {
    font-size: 13px;
  }

  .post-approval-panel .approval small {
    max-width: 100%;
    font-size: 11px;
    white-space: nowrap;
  }

  .file-comments-row {
    grid-column: 1 / -1;
    grid-row: 5;
    gap: 14px;
    padding-top: 4px;
    border-top: 0;
  }

  .comment-label b {
    min-width: 26px;
    height: 26px;
  }
}

/* Add-media button belongs to the media summary, not below the thumbnail */
.post-media-summary .thumb-add-media {
  display: inline-grid;
  width: 66px;
  height: 28px;
  min-height: 28px;
  place-items: center;
  margin-top: 0;
  border-radius: 9px;
  color: #ef1743;
}

.post-media-summary .thumb-add-media .ui-icon {
  width: 14px;
  height: 14px;
}

@media (max-width: 760px) {
  .post-media-panel .file-thumb-stack {
    grid-template-rows: 150px;
  }

  .post-media-summary {
    gap: 5px;
    transform: translateY(-16px);
  }

  .post-media-summary .thumb-add-media {
    width: 58px;
    height: 28px;
    min-height: 28px;
    margin-top: 1px;
  }
}

@media (max-width: 760px) {
  .post-media-panel .file-actions {
    grid-template-columns: repeat(auto-fit, minmax(50px, 1fr));
  }

  .post-media-panel .download-icon,
  .post-media-panel .file-actions .icon-button {
    height: 52px;
    min-height: 52px;
  }

  .post-media-panel .file-actions .action-label {
    display: none;
  }
}

/* Refined card composition */
.description-input-shell {
  overflow: hidden;
  border: 1px solid rgba(17, 24, 39, 0.12);
  border-radius: 12px;
  background: #fff;
}

.description-input-shell textarea {
  display: block;
  width: 100%;
  min-height: 142px;
  border: 0;
  border-radius: 0;
  resize: vertical;
}

.description-input-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  margin: 0 16px;
  border-top: 1px solid rgba(17, 24, 39, 0.1);
  color: var(--muted);
}

.description-input-footer span {
  display: inline-flex;
  gap: 16px;
  align-items: center;
}

.description-tools {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.description-emoji-button {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
}

.description-emoji-button:hover {
  background: rgba(239, 23, 67, 0.06);
  color: #ef1743;
}

.description-emoji-popover {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(8, 30px);
  gap: 3px;
  padding: 8px;
  border: 1px solid rgba(17, 24, 39, 0.12);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 16px 36px rgba(17, 24, 39, 0.14);
}

.description-emoji-popover[hidden] {
  display: none;
}

.description-emoji-popover button {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  font-size: 17px;
  line-height: 1;
}

.description-emoji-popover button:hover {
  background: rgba(17, 24, 39, 0.06);
}

.description-input-footer .ui-icon {
  width: 19px;
  height: 19px;
}

.description-input-footer small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.description-counter.over-limit {
  color: #ef1743;
  font-weight: 800;
}

@media (min-width: 1501px) {
  .file-list {
    gap: 16px;
  }

  .file-card {
    padding: 26px 34px 30px;
    border-color: rgba(17, 24, 39, 0.08);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.98);
  }

  .post-card-head {
    margin-bottom: 24px;
  }

  .post-card-head .file-title-button,
  .post-card-head h3 {
    font-size: 18px;
  }

  .post-card-grid,
  .file-primary.post-card-grid {
    display: grid;
    grid-template-columns: 260px minmax(460px, 1fr) 300px;
    grid-template-rows: auto auto auto;
    gap: 28px 46px;
    align-items: start;
  }

  .post-media-panel {
    grid-column: 1;
    grid-row: 1 / 4;
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .post-media-panel .file-thumb-stack {
    width: 260px;
    grid-template-rows: 340px;
    gap: 0;
  }

  .post-media-panel .video-thumb,
  .post-media-panel .file-thumb-stack .video-thumb {
    width: 260px;
    height: 340px;
    min-height: 340px;
    border-radius: 12px;
  }

  .post-media-summary {
    display: grid;
    gap: 9px;
    justify-items: start;
    transform: none;
  }

  .post-media-summary .post-media-meta,
  .post-media-summary .post-approval-note {
    font-size: 12px;
  }

  .post-media-summary .thumb-add-media {
    width: 72px;
    margin-top: 3px;
  }

  .post-media-panel .file-actions {
    display: flex;
    gap: 9px;
    margin-top: 4px;
  }

  .post-media-panel .download-icon,
  .post-media-panel .file-actions .icon-button {
    width: 40px;
    height: 40px;
    min-height: 40px;
    border-radius: 10px;
  }

  .post-work-panel {
    display: contents;
  }

  .publication-card {
    grid-column: 2;
    grid-row: 1;
    gap: 14px;
  }

  .publication-card h4,
  .description-form label span,
  .comment-label,
  .post-approval-head h4 {
    font-size: 14px;
  }

  .publication-card .publication-inline {
    width: min(100%, 620px);
    grid-template-columns: minmax(0, 1fr) minmax(150px, 0.55fr);
  }

  .publication-card .publication-field {
    min-height: 56px;
  }

  .file-description-row {
    grid-column: 2;
    grid-row: 2;
  }

  .description-form {
    gap: 12px;
  }

  .description-form textarea {
    min-height: 150px;
    padding: 17px 18px;
  }

  .description-form-actions {
    justify-content: flex-end;
  }

  .post-approval-panel {
    grid-column: 3;
    grid-row: 1 / 3;
    display: grid;
    gap: 22px;
    padding: 24px;
    border: 1px solid rgba(17, 24, 39, 0.12);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.78);
  }

  .post-approval-panel .approval-group {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    border: 0;
    background: transparent;
  }

  .post-approval-panel .approval {
    min-height: 74px;
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 14px;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .post-approval-panel .approval + .approval {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid rgba(17, 24, 39, 0.1);
    border-left: 0;
  }

  .post-approval-panel .approval input {
    width: 26px;
    height: 26px;
  }

  .post-approval-panel .approval strong {
    font-size: 13px;
  }

  .post-approval-panel .approval small {
    font-size: 11px;
    white-space: normal;
  }

  .file-comments-row {
    grid-column: 2 / 4;
    grid-row: 3;
    gap: 16px;
    margin: 10px 0 0;
    padding-top: 24px;
    border-top: 1px solid rgba(17, 24, 39, 0.1);
  }

  .inline-comments-list {
    max-height: 360px;
  }

  .comment-node {
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 14px;
  }

  .comment-avatar,
  .composer-avatar {
    width: 42px;
    height: 42px;
  }

  .comment-composer-row {
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 14px;
  }
}

@media (min-width: 761px) and (max-width: 1500px) {
  .description-input-shell textarea {
    min-height: 130px;
  }

  .description-input-footer {
    min-height: 42px;
  }

  .post-media-panel .file-thumb-stack {
    grid-template-rows: 198px;
  }

  .post-media-summary {
    gap: 7px;
  }

  .post-media-summary .thumb-add-media {
    width: 66px;
  }
}

@media (max-width: 760px) {
  .description-input-shell textarea {
    min-height: 138px;
    padding: 14px;
  }

  .description-input-footer {
    min-height: 42px;
    margin-inline: 14px;
  }

  .description-emoji-popover {
    grid-template-columns: repeat(4, 32px);
  }

  .description-emoji-popover button {
    width: 32px;
    height: 32px;
  }
}

.post-media-panel .file-actions .action-label {
  display: none;
}

/* Final desktop card lock: reference layout, approval on the right. */
@media (min-width: 761px) and (max-width: 1500px) {
  .post-card-grid,
  .file-primary.post-card-grid {
    display: grid;
    grid-template-columns: 190px minmax(260px, 1fr) minmax(205px, 240px);
    grid-template-rows: auto auto auto;
    gap: 24px;
    align-items: start;
  }

  .post-media-panel {
    grid-column: 1;
    grid-row: 1 / 4;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    align-content: start;
    min-width: 0;
  }

  .post-media-panel .file-thumb-stack {
    width: 190px;
    grid-template-rows: 248px;
    gap: 0;
  }

  .post-media-panel .video-thumb,
  .post-media-panel .file-thumb-stack .video-thumb {
    width: 190px;
    height: 248px;
    min-height: 248px;
    border-radius: 12px;
  }

  .post-media-summary {
    display: grid;
    gap: 7px;
    justify-items: start;
    transform: none;
  }

  .post-media-summary .thumb-add-media {
    width: 70px;
    height: 28px;
    min-height: 28px;
    margin-top: 2px;
  }

  .post-media-panel .file-actions {
    display: grid;
    grid-template-columns: repeat(5, 34px);
    gap: 5px;
    width: 190px;
    margin-top: 3px;
  }

  .post-media-panel .download-icon,
  .post-media-panel .file-actions .icon-button {
    width: 34px;
    height: 34px;
    min-height: 34px;
    border-radius: 9px;
  }

  .post-media-panel .file-actions .ui-icon {
    width: 15px;
    height: 15px;
  }

  .post-work-panel {
    display: contents;
  }

  .publication-card {
    grid-column: 2;
    grid-row: 1;
    gap: 12px;
    min-width: 0;
  }

  .publication-card .publication-inline {
    width: 100%;
    grid-template-columns: minmax(0, 1fr) minmax(112px, 0.55fr);
  }

  .publication-card .publication-field {
    min-height: 46px;
    padding: 0 12px;
  }

  .file-description-row {
    grid-column: 2;
    grid-row: 2;
    min-width: 0;
  }

  .description-input-shell textarea {
    min-height: 126px;
  }

  .post-approval-panel {
    grid-column: 3;
    grid-row: 1 / 3;
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    align-items: start;
    padding: 18px;
    border: 1px solid rgba(17, 24, 39, 0.12);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.78);
  }

  .post-approval-panel .approval-group {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    border: 0;
    background: transparent;
  }

  .post-approval-panel .approval {
    min-height: 64px;
    grid-template-columns: 26px minmax(0, 1fr);
    gap: 12px;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .post-approval-panel .approval + .approval {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(17, 24, 39, 0.1);
    border-left: 0;
  }

  .post-approval-panel .approval input {
    width: 23px;
    height: 23px;
  }

  .post-approval-panel .approval strong {
    font-size: 12px;
  }

  .post-approval-panel .approval small {
    font-size: 10.5px;
    white-space: normal;
  }

  .file-comments-row {
    grid-column: 2 / 4;
    grid-row: 3;
    gap: 14px;
    margin: 4px 0 0;
    padding-top: 20px;
    border-top: 1px solid rgba(17, 24, 39, 0.1);
  }
}

/* Final vertical alignment lock for post cards. */
@media (min-width: 761px) and (max-width: 1500px) {
  .post-media-panel,
  .publication-card,
  .file-description-row,
  .post-approval-panel {
    align-self: start;
    margin-top: 0;
  }

  .publication-card.date-read {
    padding-top: 0;
    border-top: 0;
  }
}

/* Card collapse and mobile separation. */
.post-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.post-collapse-button {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  min-height: 34px;
  border-radius: 10px;
}

.post-collapse-button .ui-icon {
  width: 15px;
  height: 15px;
}

.file-card.collapsed .post-card-grid {
  display: none;
}

.file-card.collapsed .post-card-head {
  margin-bottom: 0;
}

@media (max-width: 760px) {
  .file-list {
    gap: 12px;
  }

  .file-card {
    padding: 14px;
    border: 1px solid rgba(17, 24, 39, 0.12);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 12px 34px rgba(15, 23, 42, 0.07);
  }

  .file-card:hover,
  .file-card.selected {
    border-color: rgba(239, 23, 67, 0.2);
    box-shadow: 0 14px 38px rgba(15, 23, 42, 0.09);
  }

  .file-card.fully-approved {
    background: linear-gradient(180deg, rgba(236, 253, 245, 0.92), #fff 42%);
  }

  .file-card.description-approved {
    background: linear-gradient(180deg, rgba(240, 253, 250, 0.96), #fff 42%);
  }

  .file-card.published,
  .file-card.published:hover,
  .file-card.published.selected {
    background: linear-gradient(180deg, rgba(243, 244, 246, 0.95), #fff 46%);
  }

  .post-card-head {
    margin-bottom: 12px;
  }

  .post-collapse-button {
    width: 32px;
    height: 32px;
    min-height: 32px;
  }

  .file-card.collapsed {
    padding-bottom: 14px;
  }
}

/* User avatars. */
.avatar {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: var(--avatar-color, #101010);
  color: #fff;
  font-size: 11px;
  font-weight: 850;
  line-height: 1;
  text-transform: uppercase;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-button {
  display: grid;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.avatar-button .profile-avatar,
.profile-avatar.avatar {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(239, 23, 67, 0.45);
  box-shadow: 0 0 0 4px rgba(239, 23, 67, 0.06);
}

.avatar-button:hover .profile-avatar {
  box-shadow: 0 0 0 4px rgba(239, 23, 67, 0.13);
}

.user-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 38px;
  height: 38px;
}

.comment-avatar.avatar,
.composer-avatar.avatar {
  width: 36px;
  height: 36px;
  background: var(--avatar-color, #101010);
}

.approval-settings {
  display: grid;
  gap: 8px;
  margin: 2px 0 0;
  padding: 10px;
  border: 1px solid rgba(17, 24, 39, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.approval-settings legend {
  padding: 0 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Mentions and notifications */
.notifications-wrap {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
}

.notification-button {
  position: relative;
}

.notification-button strong {
  position: absolute;
  top: -5px;
  right: -5px;
  display: grid;
  min-width: 17px;
  height: 17px;
  place-items: center;
  padding: 0 5px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
}

.notifications-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 95;
  width: min(340px, calc(100vw - 24px));
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 52px rgba(15, 19, 32, 0.14);
}

.notifications-head,
.notification-item {
  display: flex;
  align-items: center;
}

.notifications-head {
  justify-content: space-between;
  padding: 2px 2px 8px;
  color: var(--ink);
  font-size: 12px;
}

.notifications-head span {
  display: grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 999px;
  background: #f2f3f5;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.notifications-list {
  display: grid;
  gap: 4px;
  max-height: 360px;
  overflow: auto;
}

.notification-item {
  width: 100%;
  gap: 9px;
  align-items: flex-start;
  padding: 9px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  text-align: left;
}

.notification-item:hover,
.notification-item:focus-visible {
  background: #f7f8fa;
}

.notification-item > span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.notification-item b {
  color: var(--ink);
  font-size: 12px;
  line-height: 1.2;
}

.notification-item small,
.notification-item em,
.notifications-menu p {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.notification-item em {
  overflow: hidden;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notification-avatar {
  width: 32px;
  height: 32px;
}

.mention-avatar {
  width: 28px;
  height: 28px;
}

.comment-input-row,
.edit-comment-form {
  position: relative;
}

.mention-suggest {
  position: absolute;
  left: 0;
  right: 52px;
  bottom: calc(100% + 6px);
  z-index: 60;
  display: grid;
  gap: 3px;
  max-height: 240px;
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 14px 36px rgba(15, 19, 32, 0.12);
}

.mention-suggest[hidden] {
  display: none;
}

.mention-suggest button {
  display: grid;
  width: 100%;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 7px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  text-align: left;
}

.mention-suggest button:hover,
.mention-suggest button.active {
  background: #f6f7f9;
}

.mention-suggest button span {
  display: grid;
  min-width: 0;
}

.mention-suggest strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mention-suggest small {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mention-token {
  color: var(--accent);
  font-weight: 850;
}

.inline-comment-item.highlighted .comment-bubble {
  border-radius: 10px;
  animation: comment-highlight 2.4s ease;
}

@keyframes comment-highlight {
  0% {
    background: #fff1f4;
    box-shadow: 0 0 0 6px rgba(239, 21, 62, 0.09);
  }
  100% {
    background: transparent;
    box-shadow: none;
  }
}

.approval-settings label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 750;
}

.approval-settings input {
  width: 15px;
  height: 15px;
}

.approval.optional:not(.approved) {
  opacity: 0.58;
}

.preview-publication-card {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(17, 24, 39, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.86);
}

.preview-publication-card .publication-inline {
  width: 100%;
}

@media (max-width: 760px) {
  .preview-publication-card {
    margin-top: 12px;
    padding: 12px;
  }
}

/* Desktop preview modal — composition per reference */
@media (min-width: 761px) {
  .preview-backdrop {
    padding: 20px;
    place-items: center;
    background: rgba(15, 23, 42, 0.42);
  }

  .preview-modal {
    width: min(1040px, calc(100vw - 48px));
    max-height: calc(100vh - 40px);
    gap: 16px;
    padding: 20px 26px 15px;
    border: 1px solid rgba(17, 24, 39, 0.14);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 28px 90px rgba(15, 23, 42, 0.22);
  }

  .preview-modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
  }

  .preview-modal-head h2,
  .preview-modal-head h3,
  .preview-modal-head .file-title-button {
    font-size: 17px;
    line-height: 1.2;
  }

  .preview-modal-head .file-title-form input {
    height: 36px;
    font-size: 15px;
  }

  .preview-modal-head p {
    margin-top: 5px;
    font-size: 12px;
  }

  .preview-modal-head > .icon-button {
    width: 38px;
    height: 38px;
    min-height: 38px;
    border-radius: 9px;
    font-size: 21px;
  }

  .preview-layout {
    display: grid;
    grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
    gap: 28px;
    align-items: start;
  }

  .preview-media-column {
    display: grid;
    gap: 8px;
    align-content: start;
    min-width: 0;
  }

  .preview-gallery {
    gap: 8px;
    justify-items: stretch;
  }

  .preview-gallery .gallery-stage {
    width: 100%;
  }

  .preview-gallery .gallery-stage-media {
    width: 100%;
    max-width: none;
    max-height: 420px;
    justify-self: stretch;
    border-radius: 10px;
    object-fit: contain;
    background: #050914;
  }

  .preview-gallery img.gallery-stage-media {
    background: transparent;
  }

  .preview-gallery .gallery-nav {
    justify-self: center;
    width: 100%;
  }

  .preview-gallery .gallery-thumbs {
    justify-content: flex-start;
    padding: 4px 0 2px;
  }

  .preview-media-meta {
    margin: 0;
    color: var(--muted);
    font-size: 11.5px;
    line-height: 1.25;
  }

  .preview-control-column {
    display: grid;
    gap: 14px;
    align-content: start;
    min-width: 0;
    padding-top: 2px;
  }

  /* Reset post-card grid placement + card chrome leaking into the modal */
  .preview-publication-card {
    grid-column: auto;
    grid-row: auto;
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  .preview-publication-card .publication-card-head {
    align-items: baseline;
    gap: 6px 12px;
  }

  .preview-publication-card .publication-card-head h4 {
    font-size: 15px;
  }

  .preview-publication-card .publication-card-head small {
    font-size: 11px;
  }

  .preview-publication-card .publication-inline {
    width: 100%;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    border-radius: 10px;
  }

  .preview-publication-card .publication-field {
    min-height: 46px;
    padding-inline: 16px;
  }

  .preview-publication-card .publication-field input {
    font-size: 13.5px;
  }

  .preview-publication-card .publication-field .ui-icon {
    width: 17px;
    height: 17px;
  }

  .preview-approval-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    margin-top: 2px;
  }

  .preview-approval-strip .approval.large {
    min-height: 52px;
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 10px;
    padding: 4px 14px;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  .preview-approval-strip .approval.large:first-child {
    padding-left: 2px;
  }

  .preview-approval-strip .approval.large + .approval.large {
    border-left: 1px solid rgba(17, 24, 39, 0.12);
  }

  .preview-approval-strip .approval.large input {
    width: 22px;
    height: 22px;
    margin: 0;
    appearance: none;
    -webkit-appearance: none;
    border: 1.5px solid var(--line-strong);
    border-radius: 50%;
    background: #fff center / 13px 13px no-repeat;
    cursor: pointer;
    transition: border-color 0.12s ease, background-color 0.12s ease;
  }

  .preview-approval-strip .approval.large input:checked {
    border-color: var(--accent);
    background-color: var(--accent);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5.5 12.5 4 4 9-9'/%3E%3C/svg%3E");
  }

  .preview-approval-strip .approval.large input:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
  }

  .preview-approval-strip .approval.large input:disabled {
    cursor: default;
  }

  .preview-approval-strip .approval.large input:disabled:not(:checked) {
    background-color: var(--panel-soft);
  }

  .preview-approval-strip .approval.large strong {
    font-size: 13px;
  }

  .preview-approval-strip .approval.large small {
    font-size: 10.5px;
    line-height: 1.3;
    white-space: normal;
  }

  .preview-actions {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    margin-top: 2px;
    overflow: hidden;
    border: 1px solid rgba(17, 24, 39, 0.12);
    border-radius: 10px;
    background: #fff;
  }

  .preview-actions .icon-button,
  .preview-actions a.icon-button {
    display: grid;
    width: auto;
    height: auto;
    min-height: 46px;
    place-items: center;
    align-content: center;
    padding: 8px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #202938;
    text-decoration: none;
  }

  .preview-actions .icon-button span,
  .preview-actions a.icon-button span {
    display: none;
  }

  .preview-actions .icon-button + .icon-button,
  .preview-actions a.icon-button + .icon-button,
  .preview-actions .icon-button + a.icon-button,
  .preview-actions a.icon-button + a.icon-button {
    border-left: 1px solid rgba(17, 24, 39, 0.1);
  }

  .preview-actions .ui-icon {
    width: 19px;
    height: 19px;
    stroke-width: 1.75;
  }

  .preview-actions .danger-icon {
    color: var(--accent);
  }

  .preview-actions .publish-icon.active {
    color: #202938;
  }

  .preview-description {
    min-height: 130px;
    margin: 0;
    padding: 14px 16px;
    border: 1px solid rgba(17, 24, 39, 0.12);
    border-radius: 12px;
    background: #fff;
  }

  .preview-description:empty {
    display: none;
  }

  .preview-description .description-form {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  .preview-description .description-form label span {
    color: var(--ink);
    font-size: 14px;
    font-weight: 850;
    letter-spacing: 0;
    text-transform: none;
  }

  .preview-description .description-input-shell textarea {
    min-height: 70px;
  }

  .preview-description .description-form-actions {
    margin-top: 4px;
  }

  .preview-comments {
    display: grid;
    gap: 12px;
    align-content: start;
    padding: 16px;
    border: 1px solid rgba(17, 24, 39, 0.12);
    border-radius: 12px;
    background: #fff;
  }

  .preview-comments .comment-label {
    color: var(--ink);
    font-size: 14px;
  }

  .preview-comments .inline-comments-list {
    max-height: 220px;
  }

  .preview-comments .inline-comment.muted {
    margin: 14px 0 0;
    color: var(--muted);
    font-size: 12px;
  }

  .preview-modal-foot {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 20px;
    margin-top: 2px;
    padding-top: 13px;
    border-top: 1px solid rgba(17, 24, 39, 0.1);
  }

  .preview-modal-foot span {
    font-size: 11.5px;
  }
}

/* Narrow desktop adaptation */
@media (min-width: 761px) and (max-width: 1120px) {
  .preview-modal {
    padding: 18px 20px 14px;
  }

  .preview-layout {
    grid-template-columns: minmax(230px, 280px) minmax(0, 1fr);
    gap: 22px;
  }

  .preview-publication-card .publication-field {
    min-height: 44px;
    padding-inline: 13px;
  }

  .preview-publication-card .publication-field input {
    font-size: 13px;
  }

  .preview-approval-strip .approval.large {
    min-height: 48px;
    grid-template-columns: 20px minmax(0, 1fr);
    gap: 9px;
    padding: 4px 11px;
  }

  .preview-approval-strip .approval.large input {
    width: 20px;
    height: 20px;
    background-size: 12px 12px;
  }

  .preview-approval-strip .approval.large strong {
    font-size: 12px;
  }

  .preview-approval-strip .approval.large small {
    font-size: 10px;
  }

  .preview-actions .icon-button,
  .preview-actions a.icon-button {
    min-height: 42px;
    padding: 7px;
  }

  .preview-actions .ui-icon {
    width: 18px;
    height: 18px;
  }
}

/* Mobile preview actions: icon row without labels */
@media (max-width: 760px) {
  .preview-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
  }

  .preview-actions .icon-button span,
  .preview-actions a.icon-button span {
    display: none;
  }

  .preview-publication-card .publication-field {
    min-height: 40px;
    gap: 6px;
    padding: 0 8px;
  }

  .preview-publication-card .publication-field input {
    min-height: 38px;
    font-size: 13px;
  }

  .preview-publication-card .publication-field .ui-icon {
    width: 15px;
    height: 15px;
  }

  .preview-approval-strip {
    margin-top: 14px;
  }
}

/* Approval stage color lock: one stage = orange, both stages = green. */
.file-card.fully-approved:not(.description-approved):not(.published),
.file-card.fully-approved:not(.description-approved):not(.published):hover,
.file-card.fully-approved:not(.description-approved):not(.published).selected {
  border-color: rgba(245, 140, 32, 0.52);
  background:
    linear-gradient(90deg, rgba(245, 140, 32, 0.14), rgba(245, 140, 32, 0.045) 44%, rgba(255, 255, 255, 0.96));
  box-shadow: 0 8px 24px rgba(245, 140, 32, 0.09);
}

.file-card.description-approved:not(.published),
.file-card.description-approved:not(.published):hover,
.file-card.description-approved:not(.published).selected {
  border-color: rgba(20, 169, 155, 0.46);
  background:
    linear-gradient(90deg, rgba(20, 169, 155, 0.13), rgba(20, 169, 155, 0.04) 46%, rgba(255, 255, 255, 0.96));
  box-shadow: 0 8px 24px rgba(20, 169, 155, 0.1);
}

@media (max-width: 760px) {
  .file-card.fully-approved:not(.description-approved):not(.published),
  .file-card.fully-approved:not(.description-approved):not(.published):hover,
  .file-card.fully-approved:not(.description-approved):not(.published).selected {
    border-color: rgba(245, 140, 32, 0.52);
    background:
      linear-gradient(180deg, rgba(245, 140, 32, 0.14), rgba(245, 140, 32, 0.045) 46%, rgba(255, 255, 255, 0.96));
  }

  .file-card.description-approved:not(.published),
  .file-card.description-approved:not(.published):hover,
  .file-card.description-approved:not(.published).selected {
    border-color: rgba(20, 169, 155, 0.46);
    background:
      linear-gradient(180deg, rgba(20, 169, 155, 0.13), rgba(20, 169, 155, 0.04) 46%, rgba(255, 255, 255, 0.96));
  }
}

/* Approval queue section */
.view-tabs button strong {
  display: inline-grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 999px;
  padding: 0 6px;
  background: rgba(239, 23, 67, 0.1);
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.view-tabs button.active strong {
  background: var(--accent);
  color: #fff;
}

.approvals-layout {
  display: grid;
  max-width: 1540px;
  margin: 0 auto;
}

.approvals-content {
  min-width: 0;
}

.approvals-head {
  align-items: center;
}

.approvals-head p {
  max-width: 640px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.approvals-tools {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 12px;
  min-width: min(100%, 420px);
}

.approval-folder-filter {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 6px 8px;
  align-items: end;
  min-width: min(100%, 340px);
}

.approval-folder-filter span {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.approval-folder-filter select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 750;
}

.approval-folder-filter .icon-button {
  width: 42px;
  height: 42px;
  min-height: 42px;
  border-radius: 10px;
}

.approval-counter-large {
  display: inline-grid;
  min-width: 50px;
  height: 50px;
  place-items: center;
  border-radius: 14px;
  background: rgba(239, 23, 67, 0.1);
  color: var(--accent);
  font-size: 18px;
  font-weight: 900;
}

@media (max-width: 900px) {
  .view-tabs button strong {
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    font-size: 10px;
  }
}

@media (max-width: 560px) {
  .view-tabs {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .view-tabs button {
    min-width: 0;
  }

  .view-tabs button span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .approval-counter-large {
    min-width: 42px;
    height: 42px;
    border-radius: 12px;
    font-size: 15px;
  }

  .approvals-head {
    gap: 14px;
  }

  .approvals-tools {
    width: 100%;
    min-width: 0;
    justify-content: stretch;
  }

  .approval-folder-filter {
    min-width: 0;
    grid-template-columns: minmax(0, 1fr) auto;
  }
}

/* Mobile notification dropdown fit */
@media (max-width: 760px) {
  .notifications-menu {
    position: fixed;
    top: 86px;
    right: 10px;
    left: auto;
    width: min(360px, calc(100vw - 20px));
    max-width: calc(100vw - 20px);
    max-height: min(420px, calc(100vh - 106px));
    overflow: auto;
    text-align: right;
  }

  .notifications-head {
    text-align: right;
  }

  .notification-item {
    grid-template-columns: minmax(0, 1fr) 32px;
    direction: rtl;
    text-align: right;
  }

  .notification-item > span {
    direction: ltr;
    text-align: right;
  }

  .notification-item em {
    white-space: normal;
  }

  .notification-avatar {
    order: 2;
  }
}

@media (max-width: 420px) {
  .notifications-menu {
    top: 80px;
    right: 8px;
    width: calc(100vw - 16px);
    max-width: calc(100vw - 16px);
  }
}

/* Mobile app section dropdown */
.mobile-section-nav {
  display: none;
}

@media (max-width: 760px) {
  .topbar {
    position: sticky;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .view-tabs {
    display: none;
  }

  .mobile-section-nav {
    position: relative;
    z-index: 35;
    display: block;
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
  }

  .mobile-section-toggle {
    display: grid;
    width: 100%;
    min-height: 42px;
    grid-template-columns: 22px minmax(0, 1fr) auto 18px;
    gap: 9px;
    align-items: center;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.94);
    color: var(--ink);
    box-shadow: 0 8px 22px rgba(15, 19, 32, 0.04);
    text-align: left;
  }

  .mobile-section-toggle.active {
    border-color: rgba(239, 23, 67, 0.34);
    color: var(--accent);
  }

  .mobile-section-toggle span {
    overflow: hidden;
    font-size: 13px;
    font-weight: 850;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-section-toggle strong,
  .mobile-section-menu strong {
    display: inline-grid;
    min-width: 24px;
    height: 24px;
    place-items: center;
    padding: 0 7px;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
  }

  .mobile-section-toggle .ui-icon:last-child {
    width: 15px;
    height: 15px;
    justify-self: end;
    transform: rotate(90deg);
    transition: transform 0.16s ease;
  }

  .mobile-section-toggle.active .ui-icon:last-child {
    transform: rotate(-90deg);
  }

  .mobile-section-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 90;
    display: grid;
    gap: 4px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 18px 52px rgba(15, 19, 32, 0.14);
  }

  .mobile-section-menu button {
    display: grid;
    width: 100%;
    min-height: 42px;
    grid-template-columns: 22px minmax(0, 1fr) auto;
    gap: 9px;
    align-items: center;
    padding: 0 10px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--ink-soft);
    text-align: left;
  }

  .mobile-section-menu button:hover,
  .mobile-section-menu button.active {
    background: #fff1f4;
    color: var(--accent);
  }

  .mobile-section-menu span {
    overflow: hidden;
    font-size: 13px;
    font-weight: 850;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}
