:root {
  color-scheme: dark;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: #101316;
  color: #f5f7f2;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --bg: #101316;
  --bg-2: #15191d;
  --surface: rgba(255, 255, 255, 0.055);
  --surface-strong: rgba(255, 255, 255, 0.08);
  --surface-muted: rgba(0, 0, 0, 0.2);
  --border: rgba(255, 255, 255, 0.1);
  --border-soft: rgba(255, 255, 255, 0.07);
  --text: #f5f7f2;
  --muted: #a8b0ae;
  --muted-2: #7f8988;
  --lime: #e4ff7a;
  --cyan: #68dfc5;
  --sky: #8ca7ff;
  --amber: #ffd36a;
  --rose: #ff8aa6;
  --danger: #ff9bb0;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 18rem),
    linear-gradient(135deg, #12171a 0%, #0f1215 52%, #15191d 100%);
}

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

button {
  cursor: pointer;
}

.icon {
  display: inline-grid;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  place-items: center;
  color: currentColor;
}

.icon svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-mark .icon,
.section-heading > .icon,
.policy-panel > .icon,
.empty-state .icon {
  width: 22px;
  height: 22px;
}

.app-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  max-width: 100vw;
  min-height: 100vh;
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 480px);
  min-height: 100vh;
}

.auth-visual {
  display: grid;
  align-content: space-between;
  min-width: 0;
  padding: 28px;
  border-right: 1px solid var(--border-soft);
  background:
    linear-gradient(145deg, rgba(104, 223, 197, 0.14), transparent 40%),
    linear-gradient(315deg, rgba(228, 255, 122, 0.11), transparent 36%),
    #11161a;
}

.auth-brand {
  max-width: 260px;
  border-bottom: 0;
}

.auth-copy {
  display: grid;
  gap: 14px;
  max-width: 680px;
}

.auth-copy > span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: max-content;
  max-width: 100%;
  padding: 7px 10px;
  border: 1px solid rgba(104, 223, 197, 0.28);
  border-radius: 8px;
  color: var(--cyan);
  background: rgba(104, 223, 197, 0.08);
}

.auth-copy h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(34px, 5vw, 64px);
  line-height: 1;
}

.auth-copy p {
  max-width: 620px;
  margin: 0;
  color: #c9d3d0;
  font-size: 16px;
  line-height: 1.65;
}

.auth-panel {
  display: grid;
  align-content: center;
  gap: 18px;
  min-width: 0;
  padding: 28px;
  background: rgba(0, 0, 0, 0.15);
}

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

.auth-tabs button {
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: #cbd4d1;
  background: rgba(255, 255, 255, 0.045);
}

.auth-tabs button.active {
  color: #102b25;
  background: var(--cyan);
}

.auth-form {
  display: grid;
  gap: 15px;
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.auth-form h2,
.auth-form p {
  margin: 0;
}

.auth-form h2 {
  font-size: 26px;
}

.auth-form p {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.45;
}

.auth-form label {
  display: grid;
  gap: 8px;
  color: #cbd4d1;
  font-size: 13px;
}

.auth-form input {
  min-height: 46px;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  outline: none;
  background: rgba(0, 0, 0, 0.22);
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  height: 100vh;
  flex-direction: column;
  gap: 22px;
  padding: 20px 16px;
  border-right: 1px solid var(--border-soft);
  background:
    linear-gradient(180deg, rgba(30, 37, 42, 0.94), rgba(14, 18, 22, 0.96)),
    #11161a;
  overflow-x: hidden;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 2px 4px 14px;
  border-bottom: 1px solid var(--border-soft);
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  color: #111315;
  background: linear-gradient(135deg, var(--lime), #9cf4df);
  box-shadow: 0 10px 24px rgba(228, 255, 122, 0.18);
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  font-size: 18px;
  line-height: 1.1;
}

.brand span,
.topbar p,
.section-heading p,
.policy-panel p {
  color: var(--muted);
}

.brand span {
  margin-top: 3px;
  color: var(--lime);
  font-size: 12px;
}

.nav-stack {
  display: grid;
  gap: 6px;
}

.nav-button,
.primary-action,
.submit-button,
.download-button,
.filter-row button,
.ghost-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text);
  background: transparent;
}

