/* ==========================================================================
   Work explorer — column browser
   Palette: Oxford Navy. Navy frames, cool grey dividers, all text Carbon black.
   ========================================================================== */

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/ibm-plex-sans/ibm-plex-sans-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/assets/fonts/ibm-plex-sans/ibm-plex-sans-latin-500-normal.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/ibm-plex-sans/ibm-plex-sans-latin-600-normal.woff2") format("woff2");
}

:root {
  --wx-ink: #161616;
  --wx-frame: #1f2a44;
  --wx-divider: #b4bcc8;
  --wx-page: #e4e7ec;
  --wx-surface: #ffffff;
  --wx-surface-1: #f6f7f9;
  --wx-surface-2: #eef1f5;
  --wx-chrome: #e9ecf1;
  --wx-sidebar: #eef1f5;
  --wx-hover: #f1f3f7;
  --wx-selected: #dce5f2;
  --wx-selected-strong: #c4d3e8;
  --wx-focus: #1f4fbf;
  --wx-accent: #1f2a44;
  --wx-font: "IBM Plex Sans", "Segoe UI", Arial, Helvetica, sans-serif;
  --wx-space-1: 0.25rem;
  --wx-space-2: 0.375rem;
  --wx-space-3: 0.5rem;
  --wx-space-4: 0.75rem;
  --wx-space-5: 1rem;
  --wx-space-6: 1.5rem;
  --wx-text-xs: 0.75rem;
  --wx-text-sm: 0.8125rem;
  --wx-text-md: 0.875rem;
  --wx-text-lg: 1.0625rem;
}

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

body.wx-page {
  margin: 0;
  min-width: 320px;
  color: var(--wx-ink);
  background: var(--wx-page);
  font-family: var(--wx-font);
  font-size: var(--wx-text-md);
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

.wx-page a {
  color: var(--wx-ink);
}

.wx-skip {
  position: absolute;
  left: var(--wx-space-3);
  top: -3rem;
  padding: var(--wx-space-3) var(--wx-space-4);
  border: 1px solid var(--wx-frame);
  background: var(--wx-surface);
  z-index: 10;
}
.wx-skip:focus {
  top: var(--wx-space-3);
}

.wx-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.wx-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  fill: currentColor;
}
.wx-icon--lg {
  width: 32px;
  height: 32px;
}
.wx-icon--forward,
.wx-tool--forward .wx-icon {
  transform: scaleX(-1);
}
.wx-chevron {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  fill: currentColor;
}

.wx-stage {
  width: min(1520px, 100%);
  margin: 0 auto;
  padding: 28px;
}

/* --- Window frame -------------------------------------------------------- */

.wx-window {
  overflow: hidden;
  border: 1px solid var(--wx-frame);
  background: var(--wx-surface);
}

.wx-titlebar {
  display: grid;
  grid-template-columns: 200px 1fr 200px;
  align-items: center;
  min-height: 44px;
  padding: 0 var(--wx-space-4);
  border-bottom: 1px solid var(--wx-frame);
  background: var(--wx-chrome);
}
.wx-wordmark {
  font-size: var(--wx-text-sm);
  font-weight: 600;
  text-decoration: none;
}
.wx-title {
  margin: 0;
  text-align: center;
  font-size: var(--wx-text-md);
  font-weight: 600;
}
.wx-window-meta {
  margin: 0;
  text-align: right;
  font-size: var(--wx-text-xs);
}

.wx-toolbar {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr) 200px;
  align-items: center;
  min-height: 52px;
  padding: 0 var(--wx-space-4);
  border-bottom: 1px solid var(--wx-frame);
  background: var(--wx-surface-1);
}
.wx-tools {
  display: flex;
  gap: var(--wx-space-2);
}
.wx-tool {
  display: grid;
  place-items: center;
  width: 34px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--wx-divider);
  border-radius: 0;
  color: var(--wx-ink);
  background: var(--wx-surface);
  cursor: pointer;
}
.wx-tool:hover {
  background: var(--wx-hover);
}
.wx-tool:disabled {
  opacity: 0.45;
  cursor: default;
}

