/* ============ Design tokens ============ */
:root {
  /* SciVida brand colours (Brand Guidelines/scivida.com...json) */
  --sv-navy: #03324A;      /* primary */
  --sv-blue: #014D73;      /* theme colour */
  --sv-green: #248E24;     /* accent / buttons / links */
  --sv-green-dark: #1C711C;

  --bg: #f3f6f8;
  --surface: #ffffff;
  --surface-2: #eef3f6;
  --text: #03324A;
  --text-2: #2b4a5c;
  --muted: #5d7584;
  --border: #dde6ec;
  --border-strong: #c3d1da;
  --brand: #248E24;
  --brand-2: #014D73;
  --brand-ink: #ffffff;
  --brand-soft: #e8f4e8;
  --header-bg: #03324A;
  --ok: #16a34a;
  --ok-soft: #e8f7ee;
  --err: #dc2626;
  --err-soft: #fdecec;
  --warn: #b45309;
  --track: #e6eaf2;
  --ring: rgba(36, 142, 36, .28);
  --shadow-sm: 0 1px 2px rgba(3, 50, 74, .06);
  --shadow: 0 1px 3px rgba(3, 50, 74, .06), 0 8px 24px rgba(3, 50, 74, .06);
  --shadow-lg: 0 20px 50px rgba(3, 50, 74, .14);
  --radius: 14px;
  --radius-sm: 10px;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Roboto, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #01192a;
    --surface: #062a3e;
    --surface-2: #0a3449;
    --text: #e6eef3;
    --text-2: #bfd0da;
    --muted: #8aa3b2;
    --border: #12405a;
    --border-strong: #1d5574;
    --brand: #4cb84c;
    --brand-2: #3a93c2;
    --brand-ink: #01192a;
    --brand-soft: #0f3a2a;
    --header-bg: #02263a;
    --ok: #4ade80;
    --ok-soft: #12301f;
    --err: #f87171;
    --err-soft: #3a1717;
    --warn: #fbbf24;
    --track: #12405a;
    --ring: rgba(76, 184, 76, .35);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow: 0 1px 3px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, .45);
  }
}

/* ============ Base ============ */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}
h1, h2 { margin: 0; letter-spacing: -.01em; }
button { font: inherit; color: inherit; }

.ic {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }

