/* Ocean Builders Media Library - React module */

:root {
  --ml-blue: #2870b0;
  --ml-blue-dark: #1b4d7c;
  --ml-blue-soft: #ecf2fa;
  --ml-deep: #0e2d44;
  --ml-surf: #4fb6c7;
  --ml-coral: #e27462;
  --ml-sand: #e9dcc4;
  --ml-page: #f4f6f9;
  --ml-panel: #ffffff;
  --ml-rail: #fbfcfd;
  --ml-line: #e3e8ee;
  --ml-line-strong: #d5dce4;
  --ml-ink: #0e141c;
  --ml-body: #353d48;
  --ml-muted: #6b7685;
  --ml-soft: #f5f8fc;
  --ml-danger: #b42318;
  --ml-success: #2e8a5a;
  --ml-warning: #b57d00;
  --ml-font: Poppins, Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* {
  box-sizing: border-box;
}

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

body[data-media-mode] {
  color: var(--ml-ink);
  font-family: var(--ml-font);
  letter-spacing: 0;
}

body[data-media-mode="admin"] {
  min-height: 100vh;
  background: var(--ml-page);
  display: flex;
  flex-direction: column;
}

body[data-media-mode="public"] {
  min-height: 100vh;
  background: #172230;
}

body[data-media-mode="admin"] #media-root {
  flex: 1;
  min-height: 0;
}

button,
input,
textarea,
select {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

a {
  color: inherit;
}

.ml-hidden-input {
  display: none;
}

.ml-app {
  min-height: calc(100vh - var(--ob-nav-height, 56px));
  background: var(--ml-page);
  color: var(--ml-ink);
  font-size: 13px;
}

.ml-shell {
  min-height: calc(100vh - var(--ob-nav-height, 56px));
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr) 380px;
  background: var(--ml-page);
}

.ml-rail {
  min-width: 0;
  background: var(--ml-rail);
  border-right: 1px solid var(--ml-line);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: auto;
}

.ml-rail-hd {
  padding: 16px 16px 9px;
}

.ml-rail-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--ml-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.ml-rail-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--ml-muted);
  background: transparent;
}

.ml-rail-add:hover {
  color: var(--ml-blue);
  background: var(--ml-blue-soft);
}

.ml-coll-list {
  list-style: none;
  margin: 0;
  padding: 3px 8px 12px;
  display: grid;
  gap: 2px;
}

.ml-coll {
  width: 100%;
  border: 0;
  background: transparent;
  font: inherit;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 7px 10px;
  border-radius: 7px;
  color: var(--ml-body);
  user-select: none;
}

.ml-coll:hover {
  background: rgba(40, 112, 176, 0.07);
}

.ml-coll.is-active {
  background: var(--ml-blue-soft);
  color: var(--ml-blue-dark);
  font-weight: 800;
}

.ml-coll-name {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ml-coll-count {
  color: var(--ml-muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.ml-coll-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--ml-surf);
  flex: 0 0 auto;
}

.ml-coll-manage {
  display: flex;
  align-items: center;
  gap: 3px;
}

.ml-coll-manage .ml-coll {
  flex: 1;
  min-width: 0;
}

.ml-coll-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  opacity: 0.32;
  transition: opacity 0.15s ease;
}

.ml-coll-manage:hover .ml-coll-actions,
.ml-coll-manage:focus-within .ml-coll-actions {
  opacity: 1;
}

.ml-icon-btn {
  width: 28px;
  height: 28px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--ml-muted);
  display: inline-grid;
  place-items: center;
}

.ml-icon-btn:hover {
  color: var(--ml-blue-dark);
  border-color: var(--ml-line-strong);
  background: #fff;
}

.ml-icon-btn.is-danger:hover {
  color: var(--ml-danger);
  border-color: #f3b6b0;
  background: #fff4f2;
}

.ml-coll-edit {
  margin: 2px 0;
  padding: 8px;
  border: 1px solid var(--ml-line);
  border-radius: 8px;
  background: #fff;
  display: grid;
  gap: 7px;
}

