@font-face {
  font-family: "Love";
  src: url("/css/Love-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Love";
  src: url("/css/Love-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #0d1014;
  --bg-soft: #151a20;
  --panel: #1c2229;
  --panel-strong: #252c34;
  --border: #343d47;
  --border-soft: rgba(255, 255, 255, 0.08);
  --text: #f4f6f8;
  --muted: #a7b0ba;
  --faint: #76818d;
  --hold: #71227e;
  --secure: #3e71e2;
  --secure-strong: #5c8df0;
  --lockdown: #f10703;
  --evacuate: #238200;
  --shelter: #f27303;
  --reunify: #da01b7;
  --danger: #f27303;
  --shadow: rgba(0, 0, 0, 0.36);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background: #000;
  color: var(--text);
  font-family: "Love Light", "Love", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.35;
  letter-spacing: 0;
  overflow-x: hidden;
}

a {
  color: #8cc5f0;
  text-decoration: none;
}

a:hover {
  color: #c2e5ff;
  text-decoration: underline;
}

.shell {
  width: min(1280px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 18px 0 24px;
}

.brand-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 64px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border-soft);
}

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

.brand-mark img {
  width: 142px;
  max-width: 42vw;
  height: auto;
  flex: 0 0 auto;
}

.workspace-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  min-height: 64px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(90deg, rgba(62, 113, 226, 0.14), rgba(21, 26, 32, 0));
}

.eyebrow {
  margin-bottom: 7px;
  color: var(--text);
  font-family: "Love Bold", "Love", system-ui, sans-serif;
  font-size: 18px;
  line-height: 1;
}

.workspace-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 4px;
  color: #fff;
  font-size: 12px;
  white-space: nowrap;
}

.account {
  display: flex;
  gap: 12px;
  align-items: center;
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}

.account a,
.login-link {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

#breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 10px;
  color: var(--faint);
  font-size: 14px;
}

#breadcrumbs a {
  color: var(--muted);
}

.file-panel {
  min-height: calc(100vh - 112px);
  background: rgba(28, 34, 41, 0.94);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 24px 60px var(--shadow);
}

.file-panel.dragging {
  outline: 3px solid rgba(47, 128, 189, 0.38);
  background: rgba(35, 104, 155, 0.16);
}

.toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 56px;
  padding: 10px;
  border-bottom: 1px solid var(--border);
  background: rgba(17, 22, 28, 0.72);
  flex-wrap: wrap;
}

button,
.upload-button,
input[type="search"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--panel-strong);
  color: var(--text);
  font: inherit;
}

button,
.upload-button {
  cursor: pointer;
}

input[type="search"] {
  width: min(320px, 100%);
  justify-content: flex-start;
  color: var(--text);
  outline: none;
}

input[type="search"]::placeholder {
  color: var(--faint);
}

input[type="search"]:focus {
  border-color: var(--secure-strong);
  box-shadow: 0 0 0 3px rgba(62, 113, 226, 0.18);
}

button:hover,
.upload-button:hover {
  border-color: var(--secure-strong);
  background: #2a333d;
}

.upload-button {
  background: var(--secure);
  border-color: var(--secure);
  color: #fff;
  font-family: "Love Bold", "Love", system-ui, sans-serif;
}

.upload-button input {
  display: none;
}

#upload-mode {
  margin-left: auto;
  color: var(--muted);
  font-size: 13px;
}

.toolbar-stat {
  color: var(--muted);
  font-size: 13px;
}

.storage-summary {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--muted);
  font-size: 13px;
  background: rgba(255, 255, 255, 0.025);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-soft);
  text-align: left;
  font-size: 14px;
}

th:last-child,
td:last-child {
  text-align: right;
}

th {
  color: #c7d1dc;
  font-family: "Love Bold", "Love", system-ui, sans-serif;
  background: rgba(255, 255, 255, 0.035);
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.045);
}

tbody tr.drop-target {
  background: rgba(35, 130, 0, 0.22);
  outline: 2px solid rgba(35, 130, 0, 0.7);
  outline-offset: -2px;
}

td.size,
td.date,
td.storage {
  white-space: nowrap;
  color: var(--muted);
}

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

.name-cell a,
.name-cell button {
  overflow-wrap: anywhere;
  text-align: left;
}

.name-cell button {
  border: 0;
  padding: 0;
  min-height: 0;
  background: transparent;
  color: #a9d8fb;
  font-family: "Love Regular", "Love", system-ui, sans-serif;
}

.item-icon {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #11161c;
  position: relative;
}

.item-icon::before {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
}

.item-icon.folder {
  background: rgba(35, 130, 0, 0.18);
  border-color: rgba(35, 130, 0, 0.5);
}

.item-icon.folder::before {
  content: "/";
  color: #9de280;
}

.item-icon.file::before {
  content: "F";
  color: #a9d8fb;
}