.nav-button {
  position: relative;
  justify-content: flex-start;
  width: 100%;
  min-width: 0;
  padding: 0 11px;
  color: #d4dad7;
}

.nav-button span {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-button em {
  min-width: 24px;
  padding: 2px 7px;
  margin-left: auto;
  border-radius: 999px;
  font-size: 12px;
  font-style: normal;
  color: #0f1414;
  background: var(--cyan);
}

.nav-button.active {
  border-color: rgba(104, 223, 197, 0.32);
  color: #aef8eb;
  background: linear-gradient(90deg, rgba(104, 223, 197, 0.18), rgba(255, 255, 255, 0.05));
}

.nav-button:hover {
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.07);
}

.form-panel,
.policy-panel,
.table-panel,
.detail-panel {
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.meter {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--lime));
}

.ghost-action {
  min-height: 38px;
  padding: 0 12px;
  border-color: var(--border);
  color: #dce5e1;
  background: rgba(0, 0, 0, 0.12);
}

.ghost-action:hover {
  border-color: rgba(104, 223, 197, 0.4);
  color: var(--cyan);
}

.workspace {
  min-width: 0;
  max-width: 100vw;
  padding: 16px 18px 28px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(180px, 280px) minmax(260px, 1fr) auto;
  align-items: center;
  gap: 18px;
  min-width: 0;
  min-height: 58px;
  margin-bottom: 18px;
}

.title-block {
  min-width: 0;
}

.topbar h1 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: clamp(28px, 3vw, 38px);
  line-height: 1;
}

.topbar p {
  max-width: 680px;
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 1.45;
}

.global-search,
.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  min-width: 0;
  max-width: 100%;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.global-search input,
.search-box input,
.form-grid input,
.form-grid textarea {
  width: 100%;
  min-width: 0;
  border: 0;
  color: var(--text);
  outline: none;
  background: transparent;
}

.global-search input::placeholder,
.search-box input::placeholder,
.form-grid input::placeholder,
.form-grid textarea::placeholder {
  color: #74807e;
}

.topbar-actions {
  display: flex;
  min-width: 0;
  max-width: 100%;
  flex-shrink: 0;
  align-items: center;
  gap: 10px;
}

.api-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  max-width: 260px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: #cbd3d0;
  font-size: 13px;
  background: var(--surface);
  white-space: nowrap;
}

.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  max-width: 280px;
  padding: 0 10px;
  overflow: hidden;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  color: #d9e3df;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.045);
}

.icon-action {
  width: 40px;
  padding: 0;
}

.api-pill.connected {
  color: #12362f;
  background: #9cf4df;
}

.api-pill.unavailable {
  color: #3b111b;
  background: var(--danger);
}

.api-pill.checking {
  color: #382811;
  background: var(--amber);
}

.notice-bar {
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px solid rgba(228, 255, 122, 0.28);
  border-radius: 8px;
  color: #e8efe8;
  background: rgba(228, 255, 122, 0.08);
}

.primary-action,
.submit-button,
.download-button {
  flex-shrink: 0;
  padding: 0 16px;
  color: #101315;
  font-weight: 700;
  background: var(--lime);
}

.primary-action:hover,
.submit-button:hover:not(:disabled),
.download-button:hover:not(:disabled) {
  background: #f0ff9f;
}

.submit-button:disabled,
.download-button:disabled {
  cursor: not-allowed;
  color: #8f9894;
  background: rgba(255, 255, 255, 0.12);
}

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

.market-main {
  display: grid;
  min-width: 0;
  gap: 18px;
}

.featured-rail,
.library-browser {
  min-width: 0;
}

.compact-heading {
  margin-bottom: 10px;
}

.rail-count {
  align-self: center;
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--cyan);
  font-size: 12px;
  white-space: nowrap;
}

.featured-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 10px;
}

.featured-card {
  position: relative;
  display: grid;
  min-height: 174px;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  color: var(--text);
  text-align: left;
  background: #161b20;
  box-shadow: var(--shadow);
}

