:root {
  --storage-purple: #6d28ff;
  --storage-ink: #070817;
  --storage-muted: #666d82;
  --storage-line: #e8e9f2;
  --storage-panel: #ffffff;
  --storage-soft: rgba(109, 40, 255, 0.08);
}

.storage-main *,
.storage-main *::before,
.storage-main *::after {
  box-sizing: border-box;
}

.storage-main {
  display: grid;
  gap: 18px;
  overflow-x: hidden;
  padding: 22px 30px 56px;
}

.storage-picker-harness {
  align-items: center;
  background: #fff;
  border: 1px solid rgba(109, 40, 255, 0.22);
  border-radius: 8px;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 14px;
  padding: 12px 14px;
}

.storage-picker-harness p {
  margin: 0;
}

.storage-picker-harness button {
  background: #6d28ff;
  border: 0;
  border-radius: 6px;
  color: #fff;
  min-height: 40px;
  padding: 0 14px;
}

@media (max-width: 560px) {
  .storage-picker-harness {
    align-items: stretch;
    flex-direction: column;
  }
}

.storage-main [hidden],
.archive-dialog[hidden] {
  display: none !important;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--storage-purple);
  font-size: 11px;
  font-weight: 840;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.storage-hero,
.storage-session,
.media-sports-panel,
.upload-panel,
.smoke-panel,
.library-panel,
.rail-panel {
  border: 1px solid var(--storage-line);
  border-radius: 8px;
  background: var(--storage-panel);
  box-shadow: var(--shadow);
}

.media-sports-panel {
  padding: 18px;
}

.sports-preferences-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.sports-preference {
  min-width: 0;
  border: 1px solid var(--storage-line);
  border-radius: 8px;
  padding: 14px;
}

.sports-preference-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.sports-preference h3,
.sports-preference p {
  margin: 0;
}

.sports-preference h3 {
  color: var(--storage-ink);
  font-size: 16px;
}

.sports-preference p,
.sports-preference-heading > span,
.sports-empty {
  color: var(--storage-muted);
  font-size: 12px;
}

.sports-preference p {
  margin-top: 5px;
}

.sports-preference-heading > span {
  white-space: nowrap;
}

.sports-preference-heading > span[data-tone="error"] {
  color: #c83838;
}

.sports-preference-heading > span[data-tone="success"] {
  color: #0f8d61;
}

.sports-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  max-height: 246px;
  margin: 14px 0;
  overflow-y: auto;
}

.sport-option {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  border: 1px solid var(--storage-line);
  border-radius: 8px;
  padding: 10px;
  cursor: pointer;
}

.sport-option:has(input:checked) {
  border-color: rgba(109, 40, 255, 0.55);
  background: var(--storage-soft);
}

.sport-option input {
  width: 17px;
  height: 17px;
  accent-color: var(--storage-purple);
}

.sport-option span,
.sport-option strong,
.sport-option small {
  display: block;
  min-width: 0;
}

.sport-option strong {
  overflow: hidden;
  color: var(--storage-ink);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sport-option small {
  margin-top: 3px;
  color: var(--storage-muted);
  font-size: 10px;
  text-transform: capitalize;
}

.sports-preference > button {
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  padding: 0 14px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--storage-purple), #4c16d7);
  font-size: 12px;
  font-weight: 820;
}

.sports-preference > button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.storage-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(360px, 0.82fr);
  align-items: center;
  gap: 26px;
  padding: 26px;
  overflow: hidden;
  color: #ffffff;
  background:
    radial-gradient(circle at 18% 24%, rgba(109, 40, 255, 0.62), transparent 26%),
    linear-gradient(135deg, #050614, #10083d 58%, #2f0e94);
}

.storage-orb {
  position: relative;
  display: grid;
  width: 112px;
  height: 112px;
  place-items: center;
}

