: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.9;
}

.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);
}

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

.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-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;
}

.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-modal-head h2 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.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%;
  }
}