/* ============ Brand ============ */
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; letter-spacing: -.01em; }
/* The SciVida logo is a white wordmark, so it always sits on navy. */
.brand-logo { display: block; height: 32px; width: auto; }
.brand-sep { width: 1px; height: 24px; background: rgba(255, 255, 255, .35); }
.brand-name { font-size: 16px; color: #fff; font-weight: 600; letter-spacing: .01em; }

/* ============ Buttons ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .05s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  color: #fff;
  background: var(--sv-green);
  border-color: var(--sv-green);
  box-shadow: 0 8px 24px rgba(12, 83, 12, .25);
}
.btn-primary:hover { background: var(--sv-green-dark); border-color: var(--sv-green-dark); }
.btn-secondary { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.btn-secondary:hover { border-color: var(--brand); color: var(--brand); }
.btn-ghost { background: transparent; color: var(--text-2); padding: 8px 12px; }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-link { background: none; border: 0; padding: 4px 6px; color: var(--brand); font-weight: 600; font-size: 13px; }
.btn-link:hover { text-decoration: underline; }
.btn-block { width: 100%; padding: 12px 18px; font-size: 15px; }

.spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, .45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.btn.loading .spinner { display: inline-block; }
.btn.loading { cursor: wait; opacity: .9; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ Sign-in page ============ */
.auth {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  min-height: 100vh;
  animation: fade .35s ease;
}

.auth-brand {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
  padding: 48px 56px;
  color: #fff;
  background:
    radial-gradient(600px 400px at 0% 0%, rgba(1, 77, 115, .9), transparent 65%),
    radial-gradient(700px 500px at 100% 100%, rgba(36, 142, 36, .45), transparent 60%),
    linear-gradient(150deg, #03324A, #02283b 55%, #03324A);
}
.auth-brand::before {   /* faint grid texture */
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .06) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: radial-gradient(ellipse at 30% 40%, #000 30%, transparent 75%);
  pointer-events: none;
}
.auth-brand > * { position: relative; }
.auth-brand .brand-logo { height: 38px; }

.auth-pitch { max-width: 480px; margin-block: auto; }   /* centred in the space below the logo */
.auth-pitch h1 { font-size: 36px; line-height: 1.15; font-weight: 700; }
.auth-pitch > p { margin: 14px 0 32px; font-size: 16px; color: rgba(255, 255, 255, .82); }

.features { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.features li { display: flex; gap: 14px; align-items: flex-start; }
.features strong { display: block; font-size: 15px; }
.features span { font-size: 14px; color: rgba(255, 255, 255, .75); }
.feat-ic {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, .12);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2);
}
.feat-ic .ic { width: 18px; height: 18px; color: #7fd07f; }

.auth-main { display: grid; place-items: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h2 { font-size: 26px; font-weight: 700; }
.auth-card .sub { margin: 6px 0 26px; color: var(--muted); }
.brand-compact { display: none; margin-bottom: 28px; padding: 12px 16px; border-radius: var(--radius-sm); background: var(--sv-navy); width: max-content; }
.brand-compact .brand-logo { height: 26px; }

.field { display: block; margin-bottom: 18px; }
.field-label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s;
}
.input-wrap > .ic { position: absolute; left: 13px; color: var(--muted); pointer-events: none; }
.input-wrap:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--ring); }
.input-wrap:focus-within > .ic { color: var(--brand); }
.input-wrap input {
  flex: 1;
  min-width: 0;
  padding: 12px 14px 12px 42px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 15px;
}
.pw-toggle {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-right: 2px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--muted);
  cursor: pointer;
}
.pw-toggle:hover { color: var(--text); background: var(--surface-2); }
.hint { display: block; margin-top: 6px; font-size: 12px; font-weight: 600; color: var(--warn); }

.alert {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 18px;
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  background: var(--err-soft);
  color: var(--err);
  font-size: 14px;
  font-weight: 500;
  animation: shake .3s ease;
}
.alert .ic { margin-top: 1px; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

.secure-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 20px 0 0;
  font-size: 12.5px;
  color: var(--muted);
}
.secure-note .ic { width: 14px; height: 14px; }

/* ============ App shell ============ */
.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(900px 340px at 50% -120px, color-mix(in srgb, var(--brand) 14%, transparent), transparent 70%),
    var(--bg);
  animation: fade .35s ease;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--header-bg);
  color: #fff;
  border-bottom: 3px solid var(--sv-green);
}
.topbar .user-chip { background: rgba(255, 255, 255, .1); color: #fff; }
.topbar .btn-ghost { color: rgba(255, 255, 255, .82); }
.topbar .btn-ghost:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.topbar-inner {
  max-width: none;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.account { display: flex; align-items: center; gap: 6px; }
.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 12px 4px 4px;
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 14px;
  font-weight: 600;
  max-width: 220px;
}
.user-chip #userName { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 50%;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
  background: var(--sv-green);
}

.container { width: 100%; max-width: none; margin: 0 auto; padding: 36px 32px 24px; flex: 1; }

/* Two columns once signed in: uploads on the left, bucket browser on the right. */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) clamp(360px, 30vw, 620px); gap: 24px; align-items: start; }
.col-main { min-width: 0; }
.col-side { position: sticky; top: 84px; min-width: 0; }