.storage-orb span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 42%, #111329 0 34%, transparent 35%),
    radial-gradient(circle, #6d28ff, #170b47 68%, transparent 69%);
  box-shadow: 0 0 42px rgba(109, 40, 255, 0.7);
}

.storage-orb strong {
  position: relative;
  z-index: 1;
  font-size: 22px;
}

.storage-hero h2,
.storage-hero p,
.storage-hero strong,
.storage-hero span,
.dark-panel h2,
.dark-panel p {
  color: #ffffff;
}

.storage-hero h2,
.storage-session h2,
.panel-heading h2,
.rail-heading h2,
.dark-panel h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.12;
}

.storage-hero-copy p:last-child,
.storage-session p,
.panel-heading p,
.dark-panel p {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.5;
}

.storage-hero-copy,
.panel-heading > div,
.storage-session > div {
  min-width: 0;
}

.storage-hero-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.storage-hero-metrics article {
  min-height: 82px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.07);
}

.storage-hero-metrics span {
  display: block;
  color: rgba(255, 255, 255, 0.66);
  font-size: 12px;
}

.storage-hero-metrics strong {
  display: block;
  margin-top: 8px;
  font-size: 22px;
}

.storage-session {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
}

.storage-session > div:first-child {
  flex: 1 1 260px;
  max-width: 280px;
}

.storage-session h2,
.panel-heading h2,
.rail-heading h2 {
  color: var(--storage-ink);
}

.storage-session p,
.panel-heading p,
.rail-panel small,
.storage-message {
  color: var(--storage-muted);
}

.signin-panel,
.session-actions,
.upload-form,
.library-tools,
.type-tabs {
  display: flex;
  align-items: center;
  gap: 10px;
}

.signin-panel {
  flex: 1 1 600px;
  justify-content: flex-end;
}

.signin-panel .language-selector-login {
  flex: 0 1 180px;
  min-width: 150px;
}

.signin-panel .language-selector-login select {
  width: 100%;
}

.signin-panel > label {
  flex: 1 1 145px;
  min-width: 0;
}

.signin-panel label,
.upload-form label {
  display: grid;
  gap: 6px;
  color: var(--storage-muted);
  font-size: 12px;
  font-weight: 760;
}

.signin-panel input,
.upload-form select {
  height: 42px;
  min-width: 210px;
  border: 1px solid var(--storage-line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--storage-ink);
  background: #ffffff;
}

.signin-panel input {
  min-width: 0;
  width: 100%;
}

.signin-panel button,
.session-actions button,
.upload-form button,
.smoke-actions button,
.filter-button,
.type-tabs button,
.asset-actions button,
.library-footer button {
  min-height: 38px;
  border: 1px solid rgba(109, 40, 255, 0.18);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--storage-purple);
  background: #ffffff;
  font-size: 12px;
  font-weight: 820;
}

.signin-panel button,
.upload-form button,
.smoke-actions button {
  color: #ffffff;
  background: linear-gradient(135deg, var(--storage-purple), #4c16d7);
}

.signin-panel button {
  min-width: 76px;
}

.secondary-action,
.upload-form .secondary-action,
.smoke-actions .secondary-action {
  color: var(--storage-purple);
  background: #ffffff;
}

.session-actions span {
  color: var(--storage-muted);
  font-size: 13px;
  font-weight: 720;
}

.storage-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  align-items: start;
  gap: 18px;
}

.storage-primary,
.storage-rail {
  display: grid;
  gap: 18px;
}

