:root {
  color-scheme: light;
  --page: #f5f5f7;
  --surface: #ffffff;
  --surface-elevated: rgba(255, 255, 255, 0.86);
  --text: #1d1d1f;
  --muted: #6e6e73;
  --soft: #86868b;
  --line: rgba(0, 0, 0, 0.12);
  --blue: #0071e3;
  --blue-hover: #0077ed;
  --danger: #b42318;
  --warning: #9a6500;
  --ok: #16794c;
  --radius-sm: 14px;
  --radius-md: 22px;
  --radius-lg: 30px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
  --font: "SF Pro SC", "SF Pro Text", "SF Pro Icons", "PingFang SC", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font: 17px/25px var(--font);
  letter-spacing: 0;
}

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

button {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

button:disabled {
  cursor: default;
}

input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  outline: none;
}

input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.12);
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  line-height: 18px;
}

.hidden {
  display: none !important;
}

.app-shell {
  min-height: 100vh;
}

.mini-nav,
.topbar {
  min-height: 44px;
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 28px;
  background: rgba(251, 251, 253, 0.78);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  backdrop-filter: saturate(180%) blur(18px);
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.brand-logo {
  width: 24px;
  height: 24px;
  display: block;
  border-radius: 6px;
  flex: 0 0 auto;
}

.nav-link {
  color: var(--blue);
  font-size: 13px;
  min-height: 32px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.user-chip {
  color: var(--muted);
  font-size: 13px;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-page {
  min-height: 100vh;
  background: var(--page);
}

.auth-page.has-photo-background {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: #1d1d1f;
  color: #fff;
}

.auth-page.has-photo-background::before,
.auth-page.has-photo-background::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.auth-page.has-photo-background::before {
  z-index: -2;
  background-image: var(--auth-bg-image);
  background-size: cover;
  background-position: center;
  transform: scale(1.02);
}

.auth-page.has-photo-background::after {
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.72) 0%, rgba(0, 0, 0, 0.4) 45%, rgba(0, 0, 0, 0.18) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.04) 46%, rgba(0, 0, 0, 0.48) 100%);
}

.auth-page.has-photo-background .mini-nav {
  color: #fff;
  background: rgba(0, 0, 0, 0.18);
  border-bottom-color: rgba(255, 255, 255, 0.18);
}

.auth-page.has-photo-background .nav-link {
  color: #f5f5f7;
}

.auth-page.has-photo-background .auth-copy .eyebrow,
.auth-page.has-photo-background .hero-copy {
  color: rgba(255, 255, 255, 0.82);
  text-shadow: 0 1px 16px rgba(0, 0, 0, 0.36);
}

.auth-page.has-photo-background .auth-copy h1 {
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.44);
}

.auth-page.has-photo-background .auth-card {
  color: var(--text);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: saturate(180%) blur(22px);
}

.auth-page.has-photo-background .auth-card h2 {
  color: var(--text);
  text-shadow: none;
}

.auth-hero {
  min-height: calc(100vh - 44px);
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  align-items: center;
  gap: 56px;
  padding: 70px 0;
}

.background-credit {
  grid-column: 1 / -1;
  align-self: end;
  width: fit-content;
  max-width: min(680px, 100%);
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  border-radius: 980px;
  padding: 0 12px;
  color: rgba(255, 255, 255, 0.78);
  background: rgba(0, 0, 0, 0.22);
  text-decoration: none;
  font-size: 12px;
  line-height: 16px;
  backdrop-filter: blur(18px);
}

.background-credit:hover {
  color: #fff;
}

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

.eyebrow,
.caption {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
}

.auth-copy h1,
.hero-band h1 {
  margin: 0;
  max-width: 790px;
  font-size: clamp(44px, 7vw, 86px);
  line-height: 1.04;
  font-weight: 700;
}

.hero-copy {
  margin: 0;
  max-width: 560px;
  color: var(--muted);
  font-size: 21px;
  line-height: 29px;
}

.auth-card,
.glass-panel {
  background: var(--surface-elevated);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.auth-card {
  display: grid;
  gap: 18px;
  padding: 28px;
}

.auth-card h2 {
  margin: 0 0 4px;
  font-size: 28px;
  line-height: 34px;
}

.pill,
.primary.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border-radius: 980px;
  padding: 0 18px;
  background: #e8e8ed;
  color: var(--text);
  font-size: 14px;
  white-space: nowrap;
}

.primary.pill {
  min-height: 44px;
  background: var(--blue);
  color: #fff;
}

.primary.pill:hover,
.pill:hover {
  background: var(--blue-hover);
  color: #fff;
}

.pill.danger {
  color: var(--danger);
  background: #fff0ee;
}

.subtle {
  color: var(--blue);
  background: transparent;
}

.wide {
  width: 100%;
}

.dashboard {
  width: min(1380px, calc(100% - 36px));
  margin: 0 auto;
  padding: 42px 0 56px;
}

.hero-band {
  min-height: 420px;
  display: grid;
  align-content: center;
  gap: 18px;
  padding: 48px;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  max-width: 780px;
  margin-top: 20px;
}

.hero-stats div,
.metric-grid div {
  min-height: 82px;
  padding: 16px;
  border-radius: var(--radius-sm);
  background: #f5f5f7;
}