.badge {
  display: inline-flex;
  min-width: 56px;
  justify-content: center;
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  color: #d7dee6;
  font-size: 12px;
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  white-space: nowrap;
}

.table-action,
.detail-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  text-decoration: none;
}

.table-action:hover,
.detail-button:hover {
  border-color: var(--secure-strong);
  background: rgba(62, 113, 226, 0.16);
  text-decoration: none;
}

#empty-state {
  padding: 44px;
  color: var(--muted);
  text-align: center;
}

#progress-panel {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: min(380px, calc(100vw - 48px));
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #11161c;
  box-shadow: 0 18px 38px var(--shadow);
}

#progress-label {
  margin-bottom: 10px;
  color: var(--text);
}

#progress-list {
  display: grid;
  gap: 10px;
}

.progress-row {
  display: grid;
  gap: 6px;
}

.progress-copy {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.progress-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

progress {
  width: 100%;
  height: 16px;
  accent-color: var(--secure-strong);
}

.detail-drawer {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  justify-content: flex-end;
  background: rgba(0, 0, 0, 0.42);
}

.detail-drawer[hidden] {
  display: none;
}

.detail-card {
  width: min(420px, 100vw);
  min-height: 100vh;
  padding: 24px;
  background: #11161c;
  border-left: 1px solid var(--border);
  box-shadow: -18px 0 38px rgba(0, 0, 0, 0.38);
  overflow-y: auto;
}

.maintenance-card {
  width: min(720px, 100vw);
}

.icon-button {
  float: right;
  min-height: 30px;
  padding: 0 10px;
}

.detail-card h2 {
  clear: both;
  margin: 10px 0 20px;
  font-family: "Love Bold", "Love", system-ui, sans-serif;
  font-size: 28px;
  line-height: 1;
  overflow-wrap: anywhere;
}

.detail-card dl {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 10px 14px;
  margin: 0;
}

.detail-card dt {
  color: var(--faint);
}

.detail-card dd {
  margin: 0;
  color: var(--text);
  overflow-wrap: anywhere;
}

.detail-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.maintenance-content {
  display: grid;
  gap: 10px;
}

.maintenance-list {
  display: grid;
  gap: 8px;
}

.maintenance-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.035);
}

.maintenance-row strong,
.maintenance-row small {
  display: block;
  overflow-wrap: anywhere;
}

.maintenance-row small,
.empty-maintenance {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(28px, 7vh, 72px) 16px;
}

.login-shell {
  width: min(600px, calc(100vw - 32px));
  margin: 56px auto;
  padding: 28px;
  background: rgba(28, 34, 41, 0.96);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 24px 60px var(--shadow);
}

.login-page .login-shell {
  margin: 0;
}

.login-logo {
  width: 176px;
  max-width: 70vw;
  margin-bottom: 26px;
}

.login-shell h1 {
  margin: 0 0 8px;
  font-size: clamp(32px, 8vw, 52px);
  font-family: "Love Bold", "Love", system-ui, sans-serif;
  line-height: 0.95;
}

.login-shell p {
  color: var(--muted);
  line-height: 1.45;
}

#clerk-sign-in {
  margin-top: 20px;
}

.auth-shell {
  width: min(740px, calc(100vw - 32px));
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.auth-shell .login-logo {
  display: block;
  width: 210px;
  margin: 0 auto 10px;
}

.auth-shell .login-subtitle {
  width: min(520px, 100%);
  margin: 0 auto 24px;
  color: #c3cbd5;
  font-size: 16px;
  line-height: 1.45;
  text-align: center;
}

.auth-shell #clerk-sign-in {
  display: grid;
  place-items: center;
  width: 100%;
  margin-top: 0;
}

.auth-shell #clerk-sign-in > *,
.auth-shell .cl-rootBox,
.auth-shell .cl-cardBox {
  margin-right: auto !important;
  margin-left: auto !important;
}

.status-band {
  height: 8px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
}

.status-band span:nth-child(1) {
  background: var(--hold);
}

.status-band span:nth-child(2) {
  background: var(--secure);
}

.status-band span:nth-child(3) {
  background: var(--evacuate);
}

.status-band span:nth-child(4) {
  background: var(--reunify);
}

@media (max-width: 720px) {
  .shell {
    width: min(100vw - 20px, 1220px);
    padding-top: 12px;
  }

  .brand-bar,
  .workspace-header {
    display: block;
  }

  .workspace-status {
    margin-top: 10px;
  }

  .account {
    margin-top: 14px;
  }

  #upload-mode {
    width: 100%;
    margin-left: 0;
  }

  th:nth-child(3),
  td:nth-child(3),
  th:nth-child(4),
  td:nth-child(4) {
    display: none;
  }

  .storage-summary {
    display: block;
  }

  .row-actions {
    justify-content: flex-start;
    margin-top: 6px;
  }

  th:last-child,
  td:last-child {
    text-align: left;
  }

  th,
  td {
    padding: 11px 10px;
  }
}