.hero { margin-bottom: 22px; }
.hero h1 { font-size: 28px; font-weight: 700; }
.hero p { margin: 6px 0 0; color: var(--muted); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ============ Drop zone ============ */
.dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 44px 24px 36px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 2px dashed var(--border-strong);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.dropzone:hover { border-color: color-mix(in srgb, var(--brand) 55%, var(--border-strong)); }
.dropzone h2 { margin-top: 18px; font-size: 19px; font-weight: 650; }
.dropzone > p { margin: 4px 0 0; color: var(--muted); }
.drop-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 18px;
  color: var(--brand);
  background: var(--brand-soft);
  transition: transform .25s;
}
.drop-icon .ic { width: 30px; height: 30px; }
.dropzone:hover .drop-icon { transform: translateY(-3px); }
.drop-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 22px; }
.drop-hint { margin-top: 18px !important; font-size: 13px; }

.drop-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: calc(var(--radius) - 2px);
  background: color-mix(in srgb, var(--brand) 10%, var(--surface));
  color: var(--brand);
  font-size: 18px;
  font-weight: 650;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s;
}
.drop-overlay .ic { width: 26px; height: 26px; }
.dropzone.over { border-color: var(--brand); transform: scale(1.01); box-shadow: 0 0 0 6px var(--ring), var(--shadow-lg); }
.dropzone.over .drop-overlay { opacity: 1; }

/* ============ Notice ============ */
.notice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 22px;
  margin: 14px 0;
  font-size: 13.5px;
  color: var(--muted);
}
.notice:empty { margin: 8px 0; }
.notice.busy::before {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid var(--track);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

/* ============ Summary (overall progress) ============ */
.summary {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 18px 22px;
  margin-bottom: 18px;
  animation: rise .3s ease;
}
.ring {
  --p: 0;
  --c: var(--brand);
  position: relative;
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  flex: none;
  border-radius: 50%;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--track) 0);
}
.ring::before { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: var(--surface); }
.ring span { position: relative; font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.summary.done .ring { --c: var(--ok); }
.summary.failed .ring { --c: var(--err); }
.summary-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.summary-text strong { font-size: 16px; }
.summary-text span { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }

/* ============ Upload list ============ */
.uploads { padding: 6px 0 4px; }
.section-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 22px 8px; }
.section-head h2 { font-size: 15px; font-weight: 650; }

#list { list-style: none; margin: 0; padding: 0; }
.item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  animation: rise .25s ease;
}