.featured-card:hover {
  border-color: rgba(104, 223, 197, 0.45);
  transform: translateY(-1px);
}

.featured-card .preview-block {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
}

.featured-card .preview-block::after {
  opacity: 0.45;
}

.featured-copy {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: end;
  gap: 5px;
  min-height: 174px;
  padding: 14px;
  background: linear-gradient(180deg, transparent 28%, rgba(0, 0, 0, 0.68) 100%);
}

.featured-copy span,
.featured-copy small {
  color: #d8e1df;
  font-size: 12px;
}

.featured-copy strong {
  font-size: 17px;
  line-height: 1.15;
}

.library-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-row button {
  min-height: 36px;
  padding: 0 11px;
  border-color: var(--border-soft);
  color: #cbd4d1;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.045);
}

.filter-row button span {
  min-width: 0;
}

.filter-row button em {
  min-width: 22px;
  padding: 2px 6px;
  border-radius: 999px;
  color: #111315;
  font-size: 11px;
  font-style: normal;
  background: #a9b5b0;
}

.filter-row button.selected {
  border-color: rgba(104, 223, 197, 0.45);
  color: #071313;
  background: var(--cyan);
}

.filter-row button.selected em {
  background: rgba(255, 255, 255, 0.74);
}

.sort-tools {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.sort-tools span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  color: #d0d8d5;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.045);
}

.dataset-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}

.dataset-card {
  display: grid;
  min-width: 0;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  color: inherit;
  text-align: left;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.04));
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24);
}

.dataset-card:hover,
.dataset-card.active {
  border-color: rgba(104, 223, 197, 0.54);
  box-shadow:
    0 0 0 1px rgba(104, 223, 197, 0.18),
    0 18px 38px rgba(0, 0, 0, 0.34);
  transform: translateY(-1px);
}

.card-preview {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  min-height: 150px;
  overflow: hidden;
  background: #151a1e;
}

.card-preview .preview-block {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
}

.card-status {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
}

.card-link {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 2;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  color: white;
  background: rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(10px);
}

.card-body {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 12px;
}

.card-title,
.card-subtitle {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-title {
  color: var(--text);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.2;
}

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

.workflow-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.workflow-strip em {
  max-width: 100%;
  padding: 3px 6px;
  overflow: hidden;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  color: #cfe6df;
  font-size: 11px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: rgba(104, 223, 197, 0.08);
}

.card-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  align-items: center;
  color: #c4cdca;
  font-size: 12px;
}

.card-meta span {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-meta .icon {
  width: 14px;
  height: 14px;
  color: var(--muted-2);
}

.preview-block {
  --tone-a: var(--cyan);
  --tone-b: var(--sky);
  --tone-c: #151e24;
  position: relative;
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: #111315;
  isolation: isolate;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--tone-a) 80%, #111315), transparent 58%),
    linear-gradient(315deg, color-mix(in srgb, var(--tone-b) 80%, #111315), transparent 54%),
    var(--tone-c);
}

.preview-block::before {
  position: absolute;
  inset: 0;
  z-index: 0;
  content: "";
  opacity: 0.44;
  background:
    linear-gradient(120deg, transparent 0 28%, rgba(255, 255, 255, 0.35) 30%, transparent 34%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.18) 0 1px, transparent 1px 42px),
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.18) 0 1px, transparent 1px 38px);
}

.preview-block::after {
  position: absolute;
  inset: auto 0 0;
  z-index: 1;
  height: 45%;
  content: "";
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.55));
}

.preview-depth {
  position: absolute;
  inset: 17% 16%;
  z-index: 1;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.16), transparent),
    rgba(0, 0, 0, 0.16);
  transform: skew(-5deg) rotate(-2deg);
}

.preview-gridline {
  position: absolute;
  inset: 10px;
  z-index: 1;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
}

.preview-label {
  position: absolute;
  right: 10px;
  bottom: 9px;
  z-index: 2;
  color: rgba(255, 255, 255, 0.92);
  font-size: 12px;
  font-weight: 800;
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.54);
  text-transform: uppercase;
}