.ml-coll-edit-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.ml-tab-empty-note {
  padding: 8px 10px;
  color: var(--ml-muted);
  font-size: 12px;
  line-height: 1.45;
}

.ml-rail-sep {
  width: auto;
  margin: 8px 16px;
  border: 0;
  border-top: 1px solid var(--ml-line);
}

.ml-new-coll {
  padding: 0 12px 14px;
  display: grid;
  gap: 8px;
}

.ml-new-coll input,
.ml-new-coll textarea,
.ml-coll-edit input,
.ml-inline-create input,
.ml-field input,
.ml-field textarea,
.ml-field select {
  width: 100%;
  border: 1px solid var(--ml-line-strong);
  border-radius: 7px;
  background: #fff;
  color: var(--ml-ink);
  padding: 9px 10px;
  outline: none;
}

.ml-new-coll textarea,
.ml-field textarea {
  min-height: 76px;
  resize: vertical;
}

.ml-new-coll input:focus,
.ml-new-coll textarea:focus,
.ml-coll-edit input:focus,
.ml-inline-create input:focus,
.ml-field input:focus,
.ml-field textarea:focus,
.ml-field select:focus,
.ml-search input:focus,
.pub-search-box input:focus {
  border-color: var(--ml-blue);
  box-shadow: 0 0 0 3px rgba(40, 112, 176, 0.16);
}

.ml-rail-status {
  color: var(--ml-muted);
  font-size: 11px;
  line-height: 1.35;
}

.ml-rail-invites {
  padding: 2px 8px 18px;
  display: grid;
  gap: 7px;
}

.ml-invite-card {
  border: 1px solid var(--ml-line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.ml-invite-name,
.ml-invite-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ml-invite-name {
  justify-content: space-between;
  color: var(--ml-ink);
  font-size: 12px;
  font-weight: 800;
}

.ml-invite-name span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ml-invite-co {
  margin-top: 3px;
  color: var(--ml-muted);
  font-size: 11px;
}

.ml-invite-bar {
  margin-top: 8px;
  color: var(--ml-muted);
  font-size: 11px;
  flex-wrap: wrap;
}

.ml-invite-bar span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.ml-invite-expiry {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.ml-invite-expiry.is-ok {
  color: var(--ml-success);
}

.ml-invite-expiry.is-soon {
  color: var(--ml-coral);
}

.ml-rail-empty {
  color: var(--ml-muted);
  font-size: 12px;
  padding: 10px;
}

.ml-canvas {
  min-width: 0;
  min-height: 0;
  background: var(--ml-panel);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--ml-line);
}

.ml-canvas-hd {
  min-height: 92px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--ml-line);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.ml-page-title {
  margin: 0;
  color: var(--ml-ink);
  font-family: Manrope, var(--ml-font);
  font-size: 24px;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: 0;
}

.ml-page-meta {
  margin-top: 7px;
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  color: var(--ml-muted);
  font-size: 12px;
}

.ml-page-meta b {
  color: var(--ml-body);
}

.ml-page-meta-dot {
  width: 3px;
  height: 3px;
  border-radius: 999px;
  background: var(--ml-line-strong);
}

.ml-canvas-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.ml-btn-primary,
.ml-btn-secondary,
.ml-btn-danger,
.ml-btn-ghost,
.ml-dl-btn,
.pub-dl-btn,
.pub-accept-btn {
  min-height: 34px;
  border-radius: 7px;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 11px;
  font-size: 12px;
  line-height: 1;
  font-weight: 800;
  text-decoration: none;
}

.ml-btn-primary,
.pub-dl-btn,
.pub-accept-btn {
  background: var(--ml-blue);
  color: #fff;
  border-color: var(--ml-blue);
}

.ml-btn-primary:hover,
.pub-dl-btn:hover,
.pub-accept-btn:hover {
  background: var(--ml-blue-dark);
  border-color: var(--ml-blue-dark);
}

.ml-btn-secondary,
.ml-btn-ghost {
  color: var(--ml-body);
  background: #fff;
  border-color: var(--ml-line-strong);
}

.ml-btn-secondary:hover,
.ml-btn-ghost:hover {
  color: var(--ml-blue-dark);
  border-color: var(--ml-blue);
  background: var(--ml-blue-soft);
}

.ml-btn-danger {
  color: var(--ml-danger);
  background: #fff;
  border-color: #f3b6b0;
}

.ml-btn-danger:hover {
  background: #fff4f2;
}

.ml-alert,
.ml-warning {
  margin: 12px 24px 0;
  border: 1px solid #f3d498;
  background: #fff9ed;
  color: #7a4f00;
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  line-height: 1.45;
}

.ml-warning.is-error {
  border-color: #f3b6b0;
  background: #fff4f2;
  color: var(--ml-danger);
}

.ml-drop-strip {
  margin: 16px 24px 0;
  min-height: 72px;
  border: 1px dashed #99b8d6;
  border-radius: 8px;
  background: #f8fbfe;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
}

.ml-drop-strip.is-active {
  background: var(--ml-blue-soft);
  border-color: var(--ml-blue);
}

.ml-drop-title {
  color: var(--ml-ink);
  font-size: 14px;
  font-weight: 800;
}

.ml-drop-sub {
  margin-top: 3px;
  color: var(--ml-muted);
  font-size: 12px;
  line-height: 1.45;
}

.ml-pending-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 4px 9px;
  background: #fff;
  color: var(--ml-blue-dark);
  border: 1px solid var(--ml-line-strong);
  font-size: 11px;
  font-weight: 800;
}

.ml-toolbar {
  min-height: 60px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--ml-line);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ml-search {
  width: min(330px, 100%);
  min-height: 36px;
  border: 1px solid var(--ml-line-strong);
  border-radius: 8px;
  background: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  color: var(--ml-muted);
}

.ml-search input,
.pub-search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  outline: 0;
  color: var(--ml-ink);
}