.ft {   /* file-type badge */
  --c: #64748b;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 11px;
  color: var(--c);
  background: color-mix(in srgb, var(--c) 13%, transparent);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .03em;
}
.ft .ic { width: 20px; height: 20px; }
.ft-folder  { --c: var(--brand-2); }
.ft-image   { --c: #db2777; }
.ft-video   { --c: #7c3aed; }
.ft-audio   { --c: #0891b2; }
.ft-pdf     { --c: #dc2626; }
.ft-sheet   { --c: #16a34a; }
.ft-doc     { --c: #2563eb; }
.ft-slides  { --c: #ea580c; }
.ft-archive { --c: #a16207; }
.ft-code    { --c: #475569; }
@media (prefers-color-scheme: dark) {
  .ft-sheet { --c: #4ade80; } .ft-doc { --c: #60a5fa; } .ft-pdf { --c: #f87171; } .ft-code { --c: #94a3b8; }
  .ft-image { --c: #f472b6; } .ft-video { --c: #a78bfa; } .ft-audio { --c: #22d3ee; } .ft-archive { --c: #fbbf24; }
  .ft-slides { --c: #fb923c; }
}

.item-body { flex: 1; min-width: 0; }
.item-head { display: flex; align-items: center; gap: 10px; }
.name { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: none;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  background: var(--surface-2);
  color: var(--muted);
}
.pill .ic { width: 12px; height: 12px; stroke-width: 3; }
.is-active .pill    { background: var(--brand-soft); color: var(--brand); }
.is-done .pill      { background: var(--ok-soft); color: var(--ok); }
.is-failed .pill    { background: var(--err-soft); color: var(--err); }

.bar { height: 6px; margin: 9px 0 7px; border-radius: 999px; background: var(--track); overflow: hidden; }
.bar > div {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  transition: width .25s ease;
}
.is-active .bar > div {   /* moving sheen while uploading */
  background-image:
    linear-gradient(90deg, transparent, rgba(255, 255, 255, .35), transparent),
    linear-gradient(90deg, var(--brand), var(--brand-2));
  background-size: 200px 100%, 100% 100%;
  background-repeat: no-repeat;
  animation: sheen 1.4s linear infinite;
}
.is-done .bar > div { background: var(--ok); }
.is-failed .bar > div { background: var(--err); }
.is-cancelled .bar > div { background: var(--border-strong); }
@keyframes sheen { from { background-position: -200px 0, 0 0; } to { background-position: calc(100% + 200px) 0, 0 0; } }

.item-meta { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.item-meta .status { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.is-failed .status { color: var(--err); }
.item-meta .size { flex: none; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  border: 0;
  border-radius: 9px;
  background: none;
  color: var(--muted);
  cursor: pointer;
}
.icon-btn:hover { background: var(--err-soft); color: var(--err); }
.icon-btn:disabled { visibility: hidden; }

.errs { margin-top: 8px; font-size: 13px; }
.errs summary { cursor: pointer; color: var(--err); font-weight: 600; }
.errs ul { margin: 6px 0 0; padding: 10px 12px 10px 28px; border-radius: 8px; background: var(--err-soft); color: var(--text-2); overflow-wrap: anywhere; }

.empty { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 30px 22px 34px; text-align: center; color: var(--muted); border-top: 1px solid var(--border); }
.empty .ic { width: 34px; height: 34px; stroke-width: 1.5; margin-bottom: 6px; color: var(--border-strong); }
.empty strong { color: var(--text-2); font-size: 15px; }
.empty span { font-size: 13.5px; }

/* ============ Files in bucket (right panel) ============ */
/* Fills the screen height beside the uploads; the list scrolls inside it. */
.files { display: flex; flex-direction: column; height: calc(100vh - 136px); min-height: 420px; }
.files-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 18px 10px; }
.files-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.files-title > div { min-width: 0; }
.files-title h2 { font-size: 15px; font-weight: 650; }
.files-ic {
  display: grid; place-items: center; width: 36px; height: 36px; flex: none;
  border-radius: 10px; color: var(--brand-2); background: color-mix(in srgb, var(--brand-2) 12%, transparent);
}
.bucket-name { display: block; font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn-plain:hover { background: var(--surface-2); color: var(--brand); }
.icon-btn-plain.spinning .ic { animation: spin .8s linear infinite; }

.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 0 14px 10px; font-size: 13px; }
.crumbs button { border: 0; background: none; padding: 3px 6px; border-radius: 6px; color: var(--brand); font-weight: 600; cursor: pointer; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crumbs button:hover { background: var(--brand-soft); }
.crumbs button[aria-current] { color: var(--text); cursor: default; background: none; }
.crumbs .ic { width: 13px; height: 13px; color: var(--muted); }

.files-filter {
  position: relative; display: flex; align-items: center; margin: 0 18px 10px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface);
}
.files-filter:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--ring); }
.files-filter .ic { position: absolute; left: 11px; width: 15px; height: 15px; color: var(--muted); pointer-events: none; }
.files-filter input { flex: 1; min-width: 0; padding: 8px 10px 8px 34px; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: 13.5px; }

.file-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; border-top: 1px solid var(--border); }
.file-row { display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 18px; border: 0; border-bottom: 1px solid var(--border); background: none; color: inherit; text-align: left; font: inherit; }
button.file-row { cursor: pointer; }
button.file-row:hover { background: var(--surface-2); }
.file-row .ft { width: 34px; height: 34px; border-radius: 9px; font-size: 9.5px; }
.file-row .ft .ic { width: 17px; height: 17px; }
.file-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.file-name { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.file-row > .ic { width: 15px; height: 15px; color: var(--muted); }

.files-state { padding: 26px 18px; text-align: center; font-size: 13.5px; color: var(--muted); }
.files-state:empty { display: none; }
.files-state.error { color: var(--err); }
.files-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 18px 11px; font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--border); }

/* ============ Upload confirmation dialog ============ */
.modal {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
}
.modal[open] { animation: rise .2s ease; }
.modal::backdrop { background: rgba(1, 25, 42, .55); backdrop-filter: blur(2px); }
.modal-body { display: flex; flex-direction: column; gap: 16px; margin: 0; padding: 22px 24px 20px; }
.modal-head { display: flex; gap: 14px; align-items: center; }
.modal-head h2 { font-size: 18px; font-weight: 700; }
.modal-ic { display: grid; place-items: center; width: 42px; height: 42px; flex: none; border-radius: 12px; color: var(--brand); background: var(--brand-soft); }
.modal-sub { margin: 2px 0 0; color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }

.dest { display: grid; gap: 6px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); }
.dest-row { display: flex; gap: 12px; font-size: 14px; min-width: 0; }
.dest-row span { flex: none; width: 56px; color: var(--muted); }
.dest-row strong { min-width: 0; font-weight: 650; overflow-wrap: anywhere; }

.cf-block { display: grid; gap: 8px; padding: 12px 14px; border-radius: var(--radius-sm); font-size: 14px; }
.cf-warn { background: color-mix(in srgb, var(--warn) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); }
.cf-err { background: var(--err-soft); border: 1px solid color-mix(in srgb, var(--err) 30%, transparent); }
.cf-title { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 650; }
.cf-warn .cf-title .ic { color: var(--warn); }
.cf-err .cf-title .ic { color: var(--err); }
.cf-title .ic { width: 16px; height: 16px; }
.cf-list { margin: 0; padding-left: 22px; max-height: 120px; overflow-y: auto; color: var(--text-2); font-size: 13px; overflow-wrap: anywhere; }
.cf-list .more { list-style: none; margin-left: -22px; color: var(--muted); }

.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 2px; }
.choice-opt { display: flex; gap: 9px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; }
.choice-opt:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 3px var(--ring); }
.choice-opt input { margin: 3px 0 0; accent-color: var(--brand); }
.choice-opt strong { display: block; font-size: 14px; }
.choice-opt small { display: block; color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }

.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }
@media (max-width: 600px) {
  .choice { grid-template-columns: 1fr; }
  .modal-actions .btn { flex: 1; }
}

/* ============ Footer ============ */
.foot { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 22px 24px 30px; font-size: 13px; color: var(--muted); text-align: center; }
.foot .ic { width: 15px; height: 15px; }

/* ============ Motion ============ */
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ============ Small screens ============ */
@media (max-width: 1100px) {
  .layout { grid-template-columns: 1fr; }
  .col-side { position: static; }
  .files { height: 640px; }
}
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .brand-compact { display: flex; }
  .auth-main { align-items: start; padding-top: 12vh; }
}
@media (max-width: 600px) {
  .topbar-inner { padding: 10px 16px; }
  .brand-name { font-size: 15px; }
  .topbar .brand-name, .topbar .brand-sep { display: none; }
  .topbar .brand-logo { height: 26px; }
  .btn-ghost span { display: none; }
  .container { padding: 24px 16px 16px; }
  .hero h1 { font-size: 23px; }
  .dropzone { padding: 32px 16px 28px; }
  .drop-actions { width: 100%; }
  .drop-actions .btn { flex: 1 1 100%; }
  .summary { padding: 16px; gap: 14px; }
  .ring { width: 58px; height: 58px; }
  .section-head, .item { padding-left: 16px; padding-right: 16px; }
  .item { gap: 12px; }
  .ft { width: 38px; height: 38px; }
}