.wx-breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--wx-space-2);
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--wx-text-sm);
}
.wx-breadcrumb li {
  display: flex;
  align-items: center;
  gap: var(--wx-space-2);
  min-width: 0;
}
.wx-breadcrumb li + li::before {
  content: "/";
}
.wx-breadcrumb li[hidden] {
  display: none;
}
.wx-breadcrumb a {
  text-decoration: none;
}
.wx-breadcrumb a:hover {
  text-decoration: underline;
}
.wx-breadcrumb strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

/* --- Workspace ----------------------------------------------------------- */

.wx-workspace {
  display: grid;
  grid-template-columns: 196px minmax(0, 1fr);
  height: clamp(560px, calc(100vh - 220px), 880px);
  min-height: 0;
}

.wx-sidebar {
  padding: var(--wx-space-5) var(--wx-space-3);
  overflow: auto;
  border-right: 1px solid var(--wx-frame);
  background: var(--wx-sidebar);
}
.wx-identity {
  padding: 0 var(--wx-space-3) var(--wx-space-5);
  border-bottom: 1px solid var(--wx-divider);
}
.wx-identity strong,
.wx-identity span {
  display: block;
}
.wx-identity strong {
  font-size: var(--wx-text-sm);
  font-weight: 600;
}
.wx-identity span {
  margin-top: 2px;
  font-size: var(--wx-text-xs);
}
.wx-side-label {
  margin: var(--wx-space-5) var(--wx-space-3) var(--wx-space-1);
  font-size: var(--wx-text-xs);
  font-weight: 600;
}
.wx-side-list,
.wx-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.wx-side-row {
  display: flex;
  align-items: center;
  gap: var(--wx-space-3);
  min-height: 34px;
  padding: 0 var(--wx-space-3);
  font-size: var(--wx-text-sm);
  text-decoration: none;
}
.wx-side-row:hover {
  background: var(--wx-hover);
}
.wx-side-row[aria-current] {
  background: var(--wx-selected);
  box-shadow: inset 3px 0 0 var(--wx-accent);
  font-weight: 500;
}
.wx-count {
  margin-left: auto;
  font-size: var(--wx-text-xs);
  font-variant-numeric: tabular-nums;
}

.wx-browser {
  display: grid;
  grid-template-columns: 220px minmax(380px, 1fr) 340px;
  min-width: 0;
  height: 100%;
}

.wx-column {
  min-width: 0;
  overflow: auto;
  border-right: 1px solid var(--wx-frame);
  background: var(--wx-surface);
}
.wx-column:last-child {
  border-right: 0;
}
.wx-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--wx-space-3);
  min-height: 40px;
  padding: 0 var(--wx-space-4);
  border-bottom: 1px solid var(--wx-frame);
  background: var(--wx-surface-2);
  font-size: var(--wx-text-xs);
}
.wx-head h2 {
  margin: 0;
  font-size: var(--wx-text-sm);
  font-weight: 600;
}

/* --- Rows ---------------------------------------------------------------- */