.preview-warning {
  position: absolute;
  right: 8px;
  top: 8px;
  z-index: 3;
  width: 18px;
  height: 18px;
  color: var(--amber);
}

.tone-cyan {
  --tone-a: #68dfc5;
  --tone-b: #8ca7ff;
  --tone-c: #13242a;
}

.tone-rose {
  --tone-a: #ff8aa6;
  --tone-b: #8064ff;
  --tone-c: #241421;
}

.tone-lime {
  --tone-a: #e4ff7a;
  --tone-b: #68dfc5;
  --tone-c: #18261c;
}

.tone-violet {
  --tone-a: #c293ff;
  --tone-b: #5d90ff;
  --tone-c: #18182a;
}

.tone-amber {
  --tone-a: #ffd36a;
  --tone-b: #ff8f6a;
  --tone-c: #2a1e14;
}

.tone-sky {
  --tone-a: #8bd3ff;
  --tone-b: #e4ff7a;
  --tone-c: #132431;
}

.detail-drawer {
  position: sticky;
  top: 16px;
  display: grid;
  gap: 14px;
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.048)),
    #151a1f;
}

.detail-preview {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  min-height: 170px;
  border-radius: 8px;
}

.detail-preview .preview-block {
  width: 100%;
  height: 100%;
  border: 0;
}

.detail-preview .preview-label {
  font-size: 18px;
}

.close-ghost {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 4;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 999px;
  color: white;
  background: rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(10px);
}

.detail-copy {
  display: grid;
  gap: 10px;
}

.detail-copy h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.12;
}

.detail-copy p {
  margin: 0;
  color: #c1cbc8;
  font-size: 14px;
  line-height: 1.55;
}

.access-card,
.version-card {
  display: grid;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--border-soft);
}

.access-card > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.access-card strong,
.version-card h3 {
  color: var(--text);
}

.access-card span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--lime);
  font-size: 13px;
}

.access-card small {
  color: var(--muted);
  line-height: 1.45;
}

.mini-heading {
  align-items: center;
  margin-bottom: 0;
}

.mini-heading h3,
.mini-heading p {
  margin: 0;
}

.mini-heading h3 {
  font-size: 16px;
}

.mini-heading strong {
  color: var(--cyan);
  font-size: 13px;
  white-space: nowrap;
}

.detail-actions {
  display: grid;
  gap: 10px;
}

.wide-action {
  width: 100%;
}

.detail-panel,
.form-panel,
.policy-panel,
.table-panel {
  padding: 18px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-row em {
  max-width: 100%;
  padding: 4px 7px;
  overflow: hidden;
  border-radius: 999px;
  color: #d4ddda;
  font-size: 11px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.09);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: max-content;
  max-width: 100%;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.status-badge .icon {
  width: 13px;
  height: 13px;
}

.status-badge.published {
  color: #102b25;
  background: #b6ff85;
}

.status-badge.pending {
  color: #36240a;
  background: var(--amber);
}

.status-badge.hidden,
.status-badge.rejected {
  color: #3b111b;
  background: var(--danger);
}

.confirm-row,
.toggle-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: #cbd4d1;
  font-size: 14px;
  line-height: 1.45;
}

.confirm-row input,
.toggle-row input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  accent-color: var(--lime);
}

.metadata-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0 0;
}

.compact-metadata {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.metadata-grid div {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.16);
}