.ml-pill-filter {
  min-height: 32px;
  border: 1px solid var(--ml-line-strong);
  border-radius: 999px;
  background: #fff;
  color: var(--ml-body);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 800;
}

.ml-pill-filter b {
  color: var(--ml-muted);
  font-size: 11px;
}

.ml-pill-filter.is-on {
  background: var(--ml-blue-soft);
  color: var(--ml-blue-dark);
  border-color: #b6d2ec;
}

.ml-trash-toggle input {
  margin: 0;
}

.ml-toolbar-grow {
  flex: 1;
}

.ml-view-toggle,
.ml-seg {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--ml-line-strong);
  border-radius: 8px;
  background: var(--ml-soft);
}

.ml-view-toggle button,
.ml-seg button {
  min-height: 28px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ml-muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 800;
}

.ml-view-toggle button.is-on,
.ml-seg button.is-on {
  color: var(--ml-blue-dark);
  background: #fff;
  box-shadow: 0 1px 2px rgba(14, 45, 68, 0.08);
}

.ml-table-scroll,
.ml-grid-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.ml-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.ml-table th {
  height: 36px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--ml-line);
  color: var(--ml-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.ml-table td {
  padding: 10px;
  border-bottom: 1px solid #edf1f5;
  color: var(--ml-body);
  vertical-align: middle;
}

.ml-table tbody tr {
  cursor: pointer;
}

.ml-table tbody tr:hover {
  background: #f8fbfe;
}

.ml-table tbody tr.is-selected {
  background: var(--ml-blue-soft);
  box-shadow: inset 3px 0 0 var(--ml-blue);
}

.ml-th-thumb {
  width: 86px;
}

.ml-cell-num {
  width: 88px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.ml-cell-time {
  color: var(--ml-muted);
  font-size: 12px;
}

.ml-cell-title {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.ml-cell-title-row {
  color: var(--ml-ink);
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ml-cell-title-sub {
  color: var(--ml-muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ml-thumb {
  position: relative;
  width: 66px;
  height: 48px;
  border-radius: 6px;
  background: #e7edf3;
  color: var(--ml-muted);
  display: grid;
  place-items: center;
  overflow: hidden;
  font-size: 11px;
  font-weight: 900;
}

.ml-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ml-thumb.is-pdf {
  color: var(--ml-blue-dark);
  background: #edf6f8;
  border: 1px solid #cae4ea;
}

.ml-thumb-play,
.pub-thumb-play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(14, 20, 28, 0.68);
  color: #fff;
}

.ml-type-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  min-height: 22px;
  border-radius: 999px;
  padding: 3px 8px;
  background: var(--ml-blue-soft);
  color: var(--ml-blue-dark);
  font-size: 11px;
  line-height: 1;
  font-weight: 900;
  text-transform: uppercase;
}

.ml-type-mp4 {
  background: #eef9fb;
  color: #236e78;
}

.ml-type-pdf {
  background: #fff4f2;
  color: #a33b2f;
}

.ml-tag-list {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.ml-tag,
.ml-tag-more {
  display: inline-flex;
  align-items: center;
  max-width: 150px;
  min-height: 22px;
  border-radius: 999px;
  padding: 3px 8px;
  background: #f5f7fa;
  color: var(--ml-body);
  font-size: 11px;
  font-weight: 800;
}

.ml-tag {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ml-tag-more {
  color: var(--ml-muted);
}

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

.ml-vis {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--ml-body);
  background: #f5f7fa;
  font-size: 11px;
  font-weight: 900;
}

.ml-vis-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentcolor;
}

.ml-vis-on {
  color: var(--ml-success);
  background: #e6f2eb;
}

.ml-vis-sched {
  color: var(--ml-warning);
  background: #fbf3dc;
}

.ml-vis-trash,
.ml-vis-off {
  color: var(--ml-muted);
}

.ml-grid {
  padding: 18px 24px 26px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
}

.ml-tile {
  text-align: left;
  border: 1px solid var(--ml-line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
  padding: 0;
  color: inherit;
}

.ml-tile:hover,
.ml-tile.is-selected {
  border-color: var(--ml-blue);
  box-shadow: 0 8px 22px rgba(14, 45, 68, 0.12);
}

.ml-tile-thumb {
  display: block;
  aspect-ratio: 16 / 10;
  background: #e7edf3;
}

.ml-tile-thumb .ml-thumb {
  width: 100%;
  height: 100%;
  border-radius: 0;
}

.ml-tile-body {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.ml-tile-name {
  min-height: 34px;
  color: var(--ml-ink);
  font-weight: 900;
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.ml-tile-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--ml-muted);
  font-size: 11px;
}

.ml-empty {
  margin: auto;
  max-width: 390px;
  padding: 38px 24px;
  text-align: center;
  color: var(--ml-muted);
}

.ml-empty-mark {
  width: 64px;
  height: 64px;
  margin: 0 auto 14px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--ml-blue);
  background: var(--ml-blue-soft);
}

.ml-empty h2 {
  margin: 0 0 8px;
  color: var(--ml-ink);
  font-size: 18px;
}

.ml-empty p {
  margin: 0 0 18px;
  line-height: 1.55;
}

.ml-empty-actions,
.ml-inline-create {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ml-inline-create {
  justify-content: flex-start;
}

.ml-inline-create input {
  min-width: min(240px, 100%);
  min-height: 34px;
}

.ml-inspector {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  background: #fff;
}

.ml-inspector-empty {
  padding: 28px;
  color: var(--ml-muted);
  line-height: 1.5;
}

.ml-insp-preview {
  height: 236px;
  background: #0b1220;
  display: grid;
  place-items: center;
  color: #cbd5e1;
}

.ml-insp-preview img,
.ml-insp-preview video,
.ml-insp-preview iframe {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border: 0;
  background: #0b1220;
}

.ml-preview-fallback {
  color: #cbd5e1;
  font-size: 18px;
  font-weight: 900;
}

.ml-insp-body {
  padding: 16px;
  display: grid;
  gap: 12px;
}

.ml-insp-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ml-insp-title {
  margin: 0;
  color: var(--ml-ink);
  font-size: 18px;
}

.ml-field {
  display: grid;
  gap: 6px;
}

.ml-field label {
  color: var(--ml-body);
  font-size: 12px;
  font-weight: 900;
}

.ml-insp-section {
  border: 1px solid var(--ml-line);
  border-radius: 8px;
  background: #fbfcfd;
}

.ml-insp-section-hd {
  padding: 11px 12px;
  border-bottom: 1px solid var(--ml-line);
  color: var(--ml-ink);
  font-size: 12px;
  font-weight: 900;
}

.ml-tab-assign {
  display: grid;
}

.ml-tab-row {
  padding: 10px 12px;
  border-bottom: 1px solid var(--ml-line);
  display: grid;
  gap: 9px;
}

.ml-tab-row:last-child {
  border-bottom: 0;
}

.ml-tab-row-l,
.ml-tab-row-fields,
.ml-check,
.ml-send-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ml-tab-row-name {
  color: var(--ml-ink);
  font-weight: 900;
}

.ml-tab-row-fields {
  flex-wrap: wrap;
}

.ml-tab-row-fields label {
  min-height: 32px;
  border: 1px solid var(--ml-line-strong);
  border-radius: 7px;
  background: #fff;
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 800;
}

.ml-tab-row-fields input[type="datetime-local"] {
  min-height: 32px;
  min-width: 170px;
}

.ml-tab-row-fields input[type="number"] {
  width: 78px;
  min-height: 32px;
}

.ml-tab-row-fields input[type="datetime-local"],
.ml-tab-row-fields input[type="number"] {
  border: 1px solid var(--ml-line-strong);
  border-radius: 7px;
  padding: 5px 7px;
}

.ml-meta-grid {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.ml-meta-grid div {
  min-width: 0;
  border: 1px solid var(--ml-line);
  border-radius: 8px;
  padding: 9px;
  background: var(--ml-soft);
}

.ml-meta-grid dt {
  color: var(--ml-muted);
  font-size: 11px;
  font-weight: 900;
}

.ml-meta-grid dd {
  margin: 3px 0 0;
  color: var(--ml-body);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.ml-insp-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ml-editor-status {
  color: var(--ml-muted);
  font-size: 12px;
}

.ml-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 20px;
}

.ml-shroud,
.pub-notice-shroud {
  position: absolute;
  inset: 0;
  background: rgba(7, 13, 24, 0.58);
}

.ml-dialog {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
  max-height: min(860px, 92vh);
  overflow: auto;
  border: 1px solid var(--ml-line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 48px rgba(14, 45, 68, 0.2);
}

.ml-dialog-hd {
  position: relative;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--ml-line);
}

.ml-dialog-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ml-blue-dark);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.ml-dialog-title {
  margin: 6px 0 4px;
  color: var(--ml-ink);
  font-size: 22px;
  line-height: 1.2;
}

.ml-dialog-sub {
  margin: 0;
  color: var(--ml-muted);
  line-height: 1.5;
}

.ml-dialog-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: 1px solid var(--ml-line-strong);
  border-radius: 7px;
  background: #fff;
  color: var(--ml-muted);
  display: grid;
  place-items: center;
}

.ml-dialog-body {
  padding: 18px 20px;
  display: grid;
  gap: 14px;
}

.ml-dialog-ft {
  padding: 14px 20px;
  border-top: 1px solid var(--ml-line);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.ml-upload-queue {
  max-height: 180px;
  overflow: auto;
  display: grid;
  gap: 7px;
}

.ml-upload-row {
  border: 1px solid var(--ml-line);
  border-radius: 7px;
  background: var(--ml-soft);
  padding: 9px 10px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--ml-body);
  font-size: 12px;
}

.ml-upload-row span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ml-tab-check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.ml-tab-check {
  min-height: 42px;
  border: 1px solid var(--ml-line);
  border-radius: 8px;
  background: #fff;
  padding: 9px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ml-body);
  font-size: 12px;
  font-weight: 900;
}

.ml-tab-check input[type="checkbox"],
.ml-tab-row input[type="checkbox"],
.ml-check input[type="checkbox"],
.ml-send-toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  margin: 0;
  padding: 0;
  accent-color: var(--ml-blue);
}

.ml-tab-check.is-on {
  border-color: #b6d2ec;
  background: var(--ml-blue-soft);
  color: var(--ml-blue-dark);
}

.ml-tab-check-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ml-no-tabs-card {
  border: 1px solid #f3d498;
  border-radius: 8px;
  background: #fff9ed;
  color: #6d4b05;
  padding: 12px;
  display: grid;
  gap: 12px;
}

.ml-no-tabs-card strong,
.ml-no-tabs-card span {
  display: block;
}

.ml-no-tabs-card strong {
  color: var(--ml-ink);
  font-size: 13px;
}

.ml-no-tabs-card span {
  margin-top: 3px;
  font-size: 12px;
  line-height: 1.45;
}

.ml-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.ml-gen-link {
  border: 1px solid #b6d2ec;
  border-radius: 8px;
  background: #f8fbfe;
  padding: 10px;
  display: grid;
  gap: 8px;
}

.ml-gen-link code {
  color: var(--ml-blue-dark);
  overflow-wrap: anywhere;
}

.ml-gen-link button {
  justify-self: start;
  min-height: 30px;
  border: 1px solid var(--ml-line-strong);
  border-radius: 7px;
  background: #fff;
  color: var(--ml-body);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  font-weight: 800;
}

.ml-send-toggle {
  justify-content: flex-start;
  color: var(--ml-body);
  font-weight: 900;
}

/* Public package */

.pub-app {
  min-height: 100vh;
  background: #f5f7fa;
  color: var(--ml-ink);
  font-family: var(--ml-font);
}

.pub-topbar {
  height: 64px;
  border-bottom: 1px solid rgba(14, 45, 68, 0.1);
  background: rgba(255, 255, 255, 0.96);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 30;
}

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

.pub-brand img {
  width: auto;
  height: 32px;
  display: block;
}

.pub-brand-div {
  width: 1px;
  height: 24px;
  background: var(--ml-line-strong);
}

.pub-brand-label {
  color: var(--ml-body);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.pub-expiry-pill {
  min-height: 32px;
  border-radius: 999px;
  border: 1px solid var(--ml-line-strong);
  background: #fff;
  color: var(--ml-body);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.pub-hd {
  background: var(--ml-deep);
  color: #fff;
  border-bottom: 4px solid var(--ml-surf);
}

.pub-hd-inner {
  max-width: 1480px;
  margin: 0 auto;
  padding: 38px 24px 34px;
  background-image: url("/images/media/shell_white.png");
  background-repeat: no-repeat;
  background-position: right 32px center;
  background-size: min(22vw, 220px);
}

.pub-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.pub-shell {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.pub-title {
  width: min(780px, 100%);
  margin: 10px 0 12px;
  font-family: Manrope, var(--ml-font);
  font-size: 38px;
  line-height: 1.08;
  font-weight: 900;
  letter-spacing: 0;
}

.pub-prepared-for {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
}

.pub-prepared-for b {
  color: #fff;
}

.pub-prepared-for .div {
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.32);
}

.pub-tabs {
  min-height: 60px;
  max-width: 1480px;
  margin: 0 auto;
  padding: 12px 24px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  background: #fff;
  border-bottom: 1px solid var(--ml-line);
}

.pub-tab {
  flex: 0 0 auto;
  border: 1px solid var(--ml-line-strong);
  border-radius: 999px;
  background: #fff;
  color: var(--ml-body);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 900;
}

.pub-tab.is-active {
  color: #fff;
  background: var(--ml-blue);
  border-color: var(--ml-blue);
}

.pub-tab-count {
  min-width: 22px;
  min-height: 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(14, 20, 28, 0.08);
  font-size: 11px;
}

.pub-tab.is-active .pub-tab-count {
  color: var(--ml-blue-dark);
  background: #fff;
}

.pub-tab-spacer {
  flex: 1 0 20px;
}

.pub-tab-meta {
  flex: 0 0 auto;
  color: var(--ml-muted);
  font-size: 12px;
  font-weight: 800;
}

.pub-split {
  max-width: 1480px;
  min-height: calc(100vh - 234px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  background: #fff;
  border-left: 1px solid var(--ml-line);
  border-right: 1px solid var(--ml-line);
}

.pub-list {
  min-width: 0;
  border-right: 1px solid var(--ml-line);
  background: #fbfcfd;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.pub-list-search {
  padding: 14px;
  border-bottom: 1px solid var(--ml-line);
}

.pub-search-box {
  min-height: 38px;
  border: 1px solid var(--ml-line-strong);
  border-radius: 8px;
  background: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  color: var(--ml-muted);
}

.pub-list-items {
  overflow: auto;
  padding: 8px;
  display: grid;
  gap: 5px;
}

.pub-item {
  width: 100%;
  min-height: 90px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 10px;
  padding: 8px;
  text-align: left;
  color: inherit;
}

.pub-item:hover {
  background: #fff;
}

.pub-item.is-active {
  background: var(--ml-blue-soft);
  border-color: #b6d2ec;
}

.pub-item-thumb {
  position: relative;
  width: 96px;
  height: 70px;
  border-radius: 7px;
  background: #e7edf3;
  color: var(--ml-muted);
  display: grid;
  place-items: center;
  overflow: hidden;
  font-size: 11px;
  font-weight: 900;
}

.pub-item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pub-item-thumb.is-pdf {
  background: #fff4f2;
  color: #a33b2f;
}

.pub-item-copy {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 5px;
}

.pub-item-name {
  color: var(--ml-ink);
  font-weight: 900;
  line-height: 1.25;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.pub-item-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--ml-muted);
  font-size: 11px;
}

.pub-item-attr {
  color: var(--ml-muted);
  font-size: 11px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pub-empty-list {
  padding: 18px;
  color: var(--ml-muted);
  line-height: 1.5;
}

.pub-preview {
  min-width: 0;
  background: #fff;
  display: grid;
  grid-template-rows: minmax(420px, 1fr) auto;
  min-height: 0;
}

.pub-preview-stage {
  position: relative;
  min-height: 420px;
  background: #0b1220;
  display: grid;
  place-items: center;
  color: #cbd5e1;
  overflow: hidden;
}

.pub-preview-img,
.pub-preview-video,
.pub-pdf-stage {
  width: 100%;
  height: 100%;
  max-height: calc(100vh - 320px);
  min-height: 420px;
  object-fit: contain;
  border: 0;
  background: #0b1220;
}

.pub-pdf-stage {
  background: #1f2630;
}

.pub-preview-fallback {
  color: #cbd5e1;
  font-size: 24px;
  font-weight: 900;
}

.pub-preview-counter {
  position: absolute;
  right: 14px;
  bottom: 14px;
  min-height: 28px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.58);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 900;
}

.pub-details {
  border-top: 1px solid var(--ml-line);
  padding: 18px 20px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 20px;
}

.pub-d-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ml-muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.pub-d-title {
  margin: 8px 0 7px;
  color: var(--ml-ink);
  font-size: 24px;
  line-height: 1.18;
}

.pub-d-desc {
  margin: 0 0 14px;
  color: var(--ml-body);
  line-height: 1.6;
}

.pub-d-attribution {
  border: 1px solid #cae4ea;
  border-radius: 8px;
  background: #eef9fb;
  color: #1b5962;
  padding: 10px 12px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.45;
}

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

.pub-dl-btn {
  min-height: 44px;
  justify-content: space-between;
}

.pub-dl-btn span {
  opacity: 0.75;
  font-size: 11px;
}

.pub-dl-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ml-muted);
  font-size: 12px;
}

.pub-meta-list {
  margin: 2px 0 0;
  border: 1px solid var(--ml-line);
  border-radius: 8px;
  overflow: hidden;
}

.pub-meta-list div {
  padding: 9px 10px;
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 10px;
  border-bottom: 1px solid var(--ml-line);
  font-size: 12px;
}

.pub-meta-list div:last-child {
  border-bottom: 0;
}

.pub-meta-list dt {
  color: var(--ml-muted);
  font-weight: 900;
}

.pub-meta-list dd {
  margin: 0;
  color: var(--ml-body);
  overflow-wrap: anywhere;
}

.pub-notice-wrap {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
}

.pub-notice {
  position: relative;
  width: min(680px, 100%);
  max-height: 90vh;
  overflow: auto;
  border: 1px solid var(--ml-line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 48px rgba(14, 45, 68, 0.22);
}

.pub-notice-hd {
  padding: 20px 22px 14px;
  border-bottom: 1px solid var(--ml-line);
}

.pub-notice-eyebrow {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ml-blue-dark);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.pub-notice-title {
  margin: 8px 0 0;
  color: var(--ml-ink);
  font-size: 24px;
}

.pub-notice-body {
  padding: 18px 22px;
  color: var(--ml-body);
  line-height: 1.65;
  white-space: pre-wrap;
}

.pub-notice-body p {
  margin: 0;
}

.pub-notice-ft {
  border-top: 1px solid var(--ml-line);
  padding: 14px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.pub-notice-prepared {
  flex: 1 1 auto;
  color: var(--ml-muted);
  font-size: 12px;
}

.pub-notice-error {
  flex: 1 1 100%;
  color: var(--ml-danger);
  font-size: 12px;
  font-weight: 800;
}

.pub-expired-stage {
  min-height: calc(100vh - 64px);
  display: grid;
  place-items: center;
  padding: 32px 20px;
  text-align: center;
}

.pub-expired-stage > p,
.pub-expired-body {
  color: var(--ml-muted);
}

.pub-expired-mark {
  width: 74px;
  height: 74px;
  margin: 0 auto 18px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--ml-blue-soft);
  color: var(--ml-blue);
}

.pub-expired-title {
  margin: 0 0 8px;
  color: var(--ml-ink);
  font-size: 26px;
}

@media (max-width: 1220px) {
  .ml-shell {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .ml-inspector {
    grid-column: 1 / -1;
    border-top: 1px solid var(--ml-line);
  }

  .ml-insp-preview {
    height: 300px;
  }
}

@media (max-width: 920px) {
  .ml-shell {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .ml-app {
    min-height: auto;
  }

  .ml-rail {
    border-right: 0;
    border-bottom: 1px solid var(--ml-line);
    max-height: 520px;
  }

  .ml-canvas-hd,
  .ml-drop-strip,
  .ml-toolbar,
  .pub-details,
  .pub-split {
    grid-template-columns: 1fr;
  }

  .ml-canvas-hd {
    flex-direction: column;
  }

  .ml-drop-strip {
    align-items: flex-start;
    flex-direction: column;
  }

  .ml-table {
    min-width: 880px;
  }

  .pub-split {
    display: grid;
  }

  .pub-list {
    border-right: 0;
    border-bottom: 1px solid var(--ml-line);
    max-height: 420px;
  }
}

@media (max-width: 680px) {
  .ml-canvas-hd,
  .ml-toolbar,
  .ml-drop-strip,
  .ml-grid,
  .ml-insp-body,
  .pub-topbar,
  .pub-hd-inner,
  .pub-tabs,
  .pub-details {
    padding-left: 14px;
    padding-right: 14px;
  }

  .ml-row-2,
  .ml-tab-check-grid,
  .ml-meta-grid {
    grid-template-columns: 1fr;
  }

  .ml-toolbar-grow {
    display: none;
  }

  .ml-view-toggle {
    width: 100%;
  }

  .ml-view-toggle button {
    flex: 1;
  }

  .ml-inline-create {
    width: 100%;
  }

  .ml-inline-create input,
  .ml-inline-create button {
    width: 100%;
  }

  .pub-topbar {
    height: auto;
    min-height: 64px;
    align-items: flex-start;
    flex-direction: column;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .pub-title {
    font-size: 30px;
  }

  .pub-hd-inner {
    background-size: 110px;
    background-position: right 14px top 18px;
  }

  .pub-item {
    grid-template-columns: 82px minmax(0, 1fr);
  }

  .pub-item-thumb {
    width: 82px;
    height: 62px;
  }

  .pub-preview {
    grid-template-rows: minmax(320px, auto) auto;
  }

  .pub-preview-stage,
  .pub-preview-img,
  .pub-preview-video,
  .pub-pdf-stage {
    min-height: 320px;
  }

  .pub-notice-ft {
    align-items: stretch;
    flex-direction: column;
  }
}