.upload-panel,
.smoke-panel,
.library-panel,
.rail-panel {
  padding: 18px;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.storage-chip {
  display: inline-grid;
  min-height: 30px;
  place-items: center;
  border-radius: 999px;
  padding: 0 12px;
  color: var(--storage-purple);
  background: var(--storage-soft);
  font-size: 12px;
  font-weight: 840;
}

.upload-form {
  align-items: end;
  flex-wrap: wrap;
  margin-top: 18px;
}

.file-drop {
  flex: 1 1 320px;
  min-height: 86px;
  border: 1px dashed rgba(109, 40, 255, 0.36);
  border-radius: 8px;
  padding: 14px;
  background: rgba(109, 40, 255, 0.05);
  transition:
    background 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.file-drop input {
  width: 100%;
}

.file-drop.drag-over {
  border-color: var(--storage-purple);
  background: rgba(109, 40, 255, 0.1);
  box-shadow: 0 16px 34px rgba(109, 40, 255, 0.12);
}

.file-drop span,
.file-drop strong {
  display: block;
}

.file-drop strong {
  margin-top: 8px;
  color: var(--storage-ink);
  font-size: 14px;
}

.file-details {
  flex: 1 1 260px;
  min-height: 86px;
  border: 1px solid var(--storage-line);
  border-radius: 8px;
  padding: 14px;
  background: #ffffff;
}

.file-details span {
  display: block;
  color: var(--storage-muted);
  font-size: 11px;
  font-weight: 820;
  text-transform: uppercase;
}

.file-details strong {
  display: block;
  overflow: hidden;
  margin-top: 6px;
  color: var(--storage-ink);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-details dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0 0;
}

.file-details div {
  display: grid;
  gap: 2px;
}

.file-details dt {
  color: var(--storage-muted);
  font-size: 11px;
}

.file-details dd {
  overflow: hidden;
  margin: 0;
  color: var(--storage-ink);
  font-size: 12px;
  font-weight: 780;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-actions,
.smoke-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.upload-actions {
  flex-wrap: wrap;
}

.upload-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.upload-steps li {
  min-height: 38px;
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--storage-muted);
  background: #f4f3fb;
  font-size: 12px;
  font-weight: 820;
}

.upload-steps li.active,
.upload-steps li.done {
  color: #ffffff;
  background: linear-gradient(135deg, var(--storage-purple), #4c16d7);
}

.upload-form [disabled],
.smoke-actions button[disabled],
.asset-actions button[disabled] {
  cursor: wait;
  opacity: 0.62;
}

.smoke-panel {
  display: grid;
  gap: 16px;
}

.smoke-panel[hidden] {
  display: none;
}

.smoke-actions {
  flex-wrap: wrap;
}

.smoke-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.smoke-steps li {
  min-height: 38px;
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--storage-muted);
  background: #f4f3fb;
  font-size: 12px;
  font-weight: 820;
}

.smoke-steps li.active,
.smoke-steps li.done {
  color: #ffffff;
  background: linear-gradient(135deg, var(--storage-purple), #4c16d7);
}

.smoke-steps li.failed {
  color: #ffffff;
  background: linear-gradient(135deg, #ef4444, #b91c1c);
}

.smoke-output {
  overflow-x: auto;
  min-height: 120px;
  max-height: 260px;
  margin: 0;
  border: 1px solid var(--storage-line);
  border-radius: 8px;
  padding: 14px;
  color: var(--storage-ink);
  background: #fafaff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.smoke-output[data-tone="success"] {
  border-color: rgba(15, 159, 110, 0.28);
  background: rgba(15, 159, 110, 0.06);
}

.smoke-output[data-tone="error"] {
  border-color: rgba(239, 68, 68, 0.26);
  background: rgba(239, 68, 68, 0.06);
}

.storage-message {
  min-height: 22px;
  margin: 12px 0 0;
  font-size: 13px;
  font-weight: 720;
}

.library-tools,
.type-tabs {
  flex-wrap: wrap;
}

.type-tabs button.active {
  color: #ffffff;
  background: linear-gradient(135deg, var(--storage-purple), #4c16d7);
}

.global-search-controls {
  display: grid;
  gap: 14px;
  margin-top: 16px;
  border: 1px solid var(--storage-line);
  border-radius: 8px;
  padding: 14px;
  background: #fafaff;
}

.global-search-heading,
.global-search-heading-actions,
.lifecycle-tabs,
.global-search-filter-actions {
  display: flex;
  align-items: center;
}

.global-search-heading {
  justify-content: space-between;
  gap: 14px;
}

.global-search-heading h3 {
  margin: 4px 0 0;
  color: var(--storage-ink);
  font-size: 17px;
}

.global-search-heading-actions,
.lifecycle-tabs,
.global-search-filter-actions {
  gap: 8px;
}

.global-search-heading-actions label {
  display: grid;
  gap: 4px;
  color: var(--storage-muted);
  font-size: 11px;
  font-weight: 780;
}

.global-search-heading-actions select {
  min-width: 150px;
  height: 40px;
  border: 1px solid var(--storage-line);
  border-radius: 8px;
  padding: 0 10px;
  color: var(--storage-ink);
  background: #ffffff;
}

.global-search-heading-actions button,
.lifecycle-tabs button,
.global-search-filter-actions button {
  min-height: 40px;
  border: 1px solid rgba(109, 40, 255, 0.18);
  border-radius: 8px;
  padding: 0 13px;
  color: var(--storage-purple);
  background: #ffffff;
  font-size: 12px;
  font-weight: 820;
}

.global-search-heading-actions button span {
  display: inline-grid;
  min-width: 22px;
  min-height: 22px;
  margin-inline-start: 4px;
  place-items: center;
  border-radius: 999px;
  color: #ffffff;
  background: var(--storage-purple);
  font-size: 10px;
}

.lifecycle-tabs {
  flex-wrap: wrap;
}

.lifecycle-tabs button.active {
  color: #ffffff;
  background: linear-gradient(135deg, var(--storage-purple), #4c16d7);
}

.global-search-filter-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  border-top: 1px solid var(--storage-line);
  padding-top: 14px;
}

.global-search-filter-panel[hidden] {
  display: none;
}

.global-search-filter-panel fieldset {
  min-width: 0;
  margin: 0;
  border: 1px solid var(--storage-line);
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
}

.global-search-filter-panel legend {
  padding: 0 6px;
  color: var(--storage-ink);
  font-size: 12px;
  font-weight: 820;
}

.search-filter-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 146px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.search-filter-options label {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  border-radius: 6px;
  padding: 7px;
  color: var(--storage-ink);
  background: var(--storage-soft);
  font-size: 12px;
}

.search-filter-options label span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-filter-options > span {
  grid-column: 1 / -1;
  color: var(--storage-muted);
  font-size: 12px;
}

.search-filter-options input {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  accent-color: var(--storage-purple);
}

.global-search-filter-actions {
  grid-column: 1 / -1;
  justify-content: flex-end;
}

.type-tabs {
  margin-top: 16px;
}

.global-search-status {
  min-height: 20px;
  margin: 12px 0 -4px;
  color: var(--storage-muted);
  font-size: 12px;
}

.asset-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.asset-tags span {
  max-width: 100%;
  overflow: hidden;
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--storage-purple);
  background: var(--storage-soft);
  font-size: 10px;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 12px;
  margin-top: 16px;
}

.asset-grid .media-state-view {
  grid-column: 1 / -1;
}

.asset-grid .media-asset-card {
  min-height: 100%;
}

.media-selection-toolbar {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  border-block: 1px solid var(--storage-line);
  padding-block: 10px;
}

.media-selection-toolbar[hidden] {
  display: none;
}

.media-select-loaded {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 10px;
  font-weight: 760;
  cursor: pointer;
}

.media-select-loaded input {
  width: 20px;
  height: 20px;
  accent-color: var(--storage-purple);
}

.media-bulk-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.media-bulk-desktop-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.media-bulk-mobile-menu {
  display: none;
}

.media-bulk-action-bar[hidden] {
  display: none;
}

.media-bulk-dialog {
  display: grid;
  gap: 18px;
  padding: 24px;
}

.media-bulk-dialog-header {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.media-bulk-dialog-header h2,
.media-bulk-dialog-header p,
.media-bulk-dialog h3,
.media-bulk-dialog-notice {
  margin: 0;
}

.media-bulk-dialog-header p {
  margin-top: 6px;
  color: var(--storage-muted);
}

.media-bulk-dialog-close {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  place-items: center;
  padding: 0;
  font-size: 24px;
}

.media-bulk-dialog-notice {
  min-height: 22px;
  color: var(--storage-muted);
}

.media-bulk-dialog-notice[data-tone="error"],
.media-selection-toolbar [data-tone="error"] {
  color: #b42318;
}

.media-bulk-dialog-notice[data-tone="warning"],
.media-selection-toolbar [data-tone="warning"] {
  color: #9a5b00;
}

.media-bulk-dialog-grid {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
}

.media-bulk-dialog-grid > section {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 12px;
}

.media-bulk-selected-list,
.media-bulk-tag-options,
.media-bulk-collection-options {
  display: grid;
  max-height: 330px;
  gap: 8px;
  overflow: auto;
}

.media-bulk-collection-option {
  display: grid;
  min-width: 0;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 52px;
  border: 1px solid var(--storage-line);
  border-radius: 7px;
  padding: 8px 10px;
  cursor: pointer;
}

.media-bulk-collection-option input {
  width: 20px;
  height: 20px;
  accent-color: var(--storage-purple);
}

.media-bulk-collection-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.media-bulk-collection-copy strong,
.media-bulk-collection-copy small {
  overflow-wrap: anywhere;
}

.media-bulk-collection-copy small {
  color: var(--storage-muted);
}

.media-bulk-tag-search input {
  width: 100%;
  min-height: 44px;
}

.media-bulk-tag-option {
  display: grid;
  min-width: 0;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 52px;
  border: 1px solid var(--storage-line);
  border-radius: 7px;
  padding: 8px 10px;
  cursor: pointer;
}

.media-bulk-tag-option input {
  width: 20px;
  height: 20px;
  accent-color: var(--storage-purple);
}

.media-bulk-tag-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.media-bulk-tag-copy strong,
.media-bulk-tag-copy small {
  overflow-wrap: anywhere;
}

.media-bulk-tag-copy small,
.media-bulk-empty {
  color: var(--storage-muted);
}

.media-bulk-dialog-actions {
  position: sticky;
  inset-block-end: -24px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin: 0 -24px -24px;
  border-block-start: 1px solid var(--storage-line);
  padding: 14px 24px calc(14px + env(safe-area-inset-bottom));
  background: #ffffff;
}

@media (max-width: 760px) {
  .media-selection-toolbar,
  .media-bulk-action-bar,
  .media-bulk-actions {
    align-items: stretch;
  }

  .media-selection-toolbar {
    flex-direction: column;
  }

  .media-bulk-actions {
    width: 100%;
  }

  .media-bulk-desktop-actions {
    display: none;
  }

  .media-bulk-mobile-menu {
    position: relative;
    display: block;
    flex: 1 1 140px;
  }

  .media-bulk-mobile-menu summary {
    display: flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--storage-purple);
    border-radius: 7px;
    padding: 9px 14px;
    color: #ffffff;
    background: var(--storage-purple);
    font-weight: 760;
    cursor: pointer;
    list-style: none;
  }

  .media-bulk-mobile-menu summary::-webkit-details-marker {
    display: none;
  }

  .media-bulk-mobile-menu-items {
    position: absolute;
    z-index: 8;
    inset-inline: 0;
    inset-block-end: calc(100% + 8px);
    display: grid;
    gap: 6px;
    border: 1px solid var(--storage-line);
    border-radius: 7px;
    padding: 8px;
    background: #ffffff;
    box-shadow: 0 12px 28px rgba(26, 34, 45, 0.18);
  }

  .media-bulk-mobile-menu-items button {
    width: 100%;
  }

  .media-bulk-actions button {
    min-height: 44px;
    flex: 1 1 120px;
  }

  .media-bulk-dialog {
    padding: calc(18px + env(safe-area-inset-top)) 16px
      calc(18px + env(safe-area-inset-bottom));
  }

  .media-bulk-dialog-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .media-bulk-selected-list,
  .media-bulk-tag-options,
  .media-bulk-collection-options {
    max-height: 220px;
  }

  .media-bulk-dialog-actions {
    inset-block-end: calc(-18px - env(safe-area-inset-bottom));
    margin: 0 -16px calc(-18px - env(safe-area-inset-bottom));
    padding-inline: 16px;
  }

  .media-bulk-dialog-actions button {
    min-height: 44px;
    flex: 1 1 0;
  }
}

.asset-card {
  display: grid;
  gap: 12px;
  min-height: 238px;
  border: 1px solid var(--storage-line);
  border-radius: 8px;
  padding: 14px;
  background: #ffffff;
  min-width: 0;
}

.asset-thumb {
  display: grid;
  min-height: 82px;
  place-items: center;
  border-radius: 8px;
  color: #ffffff;
  background:
    radial-gradient(circle at 24% 22%, rgba(255, 255, 255, 0.28), transparent 28%),
    linear-gradient(135deg, #0a0b18, var(--storage-purple));
  font-size: 22px;
  font-weight: 840;
}

.asset-meta {
  min-width: 0;
}

.asset-meta h3 {
  overflow: hidden;
  margin: 0;
  color: var(--storage-ink);
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-meta p {
  margin: 6px 0 0;
  color: var(--storage-muted);
  font-size: 12px;
}

.asset-facts {
  display: grid;
  gap: 6px;
  color: var(--storage-muted);
  font-size: 12px;
}

.asset-facts span {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.asset-facts strong {
  color: var(--storage-ink);
}

.status-pill {
  display: inline-grid;
  width: fit-content;
  min-height: 26px;
  place-items: center;
  border-radius: 999px;
  padding: 0 10px;
  color: var(--storage-purple);
  background: var(--storage-soft);
  font-size: 11px;
  font-weight: 820;
}

.status-pill.ready {
  color: #0f9f6e;
  background: rgba(15, 159, 110, 0.12);
}

.status-pill.failed,
.status-pill.quarantined {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

.status-pill.archived {
  color: #666d82;
  background: #f0f1f6;
}

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

.asset-actions button[disabled] {
  cursor: not-allowed;
  opacity: 0.42;
}

.empty-state {
  grid-column: 1 / -1;
  border: 1px dashed rgba(109, 40, 255, 0.24);
  border-radius: 8px;
  padding: 32px;
  text-align: center;
}

.empty-state button {
  min-height: 38px;
  margin-top: 16px;
  border: 1px solid rgba(109, 40, 255, 0.18);
  border-radius: 8px;
  padding: 0 16px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--storage-purple), #4c16d7);
  font-size: 12px;
  font-weight: 820;
}

.empty-state-error {
  border-color: rgba(239, 68, 68, 0.26);
  background: rgba(239, 68, 68, 0.05);
}

.empty-state h3 {
  margin: 0;
}

.empty-state p {
  margin: 8px auto 0;
  max-width: 440px;
  color: var(--storage-muted);
}

.archive-dialog {
  position: fixed;
  z-index: 120;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(7, 8, 23, 0.46);
  backdrop-filter: blur(10px);
}

.archive-dialog-card {
  width: min(440px, 100%);
  border: 1px solid rgba(109, 40, 255, 0.14);
  border-radius: 8px;
  padding: 22px;
  background: #ffffff;
  box-shadow: 0 24px 64px rgba(7, 8, 23, 0.22);
}

.archive-dialog-card h2 {
  margin: 0;
  color: var(--storage-ink);
  font-size: 22px;
  line-height: 1.18;
}

.archive-dialog-card p:not(.eyebrow) {
  margin: 10px 0 0;
  color: var(--storage-muted);
  line-height: 1.5;
}

.archive-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

.archive-dialog-actions button {
  min-height: 42px;
  border: 1px solid rgba(109, 40, 255, 0.18);
  border-radius: 8px;
  padding: 0 16px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--storage-purple), #4c16d7);
  font-size: 12px;
  font-weight: 820;
}

.archive-dialog-actions .secondary-action {
  color: var(--storage-purple);
  background: #ffffff;
}

.archive-dialog-actions button[disabled] {
  cursor: wait;
  opacity: 0.62;
}

.library-footer {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

.rail-heading h2 {
  font-size: 18px;
}

.pipeline-list,
.health-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.pipeline-list article,
.health-list div {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--storage-line);
  border-radius: 8px;
  padding: 10px;
}

.pipeline-list span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  color: var(--storage-purple);
  background: var(--storage-soft);
  font-size: 11px;
  font-weight: 840;
}

.pipeline-list strong,
.pipeline-list small,
.health-list strong,
.health-list em {
  display: block;
}

.health-list span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #0f9f6e;
}

.health-list em {
  color: #0f9f6e;
  font-size: 12px;
  font-style: normal;
  font-weight: 820;
}

.dark-panel {
  color: #ffffff;
  background:
    radial-gradient(circle at 88% 18%, rgba(255, 255, 255, 0.2), transparent 28%),
    linear-gradient(135deg, #090a18, #2f0e94);
}

.dark-panel .eyebrow {
  color: #cfc4ff;
}

@media (max-width: 1800px) {
  .storage-layout {
    grid-template-columns: 1fr;
  }
}

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

  .storage-hero-metrics,
  .smoke-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .storage-main {
    padding: 18px 18px 126px;
  }

  .storage-session,
  .panel-heading,
  .sports-preference-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .sports-preferences-grid {
    grid-template-columns: 1fr;
  }

  .signin-panel,
  .session-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .signin-panel input,
  .upload-form select {
    min-width: 0;
    width: 100%;
  }

  .upload-actions,
  .smoke-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .global-search-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .global-search-heading-actions {
    align-items: stretch;
  }

  .filter-button,
  .type-tabs button,
  .asset-actions button,
  .library-footer button {
    min-height: 44px;
  }
}

@media (max-width: 620px) {
  .storage-hero {
    padding: 20px;
  }

  .storage-hero-metrics,
  .upload-steps,
  .smoke-steps,
  .file-details dl {
    grid-template-columns: 1fr;
  }

  .sports-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: none;
  }

  .sports-preference > button {
    width: 100%;
    min-height: 44px;
  }

  .storage-orb {
    width: 92px;
    height: 92px;
  }

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

  .panel-heading {
    gap: 12px;
  }

  .library-tools,
  .type-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .global-search-heading-actions,
  .lifecycle-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .global-search-heading-actions label {
    grid-column: 1 / -1;
  }

  .global-search-heading-actions select,
  .global-search-heading-actions button,
  .lifecycle-tabs button {
    width: 100%;
    min-height: 44px;
  }

  .global-search-heading-actions button {
    grid-column: 1 / -1;
  }

  .global-search-filter-panel,
  .search-filter-options {
    grid-template-columns: 1fr;
  }

  .global-search-filter-actions {
    grid-column: 1;
  }

  .global-search-filter-actions button {
    width: 100%;
    min-height: 44px;
  }

  .filter-button,
  .type-tabs button {
    justify-content: center;
    width: 100%;
    padding-inline: 8px;
  }

  .asset-card {
    min-height: auto;
  }

  .asset-thumb {
    min-height: 68px;
  }

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

  .upload-form button,
  .smoke-actions button,
  .archive-dialog-actions button {
    min-height: 44px;
  }

  .archive-dialog {
    align-items: end;
    padding: 18px 18px 96px;
  }

  .archive-dialog-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .archive-dialog-card.media-dialog-surface {
    min-height: auto;
  }
}