.compact-metadata div {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.metadata-grid .wide {
  grid-column: span 2;
}

.metadata-grid dt {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.metadata-grid dd {
  margin: 0;
  color: var(--text);
  font-size: 13px;
}

.metadata-grid a {
  color: var(--cyan);
  overflow-wrap: anywhere;
  text-decoration: none;
}

.metadata-grid a:hover {
  text-decoration: underline;
}

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

.workflow-grid span {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.workflow-grid b {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.hash {
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  line-height: 1.55;
}

.upload-layout,
.access-layout,
.moderation-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 20px;
}

.mode-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.mode-panel label {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: #d8e2df;
  background: rgba(0, 0, 0, 0.18);
}

.mode-panel input {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  accent-color: var(--cyan);
}

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

.form-grid label {
  display: grid;
  gap: 8px;
  color: #cbd4d1;
  font-size: 13px;
}

.form-grid label.wide {
  grid-column: 1 / -1;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
  min-height: 44px;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.22);
}

.form-grid input[type="file"] {
  display: grid;
  align-content: center;
  min-height: 52px;
  color: #cbd4d1;
}

.form-grid input[type="file"]::file-selector-button {
  min-height: 32px;
  padding: 0 12px;
  margin-right: 12px;
  border: 0;
  border-radius: 8px;
  color: #111315;
  background: var(--cyan);
}

.form-grid textarea {
  resize: vertical;
}

.toggle-row {
  margin: 18px 0;
}

.upload-progress {
  display: grid;
  gap: 10px;
  margin: 18px 0;
  padding: 14px;
  border: 1px solid rgba(104, 223, 197, 0.28);
  border-radius: 8px;
  background: rgba(104, 223, 197, 0.08);
}

.upload-progress > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.upload-progress strong {
  color: var(--text);
}

.link-button {
  text-decoration: none;
}

.upload-progress span,
.upload-progress small {
  color: #cbd4d1;
}

.submit-button {
  width: 100%;
}

.policy-panel h2,
.section-heading h2 {
  margin: 0 0 8px;
  font-size: 23px;
}

.policy-panel ul {
  display: grid;
  gap: 12px;
  padding: 0;
  margin: 20px 0 0;
  list-style: none;
}

.policy-panel li {
  padding-left: 18px;
  border-left: 3px solid var(--lime);
  color: #d7dfdc;
  line-height: 1.45;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.section-heading h2,
.section-heading p {
  margin-top: 0;
}

.empty-state {
  display: grid;
  min-height: 260px;
  place-items: center;
  align-content: center;
  gap: 10px;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  color: var(--muted);
}

.empty-state strong {
  color: var(--text);
}

.dataset-table {
  display: grid;
  gap: 8px;
}

.table-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) 100px 90px auto 24px;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 0 12px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  color: inherit;
  text-align: left;
  background: rgba(255, 255, 255, 0.035);
}

.table-row:hover {
  border-color: rgba(104, 223, 197, 0.45);
}

.access-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.access-summary div {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.16);
}

.access-summary span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.access-summary strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-row {
  grid-template-columns: minmax(180px, 1fr) 120px 120px 90px auto;
}

.user-row select,
.user-row button {
  min-height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.22);
}

.user-row button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 12px;
  color: #12362f;
  background: #9cf4df;
}

.invite-panel h2 {
  margin-top: 0;
}

.invite-stack {
  display: grid;
  gap: 14px;
  align-content: start;
}

.invite-result {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(228, 255, 122, 0.28);
  border-radius: 8px;
  background: rgba(228, 255, 122, 0.08);
}

.invite-result span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--lime);
  font-size: 13px;
}

.invite-result strong {
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 18px;
  letter-spacing: 0;
}

.invite-list-panel {
  display: grid;
  gap: 12px;
}

.invite-code-list {
  display: grid;
  gap: 10px;
}

.invite-code-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.16);
}

.invite-code-card.disabled {
  opacity: 0.64;
}

.invite-code-card div {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.invite-code-card strong,
.invite-code-card span,
.invite-code-card small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.invite-code-card span,
.invite-code-card small {
  color: var(--muted);
  font-size: 12px;
}

.moderation-side,
.grant-stack,
.audit-stack {
  display: grid;
  gap: 14px;
  align-content: start;
}

.moderation-control-panel,
.audit-panel {
  display: grid;
  gap: 14px;
}

.revoke-grid {
  margin-bottom: 0;
}

.manual-action-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.manual-action-row button {
  min-height: 44px;
  padding: 0 12px;
}

.danger-submit {
  color: #3b111b;
  background: var(--danger);
}

.grant-card,
.audit-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.16);
}