.wx-row {
  width: 100%;
  display: grid;
  grid-template-columns: 16px 16px minmax(0, 1fr);
  gap: var(--wx-space-3);
  align-items: center;
  min-height: 44px;
  padding: var(--wx-space-2) var(--wx-space-4);
  border: 0;
  border-bottom: 1px solid var(--wx-divider);
  border-radius: 0;
  color: var(--wx-ink);
  background: var(--wx-surface);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.wx-folders .wx-row {
  grid-template-columns: 16px minmax(0, 1fr) 16px;
  border-bottom-color: var(--wx-frame);
}
.wx-row:hover {
  background: var(--wx-hover);
}
.wx-row[aria-current] {
  background: var(--wx-selected);
}
.wx-row[aria-current="true"] {
  box-shadow: inset 3px 0 0 var(--wx-accent);
}
.wx-row--project {
  min-height: 48px;
  background: var(--wx-surface-1);
}
.wx-row--project.is-expanded {
  background: var(--wx-surface-2);
}
.wx-row--project[aria-current] {
  background: var(--wx-selected-strong);
}
.wx-row--level-1 {
  padding-left: 2.25rem;
}
.wx-row--level-2 {
  padding-left: 4rem;
}
.wx-row-text {
  min-width: 0;
}
.wx-row-text strong,
.wx-row-text small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wx-row-text strong {
  font-size: var(--wx-text-sm);
  font-weight: 500;
}
.wx-row--project .wx-row-text strong {
  font-weight: 600;
}
.wx-row-text small {
  margin-top: 1px;
  font-size: var(--wx-text-xs);
}
.wx-group > .wx-list[hidden] {
  display: none;
}

.wx-page a:focus-visible,
.wx-page button:focus-visible {
  outline: 2px solid var(--wx-focus);
  outline-offset: -2px;
}

/* --- Details ------------------------------------------------------------- */

.wx-details {
  background: var(--wx-surface-1);
}
.wx-details-body {
  padding: var(--wx-space-5) var(--wx-space-5) var(--wx-space-6);
}
.wx-details-heading {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: var(--wx-space-4);
  align-items: start;
}
.wx-details-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--wx-divider);
  background: var(--wx-surface);
}
.wx-details-icon--app {
  border-color: var(--wx-frame);
  background: var(--wx-selected);
}
.wx-details h3 {
  margin: 0;
  font-size: var(--wx-text-lg);
  font-weight: 600;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.wx-details-path {
  margin: var(--wx-space-1) 0 0;
  font-size: var(--wx-text-xs);
  overflow-wrap: anywhere;
}
.wx-description {
  margin: var(--wx-space-5) 0;
  padding: var(--wx-space-4) 0;
  border-top: 1px solid var(--wx-divider);
  border-bottom: 1px solid var(--wx-divider);
  font-size: var(--wx-text-sm);
  line-height: 1.55;
}
.wx-meta {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: var(--wx-space-3) var(--wx-space-4);
  margin: 0;
  font-size: var(--wx-text-sm);
}
.wx-meta dt {
  font-weight: 500;
}
.wx-meta dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}
.wx-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--wx-space-3);
  min-height: 40px;
  margin-top: var(--wx-space-6);
  border: 1px solid var(--wx-frame);
  border-radius: 0;
  background: var(--wx-surface);
  font-size: var(--wx-text-sm);
  font-weight: 600;
  text-decoration: none;
}
.wx-action:hover {
  background: var(--wx-surface-2);
}
.wx-mobile-back {
  display: none;
}

/* --- Status bar ---------------------------------------------------------- */

.wx-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--wx-space-4);
  min-height: 32px;
  padding: 0 var(--wx-space-4);
  border-top: 1px solid var(--wx-frame);
  background: var(--wx-chrome);
  font-size: var(--wx-text-xs);
}
.wx-status strong {
  font-weight: 600;
}

/* --- Responsive ---------------------------------------------------------- */

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

@media (max-width: 780px) {
  .wx-stage {
    padding: 0;
  }
  .wx-window {
    border-width: 0;
  }
  .wx-titlebar {
    grid-template-columns: 1fr auto;
    gap: var(--wx-space-4);
  }
  .wx-title {
    text-align: right;
  }
  .wx-window-meta,
  .wx-toolbar > .wx-tools:last-child {
    display: none;
  }
  .wx-toolbar {
    grid-template-columns: auto minmax(0, 1fr);
    gap: var(--wx-space-4);
  }
  .wx-breadcrumb ol {
    justify-content: flex-start;
  }
  .wx-workspace {
    display: block;
    height: auto;
  }
  .wx-browser {
    display: block;
  }
  .wx-column {
    overflow: visible;
    border-right: 0;
  }
  .wx-folders .wx-head {
    display: none;
  }
  .wx-folders .wx-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-bottom: 1px solid var(--wx-frame);
  }
  .wx-folders li + li .wx-row {
    border-left: 1px solid var(--wx-frame);
  }
  .wx-folders .wx-row {
    border-bottom: 0;
  }
  .wx-folders .wx-row .wx-chevron {
    display: none;
  }
  .wx-row {
    min-height: 48px;
  }
  .wx-row--level-1 {
    padding-left: 1.75rem;
  }
  .wx-row--level-2 {
    padding-left: 3rem;
  }
  .wx-details {
    border-top: 1px solid var(--wx-frame);
  }
  [data-wx-mobile-view="tree"] .wx-details,
  [data-wx-mobile-view="details"] .wx-folders,
  [data-wx-mobile-view="details"] .wx-tree {
    display: none;
  }
  .wx-mobile-back {
    display: inline-flex;
    align-items: center;
    gap: var(--wx-space-3);
    min-height: 40px;
    margin-bottom: var(--wx-space-4);
    font-size: var(--wx-text-sm);
    font-weight: 500;
    text-decoration: none;
  }
  .wx-status span:last-child {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