.hero-stats span,
.metric-grid span,
.file-row span,
.browser-row span:not(.browser-name):not(.file-glyph) {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 18px;
}

.hero-stats strong,
.metric-grid strong {
  display: block;
  margin-top: 6px;
  font-size: 24px;
  line-height: 30px;
}

.ok {
  color: var(--ok);
}

.warn {
  color: var(--warning);
}

.danger,
.error {
  color: var(--danger);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 22px;
  margin-top: 22px;
}

.side-stack,
.main-stack {
  display: grid;
  align-content: start;
  gap: 22px;
}

.glass-panel {
  padding: 22px;
  display: grid;
  gap: 18px;
  overflow: hidden;
}

.wide-panel {
  min-height: 360px;
}

.panel-heading {
  min-height: 44px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

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

.panel-heading h2 {
  margin: 3px 0 0;
  font-size: 24px;
  line-height: 30px;
}

.status-dot {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 980px;
  padding: 0 11px;
  color: var(--muted);
  background: #f5f5f7;
  font-size: 12px;
  line-height: 16px;
}

.path-display,
.command {
  display: block;
  margin: 0;
  padding: 14px;
  border-radius: var(--radius-sm);
  background: #f5f5f7;
  color: var(--text);
  overflow-wrap: anywhere;
  overflow-x: auto;
  font: 13px/20px ui-monospace, SFMono-Regular, Menlo, monospace;
}

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

.path-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.volume-list,
.root-list,
.file-list,
.user-list,
.browser-list {
  display: grid;
  gap: 8px;
}

.volume-row,
.root-row,
.file-row,
.user-row,
.browser-row {
  width: 100%;
  min-height: 56px;
  display: grid;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: #f5f5f7;
}

.volume-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.root-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.root-row strong {
  display: block;
  margin-bottom: 3px;
  font-size: 14px;
  line-height: 20px;
  overflow-wrap: anywhere;
}

.root-row span:not(.status-dot) {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 17px;
  overflow-wrap: anywhere;
}

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

.file-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.file-row strong {
  display: block;
  margin-bottom: 4px;
  font-size: 15px;
  line-height: 21px;
  overflow-wrap: anywhere;
}

.file-actions,
.browser-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-row {
  grid-template-columns: minmax(0, 1.25fr) auto 90px 110px minmax(140px, 0.8fr);
}

.user-row strong {
  display: block;
  margin-bottom: 3px;
  font-size: 15px;
  line-height: 21px;
  overflow-wrap: anywhere;
}

.user-row span:not(.role-badge) {
  color: var(--muted);
  font-size: 13px;
  line-height: 18px;
}

.user-email {
  display: block;
  overflow-wrap: anywhere;
}

.role-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  border-radius: 980px;
  padding: 0 11px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  line-height: 16px;
  white-space: nowrap;
}

.browser-row {
  grid-template-columns: 28px minmax(0, 1fr) 110px 190px auto;
  text-align: left;
}

.browser-row.directory:hover {
  background: #e8e8ed;
}

.browser-row .pill,
.browser-actions {
  justify-self: end;
}

.file-glyph {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: var(--blue);
  font-size: 16px;
}

.file-glyph.file {
  color: var(--muted);
}

.browser-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.breadcrumb {
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
}

.breadcrumb button {
  color: var(--blue);
  font-size: 14px;
}

.upload-zone {
  min-height: 116px;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(0, 0, 0, 0.22);
  border-radius: var(--radius-md);
  background: #f5f5f7;
  padding: 20px;
}

.inline-upload {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.message,
.empty {
  color: var(--muted);
  font-size: 14px;
  line-height: 20px;
}

.empty {
  min-height: 120px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-md);
  background: #f5f5f7;
  text-align: center;
  padding: 20px;
}

.empty.compact {
  min-height: 72px;
}

.message.ok {
  color: var(--ok);
}

.message.error {
  color: var(--danger);
}

@media (max-width: 980px) {
  .auth-hero,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .auth-hero {
    gap: 28px;
    align-items: start;
    padding: 44px 0;
  }

  .hero-band {
    min-height: 0;
  }

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

@media (max-width: 720px) {
  body {
    font-size: 16px;
    line-height: 24px;
  }

  .mini-nav,
  .topbar {
    min-height: 48px;
    padding: 0 16px;
  }

  .top-actions {
    gap: 10px;
  }

  .user-chip {
    display: none;
  }

  .auth-hero,
  .dashboard {
    width: min(100% - 24px, 100%);
  }

  .auth-copy h1,
  .hero-band h1 {
    font-size: 42px;
  }

  .hero-copy {
    font-size: 19px;
    line-height: 27px;
  }

  .hero-band,
  .auth-card,
  .glass-panel {
    border-radius: 22px;
    padding: 20px;
  }

  .hero-stats,
  .side-stack,
  .metric-grid,
  .path-form,
  .inline-upload,
  .root-row,
  .user-row,
  .file-row {
    grid-template-columns: 1fr;
  }

  .root-actions {
    justify-content: flex-start;
  }

  .panel-actions {
    justify-content: flex-start;
  }

  .browser-row {
    grid-template-columns: 28px minmax(0, 1fr) auto;
  }

  .browser-row span:not(.browser-name):not(.file-glyph) {
    display: none;
  }

  .file-actions,
  .browser-actions {
    justify-content: flex-start;
  }
}