.grant-card {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.grant-card div,
.audit-card div {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.grant-card strong,
.audit-card strong {
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.grant-card span,
.grant-card small,
.audit-card span,
.audit-card small,
.audit-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.grant-card button {
  min-height: 36px;
  padding: 0 12px;
  color: #3b111b;
  background: var(--danger);
}

.compact-empty {
  min-height: 150px;
  padding: 14px;
}

@media (prefers-reduced-motion: no-preference) {
  .dataset-card,
  .featured-card,
  .nav-button,
  .ghost-action,
  .primary-action,
  .download-button,
  .submit-button {
    transition:
      transform 160ms ease,
      border-color 160ms ease,
      background-color 160ms ease,
      box-shadow 160ms ease;
  }
}

@media (max-width: 1260px) {
  .library-market {
    grid-template-columns: minmax(0, 1fr);
  }

  .detail-drawer {
    position: static;
    max-height: none;
    grid-template-columns: minmax(240px, 0.75fr) minmax(0, 1fr);
    align-items: start;
  }

  .detail-preview {
    min-height: 220px;
  }
}

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

  .auth-shell {
    grid-template-columns: 1fr;
  }

  .auth-visual {
    min-height: 420px;
    border-right: 0;
    border-bottom: 1px solid var(--border-soft);
  }

  .sidebar {
    position: sticky;
    z-index: 5;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    padding: 14px;
  }

  .brand {
    padding: 0;
    border-bottom: 0;
  }

  .nav-stack {
    display: flex;
    flex: 1 1 620px;
    flex-wrap: wrap;
    min-width: 0;
  }

  .nav-button {
    width: auto;
  }

  .topbar {
    grid-template-columns: minmax(220px, 0.55fr) minmax(260px, 1fr);
  }

  .topbar-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .upload-layout,
  .access-layout,
  .moderation-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .sidebar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    align-items: stretch;
  }

  .brand {
    align-items: center;
  }

  .nav-stack {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    min-width: 0;
    width: 100%;
    flex: initial;
  }

  .nav-button {
    justify-content: center;
    min-height: 54px;
    min-width: 0;
    padding: 6px;
    gap: 5px;
    flex-direction: column;
    font-size: 12px;
    text-align: center;
  }

  .nav-button em {
    position: absolute;
    top: 5px;
    right: 5px;
    min-width: 18px;
    padding: 1px 5px;
    font-size: 10px;
  }

  .topbar {
    grid-template-columns: 1fr;
  }

  .topbar-actions {
    justify-content: stretch;
  }

  .api-pill,
  .user-pill,
  .primary-action {
    flex: 1 1 0;
    justify-content: center;
  }

  .featured-strip {
    display: flex;
    overflow-x: auto;
    padding-bottom: 4px;
    scroll-snap-type: x mandatory;
  }

  .featured-card {
    min-width: 240px;
    scroll-snap-align: start;
  }

  .library-controls {
    display: grid;
  }

  .sort-tools {
    justify-content: flex-start;
  }

  .detail-drawer {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .workspace {
    padding: 14px;
  }

  .topbar-actions {
    display: grid;
    width: 100%;
  }

  .api-pill {
    max-width: none;
    white-space: normal;
    text-align: center;
  }

  .user-pill {
    max-width: none;
    justify-content: center;
  }

  .primary-action {
    width: 100%;
  }

  .detail-panel,
  .form-panel,
  .policy-panel,
  .table-panel {
    padding: 14px;
  }

  .dataset-gallery {
    grid-template-columns: 1fr;
  }

  .card-preview {
    min-height: 190px;
  }

  .metadata-grid,
  .form-grid,
  .manual-action-row,
  .access-summary {
    grid-template-columns: 1fr;
  }

  .metadata-grid .wide {
    grid-column: auto;
  }

  .table-row {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .grant-card {
    grid-template-columns: 1fr;
  }

  .auth-visual,
  .auth-panel {
    padding: 20px;
  }

  .auth-copy h1 {
    font-size: 34px;
  }

  .invite-code-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 440px) {
  .filter-row button,
  .sort-tools span {
    flex: 1 1 auto;
  }

  .card-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
